{"similarity_score": 0.9855428259683578, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tINF = 12345\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tS := io.NextLine()\n\n\tA := []rune(S)\n\tN := len(A)\n\n\tbest := INF\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') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t\tif (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t}\n\t}\n\tif best < INF {\n\t\tio.Println(best)\n\t} else {\n\t\tio.Println(-1)\n\t}\n}\n\nfunc simulate(A []rune, front, back int) int {\n\tN := len(A)\n\n\tX := make([]rune, N)\n\tcopy(X, A)\n\n\tif back < front {\n\t\tfront--\n\t}\n\n\ta := swapTo(X, back, N - 1)\n\tb := swapTo(X, front, N - 2)\n\tc := fix(X)\n\n\treturn a + b + c\n}\n\nfunc swapTo(A []rune, i, j int) int {\n\tcnt := 0\n\tfor i + 1 <= j {\n\t\tA[i], A[i + 1] = A[i + 1], A[i]\n\t\tcnt++\n\t\ti++\n\t}\n\treturn cnt\n}\n\nfunc fix(A []rune) int {\n\tif A[0] != '0' {\n\t\treturn 0\n\t}\n\tfor i := 1; i < len(A) - 2; i++ {\n\t\tif A[i] != '0' {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn INF\n}\n\nfunc Min(args ...int) int {\n\tmin := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] < min {\n\t\t\tmin = args[i]\n\t\t}\n\t}\n\treturn min\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}", "lang": "Go", "bug_code_uid": "d145c28ece10b1eba1e9dfd114e8ab0b", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "dc3b96d67ae1e019d6ec878b24e27602", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9977973568281938, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var h1, m1, h2, m2 int\n fmt.Scanf(\"%d:%d\\n%d:%d\", &h1, &m1, &h2, &m2)\n \n t1, t2 := h1 * 60 + m1, h2 * 60 + m2\n t3 := t1 + (t2 - t1) / 2\n \n h3, m3 := t3 / 60, m3 % 60\n if h3 < 10 {\n fmt.Printf(\"0%d\", h3)\n } else {\n fmt.Printf(\"%d\", h3)\n }\n fmt.Printf(\":\")\n if m3 < 10 {\n fmt.Printf(\"0%d\", m3)\n } else {\n fmt.Printf(\"%d\", m3)\n }\n \n}", "lang": "Go", "bug_code_uid": "e1700e826f118bf4d53c184e03099068", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "ecc4f4a7ddc06e2460ce21ac9de90cfa", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.21456185567010308, "equal_cnt": 31, "replace_cnt": 27, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 31, "bug_source_code": "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\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\n\tstr1, _ := in.ReadString('\\n')\n\tstr2, _ := in.ReadString('\\n')\n\n\tstr1 = strings.Replace(str1, \"\\n\", \"\", -1)\n\tstr2 = strings.Replace(str2, \"\\n\", \"\", -1)\n\n\thh1mm1 := strings.Split(str1, \":\")\n\thh2mm2 := strings.Split(str2, \":\")\n\n\n\thh1, _ := strconv.ParseInt(hh1mm1[0], 10, 64)\n\tmm1, _ := strconv.ParseInt(hh1mm1[1], 10, 64)\n\n\thh2, _ := strconv.ParseInt(hh2mm2[0], 10, 64)\n\tmm2, _ := strconv.ParseInt(hh2mm2[1], 10, 64)\n\n\tif (hh1 == hh2) {\n\t\tfmt.Fprintf(out, \"%v:%v\\n\", hh1,(mm2-mm1)/2)\n\t} else if (hh2 > hh1) {\n\t\tmins := 60 - mm1\n\t\thh1New := hh1 + 1\n\t\tmins += (hh2 - hh1New) * 60\n\t\tmins += mm2\n\t\tmediana := mins / 2\n\n\t\tvar hhres, mmres int64\n\n\t\tif ((mm1 + mediana) < 60) {\n\t\t\tfmt.Fprintf(out, \"%02d:%02d\\n\", hh1, mm1 + mediana)\n\t\t} else {\n\t\t\thhres = hh1\n\t\t\tmediana = (mediana - (60 - mm1))\n\t\t\thhres += 1\n\t\t\tnumHh := mediana / 60\n\t\t\thhres += numHh\n\t\t\tmmres = mediana - numHh*60\n\t\t\tfmt.Fprintf(out, \"%02d:%02d\\n\", hhres, mmres)\n\t\t}\n\t}\n\tout.Flush()\n}\n", "lang": "Go", "bug_code_uid": "2399886a35e33cc2d448a9af0982802e", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "d398dc1427bf3055de57ded24a3736bb", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.996268656716418, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"os\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc max(a int, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tvar sh, sm, eh, em int\n\tFscanf(in, \"%d:%d\\n\", &sh, &sm)\n\tFscanf(in, \"%d:%d\", &eh, &em)\n\tminute := (eh-sh)*60 + em - sm\n\tminute /= 2\n\tsh += minute / 60\n\tsm += minute % 60\n\tif sm >= 60 {\n\t\tsh++\n\t\tsm -= 60\n\t}\n\tFprintf(out, \"%d:%d\", sh, sm)\n}\n", "lang": "Go", "bug_code_uid": "627bd3726496e66157f9f17448a277b9", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "be37308797483489f06e31c48ea3bef3", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5014577259475219, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, m int\n\tvar n1, m1 int\n\tfmt.Fscanf(reader, \"%d:%d\\n\", &n, &m)\n\tfmt.Fscanf(reader, \"%d:%d\\n\", &n1, &m1)\n\n\tvar mn, h int\n\tif m1 < m {\n\t\tmn = 60 + m1 - m\n\t\th--\n\t} else {\n\t\tmn = m1 - m\n\t}\n\n\tif n1 < n {\n\t\tn1 = 24 + n1\n\t}\n\n\th += (n1-n)*60 + mn\n\n\tmd := (h / 2) / 60\n\tmx := h/2 - md*60\n\n\tif n+md+1 < 10 {\n\t\tfmt.Print(0)\n\t}\n\n\tfmt.Println(mx, m)\n\tif mx+m >= 60 {\n\t\tdefer fmt.Println(mx + m - 60)\n\t\tfmt.Print(n+md+1, \":\")\n\t\tif mx+m-60 < 10 {\n\t\t\tfmt.Print(0)\n\t\t}\n\t} else {\n\t\tdefer fmt.Println(mx + m)\n\t\tfmt.Print(n+md, \":\")\n\t\tif mx+m < 10 {\n\t\t\tfmt.Print(0)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "75193c50a39af715490ed195ffafc0a6", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "1e4f3cc5a621adee097a65b072e40782", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9244604316546763, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar num string\n\tfmt.Scan(&num)\n\n\tfor _, v := range []string{\"144\", \"14\", \"1\"} {\n\t\tnum = strings.Replace(num, v, \"\", -1)\n\t}\n\n\tif len(num) > 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}", "lang": "Go", "bug_code_uid": "be0f1cda3efdd7389a5186847ae3f9fa", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "5d581503a94509ee1c91c17addcebd04", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9719626168224299, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n )\n\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n scanner.Scan()\n a := scanner.Text()\n a = strings.Replace(a,\"144\",\"\",-1)\n a = strings.Replace(a,\"14\",\"\",-1)\n a = strings.Replace(a,\"1\",\"\",-1)\n if (a == \"\") {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang": "Go", "bug_code_uid": "71d856be9adc8d32490e56c42528ae9f", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "d54a5a78093fa27c8129b1a35c2d4385", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9973544973544973, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar line string\n\tfmt.Scanf(\"%s\", &line)\n\n\tfoursExpect := 2\n\tokay := true\n\n\tfor i := 0; i < len(line); i++ {\n\t\tswitch line[i] {\n\t\tcase '1':\n\t\t\tfoursExpect = 2\n\t\tcase '4':\n\t\t\tfoursExpect--\n\t\t\tif foursExpect < 0 {\n\t\t\t\tokay = false\n\t\t\t}\n\t\tdefault:\n\t\t\tokay = false\n\t\t}\n\t}\n\n\tif okay {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "efab76cfba48b42ff2088c408c207b62", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "88bbb20e2d73bf0cb8572e0730259d32", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9099181073703366, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ni() int {\n sc.Scan()\n ans, _ := strconv.Atoi(sc.Text())\n return ans\n}\n\nfunc nll() int64 {\n sc.Scan()\n ans, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return ans\n}\n\nfunc next() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc pri(n int) { w.WriteString(strconv.Itoa(n)) }\nfunc prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n sc.Scan()\n s := sc.Text()\n c := 0\n for i := 0; i < len(s); i++ {\n if s[i] == '1' {\n if c >= 3 {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n } else {\n c = 0\n }\n } else if s[i] == '4' {\n c++\n } else {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n }\n if c >= 3 {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n w.WriteString(\"YES\\n\")\n w.Flush()\n}\n", "lang": "Go", "bug_code_uid": "b009ccb8daa2431ed644bce86865705b", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "f94fe5755657da0479c51b06239ad6ba", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.98989898989899, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn:=0\n\tfmt.Scanf(\"%d\",&n)\n\tswitch n%4 {\n\tcase 0:\n\t\tfmt.Println(\"0\")\n\tcase 1:\n\t\tfmt.Println(\"1\")\n\tcase 2:\n\t\tfmt.Println(\"2\")\n\tcase 3:\n\t\tfmt.Println(\"3\")\n\t}\n}", "lang": "Go", "bug_code_uid": "215b018dc48968068ee44516afa9a9d6", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "022df2bb7a01959cf366d604ad83d8bf", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9924050632911392, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h int, n int64\n\tfmt.Scanf(\"%d %d\", &h, &n)\n\tn -= 1\n\ttn := int64(1)\n\tr := int64(0)\n\tfor i := 0; i < h; i++ {\n\t\ttn *= 2\n\t}\n\tisLeft := true\n\tfor i := 0; i < h; i++ {\n\t\ttn /= 2\n\t\tr += 1\n\t\tif tn&n > 0 {\n\t\t\tif isLeft {\n\t\t\t\tr += 2*tn - 1\n\t\t\t}\n\t\t\tisLeft = true\n\t\t} else {\n\t\t\tif !isLeft {\n\t\t\t\tr += 2*tn - 1\n\t\t\t}\n\t\t\tisLeft = false\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "lang": "Go", "bug_code_uid": "af664f733aae59bf0960c13932145318", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "cececa66085b315ef6f1dcdbfa0a44bb", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9488188976377953, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n var n int\n var encodeStr string\n\n fmt.Scan(&n)\n fmt.Scan(&encodeStr)\n\n var answer []string\n var counter int\n var prevDigit string = \"-1\"\n\n for i := 0; i < n; i++ {\n var currentDigit string = string(encodeStr[i])\n if currentDigit == \"1\" {\n counter++\n if i == n-1 {\n answer = append(answer, strconv.Itoa(counter))\n }\n } else if currentDigit == \"0\" && prevDigit == \"0\" {\n answer = append(answer, \"0\")\n } else if currentDigit == \"0\" && prevDigit != \"0\" {\n answer = append(answer, strconv.Itoa(counter))\n counter = 0\n }\n prevDigit = currentDigit\n }\n fmt.Println(strings.Join(answer, \"\"))\n}\n", "lang": "Go", "bug_code_uid": "7e23ca4fa59f491a6d1b37e546300662", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "c8c5755b93f62b859b350a9ba82adecc", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9165659008464329, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t reader.ReadString('\\n')\n\ttext, _ := reader.ReadString('\\n')\n\tresult := \"\"\n\tcurNum := 0\n\tfor _, value := range text{\n\t\tif value == 49 {\n\t\t\tcurNum += 1\n\t\t} else if value == 48 {\n\t\t\tresult += strconv.Itoa(curNum)\n\t\t\tcurNum = 0\n\t\t}\n\t}\n\n\tif curNum != 0{\n\t\tresult += strconv.Itoa(curNum)\n\t}\n\n\t fmt.Println(result)\n}\n", "lang": "Go", "bug_code_uid": "41de58b113abc180cddfe8d3608cc986", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "cd8cf2448dbfe49c153a881061f51e37", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.7105719237435009, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n //\"strings\"\n)\n\nfunc main() {\n var n string = \"\"\n fmt.Scan(&n)\n for x:=0;x 0 {\n\t\t\t\tdp[i][j] -= dp[p-1][j-1]\n\t\t\t}\n\t\t}\n\t\tprev[c] = i\n\t}\n\tk--\n\tfor l := n - 1; l >= 0; l-- {\n\t\tcnt := dp[n][l]\n\t\tif cnt > k {\n\t\t\tans += int64(n-l) * k\n\t\t\tk = 0\n\t\t\tbreak\n\t\t}\n\t\tk -= cnt\n\t\tans += int64(n-l) * cnt\n\t}\n\tif k > 0 {\n\t\tans = -1\n\t}\n\tFprint(_w, ans)\n}\n\n//func main() { CF1183H(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "930d63ff9d1bf1a9eda003607ad5bc5a", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "ca22b1b8cbecfc1809997a9c3abf7e28", "difficulty": 2000, "tags": ["graphs", "dp", "implementation", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9791332263242376, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"bufio\"\n)\n\nfunc winpos(table [][]byte, sx, sy, dx, dy int) bool {\n\tx, y := sx, sy\n\ti := 0\n\tfor i < 5 {\n\t if x>=10 || y>=10 {\n\t return false\n\t }\n\t \n\t\tif table[x][y]!='X' {\n\t\t\treturn false\n\t\t}\n\t\t\n\t\tx += dx\n\t\ty += dy\n\t\t\n\t\ti++\n\t}\n\t\n\treturn true\n}\n\nfunc win(table [][]byte) bool {\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0;j < 10; j++ {\n\t\t\tif winpos(table, i, j, 0, 1) || winpos(table, i, j, 1, 0) || winpos(table, i, j, 1, 1) {\n\t\t\t\treturn true \n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false\n}\n\nfunc main() {\n stdin := bufio.NewReader(os.Stdin)\n\ttable := make([][]byte, 10)\n\tfor i := 0; i < 10; i++ {\n\t\ttable[i], _, _ = stdin.ReadLine()\n\t\t\n\t}\n\t\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0;j < 10; j++ {\n\t\t\tif table[i][j]=='.' {\n\t\t\t\ttable[i][j]='X'\n\t\t\t\tif win(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttable[i][j]='.'\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfmt.Println(\"NO\")\n\tos.Exit(0)\n}\n", "lang": "Go", "bug_code_uid": "0cd2913ce92f0195fbff8c3af97d8076", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "50ece8c5ed96b6d47be590b1f748400b", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8780487804878049, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "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:=0;i r1 {\n l1, r1 = r1, l1\n }\n if l2 > r2 {\n l2, r2 = r2, l2\n }\n return l1 < l2 && l2 < r1 && r1 < r2 || l2 < l1 && l1 < r2 && r2 < r1\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n n := nextInt()\n a := make([]int, n)\n for i := 0; i < n; i++ {\n a[i] = nextInt()\n }\n\n for i := 0; i < n - 1; i++ {\n for j := i + 1; j < n - 1; j++ {\n if intersect(a[i], a[i + 1], a[j], a[j + 1]) {\n fmt.Fprintln(out, \"yes\")\n return\n }\n }\n }\n fmt.Fprintln(out, \"no\")\n}\n", "lang": "Go", "bug_code_uid": "e7487e900d60953ad39266313ebf4e0d", "src_uid": "4408eba2c5c0693e6b70bdcbe2dda2f4", "apr_id": "fb9d94ad0e7a113cccb02179f80bf009", "difficulty": 1300, "tags": ["constructive algorithms", "implementation", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9918355004535833, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype Vertex struct {\n\tneighbors []*Vertex\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tg1 := make([][]*Vertex, n)\n\tg2 := make([][]*Vertex, n)\n\tfor i := range g1 {\n\t\tg1[i] = make([]*Vertex, m)\n\t\tg2[i] = make([]*Vertex, m)\n\t\tfor j := range g1[i] {\n\t\t\tg1[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}\n\t\t\tg2[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}\n\t\t}\n\t}\n\n\tvar horizon, vertical string\n\tfmt.Scanf(\"%s %s\", &horizon, &vertical)\n\tfor i, c := range horizon {\n\t\tif c == '>' {\n\t\t\tfor j := 0; j < m-1; j++ {\n\t\t\t\tg1[i][j].neighbors[0] = g1[i][j+1]\n\t\t\t}\n\t\t\tfor j := 1; j < m; j++ {\n\t\t\t\tg2[i][j].neighbors[0] = g2[i][j-1]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 1; j < m; j++ {\n\t\t\t\tg1[i][j].neighbors[0] = g1[i][j-1]\n\t\t\t}\n\t\t\tfor j := 0; j < m-1; j++ {\n\t\t\t\tg2[i][j].neighbors[0] = g2[i][j+1]\n\t\t\t}\n\t\t}\n\t}\n\tfor j, c := range vertical {\n\t\tif c == 'v' {\n\t\t\tfor i := 0; i < n-1; i++ {\n\t\t\t\tg1[i][j].neighbors[1] = g1[i+1][j]\n\t\t\t}\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tg2[i][j].neighbors[1] = g2[i-1][j]\n\t\t\t}\n\t\t} else {\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tg1[i][j].neighbors[1] = g1[i-1][j]\n\t\t\t}\n\t\t\tfor i := 0; i < n-1; i++ {\n\t\t\t\tg2[i][j].neighbors[1] = g2[i+1][j]\n\t\t\t}\n\n\t\t}\n\t}\n\tif dfs(g1) && dfs(g2) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc dfs(g [][]*Vertex) bool {\n\tvisited := make(map[*Vertex]struct{})\n\tv := g[0][0]\n\tdfsRecurse(v, visited)\n\treturn len(visited) == len(g) * len(g[0])\n\n}\n\nfunc dfsRecurse(v *Vertex, visited map[*Vertex]struct{}) {\n\tvisited[v] = struct{}{}\n\tfor _, n := range v.neighbors {\n\t\tif n == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := visited[n]; !ok {\n\t\t\tdfsRecurse(n, visited)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "0d96fc5024ec4930e1387735e6bed220", "src_uid": "eab5c84c9658eb32f5614cd2497541cf", "apr_id": "947509121e252fdfd22ae28e5c3b6197", "difficulty": 1400, "tags": ["graphs", "brute force", "dfs and similar", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8709472345835982, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\nfunc max(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tvar ans int\n\tfor index,_ := range s{\n\t\tif(string(s[index]) == \"+\"){\n\t\t\tans ++\n\t\t}else{\n\t\t\t\tans --;\n\t\t}\n\n\t}\n\tfmt.Print(max(ans,0))\n\n\n\n}\n", "lang": "Go", "bug_code_uid": "1e805f2bf870587df0cdfee070e7ddc7", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "02ea2f1c41e1700d93c09a1bbfbbf967", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5038759689922481, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tvar str string\n\tfmt.Scanf(\"%d\\n\",&n)\n\tfmt.Scanf(\"%s\\n\",&str)\n\tfmt.Println(n)\n\tfmt.Println(str)\n\tans:=0\n\tfor _,c:=range str{\n\t\tif c=='+'{\n\t\t\tans++\n\t\t}else if c=='-'{\n\t\t\tif ans>0{\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "bcefbead23f12fabcc1fd3f2231d6936", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "a1df30412476008ef25c19be84d8e409", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.995507637017071, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "```package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar d int\n\tscanf(\"%d\\n\", &d)\n\tvar s string\n\tscanf(\"%s\\n\", &s)\n\tsa := []byte(s)\n\tcur := 0\n\tfor _, c := range sa {\n\t\tif c == '-' {\n\t\t\tcur--\n\t\t} else {\n\t\t\tcur++\n\t\t}\n\t\tif cur < 0 {\n\t\t\tcur = 0\n\t\t}\n\t}\n\n\tprintf(\"%d\", cur)\n}\n", "lang": "Go", "bug_code_uid": "99623b01f5b394d3bb252d83cc3b6099", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "9439cb40d2533455d69e0ccc2aa4b8cf", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.5526315789473685, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc readline(reader *bufio.Reader) string {\n\tstr, _ := reader.ReadString('\\n')\n\treturn strings.TrimSuffix(str, \"\\n\")\n}\n\nfunc readInt(reader *bufio.Reader) int {\n\tstr := readline(reader)\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tn := readInt(reader)\n\tpattern := readline(reader)\n\n\tct := 0\n\tminSeen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif pattern[i] == '+' {\n\t\t\tct++\n\t\t} else if pattern[i] == '-' {\n\t\t\tct--\n\t\t}\n\t\tif ct < minSeen {\n\t\t\tminSeen = ct\n\t\t}\n\t}\n\tfmt.Println(ct, minSeen)\n\tfmt.Println(ct - minSeen)\n}\n", "lang": "Go", "bug_code_uid": "f6f12fca8b911d0e069db2c4e158457a", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "4becac9670654d3511a5326d0b28ccc6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.93296853625171, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\tss := bufio.NewScanner(os.Stdin)\n\tss.Scan()\n\ts := ss.Text()\n\tn := len(s)\n\tcount:=0\n\n\tfor i:=0; i< n-2; i++ {\n\t\tif s[i] != 'Q' { continue }\n\t\tfor j:= i+1; j< n-1; j++ {\n\t\t\tif s[j] != 'A' { continue }\n\t\t\tfor k:=j+1; k< n; k++ {\n\t\t\t\tif s[k] != 'Q' { continue }\n\t\t\t\tcount++\n\t\t\t}\n\n\t\t}\n\n\t}\n\tprintln(count)\n}", "lang": "Go", "bug_code_uid": "d0d894c073da4d29d9405660f256c1bc", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "9bd0b386203126a3879e42ba187d2b83", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7171717171717171, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "// cf894a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tflag := true\n\ti := 0\n\tfor _, c := range s {\n\t\tif c == 'Q' {\n\t\t\tif !flag {\n\t\t\t\ti++\n\t\t\t}\n\t\t\tflag = true\n\t\t} else if c == 'A' {\n\t\t\tflag = false\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", i*i)\n}\n", "lang": "Go", "bug_code_uid": "6577fd0e0a67a2c9c02afe73906bf247", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "e18c7f926eb906b8d1a7049fc3be2ec0", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9909335124244459, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\ntype Pos struct {\n i, j, t, di, dj, lvl int\n}\n\nfunc solve() {\n const mx = 300\n n := readInt()\n a := readIntArray(n)\n\n was := [mx+2][mx+2][6][3][3]bool{}\n ans := [mx+2][mx+2]bool{}\n setWas := func(p Pos) {\n was[p.i][p.j][p.t][p.di+1][p.dj+1] = true\n }\n checkWas := func(p Pos) bool {\n return was[p.i][p.j][p.t][p.di+1][p.dj+1]\n }\n q := []Pos{Pos{mx/2, mx/2, a[0], 1, 0, 0}}\n setWas(q[0])\n for i := 0; i < len(q); i++ {\n cur := q[i]\n for t := 0; t < cur.t; t++ {\n cur.i += cur.di\n cur.j += cur.dj\n ans[cur.i][cur.j] = true\n }\n if nextLvl := cur.lvl+1; nextLvl < n {\n for rot := -1; rot < 2; rot += 2 {\n next := Pos{cur.i, cur.j, a[nextLvl], 0, 0, nextLvl}\n if abs(cur.di*cur.dj) == 1 {\n if rot == 1 {\n next.di = cur.di\n } else {\n next.dj = cur.dj\n }\n } else {\n if cur.di == 0 {\n next.di = rot\n next.dj = cur.dj\n } else {\n next.di = cur.di\n next.dj = rot\n }\n \t\t\t\t}\n if !checkWas(next) {\n setWas(next)\n q = append(q, next)\n }\n }\n }\n }\n res := 0\n for i := range ans {\n for _, b := range ans[i] {\n if b {\n res++\n }\n }\n }\n fmt.Println(res)\n}\n\n\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/", "lang": "Go", "bug_code_uid": "01a3f4759b49c21ada7e9b13e498707d", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "d54bda9c91c9d6ba43b3af53a322fcf2", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8841826604897419, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype move struct {\n\tx int\n\ty int\n\tdx int\n\tdy int\n\tw int\n}\n\nconst W = 5000 * 1000\nconst H = 5*30*2 + 10\nconst Z = H / 2\n\nvar used [H][H][3][3]bool\nvar wave [H][H][3][3]int\nvar t [31]int\nvar n int\n\nvar q [W]move\nvar hd, tl int\n\nfunc push(m move) {\n\tq[tl] = m\n\tif tl == W-1 {\n\t\ttl = 0\n\t} else {\n\t\ttl += 1\n\t}\n}\n\nfunc pop() move {\n\tret := q[hd]\n\tif hd == W-1 {\n\t\thd = 0\n\t} else {\n\t\thd += 1\n\t}\n\treturn ret\n}\n\nfunc empty() bool {\n\treturn hd == tl\n}\n\nvar ndx [3][3]int\nvar ndy [3][3]int\nvar ndxx [3][3]int\nvar ndyy [3][3]int\n\nfunc do() {\n\tm := pop()\n\n\ttt := t[m.w]\n\tlx := m.x + (tt-1)*m.dx\n\tly := m.y + (tt-1)*m.dy\n\n\t//fmt.Printf(\"%d lines from (%d, %d) with dir (%d, %d)\\n\", tt, m.x-Z, m.y-Z, m.dx, m.dy)\n\n\tfor i := 0; i < tt; i++ {\n\t\tused[m.x+i*m.dx][m.y+i*m.dy][1+m.dx][1+m.dy] = true\n\t}\n\twave[m.x][m.y][1+m.dx][1+m.dy] = m.w\n\n\tif m.w+1 < n {\n\t\tndx1 := ndx[1+m.dx][1+m.dy]\n\t\tndy1 := ndy[1+m.dx][1+m.dy]\n\t\tx1 := lx + ndx1\n\t\ty1 := ly + ndy1\n\t\tif wave[x1][y1][1+ndx1][1+ndy1] < m.w+1 {\n\t\t\tpush(move{x1, y1, ndx1, ndy1, m.w + 1})\n\t\t}\n\n\t\tndx2 := ndxx[1+m.dx][1+m.dy]\n\t\tndy2 := ndyy[1+m.dx][1+m.dy]\n\t\tx2 := lx + ndx2\n\t\ty2 := ly + ndy2\n\t\tif wave[x2][y2][1+ndx2][1+ndy2] < m.w+1 {\n\t\t\tpush(move{x2, y2, ndx2, ndy2, m.w + 1})\n\t\t}\n\t}\n}\n\nfunc main() {\n\n\tndy = [3][3]int{\n\t\t{0, 1, 1},\n\t\t{-1, 0, 1},\n\t\t{-1, -1, 0},\n\t}\n\n\tndx = [3][3]int{\n\t\t{-1, -1, 0},\n\t\t{-1, 0, 1},\n\t\t{0, 1, 1},\n\t}\n\n\tndyy = [3][3]int{\n\t\t{-1, -1, 0},\n\t\t{-1, 0, 1},\n\t\t{0, 1, 1},\n\t}\n\n\tndxx = [3][3]int{\n\t\t{0, -1, -1},\n\t\t{1, 0, -1},\n\t\t{1, 1, 0},\n\t}\n\n\tin := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\", &t[i])\n\t}\n\n\tfor x := 0; x < H; x++ {\n\t\tfor y := 0; y < H; y++ {\n\t\t\tfor i := 0; i < 3; i++ {\n\t\t\t\tfor j := 0; j < 3; j++ {\n\t\t\t\t\twave[x][y][i][j] = -1\n\t\t\t\t\tused[x][y][i][j] = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpush(move{Z, Z, 0, 1, 0})\n\n\tfor !empty() {\n\t\tdo()\n\t}\n\n\tret := 0\n\tfor x := 0; x < H; x++ {\n\t\tfor y := 0; y < H; y++ {\n\t\t\tfg := false\n\t\t\tfor i := 0; i < 3; i++ {\n\t\t\t\tif fg {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfor j := 0; j < 3; j++ {\n\t\t\t\t\tif used[x][y][i][j] {\n\t\t\t\t\t\tfg = true\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 fg {\n\t\t\t\tret += 1\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ret)\n}\n", "lang": "Go", "bug_code_uid": "d9e6aa967ba63d3a5bedcd9a311b41ef", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "1056bf3c10c3786a910c2ee6ef9c585b", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9975278121137207, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n//TODO, 2017.11.15\nfunc main() {\n\tvar sum int\n\treader := bufio.NewReader(os.Stdin)\n\tarray := make([]int, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tfmt.Fscan(reader, &array[i])\n\t\tsum += array[i]\n\t}\n\tif sum%2 == 1 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tflag := false\n\t\thalf := sum / 2\n\t\tfor i := 0; i < 6; i++ {\n\t\t\tadd := array[i]\n\t\t\tif add > half {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tother := make([]int, len(array))\n\t\t\tcopy(other, array)\n\t\t\tother = append(other[:i], other[i+1:]...)\n\t\t\tfor j := 0; j < len(other)-1; j++ {\n\t\t\t\tfor k := 1; k < len(other)-2; k++ {\n\t\t\t\t\tif add+other[j]+other[k] == half {\n\t\t\t\t\t\tflag = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif flag == true {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag == false {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tfmt.Println(\"YES\")\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d5144b12675c66db7bb423d598ade95b", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "63534bfa236505b24cd56f208325c334", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.0199501246882793, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "func main() { \n}", "lang": "Go", "bug_code_uid": "6a43266de55ebe4c0065e46db582b3cd", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "25ed0ade664a101a097acf248370f20b", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8795074758135444, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, k int\n\tvar types []int\n\n\tfmt.Scan(&n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\t\ttypes = append(types, t)\n\t}\n\n\tmaxDiff := 0\n\tfor i := 0; i < k; i++ {\n\t\tcountTest := 0\n\t\tcountSocialNetwork := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif (j-i)%k != 0 {\n\t\t\t\tif types[j] == 1 {\n\t\t\t\t\tcountTest++\n\t\t\t\t} else {\n\t\t\t\t\tcountSocialNetwork++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdiff := int(math.Abs(float64(countSocialNetwork - countTest)))\n\t\tfmt.Println(i)\n\t\tfmt.Println(diff)\n\t\tif maxDiff < diff {\n\t\t\tmaxDiff = diff\n\t\t}\n\t}\n\tfmt.Println(maxDiff)\n}\n", "lang": "Go", "bug_code_uid": "f6a977a82dc44e82cf937f70206a7af3", "src_uid": "6119258322e06fa6146e592c63313df3", "apr_id": "c420cce6b8dbd73c9277b509c7b66ab5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.949550794747754, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts, t := next(), next()\n\n\tif len(s) < len(t) {\n\t\tprintln(\"need tree\")\n\t\treturn\n\t}\n\n\tif strings.Contains(s, t) {\n\t\tprintln(\"automaton\")\n\t\treturn\n\t}\n\n\tchars := countChars(s)\n\tchart := countChars(t)\n\n\tif len(chars) < len(chart) {\n\t\tprintln(\"need tree\")\n\t\treturn\n\t}\n\n\tfor k := range chart {\n\t\t_, ok := chars[k]\n\n\t\tif !ok || chars[k] < chart[k] {\n\t\t\tprintln(\"need tree\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(s) == len(t) {\n\t\tprintln(\"array\")\n\t} else {\n\t\tprintln(\"both\")\n\t}\n}\n\nfunc countChars(s string) map[uint8]int {\n\tchars := make(map[uint8]int)\t\n\t\n\tfor i := range s {\n\t\t_, ok := chars[s[i]]\n\n\t\tif ok {\n\t\t\tchars[s[i]]++\n\t\t} else {\n\t\t\tchars[s[i]] = 1\n\t\t}\n\t}\n\n\treturn chars\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "061c250966e92fbb479de1d470b409bb", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "534eb9372da765b46696c77f5aa3a5a7", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8695652173913043, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\ntype sortRunes []rune\n\nfunc (s sortRunes) Less(i, j int) bool {\n\treturn s[i] < s[j]\n}\n\nfunc (s sortRunes) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s sortRunes) Len() int {\n\treturn len(s)\n}\n\nfunc need_array(input1 string, input2 string) bool {\n\tif len(input1) != len(input2) {\n\t\treturn false\n\t}\n\n\tinput1Bytes := []rune(input1)\n\tinput2Bytes := []rune(input2)\n\n\tsort.Sort(sortRunes(input1Bytes))\n\tsort.Sort(sortRunes(input2Bytes))\n\n\tfor i := 0; i < len(input1Bytes); i++ {\n\t\tif input1Bytes[i] != input2Bytes[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc need_both(input1 string, input2 string) bool {\n\tinput1Bytes := []rune(input1)\n\tinput2Bytes := []rune(input2)\n\n\tsort.Sort(sortRunes(input1Bytes))\n\tsort.Sort(sortRunes(input2Bytes))\n\n\tif len(input2Bytes) > len(input1Bytes) {\n\t\treturn false\n\t}\n\n\ti, j := 0, 0\n\n\tfor {\n\t\tif i >= len(input2Bytes) || j >= len(input1Bytes) {\n\t\t\tbreak\n\t\t}\n\n\t\tif input2Bytes[i] == input1Bytes[j] {\n\t\t\ti++\n\t\t\tj++\n\t\t} else if input2Bytes[i] > input1Bytes[j] {\n\t\t\tj++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif i == len(input2Bytes) {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc main() {\n\tvar word1, word2 string\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tif scanner.Scan() {\n\t\tword1 = scanner.Text()\n\t}\n\n\tif scanner.Scan() {\n\t\tword2 = scanner.Text()\n\t}\n\n\tif need_array(word1, word2) {\n\t\tfmt.Println(\"array\")\n\t} else if strings.Contains(word1, word2) {\n\t\tfmt.Println(\"automaton\")\n\t} else if need_both(word1, word2) {\n\t\tfmt.Println(\"both\")\n\t} else {\n\t\tfmt.Println(\"need tree\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f8b61ce6cbe5a163d68d1eb53448078e", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "fe815fb8870fdb24f676e3f65d21ad5a", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8207705192629816, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(s, t string) string {\n\t// atomaton\n\tfirst := 0\n\tfind := true\n\tfor i := 0; i < len(t); i++ {\n\t\tfor ; first < len(s); first++ {\n\t\t\tif s[first] == t[i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif first == len(s) {\n\t\t\tfind = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif find == true {\n\t\treturn \"automaton\"\n\t}\n\n\t// counts\n\tcount_s := make([]int, 26, 26)\n\tcount_t := make([]int, 26, 26)\n\tfor i := 0; i < len(s); i++ {\n\t\tcount_s[s[i]-'a']++\n\t}\n\tfor i := 0; i < len(t); i++ {\n\t\tcount_t[t[i]-'a']++\n\t}\n\n\t// array\n\tarray := true\n\tfor i := 0; i < 26; i++ {\n\t\tif count_t[i] != count_s[i] {\n\t\t\tarray = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif array {\n\t\treturn \"array\"\n\t}\n\n\t// both\n\tboth := true\n\tfor i := 0; i < 26; i++ {\n\t\tif count_t[i] > count_s[i] {\n\t\t\tboth = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif both {\n\t\treturn \"both\"\n\t}\n\n\treturn \"need tree\"\n}\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s)\n\tfmt.Scan(&t)\n\n\tfmt.Println(solve(s, t))\n}\n", "lang": "Go", "bug_code_uid": "1892b3a97878154ab8e7614809ab4232", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "e7a262ed770e7808c6343a2161b4f010", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9786250722125939, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(s, t string) string {\n\t// atomaton\n\tfirst := 0\n\tsecond := 0\n\n\tfor ; first < len(s); first++ {\n\t\tif s[first] == t[second] {\n\t\t\tsecond++\n\t\t}\n\t}\n\n\tif second == len(t) && first <= len(s) {\n\t\treturn \"automaton\"\n\t}\n\n\t// counts\n\tcount_s := make([]int, 26, 26)\n\tcount_t := make([]int, 26, 26)\n\tfor i := 0; i < len(s); i++ {\n\t\tcount_s[s[i]-'a']++\n\t}\n\tfor i := 0; i < len(t); i++ {\n\t\tcount_t[t[i]-'a']++\n\t}\n\n\t// array\n\tarray := true\n\tfor i := 0; i < 26; i++ {\n\t\tif count_t[i] != count_s[i] {\n\t\t\tarray = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif array {\n\t\treturn \"array\"\n\t}\n\n\t// both\n\tboth := true\n\tfor i := 0; i < 26; i++ {\n\t\tif count_t[i] > count_s[i] {\n\t\t\tboth = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif both {\n\t\treturn \"both\"\n\t}\n\n\treturn \"need tree\"\n}\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s)\n\tfmt.Scan(&t)\n\n\tfmt.Println(solve(s, t))\n}\n", "lang": "Go", "bug_code_uid": "0e33447e3619d6f21aafa2200e97f286", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "e7a262ed770e7808c6343a2161b4f010", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7108655616942909, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main;\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n,d int\n\tfmt.Scan(&n, &d)\n\tt := make([]int, n)\n\ttime := 0\n\tfor i := range n {\n\t\tfmt.Scan(&t[i])\n\t\ttime += t[i]\n\t\tif i!= 0 {\n\t\t\ttime += 10\n\t\t}\n\t}\n\tif time >= d {\n\t\tfmt.Println(-1)\n\t}\n\telse{\n\t\tfmt.Println((d-time)/5)\n\t}\n}", "lang": "Go", "bug_code_uid": "6618598183fb34b8018bcc5975751617", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "3972dae01ecd5776d93c62678f725a17", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9254185692541856, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, d int\n\tfmt.Scan(&n, &d)\n\n\tvar ti int\n\tfmt.Scan(&ti)\n\n\tans := 0\n\tsum := ti\n\tfor i := 1; i < n; i++ {\n\t\tfmt.Scan(&ti)\n\t\tsum += (10 + ti)\n\n\t\tif sum > d {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tans += 2\n\t}\n\tif ans > -1 {\n\t\tans += ((d - sum) / 5)\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "7d89f9485bddfc4afd02e4519b403240", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "47fe4d0d1e95d416728d0abc0376d0c2", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9128014842300557, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t)\n\nconst INF = 0x3f3f3f3f\n\nvar n, m, tot int\n\nfunc min(x, y int) int {\n\tif xy {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc main() {\n\t// fd, _ := os.Open(\"in.txt\")\n\t// os.Stdin = fd\n\tvar T int = 1\n\t// fmt.Scanf(\"%d\", &T)\n\tfor ci:=1; ci<=T; ci++ {\n\t\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\t\t// fmt.Printf(\"Case #%d: \", ci)\n\t\tvar ans int = 0\n\t\tfor i:=1; i<=n; i++ {\n\t\t\tvar x int\n\t\t\tfmt.Scanf(\"%d\", &x)\n\t\t\tif m%x==0 {\n\t\t\t\tans = max(ans, m/x)\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"%d\\n\", ans)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "31240044380fbfb3ad9c84ab8bbe9535", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "bd97d42c12e5077b9583a94b11f47fa4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.17900172117039587, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t//n, _ := strconv.ParseInt(os.Args[0], 2, 32)\n\tk, _ := strconv.Atoi(os.Args[2])\n\n\tsol := 0\n\n\tfor i := 3; i < len(os.Args); i++ {\n\t\td, _ := strconv.Atoi(os.Args[i])\n\t\tif k%d == 0 && sol < d {\n\t\t\tsol = d\n\t\t}\n\t}\n\n\tprintln(k / sol)\n}\n", "lang": "Go", "bug_code_uid": "47fbb9fe3cc538c199608ad58b387994", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "c0740ba632efbbdf4553dfcb9315bbec", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9253731343283582, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, k int\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &n, &k)\n\tans := 12345678\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\t// fmt.Fscan(input, &val)\n\t\tfmt.Scanf(\"%d\", &val)\n\t\tif k%val == 0 {\n\t\t\tif ans > k/val {\n\t\t\t\tans = k / val\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "42ea2fc92ea555b9bc6974d45f8fe097", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "8f3239d51355de8613d755061931a98e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.914365933551708, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts := next()\n\tt := \"CODEFORCES\"\n\tidx := 0\n\tr, l := \"\", \"\"\n\n\tfor i := 0; i < len(t); i++ {\n\t\tr, l = t[:i], t[i:]\n\n\t\tidx = strings.Index(s, r)\n\n\t\tif idx >= 0 && strings.Index(s[idx+1:], l) >= 0 {\n\t\t\tprintln(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tprintln(\"NO\")\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "f490b782a3aea4c1f79ea3b80206e8cc", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "a5f9a8463f8fc5de89a5045c50c4e28b", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9176470588235294, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tsize := len(s)\n\textra := size - len(\"CODEFORCES\")\n\tfor i := 0; i < size-extra; i++ {\n\t\tx := s[:i] + s[i+extra:]\n\t\tif x == \"CODEFORCES\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "8462a995092c7b5be34f50eab0696994", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "e5a2fb622190dbea4d8324f7e523dbc8", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9984447900466563, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tsize := len(s)\n\textra := size - len(\"CODEFORCES\")\n\tif extra < 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfor i := 0; i < size-extra; i++ {\n\t\tx := s[:i] + s[i+extra:]\n\t\tif x == \"CODEFORCES\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "eddc44aa496ebf1d6d88644ee2b23cc2", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "e5a2fb622190dbea4d8324f7e523dbc8", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8212314225053079, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc sortAsc(numbers string) (result string) {\n\tsplitResult := strings.Split(numbers, \"+\")\n\tif len(splitResult) <= 1 {\n\t\tresult = numbers\n\t\treturn\n\t}\n\n\tvar index int\n\tvar isSwap bool\n\tfor {\n\t\tif splitResult[index] > splitResult[index+1] {\n\t\t\ttemp := splitResult[index]\n\t\t\tsplitResult[index] = splitResult[index+1]\n\t\t\tsplitResult[index+1] = temp\n\t\t\tisSwap = true\n\t\t} else {\n\t\t\tisSwap = false\n\t\t}\n\n\t\tindex++\n\t\tif index == len(splitResult)-1 {\n\t\t\tindex = 0\n\t\t\tif !isSwap {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tvar sb strings.Builder\n\tfor i, number := range splitResult {\n\t\tsb.WriteString(number)\n\t\tif i < len(splitResult)-1 {\n\t\t\tsb.WriteString(\"+\")\n\t\t}\n\t}\n\n\treturn sb.String()\n}\n\nfunc main() {\n\n\t// var firstWord, secondWord string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tif err := scanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(sortAsc(scanner.Text()))\n\n\t\t// if firstWord == \"\" {\n\t\t// \tfirstWord = scanner.Text()\n\t\t// \tcontinue\n\t\t// }\n\n\t\t// if secondWord == \"\" {\n\t\t// \tsecondWord = scanner.Text()\n\t\t// \tfmt.Println(compareString(firstWord, secondWord))\n\t\t// \tfirstWord, secondWord = \"\", \"\"\n\t\t// }\n\t}\n}\n", "lang": "Go", "bug_code_uid": "2ef4084f7c3836c5e65dec0d2c2cb6f4", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "42dfbc6712e91c38e71b654c5f764020", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8805309734513275, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n int\n i := 1\n fmt.Scan(&n)\n while(n>i){\n n -= i\n i++\n }\n if n == i {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang": "Go", "bug_code_uid": "ccd37001a646e417d1be20265d6eb793", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "0ae90a2d9705d4500a4767843794404e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9943661971830986, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "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} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar a, b, c, d int\n\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tm := max(3*a/10, a/250*c)\n\tv := max(3*b/10, b/250*d)\n\n\tvar res string\n\n\tif m > v {\n\t\tres = \"Misha\"\n\t} else if m < v {\n\t\tres = \"Vasya\"\n\t} else {\n\t\tres = \"Tie\"\n\t}\n\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "ada929301e4ca5606757001dcc51a528", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "13c56211420769a3cfdf2652a9e3ee6a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9943181818181818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "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\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tmisha := max(3*a/10, a/250*c)\n\tvasya := max(3*b/10, b/250*d)\n\n\tif misha > vasya {\n\t\tfmt.Println(\"Misha\")\n\t} else if misha < vasya {\n\t\tfmt.Println(\"Vasya\")\n\t} else {\n\t\tfmt.Println(\"Tie\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "634771d2e733a1a1e824f500654130c9", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "98b56b3f6db79399d37af8a0a5e8e997", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8938740293356342, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBIG = 1024 * 1024 * 10\n)\n\nfunc readLine(r *bufio.Reader) string {\n\tbytes, _, err := r.ReadLine()\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to read line\")\n\t}\n\n\treturn string(bytes)\n}\n\nfunc readInts(r *bufio.Reader) []int {\n\telems := strings.Fields(readLine(r))\n\n\tret := make([]int, len(elems))\n\tfor i, el := range elems {\n\t\ttmp, err := strconv.ParseInt(el, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to parse number %v\", el)\n\t\t}\n\t\tret[i] = int(tmp)\n\t}\n\n\treturn ret\n}\n\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc combination(a, b int64) int64 {\n\tb = min(b, a-b)\n\tnom, denom := int64(1), int64(1)\n\tfor b > 0 {\n\t\tnom *= a\n\t\tdenom *= b\n\t\ta -= 1\n\t\tb -= 1\n\t}\n\n\treturn nom / denom\n}\n\nfunc pow(a, b int64) int64 {\n\tret := int64(1)\n\tfor b > 0 {\n\t\tret *= a\n\t\tb -= 1\n\t}\n\n\treturn ret\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, BIG)\n\n\tn := readInts(r)[0]\n\n\tres := int64(4*(n-1)) * pow(int64(3), int64(n-2))\n\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "e635d6584dc5f76a9857474cae2c574f", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "512a03b1b446373a4ed6306d7aaec56e", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8179508890770534, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport \"fmt\"\n\n\n\n\nfunc main() {\n\tsdeck := make([]string, 8)\n\tfor i := 0; i < 8; i++{\n\t\tfmt.Scan(&sdeck[i])\n\t}\n\tvar deck [8][8]int\n\tcount := 0\n\tfor i, s := range sdeck{\n\t\tfor j, c := range s{\n\t\t\tif c == 'B'{\n\t\t\t\tdeck[i][j] = 1\n\t\t\t}else{\n\t\t\t\tdeck[i][j] = 0\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 8; i++{\n\t\tsum := 0\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tif deck[i][j] == 1{\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t\tif sum == 8 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfor i := 0; i < 8; i++{\n\t\tsum := 0\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tif deck[j][i] == 1{\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t\tif sum == 8 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Print(count)\n}", "lang": "Go", "bug_code_uid": "52807a5c545b68965476c5d6ce699f4b", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "9786183432c7172d9de0f2f75c6730db", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9485458612975392, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tz := bufio.NewScanner(os.Stdin)\n\tvar col [8]int\n\tvar count int\n\tfor i := 0; i < 8 ; i++ {\n\t\tz.Scan()\n\t\ts := z.Text()\n\t\trow := 0\n\t\tfor j := 0; j < 8 ; j++ {\n\t\t\tif s[i] == 'B' {\n\t\t\t\trow++\n\t\t\t\tcol[j]++\n\t\t\t}\n\t\t\tif row == 8 {\n\t\t\t\tcount++\n\t\t\t}\n\n\t\t}\n\t}\n\tfor i := 0 ; i < 8 ; i++ {\n\t\tif col[i] == 8 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count == 16 {count = 8}\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "a17cdd8cfb3df31060eea125119e54ca", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "8724cc2a2bbefeb12ee0d7d93ebc88e8", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9976967370441459, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\ntype caseInput struct {\n\tnum int\n}\n\nfunc readCaseInput(scanner *bufio.Scanner) caseInput {\n\treturn caseInput{readInt(scanner)}\n}\n\ntype caseOutput struct {\n\tops int\n}\n\nfunc writeCaseOutput(writer *bufio.Writer, out caseOutput) {\n\twritef(writer, \"%d\\n\", out.ops)\n}\n\nfunc solveCase(in caseInput) caseOutput {\n\tnumStr := fmt.Sprintf(\"%d\", in.num)\n\troot := int(math.Floor(math.Sqrt(float64(in.num))))\n\tfor root > 0 {\n\t\tsquareStr := fmt.Sprintf(\"%d\", root*root)\n\t\tif len(lcs(numStr, squareStr)) == len(squareStr) {\n\t\t\treturn caseOutput{len(numStr) - len(squareStr)}\n\t\t}\n\t}\n\treturn caseOutput{-1}\n}\n\n//\tthat's from rozetta code and seems to work\nfunc lcs(a, b string) string {\n\tarunes := []rune(a)\n\tbrunes := []rune(b)\n\taLen := len(arunes)\n\tbLen := len(brunes)\n\tlengths := make([][]int, aLen+1)\n\tfor i := 0; i <= aLen; i++ {\n\t\tlengths[i] = make([]int, bLen+1)\n\t}\n\t// row 0 and column 0 are initialized to 0 already\n\n\tfor i := 0; i < aLen; i++ {\n\t\tfor j := 0; j < bLen; j++ {\n\t\t\tif arunes[i] == brunes[j] {\n\t\t\t\tlengths[i+1][j+1] = lengths[i][j] + 1\n\t\t\t} else if lengths[i+1][j] > lengths[i][j+1] {\n\t\t\t\tlengths[i+1][j+1] = lengths[i+1][j]\n\t\t\t} else {\n\t\t\t\tlengths[i+1][j+1] = lengths[i][j+1]\n\t\t\t}\n\t\t}\n\t}\n\n\t// read the substring out from the matrix\n\ts := make([]rune, 0, lengths[aLen][bLen])\n\tfor x, y := aLen, bLen; x != 0 && y != 0; {\n\t\tif lengths[x][y] == lengths[x-1][y] {\n\t\t\tx--\n\t\t} else if lengths[x][y] == lengths[x][y-1] {\n\t\t\ty--\n\t\t} else {\n\t\t\ts = append(s, arunes[x-1])\n\t\t\tx--\n\t\t\ty--\n\t\t}\n\t}\n\t// reverse string\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\ts[i], s[j] = s[j], s[i]\n\t}\n\treturn string(s)\n}\n\nfunc solveSequential(scanner *bufio.Scanner, writer *bufio.Writer) {\n\twriteCaseOutput(writer, solveCase(readCaseInput(scanner)))\n}\n\nfunc main() {\n\tvar scanner *bufio.Scanner\n\tif len(os.Args) > 1 {\n\t\treader, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer reader.Close()\n\t\tscanner = bufio.NewScanner(reader)\n\t} else {\n\t\tscanner = bufio.NewScanner(os.Stdin)\n\t}\n\tscanner.Split(bufio.ScanWords)\n\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tsolveSequential(scanner, writer)\n}\n\nfunc readInt64(sc *bufio.Scanner) int64 {\n\tsc.Scan()\n\tres, err := strconv.ParseInt(sc.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc readInt(sc *bufio.Scanner) int {\n\treturn int(readInt64(sc))\n}\n\nfunc writef(writer *bufio.Writer, formatStr string, values ...interface{}) {\n\tout := fmt.Sprintf(formatStr, values...)\n\t_, err := writer.WriteString(out)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "11c3698b2517f626a378297b76b3b905", "src_uid": "fa4b1de79708329bb85437e1413e13df", "apr_id": "fb5888e4bbb0323cf73fd417c5f5235d", "difficulty": 1400, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9765721331689272, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\treadN(a, 0, n)\n\tout := make(map[int]bool, n)\n\tfor v := range a {\n\t\tout[v] = true\n\t}\n\tvar count int\n\tfor k := range out {\n\t\tif k != 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\nfunc readN(all []int, i, n int) {\n\tif n == 0 {\n\t\treturn\n\t}\n\tif m, err := fmt.Scan(&all[i]); m != 1 {\n\t\tpanic(err)\n\t}\n\treadN(all, i+1, n-1)\n}\n", "lang": "Go", "bug_code_uid": "a8efcd9cf14099917c25265f39f3954a", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "ee3f69a0d1c4e887cc9496d35c9b0fcf", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5454545454545454, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\ta, b, r := 0, 0, 0\n\tfmt.Scanf(\"%d %d %d\\n\", &a, &b, &r)\n\twinner := \"Second\"\n\tvar xDiameter float32\n\tif a > b {\n\t\txDiameter = float32(a) / float32(r*2)\n\t} else {\n\t\txDiameter = float32(b) / float32(r*2)\n\t}\n\tif xDiameter >= 1 && int32((xDiameter-1)/1.5)%2 == 0 {\n\t\twinner = \"First\"\n\t}\n\tfmt.Printf(\"%s\\n\", winner)\n}\n", "lang": "Go", "bug_code_uid": "aecc2da9f8faedd9faaae85e691ccb70", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "12e964cd70d0c001ecc3f93dacd34ef5", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6151012891344383, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint64\n\tvar c int64\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i:=1; uint32(i) <= n; i++{\n\t\tif i % 2 != 0{\n\t\t\tc -= int32(i);\n\t\t}else{\n\t\t\tc += int32(i);\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n", "lang": "Go", "bug_code_uid": "581b50e89123e81d0dee44e2c8ac3ec9", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "47639cff990af51b8215ea22da193ef7", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6666666666666666, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint64\n\tvar c int64\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i:=1; uint64(i) <= n; i++{\n\t\tif i % 2 != 0{\n\t\t\tc -= int64(i);\n\t\t}else{\n\t\t\tc += int64(i);\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n", "lang": "Go", "bug_code_uid": "6c04d58efc11f94283da88b4412b4753", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "47639cff990af51b8215ea22da193ef7", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7272727272727273, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, r, i int64 = 0, 0, 1\n\tfmt.Scan(&n)\n\n\tfor ; i <= n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tr += i\n\t\t} else {\n\t\t\tr -= i\n\t\t}\n\t}\n\tfmt.Print(r)\n}", "lang": "Go", "bug_code_uid": "97a7df826faee90bb325dfee7f40e616", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "fc1239f1e8f5a74d75184dfa921bd9f6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.967741935483871, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n\n p := 1\n if n % 2 == 1 {\n p = -1\n }\n\n fmt.Println(((n + 1) / 2) * p)\n}\n", "lang": "Go", "bug_code_uid": "ceb19e34d661edec1ededa239c0b24ba", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "e3b347c4452c51130c097bb5bbd06a79", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4314410480349345, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tProblem486A()\n}\n\nfunc Problem486A() {\n\tvar n int\n\tscanf(\"%d\\n\", &n)\n\trs := processProblem486A(n)\n\tprintf(\"%d\", rs)\n\n}\n\nfunc processProblem486A(n int) int {\n\tvar even, odd int\n\tfor i := 1 ; i <= n ; i++ {\n\t\tif i % 2 > 0 {\n\t\t\todd += i\n\t\t}else {\n\t\t\teven += i\n\t\t}\n\t}\n\treturn even + ( odd - ( odd * 2))\n}\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc scanf(format string, x ...interface{}) {\n\tif _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "d1ef35c52fc9fce36ac52c0b35494a63", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "ae3074aa68d84f6547d9c7a4a7422cdf", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9885496183206107, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\trs := Problem486A()\n\tprintf(\"%d\", rs)\n}\n\nfunc Problem486A() int {\n\tvar n int\n\tscanf(\"%d\\n\", &n)\n\tif n % 2 > 0 {\n\t\treturn (( n + 1 ) / 2 ) - ( ( ( n + 1 ) / 2 ) * 2 )\n\t}else {\n\t\treturn n / 2\n\t}\n}\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc scanf(format string, x ...interface{}) {\n\tif _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "50370aa19d2ed8b592bb8aea3206c170", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "ae3074aa68d84f6547d9c7a4a7422cdf", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6628242074927954, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n,i,r int64\n\t_, _ = fmt.Scanf(\"%d\\n\", &n)\n \n\tfor i = 1; i <= n; i++ {\n\t\tif i&1 == 1 {\n\t\t\tr += -i\n\t\t\tcontinue\n\t\t}\n\t\tr += i\n\t}\n\tfmt.Println(r)\n}", "lang": "Go", "bug_code_uid": "b47f7605c5252efb8ad10883ba12eef3", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "71a838d9956c8528d46666cb72c319e6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9869346733668342, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x,y int\n dx := [4]int{1,0,-1,0}\n dy := [4]int{0,1,0,-1}\n abs := func(a int) int { if a < 0 { return -a } else { return a } }\n fmt.Scan(&x,&y)\n curx, cury, ans, in := 0, 0, 0, 0\n for (curx != x) || (cury != y) {\n if ((in == 0) && (curx-cury == 1)) || ((in > 0) && (abs(curx) == abs(cury))) {\n in = (in+1)%4\n ans++\n }\n curx += dx[in]\n cury += dy[in]\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "efc2be7fd641e08b1231765908521e72", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "apr_id": "096bd7ebd31225da3a0157e017064a9e", "difficulty": 1400, "tags": ["geometry", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8621173827576524, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\ttc := readNum(reader)\n\tfor tc > 0 {\n\t\ttc--\n\t\tn := readNum(reader)\n\t\ta, b := solve(n)\n\t\tfmt.Printf(\"%d %d\\n\", a, b)\n\t}\n}\n\nfunc readInt(bytes []byte, from int, val *int) int {\n\ti := from\n\tsign := 1\n\tif bytes[i] == '-' {\n\t\tsign = -1\n\t\ti++\n\t}\n\ttmp := 0\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nfunc solve(n int) (int, int) {\n\tif n%2 == 0 {\n\t\treturn n / 2, n / 2\n\t}\n\tN := int64(n)\n\tbest := n - 1\n\t// n is odd\n\tfor a := 3; int64(a)*int64(a) <= N; a += 2 {\n\t\tif n%a == 0 {\n\t\t\tb := n - a\n\t\t\tif b%a == 0 {\n\t\t\t\tbest = min(best, b)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn n - best, best\n}\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang": "Go", "bug_code_uid": "1b2084f656e0a1204217fa124247bcd4", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "29ae13ba4aa992c7f9e553e4118b079d", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7070063694267515, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\nvar input *bufio.Reader\n\nfunc main() {\n\tvar T int\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &T)\n\tfor i := 0; i < T; i++ {\n\t\tsolver()\n\t}\n}\n\nfunc solver() {\n var n int\n\tfmt.Fscan(input, &n)\n b := int(1e9)\n for i := n / 2; true; i-- {\n if (n - i) % i == 0 {\n b = min(b, n - i)\n break\n } \n }\n\tfmt.Println(n - b, b)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}", "lang": "Go", "bug_code_uid": "1607f4f92a4732fe36979a6bdc0d5110", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "40ce530d0bf3b7fdb412b7bf24725e99", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7886855241264559, "equal_cnt": 18, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar done bool\n\t_, _ = fmt.Scanf(\"%d\", &n)\n\n\tfor p := 2; p * p <= n && !done; p++ {\n\t\tif n % p == 0 {\n\t\t\tk := n / p\n\t\t\tfmt.Println(k, n - k)\n\t\t\tdone = true\n\t\t}\n\t}\n\n\tif !done {\n\t\tfmt.Println(1, n - 1)\n\t}\n}", "lang": "Go", "bug_code_uid": "249db852df94876c0f9ed3075f037cf2", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "dbf9cf2abe575f91d2c4fa702c2cc958", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9962264150943396, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar t int\n\tfmt.Scan(&t)\n\tfor c:=0; c 240 {\n fmt.Println(i - 1)\n return\n }\n }\n fmt.Println(n)\n}", "lang": "Go", "bug_code_uid": "1636dbf3c223a5dfd8c840876b539980", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "75e1b994c5ce44f73fa4b85e44df5e1d", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9358974358974359, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\n\nfunc main() {\n\tvar n,k int\n\tfmt.Scanf(\"%d%d\",&n,&k)\n\tremain := 240 - k\n\tsum := 0\n\tvar i int = 0\n\tfor var i int = 1;i<=n&&sum<=remain;i++{\n\t\tsum += 5*i\n\t\tif sum<=remain{\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "99009d563318feda79e498cb59036949", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "40c2ba8ad883db47e9236c119d21a2b2", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9733333333333334, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcnt := 0\n\tfor i:=2; i<=n; i++ {\n\t\tif (n%i==0) {\n\t\t\tcnt++\n\t\t};\n\t}\n\tprint(cnt);\n}", "lang": "Go", "bug_code_uid": "1c5232d8c3781e07ef25b3785ffab6be", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "dea2ae743ef0564d1a26cc7dcc811745", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.732159406858202, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"math\"\n)\n\nfunc Employee(number int) int {\n\tvar array []int\n\tfor i:=1;i<=number/2;i++ {\n\t\tif number % i == 0 {\n\t\t\tarray = append(array,i)\n\t\t}\n\t}\n\tfmt.Println(array)\n\treturn len(array)\n}\n\nfunc main() {\n\tvar number int\n\tvar err error\n\tfor {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text,\"\\r\\n\")\n\tnumber,err = strconv.Atoi(text)\n\tif err == nil {\n\t\tif number > 2 && number < int(math.Pow(10,5)) {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(\"Enter number > 2 and < 10^5\")\n\t\t}\n\t\tfmt.Println(err)\n\t}\n\t}\n\tfmt.Println(Employee(number))\n}", "lang": "Go", "bug_code_uid": "6fa3b0454ca965e7a9946ea99c458075", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "4ec8fe459f93a42be93238ef5143fb02", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9411764705882353, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc Employee(number int) int {\n\tvar array []int\n\tfor i:=1;i<=number/2;i++ {\n\t\tif number % i == 0 {\n\t\t\tarray = append(array,i)\n\t\t}\n\t}\n\tfmt.Println(array)\n\treturn len(array)\n}\n\nfunc main() {\n\tvar number int\n\tvar err error\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text,\"\\r\\n\")\n\tnumber,err = strconv.Atoi(text)\n\tfmt.Println(Employee(number))\n}", "lang": "Go", "bug_code_uid": "4da7f32675c9768df902802badfe6d70", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "4ec8fe459f93a42be93238ef5143fb02", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9764705882352941, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n \nimport \"fmt\"\n \nfunc main(){\n\tvar n\n var res\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n; i++ {\n\t\tif n % i == 0 {\n\t\t res +=1\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "6088a86c851e44c14e35737b16f2d9e7", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "58b62fa4fae18b2b9fd14c68f9ed1ca0", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5335638144626909, "equal_cnt": 38, "replace_cnt": 27, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 37, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype graph struct {\n\tedges [][]int\n\tdegree []int\n\tscc int\n\tcolor []int\n}\n\nfunc (g *graph) add(from, to int) {\n\tg.edges[from] = append(g.edges[from], to)\n\tg.degree[from]++\n}\n\nfunc (g *graph) addBoth(from, to int) {\n\tg.add(from, to)\n\tif from != to {\n\t\tg.add(to, from)\n\t}\n}\n\nfunc (g *graph) dfs(v int) {\n\tg.color[v] = g.scc\n\tfor _, w := range g.edges[v] {\n\t\tif g.color[w] == 0 {\n\t\t\tg.dfs(w)\n\t\t}\n\t}\n}\n\nfunc (g *graph) check() bool {\n\tcnt := 0\n\tfor _, c := range g.color {\n\t\tif c == g.scc {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfor i, c := range g.color {\n\t\tif c == g.scc && g.degree[i] != cnt-1 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol623A(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tg := &graph{\n\t\tedges: make([][]int, n+1),\n\t\tdegree: make([]int, n+1),\n\t\tscc: 1,\n\t\tcolor: make([]int, n+1),\n\t}\n\tfor ; m > 0; m-- {\n\t\tvar v, w int\n\t\tFscan(in, &v, &w)\n\t\tg.addBoth(v, w)\n\t}\n\n\tg.dfs(1)\n\tif !g.check() {\n\t\tFprint(out, \"No\")\n\t\treturn\n\t}\n\tg.scc++\n\tfor i := 2; i <= n; i++ {\n\t\tif g.color[i] == 0 {\n\t\t\tg.dfs(i)\n\t\t\tbreak\n\t\t}\n\t}\n\tif !g.check() {\n\t\tFprint(out, \"No\")\n\t\treturn\n\t}\n\tfor _, c := range g.color[1:] {\n\t\tif c == 0 {\n\t\t\tFprint(out, \"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tFprintln(out, \"Yes\")\n\tfor _, c := range g.color[1:] {\n\t\tif c == 1 {\n\t\t\tFprint(out, \"a\")\n\t\t} else {\n\t\t\tFprint(out, \"c\")\n\t\t}\n\t}\n}\n\nfunc main() {\n\tSol623A(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "d65746c5e944ee5135ae9412cba35bd8", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "5421f59c2a84fd0eae64a984bc200f90", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9986684420772304, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n\t//\"strings\"\n)\n\nfunc main() {\n var s string\n //fmt.Scan(&s)\n input:= bufio.NewScanner(os.Stdin)\n //input.Split(bufio.ScanLines)\n var c rune\n input.Scan()\n s=input.Text()\n fmt.Println(s)\n //s = strings.TrimSpace(s)\n c = rune(s[len(s)-2])\n c = unicode.ToLower(c)\n var cek bool\n cek = unicode.IsSpace(c)\n //fmt.Println(cek)\n for i:=3;cek==true;i++ {\n \tc = rune(s[len(s)-i])\n \tc = unicode.ToLower(c)\n \tcek = unicode.IsSpace(c)\n }\n //fmt.Println(s)\n //fmt.Println(string(c))\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n", "lang": "Go", "bug_code_uid": "26df87d11c7375aa3a7b46e400464b13", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "4779c4a3df15567978f582d3c1940421", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7452596867271228, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n input:= bufio.NewScanner(os.Stdin)\n var c rune\n input.Scan()\n s=input.Text()\n c = rune(s[len(s)-2])\n //c = unicode.ToLower(c)\n //fmt.Println(s)\n fmt.Println(string(c))\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n", "lang": "Go", "bug_code_uid": "dad26d1c76a5ba8cf9ed02f03856704b", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "4779c4a3df15567978f582d3c1940421", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.957004160887656, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n\t\"strings\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n input:= bufio.NewScanner(os.Stdin)\n var c rune\n input.Scan()\n s=input.Text()\n s = strings.TrimSpace(s)\n c = rune(s[len(s)-2])\n c = unicode.ToLower(c)\n var cek bool\n cek = unicode.IsSpace(c)\n //fmt.Println(cek)\n for i:=3;cek==true;i++ {\n \tc = rune(s[len(s)-i])\n \tc = unicode.ToLower(c)\n \tcek = unicode.IsSpace(c)\n }\n //fmt.Println(s)\n //fmt.Println(string(c))\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n", "lang": "Go", "bug_code_uid": "c7cd930f44e56319776fc705f20580f5", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "4779c4a3df15567978f582d3c1940421", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9992313604919293, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// 49A-mic\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strings\"\n)\n\nfunc main() {\n z := bufio.NewScanner(os.Stdin)\n var y bool\n var s []string\n y = false\n z.Scan()\n ss := z.Text()\n ss = strings.ToLower(ss)\n l := len(ss)\n for i := l - 1; i > 0; i-- {\n if ss[i] == ' ' || ss[i] == '?' {\n continue\n } else {\n s = append(s, string(ss[i]))\n break\n }\n }\n if s[0] == \"a\" || s[0] == \"i\" || s[0] == \"u\" || s[0] == \"e\" || s[0] == \"o\" || s[0] == \"y\" {\n y = true\n }\n if y {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n", "lang": "Go", "bug_code_uid": "e0d68bf436c3ef7155e2e1a62ee8d811", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "ba564cdd1cca745d67c28bfa77f794b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9310344827586207, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tvar A = make([]int, n)\n\tvar T = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tT[n - 1 - i] = A[i]\n\n\t\tfor j := 0; n - 1 - i + j + 1 <= n - 1; j++ {\n\t\t\tl := n - 1 - i + j\n\t\t\tr := l + 1\n\t\t\td := T[l] - T[r]\n\n\t\t\tif d > 0 {\n\t\t\t\tT[r] += d\n\t\t\t\tT[l] -= d\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(T)\n}\n", "lang": "Go", "bug_code_uid": "9e909949b10b5a1fb4f3f28a69295fd1", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "31fd0b23631671fc731df55c383aa4b9", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8832271762208068, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar t, a int\n\tvar arr []int\n\tfmt.Scanf(\"%d\\n\", &t)\n\tfor i := 0; i < t; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tarr = append(arr, a)\n\t}\n\tsort.Ints(arr)\n\tfmt.Println(arr)\n}", "lang": "Go", "bug_code_uid": "f96ba5ff3da1724ca95bf6ae416ac696", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "46b094b2a638d285a3872d4d3560bf3b", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9885358663609565, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc fastGetInt(b []byte) int {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc solveFromFile() []int {\n\tvar num int\n\tvar numList []int\n\tfile, err := os.Open(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t}\n\tscanner := bufio.NewScanner(file)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tnum = fastGetInt(scanner.Bytes())\n\tnum++\n\tfor scanner.Scan() {\n\t\tnumList = append(numList, fastGetInt(scanner.Bytes()))\n\t}\n\n\tdefer file.Close()\n\n\treturn solution(numList)\n}\n\n//========== Implement Algorithm =======================\nfunc solution(numList []int) []int {\n\tsort.Ints(numList)\n\n\treturn numList\n}\n\nfunc main() {\n\n\t//================== Variables used ====================\n\tvar num int\n\tvar numList, ret []int\n\t//======================================================\n\n\tif len(os.Args) >= 2 {\n\t\t//============== Get return value from File ============\n\t\tret = solveFromFile()\n\n\t} else {\n\t\t//============== Get return value from STDIN ===========\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tscanner.Split(bufio.ScanWords)\n\n\t\tscanner.Scan()\n\t\tnum = fastGetInt(scanner.Bytes())\n\t\tnum++\n\n\t\tfor scanner.Scan() {\n\t\t\tnumList = append(numList, fastGetInt(scanner.Bytes()))\n\t\t}\n\n\t\tret = solution(numList)\n\t}\n\n\t//================== OUTPUT ============================\n\tfor x := range ret {\n\t\tfmt.Print(x)\n\t\tfmt.Print(\" \")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "bdd4e5e290b7dad9342985a3169c7f85", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "402b34aac8d22214a815d04cdb02e09d", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6731517509727627, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tvar a = make([]string, n, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%s\", &a[i])\n\t}\n\tsort.Strings(a)\n\tfmt.Printf(strings.Join(a, \" \"))\n}\n", "lang": "Go", "bug_code_uid": "aeef6f200e05d5236d4cf1d26af1d91b", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "ab170733ca13dc254ecfbdb83e8871be", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9702602230483272, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\n\nfunc main(){\n\tvar a , b , c , d int\n\tfmt.Scanf(\"%d%d\\n\" , &a , &b)\n\tfmt.Scanf(\"%d%d\" , &c , &d)\n\tfor i:=0 ; i<=110 ; i++ {\n\t\tif (b+i*a-d) % c == 0 {\n\t\t\tfmt.Printf(\"%d\\n\" ,b+i*a)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Printf(\"-1\\n\")\n}", "lang": "Go", "bug_code_uid": "2188b027d0daf779979050e6d92a50a2", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "f2ff3a104c9c0c31e2dc718d87b5905e", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9793233082706767, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "// You can edit this code!\n// Click here and start typing.\npackage main\n\nimport \"fmt\"\nimport \"strconv\"\nimport \"os\"\nimport \"bufio\"\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\tstart := strconv.Atoi(s.Text())\n\ts.Scan()\n\tevery := strconv.Atoi(s.Text())\n\ts.Scan()\n\teat := strconv.Atoi(s.Text())\n\n\tif eat == start {\n\t\tfmt.Println(\"YES\")\n\t}\n\n\tfor i := start + every; i <= eat; i += every {\n\t\tif eat == i || eat == i+1 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n\n}\n", "lang": "Go", "bug_code_uid": "a9c77ad520f4da32f55e148a95568c4d", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "e59564f31fed7c73e41e81d7f25b724d", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9227272727272727, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar t, s, x int\n\tfmt.Scanf(\"%d%d%d\", &t, &s, &x)\n\tif (x - t) % s == 0 || (x - t) % s == 1 && (x - t) / s > 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1c3c3b996c50b4884fcb57fdb8fe32a7", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "96f3aa596cc1b6eab521f31e6367917c", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6959517657192076, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc base(s, b int) int {\n ans := 0\n for s > 0 {\n s = s/b\n ans += 1 \n }\n return ans\n}\n\nfunc main(){\n var a, b int\n fmt.Scan(&a)\n fmt.Scan(&b)\n sum := a+b\n x := strconv.Itoa(a) + strconv.Itoa(b)\n z := uint8(48)\n for i := 0; i < len(x); i++ {\n if z < x[i] {\n z = x[i]\n }\n }\n fmt.Print(base(sum, int(z-47))) \n \n}", "lang": "Go", "bug_code_uid": "bee7c187892fd784921a34e6328af940", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "c99a8f98437c45ebd8d02e12b62f38f7", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9324324324324325, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar ps = fmt.Printf\nvar ss = fmt.Scanf\n\nconst mod int = 1000000007\n\nfunc main() {\n\tt := 0\n\tm := 0\n\tvar s, s1 string\n\tres := \"FUCK\\n\"\n\tss(\"%d\\n%s\", &t, &s)\n\tfor i := 0; i < t-1; i++ {\n\t\ts1 = \"\"\n\t\tcount := 0\n\t\ts1 = s1 + string(s[i]) + string(s[i+1])\n\t\tfor j := 0; j < t-1; j++ {\n\t\t\tif s1[0] == s[i] && s1[1] == s[i+1] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif count >= m {\n\t\t\tm = count\n\t\t\tres = s1\n\t\t}\n\t}\n\tps(\"%s\", res)\n}\n", "lang": "Go", "bug_code_uid": "e332eb9e339ca7bc16c2b4973db365ad", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "b28173600b0cdd6eaa1be70067127884", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.684, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\nimport.\"fmt\"\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tn,s,m:=0,\"\",\"\"\n\tScan(&n, &s)\n\tc:=map[string]int{}\n\tfor i := range s {\n\t\tfor j := i + 2; j <= n; j++ {\n\t\t\tc[s[i:j]]++\n\t\t}\n\t}\n\tfor s, v := range c {\n\t\tif v > c[m] {\n\t\t\tm = s\n\t\t}\n\t}\n\tPrint(m)\n}\n", "lang": "Go", "bug_code_uid": "6addf5c97d1a48335ac5f3a141543f17", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "3c5230496b8e2aeff35767288e07822a", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6996363636363636, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n\nfunc getMaxFromMap(ma map[string]int) int {\n max := -999999999\n for _, m := range(ma) {\n if m > max {\n max = m\n }\n }\n\n return max\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n _, _ = reader.ReadString('\\n')\n input, _ := reader.ReadString('\\n')\n\n ma := make(map[string]int)\n for i, c := range(input) {\n if i == len(input) - 1 {\n break\n }\n\n cu := string(c) + string(input[i + 1])\n if _, ok := ma[cu]; ok {\n ma[cu] += 1\n } else {\n ma[cu] = 1\n }\n }\n\n fmt.Println(getMaxFromMap(ma))\n}\n", "lang": "Go", "bug_code_uid": "a74840af246e1a7a152b404cbca42277", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "6ac7ffb43a93a832f65f34b350600b4d", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.44715447154471544, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar data string\n\tvar n int\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&data)\n\tvar ans2, max int = 0, 0\n\tformer := make([]int, 26)\n\tsame := make([]int, 26)\n\tnext := make([]int, 26)\n\tfor i := 0;i < n-1 ; i++ {\n\t\tif data[i] == data[i+1]{\n\t\t\tsame[data[i] - 'A']++\n\t\t\tif same[data[i] - 'A'] > max{\n\t\t\t\tans2 = i\n\t\t\t\tmax = same[data[i] - 'A']\n\t\t\t}\n\t\t} else if data[i] == 'Z' && data[i+1] == 'A' || data[i+1] == data[i]+1{\n\t\t\tnext[data[i] - 'A']++\n\t\t\tif next[data[i] - 'A'] > max{\n\t\t\t\tans2 = i\n\t\t\t\tmax = next[data[i] - 'A']\n\t\t\t}\n\t\t}else if data[i] == 'A' && data[i+1] == 'Z' || data[i+1] == data[i]-1{\n\t\t\tformer[data[i] - 'A']++\n\t\t\tif former[data[i] - 'A'] > max{\n\t\t\t\tans2 = i\n\t\t\t\tmax = former[data[i] - 'A']\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%c%c\", data[ans2], data[ans2+1])\n}", "lang": "Go", "bug_code_uid": "d799c363707f18397c5feddb43bb49d3", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "d5e0c475b8056d66c084add8161daab4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9975936748023376, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "// A. Petya and Origami\n/*\nPetya is having a party soon, and he has decided to invite his 𝑛 friends.\n\nHe wants to make invitations in the form of origami. For each invitation, he needs two red sheets, five green sheets, and eight blue sheets. The store sells an infinite number of notebooks of each color, but each notebook consists of only one color with 𝑘 sheets. That is, each notebook contains 𝑘 sheets of either red, green, or blue.\n\nFind the minimum number of notebooks that Petya needs to buy to invite all 𝑛 of his friends.\n\nInput\nThe first line contains two integers 𝑛 and 𝑘 (1≤𝑛,𝑘≤108) — the number of Petya's friends and the number of sheets in each notebook respectively.\n\nOutput\nPrint one number — the minimum number of notebooks that Petya needs to buy.\n\nExamples\nInput\n3 5\n\nOutput\n10\n\nInput\n15 6\n\nOutput\n38\n\nNote\nIn the first example, we need 2 red notebooks, 3 green notebooks, and 5 blue notebooks.\n\nIn the second example, we need 5 red notebooks, 13 green notebooks, and 20 blue notebooks.\n*/\npackage 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\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\tn, _ := strconv.ParseFloat(arr[0], 64)\n\tk, _ := strconv.ParseFloat(arr[1], 64)\n\n\tr := math.Ceil(float64(2.0 * n / k))\n\tg := math.Ceil(float64(5.0 * n / k))\n\tb := math.Ceil(float64(8.0 * n / k))\n\n\tfmt.Print(r + g + b)\n\n}\n", "lang": "Go", "bug_code_uid": "8c43f99a50329b0e8e4911120c9c3a38", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "942e8fe75530734e4e44eba1d60b6d27", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9791921664626683, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\n\nimport (\n\t\"fmt\"\t\n)\n\n\nfunc need(person, paper int) int {\n\treturn person / paper + add(person, paper) \n}\n\nfunc add(item1, item2 int) int {\n\tif item1 < item2 || item1 % item2 == 0 {\n\t\treturn 0\n\t} else {\n\t\treturn 1\n\t}\n}\n\nfunc main() {\n\tvar friends, papers, count int\n\n\tfmt.Scan(&friends, &papers)\n\n\tcount = need(friends*2, papers) + need(friends*5, papers) + need(friends*8, papers)\n\tfmt.Println(count)\n}\t\n", "lang": "Go", "bug_code_uid": "4732f6a3a254eb6e8d9cf1ac05c7dc54", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "8cac1254c76ccb283ca607bdd059c65b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.7420886075949367, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc GCD(a,b int64) int64 { if b == 0 { return a } else { return GCD(b,a%b) } }\nfunc LCM(a,b int64) int64 { return (a/GCD(a,b))*b }\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n ans := int64(1);\n if n <= 3 {\n for ; n > 0; n-- { ans *= n }\n\n } else if n%2 == 1 {\n for i := int64(0); i < 3; i++ {\n ans = LCM(ans,n-i)\n }\n } else {\n for i := int64(1); i <= 3; i++ {\n ans = LCM(ans,n-i)\n }\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "8ddc6d2ba62edc64fac9edf3da9bc4c3", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "9e23fae10c88bbcc00d56f0cc020b6e9", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6135328562134027, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\tprimes := sieves(n)\n\n\tif n == 1 {\n\t\tfmt.Println(\"1\")\n\t\treturn\n\t} else if n == 2 {\n\t\tfmt.Println(\"2\")\n\t\treturn\n\t} else if n == 3 {\n\t\tfmt.Println(\"6\")\n\t\treturn\n\t}\n\n\tset := []int64(nil)\n\tif n%2 == 0 {\n\t\tset = append(set, int64(n-1))\n\t} else {\n\t\tset = append(set, int64(n))\n\t}\n\tfor i := set[0] - 1; i >= 1; i-- {\n\t\tisDiv := false\n\t\tfor j := 0; j < len(set); j++ {\n\t\t\tif i%set[j] == 0 {\n\t\t\t\tisDiv = true\n\t\t\t}\n\t\t}\n\t\tif !isDiv {\n\t\t\tset = append(set, i)\n\t\t}\n\t\tif len(set) == 3 {\n\t\t\tbreak\n\t\t}\n\t}\n\t//fmt.Println(set)\n\tfmt.Println(mul(set, primes))\n}\n\nfunc mul(xs, primes []int64) (ans int64) {\n\tfactors := make([]int64, len(primes))\n\tfor i := 0; i < len(xs); i++ {\n\t\tx := xs[i]\n\t\tiFactors := make([]int64, len(primes))\n\t\tfor x > 1 {\n\t\t\tfor j := 0; j < len(primes); j++ {\n\t\t\t\tif x%primes[j] == 0 {\n\t\t\t\t\tx /= primes[j]\n\t\t\t\t\tiFactors[j]++\n\t\t\t\t\tif iFactors[j] > factors[j] {\n\t\t\t\t\t\tfactors[j] = iFactors[j]\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans = 1\n\tfor i := 0; i < len(factors); i++ {\n\t\tif factors[i] > 0 {\n\t\t\tans *= int64(math.Pow(float64(primes[i]), float64(factors[i])))\n\t\t}\n\t}\n\treturn\n}\n\nfunc sieves(n int) (primes []int64) {\n\tn = n + 1\n\txs := make([]bool, n)\n\txs[0] = true\n\txs[1] = true\n\tprimes = make([]int64, 0, n)\n\tfor i := 2; i < n; i++ {\n\t\tfor j := i * 2; j < n; j = j + i {\n\t\t\txs[j] = true\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif !xs[i] {\n\t\t\tprimes = append(primes, int64(i))\n\t\t}\n\t}\n\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "b0c9f4e5c8539d2e0cc5a3196612d9e0", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "51dd2023f4138af2029944882a50f12a", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5962815405046481, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\tprimes := sieves(n)\n\n\tif n <= 3 {\n\t\tfmt.Println(mul([]int64{1, 2, 6}, primes), primes)\n\t\treturn\n\t}\n\n\tset := []int64(nil)\n\tif n%2 == 0 {\n\t\tset = append(set, int64(n-1))\n\t} else {\n\t\tset = append(set, int64(n))\n\t}\n\tfor i := set[0] - 1; i >= 1; i-- {\n\t\tisDiv := false\n\t\tfor j := 0; j < len(set); j++ {\n\t\t\tif i%set[j] == 0 {\n\t\t\t\tisDiv = true\n\t\t\t}\n\t\t}\n\t\tif !isDiv {\n\t\t\tset = append(set, i)\n\t\t}\n\t\tif len(set) == 3 {\n\t\t\tbreak\n\t\t}\n\t}\n\t//fmt.Println(set)\n\tfmt.Println(mul(set, primes))\n}\n\nfunc mul(xs, primes []int64) (ans int64) {\n\tfactors := make([]int64, len(primes))\n\tfor i := 0; i < len(xs); i++ {\n\t\tx := xs[i]\n\t\tiFactors := make([]int64, len(primes))\n\t\tfor x > 1 {\n\t\t\tfor j := 0; j < len(primes); j++ {\n\t\t\t\tif x%primes[j] == 0 {\n\t\t\t\t\tx /= primes[j]\n\t\t\t\t\tiFactors[j]++\n\t\t\t\t\tif iFactors[j] > factors[j] {\n\t\t\t\t\t\tfactors[j] = iFactors[j]\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans = 1\n\tfor i := 0; i < len(factors); i++ {\n\t\tif factors[i] > 0 {\n\t\t\tans *= int64(math.Pow(float64(primes[i]), float64(factors[i])))\n\t\t}\n\t}\n\treturn\n}\n\nfunc sieves(n int) (primes []int64) {\n\tn = n + 1\n\txs := make([]bool, n)\n\txs[0] = true\n\txs[1] = true\n\tprimes = make([]int64, 0, n)\n\tfor i := 2; i < n; i++ {\n\t\tfor j := i * 2; j < n; j = j + i {\n\t\t\txs[j] = true\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif !xs[i] {\n\t\t\tprimes = append(primes, int64(i))\n\t\t}\n\t}\n\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "d973667e927ee9c44dc938efb2fc2906", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "51dd2023f4138af2029944882a50f12a", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9190172884440401, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/235/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(n int64) int64 {\n\tif n%2 == 1 {\n\t\treturn n * (n - 1) * (n - 2)\n\t} else if n%2 == 0 && n%3 == 0 {\n\t\treturn (n - 1) * (n - 2) * (n - 3)\n\t}\n\treturn n * (n - 1) * (n - 3)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int64\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n))\n}\n", "lang": "Go", "bug_code_uid": "5227d0231d0fa0d97b97f54052259ca2", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "fecfe20d12dbd26cca09fe1d8205d33e", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6876971608832808, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "// https://codeforces.com/contest/13/problem/A\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\tvar (\n\t\tA int \n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &A)\n\tans := 0\n\tcnt := 0\n\tfor i := 2; i < A; i++ {\n\t\ttmp := A\n\t\tfor tmp > 0 {\n\t\t\tans += tmp % i\n\t\t\ttmp /= i\n\t\t}\n\t\tcnt++\n\t}\n\n\tfmt.Printf(\"%d/%d\", ans, cnt)\n}\n", "lang": "Go", "bug_code_uid": "b7940b05e4b1bac900837dcdef6989df", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "e694fd46936be021ff3c0135b778d879", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9706336939721792, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// 13A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t} else {\n\t\treturn gcd(m, n%m)\n\t}\n}\n\nfunc main() {\n\tvar n, m, i int\n\tsum := 0\n\tfmt.Scan(&n)\n\tfor i = 2; i < n; i++ {\n\t\tm = n\n\t\tfor m != 0 {\n\t\t\tsum += m % i\n\t\t\tm /= i\n\t\t}\n\t}\n\tfmt.Println(sum/gcd(sum, n-2), \"/\", (n-2)/gcd(sum, n-2))\n}\n", "lang": "Go", "bug_code_uid": "285aa7055419bf102eb963bbf1a58939", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "23443def65c0747e3554793c2573e9ce", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9870967741935484, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc build_tree() [][]uint64 {\n\toutput := make([][]uint64, 35)\n\tfor i:=0; i<=30; i++ {\n\t\tt := make([]uint64, 35)\n\t\tt[0]=1\n\t\tfor j:=1; j<=i; j++ {\n\t\t\tt[j] = output[i-1][j] + output[i-1][j-1]\n\t\t}\n\t\toutput[i] = t\n\t}\n\treturn output\n}\n\nfunc main() {\n\ttree := build_tree()\n\tvar n, m, t int\n\tvar ans uint64\n\tfmt.Scan(&n, &m, &t)\n\tfor i:=4; i<=n; i++ {\n\t\tif t-i < 1 {continue}\n\t\tans += tree[n][i] * tree[m][t-i]\n\t}\n\tfmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "04f42663645f4c8402d21d6d06bd32f3", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "500157ae0adf126473704685ab64ba88", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9714285714285714, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n str := \"0\"\n for i:=1; i<=n; i++{\n s, _ := strconv.Itoa(i)\n str += s\n }\n fmt.Print(str[n])\n}", "lang": "Go", "bug_code_uid": "ad0fef72a2dcbb91b7be2fa9f5687c0c", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "832b05576b7003d92c8a5fa938a9aa26", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9952830188679245, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n str := \"0\"\n for i:=1; i<=n; i++{\n s := strconv.Itoa(i)\n str += s\n }\n fmt.Printf(\"%d\", str[n])\n}", "lang": "Go", "bug_code_uid": "1d5562c1fd1fb8c8578598f894acc996", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "832b05576b7003d92c8a5fa938a9aa26", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9887640449438202, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc solve(s string) int {\n\tvar current byte = 'a'\n\tsum := 0\n\tfor i := range s {\n\t\td := abs(int(current), int(s[i]))\n\t\tif d < 13 {\n\t\t\tsum += d\n\t\t} else {\n\t\t\tsum += 26 - d\n\t\t}\n\t\tcurrent = s[i]\n\t}\n\n\treturn sum\n}\n\nfunc abs(n1 int, n2 int) int {\n\td := n1 - n2\n\tif d > 0 {\n\t\treturn d\n\t}\n\n\treturn n2 - n1\n}\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\n\tvar s string\n\n\tfmt.Fscanf(r, \"%s\\n\", &s)\n\n\tfmt.Fprintf(os.Stdout, \"%d\\n\", solve(s))\n}\n", "lang": "Go", "bug_code_uid": "11a6a9d142c2877a20ad6ae519af6139", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "61ebafd19d4f6c0f831c44773514fe5b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9793488372093023, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "/*\nEpic Game\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nSimon and Antisimon play a game. Initially each player receives one fixed positive integer that doesn't change throughout the game. Simon receives number a and Antisimon receives number b. They also have a heap of n stones. The players take turns to make a move and Simon starts. During a move a player should take from the heap the number of stones equal to the greatest common divisor of the fixed number he has received and the number of stones left in the heap. A player loses when he cannot take the required number of stones (i. e. the heap has strictly less stones left than one needs to take).\n\nYour task is to determine by the given a, b and n who wins the game.\n\nInput\nThe only string contains space-separated integers a, b and n (1 ≤ a, b, n ≤ 100) — the fixed numbers Simon and Antisimon have received correspondingly and the initial number of stones in the pile.\n\nOutput\nIf Simon wins, print \"0\" (without the quotes), otherwise print \"1\" (without the quotes).\n\nSample test(s)\ninput\n3 5 9\noutput\n0\ninput\n1 1 100\noutput\n1\nNote\nThe greatest common divisor of two non-negative integers a and b is such maximum positive integer k, that a is divisible by k without remainder and similarly, b is divisible by k without remainder. Let gcd(a, b) represent the operation of calculating the greatest common divisor of numbers a and b. Specifically, gcd(x, 0) = gcd(0, x) = x.\n\nIn the first sample the game will go like that:\n\nSimon should take gcd(3, 9) = 3 stones from the heap. After his move the heap has 6 stones left.\nAntisimon should take gcd(5, 6) = 1 stone from the heap. After his move the heap has 5 stones left.\nSimon should take gcd(3, 5) = 1 stone from the heap. After his move the heap has 4 stones left.\nAntisimon should take gcd(5, 4) = 1 stone from the heap. After his move the heap has 3 stones left.\nSimon should take gcd(3, 3) = 3 stones from the heap. After his move the heap has 0 stones left.\nAntisimon should take gcd(5, 0) = 5 stones from the heap. As 0 < 5, it is impossible and Antisimon loses.\nIn the second sample each player during each move takes one stone from the heap. As n is even, Antisimon takes the last stone and Simon can't make a move after that.\n*/\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(a, b int) int {\n if b == 0 {\n return a\n } \n return gcd(b, a % b)\n}\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &n)\n\n\tvar person int\n\tfor take, count := gcd(a, n), 1;take < n;take = gcd(a, n) {\n\t\tn -= take\n\t\tperson += count\n\t\tcount *= -1\n\t}\n\tfmt.Println(person)\n}\n", "lang": "Go", "bug_code_uid": "7ac052a76bea043b67f0576e9fdc2e82", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "8d8c748fceb9c4b86f04524afd824a10", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9733333333333334, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d %d %d \\n\", &a, &b, &n)\n\tres := getStones(a, b, n)\n\tfmt.Println(strconv.Itoa(res))\n\n}\n\nfunc canN(n, a int) bool {\n\tif n >= a {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc getStones(a, b, n int) (result int) {\n\tfor n > 0 {\n\t\tfirst := Nod(a, n)\n\t\tsecond := Nod(b, n)\n\t\tif canN(n, first) {\n\t\t\tn -= first\n\t\t\tresult = 0\n\t\t} else {\n\t\t\tresult++\n\t\t\treturn\n\t\t}\n\t\tif canN(n, second) {\n\t\t\tn -= second\n\t\t\tresult++\n\t\t} else {\n\t\t\tresult = 0\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\nfunc Nod(a, b int) int {\n\tvar del int\n\tchastnoe := 0\n\tdel = min(a, b)\n\tfor i := 1; chastnoe != a; i++ {\n\t\tif a%i != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tdel = a / i\n\t\tchastnoe = a / del\n\t\tif b%del == 0 {\n\t\t\treturn del\n\t\t}\n\t}\n\treturn 1\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang": "Go", "bug_code_uid": "aed41b5104c2c2c6f15ad1b4c3a42191", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "343d27d211e354b5391b61de21ccc788", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9931714719271624, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "/*********************************************************************************\n* File Name : A.go\n* Created By : YIMMON, yimmon.zhuang@gmail.com\n* Creation Date : [2014-03-04 23:07]\n* Last Modified : [2014-03-04 23:27]\n* Description :\n**********************************************************************************/\n\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner.Split(bufio.ScanWords)\n\n var n, p, k = scanner.nextInt(), scanner.nextInt(), scanner.nextInt()\n if p != 1 {\n fmt.Print(\"<< \")\n }\n for i := max(1, p-k); i < p; i++ {\n fmt.Printf(\"%d \", i)\n }\n fmt.Printf(\"(%d)\", p)\n for i := p + 1; i <= n && i <= p+k; i++ {\n fmt.Printf(\" %d\", i)\n }\n if p != n {\n fmt.Print(\" >>\")\n }\n fmt.Println()\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\ntype Scanner struct {\n *bufio.Scanner\n}\n\nvar scanner = Scanner{bufio.NewScanner(os.Stdin)}\n\nfunc (self *Scanner) next() string {\n if !self.Scan() {\n panic(self.Err())\n }\n return self.Text()\n}\n\nfunc (self *Scanner) nextInt() int {\n x, err := strconv.Atoi(self.next())\n if err != nil {\n panic(err)\n }\n return x\n}", "lang": "Go", "bug_code_uid": "f132037c7d7284c769449cf77df6a155", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "bdcf66bc96fcbd63c1dff9dffd0310c6", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.66565579984837, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "/*********************************************************************************\n* File Name : A.go\n* Created By : YIMMON, yimmon.zhuang@gmail.com\n* Creation Date : [2014-03-04 23:07]\n* Last Modified : [2014-03-04 23:29]\n* Description :\n**********************************************************************************/\n\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner.Split(bufio.ScanWords)\n\n var n, p, k = scanner.nextInt(), scanner.nextInt(), scanner.nextInt()\n if p-k > 1 {\n fmt.Print(\"<< \")\n }\n for i := max(1, p-k); i < p; i++ {\n fmt.Printf(\"%d \", i)\n }\n fmt.Printf(\"(%d)\", p)\n for i := p + 1; i <= n && i <= p+k; i++ {\n fmt.Printf(\" %d\", i)\n }\n if p+k < n {\n fmt.Print(\" >>\")\n }\n fmt.Println()\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\ntype Scanner struct {\n *bufio.Scanner\n}\n\nvar scanner = Scanner{bufio.NewScanner(os.Stdin)}\n\nfunc (self *Scanner) next() string {\n if !self.Scan() {\n panic(self.Err())\n }\n return self.Text()\n}\n\nfunc (self *Scanner) nextInt() int {\n x, err := strconv.Atoi(self.next())\n if err != nil {\n panic(err)\n }\n return x\n}/*********************************************************************************\n* File Name : A.go\n* Created By : YIMMON, yimmon.zhuang@gmail.com\n* Creation Date : [2014-03-04 23:07]\n* Last Modified : [2014-03-04 23:29]\n* Description :\n**********************************************************************************/\n\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner.Split(bufio.ScanWords)\n\n var n, p, k = scanner.nextInt(), scanner.nextInt(), scanner.nextInt()\n if p-k > 1 {\n fmt.Print(\"<< \")\n }\n for i := max(1, p-k); i < p; i++ {\n fmt.Printf(\"%d \", i)\n }\n fmt.Printf(\"(%d)\", p)\n for i := p + 1; i <= n && i <= p+k; i++ {\n fmt.Printf(\" %d\", i)\n }\n if p+k < n {\n fmt.Print(\" >>\")\n }\n fmt.Println()\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\ntype Scanner struct {\n *bufio.Scanner\n}\n\nvar scanner = Scanner{bufio.NewScanner(os.Stdin)}\n\nfunc (self *Scanner) next() string {\n if !self.Scan() {\n panic(self.Err())\n }\n return self.Text()\n}\n\nfunc (self *Scanner) nextInt() int {\n x, err := strconv.Atoi(self.next())\n if err != nil {\n panic(err)\n }\n return x\n}", "lang": "Go", "bug_code_uid": "a73860c06a07cf040be711f3b17d55bf", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "bdcf66bc96fcbd63c1dff9dffd0310c6", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.932868352223191, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar totalNum, currentNum, showSize int\n\tfmt.Scanf(\"%d\", &totalNum)\n\tfmt.Scanf(\"%d\", ¤tNum)\n\tfmt.Scanf(\"%d\", &showSize)\n\n\tif currentNum - showSize > 1 {\n\t\tfmt.Print(\"<< \")\n\t}\n\tfor i := showSize; i >0; i-- {\n\t\tfmt.Printf(\"%d \", currentNum - i)\n\t}\n\tfmt.Printf(\"(%d)\", currentNum)\n\tfor i := 1; i <= showSize; i++ {\n\t\tshowNum := currentNum + i\n\t\tif showNum > totalNum {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Printf(\" %d\", showNum)\n\t\t}\n\t}\n\tif(currentNum + showSize < totalNum) {\n\t\tfmt.Print(\" >>\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d06fc90fbf3ed24a2bcb7f8354b90ef5", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "97770c4b69fee0d4547ee0d8a63aabfd", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9214323890967397, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\nvar writer *bufio.Writer\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer = bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n a, b := getI(), getI()\n t, d := getI(), getI()\n result := a + b\n x := a\n for i := 2; i < t; i++ {\n x += d\n result += x\n }\n excess := x-b-d\n subtract := 0\n for excess > 0 {\n if excess < 2*d {\n subtract += excess\n excess = 0\n } else {\n subtract += 2*d\n excess -= 2*d\n }\n result -= subtract\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang": "Go", "bug_code_uid": "bef9f92df5ea4c066be7745c37457b4c", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "e5d0f3bebcc1017f353227d7ad84501b", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9850622406639005, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tMAX_T = 100\n)\n\nvar v1, v2 int\nvar T, D int\nvar dp [MAX_T][MAX_T * 10]int\n\nfunc init() {\n\tfor i := 0; i < MAX_T; i++ {\n\t\tfor j := 0; j < len(dp[i]); j++ {\n\t\t\tdp[i][j] = -1\n\t\t}\n\t}\n}\n\nfunc memo(t, v int) int {\n\tif t == T {\n\t\tif v == v2 {\n\t\t\treturn 0\n\t\t}\n\t\treturn -1145141919\n\t}\n\tif dp[t][v] >= 0 {\n\t\treturn dp[t][v]\n\t}\n\tres := -1145141919\n\tres = IntMax(res, memo(t+1, v)+v)\n\tfor i := 1; i <= D; i++ {\n\t\tres = IntMax(res, memo(t+1, v+i)+v+i)\n\t\tif v-i >= 0 {\n\t\t\tres = IntMax(res, memo(t+1, v-i)+v-i)\n\t\t}\n\t}\n\tdp[t][v] = res\n\treturn res\n}\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tv1, v2 = fsc.NextInt(), fsc.NextInt()\n\tT, D = fsc.NextInt(), fsc.NextInt()\n\tfmt.Println(memo(1, v1) + v1)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) 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 *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) 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\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n", "lang": "Go", "bug_code_uid": "9de9ca5779bd1ae56f249445b9d5da11", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "1749aaab1c26dae25c021f74fdc89c47", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.999589995899959, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tMAX_T = 100\n)\n\nvar v1, v2 int\nvar T, D int\nvar dp [MAX_T][MAX_T * 10]int\nvar visited [MAX_T][MAX_T * 10]bool\n\nfunc init() {\n\tfor i := 0; i < MAX_T; i++ {\n\t\tfor j := 0; j < len(dp[i]); j++ {\n\t\t\tdp[i][j] = -1\n\t\t}\n\t}\n}\n\nfunc memo(t, v int) int {\n\tif t == T {\n\t\tif v == v2 {\n\t\t\treturn 0\n\t\t}\n\t\treturn -1145141919\n\t}\n\tif visited[t][v] {\n\t\treturn dp[t][v]\n\t}\n\tvisited[t][v] = true\n\tres := -1145141919\n\tres = IntMax(res, memo(t+1, v)+v)\n\tfor i := 1; i <= D; i++ {\n\t\tres = IntMax(res, memo(t+1, v+i)+v+i)\n\t\tif v-i >= 0 {\n\t\t\tres = IntMax(res, memo(t+1, v-i)+v-i)\n\t\t}\n\t}\n\tdp[t][v] = res\n\treturn res\n}\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tv1, v2 = fsc.NextInt(), fsc.NextInt()\n\tT, D = fsc.NextInt(), fsc.NextInt()\n\tfmt.Println(memo(1, v1) + v1)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) 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 *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) 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\n//Max,Min\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//Gcd\nfunc IntGcd(a, b int) int {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn IntGcd(b, a%b)\n}\nfunc Int64Gcd(a, b int64) int64 {\n\tif a < b {\n\t\tb, a = a, b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn Int64Gcd(b, a%b)\n}\n", "lang": "Go", "bug_code_uid": "9b219ec4944908dcddf0d290daa45896", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "1749aaab1c26dae25c021f74fdc89c47", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9364548494983278, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc int_abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc int_max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc int_min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar v1, v2, t, d int\n\tfmt.Scanf(\"%d%d%d%d\", &v1, &v2, &t, &d)\n\tans := 0\n\tspeed := v1\n\tfor i := 0; i < t; i++ {\n\t\tans += speed\n\t\tspeed = int_min(speed+d, v2+d*(t-2-i))\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "52838fadb3afa44fcf7ada2682580368", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "9e8db7b5c9f00e0117dba64ad1c10430", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9970588235294118, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc queen(x int64, y int64, z int64) int {\n\tres := z * 2\n\tif x == y {\n\t\tres += x * 2\n\t\treturn res\n\t} else if x > y {\n\t\tres += y * 2 + 1\n\t\treturn res\n\t} else {\n\t\tres += x * 2 + 1\n\t\treturn res\n\t}\n}\n \nfunc main() {\n\tvar a int64\n\tvar b int64\n\tvar c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(queen(a, b, c))\n}", "lang": "Go", "bug_code_uid": "84a789168c7a586c4cbaafb03fc10f1c", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "cfc04ef94f88bd334ba2c832b8578495", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8683127572016461, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(a, b, c uint64) uint64 {\n\tres := a\n\tif b < a {\n\t\tres = b\n\t}\n\n\treturn 2*res + 2*c\n}\n\nfunc main() {\n\tvar a, b, c uint64\n\n\tfmt.Scan(&a, &b, &c)\n\n\tres := solve(a, b, c)\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "110216ab5cfbae6875ec94467beaf6c0", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "85dd77ac63b555efefb365ef1d6e36f8", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9238845144356955, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar a , b ,c int\n\tfmt.Fscan(in,&a,&b,&c)\n\t//3 2\n\ttotal := min1(a,b) + c * 2\n\tif(a != b){\n\t\ttotal += 1\n\t}\n\tfmt.Fprint(out,total)\n\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n", "lang": "Go", "bug_code_uid": "dbfd5b641d45d715a274b66557e8fac7", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "6529c6fe7360a92edc03ef40f44ffd97", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.983957219251337, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k,w,d int64\n\tfmt.Scan(&k,&d,&w)\n\tn:=(k+(w*k))*w/2\n\tn-=d\n\tif n<0{\n\t\tfmt.Printf(\"%d\\n\",'0')\n\t} else {\n\t\tfmt.Printf(\"%d\\n\",n)\n\t}\n\t\n\t\n\t\n\t\n}", "lang": "Go", "bug_code_uid": "3cdd3ed6df4de3a484828bcc3e526c32", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "ad18773659c4538483b4af885dcc2f55", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9444444444444444, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k,w,d int64\n\tfmt.Scan(&k,&d,&w)\n\tn:=(k+(w*k))*w/2\n\tn-=d\n\tif n<0{\n\t\tfmt.Printf('0')\n\t} else {\n\t\tfmt.Printf(n)\n\t}\n\t\n\t\n\t\n\t\n}", "lang": "Go", "bug_code_uid": "f8e9bfd4ae5ec90680f5a455b066e84c", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "ad18773659c4538483b4af885dcc2f55", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8139059304703476, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport(\n \"fmt\"\n)\n\ntype i64 int64\n\nfunc main(){\n var(\n k,n,w,res i64\n )\n fmt.Scan(&k,&n,&w)\n res = (k *w*(w+1))/2\n fmt.Println(res)\n if res > n{\n fmt.Println(res-n)\n }else{\n fmt.Println(0)\n }\n}\n", "lang": "Go", "bug_code_uid": "2db9e72898145f6dbf7fe9e4de1c4211", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "559ee6fb51cc379b97402adbacac0593", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9975124378109452, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF11B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar x, s, i int\n\tFscan(in, &x)\n\tif x < 0 {\n\t\tx = -x\n\t}\n\tfor {\n\t\ts += i\n\t\tif s >= x && (s-x)&3 == 0 {\n\t\t\tFprint(out, i)\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n}\n\nfunc main() { CF11B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "2fdc38be8f55c842c59e03a76c89ea81", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "8b6c06563c2e1fb16cfb4075bd48f098", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.495364238410596, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "// 388A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x [100]int\n\tvar n, rnt int\n\tfor fmt.Scan(n) {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfmt.Scan(x[i])\n\t\t}\n\t\tsort.Ints(x[:])\n\t\tfor rnt = 1; rnt <= n; rnt++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif x[j]-j/rnt < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif j == n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(rnt)\n}\n", "lang": "Go", "bug_code_uid": "02256afab2e4bf900c24a05ad16bd6b4", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "4666e7e8d9dc2a884bc1a9883af41d3c", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8326530612244898, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "// 388A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, rnt int\n\tx := make([]int, n)\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(x[i])\n\t}\n\tsort.Ints(x)\n\tfor rnt = 1; rnt <= n; rnt++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif x[j]-j/rnt < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(rnt)\n}\n", "lang": "Go", "bug_code_uid": "139126595490756d9e27115d644ed364", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "4666e7e8d9dc2a884bc1a9883af41d3c", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8439620081411127, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "// 388A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, rnt int\n\tfmt.Scan(&n)\n\tx := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(x[i])\n\t}\n\tsort.Ints(x)\n\tfor rnt = 1; rnt <= n; rnt++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif x[j] < (j / rnt) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(rnt)\n}\n", "lang": "Go", "bug_code_uid": "86131cbfde40fc9acba2211cc2b92828", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "4666e7e8d9dc2a884bc1a9883af41d3c", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9115075201119273, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t// \"bufio\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\tstrings \"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t_, _, _ = reader.ReadLine()\n\ttext, _, _ := reader.ReadLine()\n\n\tstr := string(text)\n\n\tif !strings.Contains(str, \"R\") && !strings.Contains(str, \"B\") {\n\t\tfmt.Println(\"G\")\n\t} else if !strings.Contains(str, \"G\") && !strings.Contains(str, \"B\") {\n\t\tfmt.Println(\"R\")\n\t} else if !strings.Contains(str, \"R\") && !strings.Contains(str, \"G\") {\n\t\tfmt.Println(\"B\")\n\t} else if !strings.Contains(str, \"R\") && len(str) == 2 {\n\t\tfmt.Println(\"R\")\n\t} else if !strings.Contains(str, \"B\") && len(str) == 2 {\n\t\tfmt.Println(\"B\")\n\t} else if !strings.Contains(str, \"G\") && len(str) == 2 {\n\t\tfmt.Println(\"G\")\n\t} else if !strings.Contains(str, \"R\") {\n\t\tif ada1(str, \"B\") {\n\t\t\tfmt.Println(\"BR\")\n\t\t} else if ada1(str, \"G\") {\n\t\t\tfmt.Println(\"GR\")\n\t\t} else {\n\t\t\tfmt.Println(\"BGR\")\n\t\t}\n\t} else if !strings.Contains(str, \"B\") {\n\t\tif ada1(str, \"R\") {\n\t\t\tfmt.Println(\"BR\")\n\t\t} else if ada1(str, \"G\") {\n\t\t\tfmt.Println(\"BG\")\n\t\t} else {\n\t\t\tfmt.Println(\"BGR\")\n\t\t}\n\t} else if !strings.Contains(str, \"G\") {\n\t\tif ada1(str, \"B\") {\n\t\t\tfmt.Println(\"BG\")\n\t\t} else if ada1(str, \"R\") {\n\t\t\tfmt.Println(\"GR\")\n\t\t} else {\n\t\t\tfmt.Println(\"BGR\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"BGR\")\n\t}\n}\n\nfunc ada1(str string, a string) bool {\n\n\treturn strings.Contains(str, a)\n}\n", "lang": "Go", "bug_code_uid": "a33f71d40db577aab61d3558bffc43b6", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "627724abc6a5198b581ebaefa120de6b", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9610778443113772, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc canReach(a, b, c int) bool {\n\tif b == 0 && c == 1 {\n\t\treturn false\n\t}\n\tif c == 0 && b == 1 {\n\t\treturn false\n\t}\n\tif a > 0 {\n\t\treturn true\n\t}\n\tif b > 0 && c > 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tcounts := [3]int{}\n\n\tvar s string\n\tfmt.Scan(&s)\n\tfor _, r := range s {\n\t\tswitch r {\n\t\tcase 'R':\n\t\t\tcounts[0]++\n\t\tcase 'G':\n\t\t\tcounts[1]++\n\t\tcase 'B':\n\t\t\tcounts[2]++\n\t\t}\n\t}\n\n\tif canReach(counts[0], counts[1], counts[2]) {\n\t\tfmt.Print(\"R\")\n\t}\n\tif canReach(counts[1], counts[0], counts[2]) {\n\t\tfmt.Print(\"G\")\n\t}\n\tif canReach(counts[2], counts[1], counts[0]) {\n\t\tfmt.Print(\"B\")\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "44865bb31d9d400a19589f1fcc81eec9", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "9717f14b569158fc70c73959aa1bc77b", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.23665382498624105, "equal_cnt": 21, "replace_cnt": 20, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 21, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst None = 0\nconst Red = 1\nconst Blue = 2\nconst Green = 4\n\nfunc colors(r, g, b int) int {\n\tif r < 0 || g < 0 || b < 0 {\n\t\treturn None\n\t}\n\t// fmt.Println(r, g, b)\n\tif r == 1 && g == 0 && b == 0 {\n\t\treturn Red\n\t}\n\tif r == 0 && g == 1 && b == 0 {\n\t\treturn Green\n\t}\n\tif r == 0 && g == 0 && b == 1 {\n\t\treturn Blue\n\t}\n\n\tresult := None\n\n\tfor _, i := range [][]int{\n\t\t[]int{r + 1, g - 1, b - 1},\n\t\t[]int{r - 1, g + 1, b - 1},\n\t\t[]int{r - 1, g - 1, b + 1},\n\t} {\n\t\tresult = result | colors(i[0], i[1], i[2])\n\t}\n\tif r > 1 {\n\t\tresult = result | colors(r-1, g, b)\n\t}\n\tif g > 1 {\n\t\tresult = result | colors(r, g-1, b)\n\t}\n\tif b > 1 {\n\t\tresult = result | colors(r, g, b-1)\n\t}\n\treturn result\n}\n\nfunc main() {\n\tvar count int\n\tvar col string\n\n\tfmt.Scan(&count)\n\tfmt.Scan(&col)\n\n\tvar r, g, b int\n\n\tfor _, c := range col {\n\t\tswitch c {\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\n\t// fmt.Println(r, g, b)\n\tresult := colors(r, g, b)\n\t// fmt.Println(result)\n\tif (result & Blue) != 0 {\n\t\tfmt.Print(\"B\")\n\t}\n\tif (result & Green) != 0 {\n\t\tfmt.Print(\"G\")\n\t}\n\tif (result & Red) != 0 {\n\t\tfmt.Print(\"R\")\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "dcca639c4aaade654789bffe4fee34c3", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "9717f14b569158fc70c73959aa1bc77b", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5085470085470085, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int64\n var a [10]int64\n fmt.Scan(&n)\n \n for i := 0; i < 9; i++ {\n a[i] = n / 9\n if i != 0 && n % 9 >= i {\n a[i] += 1\n }\n }\n \n for i := 0; i < 9; i++ {\n for j := 0; j < 9; j++ {\n ans += a[i] * a[j] * a[i * j]\n }\n }\n \n for i := 1; i <= n; i++ {\n ans -= n / int64(i)\n }\n fmt.Println(ans)\n \n return\n}", "lang": "Go", "bug_code_uid": "f55e7660bbaa01b6733c63af4d4951cd", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "1964885131a2255fbf52ffb5a662a21e", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9957894736842106, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int64\n var a [10]int64\n fmt.Scan(&n)\n \n for i := 0; i < 9; i++ {\n a[i] = n / 9\n if i != 0 && n % 9 >= int64(i) {\n a[i] += 1\n }\n }\n \n for i := 0; i < 9; i++ {\n for j := 0; j < 9; j++ {\n ans += a[i] * a[j] * a[i * j]\n }\n }\n \n for i := 1; int64(i) <= n; i++ {\n ans -= n / int64(i)\n }\n fmt.Println(ans)\n \n return\n}", "lang": "Go", "bug_code_uid": "3493b03c9454d10dc926412b8f613a18", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "1964885131a2255fbf52ffb5a662a21e", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9721362229102167, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar m, n uint64\n\tfmt.Scan(&n, &m)\n\tif n > 31 {\n\t\tn = uint64(31)\n\t}\n\tpow := uint64(2) << n\n\tfmt.Println(m % pow)\n}\n", "lang": "Go", "bug_code_uid": "891a2ff6934bd013cbbdc77bf5f449a7", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "3ac91ca0e6711c7f8f759ec3de5d815f", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9974160206718347, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Fscan(os.Stdin, &n, &m)\n\tvar v = 2\n\tfor i := 1; i < n; i++ {\n\t\tif m <= v {\n\t\t\tbreak\n\t\t}\n\t\tv *= 2\n\t}\n\tfmt.Println(m % v)\n}\n", "lang": "Go", "bug_code_uid": "39f3d05c7be39a3fd7d02f1b4b622722", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "831e0d293d10cf4370a16a2aace4e74e", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8389923329682366, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "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.Scanner\n\tvar n int\n\tvar e error\n\tvar min [6]int = [6]int{0, 0, 0, 0, 0, 1}\n\tvar max [7]int = [7]int{1, 2, 2, 2, 2, 2, 2}\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\n\tn, e = strconv.Atoi(strings.TrimSpace(scanner.Text()))\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\tfmt.Println(min[(n-1)%6]+(n/7)*2, max[(n-1)%7]+(n/8)*2)\n\n}\n", "lang": "Go", "bug_code_uid": "46a896dfd1135d4e38b719814e7937b8", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "3bb43272a6a9f00f42a46ffcc42f2edf", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9501557632398754, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tfmt.Scanf(\"%d\", &d)\n\tmod := d % 7\n\tweeksCompleted := (d - mod) / 7\n\tweekend := weeksCompleted * 2\n\tminWeekend := weekend\n\tmaxWeekend := weekend\n\tif mod > 1 {\n\t\tmaxWeekend += 2\n\t}\n\tif mod == 1 {\n\t\tmaxWeekend++\n\t}\n\tfmt.Println(minWeekend, maxWeekend)\n}\n", "lang": "Go", "bug_code_uid": "f4247dc72de1d089f9628ec37fd13f38", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "05ef16e7993f42996a7b3c621787cc59", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9861111111111112, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n var min, max int\n min, max = n/7, n/7\n if n%7 > 5 {\n min += (n%7)-5\n max += 2\n } else if n%7 < 2 {\n max += n%7\n } else {\n max += 2\n }\n fmt.Print(min, \" \", max)\n}", "lang": "Go", "bug_code_uid": "c487fb3c4a4a5c96febe4c34b5903acc", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "b08c8822ec2a5852ce2882d902a92057", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.993421052631579, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// cf670a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar ma int\n\tif ma > 1 {\n\t\tma = 2 + (((n - 2) / 7) * 2)\n\t\tif (n-2)%7 > 5 {\n\t\t\tma += ((n - 2) % 7) - 5\n\t\t}\n\t} else {\n\t\tma = n\n\t}\n\tmi := (n / 7) * 2\n\tif n%7 > 5 {\n\t\tmi += (n % 7) - 5\n\t}\n\tfmt.Println(mi, ma)\n}\n", "lang": "Go", "bug_code_uid": "f751bf12eb1896cf31fb343e3e07a98d", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "d0076675c53b137a3aff2b0af521cef1", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8932955618508026, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "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 lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tnode := i\n\t\tfor k := 0; k < n; k++ {\n\t\t\tnode = crush[node]\n\t\t\tif node == i {\n\t\t\t\tans = lcm(ans, (k+1)/2)\n\t\t\t\tgoto start\n\t\t\t}\n\t\t}\n\t\tans = -1\n\t\tbreak\n\tstart:\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "3b6389e945e9c43da693c9d18fef4763", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "b742688cd86d45790f99a5e28a0ad23b", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.38978240302743616, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc getCrush(x, t int, crush []int) int {\n\tfor i := 0; i < t; i++ {\n\t\tx = crush[x]\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := -1\n\tfor t := 1; t <= 2*n*n; t++ {\n\t\tflag := true\n\t\tfor x := 0; x < n; x++ {\n\t\t\ty := getCrush(x, t, crush)\n\t\t\tif x != getCrush(y, t, crush) {\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 = t\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "43254a585d150026a313a8ae7576990a", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "b742688cd86d45790f99a5e28a0ad23b", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982886480319453, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\ntype crushes []int\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(a ...int) int64 {\n\tl := int64(a[0])\n\tfor _, v := range a {\n\t\tl = lcm(l, int64(v))\n\t}\n\treturn l\n}\n\nfunc (cr crushes) CountStepsToReturn(start int) int {\n\tcnt := 1\n\tcur := start\n\tfor cnt <= len(cr) {\n\t\tcur = cr[cur]\n\t\tif cur == start {\n\t\t\tbreak\n\t\t}\n\t\tcnt++\n\t}\n\tif cnt > len(cr) {\n\t\treturn -1\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar cr crushes = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&cr[i])\n\t\tcr[i]--\n\t}\n\tmin := make([]int, n)\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tm := cr.CountStepsToReturn(i)\n\t\tif m == -1 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t} else if m%2 == 0 {\n\t\t\tm = m / 2\n\t\t}\n\t\tmin[i] = m\n\t}\n\tif ans != -1 {\n\t\tans = lcmm(min...)\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "9cafaf3b120c047d9ea6a434fb7d53f9", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "4815b4501bcf99f6306960923ca17854", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.827790973871734, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tN, H := readTwoNums(reader)\n\n\tfmt.Println(solve(N, H))\n}\n\nfunc readInt(bytes []byte, from int, val *int) int {\n\ti := from\n\tsign := 1\n\tif bytes[i] == '-' {\n\t\tsign = -1\n\t\ti++\n\t}\n\ttmp := 0\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nfunc solve(N, H int) int64 {\n\tdp := make([][]int64, N+1)\n\tfp := make([][]int64, N+1)\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]int64, N+1)\n\t\tfp[i] = make([]int64, N+1)\n\t}\n\n\tfor h := 0; h <= N; h++ {\n\t\tdp[0][h] = 1\n\t}\n\n\tfor h := 1; h <= N; h++ {\n\t\tfor n := h; n <= N; n++ {\n\t\t\tfor x := 0; x < n; x++ {\n\t\t\t\tdp[n][h] += dp[x][h-1] * dp[n-1-x][h-1]\n\t\t\t}\n\t\t\tfp[n][h] = dp[n][h]\n\t\t\tdp[n][h] += dp[n][h-1]\n\t\t}\n\t}\n\tvar res int64\n\tfor h := H; h <= N; h++ {\n\t\tres += fp[N][h]\n\t}\n\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "69421b0b7344f39f107989e515e32bee", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "apr_id": "8cd6f4c036a5f8bce590cf892129a80c", "difficulty": 1900, "tags": ["divide and conquer", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9705159705159705, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc check(k,n uint64) bool {\n\ttotal := n\n\ttot := uint64(0)\n\tfor n > 0 {\n\t\tif k >= n {\n\t\t\tn = 0\n\t\t\ttot += n\n\t\t}else{\n\t\t\tn -= k\n\t\t\ttot +=k\n\t\t\tn -= n/10\n\t\t}\n\t}\n\treturn tot * 2 >= total\n}\n\nfunc main() {\n\tvar n uint64\n\tfmt.Scan(&n)\n\tlb := uint64(0)\n\tub := n\n\n\tfor ub - lb > 1{\n\t\tmid := (lb + ub)/2\n\t\tif check(mid,n) {\n\t\t\tub = mid\n\t\t}else{\n\t\t\tlb = mid\n\t\t}\n\t}\n\tfmt.Println(ub)\n}\n", "lang": "Go", "bug_code_uid": "94f5de2ecf5bf39e9249970c2b09b771", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "61a1e9043253dcfb9dd6fdc49b02df92", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.7052023121387283, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tline, _ := reader.ReadString('\\n')\n\n\ts := strings.TrimSpace(line)\n\tstringLength := len(s)\n\n\tline, _ = reader.ReadString('\\n')\n\tvar k int\n\n\tfmt.Sscanf(line, \"%d\", &k)\n\n\tnewString := make([]rune, stringLength+k)\n\tcopy(newString, []rune(s))\n\n\tbestRepeat := 0\n\tfor i := 0; i < stringLength+k; i++ {\n\t\tcurrentRepeat := 0\n\t\tfor i+currentRepeat < stringLength+k && currentRepeat <= (stringLength+k-i)/2 {\n\t\t\tif newString[i+currentRepeat] == newString[i] || newString[i+currentRepeat] == 0 {\n\t\t\t\tif currentRepeat > bestRepeat {\n\t\t\t\t\tbestRepeat = currentRepeat\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentRepeat++\n\t\t}\n\t}\n\tfmt.Println(2 * (bestRepeat - 0))\n}\n", "lang": "Go", "bug_code_uid": "b6e4e0247e8be5a2034f09bd40b11809", "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab", "apr_id": "6496cc624a01dc78f4b02ca0b6fb01c6", "difficulty": 1500, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.27209533267130087, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "// 443B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar st [500]string\n\tvar ans, i, j, k, n, length, flag, max int\n\tfmt.Scan(&st)\n\tlength = len(st)\n\tfmt.Scan(&n)\n\tans = n + length\n\tmax = 0\n\tfor i = 0; i < ans; i++ {\n\t\tfor j = 0; i+2*j-1 < ans; j++ {\t\t\t\nflag = 0\n\t\t\tfor k = i; k < i+j; k++ {\n\t\t\t\tif k >= length || j+k >= length || st[k] == st[j+k] {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tflag = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif flag == 0 {\n\t\t\t\tif 2*j > max {\n\t\t\t\t\tmax = 2 * j\n\t\t\t\t}\n\t\t\t}\n\t\t\tmax = 2 * j\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "lang": "Go", "bug_code_uid": "b0c062262dc02dcd9afc51d709718031", "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab", "apr_id": "5c6ef1824a571ce855d31d84a0768510", "difficulty": 1500, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9575129533678757, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, a, b, x, y, cnt int\n\tscr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Fscanln(scr, &n, &a, &x, &b, &y)\n\n\tfor i := 0; i <= n; i++ {\n\t\tif a == b {\n\t\t\tcnt = 2\n\t\t\tbreak\n\t\t}\n\t\ta++\n\t\ta = a % (n + 1)\n\t\tb--\n\t\tif b == 0 {\n\t\t\tb = n\n\t\t}\n\n\t\tif a == b {\n\t\t\tcnt = 2\n\t\t\tbreak\n\t\t}\n\n\t\tif a == x || b == y {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif cnt == 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "665098d0cc4196ab5520a4614ed3525f", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "3d0b68d93edfc21e213d0687c449ae2b", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9940174873446848, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve339a() {\n\t// digits can only be {1,2,3}\n\t// input is <= 100 characters\n\t// no spaces\n\t// digit and/or plus sign\n\t// could be a single character(digit)\n\n\t// if we use sorting in stdlib, then parse by \"+\", sort, and join with \"+\"\n\n\t// if we implement sorting, a good constraint is that numbers are {1,2,3}.\n\n\t// count 1, 2 and 3 digits in a map(nah just variables)\n\t// create a string with \"+\" between each counted digit if sum of count > 1\n\t// else just print\n\n\tequation := \"\"\n\tfmt.Scan(&equation)\n\n\tone := 0\n\ttwo := 0\n\tthree := 0\n\n\tfor _, c := range equation {\n\t\tswitch c {\n\t\tcase '1':\n\t\t\tone++\n\t\tcase '2':\n\t\t\ttwo++\n\t\tcase '3':\n\t\t\tthree++\n\t\t}\n\t}\n\n\tif one+two+three <= 1 {\n\t\tfmt.Println(equation)\n\t} else {\n\t\tresult := \"\"\n\t\tresult = appendNumber(result, one, 1)\n\t\tresult = appendNumber(result, two, 2)\n\t\tresult = appendNumber(result, three, 3)\n\t\tresult = result[:len(result)-1]\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc appendNumber(result string, count, num int) string {\n\tfor count > 0 {\n\t\tresult += fmt.Sprintf(\"%d+\", num)\n\t\tcount--\n\t}\n\treturn result\n}\n", "lang": "Go", "bug_code_uid": "28b2f40680649a5d135d0d694491ae61", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "ec55ee9e4de2e3279ba98c16c57dd1ef", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982773471145564, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"sync\"\n)\n\nconst MAX = 3\n\nfunc Sort(A []int) []int {\n\tN := rand.Intn(len(A))\n\tq := len(A) / N\n\tr := len(A) % N\n\tsplits := make([][]int, N)\n\tpos := 0\n\tfor i := 0; i < N; i++ {\n\t\tvar delta int\n\t\tif i < r {\n\t\t\tdelta = q + 1;\n\t\t} else {\n\t\t\tdelta = q;\n\t\t}\n\t\tsplits[i] = A[pos : pos + delta]\n\t\tpos += delta\n\t}\n\twaitGroup := new(sync.WaitGroup)\n\tfor i := 0; i < N; i++ {\n\t\twaitGroup.Add(1)\n\t\tgo func(B []int) {\n\t\t\tsort.Ints(B)\n\t\t\twaitGroup.Done()\n\t\t}(splits[i])\n\t}\n\twaitGroup.Wait()\n\tB := make([]int, 0);\n\tnext := make([]int, N)\n\tfor len(B) < len(A) {\n\t\tidx := -1\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif next[i] < len(splits[i]) && (idx == -1 || splits[i][next[i]] < splits[idx][next[idx]]) {\n\t\t\t\tidx = i\n\t\t\t}\n\t\t}\n\t\tB = append(B, splits[idx][next[idx]])\n\t\tnext[idx]++\n\t}\n\treturn B\n}\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tdigits := strings.Split(input, \"+\")\n\tints := make([]int, 0)\n\tfor i := 0; i < len(digits); i++ {\n\t\tints = append(ints, int(digits[i][0]) - '0')\n\t}\n\tints = Sort(ints)\n\tfor i := 0; i < len(ints); i++ {\n\t\tif i > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfmt.Print(ints[i])\n\t}\n\tfmt.Println()\n}", "lang": "Go", "bug_code_uid": "6e48028f305931938075de7b69f655d6", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "374a4597c5214c7f13c8382b6b0cbf8e", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9978714346530438, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"sync\"\n)\n\nconst MAX = 3\n\nfunc Sort(A []int, N int) []int {\n\tq := len(A) / N\n\tr := len(A) % N\n\tsplits := make([][]int, N)\n\tpos := 0\n\tfor i := 0; i < N; i++ {\n\t\tvar delta int\n\t\tif i < r {\n\t\t\tdelta = q + 1;\n\t\t} else {\n\t\t\tdelta = q;\n\t\t}\n\t\tsplits[i] = A[pos : pos + delta]\n\t\tpos += delta\n\t}\n\twaitGroup := new(sync.WaitGroup)\n\tfor i := 0; i < N; i++ {\n\t\twaitGroup.Add(1)\n\t\tgo func(B []int) {\n\t\t\tsort.Ints(B)\n\t\t\twaitGroup.Done()\n\t\t}(splits[i])\n\t}\n\twaitGroup.Wait()\n\tB := make([]int, 0);\n\tnext := make([]int, N)\n\tfor len(B) < len(A) {\n\t\tidx := -1\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif next[i] < len(splits[i]) && (idx == -1 || splits[i][next[i]] < splits[idx][next[idx]]) {\n\t\t\t\tidx = i\n\t\t\t}\n\t\t}\n\t\tB = append(B, splits[idx][next[idx]])\n\t\tnext[idx]++\n\t}\n\treturn B\n}\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tdigits := strings.Split(input, \"+\")\n\tints := make([]int, 0)\n\tfor i := 0; i < len(digits); i++ {\n\t\tints = append(ints, int(digits[i][0]) - '0')\n\t}\n\tN := rand.Intn(len(A)) + 1\n\tints = Sort(ints, N)\n\tfor i := 0; i < len(ints); i++ {\n\t\tif i > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfmt.Print(ints[i])\n\t}\n\tfmt.Println()\n}", "lang": "Go", "bug_code_uid": "dae110e982678d5d41ac345d74cdee89", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "374a4597c5214c7f13c8382b6b0cbf8e", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.948170731707317, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc getNext(x int64) int64 {\n //fmt.Fprintf(os.Stderr, \"in: %d\\n\", x)\n digits := []int64{}\n for x != 0 {\n digits = append(digits, x%10)\n x /= 10\n }\n carry := int64(0)\n carryIndex := -1\n for i, digit := range digits {\n if carry == 1 {\n digit++\n carry = 0\n }\n if digit <= 4 {\n digits[i] = 4\n } else if digit <= 7 {\n digits[i] = 7\n } else {\n digits[i] = 4\n carry = 1\n carryIndex = i\n }\n }\n if carry == 1 {\n digits = append(digits, 4)\n }\n for i := 0; i <= carryIndex; i++ {\n digits[i] = 4\n }\n base := int64(1)\n for _, digit := range digits {\n x += base*digit\n base *= 10\n }\n //fmt.Fprintf(os.Stderr, \" -> %d\\n\", x)\n return x\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n left, right := getI64(), getI64()\n total := int64(0)\n max := getNext(right)\n current := left-1\n for {\n next := getNext(current+1)\n if next == max {\n total += (right-current)*next\n break\n }\n total += (next-current)*next\n current = next\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", total))\n}\n", "lang": "Go", "bug_code_uid": "4d30548f35c16bd407ca5fe2bbcf004d", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "88d022244ff67a76cf31b0644b0283fb", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9028400597907325, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(t, s, x int) bool {\n\tif x <= t {\n\t\treturn t == x\n\t}\n\n\tdelta := x - t\n\t//return (delta%s) == 0 || (delta/s >= 1 && delta%s == 1)\n\treturn true\n}\n\nfunc main() {\n\tvar t, s, x int\n\tfmt.Scan(&t, &s, &x)\n\tif solve(t, s, x) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "899d5356fce042a26d645989e70f52bd", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "438e8dc2f29cb3b7dcd59468de452cda", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9957325746799431, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(t, s, x int) bool {\n\t//if x <= t {\n\t//return t == x\n\t//}\n\tif x == t {\n\t\treturn false\n\t}\n\n\tdelta := x - t\n\treturn (delta%s) == 0 || (delta/s >= 1 && delta%s == 1)\n\treturn true\n}\n\nfunc main() {\n\tvar t, s, x int\n\tfmt.Scan(&t, &s, &x)\n\tif solve(t, s, x) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4c732a7058a298657614886883c56f78", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "438e8dc2f29cb3b7dcd59468de452cda", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9950248756218906, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sh, sm, lh, lm int\n\tfmt.Scanf(\"%d:%d\", &sh, &sm)\n\tfmt.Scanf(\"%d:%d\", &lh, &lm)\n\n\tvar ah, am int\n\n\tah = sh - lh\n\tam = sm - lm\n\tif am < 0 {\n\t\tam = 60 + am\n\t\tah--\n\t}\n\tif ah < 0 {\n\t\tah = 24 + ah\n\t}\n\n\tif ah < 10 {\n\t\tfmt.Printf(\"0%d:\", ah)\n\t} else {\n\t\tfmt.Printf(\"%d:\", ah)\n\t}\n\n\tif ah < 10 {\n\t\tfmt.Printf(\"0%d\", am)\n\t} else {\n\t\tfmt.Printf(\"%d\", am)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "6cc0cda13ab3d727b043e6ac435cb12e", "src_uid": "595c4a628c261104c8eedad767e85775", "apr_id": "f1786ad6516b0bc5cc59652346422c82", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7986725663716814, "equal_cnt": 20, "replace_cnt": 20, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 20, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var sh, sm, lh, lm int\n fmt.Scanf(\"%d:%d\\n\", &sh, &sm)\n fmt.Scanf(\"%d:%d\", &lh, &lm)\n\n var ah,am int\n\n ah = sh - lh\n am = sm - lm\n\n if am < 0 {\n am = 60 + am\n ah = ah - 1\n }\n\n if ah < 0 {\n ah = 24 + ah % 24 \n }\n\n if ah < 10 {\n fmt.Printf(\"0%d:\", ah)\n } else {\n fmt.Printf(\"%d:\", ah)\n }\n\n if am < 10 {\n fmt.Printf(\"0%d\", am)\n } else {\n fmt.Printf(\"%d\", am)\n }\n}", "lang": "Go", "bug_code_uid": "9a0f5510122dd952c26ff1cd95c0e6a6", "src_uid": "595c4a628c261104c8eedad767e85775", "apr_id": "3e3c31a8dde88f82bd7ea7eb3f6ff927", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9250457038391224, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "// Package main provides\n//\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 30 23:45:54 2018\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar y, b, r int\n\tfmt.Scan(&y, &b, &r)\n\ti := 0\n\tfor i = 1; i <= y && i+1 <= b && i+2 <= r; i++ {\n\t}\n\tfmt.Println(y + b + r)\n}\n", "lang": "Go", "bug_code_uid": "0d6ce85a44a42a2a66dc9644e49924da", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "8da4a0bad0c7c8d823db31aa894254bd", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9723991507430998, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nimport (\n\t\"fmt\"\n)\n\nfunc min(n1 int, n2 int) int {\n\tif n1 < n2 {\n\t\treturn n1\n\t} else {\n\t\treturn n2\n\t}\n}\n\nfunc main() {\n\tvar y, b, r int\n\tfmt.Scanf(\"%d %d %d\", &y, &b, &r)\n\tyNum := min(y, min(b-1, r-2))\n\tfmt.Println(yNum*3 + 3)\n}\n", "lang": "Go", "bug_code_uid": "08c0ef605a52855441a4ea49ed50d737", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "385887c910e915d83e1199ed0e083710", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9814020028612304, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tmin := [2]int{0, int((^uint(0)) >> 1)}\n\n\tfor i := 0; i != 3; i++ {\n\t\tvar v int\n\t\tfmt.Scan(&v)\n\t\tif (v - i) <= min[1] {\n\t\t\tmin[0] = i\n\t\t\tmin[1] = v\n\t\t}\n\t}\n\n\tvar res int\n\tswitch min[0] {\n\tcase 0:\n\t\tres = min[1]*3 + 3\n\tcase 1:\n\t\tres = min[1] * 3\n\tcase 2:\n\t\tres = min[1]*3 - 3\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "b4e5cc41c056c91e93ff568819ec10ab", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "b7b5ed84bbe75759624894d1066f87b3", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9974811083123426, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar a,b int64\n\tfmt.Scan(&a,&b)\n\tif a>0 && b>0 {\n\t\tfmt.Print(\"0 \",a+b,a+b,\" 0\")\n\t\tfmt.Println()\n\t} else if a<0 && b>0 {\n\t\tfmt.Print(a-b,\"0 \",\"0 \",b-a)\n\t\tfmt.Println()\n\t} else if a<0 && b<0 {\n\t\tfmt.Print(a+b,\"0 \",\"0 \",a+b)\n\t\tfmt.Println()\n\t} else if a>0 && b<0 {\n\t fmt.Print(\"0 \",b-a,a-b,\" 0\")\n\t fmt.Println()\n\t}\n\n}\n\n\n", "lang": "Go", "bug_code_uid": "852bb8afd76c2aaef7c2339e4c087ab5", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "29c9aefb6de577d3e0e88e26ec96a598", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.989010989010989, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "// 336A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b int\n\tfmt.Scan(&a, &b)\n\tx := a+b\n\ty:= a-b\n\tif x>0{\n\t\tif y>0{\n\t\t\tfmt.Println(0,x,x,0)\n\t\t}else{\n\t\t\tfmt.Println(0,-y,y,0)\n\t\t}\n\t} else{\n\t\tif y>0{\n\t\t\tfmt.Println(y,0,0,-y)\n\t\t}else{\n\t\t\tfmt.Println(x,0,0,x)\n\t\t}\n\t}\n\t\n}", "lang": "Go", "bug_code_uid": "74446d8e13469fd283988e518873216d", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "c2ec30b5c537e069864210e9ea13d1b2", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9965792474344356, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// 258A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var i, k float64\n fmt.Scan(&i, &k)\n t := int64(math.Abs(math.Abs(i) + math.Abs(k)))\n if i > 0 && k > 0 {\n fmt.Printf(\"0 %d %d 0\\n\", t, t)\n } else if i > 0 && k < 0 {\n fmt.Printf(\"0 %d %d 0\\n\", -t, t)\n } else if i < 0 && k > 0 {\n fmt.Printf(\"%d 0 0 %d\\n\", -t, t)\n } else {\n fmt.Println(\"%d 0 0 %d\\n\", -t, -t)\n }\n}\n", "lang": "Go", "bug_code_uid": "67c13122a0b5d709f4bec7512350400a", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "2ed6bffc6e9e794a1ed14014a6693200", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9555236728837877, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main () {\n\tvar num int\n\n\tcnt := 0\n\n\tfor i := 0; i < 5; i++ {\n\t\tfor j := 0; j < 5; j++ {\n\t\t\tfmt.Scan(&num)\n\t\t\tif num == 1 {\n\t\t\t\ti = 2 - i\n\t\t\t\tj = 2 - j\n\t\t\t\tif i < 0 {\n\t\t\t\t\tcnt -= i\n\t\t\t\t} else {\n\t\t\t\t\tcnt += i\n\t\t\t\t}\n\t\t\t\tif j < 0 {\n\t\t\t\t\tcnt -= j\n\t\t\t\t} else {\n\t\t\t\t\tcnt += j\n\t\t\t\t}\n\n\t\t\t\tfmt.Println(cnt)\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "Go", "bug_code_uid": "e5a5c73c95bca7d1178d44b4069faff5", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "599a54b1ed07a4a39ff9c4451ffd66f5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6287425149700598, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Vector struct {\n\tx int\n\ty int\n}\n\nfunc (v *Vector) diff(end *Vector) (x int, y int) {\n\treturn v.x - end.x, v.y - end.y\n}\n\nfunc main() {\n\ta := 0\n\tmatrix := [5][5]byte{}\n\n\ti := 0\n\tj := 0\n\n\tcenter := Vector{3, 3}\n\tstart := Vector{}\n\n\tfor {\n\t\t_, err := fmt.Scanf(\"%d\", &a)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tmatrix[i][j] = byte(a)\n\t\tif a == 1 {\n\t\t\tstart = Vector{i, j}\n\t\t}\n\n\t\tif j == 4 {\n\t\t\ti++\n\t\t\tj = -1\n\t\t}\n\n\t\tj++\n\t}\n\n\tx, y := start.diff(¢er)\n\n\tsteps := math.Abs(float64(x)) + math.Abs(float64(y))\n\n\tfmt.Println(int(steps))\n}\n\n", "lang": "Go", "bug_code_uid": "1b2eede772d4045d2f97ef8563d4073c", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "3d318d33b9be90dda0f35d1d46bf6e9d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8203017832647462, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n //\"bufio\"\n //\"os\"\n)\n\nfunc main() {\n //cin := bufio.NewReader(os.Stdin)\n\t//cout := bufio.NewWriter(os.Stdout)\n\t//defer cout.Flush()\n\n var k,n,w int\n fmt.Scan(&k)\n fmt.Scan(&n)\n fmt.Scan(&w)\n money:=0\n\tfor x := 1; x < w+1; x++ {\n money+= k*x", "lang": "Go", "bug_code_uid": "03ef54216bb25019d43a9e84369e6db9", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "7dd5740ea2190bcdd77678b88871df24", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9802955665024631, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int\nvar k int\n\nfunc main() {\n fmt.Scanf(\"%d %d\", &n, &k)\n cnt2 := 0\n cnt5 := 0\n res := n\n for {\n if cnt5 >= k || n%5 != 0 {\n break\n }\n res = res / 5\n cnt5++\n }\n for {\n if cnt2 >= k || n%2 != 0 {\n break\n }\n res = res / 2\n cnt2++\n }\n for i := 0; i < k; i++ {\n res = res * 10\n }\n fmt.Println(res)\n}", "lang": "Go", "bug_code_uid": "34ea20523e3f030b6f35cca84b5dab9b", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "dfad7fffb3416e4b9ac58a90a2110b5f", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9869494290375204, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int64\nvar k int64\n\nfunc main() {\n fmt.Scanf(\"%d %d\", &n, &k)\n cnt2 := 0\n cnt5 := 0\n res := n\n for {\n if cnt5 >= k || res%5 != 0 {\n break\n }\n res = res / 5\n cnt5++\n }\n for {\n if cnt2 >= k || res%2 != 0 {\n break\n }\n res = res / 2\n cnt2++\n }\n for i := 0; i < k; i++ {\n res = res * 10\n }\n fmt.Println(res)\n}", "lang": "Go", "bug_code_uid": "e05ebdb3d34831c58ff2a6e2ef29fb21", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "dfad7fffb3416e4b9ac58a90a2110b5f", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9198813056379822, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, s, ans int\n fmt.Scan(&n &s)\n \n for i=n; i > 0 && ; i-- {\n ans+=s/i\n s %= i\n }\n}\n", "lang": "Go", "bug_code_uid": "ec466463231a10940e876f3a3c0cec2e", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "ab3f0ab9f2fca029f999e71dfb978e25", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9833333333333333, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar n,s int\n\tfmt.Scan(&n,&s);\n\tk:=0\n\tif n%s!=0 {\n\t\tk = 1\n\t}\n\tfmt.Print(s/n+k)\n}", "lang": "Go", "bug_code_uid": "e7f317e67ca8955ce59a92358c627f24", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "6ccf0a7374637029db73dba9165be62b", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8888888888888888, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, s int64\n fmt.Scan(&n)\n fmt.Scan(&s)\n if n>=s {\n fmt.Println(\"1\")\n } else {\n ans := s/n+1\n fmt.Println(ans)\n }\n}", "lang": "Go", "bug_code_uid": "2559941506c36d1dfdd1d15239f93441", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "d25bea4ca0085778e28cc884d8081fd7", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.959731543624161, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n uint64\n\tfor I(&n, \"\\n\") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n uint64) {\n\tO([]int{8, 4, 2, 6}[n%4-1], \"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "2f26730ba82bd850c19bac3ef863c9b2", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "69e2c59988c6a36769874d9da8056f08", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6954813359528488, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n \n var lastDigit = 1\n for i:=0; i < n; i++ {\n lastDigit = (lastDigit*8)%10\n }\n fmt.Print(lastDigit)\n}", "lang": "Go", "bug_code_uid": "617a9a9f297f9db8630980a6559f5b52", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "474c9cb35ccf41b6dbf233b0d15b491e", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9968051118210862, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n uint64\n fmt.Scan(&n)\n \n var lastDigit uint64 = 1\n var level uint64 = 8\n for n > 0 {\n if n%2 == 1 {\n lastDigit = (lastDigit*level)%10\n }\n level = (level*level)/10\n n /= 2\n }\n \n fmt.Print(lastDigit)\n}", "lang": "Go", "bug_code_uid": "3f0251f4f4643d48cc0e16fdb47e8c1a", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "474c9cb35ccf41b6dbf233b0d15b491e", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9876615746180963, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []Pair) []Pair {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i].first > arr[right].first {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc sort2(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort2(arr[:left])\n\tsort2(arr[left+1:])\n\treturn arr\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 min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar n, a int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\ta = 6\n\tn %= 4\n\tfor i := 0; i < n; i++ {\n\t\ta *= 8\n\t}\n\tfmt.Println(a % 10)\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}", "lang": "Go", "bug_code_uid": "3cb7caebc2e6a42dbc8144d4ee6c3e7c", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "30156e74e484cefda26ca9ace0d4e576", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.988, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar MOD int64 = 10000007\n\tvar r, g int\n\tfmt.Scan(&r, &g)\n\th := 0\n\n\tfor i := 1; i <= 1000; i++ {\n\t\tif (i * (i + 1) / 2) > r+g {\n\t\t\th = i - 1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tdp := make([]int64, r+1)\n\tdp[0] = 1\n\n\tfor i := 1; i <= h; i++ {\n\t\tfor j := r - i; j >= 0; j-- {\n\t\t\tdp[j+i] += dp[j]\n\t\t\tif dp[j+i] >= MOD {\n\t\t\t\tdp[j+i] -= MOD\n\t\t\t}\n\t\t}\n\t}\n\n\tvar answer int64 = 0\n\tfor i := 0; i <= r; i++ {\n\t\tif h*(h+1)/2-i <= g {\n\t\t\tanswer += dp[i];\n\t\t}\n\t}\n\n\tfmt.Print(answer % MOD)\n}\n", "lang": "Go", "bug_code_uid": "b7fb11e861f5eaf1454077f2f844ca8d", "src_uid": "34b6286350e3531c1fbda6b0c184addc", "apr_id": "04ad4713fa069e028a4c4e3feaf4d8b5", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9912772585669782, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/cmplx\"\n\t\"os\"\n)\n\nconst (\n\tEPS = 1e-8\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n)\n\ntype Light struct {\n\tp complex128\n\ta float64\n}\n\ntype Line struct {\n\tp1, p2 complex128\n}\n\nfunc CrossProduct(a complex128, b complex128) float64 {\n\treturn real(a)*imag(b) - real(b)*imag(a)\n}\n\nfunc Roatate(x complex128, a float64) complex128 {\n\tr, t := cmplx.Polar(x)\n\treturn cmplx.Rect(r, t+a)\n}\n\nfunc Intersact(a Line, b Line) (intersaction complex128, isIntersact bool) {\n\ts1 := CrossProduct(a.p2-a.p1, b.p1-a.p1)\n\ts2 := CrossProduct(a.p2-a.p1, b.p2-a.p1)\n\tif math.Abs(s2-s1) >= EPS {\n\t\tisIntersact = true\n\t\tintersaction = complex(real(b.p1)*s2-real(b.p2)*s1, imag(b.p1)*s2-imag(b.p2)*s1) / complex(s2-s1, 0.0)\n\t}\n\treturn\n}\n\nfunc foo(l float64, lit Light, r float64) float64 {\n\tv1 := complex(l-real(lit.p), 0-imag(lit.p))\n\tv2 := Roatate(v1, lit.a)\n\tif imag(v2) > -EPS {\n\t\treturn r\n\t}\n\n\tp1 := complex(0.0, 0.0)\n\tp2 := complex(10.0, 0.0)\n\tinter, _ := Intersact(Line{lit.p, lit.p + v2}, Line{p1, p2})\n\treturn real(inter)\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tl, r float64\n\t\tlits []Light\n\t)\n\n\tfmt.Fscan(reader, &n, &l, &r)\n\tfor i := 0; i < n; i++ {\n\t\tvar x, y, a float64\n\t\tfmt.Fscan(reader, &x, &y, &a)\n\t\tlits = append(lits, Light{complex(x, y), a * math.Pi / 180.0})\n\t}\n\n\tf := make([]float64, 1< f[k] {\n\t\t\t\t\tf[k] = cur\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(f[(1< 9 {\n\t\t\td = 9\n\t\t}else {\n\t\t\td = s\n\t\t}\n\t\ts -= d\n\t\tmaximum[i] = d\n\t}\n\tdec := false\n\tif maximum[m - 1] == 0 {\n\t\tfmt.Printf(\"%d\", 1)\n\t\tdec = true\n\t}else {\n\t\tfmt.Printf(\"%d\", maximum[m - 1])\n\t}\n\tfor i := m - 2; i >= 0; i-- {\n\t\tif dec && maximum[i] > 0 {\n\t\t\tfmt.Printf(\"%d\", maximum[i] - 1)\n\t\t\tdec = false\n\t\t}else {\n\t\t\tfmt.Printf(\"%d\", maximum[i])\n\t\t}\n\t}\n\n\tfmt.Printf(\" \")\n\tfor i := 0; i < m; i++{\n\t\tfmt.Printf(\"%d\", maximum[i])\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "de840f1935396c94e4c317ea1faa27e1", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "e9338293c3a6a3d311f7b1de57bff9f4", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.935633709356337, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\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 reverse(s string) (result string) {\n\tfor _, v := range s {\n\t\tresult = string(v) + result\n\t}\n\treturn\n}\n\nfunc getMax(m, s int) string {\n\tr := \"\"\n\tfor i := 0; i < m; i++ {\n\t\tnext := min(9, s)\n\t\ts -= next\n\t\tr += strconv.Itoa(next)\n\t}\n\treturn r\n}\n\nfunc getMin(m, s int) string {\n\th := max(1, s-9*(m-1))\n\tmax := getMax(m-1, s-h)\n\treturn strconv.Itoa(h) + reverse(max)\n}\n\nfunc main() {\n\tvar m, s int\n\tfmt.Scanf(\"%d %d \\n\", &m, &s)\n\tif s == 0 || s > 9*m {\n\t\tfmt.Print(-1, -1)\n\t\treturn\n\t}\n\tif m == 1 {\n\t\tfmt.Print(s, s)\n\t\treturn\n\t}\n\tfmt.Print(getMin(m, s) + \" \" + getMax(m, s))\n}\n", "lang": "Go", "bug_code_uid": "9a4fd254f05dae13c8e5fbc472c6d2f1", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "7bb1ce4efb5aee1555d142f67924f020", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9995778809624314, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tscanner.Split(bufio.ScanWords)\n\n\tn, sum := readInt(), readInt()\n\tminNum := make([]int, n)\n\tmaxNum := make([]int, n)\n\tim := []int{-1}\n\n\tif (9*n < sum) || (sum == 0 && n > 1) {\n\t\twriteExit(im, im)\n\t}\n\n\t/*\tif sum < 10 {\n\t\t\tmaxNum[0] = sum\n\t\t\tminNum[0] = 1\n\t\t\tminNum[n-1] = sum - 1\n\t\t\twriteExit(minNum, maxNum)\n\t\t}\n\t*/\n\ts, i := sum, 0\n\tfor ; (s >= 9) && (i < n-1); s, i = s-9, i+1 {\n\t\tmaxNum[i] = 9\n\t}\n\n\tmaxNum[i] = s\n\n\tminNum = reverse(maxNum)\n\n\tif minNum[0] == 0 {\n\t\tminNum[0]++\n\t\tminNum[n-i-1]--\n\t}\n\n\twriteExit(minNum, maxNum)\n}\n\nfunc reverse(a []int) []int {\n\n\ts := make([]int, len(a))\n\tfor i, j := 0, len(a)-1; i <= j; i, j = i+1, j-1 {\n\t\ts[i], s[j] = a[j], a[i]\n\t}\n\treturn s\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tres, _ := strconv.Atoi(scanner.Text())\n\treturn res\n}\n\nfunc writeExit(a []int, b []int) {\n\n\tfor _, value := range a {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t}\n\n\twriter.WriteString(\" \")\n\n\tfor _, value := range b {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t}\n\n\twriter.Flush()\n\tos.Exit(0)\n}\n", "lang": "Go", "bug_code_uid": "82a9abe5b9ef620ab63ee5057cab3df0", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "7130cebc85ca7c45b4a26709eef18b53", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9882352941176471, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println ((a-1)/c + 1) * ((b-1)/c + 1)\n}\n", "lang": "Go", "bug_code_uid": "ee225aa7f4079d396c7024a723fcec5e", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2ffe7e12e1336fe64d6050609654f8b4", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.48586387434554973, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\nimport \"os\"\nimport \"strconv\"\n\nfunc main() {\n\tvar n, m, a int\n\tn, _ = strconv.Atoi(os.Args[1])\n\tm, _ = strconv.Atoi(os.Args[2])\n\ta, _ = strconv.Atoi(os.Args[3])\n\t// Not sure how to convert...\n\tnFloat := float64(n)\n\tmFloat := float64(m)\n\taFloat := float64(a)\n\t// How many are needed in X axis?\n\tx := math.Ceil(nFloat / aFloat)\n\ty := math.Ceil(mFloat / aFloat)\n\tfmt.Println(x + y)\n}\n", "lang": "Go", "bug_code_uid": "ba6b1ee8ff94c1dab4d078e852d6cf31", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2fe1b497d13187a877152f304a03ecc9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.954417103670835, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "/*A. Theatre Square\ntime limit per test1 second\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.\n\nWhat is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.\n\nInput\nThe input contains three positive integer numbers in the first line: n,  m and a (1 ≤  n, m, a ≤ 109).\n\nOutput\nWrite the needed number of flagstones.\n\nExamples\ninputCopy\n6 6 4\noutputCopy\n4\n*/\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, a float64\n\tfmt.Scanf(\"%b %b %b\", &n, &m, &a)\n\n\ta_in_n_ceil := uint64(math.Ceil(n / a))\n\n\ta_in_m_ceil := uint64(math.Ceil(m / a))\n\n\ta_in_n_and_m = a_in_n_ceil * a_in_m_ceil\n\n\tsquare_volume := n * m\n\tflagstone_volume := a * a\n\n\tif flagstone_volume >= square_volume {\n\t\ta_in_n_and_m = 1\n\t}\n\n\tfmt.Println(a_in_n_and_m)\n\n}\n", "lang": "Go", "bug_code_uid": "f09821fd9142847bdbeac26be65189ec", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "c28bfd4dd01ff28bd08ccf7f3a03d95a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9229473684210526, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "/*A. Theatre Square\ntime limit per test1 second\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.\n\nWhat is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.\n\nInput\nThe input contains three positive integer numbers in the first line: n,  m and a (1 ≤  n, m, a ≤ 109).\n\nOutput\nWrite the needed number of flagstones.\n\nExamples\ninputCopy\n6 6 4\noutputCopy\n4\n*/\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, a float32\n\tfmt.Scanf(\"%b %b %b\", &n, &m, &a)\n\n\ta_in_n_ceil := uint64(math.Ceil(n / a))\n\n\ta_in_m_ceil := uint64(math.Ceil(m / a))\n\n\ta_in_n_and_m := a_in_n_ceil * a_in_m_ceil\n\n\t/*\tsquare_volume := n * m\n\t\tflagstone_volume := a * a\n\n\t\tif flagstone_volume >= square_volume {\n\t\t\ta_in_n_and_m = 1\n\t\t}\n\t*/\n\tfmt.Println(a_in_n_and_m)\n\n}\n", "lang": "Go", "bug_code_uid": "dbc772ed675eebaa2dbf3427b7736d96", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "c28bfd4dd01ff28bd08ccf7f3a03d95a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982608695652174, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, a, result, x1, x2 int64\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tfmt.Scan(&a)\n\n\tif n%a != 0 {\n\t\tx1 = (n / a) + 1\n\t} else {\n\t\tx1 = n / a\n\t}\n\tif m%a != 0 {\n\t\tx2 = (m / a) + 1\n\t} else {\n\t\tx2 := m / a\n\t}\n\tresult = x1 * x2\n\tfmt.Println(result)\n\n}\n", "lang": "Go", "bug_code_uid": "8b6561d5c4a39c3b4a78e3b3cbbe494b", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "134a86074dd88a5528a369e9e31350df", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.5327313769751693, "equal_cnt": 20, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,m,a,v,h int\n fmt.Scan(&n,&m)\n fmt.Scan(&a)\n v= (int)n/a\n if v%a!= 0 {\n v=v+1\n }\n h= (int)m/a\n if h%a!=0 {\n h=h+1\n }\n fmt.Println(v*h)\n}", "lang": "Go", "bug_code_uid": "940f5ca4da40d49181f742fe5c1ff0fe", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "3230db42df2168edf7684085290bb87f", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7027027027027027, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tslice := strings.Fields(scanner.Text())\n\tm, _ := strconv.Atoi(slice[0])\n\tn, _ := strconv.Atoi(slice[1])\n\ta, _ := strconv.Atoi(slice[2])\n\tif n > m {\n\t\tm, n = n, m\n\t}\n\tnum_flags := 0\n\tfor m > 0 {\n\t\ttemp := n\n\t\tfor temp > 0 {\n\t\t\ttemp -= a\n\t\t\tnum_flags++\n\t\t}\n\t\tm -= a\n\t}\n\tfmt.Print(num_flags)\n}\n", "lang": "Go", "bug_code_uid": "8fa8dabfada3a567744b7b34f361ff22", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "cd7d4e37c938cfc1755520beda1a8d98", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6198830409356725, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar m, n, a, sum int64\n\tsum = 0\n\tfmt.Scanf(\"%d%d%d\", &m, &n, &a)\n\n\tfor ; n > 0; n = n - a {\n\t\tif m%a != 0 {\n\t\t\tsum += m/a + 1\n\t\t} else {\n\t\t\tsum += m / a\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", sum)\n}\n", "lang": "Go", "bug_code_uid": "897ac8cd9762cd6fc64e4d8b75fbddf2", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "8337ca1f3379fb22d4ddef4bc2a5a82d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9989154013015185, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ta, b, s := nextInt(), nextInt(), nextInt()\n\n\tstep := abs(a) + abs(b)\n\n\tif s < step || abs(s-step) == 1 {\n\t\tprintln(\"No\")\n\t} else {\n\t\tprintln(\"Yes\")\n\t}\n\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "eb8d4c9162d96e34bb3bcb707346918d", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "599ee6503cf2533e38cefdbc97319e02", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6232876712328768, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, s int\n fmt.Scanf(\"%d %d %d\", &a, &b, &s)\n if ((a + b) == 0 && s & 1 == 0) || (s != 0 && s % (a + b) == 0) {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n", "lang": "Go", "bug_code_uid": "6ea347cac0541a8db503072211c339d6", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "c2988dbbfcc8b66aa7a5340b20f35e64", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5310077519379846, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, s int\n\tfmt.Scan(&a, &b, &s)\n\n\tdelta := s - a - b\n\tif delta >= 0 && delta%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1a82aeef22edaa5cd6421b978f724f5a", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "9a9d1040a12f18dca697c97252f1383f", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8602825745682888, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var a, b, s int\n fmt.Scan(&a, &b, &s)\n\n delta := s - (a + b)\n if delta < 0 {\n fmt.Println(\"No\")\n } else if delta & 1 == 0 {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n", "lang": "Go", "bug_code_uid": "0c4b681e813f8ce65f15240853e55977", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "b2761c37afd09383cf0510efdfd87d51", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9753424657534246, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc getCnt(n int64) int64 {\n var sum int64\n for k:= int64(2); k*k*k <= n; k++ {\n sum += n/(k*k*k)\n }\n return sum\n}\n\nfunc main() {\n var m int64\n fmt.Scan(&m)\n\n var lo, hi int64\n lo = 1\n hi = 100000000000\n for lo+1 < hi {\n mid := (lo+hi)/2\n sum := int64(0)\n for k:= int64(2); k*k*k <= mid; k++ {\n sum += mid/(k*k*k)\n }\n if sum >= m {\n hi = mid\n } else {\n lo = mid\n }\n }\n hiCnt := getCnt(hi)\n if hiCnt == m {\n fmt.Println(hi)\n } else {\n fmt.Println(-1)\n }\n}\n", "lang": "Go", "bug_code_uid": "97fb1eef48383d2d1b97623e6de53739", "src_uid": "602deaad5c66e264997249457d555129", "apr_id": "0c2e05f19a0c6a8f58e7ab0e60d56e3b", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9758812615955473, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n side, x, y := scanInt(scanner), scanInt(scanner), scanInt(scanner)\n a, b := side/2, side/2+1\n if x == a || x == b || y == a || y == b {\n writer.WriteString(\"NO\\n\")\n } else {\n writer.WriteString(\"YES\\n\")\n }\n}\n", "lang": "Go", "bug_code_uid": "ef42129e3f63817f7ee7f5887d27a2f7", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "6d6d49225a99cfddbb1d83c0eb18298e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8679245283018868, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "// 112B-Andre,Dikai,Eric\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n,x,y int\n fmt.Scan(&n,&x,&y)\n if n==2{\n fmt.Println(\"NO\")\n }else\n {if x == n/2 || x == (n/2)+1 && y == n/2 || y == (n/2)+1{\n fmt.Println(\"NO\")\n }else\n {fmt.Println(\"YES\")}\n }\n \n}\n", "lang": "Go", "bug_code_uid": "87951ac7cc2d93629948a812f4c91614", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "78918e27a9769a8b778c86f2340baadd", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.609009009009009, "equal_cnt": 17, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "import (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int\n\tfmt.Scan(&n,&x,&y)\n\tif n==2{\n\t\tfmt.Println(\"NO\")\n\t}else\n\t{if x == n/2 || x == (n/2)+1 && y == n/2 || y == (n/2)+1{\n\t\tfmt.Println(\"NO\")\n\t}else\n\t{fmt.Println(\"YES\")}\n\t}\n\t\n}\n", "lang": "Go", "bug_code_uid": "5ba3e571a00ce8fe366c74972aeccec7", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "78918e27a9769a8b778c86f2340baadd", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9364341085271318, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B int64\n\tvar x, y, z int64\n\tfor {\n\t\tfmt.Scan(&A, &B)\n\t\tfmt.Scan(&x, &y, &z)\n\t\tvar yellow, blue int64\n\t\tyellow = x*2 + y - A\n\t\tif yellow < 0 {\n\t\t\tyellow = 0\n\t\t}\n\t\tblue = y + 3*z - B\n\t\tif blue < 0 {\n\t\t\tblue = 0\n\t\t}\n\t\tfmt.Println(yellow + blue)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "dba3f498ddcaad71ce0538a15db868f9", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "c653167280abb8162ec067f19947538b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5785123966942148, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n runes := []rune(s)\n f, b := 0, len(runes)\n cnt := 0\n for f < b {\n if runes[f] != runes[b] {\n cnt++\n }\n }\n if cnt > 1 {\n fmt.Print(\"NO\")\n } else {\n fmt.Print(\"YES\")\n }\n}", "lang": "Go", "bug_code_uid": "78ab18643550e21e64b7d03863621a7f", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "0994d1f7134f0ea6e4385123f57f4f2d", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.586490939044481, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n runes := []rune(s)\n f, b := 0, len(runes)-1\n cnt := 0\n for f < b {\n if runes[f] != runes[b] {\n cnt++\n }\n }\n if cnt > 1 {\n fmt.Print(\"NO\")\n } else {\n fmt.Print(\"YES\")\n }\n}", "lang": "Go", "bug_code_uid": "a2d2363550c86f9c210da1f313161eae", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "0994d1f7134f0ea6e4385123f57f4f2d", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9371633752244165, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\trunes := []rune(s)\n\tf, b := 0, len(runes)-1\n\tcnt := 0\n\tfor f < b {\n\t\tif runes[f] != runes[b] {\n\t\t\tcnt++\n\t\t}\n\t\tf++\n\t\tb--\n\t}\n\tif cnt == 1 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1cd64b72fa89f3567bedbf2ebc5a48fc", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "0994d1f7134f0ea6e4385123f57f4f2d", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9314720812182741, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"strings\"\n\t// \"os\"\n\t// \"bufio\"\n)\n\nfunc main() {\n\t// reader := bufio.NewReader(os.Stdin)\n\t// reader.ReadLine()\n\t// fmt.Scanf(\"%d\", &N)\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tres := 0\n\tl := len(s)\n\tfor i := 0; i < l/2; i++ {\n\t\tif s[i] != s[l-1-i] {\n\t\t\tres += 1\n\t\t}\n\t}\n\n\tif res == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "d48633ee37a01238a3626b9e3e851e7b", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "255a6dc281f2fd6268ba112ea3f1fb94", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.96996996996997, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn, k := 0, 0\n\ts := \"\"\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &k)\n\tfmt.Fscanf(in, \"%s\\n\", &s)\n\t//\tfmt.Println(s)\n\ta := make([]int, 26)\n\tfor i := 0; i < len(s); i++ {\n\t\ta[s[i]-'a'] = 1\n\t}\n\tans := 0\n\tcnt := 0\n\tfor i := 0; i < k; i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tif a[j] == 1 {\n\t\t\t\tans += j + 1\n\t\t\t\tcnt++\n\t\t\t\ta[j] = 0\n\t\t\t\tif j+1 < 26 {\n\t\t\t\t\ta[j+1] = 0\n\t\t\t\t}\n\t\t\t\tif j+2 < 26 {\n\t\t\t\t\ta[j+2] = 0\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Println(ans, cnt)\n\tif cnt < k {\n\t\tfmt.Fprintf(out, \"%d\\n\", -1)\n\t} else {\n\t\tfmt.Fprintf(out, \"%d\\n\", ans)\n\t}\n\treturn\n}", "lang": "Go", "bug_code_uid": "24b3d7bce9a863be7ee099afa7f12df4", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "b6622e516ed9e2bdf445a8bff4b91001", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9166666666666666, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar k, n int\n\tfmt.Scanf(\"%d %d\\n\", &k, &n)\n\n\tvar str string\n\tfmt.Scanln(&str)\n\n\tunsorted := strings.Split(str, \"\")\n\tsort.Strings(unsorted)\n\tsorted := strings.Join(unsorted, \"\")\n\ts := []rune(sorted)\n\n\tweight := s[0] - 96\n\tcount := 1\n\tprev := 0\n\tfor i := 1; i < k; i++ {\n\t\tif s[i]-s[prev] < 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tweight += s[i] - 96\n\t\tcount++\n\t\tprev = i\n\t\tif count == n {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif count != n {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfmt.Println(weight)\n\t}\n}", "lang": "Go", "bug_code_uid": "2d75dd9feb1fd80d7a3ee1a599c6a766", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "f22649e4cdc4a2c9394ce0855a3ed6c4", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6083707025411061, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tvar list [8][8]string\n\n\tresult := 0\n\n\tfor i := 0; i < 8 ; i++ {\n\t\tinput, _ := reader.ReadString('\\n')\n\n\t\tfor j, r := range input {\n\t\t\tlist[i][j] = string(r)\n\t\t}\n\t}\n\n\tfor i := 0; i < 8 ; i++ {\n\t\tnow := true\n\t\tfirstChar := list[i][0]\n\n\t\tfor j := 0; j < 8 ; j++ {\n\t\t\tif list[i][j] != firstChar {\n\t\t\t\tnow = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif now {\n\t\t\tresult++;\n\t\t}\n\t}\n\n\tfor i := 0; i < 8 ; i++ {\n\t\tnow := true\n\t\tfirstChar := list[0][i]\n\n\t\tfor j := 0; j < 8 ; j++ {\n\t\t\tif list[j][i] != firstChar {\n\t\t\t\tnow = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif now {\n\t\t\tresult++;\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}", "lang": "Go", "bug_code_uid": "72a87f60d60f8a9b98d319bc946d4a01", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "83d96f0f51977f37d3cb1e31e5e74397", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9939117199391172, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tvar list [8][8]string\n\n\tresult := 0\n\n\tfor i := 0; i < 8 ; i++ {\n\t\tinput, _ := reader.ReadString('\\n')\n\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tlist[i][j] = string(input[j])\n\t\t}\n\t}\n\n\tfor i := 0; i < 8 ; i++ {\n\t\tnow := true\n\n\t\tfor j := 0; j < 8 ; j++ {\n\t\t\tif list[i][j] != \"B\" {\n\t\t\t\tnow = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif now {\n\t\t\tresult++;\n\t\t}\n\t}\n\n\tfor i := 0; i < 8 ; i++ {\n\t\tnow := true\n\n\t\tfor j := 0; j < 8 ; j++ {\n\t\t\tif list[j][i] != \"B\" {\n\t\t\t\tnow = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif now {\n\t\t\tresult++;\n\t\t}\n\t}\n\n\tif result > 8 {\n\t\tresult = 8\n\t}\n\n\tfmt.Println(result)\n}", "lang": "Go", "bug_code_uid": "ecb1b85c1389ae541312d96e073397a8", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "83d96f0f51977f37d3cb1e31e5e74397", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9971671388101983, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 1 {\n fmt.Println(0)\n return\n }\n var gpp int64\n var gp int64 = 0\n var g int64 = 1\n for i := 2; i < n; i++ {\n gpp = gp\n gp = g\n g = 2 * gp + 3 * gpp % 1000000007\n }\n fmt.Println(3 * g % 1000000007)\n \n return\n}", "lang": "Go", "bug_code_uid": "3d4e540af1e585dd1a73baff34c82d48", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "e33f3d36ecc74443bfed48076c40e5c9", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9461756373937678, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 1 {\n fmt.Println(0)\n return\n }\n var fpp int64\n var fp int64 = 0\n var f int64 = 3\n for i := 3; i <= n; i++ {\n fpp = gp\n fp = g\n f = (2 * fp + 3 * fpp) % 1000000007\n }\n fmt.Println(3 * f % 1000000007)\n \n return\n}", "lang": "Go", "bug_code_uid": "1ad1c4fe87b79d1c7bd57e7f6e4f9040", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "e33f3d36ecc74443bfed48076c40e5c9", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9943342776203966, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 1 {\n fmt.Println(0)\n return\n }\n var fpp int64\n var fp int64 = 0\n var f int64 = 3\n for i := 3; i <= n; i++ {\n fpp = fp\n fp = f\n f = (2 * fp + 3 * fpp) % 1000000007\n }\n fmt.Println(3 * f % 1000000007)\n \n return\n}", "lang": "Go", "bug_code_uid": "a5d51b92c2438654a49850c31b9c6a26", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "e33f3d36ecc74443bfed48076c40e5c9", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9789915966386554, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// 166E\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, i, k int64\n\tk = 0\n\tfmt.Scan(&n)\n\tfor i = 1; i < n; i++ {\n\t\tif i%2 == 1 {\n\t\t\tk = ((k + 1) * 3) % 1000000007\n\t\t} else {\n\t\t\tk = ((k - 1) * 3) % 1000000007\n\t\t}\n\t\tfmt.Print(k)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ea2cf2213f30c53ae7eec60bfe138a6d", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "5a149f4512a0430339a6bed0679e3d91", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.935064935064935, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := readUint64() * uint64(10000000000000)\n\tb := readUint64()\n\tc := readUint()\n\n\td := a / b\n\tfor i, ch := range fmt.Sprintf(\"%013v\", d) {\n\t\tv := ch - '0'\n\t\tif uint(v) == c {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"-1\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readUint() uint {\n\tval, _ := strconv.ParseUint(readString(), 10, 32)\n\treturn uint(val)\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readUint64() uint64 {\n\tval, _ := strconv.ParseUint(readString(), 10, 64)\n\treturn val\n}\n", "lang": "Go", "bug_code_uid": "7f5fc53099535f96c8e0565e4735b626", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "c26d9f975884089f7d46b06e802a24e8", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9942528735632183, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner\nvar t[1e5] bool;\n\nfunc init_scanner() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024*1024*20\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tval, _ := strconv.Atoi(scanner.Text())\n\treturn val\n}\n\nfunc main() {\n\tinit_scanner()\n\ta, b, c := readInt(), readInt(), readInt()\n\tfor i := 0; ; i++ {\n\t\ta *= 10\n\t\td := a/b\n\t\tif d == c {\n\t\t\tfmt.Println(i+1)\n\t\t\treturn\n\t\t}\n\t\tif t[d] {\n\t\t\tbreak\n\t\t}\n\t\tt[d] = true\n\t\ta %= b\n\t}\n\tfmt.Println(-1)\n}", "lang": "Go", "bug_code_uid": "ee1d41a4766390093dd52f0b22954282", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "ab0634bce874c12e06adc28608564f9e", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9971264367816092, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner\nvar t[1e5] bool;\n\nfunc init_scanner() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024*1024*20\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tval, _ := strconv.Atoi(scanner.Text())\n\treturn val\n}\n\nfunc main() {\n\tinit_scanner()\n\ta, b, c := readInt(), readInt(), readInt()\n\tfor i := 0; ; i++ {\n\t\ta *= 10\n\t\td := a/b\n\t\tif d == c {\n\t\t\tfmt.Println(i+1)\n\t\t\treturn\n\t\t}\n\t\tif t[a] {\n\t\t\tbreak\n\t\t}\n\t\tt[a] = true\n\t\ta %= b\n\t}\n\tfmt.Println(-1)\n}", "lang": "Go", "bug_code_uid": "fa9b8cdf13f3bc865c62550dfab197eb", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "ab0634bce874c12e06adc28608564f9e", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9976190476190476, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tMAXN = 110\n)\n\nvar N int\nvar A [MAXN]int\n\nfunc f(left int) int {\n\tfor i := left; i < N; i++ {\n\t\t// fmt.Print(i, A[i])\n\t\tif A[i] == 1 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\nfunc main() {\n\tfsc := NewFastScanner()\n\tN = fsc.NextInt()\n\tok := false\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = fsc.NextInt()\n\t\tif A[i] == 1 {\n\t\t\tok = true\n\t\t}\n\t}\n\tvar result int64\n\tresult = 1\n\tvar left, right int\n\tleft, right = 0, 0\n\n\tfor {\n\t\tleft = f(left)\n\t\tright = f(left + 1)\n\t\t// fmt.Println(left, right)\n\t\tif left == -1 || right == -1 {\n\t\t\tbreak\n\t\t}\n\t\t// fmt.Println(left, right)\n\t\tresult *= int64((right - left) - 1)\n\t\tleft = right\n\t}\n\tif ok == false {\n\t\tresult = 0\n\t}\n\tfmt.Println(result)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) 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 *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) 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", "lang": "Go", "bug_code_uid": "5b135841048f512a5b0b802ec43a87cc", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "898b9b2c61def36e5eec75c49e252580", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.18491484184914841, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 17, "bug_source_code": "// 284B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tin := bufio.NewScanner(os.Stdin)\n\tnm := 3\n\tst := make([]int, nm)\n\tvar n int\n\tvar ln string\n\tin.Scan()\n\tn, _ = strconv.Atoi(in.Text())\n\tln = in.Text()\n\tfor i := 0; i < n; i++ {\n\t\tif ln[i] == 'F' {\n\t\t\tst[0]++\n\t\t}\n\t\tif ln[i] == 'I' {\n\t\t\tst[1]++\n\t\t}\n\t\tif ln[i] == 'A' {\n\t\t\tst[2]++\n\t\t}\n\t}\n\tvar out int\n\tout = 0\n\tif st[1] == 0 {\n\t\tout = n - (st[0])\n\t}\n\tif st[1] == 1 {\n\t\tout = 1\n\t}\n\tfmt.Println(out)\n}\n", "lang": "Go", "bug_code_uid": "5e20cb53a13cdd6c6be500b2f452a6fd", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "859341296182b9771f79dc0ca5bdd948", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.2393617021276596, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tn, _ := strconv.ParseInt(os.Args[1], 10, 32)\n\tk, _ := strconv.ParseInt(os.Args[2], 10, 32)\n\n\tmod := n % k\n\tfmt.Println(n + (k - mod))\n}", "lang": "Go", "bug_code_uid": "480fec5e228046d29d1c4641659acfbb", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "a06434e9041baadeac2b83b359d720d3", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8867647058823529, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc my_min( x , y int ) ( ret int ) {\n\tif x < y {\n\t\tret = x ;\n\t} else {\n\t\tret = y ;\n\t}\n\t\n\treturn ;\n}\n\nfunc solve( n , k , lim int ) ( res int ) {\n\tres = k ;\n\t\n\tfor i := 2; i <= lim ; i ++ {\n\t\tif (k % i) == 0 {\n\t\t\tot := k / i ; \n\t\t\t\n\t\t\tif i > n {\n\t\t\t\tres = my_min( res , i ) ;\n\t\t\t}\n\t\t\t\n\t\t\tif ot > n {\n\t\t\t\tres = my_min( res , ot ) ; \n\t\t\t}\n\t\t} \n\t}\n\t\n\treturn ; \n}\n\nfunc main() {\n\t\n\tvar n , k int ;\n\t\n\tfmt.Scanf(\"%d %d\",&n,&k)\n\t\n\tvar lim int ; \n\tvar vv float64 ;\n\tvv = math.Sqrt(float64(k)) ;\n\t\n\tlim = int(vv);\n\t\n\tres := solve( n , k , lim ) ; \n\t\n\tfmt.Println(res);\n}\n", "lang": "Go", "bug_code_uid": "859089ff94101a39dc2d244e9ebe40e9", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "188861851e2e9d6b852b3cb8ca08e226", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6653306613226453, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar n, k uint64\n fmt.Scanf(\"%d %d \\n\", &n, &k)\n if k == 1 {\n fmt.Println(n)\n } else {\n count := math.Trunc(math.Log2(float64(n))) + 1\n k = uint64(math.Pow(2, float64(count))) - 1\n fmt.Println(k)\n }\n}", "lang": "Go", "bug_code_uid": "056836096cd3b85d2ea691edd1dac377", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "88667f6e91e71d609225b16ac29e99a4", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.997093023255814, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "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, k int64\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%d %d\", &n, &k)\n\n\tif n == 1 {\n\t\tfmt.Println(n)\n\t\treturn\n\t}\n\tbinStr := strings.Replace(strconv.FormatInt(n, 2), \"0\", \"1\", -1)\n\tnum, _ := strconv.ParseInt(binStr, 2, 64)\n\tfmt.Println(num)\n}\n", "lang": "Go", "bug_code_uid": "3d79a01e7e85f359c45cbaf75fa65230", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "b409b728ebab22c9c08872ff6a177a62", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6648575305291723, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, k uint64\n fmt.Scanln(&n, &k)\n if k == 1 || n == 1 {\n fmt.Println(n)\n } else {\n var degree_2 uint64 = uint64(math.Log2(float64(n)))\n result := (1 << (degree_2 + 1)) - 1\n fmt.Println(result)\n }\n}\n", "lang": "Go", "bug_code_uid": "ddf2d67b602c7f3ee2c8edb28a08e2a2", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "49fde96cdc86450ab84a9735f37af4d4", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6648501362397821, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "package main\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, k uint64\n fmt.Scanln(&n, &k)\n if k == 1 || n == 1 {\n fmt.Println(n)\n } else {\n var degree_2 uint64 = uint(math.Log2(float64(n)))\n result := (1 << (degree_2 + 1)) - 1\n fmt.Println(result)\n }\n}\n", "lang": "Go", "bug_code_uid": "5e8c2668acf4bcf39231fd546c540aea", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "49fde96cdc86450ab84a9735f37af4d4", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6038863976083707, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar input *bufio.Reader\n\nfunc main() {\n\tinput = bufio.NewReader(os.Stdin)\n\tvar n, m int32\n\tfmt.Fscanf(input, \"%d%d\\n\", &n, &m)\n\tfmt.Println(2 * (n + m - 1))\n}\n", "lang": "Go", "bug_code_uid": "667ff4a275e51a4278cb51f881d31338", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "c29224cf7b58e72348782c82240f789e", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9565217391304348, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\n\tfor i := 0; i <= 10000; i++ {\n\t\tif (c-i*b)%a == 0 {\n\t\t\tfmt.Printf(\"Yes\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Printf(\"No\\n\")\n}\n", "lang": "Go", "bug_code_uid": "d83fe6eedc579a855f2550d8441a5f25", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "816b703317d59b03c59ff7fa5baacca7", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5708978328173374, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Scan()\n\tline := s.Text()\n\ttokens := strings.Split(line, \" \")\n\ta, _ := strconv.Atoi(tokens[0])\n\tx, _ := strconv.Atoi(tokens[1])\n\ty, _ := strconv.Atoi(tokens[2])\n\tfmt.Println(findSquare(a, x, y))\n}\n\nfunc findSquare(a, x, y int) int {\n\tha := a\n\ta *= 2\n\tx *= 2\n\ty *= 2\n\n\tif -ha < x && x < ha && 0 < y && y < a {\n\t\treturn 1\n\t}\n\n\tif -ha < x && x < ha && a < y && y < 2*a {\n\t\treturn 2\n\t}\n\n\tif -a < x && x < 0 && 2*a < y && y < 3*a {\n\t\treturn 3\n\t}\n\n\tif 0 < x && x < a && 2*a < y && y < 3*a {\n\t\treturn 4\n\t}\n\n\tif -ha < x && x < ha && 3*a < y && y < 4*a {\n\t\treturn 5\n\t}\n\n\tif -a < x && x < 0 && 4*a < y && y < 5*a {\n\t\treturn 6\n\t}\n\n\tif 0 < x && x < a && 4*a < y && y < 5*a {\n\t\treturn 7\n\t}\n\n\treturn -1\n}\n", "lang": "Go", "bug_code_uid": "51f45459c5c9f51460901a2a5de2d070", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "238772115de6d2b69449c12171efa87b", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9861111111111112, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n%2 == 0 {\n\t\tfmt.Println(n/2 - 1)\n\t} else {\n\t\tfmt.Println(n/2 - 2)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "f24ee1087fed496955356f522b38d276", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "c480d8d024fa0ce8dc2917e4efaa0fb6", "difficulty": 1000, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9219440353460973, "equal_cnt": 28, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 15, "fix_ops_cnt": 27, "bug_source_code": "// package main\n\n// import \"fmt\"\n// import \"sort\"\n\n// func max(a int, b int) bool {\n// \treturn a > b;\n// }\n\n// func main() {\n// \tvar n int\n// \tvar inicio int\n// \tvar fim int\n\n// \tfmt.Scan(&n, &inicio, &fim)\n\n// \tarray := make([]int64, n)\n\n// \tfor i := 0; i < n; i++ {\n// \t\tfmt.Scan(&array[i])\n// \t}\n\n// \tslice := array[inicio-1 : fim]\n\n// \tsort.Slice(slice, max)\n\n// \tfor i := 0; i < n; i++ {\n// \t\tif i > 0 {\n// \t\t\tfmt.Print(\" \")\n// \t\t}\n// \t\tfmt.Print(array[i])\n// \t}\n// \tfmt.Println()\n// }\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar distancia int\n\tpassos := 0\n\n\tfmt.Scan(&distancia)\n\n\tif distancia % 5 == 0 {\n\t\tpassos += distancia / 5\n\t\tdistancia -= distancia / 5\n\t} else if distancia % 4 == 0 {\n\t\tpassos += distancia / 4\n\t\tdistancia -= distancia / 4\n\t} else if distancia % 3 == 0 {\n\t\tpassos += distancia / 3\n\t\tdistancia -= distancia / 3\n\t} else if distancia % 2 == 0 {\n\t\tpassos += distancia / 2\n\t\tdistancia -= distancia / 2\n\t} else {\n\t\tpassos += distancia;\n\t\tdistancia = 0\n\t}\n\tfmt.Println(passos)\n}", "lang": "Go", "bug_code_uid": "e94192cf94e7968515c5c1d6c6fd6fd0", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "6623ccaaa29e2b7a53573753851658fa", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9290780141843972, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tc := n / 2 + n % 2\n\tstep := n / 5\n\tif n % 5 > 0 {\n\t step++\n\t}\n\tfmt.Print(step)\n}", "lang": "Go", "bug_code_uid": "78a7cd56f407e5202949538d0ac7a894", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "f899f3c09fa5a89e254fbbe2fcfeec0a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9932885906040269, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n var a int\n scanf(\"%d\\n\", &a)\n steps := Problem617A(a)\n\tprintf(steps)\n}\n\nfunc Problem617A(position int) (steps int) {\n\tsteps = 0\n\tfor curr := 5; curr > 0; curr-- {\n\t\tfor position >= curr {\n\t\t\tsteps++\n\t\t\tposition-=curr\n\t\t}\n\t}\n\treturn\n}\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc scanf(format string, x ...interface{}) {\n\tif _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "9e3316ac251d7255c0c2e1f77457c05d", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "9811fff0ff9cc81224695c17f657c474", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.975397973950796, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// Steven Phillips / elimisteve\n// 2016.01.23\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tprintln(Run(PluckInt(Line())))\n}\n\nfunc Run(x int) int {\n\tanswer := x / 5\n\tif x%5 > 0 {\n\t\tanswer += 1\n\t}\n\treturn answer\n}\n\n// Helpers\n\nvar read = bufio.NewReader(os.Stdin)\n\nfunc Line() string {\n\ts, err := read.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn s[:len(s)-1]\n}\n\nvar regexNum = regexp.MustCompile(`\\d+`)\n\nfunc PluckInt(nStr string) int {\n\treturn Int(regexNum.FindString(nStr))\n}\n\nfunc Int(numStr string) int {\n\tnumStr = strings.TrimSpace(numStr)\n\tnum, err := strconv.Atoi(numStr)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "lang": "Go", "bug_code_uid": "5f0bc183fdff4726c579ede16a191726", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "7ba3e9f804468b98f6b84fca93527a1f", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.906318082788671, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n,m int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &m)\n\tif check(n,m){\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\nfunc check(n int, m int) bool{\n\tfor i:= n + 1; i <= m; i++{\n\t\tif checkPrime(i) == m{\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\nfunc checkPrime(a int) int{\n\tfor k:= 2; k < a; k++{\n\t\tif a % k == 0{\n\t\t\treturn -1\n\t\t}\n\t}\n\treturn a\n}", "lang": "Go", "bug_code_uid": "97f98dd0c2460e91abb69881f15e2adb", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "c23aaca3ea0cf063ba6318940b4018d8", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9906928645294726, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tis_prime := make([]int, 51, 51)\n\tfor i := 0; i < 51; i++ {\n\t\tis_prime[i] = 1\n\t}\n\tis_prime[1] = 0\n\tfor i := 2; i <= 8; i++ {\n\t\tif is_prime[i] == 1 {\n\t\t\tfor x := i + i; x < 51; x += i {\n\t\t\t\tis_prime[x] = 0\n\t\t\t}\n\t\t}\n\t}\n\n\tans := false\n\tfor i := n + 1; i < 51; i++ {\n\t\tif is_prime[i] == 1 {\n\t\t\tif i == m {\n\t\t\t\tans = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif ans == true {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a179c5b564884fd7548f455d71116b10", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "1429b349be76dc86a0868586264bba6e", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9834254143646409, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc sum(x int64) int64 {\n\tres := int64(0)\n\tfor x > 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar b, c int64\n\tvar a int\n\tfmt.Scan(&a, &b, &c)\n\tvar res []int\n\tfor s := int64(1); s <= 9*9; s++ {\n\t\tr := s\n\t\tfor i := 1; i < a; i++ {\n\t\t\tr *= s\n\t\t}\n\t\tr = b*r + c\n\t\tif sum(r) == s {\n\t\t\tres = append(res, int(r))\n\t\t}\n\t}\n\n\tsort.Ints(res)\n\tfmt.Println(len(res))\n\tfor i, r := range res {\n\t\tfmt.Print(r)\n\t\tif i == len(res)-1 {\n\t\t\tfmt.Print(\"\\n\")\n\t\t} else {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "e9ca2001d402734fa7fa1162a6e476f3", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "c76ddc78efed85c45195241b32a2d113", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9577666428060129, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// x = b·s(x)^a + c\n\nfunc main() {\n\tconst max_digits int64 = 9\n\n\tvar a, b, c int64\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &a, &b, &c); err != nil {\n\t\treturn\n\t}\n\n\tcnt := 0\n\tvar all_res []string\n\n\tfor i := int64(1); i < max_digits*max_digits; i++ {\n\t\ty := b*power(i, a) + c\n\t\tif s(y) == i {\n\t\t\tcnt++\n\t\t\tall_res = append(all_res, strconv.FormatInt(y, 10))\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\tfmt.Println(strings.Join(all_res, \" \"))\n}\n\nfunc s(x int64) int64 {\n\tres := int64(0)\n\tfor x > 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc power(sx, n int64) int64 {\n\tres := sx\n\tfor i := int64(1); i < n; i++ {\n\t\tres *= sx\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "856001f8d2091424ca061dfa672fe327", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "bb43b11877e5bd0f5dbfd19fd0fd371c", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9652067130577159, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc Sum(x int64) int64 {\n var result int64\n for x != 0 {\n result += int64(math.Mod(float64(x), 10.0))\n x = x / 10\n }\n\n return result\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var a, b, c int64\n line, _ := reader.ReadString(' ')\n fmt.Sscanln(line, &a)\n line, _ = reader.ReadString(' ')\n fmt.Sscanln(line, &b)\n fmt.Sscanln(Read(reader), &c)\n\n writer := bufio.NewWriter(os.Stdout)\n // s(x) can be from 1 to 81\n var result []int64\n for i := 1; i <= 81; i++ {\n right := b * int64(math.Pow(float64(i), float64(a))) + c\n if right < 1000000000 {\n left := Sum(right)\n\n if left == int64(i) {\n Write(writer, left, right)\n result = append(result, right)\n } \n }\n }\n\n \n Write(writer, len(result))\n for i := range result {\n fmt.Fprint(writer, result[i]) \n fmt.Fprint(writer, \" \") \n }\n \n writer.Flush()\n}", "lang": "Go", "bug_code_uid": "56ae415cc076e6a369887c60a1b662c4", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "d7609a27b221d3c032206e1659afd756", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9973082099596231, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc S(x int64) int64 {\n\tvar res int64 = 0\n\tfor x != 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc Pow(x, a int64) int64 {\n\tvar res int64 = 1\n\tfor i := 0; int64(i) < a; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tvar a, b, c int64\n\tfmt.Fscan(reader, &a, &b, &c)\n\tvar num_res = 0\n\tvar res []int64 = make([]int64, 40)\n\tfor i := 1; i < 40; i++ {\n\t\tvar x int64 = b*Pow(int64(i), a) + c\n\t\tif x < 1000000000 && S(x) == int64(i) {\n\t\t\tres[num_res] = x\n\t\t\tnum_res++\n\t\t}\n\t}\n\tfmt.Fprintln(writer, num_res)\n\tfor i := 0; i < num_res; i++ {\n\t\tfmt.Fprintf(writer, \"%d \", res[i])\n\t}\n\tfmt.Fprintln(writer)\n\twriter.Flush()\n}\n", "lang": "Go", "bug_code_uid": "9a6b020ee732f04da8a9aa5d66b2c636", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "32c07c65462a82f21e84eb5868a8f747", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9969040247678018, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m int\n\tvar ans int = 10000\n\tfmt.Scan(&n, &m)\n\tinputs := make([]int, m)\n\tfor i:=0; i A {\n\t\t\t\tA = v\n\t\t\t}\n\n\t\t\tif v < B {\n\t\t\t\tB = v\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", A-B)\n}\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc scanf(format string, x ...interface{}) {\n\tif _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "48c102ef9faeea17bb90a18b7d6c706f", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "ae1e41b6e5944bff2559ffb124e1e695", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport\n(\n \"fmt\"\n // \"math\"\n)\nfunc main(){\n var i int\n fmt.Scanf(\"%d\" , &i)\n // temp:= i\n x :=1\n count := 0\n var s []int\n for ;x81){\n continue\n }\n temp := x\n rs := (i-x)\n // temp2 :=1\n // fmt.Println(x)\n sum :=0\n for ;temp>0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n for x:=0;x0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n for x:=0;x= b - c {\n for n >= 0 {\n Lb := int64(n/b)\n if Lb == 0 {\n break\n }\n n -= Lb*b\n n += c*Lb\n bTotal += Lb\n //fmt.Printf(\"%v %v\\n\", n, bTotal)\n }\n bTotal += int64(n/a)\n } else {\n bTotal = int64(n/a)\n }\n fmt.Printf(\"%v\", bTotal)\n}\n", "lang": "Go", "bug_code_uid": "3cd4ea9bf00705213c32a77977d8671c", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "6004ad6a9ac0afd5081890bca4090e29", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.998766954377312, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n \nfunc main() {\n var n,a,b,c int64\n fmt.Scanf(\"%v\\n\", &n)\n fmt.Scanf(\"%v\\n\", &a)\n fmt.Scanf(\"%v\\n\", &b)\n fmt.Scanf(\"%v\\n\", &c)\n \n bTotal := int64(0)\n if a > b - c && n > b{\n /*for n >= 0 {\n Lb := int64(n/b)\n if Lb == 0 {\n break\n }\n n -= Lb*b\n n += c*Lb\n bTotal += Lb\n //fmt.Printf(\"%v %v\\n\", n, bTotal)\n }*/\n \n bTotal += int64((n-c)/(b-c))\n if bTotal < 0 {\n fmt.Printf(\"0\")\n return\n }\n n -= bTotal*(b-c)\n bTotal += int64(n/a)\n } else if n > a {\n bTotal = int64(n/a)\n } else if n > b {\n bTotal = int64(n/b)\n }\n fmt.Printf(\"%v\", bTotal)\n}\n", "lang": "Go", "bug_code_uid": "4a1aa62dfe6cf4f02bc1550b0c719132", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "6004ad6a9ac0afd5081890bca4090e29", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7700640078778926, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1<<13)\n\twriter := bufio.NewWriterSize(os.Stdout, 1<<13)\n\tn, a, b, c := ReadInt64(reader), ReadInt64(reader), ReadInt64(reader), ReadInt64(reader)\n\tans := min(solve(4-n%4, a, b, c), solve(8-n%4, a, b, c))\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc solve(n, a, b, c int64) int64 {\n\tif n < 0 {\n\t\treturn 1e10\n\t}\n\tif n%4 == 0 {\n\t\treturn 0\n\t}\n\tans := solve(n-1, a, b, c) + a\n\tans = min(ans, solve(n-2, a, b, c)+b)\n\tans = min(ans, solve(n-3, a, b, c)+c)\n\treturn ans\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc ReadInt(reader *bufio.Reader) int {\n\treturn int(ReadInt64(reader))\n}\n\nfunc ReadInt64(reader *bufio.Reader) int64 {\n\tb, err := reader.ReadByte()\n\tfor !isValid(b, err) {\n\t\tb, err = reader.ReadByte()\n\t}\n\tvar res int64\n\tfor isValid(b, err) {\n\t\tres = res*10 + int64(b-'0')\n\t\tb, err = reader.ReadByte()\n\t}\n\treturn res\n}\n\nfunc isValid(b byte, err error) bool {\n\treturn err == nil && '0' <= b && b <= '9'\n}\n", "lang": "Go", "bug_code_uid": "e28752a50486eb8e385b33abe43c4b07", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "de61bf7cd6b2b307a6f8835c93419f58", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9711229946524064, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tarr := [16]int{}\n\trems := [4]int{}\n\tfor i := 1; i < 4; i++ {\n\t\tfmt.Scan(&rems[i])\n\t}\n\tarr[n%4] = 1\n\tfor i := 0; i < 12; i++ {\n\t\tif arr[i] > 0 {\n\t\t\tfor j := 1; j < 4; j++ {\n\t\t\t\tif arr[i+j] == 0 || arr[i+j] > arr[i]+rems[j] {\n\t\t\t\t\tarr[i+j] = arr[i] + rems[j]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tans := 1\n\tfor i := 0; i < 16; i++ {\n\t\tif arr[i] > 0 && arr[i] < ans {\n\t\t\tans = arr[i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "c442d536e8a468aa0f8df9432261c6b9", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "867db93a06692fd5c328add5e9b0144b", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.48464163822525597, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tarr := [3]int{}\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Scan(&arr[i])\n\t}\n\trems := [4]int{}\n\trems[n] = 1\n\tfor i := 0; i < 3; i++ {\n\t\tfor rem := 0; rem < 4; rem++ {\n\t\t\tnewindex := (rem + i + 1) % 4\n\t\t\tif rems[newindex] == 0 || rems[newindex] > rems[rem]+arr[i] {\n\t\t\t\trems[newindex] = rems[rem] + arr[i]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(rems[0] - 1)\n}\n", "lang": "Go", "bug_code_uid": "8d0852a57275e3fb36e25b553ee5790e", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "867db93a06692fd5c328add5e9b0144b", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8148148148148148, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c, res int64\n\tfmt.Scan(&n, &a, &b, &c)\n\tr := n % 4\n\tswitch r {\n\tcase 0:\n\t\tres = 0\n\tcase 1:\n\t\tres = min(3*a, 2*b+1, c)\n\tcase 2:\n\t\tres = min(2*a, b, 2*c)\n\tcase 3:\n\t\tres = min(a, c+b)\n\t}\n\tfmt.Println(res)\n}\n\nfunc min(a ...int64) int64 {\n\tmin := a[0]\n\tfor _, n := range a {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\n", "lang": "Go", "bug_code_uid": "caa02be1a624dd64ac4950d8abef9124", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "fda1098c62ba5e9fff92be6df72f6714", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9964485032978183, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min(x, y int) int {\n\tif y < x {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\n\timpossible := func() bool {\n\t\tswitch n {\n\t\tcase 1:\n\t\t\tif s > 9 {\n\t\t\t\treturn true\n\t\t\t}\n\t\tdefault:\n\t\t\tif s == 0 || s > 9*n {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\n\tif impossible() {\n\t\tfmt.Println(\"-1 -1\")\n\t\treturn\n\t}\n\n\tlargest := func() string {\n\t\td := make([]int, n)\n\t\tx := s\n\t\tfor i := 0; i < n; i++ {\n\t\t\td[i] = min(x, 9)\n\t\t\tx -= d[i]\n\t\t}\n\t\tres := make([]rune, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tres[i] = rune(d[i] + '0')\n\t\t}\n\t\treturn string(res)\n\t}\n\n\tsmallest := func() string {\n\t\tif n == 1 {\n\t\t\treturn fmt.Sprintf(\"%d\", s)\n\t\t}\n\t\td := make([]int, n)\n\n\t\tx := s\n\t\tk := 0\n\t\tif s < 9*(n-1)+1 {\n\t\t\td[0] = 1\n\t\t\tk = 1\n\t\t}\n\t\tfor i := n - 1; i >= k; i-- {\n\t\t\td[i] = min(x, 9)\n\t\t\tx -= d[i]\n\t\t}\n\t\tres := make([]rune, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tres[i] = rune(d[i] + '0')\n\t\t}\n\t\treturn string(res)\n\t}\n\n\tfmt.Println(smallest(), largest())\n}\n", "lang": "Go", "bug_code_uid": "a33ca5590b568a4f63796725405a199a", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "cf6366e4b1f0e3b2faab4472500d3c08", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.20522749273959343, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x,y,m int64\n fmt.Scan(&x,&y,&m)\n ans := int64(0)\n for (x < m) && (y < m) {\n if (x < y) {\n if (x+y) <= x {\n ans = -1\n break\n } else {\n x += y\n }\n } else {\n if (y+x) <= y {\n ans = -1\n break\n } else {\n y += x\n }\n }\n ans++\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "ed65edb809f261e1411a5fd98402eaf7", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "e9205642df478025faf88608ec9b21db", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9646302250803859, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc scanInput() (int64, int64, int64) {\n\tvar x, y, m int64\n\tfmt.Scanf(\"%d %d %d\\n\", &x, &y, &m)\n\treturn x, y, m\n}\n\nfunc fibo(x, y, m int64) int64 {\n\tvar n int64\n\tif n = 0; x < m && y < m && (x+y) <= y && (x+y) <= x {\n\t\tn = -1\n\t\treturn n\n\t} else if math.Signbit(float64(x)) != math.Signbit(float64(y)) {\n\t\tif x > y {\n\t\t\tx, y = y, x\n\t\t}\n\t\tn = (-x) / y\n\t\tx = -((-x) % y)\n\t}\n\n\tfor x < m && y < m {\n\t\tt := x + y\n\t\tif x < y {\n\t\t\tx = t\n\t\t} else {\n\t\t\ty = t\n\t\t}\n\t\tn++\n\t}\n\treturn n\n}\n\nfunc main() {\n\tx, y, m := scanInput()\n\tn := fibo(x, y, m)\n\tfmt.Printf(\"%d\\n\", n)\n}\n", "lang": "Go", "bug_code_uid": "528876c46be56fe38f162b9ab4689ddd", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "40ea9b69acb06b2c7df5864977fd8bcc", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.818926296633303, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc scanInput() (int64, int64, int64) {\n\tvar x, y, m int64\n\tfmt.Scanf(\"%d %d %d\\n\", &x, &y, &m)\n\treturn x, y, m\n}\n\nfunc fibo(x, y, m int64) int64 {\n\tvar n int64\n\tif n = 0; x < m && y < m && (x+y) <= y && (x+y) <= x {\n\t\tn = -1\n\t\treturn n\n\t}\n\tfor x < m && y < m {\n\t\tt := x + y\n\t\tif x < y {\n\t\t\tx = t\n\t\t} else {\n\t\t\ty = t\n\t\t}\n\t\tn++\n\t}\n\treturn n\n}\n\nfunc main() {\n\tx, y, m := scanInput()\n\tn := fibo(x, y, m)\n\tfmt.Printf(\"%d\\n\", n)\n}\n", "lang": "Go", "bug_code_uid": "d126a8b0ed40a389f185f8dc15f657ce", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "40ea9b69acb06b2c7df5864977fd8bcc", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8886971527178602, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc scanInput() (int64, int64, int64) {\n\tvar x, y, m int64\n\tfmt.Scanf(\"%d %d %d\\n\", &x, &y, &m)\n\treturn x, y, m\n}\n\nfunc fibo(x, y, m int64) int64 {\n\tvar n int64\n\tif n = 0; x < m && y < m && (x+y) <= y && (x+y) <= x {\n\t\tn = -1\n\t\treturn n\n\t} else if math.Signbit(float64(x)) != math.Signbit(float64(y)) {\n\t\tif x > y {\n\t\t\tx, y = y, x\n\t\t}\n\t\tn = (-x) / y\n\t\tx = -((-x) % y)\n\t}\n\n\tfor x < m && y < m {\n\t\tt := x + y\n\t\tif x < y {\n\t\t\tx = t\n\t\t} else {\n\t\t\ty = t\n\t\t}\n\t\tn++\n\t}\n\treturn n\n}", "lang": "Go", "bug_code_uid": "4bc9be56284761cb790ca3a15fa18970", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "40ea9b69acb06b2c7df5864977fd8bcc", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5067300079176563, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bytes\"\n\t\"os\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\tvar dd, mm, yy, bd, bm, by int\n\tfmt.Fscanf(reader, \"%d.%d.%d\\n\", &dd, &mm, &yy)\n\tfmt.Fscanf(reader, \"%d.%d.%d\\n\", &bd, &bm, &by)\n\tby += 18\n\tif yy > by || (yy == by && mm > bm) || (yy == by && mm == bm && dd >= bd) {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "8d3f5b9b48de24ef12dd6aba8858013e", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "5f319e48b707479154800c73188b7e29", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9310344827586207, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b string\n\tfmt.Scan(a,b)\n\tif(a = b){\n\t\tfmt.Println(a)\n\t}\n\telse {\n\t\tfmt.Println(1)\n\t}\n}", "lang": "Go", "bug_code_uid": "f7ef72207e94294e580a0baf888bd9b6", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "c0db0b7130d3b56a8ce22cdbfe834107", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9917355371900827, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s1, s2 string\n fmt.Scanf(\"%s %s\", &s1, &s2)\n\n if s1 == s2 {\n fmt.Println(s1)\n } else {\n fmt.Println(s2)\n }\n}", "lang": "Go", "bug_code_uid": "eda4bf51b4822b58260692dd5410b0e7", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "27019dd3dc198ec49c05e4a2aa032f42", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9098116947472745, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math/big\"\n \"strconv\"\n \"strings\"\n)\n\nfunc stringToInt(s string) *big.Int {\n a := big.NewInt(0)\n for _, c := range s {\n a.Mul(a, big.NewInt(10))\n i, _ := strconv.Atoi(string(c))\n a.Add(a, big.NewInt(int64(i)))\n }\n return a\n}\n\nfunc main() {\n var a, b string\n fmt.Scan(&a, &b)\n a = strings.Trim(a, \" \")\n b = strings.Trim(b, \" \")\n x := stringToInt(a)\n y := stringToInt(b)\n fmt.Println(x.GCD(nil,nil, x, y))\n}\n", "lang": "Go", "bug_code_uid": "69aa2957f55d03c1fe1fef5a91b7f149", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "a3248acfcabcdae5190139572fc02ed1", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9928571428571429, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b string\n\tfmt.Scan(&a, &b)\n\n\tif a == b {\n\t\tfmt.Println(a)\n\t} else {\n\t\tfmt.Println(a)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "91593fa7a580ae83461003b547cba524", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "b4e36878d7eece3c45a7993b9012b150", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8306679209783632, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tn := ReadInt64()\n\ta := ReadInt64s(3)\n\tb := ReadInt64s(3)\n\tmin, max := solve(n, a, b)\n\tfmt.Printf(\"%d %d\\n\", min, max)\n}\n\nfunc solve(n int64, a, b []int64) (int64, int64) {\n\tmax := int64(0)\n\tMin = Min(a[0], b[1]) + Min(a[1], b[2]) + Min(a[2], b[0])\n\n\tcnt := int64(0)\n\tcnt += Min(a[0], b[1]+b[2]) + Min(a[1], b[2]+b[0]) + Min(a[2], b[0]+b[1])\n\tmin := n - cnt\n\n\treturn min, max\n}\n\nfunc Min(xs ...int) int {\n\tmin := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif min > x {\n\t\t\tmin = x\n\t\t}\n\t}\n\treturn min\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 ReadString() (s string) { Scan(&s); return }\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}\nfunc ReadInt64() (i int64) { Scan(&i); return }\nfunc ReadInt64s(n int) []int64 {\n\tv := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "lang": "Go", "bug_code_uid": "ee26e7a42498bee35b9703876da9bd84", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "apr_id": "abeb8e41025437a837be951bbae71aa6", "difficulty": 1800, "tags": ["flows", "greedy", "math", "brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9194499017681729, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int64) int64 {\n\tif a a {\n\t\ta, b = b, a\n\t}\n\tfor {\n\t\tr = a % b\n\t\tif r == 0 {\n\t\t\tbreak\n\t\t}\n\t\ta = b\n\t\tb = r\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar t,w,b int64\n\tfmt.Scanf(\"%d %d %d\",&t,&w,&b)\n p:=gcd(w,b)\n qw:=w/p\n qb:=b/p\n k:=t/p/qw/qb\n m:=min(w,b)-1\n r:=k + m*k + min(m,t-k*p*qw*qb)\n rt:=gcd(r,t)\n r,t=r/rt,t/rt\n fmt.Printf(\"%d/%d\\n\",r,t)\n}", "lang": "Go", "bug_code_uid": "581efad18c06cf7792165eed05e9bc25", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "5a0a1978b6d7d3dc5845e955be4c5e43", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9613899613899614, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int64) int64 {\n\tif a a {\n\t\ta, b = b, a\n\t}\n\tfor {\n\t\tr = a % b\n\t\tif r == 0 {\n\t\t\tbreak\n\t\t}\n\t\ta = b\n\t\tb = r\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar t,w,b int64\n\tfmt.Scanf(\"%d %d %d\",&t,&w,&b)\n p:=gcd(w,b)\n qw:=w/p\n qb:=b/p\n k:=t/p/qw/qb\n m:=min(w,b)-1\n r:=k + m*k + min(m,t-k*p*qw*qb)\n if r>0 {\n\t rt:=gcd(r,t)\n \tr,t=r/rt,t/rt\n\t}\n fmt.Printf(\"%d/%d\\n\",r,t)\n}", "lang": "Go", "bug_code_uid": "fa91ba23f84681b35f3a6355beb4ffd7", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "5a0a1978b6d7d3dc5845e955be4c5e43", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8523206751054853, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package a50\n\nimport \"fmt\"\n\nfunc main() {\n\tm, n := 0, 0\n\n\tfmt.Scanln(&m)\n\tfmt.Scanln(&n)\n\n\tfmt.Println(\" \", m*n/2)\n}\n", "lang": "Go", "bug_code_uid": "674ea0fab0a9449e2dbdb78778155501", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "c2a8923e96791ba198311badbec93889", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.018867924528301886, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a", "lang": "Go", "bug_code_uid": "b2a6ef7c188f6246dbfc51ff8fa42670", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "44a4538de2b30bcc2088957347607363", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9888484296768321, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "// A. Bear and Reverse Radewoosh\n/*\nLimak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't solve problems in the same order.\n\nThere will be n problems. The i-th problem has initial score p i and it takes exactly t i minutes to solve it. Problems are sorted by difficulty — it's guaranteed that p i < p i + 1 and t i < t i + 1.\n\nA constant c is given too, representing the speed of loosing points. Then, submitting the i-th problem at time x ( x minutes after the start of the contest) gives max(0,  p i - c·x) points.\n\nLimak is going to solve problems in order 1, 2, ..., n (sorted increasingly by p i). Radewoosh is going to solve them in order n, n - 1, ..., 1 (sorted decreasingly by p i). Your task is to predict the outcome — print the name of the winner (person who gets more points at the end) or a word \"Tie\" in case of a tie.\n\nYou may assume that the duration of the competition is greater or equal than the sum of all t i. That means both Limak and Radewoosh will accept all n problems.\n\nInput\nThe first line contains two integers n and c (1 ≤ n ≤ 50, 1 ≤ c ≤ 1000) — the number of problems and the constant representing the speed of loosing points.\n\nThe second line contains n integers p 1, p 2, ..., p n (1 ≤ p i ≤ 1000, p i < p i + 1) — initial scores.\n\nThe third line contains n integers t 1, t 2, ..., t n (1 ≤ t i ≤ 1000, t i < t i + 1) where t i denotes the number of minutes one needs to solve the i-th problem.\n\nOutput\n\nPrint \"Limak\" (without quotes) if Limak will get more points in total. Print \"Radewoosh\" (without quotes) if Radewoosh will get more points in total. Print \"Tie\" (without quotes) if Limak and Radewoosh will get the same total number of points.\n\nExamples\nInput\n3 2\n50 85 250\n10 15 25\n\nOutput\nLimak\n\nInput\n3 6\n50 85 250\n10 15 25\n\nOutput\nRadewoosh\n\nInput\n8 1\n10 20 30 40 50 60 70 80\n8 10 58 63 71 72 75 76\n\nOutput\nTie\n\nNote\nIn the first sample, there are 3 problems. Limak solves them as follows:\n\n Limak spends 10 minutes on the 1-st problem and he gets 50 - c·10 = 50 - 2·10 = 30 points.\n Limak spends 15 minutes on the 2-nd problem so he submits it 10 + 15 = 25 minutes after the start of the contest. For the 2-nd problem he gets 85 - 2·25 = 35 points.\n He spends 25 minutes on the 3-rd problem so he submits it 10 + 15 + 25 = 50 minutes after the start. For this problem he gets 250 - 2·50 = 150 points.\n\nSo, Limak got 30 + 35 + 150 = 215 points.\n\nRadewoosh solves problem in the reversed order:\n\n Radewoosh solves 3-rd problem after 25 minutes so he gets 250 - 2·25 = 200 points.\n He spends 15 minutes on the 2-nd problem so he submits it 25 + 15 = 40 minutes after the start. He gets 85 - 2·40 = 5 points for this problem.\n He spends 10 minutes on the 1-st problem so he submits it 25 + 15 + 10 = 50 minutes after the start. He gets max(0, 50 - 2·50) = max(0,  - 50) = 0 points.\n\nRadewoosh got 200 + 5 + 0 = 205 points in total. Limak has 215 points so Limak wins.\n\nIn the second sample, Limak will get 0 points for each problem and Radewoosh will first solve the hardest problem and he will get 250 - 6·25 = 100 points for that. Radewoosh will get 0 points for other two problems but he is the winner anyway.\n\nIn the third sample, Limak will get 2 points for the 1-st problem and 2 points for the 2-nd problem. Radewoosh will get 4 points for the 8-th problem. They won't get points for other problems and thus there is a tie because 2 + 2 = 4.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput1, _ := reader.ReadString('\\n')\n\tn, _ := strconv.Atoi(string(input1[0]))\n\tc, _ := strconv.Atoi(string(input1[2]))\n\n\tinput2, _ := reader.ReadString('\\n')\n\tpArr := strings.Split(strings.TrimSpace(input2), \" \")\n\n\tinput3, _ := reader.ReadString('\\n')\n\ttArr := strings.Split(strings.TrimSpace(input3), \" \")\n\n\tlt, lpt, rt, rpt := 0, 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tp1, _ := strconv.Atoi(pArr[i])\n\t\tt1, _ := strconv.Atoi(tArr[i])\n\t\tlpt += t1\n\t\tlt += max(0, p1-c*lpt)\n\n\t\tp2, _ := strconv.Atoi(pArr[n-1-i])\n\t\tt2, _ := strconv.Atoi(tArr[n-1-i])\n\t\trpt += t2\n\t\trt += max(0, p2-c*rpt)\n\t}\n\n\tif lt > rt {\n\t\tfmt.Print(\"Limak\")\n\t} else if lt < rt {\n\t\tfmt.Print(\"Radewoosh\")\n\t} else {\n\t\tfmt.Print(\"Tie\")\n\t}\n}\n\nfunc max(i, j int) int {\n\tif i > j {\n\t\treturn i\n\t}\n\treturn j\n}\n", "lang": "Go", "bug_code_uid": "30aa9418c7d6f6e906cfe88852cd2353", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "0e1910795eb92b94fc803c4969183516", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8679886685552408, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc isSubsequence(s, t string) bool {\n\tif len(s) < len(t) {\n\t\treturn false\n\t}\n\n\ti, j := 0, 0\n\n\tfor j < len(t) && i < len(s) {\n\t\tif s[i] == t[j] {\n\t\t\ti++\n\t\t\tj++\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\n\treturn j == len(t)\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\tvar (\n\t\ts, t string\n\t)\n\n\t// file, err := os.Open(\"input.txt\")\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\t// reader := bufio.NewReader(file)\n\n\treader := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tfmt.Fscanf(reader, \"%s\\n\", &t)\n\n\tvar maxLen = -1\n\tfor l := 0; l < len(s); l++ {\n\t\tfor r := l; r < len(s); r++ {\n\t\t\tarr := []string{string(s[:l]), string(s[r+1:])}\n\t\t\tnewS := strings.Join(arr, \"\")\n\n\t\t\tif isSubsequence(newS, t) {\n\t\t\t\tmaxLen = max(r-l+1, maxLen)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(maxLen)\n\n}\n", "lang": "Go", "bug_code_uid": "05026b8da93a9749c94c6f51a6864227", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "apr_id": "92475bb1364de2ec78af098557dbd691", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.98989898989899, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar s,v1,v2,t1,t2 int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in,&s,&v1,&v2,&t1,&t2)\n\ta1 := 2*t1+s*v1\n\ta2 := 2*t2+s*v2\n\tif a1= 2*b {\n\t\t\ta %= 2 * b\n\t\t\tcontinue\n\n\t\t} else if b >= 2*a {\n\t\t\tb %= 2 * a\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn a, b\n}\n\nfunc main() {\n\tvar s, v1, v2, t1, t2 int64\n\tfmt.Scanf(\"%d %d %d %d %d\", &s, &v1, &v2, &t1, &t2)\n\n\ttime1 := t1*2 + s*v1\n\ttime2 := t2*2 + s*v2\n\n\tif time1 == time2 {\n\t\tfmt.Println(\"Friendship\")\n\t}\n\n\tif time1 < time2 {\n\t\tfmt.Println(\"First\")\n\t} else {\n\t\tfmt.Println(\"Second\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "7d3d7c2fcb8452cc1343aeb69898cf71", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "f1a40194b95ce4d9e94c6127f9d74708", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.976271186440678, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s, v1, t1, v2, t2 int\n fmt.Scan(&s, &v1, &t1, &v2, &t2)\n a := s*v1 + 2*t1\n b := s*v2 + 2*t2\n if a < b {\n fmt.Print(\"First\")\n } else if a > b {\n fmt.Print(\"Second\")\n } else {\n fmt.Print(\"Friendship\")\n }\n}", "lang": "Go", "bug_code_uid": "6a189713d150d58ebcab1822a4ecacad", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "df7e8868c4ed049c76a485271ff8ec25", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8181818181818182, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"math\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc sign(x int) int {\n\ty := x\n\tif (y == 0) {\n\t\treturn 0\n\t}\n\tif (y < 0) {\n\t\treturn -1\n\t}\n\treturn 1\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tax, ay := scanInt(scanner), scanInt(scanner)\n\tbx, by := scanInt(scanner), scanInt(scanner)\n\tcx, cy := scanInt(scanner), scanInt(scanner)\n\tx0, y0 := float64(bx-ax), float64(by-ay)\n\tl0 := math.Hypot(x0, y0)\n\tx0 /= l0\n\ty0 /= l0\n\tx1, y1 := float64(cx-bx), float64(cy-by)\n\tl1 := math.Hypot(x1, y1)\n\tx1 /= l1\n\ty1 /= l1\n\t//writer.WriteString(fmt.Sprintf(\"(%.8f, %.8f) (%.8f, %.8f), dot product = %.8f\\n\",\n\t//\t\tx0, y0, x1, y1, x0*x1 + y0*y1))\n\tif x1 == x0 && y1 == y0 {\n\t\twriter.WriteString(\"TOWARDS\\n\")\n\t} else if x1 == -y0 && y1 == x0 {\n\t\twriter.WriteString(\"LEFT\\n\")\n\t} else {\n\t\twriter.WriteString(\"RIGHT\\n\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "3331d1231604af9f87bc9e60a893b90d", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "a09e43fa642fd05d1fb173f525984bd2", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8295454545454546, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, sum int\n\n\tfmt.Scanln(&n)\n\n\tfor i := 1; i <= n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tsum += i\n\t\t} else {\n\t\t\tsum -= i\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "lang": "Go", "bug_code_uid": "ec18ce5e4f69f71c04411a0d0e2a7a20", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "a6e084ddda2e37e27431d486a125349c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6437346437346437, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar res int\n\nfunc main() {\n\tvar q int\n\n\tfmt.Scanln(&q)\n\tfmt.Println(fn(q))\n}\n\nfunc fn(n int) int {\n\tif n == 1 {\n\t\tres--\n\t\treturn res\n\t}\n\n\tif n%2 == 0 {\n\t\tres += n\n\t} else {\n\t\tres -= n\n\t}\n\n\tfn(n - 1)\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "bfa3d3facfc94f487b78253225ee1800", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "a6e084ddda2e37e27431d486a125349c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.5953757225433526, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n\tvar n int64\n\tvar total int64\n\tfmt.Scanln(&n)\n\tfor i := int64(1); i <= n; i ++ {\n\t\tif i%2 == 1 {\n\t\t\ttotal -= i\n\t\t}else {\n\t\t\ttotal += i\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n", "lang": "Go", "bug_code_uid": "d36a2a1a24f8aeb10d45318f5eaee700", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "fffc42321dc745f27048e2a97adaa7cc", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.05072923272035511, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Pow(a int, b int) int {\n\tnum := a\n\tfor i := 0; i < b; i++ {\n\t\tnum *= a\n\t}\n\treturn num\n}\n\nfunc main() {\n\tvar n int\n\tnum := 0\n\t_, _ = fmt.Scan(&n)\n\tfor i := 1; i < n + 1; i++ {\n\t\tnum += -Pow(-1, i) * i\n\t}\n\tfmt.Println(num)\n}\n", "lang": "Go", "bug_code_uid": "8b950a99e56067943ac0ddb8b4f603b1", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "04ba1ef80bbd09cb3d7610f7fc4ed7e3", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9980732177263969, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar num int\n\tvar numMap map[int]int\n\tvar buy int\n\n\tbuy = 0\n\tnumMap = make(map[int]int, 4)\n\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scanf(\"%d \", &num)\n\t\tnumMap[num]++\n\t\tif numMap[num] > 1 {\n\t\t\tbuy++\n\t\t}\n\t}\n\tfmt.Println(buy)\n}\n", "lang": "Go", "bug_code_uid": "f512737e6008840e27798d50690e17c5", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "3c6b711d90e359907e31cb8d271d3cc2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6675126903553299, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc main() {\n\ts1 := uint64(0)\n\ts2 := uint64(0)\n\ts3 := uint64(0)\n\ts4 := uint64(0)\n\tfmt.Scanf(\"%d %d %d %d\", s1, s2, s3, s4)\n\n\tcnt := 0\n\n\tif s1 != s2 {\n\t\tcnt += 1\n\t}\n\n\tif s1 != s3 {\n\t\tcnt += 1\n\t}\n\n\tif s1 != s4 {\n\t\tcnt += 1\n\t}\n\n\tfmt.println(3-cnt)\n}\n", "lang": "Go", "bug_code_uid": "827efd609c772b23342cb9dd9bfaf172", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "9fd04225593c0bbfa6a068bf382b90c6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9513513513513514, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar s1, s2, s3, s4, needToBuy int\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(reader, &s1)\n\tfmt.Fscan(reader, &s2)\n\tfmt.Fscan(reader, &s3)\n\tfmt.Fscan(reader, &s4)\n\tif s1 == s2 {\n\t\tneedToBuy++\n\t}\n\tif s2 == s3 {\n\t\tneedToBuy++\n\t}\n\tif s3 == s4 {\n\t\tneedToBuy++\n\t}\n\tfmt.Println(needToBuy)\n}\n", "lang": "Go", "bug_code_uid": "155ade5250dd87d4e0b3657ef980a976", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "d2c8f93420abf176863c4784d6e60df1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9263392857142857, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s1 int\n\tfmt.Scan(&s1)\n\tvar s2 int\n\tfmt.Scan(&s2)\n\tvar s3 int\n\tfmt.Scan(&s3)\n\tvar s4 int\n\tfmt.Scan(&s4)\n\tsAll := [4] int {s1, s2, s3, s4}\n\tcount := 1\n\tfor index := 0; index < 4; index++ {\n\t\tfor i := index +1 ; i < 4; i++ {\n\t\t\tif sAll[index] == sAll[i] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t} \n\t}\n\tif count > 4 {\n\t\tcount = count - 4\n\t} else {\n\t\tcount = count - 1\n\t}\n\tfmt.Print(count)\n}", "lang": "Go", "bug_code_uid": "baf0daf839ec15a0907469aea636e125", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "e7f0e333376f35e82a59bf0e46f3284d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9848101265822785, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tn, m := 0, 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d %d\", &n, &m)\n\t}\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\ttokens := strings.Fields(line)\n\t\tchildRequirement := make([]int, n)\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tchildRequirement[i], _ = strconv.Atoi(tokens[i])\n\t\t}\n\n\t\tchildGet := make([]int, n)\n\n\t\tlastChild := 0\n\t\tfor {\n\t\t\tfinishes := true\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tchildGet[i] = childGet[i] + m\n\t\t\t\t\tlastChild = i\n\t\t\t\t}\n\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tfinishes = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif finishes {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(childGet)\n\t\tfmt.Println(lastChild + 1)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "eb9876899d3b2522dc99c8f22b51087c", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "f8a814d29e4c273e58ae17cec92bb656", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9764309764309764, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// 437A\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t\ta [4]int\n\t\tb1, b2 bool\n\t)\n\tout := bufio.NewWriter(os.Stdout)\n\ttmp := 0\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&s)\n\t\ta[i] = len(s) - 2\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tb1 = true\n\t\tb2 = true\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif j != i {\n\t\t\t\tif 2*a[i] > a[j] {\n\t\t\t\t\tb1 = false\n\t\t\t\t}\n\t\t\t\tif a[i] < 2*a[j] {\n\t\t\t\t\tb2 = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif b1 || b2 {\n\t\t\ttmp++\n\t\t\tk = i\n\t\t}\n\t}\n\tif tmp == 1 {\n\t\tm := 65 + k\n\t\tfmt.Fprintln(out, string(m))\n\t} else {\n\t\tfmt.Println('C')\n\t}\n\tout.Flush()\n}\n", "lang": "Go", "bug_code_uid": "d1335ac2f36c80c502c12f44e3349bad", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "f17270d1304a34221edb075013bc0d1d", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9163987138263665, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tlens := make([]int, 4, 4)\n\tchoice := \"\"\n\tmin := 0\n\tmax := 0\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&choice)\n\t\tlens[i] = len(choice) - 2\n\t\tif lens[min] > lens[i] {\n\t\t\tmin = i\n\t\t}\n\t\tif lens[max] < lens[i] {\n\t\t\tmax = i\n\t\t}\n\t}\n\n\t//fmt.Println(min, max)\n\n\tans := 2\n\tcnt := 0\n\tfor i := 0; i < 4; i++ {\n\t\tif lens[i] >= 2*lens[min] {\n\t\t\tcnt++\n\t\t}\n\t}\n\t//fmt.Println(cnt)\n\tif cnt == 3 {\n\t\tans = min\n\t} else {\n\t\tcnt = 0\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tif lens[i] <= lens[max]/2 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\n\t\t//fmt.Println(cnt)\n\t\tif cnt == 3 {\n\t\t\tans = max\n\t\t}\n\t}\n\n\tfmt.Println(string(ans + 'A'))\n}\n", "lang": "Go", "bug_code_uid": "3c56d395aa51f5f46f50eaae8fee2059", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "389e52556f8c90d0f5d513260061d187", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5580715850986121, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "// 437A-mic_rizal\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc solve(A, B, C, D string) string {\n a := len(A) - 2\n b := len(B) - 2\n c := len(C) - 2\n d := len(D) - 2\n var an string\n if (2*a <= b && 2*a <= c && 2*a <= d) || (a >= 2*b && a >= 2*c && a >= 2*d) {\n an = string(A[0])\n }\n return an\n}\n\nfunc main() {\n var a, b, c, d string\n fmt.Scan(&a, &b, &c, &d)\n if solve(a, b, c, d) != \"\" {\n fmt.Println(solve(a, b, c, d))\n } else if solve(b, a, c, d) != \"\" {\n fmt.Println(solve(b, a, c, d))\n } else if solve(c, a, b, d) != \"\" {\n fmt.Println(solve(c, a, b, d))\n } else if solve(d, a, b, c) != \"\" {\n fmt.Println(solve(d, a, b, c))\n } else {\n fmt.Println(\"C\")\n }\n\n}\n", "lang": "Go", "bug_code_uid": "ace6a6476ace03b9dcd856b73b696d8a", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "0849b461b08a1d9e197466dd553eec08", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9143835616438356, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\"fmt\";\"sort\")\n\ntype set map[int]bool\n\nfunc main(){\n\ta := make([]string, 4)\n\tfor i := 0; i < 4; i++{\n\t\tscan(&a[i])\n\t}\n\tsort.Slice(a, func (i, j int)bool{return len(a[i]) < len(a[j])})\n\tif (len(a[0]) - 2) * 2 <= len(a[1]) - 2{\n\t\tsout(string(a[0][0]))\n\t}else if (len(a[2]) - 2) * 2 <= len(a[3]) - 2{\n\t\tsout(string(a[3][0]))\n\t}else{\n\t\tsout(\"C\")\n\t}\n}\n\nfunc scan(in ... interface{}){\n\tfor _,k := range in{\n\t\tfmt.Scan(k)\n\t}\n}\n\nfunc sout(obj ... interface{}){\n\tfor _, k := range obj{\n\t\tfmt.Print(k)\n\t}\n\t//fmt.Println()\n}", "lang": "Go", "bug_code_uid": "140bf3e48b751ae684df0fffca2e8271", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "e12e4a6dd87742c439ccaf3993daaad2", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9182732606873428, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN, k := sc.NextInt(), sc.NextInt()\n\tif k % 2 == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tif (k / 2) % 2 == 1 {\n\t\tfmt.Println(2)\n\t\treturn\n\t}\n\tn := pow(2, N)\n\tc := n / 2\n\n\tif c == k {\n\t\tfmt.Println(N)\n\t\treturn\n\t}\n\tif k > c {\n\t\tk = n - k\n\t}\n\n\tfmt.Println(k / 4 + 1)\n}\n//aのb乗をします\nfunc pow(a int, b int) int {\n\ttotal := 1\n\ttmp := a\n\tfor b > 0 {\n\t\tif b % 2 == 1 {\n\t\t\ttotal *= tmp\n\t\t}\n\t\tb /= 2\n\t\ttmp *= tmp\n\t}\n\treturn total\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", "lang": "Go", "bug_code_uid": "eae5d9c09b35bc8a3044c8ab9a7341ab", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "7507c7c8da365f2b1009ff18ca84daa1", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.32707774798927614, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc cnt(x, y int) (result int) {\n\tfor i := x; i < x+y; i++ {\n\t\tresult += 2*i + 1\n\t}\n\n\treturn result\n}\n\nfunc main() {\n\tvar a [6]int\n\tfor i := 0; i < 6; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfmt.Println(cnt(a[1], a[0]) + cnt(a[4], a[3]))\n}\n", "lang": "Go", "bug_code_uid": "a913ac1f2bc3b8ae838c813a0c5a75fa", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "3e0f66057a726889b490f1317e9d9cb2", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9665158371040724, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/559/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc s(x int) int {\n\treturn x * x\n}\n\nfunc Solve(a1, a2, a3, a4, a5, a6 int) int {\n\tfmt.Println(a1, a2, a3, a4, a5, a6)\n\treturn s(a1+a2+a3) - s(a1) - s(a3) - s(a5)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar a1, a2, a3, a4, a5, a6 int\n\tfmt.Fscanf(reader, \"%d %d %d %d %d %d\\n\", &a1, &a2, &a3, &a4, &a5, &a6)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(a1, a2, a3, a4, a5, a6))\n}\n", "lang": "Go", "bug_code_uid": "f46bfd04bc26392942a9993fec833391", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "22be7f8fa449a501cacd85981ccf6604", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9162303664921466, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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\tword := scanner.Bytes()\n\tscanner.Scan()\n\ttranslated := scanner.Bytes()\n\tlength := len(word)\n\tfor index := range word {\n\t\tif word[index] != translated[length - 1 - index] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n", "lang": "Go", "bug_code_uid": "dc65ae611e05bbc681029fa55926c212", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "2784b4c62315a015c33fb9908e6a642a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8832684824902723, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\n\tvar a, b string\n\n\tfmt.Scan(&a, &b)\n\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[len(a)-1-i] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n\tos.Exit(0)\n}\n", "lang": "Go", "bug_code_uid": "5568dad1aab471428f5186adfd158a16", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "ae0f4c3aaf33073eb4a48d2fb9c556b6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7592067988668555, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\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 runes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n }\n\nfunc main(){\n\tvar x, y string\n\t\n\n\tfmt.Scanf(\"%s\\n%s\", &x, &y)\n\n\tc := reverse(x)\n\n\tif c == y {\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}", "lang": "Go", "bug_code_uid": "73a1588d604c3a08f7959db50df00835", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "c86725a71b636c0be7f3c168c5734ea5", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9241379310344827, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar s, t string\n\nfunc main() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader := bufio.NewReaderSize(stdin, 1<<20)\n\tfmt.Fscanf(reader, \"%s\\n%s\\n\", &s, &t)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != t[len(s)-i-1] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n", "lang": "Go", "bug_code_uid": "c103eb07eef273b8be29a6026a7c11d2", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "ebfbf50f33845cfe4aa645d099709a88", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9673590504451038, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc isPalindrome(a1, a2 string) bool {\n\tvar i, n int\n\tn = len(a1)\n\tfor i = 0; i < n; i++ {\n\t\tif a1[i] != a2[n-i-1] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tfmt.Scan(&s1, &s2)\n\tif isPalindrome(s1, s2) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "7aef1367596b44ffa616991e0ab917c4", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "2701e689fe22cbc100fde18f3ef4ddff", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7027190332326284, "equal_cnt": 36, "replace_cnt": 33, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 37, "bug_source_code": "package main\n \nimport (\n \"fmt\"\n \"unicode\"\n \"unicode/utf8\"\n)\n \n// no encoding\nfunc reverseBytes(s string) string {\n r := make([]byte, len(s))\n for i := 0; i < len(s); i++ {\n r[i] = s[len(s)-1-i]\n }\n return string(r)\n}\n \n// reverseCodePoints interprets its argument as UTF-8 and ignores bytes\n// that do not form valid UTF-8. return value is UTF-8.\nfunc reverseCodePoints(s string) string {\n r := make([]rune, len(s))\n start := len(s)\n for _, c := range s {\n // quietly skip invalid UTF-8\n if c != utf8.RuneError {\n start--\n r[start] = c\n }\n }\n return string(r[start:])\n}\n \n// reversePreservingCombiningCharacters interprets its argument as UTF-8\n// and ignores bytes that do not form valid UTF-8. return value is UTF-8.\nfunc reversePreservingCombiningCharacters(s string) string {\n if s == \"\" {\n return \"\"\n }\n p := []rune(s)\n r := make([]rune, len(p))\n start := len(r)\n for i := 0; i < len(p); {\n // quietly skip invalid UTF-8\n if p[i] == utf8.RuneError {\n i++\n continue\n }\n j := i + 1\n for j < len(p) && (unicode.Is(unicode.Mn, p[j]) ||\n unicode.Is(unicode.Me, p[j]) || unicode.Is(unicode.Mc, p[j])) {\n j++\n }\n for k := j - 1; k >= i; k-- {\n start--\n r[start] = p[k]\n }\n i = j\n }\n return (string(r[start:]))\n}\n\nfunc main() {\n fmt.Scanln(s)\n fmt.Scanln(r)\n if r = reverseCodePoints(s){\n fmt.Println(\"YES\")\n }\n else {fmt.Println(\"NO\")\n}", "lang": "Go", "bug_code_uid": "452d0c5478ce7f1c33e2fa323cff740f", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "a0986bca595184d493b4391c8ffc0a3e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.914396887159533, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar a,b string\n\tfmt.Scanln(&a)\n\tfmt.Scanln(&b)\n\tvar f,l int = 0,len(b)\n\tfor i := range b {\n\t\tif(b[i]!=a[l-i-1]){\n\t\t\tf=1\n\t\t}\n\t}\n\tif f == 0{\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "937c26051651b1107fdd60e36c267372", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "db70704ea89c9b16a02fc6556cc46bab", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.65, "equal_cnt": 19, "replace_cnt": 19, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 19, "bug_source_code": "// 41A-Mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar str string\n\tvar reverse string\n\ti := 0\n\tbenar := false\n\tfmt.Scan(&str)\n\tk := len(str) - 1\n\tfmt.Scan(&reverse)\n\tfor i < len(str) {\n\t\tif str[i] == reverse[k] {\n\t\t\tbenar = true\n\t\t\tk--\n\t\t\ti++\n\t\t} else {\n\t\t\tbenar = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif benar {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "33dc7cddcfeadc01fe34480453ae9711", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "c48fa5ea5ef4130ab8fe99e7b7c6e187", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9425287356321839, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n, &s)\n\n\tfor i := 0; i < n; i += i + 1 {\n\t\tfmt.Print(string(s[i]))\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "4740bdc669ce1ea9befc4adc3f10832c", "src_uid": "08e8c0c37b223f6aae01d5609facdeaf", "apr_id": "6287110ac1ea55db1b0cfa356dab2549", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9383697813121272, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\n\nimport (\n\t\"fmt\"\t\n\t)\n\nfunc main() {\n\tvar cipherLength int\n\tvar cipherCode string\n\n\tfmt.Scan(&cipherLength)\n\tfmt.Scan(&cipherCode)\n\n\tfor i:=0; i 0 {\n if num < arr[startIndex] {\n startIndex--\n continue\n }\n count += num / arr[startIndex]\n num = num % arr[startIndex]\n startIndex--\n }\n \n fmt.Println(num)\n}", "lang": "Go", "bug_code_uid": "111202fce8597eda7e7a4c84cbc7943b", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "ec341e8981b81b48ce0b41ffad578745", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9938271604938271, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n \"fmt\"\n) \nfunc main() {\n var n,k int\n fmt.Scan(&n)\n for _,i := range([]int{100,20,10,5,1}){\n k += n/i\n n %= i\n }\n fmt.Println(k)", "lang": "Go", "bug_code_uid": "f5ca0a43069d2d240a93c8d191dc47d7", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "fc69b78b0a40c223886a2890ae0e9ef0", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9981606376456161, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a + 1, -a},\n\t\t[]int64{1, 0},\n\t}\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t// \t[]int64{1, 0},\n\t// }\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := int64(0)\n\n\tbig := (a*x + b) % MOD\n\tbig *= AK[0][0]\n\tans += big\n\tans %= MOD\n\n\tsml := AK[0][1]\n\tsml *= x\n\tsml %= MOD\n\tans += sml\n\tans %= MOD\n\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*nのint型正方行列を生成する\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// 行列A, Bに関するA*Bの計算\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// 行列Aに関するA^nの計算\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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", "lang": "Go", "bug_code_uid": "e6cf119c8e74934db51a7e07812c648d", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "d7cc97323d5d8a267c2a59811a6a18bc", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9119746233148295, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "//\n// Created by aldair on 21/10/20.\n// https://codeforces.com/problemset/problem/236/A\n//\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\nfunc scanf(f string, a ...interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tvar username string\n\tscanf(\"%s\\n\", &username)\n\n\tif len(username)%2 == 0 {\n\t\tprintf(\"CHAT WITH HER!\\n\")\n\t} else {\n\t\tprintf(\"IGNORE HIM!\\n\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1cec93244aaf406198ec3b78a1855e34", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "b595cfa7e471b25673b96edc439a58a7", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7707509881422925, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/emirpasic/gods/sets/hashset\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tst := hashset.New()\n\tfor i := range s {\n\t\tst.Add(s[i])\n\t}\n\tif st.Size()%2 == 0 {\n\t\tfmt.Print(\"CHAT WITH HER!\")\n\t} else {\n\t\tfmt.Print(\"IGNORE HIM!\")\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "2943ce5931d3d22eabae3f3edcc4745e", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "95693e63f72641447e19394ec32ef9f9", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9961389961389961, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tchars := map[rune]bool{}\n\tvar word string\n\tfmt.Scanf(\"%s\\n\", &word)\n\tfor _, c := range word {\n\t\tchars[c] = true\n\t}\n\n\tif len(chars)%2 == 0 {\n\t\tfmt.Println(\"CHAR WITH HER!\")\n\t} else {\n\t\tfmt.Println(\"IGNORE HIM!\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "fbbe6664b53677e9aadcb15d0835d744", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "3844d4287f58cdf19d2b4aa0c4e3c103", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9980506822612085, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\n// A. Boy or Girl\n// time limit per test\n// 1 second\n// memory limit per test\n// 256 megabytes\n// input\n// standard input\n// output\n// standard output\n\n// Those days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talked very often and eventually they became a couple in the network.\n\n// But yesterday, he came to see \"her\" in the real world and found out \"she\" is actually a very strong man! Our hero is very sad and he is too tired to love again now. So he came up with a way to recognize users' genders by their user names.\n\n// This is his method: if the number of distinct characters in one's user name is odd, then he is a male, otherwise she is a female. You are given the string that denotes the user name, please help our hero to determine the gender of this user by his method.\n// Input\n\n// The first line contains a non-empty string, that contains only lowercase English letters — the user name. This string contains at most 100 letters.\n// Output\n\n// If it is a female by our hero's method, print \"CHAT WITH HER!\" (without the quotes), otherwise, print \"IGNORE HIM!\" (without the quotes).\n\nfunc main() {\n\tvar input string\n\tfmt.Scan(&input)\n\n\t// since our input is constrained to lowercase ascii characters, this is a better way to count the chars compared to using a map\n\tvar charCounts [26]int\n\n\tfor _, r := range input {\n\t\tc := byte(r)\n\t\tcharCounts[c-'a']++\n\t}\n\n\tvar nDistinctChars int\n\tfor _, count := range charCounts {\n\t\tif count == 1 {\n\t\t\tnDistinctChars++\n\t\t}\n\t}\n\n\tif nDistinctChars%2 == 0 {\n\t\tfmt.Print(\"CHAT WITH HER!\")\n\t} else {\n\t\tfmt.Print(\"IGNORE HIM!\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ba25c46ad0b97effcfbdfa72b24f3749", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "2ac784c79cb138402e315d6665c3bb6c", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9940652818991098, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc judui(c int) int {\n\tif c < 0 {\n\t\tc = c * (-1)\n\t}\n\treturn c\n}\n\nfunc main() {\n\tvar a, b int\n\tx := 0\n\ty := 0\n\tz := 0\n\tfmt.Scanln(&a, &b)\n\tfor i := 1; i < 7; i++ {\n\t\tif judui(i-a) == judui(i-b) {\n\t\t\ty++\n\t\t} else if judui(i-a) > judui(i-b) {\n\t\t\tx++\n\t\t} else {\n\t\t\tz++\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d %d\", x, y, z)\n}\n", "lang": "Go", "bug_code_uid": "78f7a9ae32db02cbdc58e8c50bd0b1e5", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "332aee8de5fb3f9542a7d4f16c9339d8", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7620320855614974, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "// 378A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n var a, b, wina, winb, draw int\n fmt.Scan(&a, &b)\n for x := 1; x <= 6; x++ {\n\t\tai := float64(x)-a\n\t\tbi := float64(x)-b\n if math.Abs(ai) < math.Abs(bi) {\n wina++\n } else if math.Abs(ai) > math.Abs(bi) {\n winb++\n } else {\n draw++\n }\n }\n fmt.Println(wina, draw, winb)\n}", "lang": "Go", "bug_code_uid": "adb63b5a62f6bf5e02f0212eb35bbbe5", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "5db5531d2f468d9d6cc3119b05952d57", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9895615866388309, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "// 104A-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 20 {\n fmt.Println(\"15\")\n }else if n == 10 || n>21 {\n fmt.Println(\"0\")\n } else {\n fmt.Println(\"4\")\n }\n}\n", "lang": "Go", "bug_code_uid": "35e28aa58c8ad5d7df9bb3582beb29aa", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "feb37872fc506bc8dfb64a8ab158ecd5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.986639260020555, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc main() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tvar id string\n\tfor I(&id, \"\\n\") == nil {\n\t\tif solve(id) {\n\t\t\tO(\"YES\", \"\\n\")\n\t\t} else {\n\t\t\tO(\"NO\", \"\\n\")\n\t\t}\n\t}\n}\nfunc solve(id string) bool {\n\tpattern := \"^[a-zA-Z0-9_]{2,15}@([a-zA-Z0-9_]{2,15}\\\\.?)*(\\\\/[a-zA-Z0-9_]{2,15})?$\"\n\tif regexp.MustCompile(pattern).MatchString(id) {\n\t\to := strings.Split(id, \"@\")\n\t\tif strings.Contains(o[1], \"/\") {\n\t\t\to = append([]string{o[0]}, strings.Split(o[1], \"/\")...)\n\t\t}\n\t\tif len(o[1]) > 1 && len(o[1]) < 32 && o[1][len(o[1])-1] != '.' {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "lang": "Go", "bug_code_uid": "43a4f8c9e7205c75af196a88482b08b3", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "a214c41fe2368c70950a901fffd462f4", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9988249118683902, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nvar re *regexp.Regexp = regexp.MustCompile(\"^[0-9a-zA-Z_]{1,16}$\")\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\", &s)\n\n\tsegs := strings.Split(s, \"@\")\n\tif len(segs) != 2 || !re.Match([]byte(segs[0])) {\n\t\tfmt.Printf(\"NO\")\n\t\treturn\n\t}\n\tsegs = strings.Split(segs[1], \"/\")\n\tif len(segs) > 2 {\n\t\tfmt.Printf(\"NO\")\n\t\treturn\n\t} else {\n\t\tif len(segs[0]) < 1 || len(segs[0]) > 32 {\n\t\t\tfmt.Printf(\"NO\")\n\t\t\treturn\n\t\t}\n\t\thostnameSegs := strings.Split(segs[0], \".\")\n\t\tfor i := 0;i < len(hostnameSegs);i ++ {\n\t\t\tif !re.Match([]byte(hostnameSegs[0])) {\n\t\t\t\tfmt.Printf(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif len(segs) == 2 && !re.Match([]byte(segs[1])) {\n\t\t\tfmt.Printf(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"YES\")\n\treturn\n}", "lang": "Go", "bug_code_uid": "02b76dd4e171b6ba8f929513e2687be0", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "3531aa5ff88ff5652f35f4b95a66781d", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.997934493951018, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"fmt\"\nimport \"strings\"\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin);\n\tfor scanner.Scan() {\n\t\tif do_str(scanner.Text()) {\n\t\t\tfmt.Println(\"YES\");\n\t\t} else {\n\t\t\tfmt.Println(\"NO\");\n\t\t}\n\t}\n\n\t\n}\n\nfunc isalpha(c rune) bool {\n\tif c >= 'a' && c <= 'z' {\n\t\treturn true;\n\t}\n\tif c >= 'A' && c <= 'Z' {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunc isdigit(c rune) bool {\n\tif c >= '0' && c <= '9' {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunc do_str(s string) bool {\n\tidx := strings.Index(s, \"@\");\n\tif idx == -1 {\n\t\t// No \"@\"\n\t\treturn false;\n\t}\n\n\tusername := s[0:idx];\n\tif len(username) > 16 || len(username) < 1 {\n\t\treturn false;\n\t}\n\t\n\tfor _, c := range(username) {\n\t\tif isalpha(c) { continue }\n\t\tif isdigit(c) { continue }\n\t\tif c == '_' { continue }\n\t\treturn false\n\t}\n\n\tif len(s[idx:]) == 1 {\n\t\treturn false;\n\t}\n\tvar resource string;\n\tvar hostname string;\n\t\n\trest := s[idx+1:]\n\tidx = strings.Index(rest, \"/\");\n\tif idx == -1 {\n\t\tresource = \"\";\n\t\thostname = rest;\n\t} else {\n\t\tresource = rest[idx:];\n\t\tif len(resource) == 1 {\n\t\t\treturn false;\n\t\t}\n\t\tresource = resource[idx+1:]\n\t\thostname = rest[0:idx];\n\t}\n\n\tif len(hostname) < 1 || len(hostname) > 32 {\n\t\treturn false\n\t}\n\tfor _, c := range(hostname) {\n\t\tif isalpha(c) { continue }\n\t\tif isdigit(c) { continue }\n\t\tif c == '_' { continue }\n\t\tif c == '.' { continue }\n\t\treturn false\n\t}\n\twords := strings.Split(hostname, \".\");\n\tfor _, word := range(words) {\n\t\tif len(word) < 1 || len(word) > 16 {\n\t\t\treturn false;\n\t\t}\n\t}\n\tif len(resource) > 16 {\n\t\treturn false;\n\t}\n\tfor _, c := range(resource) {\n\t\tif isalpha(c) { continue }\n\t\tif isdigit(c) { continue }\n\t\tif c == '_' { continue }\n\t\treturn false\n\t}\n\t\n\treturn true\n}\n", "lang": "Go", "bug_code_uid": "d10a4990e035804164d9ad245cd0898f", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "3debddb5f21bb31f48420040a79857af", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8427260812581914, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\ta, b ,c := nextInt(), nextInt(), nextInt()\n\n\tvar lo, hi int64 = 0, 1000000000\n\tvar m, x, rem int64 \n\tvar bad bool\n\tfor hi - lo > 1 {\n\t\t\n\t\tm = lo + (hi - lo) / 2\n\t\tx = b * m\n\t\trem = a * c - x\n\t\tbad = false\n\n\t\tfor rem > 0 {\n\t\t\tx += b\n\t\t\tx -= a\n\t\t\tif x < 0 {\n\t\t\t\tbad = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\trem -= b\n\t\t}\n\n\t\tif bad {\n\t\t\tlo = m\n\t\t}else {\n\t\t\thi = m\n\t\t}\n\t}\n\n\tfmt.Println(hi)\n}\n\nfunc next() string {\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\n\treturn in.Text()\n}\n\nfunc nextInt() int {\n\tret, _ := strconv.Atoi(next())\n\treturn ret\n}", "lang": "Go", "bug_code_uid": "1705d94d410f849aec507a18686a454d", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "f6450aa50a051019324f30758e74bc1c", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9970059880239521, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// cf999a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\tm := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&m[i])\n\t}\n\tc := 0\n\tl, r := 0, n-1\n\tfor i := 0; i < n && l < r; i++ {\n\n\t\tif m[l] <= s {\n\t\t\tc++\n\t\t\tl++\n\t\t}\n\t\tif m[r] <= s && l < r {\n\t\t\tc++\n\t\t\tr--\n\t\t}\n\n\t}\n\tfmt.Println(c)\n}\n", "lang": "Go", "bug_code_uid": "5ba44dec51dcb29151956e20624e5f94", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "90a6e39db8a7d1cde4ad35bc3fe7abae", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.24697986577181208, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar k int\nfunc main() {\n fmt.Scan(&k)\n s := \"codeforce\"\n var s2 string\n for i := 0; i < k; i++ {\n s2 += \"s\"\n }\n fmt.Println(s+s2)\n}\n\n\n \n \n \n \n \n \n \n \n\n\n\n\n", "lang": "Go", "bug_code_uid": "9ce61d2d216aaef6e356cb6f2546017a", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "7d5b6d430b8cc8ad9ee6b0cccff18bd6", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.540453074433657, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t. \"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar k, n int64 = 0, 3\n\tScan(&k)\n\tfor ; n/3*(n+1)/3*(n+2)/3 < k; n++ {}\n\tm := int(n)\n\tPrintln(Repeat(\"c\", (m+2)/3) + Repeat(\"o\", (m+1)/3) + \"d\" + Repeat(\"e\", m/3) + \"forces\")\n}\n", "lang": "Go", "bug_code_uid": "28099644da27c392580ec89f048dfd1b", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "c64b72ac604fc0b7a6d563f7c3770143", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9796747967479674, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var n, m int\n fmt.Scan(&n, &m)\n\n ans := 0\n for a := 0; a <= m; a++ {\n b := n - a*a\n if a + b*b == m {\n ans++\n }\n }\n\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "31fef3fe78b5a2a60e3bcba2422fc4d3", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "1646886b62d57068598793214a71d3a3", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9968652037617555, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "// System of Equations\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Maxx (n,m int)int{\n\tif n>m{\n\t\treturn n\n\t}else{\n\t\treturn m\n\t}\n}\n\nfunc main() {\n\tvar n, m, cnt, l int\n\tfmt.Scan(&n, &m)\n\tl=Maxx(n,m)\n\tfor i := 0; i < l; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif i*i+j == n && j*j+i == m {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(cnt)\n}\n", "lang": "Go", "bug_code_uid": "2e2f6abe5a25ecf0584e2b6a4f64e581", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "fd1209af4f1befc8e705e8f4e5e3c88d", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9838249286393911, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport \"fmt\"\n\nconst INF int64 = 2147483647\nconst MAX int64 = 1e7\nconst MOD int64 = 1e7+9\nvar isgood [MAX]bool\nfunc Max(a, b int64) int64 {\n\tif (a < b) {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Init(a, b, n int64) {\n\tvar k int64\n\tfor k = 0; k < MAX; k++ { isgood[k] = true }\n\tfor k = 1; k <= Max(a,b) * n; k++ {\n\t\tp := k\n\t\tfor p > 0 {\n\t\t\tif p % 10 != a && p % 10 != b {\n\t\t\t\tisgood[k] = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp /= 10\n\t\t}\n\t}\n}\n\nfunc EE(a, b int64) int64 {\n\tvar (\n\t\tr=a%b\n\t\tx0 int64=1\n\t\ty0 int64=0\n\t\tx1 int64=0\n\t\ty1 int64=1\n\t\tmod=b\n\t)\n\tfor r > 0 {\n\t\tf:=a/b\n\t\ttx:=x0-f*x1\n\t\tty:=y0-f*y1\n\t\tx0=x1\n\t\ty0=y1\n\t\tx1=tx\n\t\ty1=ty\n\t\ta=b\n\t\tb=r\n\t\tr=a%b\n\t}\n\treturn (x1%mod+mod)%mod\n}\n\nfunc main() {\n\tvar a,b,n int64\n\tfmt.Scanf(\"%d%d%d\",&a,&b,&n)\n\tInit(a,b,n)\n\tvar (\n\t\tchoose int64=1\n\t\tx int64=0\n\t\ty int64\n\t)\n\tcnt := make(map[int64]int64)\n\tfor x <= n {\n\t\ty=n-x\n\t\ts:=a*x+b*y\n\t\tif isgood[s] { cnt[s]=(cnt[s]+choose)%MOD }\n\t\tchoose=((choose*(n-x))%MOD)*EE(x+1,MOD)%MOD\n\t\tx++\n\t}\n\tvar ans int64 = 0\n\tfor k,v := range cnt {\n\t\tif isgood[k] { ans = (ans + v) % MOD }\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "32824b6b6ba48d740613be5dcc63053d", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "beea30208937de5f7328f13511b93ce2", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.843501326259947, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "\tpackage main\n\n\timport \"fmt\"\n\n\tfunc main() {\n\t\tvar input string\n\t\tvar count,trans int \n\t\t//fmt.Println(\"enter the value of input:\")\n\t\tfmt.Scanln(&input)\n\t\tlen:=len(input)\n\t\tfor i := 0; i < len; i++ {\n\t\t\tif i==0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif count>=7 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif input[i]==input[i-1] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\t\n\t\t\tfmt.Println(\"NO\")\n\t\t\n\t}", "lang": "Go", "bug_code_uid": "c003c890e3bb358e1a8f8258ab04d07b", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "ac4e2479f3d380ebcad90652cc6cc5d4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.721608040201005, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (s *input) readIn(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\ts.a = scanner.Text()\n\t}\n}\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tvar inp input\n\tinp.readIn(sc)\n\tchr := \"\"\n\tvar v1 int\n\tfor _, b := range inp.a {\n\t\tstr := string(b)\n\t\tif str == chr {\n\t\t\tv1++\n\t\t} else {\n\t\t\tv1 = 1\n\t\t}\n\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "fe17147b81e91b5f5b17959973fd22f8", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "880fa502e4f08c8c52f24f8971909bab", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.41514041514041516, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tfor {\n\t\tsequence, _ := reader.ReadString('\\n')\n\t\tif(check(sequence)) {\n\t\t\tprintln(\"YES\")\n\t\t} else {\n\t\t\tprintln(\"NO\")\n\t\t}\n\t}\n}\n\nfunc check(sequence string) bool {\n\tcounter := 1\n\tfor i := 1; i < len(sequence); i++ {\n\t\tif(sequence[i]==sequence[i-1]) {\n\t\t\tcounter += 1\n\t\t\tif(counter==7) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t} else {\n\t\t\tcounter = 1\n\t\t}\n\t}\n\treturn false\n}\n\n", "lang": "Go", "bug_code_uid": "20b2e3e07d74009f0f52c722ff58ccd0", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "e88c74df92e5b6689321f258e33c549a", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9959404600811907, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a1, a2, a3, t1, t2, n int\n\tfmt.Scanf(\"%d %d %d \\n\", &a1, &a2, &a3)\n\tt1 = (a1 + a2 + a3) / 5\n\tif (a1+a2+a3)%5 > 0 {\n\t\tt1++\n\t}\n\tfmt.Scanf(\"%d %d %d \\n\", &a1, &a2, &a3)\n\tt2 = (a1 + a2 + a3) / 10\n\tif (a1+a2+a3)%5 > 0 {\n\t\tt2++\n\t}\n\tfmt.Scanf(\"%d \\n\", &n)\n\tif n >= (t1 + t2) {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ee1da5db330df7f81db2b6a0d0d0a32c", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "18eef92524b5655261452141262bfd1e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8768382352941176, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a1, a2, a3, b1, b2, b3, n uint16\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d %d\\n\", &a1, &a2, &a3)\n\tfmt.Fscanf(in, \"%d %d %d\\n\", &b1, &b2, &b3)\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tif a1+a2+a3 < 5 {\n\t\tif a1+a2+a3 != 0 {\n\t\t\tn--\n\t\t}\n\t} else {\n\t\tn -= (a1 + a2 + a3) / 5\n\t}\n\tif b1+b2+b3 < 10 {\n\t\tif b1+b2+b3 != 0 {\n\t\t\tn--\n\t\t}\n\t} else {\n\t\tn -= (b1 + b2 + b3) / 10\n\t}\n\tif n > 255 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "6af272a02b59a928415f45335a57c2e2", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "d5a7c3ecc914366161096e98081a344b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9918032786885246, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a1, a2, a3, b1, b2, b3, n int\n fmt.Scan(&a1, &a2, &a3, &b1, &b2, &b3, &n)\n a := a1 + a2 + a3\n b := b1 + b2 + b3\n a = int(a / 10)\n if (a1 + a2 + a3) % 10 != 0 {\n a++\n }\n b = int(b / 10)\n if (b1 + b2 + b3) % 10 != 0 {\n b++\n }\n if n >= a + b {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n", "lang": "Go", "bug_code_uid": "d42b48c8f7c417fca9d1058d3db07a6f", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "6d3add9124920a63afd9923305873537", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.99836867862969, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a1, a2, a3, b1, b2, b3, p int\n\tfmt.Scan(&a1, &a2, &a3, &b1, &b2, &b3, p)\n\ta := math.Ceil((float64)(a1+a2+a3) / 5.0)\n\tb := math.Ceil((float64)(b1+b2+b3) / 10.0)\n\tif ((float64)(p)-a-b) >= 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "17d28bd0dcb491236f571e4564384efb", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "0632f7757e373fe4fdd39415eed8a9fe", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9965635738831615, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\te:=make([]int,3)\n\tt :=0\n\tfor k:=0;k e[1] && e[0] > e[2] {\n\t\tfmt.Println(\"chest\")\n\t} else if e[1] > e[2] {\n\t\tfmt.Println(\"biceps\")\n\t} else {fmt.Println(\"back\")}\n\n}\n\n\n\n\n\n\n\n", "lang": "Go", "bug_code_uid": "8918fee2f91bf258c0be272f2f61dde9", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "4e62c0aa2e3d84670e60710e72111e6e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.991332611050921, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nvar a, b, c int64\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tread(&a, &b, &c)\n\twrite(a, b, c)\n\ta, b, c = sort(a, b, c)\n\n\tif a >= int64(2)*(b+c) {\n\t\twrite(b + c)\n\t} else {\n\t\twrite((a + b + c) / int64(3))\n\t}\n}\n\nfunc sort(a, b, c int64) (int64, int64, int64) {\n\tx := max(c, max(a, b))\n\tz := min(c, min(a, b))\n\ty := a + b + c - x - z\n\treturn x, y, z\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc write(num ...int64) {\n\tfor _, value := range num {\n\t\tstr := strconv.FormatInt(value, 10) + \" \"\n\t\tout.WriteString(str)\n\t}\n\tout.WriteString(\"\\n\")\n}\n\nfunc read(num ...*int64) {\n\tfor _, value := range num {\n\t\tin.Scan()\n\t\t*value, _ = strconv.ParseInt(in.Text(), 10, 64)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "da6b827a1ba57a1b3ea26ee4a11c8b2e", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "9e60c2134e14bd4bc694cefbf0615d24", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9859154929577465, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main () {\n\tvar r [3]float64\n\t_, _ = fmt.Scan(&r[0], &r[1], &r[2])\n\tfmt.Println(\n\t\tmath.Min(\n\t\t\tfloat64(int64(r[0]+r[1]+r[2]) / 3),\n\t\t\tmath.Min(\n\t\t\t\tr[0]+r[1],\n\t\t\t\tmath.Min(r[1]+r[2], r[2]+r[0]))))\n}\n", "lang": "Go", "bug_code_uid": "38da7c5b79ba673b6f6bdf3b98f57e1c", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "52861c4853a52e6be0236398b16440bd", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.10318142734307825, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar r, g, b int64\n\tfmt.Scan(&r, &g, &b)\n\tz := int64(0)\n\tfor r+g+b >= 3 && (r*g > 0 || g*b > 0 || r*b > 0) {\n\t\tif r == g && g == b {\n\t\t\tz += r\n\t\t\tbreak\n\t\t}\n\t\tswitch {\n\t\tcase r >= g && r >= b:\n\t\t\tr -= 2\n\t\t\tif g > b {\n\t\t\t\tg--\n\t\t\t} else {\n\t\t\t\tb--\n\t\t\t}\n\t\tcase g >= r && g >= b:\n\t\t\tg -= 2\n\t\t\tif r > b {\n\t\t\t\tr--\n\t\t\t} else {\n\t\t\t\tb--\n\t\t\t}\n\t\tcase b >= g && b >= r:\n\t\t\tb -= 2\n\t\t\tif g > r {\n\t\t\t\tg--\n\t\t\t} else {\n\t\t\t\tr--\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(\"do not reach here\")\n\t\t}\n\t\tz++\n\t}\n\tfmt.Println(z)\n}\n", "lang": "Go", "bug_code_uid": "f92503664270e33c5f982a1292c0a242", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "54ef838ead46c24ba4caeb7916916eb0", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8917062863180137, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\n// var reader *bufio.Reader = bufio.NewReader(os.Stdin)\n// var writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\n// func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n// func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc min2(a int64, b int64) int64 {\n\tvar res int64\n\tif a < b {\n\t\tres = a\n\t} else {\n\t\tres = b\n\t}\n\treturn res\n}\nfunc min3(a int64, b int64, c int64) int64 {\n\tvar res int64\n\tres = min2(a, min2(b, c))\n\treturn res\n}\n\nfunc max2(a int64, b int64) int64 {\n\tvar res int64\n\tif a > b {\n\t\tres = a\n\t} else {\n\t\tres = b\n\t}\n\treturn res\n}\nfunc max3(a int64, b int64, c int64) int64 {\n\tvar res int64\n\tres = max2(a, max2(b, c))\n\treturn res\n}\n\nfunc main() {\n\tvar (\n\t\tr int64\n\t\tg int64\n\t\tb int64\n\t)\n\n\tfmt.Scanf(\"%d %d %d\", &r, &g, &b)\n\tif 2*max3(r, g, b) > (r + g + b - max3(r, g, b)) {\n\t\tfmt.Printf(\"%d\\n\", (r+g+b)/3)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", r+g+b-max3(r, g, b))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "5dca4cc707d3ea62c1274349018ffb54", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "44ed04d2b7e38df52dcedc8b178ceb5d", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9861111111111112, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int64\n\ta,b,c:=0,0,0\n\tfmt.Scan(&n)\n\tfor i:=0;i0 {\n\t\tfmt.Print(\"1\")\n\t} else {\n\t\tfmt.Print(\"-1\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "105863c3ac52a1c992d404793b5fee5a", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "a520a7b8d93c51d88c2afc0d6c0d3cfa", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9895470383275261, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int\n\ta,b,c:=0,0,0\n\tfmt.Scan(&n)\n\tfor i:=0;i0 {\n\t\tfmt.Print(\"1\")\n\t} else {\n\t\tfmt.Print(\"-1\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "16c74a8178fcdde92278593db3edf117", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "a520a7b8d93c51d88c2afc0d6c0d3cfa", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8790212958767558, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "package main \n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc ReadInt32(scanner *bufio.Scanner) int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString(scanner *bufio.Scanner) string {\n scanner.Scan()\n ans := scanner.Text()\n return ans\n}\n\nfunc PrintInt(writer *bufio.Writer, value int) {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n}\n\nfunc PrintInts(writer *bufio.Writer, ints ...int) {\n for _, value := range ints {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n }\n writer.WriteByte('\\n')\n}\n\nfunc main() {\n var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n var writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n n, k := ReadInt32(scanner), ReadInt32(scanner)\n hn := n / 2\n total := n * (n - 1) / 2\n\n if k >= hn {\n k = hn\n PrintInt(writer, total)\n return \n }\n PrintInts(writer, n, k, hn)\n\n total -= (n - k) * (n - k - 1) / 2\n total += k * (n - 2 * k)\n total += k * (k - 1) / 2\n\n PrintInt(writer, total)\n writer.WriteByte('\\n')\n}\n", "lang": "Go", "bug_code_uid": "e55e089965a5604078369ff1d04097f6", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "1983c705c0351a78ba2346d8ff414351", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8898163606010017, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport . \"fmt\"\n\ntype vec struct {\n\tx, y int64\n}\n\nfunc (a vec) sub(b vec) vec { return vec{a.x - b.x, a.y - b.y} }\nfunc (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }\nfunc isOrthogonal(a, b, c vec) bool { return a.sub(b).dot(c.sub(b)) == 0 }\nfunc isRectangle(a, b, c, d vec) bool { return isOrthogonal(a, b, c) && isOrthogonal(b, c, d) && isOrthogonal(c, d, a) }\nfunc isRectangleAnyOrder(a, b, c, d vec) bool { return isRectangle(a, b, c, d) || isRectangle(a, b, d, c) || isRectangle(a, c, b, d) }\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tmp := map[vec]int{}\n\tfor i := 0; i < 4; i++ {\n\t\tvar x, y int64\n\t\tScan(&x, &y)\n\t\tp0 := vec{x, y}\n\t\tScan(&x, &y)\n\t\tp1 := vec{x, y}\n\t\tv := p1.sub(p0)\n\t\tif v.x != 0 && v.y != 0 {\n\t\t\tPrint(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tmp[p0]++\n\t\tmp[p1]++\n\t}\n\tarr := []vec{}\n\tfor vec, v := range mp {\n\t\tif v != 2 {\n\t\t\tPrint(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tarr = append(arr, vec)\n\t}\n\tif isRectangleAnyOrder(arr[0], arr[1], arr[2], arr[3]) {\n\t\tPrint(\"YES\")\n\t} else {\n\t\tPrint(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f6745c6c26657e1e2e0d825b76c93330", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "ec21e16412a3745ac83a851f3ddea107", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5309849967384214, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n/*Simulating the problem of mashmokh and the lights\nlights array will contain the current state of the light -1 / -2\n0 -> ON\nif any other number is present, then the light is switched off with that swtich*/\nfunc main() {\n var n,m,b int\n fmt.Scanf(\"%d %d\", &n, &m)\n var light []int = make([]int, n)\n for i := 0; i < n; i++ {\n light[i] = -1\n }\n\n for l := 0; l < m; l++ {\n retN, _ := fmt.Scanf(\"%d\", &b)\n if retN == 0 {\n continue\n }\n\n b = b - 1\n for i := b; (i < n ) && (light[i] == -1); i++ {\n light[i] = b + 1\n }\n }\n\n for i := 0; i < n; i++ {\n fmt.Printf(\"%d \", light[i])\n if i == n {\n fmt.Println()\n } else {\n fmt.Printf(\" \")\n }\n }\n\n return\n}\n\n", "lang": "Go", "bug_code_uid": "e258b6cffef23c834fecd123034e217e", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "d31578cc9dec92d2cf4e4888a44395a0", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9319526627218935, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\n\tr1 := (a + b) * c\n\tr2 := a + b*c\n\tr3 := a*b + c\n\tr4 := a * (b + c)\n\tr5 := a * b * c\n\n\tmax := r1\n\tif r2 > max {\n\t\tmax = r2\n\t}\n\tif r3 > max {\n\t\tmax = r3\n\t}\n\tif r4 > max {\n\t\tmax = r4\n\t}\n\tif r5 > max {\n\t\tmax = r5\n\t}\n\n\tfmt.Print(max)\n\n}\n", "lang": "Go", "bug_code_uid": "34ba815211b396695e60f259a68266da", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "850fe23aa6bd3e231f1af28a6f9d328c", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9585547290116897, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\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 main() {\n\tvar a, b, c int\n\tif _, err := fmt.Scanf(\"%d %d %d\", &a, &b, &c); err != nil {\n\t\tos.Exit(1) // very unlikely...\n\t}\n\n\tvar best = 0\n\tbest = max(best, (a+b)+c)\n\tbest = max(best, (a+b)*c)\n\tbest = max(best, (a*b)+c)\n\tbest = max(best, (a*b)*c)\n\n\tbest = max(best, a+(b*c))\n\tbest = max(best, a*(b+c))\n\tfmt.Println(best)\n\tos.Exit(0)\n}\n", "lang": "Go", "bug_code_uid": "3a3f221aa29ebaa303430a99c9f84dcf", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "71e1370aecf4764e9b08848c410474f0", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7422867513611615, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif a == 1 && b == 1 && c == 1 {\n\t\tfmt.Println(a + b + c)\n\t} else if a == 1 && b == 1 {\n\t\tfmt.Println((a + b) * c)\n\t} else if b == 1 && c == 1 {\n\t\tfmt.Println((c + b) * a)\n\t} else if a == 1 && c == 1 {\n\t\tfmt.Println(a + b + c)\n\t} else if a == 1 {\n\t\tfmt.Println((a + b) * c)\n\t} else if b == 1 {\n\t\tif a > c {\n\t\t\tfmt.Println((a + b) * c)\n\t\t} else {\n\t\t\tfmt.Println(a * (b + c))\n\t\t}\n\t} else if c == 1 {\n\t\tfmt.Println((c + b) * a)\n\t} else {\n\t\tfmt.Println(a * b * c)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "189305c105185a60e510ab9887467297", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "f36620e311f00a0fad1c1533a630df9c", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9497536945812808, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tpanel := make([][]int,3)\n\tt := true\n\tfor i := range panel{\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\\n\",&s)\n\t\t//fmt.Printf(\"%s\", s)\n\t\tpanel[i] = make([]int, 3)\n\t\tfor j := range panel[i]{\n\t\t\tif s[j] == 'X'{\n\t\t\t\tpanel[i][j] = 1\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tfor i := range panel{\n\t\tfor j := range panel[i] {\n\t\t\tif i*3 + j > 4 {\n\t\t\t\tif panel[i][j]==1{\n\t\t\t\t\tif panel[i][j] != panel[2 - i][2 - j]{\n\t\t\t\t\t\tt = false\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif t{\n\t\tfmt.Printf(\"YES\")\n\t}else{\n\t\tfmt.Printf(\"NO\")\n\t}\n\n\n\t\n\n}", "lang": "Go", "bug_code_uid": "72f1e5a2344842aabaf5bed7c669c2dd", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "f1afee29579bb2c3327b77528cf4d9f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.5267326732673268, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "// 12A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c [4]string\n\tm := 0\n\tfmt.Scan(&a, &b, &c)\n\tif a[0] == c[2] || a[1] == c[1] || a[2] == c[0] || b[0] == b[2] {\n\t\tm = 1\n\t}\n\tif m == 1 {\n\t\tfmt.Print(\"YES\")\n\t}\n\tif m == 0 {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "9298b1c74d3a4a28abb7ed04d8fa7f44", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "3385fc6c2c9d5d0b15fb15786db02fa6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9731293923108723, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "// A. Nauuo and Votes\n/*\nNauuo is a girl who loves writing comments.\n\nOne day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes.\n\nIt's known that there were 𝑥 persons who would upvote, 𝑦 persons who would downvote, and there were also another 𝑧 persons who would vote, but you don't know whether they would upvote or downvote. Note that each of the 𝑥+𝑦+𝑧 people would vote exactly one time.\n\nThere are three different results: if there are more people upvote than downvote, the result will be \"+\"; if there are more people downvote than upvote, the result will be \"-\"; otherwise the result will be \"0\".\n\nBecause of the 𝑧 unknown persons, the result may be uncertain (i.e. there are more than one possible results). More formally, the result is uncertain if and only if there exist two different situations of how the 𝑧 persons vote, that the results are different in the two situations.\n\nTell Nauuo the result or report that the result is uncertain.\n\nInput\nThe only line contains three integers 𝑥, 𝑦, 𝑧 (0≤𝑥,𝑦,𝑧≤100), corresponding to the number of persons who would upvote, downvote or unknown.\n\nOutput\nIf there is only one possible result, print the result : \"+\", \"-\" or \"0\".\n\nOtherwise, print \"?\" to report that the result is uncertain.\n\nExamples\nInput\n3 7 0\n\nOutput\n-\n\nInput\n2 0 1\n\nOutput\n+\n\nInput\n1 1 0\n\nOutput\n0\n\nInput\n0 0 1\n\nOutput\n?\n\nNote\nIn the first example, Nauuo would definitely get three upvotes and seven downvotes, so the only possible result is \"-\".\n\nIn the second example, no matter the person unknown downvotes or upvotes, Nauuo would get more upvotes than downvotes. So the only possible result is \"+\".\n\nIn the third example, Nauuo would definitely get one upvote and one downvote, so the only possible result is \"0\".\n\nIn the fourth example, if the only one person upvoted, the result would be \"+\", otherwise, the result would be \"-\". There are two possible results, so the result is uncertain.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\tx, _ := strconv.Atoi(arr[0])\n\ty, _ := strconv.Atoi(arr[1])\n\tz, _ := strconv.Atoi(arr[2])\n\n\tif z != 0 && x+z == y+z {\n\t\tfmt.Print(\"?\")\n\t} else if x+z > y+z {\n\t\tfmt.Print(\"+\")\n\t} else if x+z < y+z {\n\t\tfmt.Print(\"-\")\n\t} else if x+z == y+z {\n\t\tfmt.Print(\"0\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "408a8dffdfc1f8c2cfb3a5974892eb6c", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "8add332e0cee5c17f002c18224314fc2", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8828125, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "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\tif x - y > z {\n\t\tfmt.Println(\"+\")\n\t} else if x - y < z {\n\t\tfmt.Println(\"-\")\n\t} else if z == 0 {\n\t\tfmt.Println(\"0\")\n\t} else {\n\t\tfmt.Println(\"?\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d0bc742afac0bf9e2682e5828d40b82b", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "9f3ce1cca5311333798906217c4a413c", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9831081081081081, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, z int\n\tfmt.Scan(&x, &y, &z)\n\tr := x - y\n\tif r == 0 {\n\t\tif z == 0 {\n\t\t\tfmt.Print(\"0\")\n\t\t} else {\n\t\t\tfmt.Print(\"?\")\n\t\t}\n\t} else if r > z {\n\t\tif r > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t} else {\n\t\t\tfmt.Print(\"-\")\n\t\t}\n\t} else {\n\t\tfmt.Print(\"?\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a961a4eee7625ab0b2d90ebf6d77dedb", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "9c6b3e7271064d276c64efe349942e24", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9720176730486009, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\t//reader := bufio.NewReader(os.Stdin)\n\tvar n, m, a, b int\n\t//fmt.Println(\"meta algo\")\n\tfmt.Scanf(\"%d %d %d %d\", &n, &m, &a, &b)\n\n\tnum1, num2 := (n%m)*b, (m-n%m)*a\n\tfmt.Println(num1, num2)\n\tfmt.Println(min(num1, num2))\n\n}\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang": "Go", "bug_code_uid": "219aff24362d12ddf52f14b5289faf42", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "ca0aace3cb97fa07b8a61d812d5041f9", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.711287577992059, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc min0(a, b int) int {\n\tif a < 0 {\n\t\treturn b\n\t}\n\n\tif b < 0 {\n\t\treturn a\n\t}\n\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tdata := strings.Split(scanner.Text(), \" \")\n\n\t//fmt.Println(data, len(data))\n\n\tcabs, _ := strconv.Atoi(data[0])\n\tdils, _ := strconv.Atoi(data[1])\n\tpBuild, _ := strconv.Atoi(data[2])\n\tpDestroy, _ := strconv.Atoi(data[3])\n\n\thigh := dils\n\tlow := dils\n\tfor high = dils; cabs > high; high = high + dils {\n\t\tlow = high\n\t}\n\n\tif high == cabs {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\n\tpLow := pDestroy * (cabs - low)\n\tpHigh := pBuild * (high - cabs)\n\tpDestroyAll := pDestroy * cabs\n\n\t//fmt.Println(high, low, cabs, pLow, pHigh, pDestroyAll)\n\n\tfmt.Println(min0(min0(pLow, pHigh), pDestroyAll))\n}\n", "lang": "Go", "bug_code_uid": "8c032d74f8ed3f1c8b2043c5b8f8bd7c", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "ec8f013f6e12ba4a988c4a6ae51bf09e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8502523836231072, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc min0(a, b int64) int64 {\n\tif a < 0 {\n\t\treturn b\n\t}\n\n\tif b < 0 {\n\t\treturn a\n\t}\n\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tdata := strings.Split(scanner.Text(), \" \")\n\n\tcabs, _ := strconv.ParseInt(data[0], 10, 64)\n\tdils, _ := strconv.ParseInt(data[1], 10, 64)\n\n\tpBuild, _ := strconv.ParseInt(data[2], 10, 64)\n\tpDestroy, _ := strconv.ParseInt(data[3], 10, 64)\n\n\thigh := dils\n\tlow := dils\n\tfor high = dils; cabs > high; high = high + dils {\n\t\tlow = high\n\t}\n\n\tif high == cabs {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\n\tpLow := pDestroy * (cabs - low)\n\tpHigh := pBuild * (high - cabs)\n\tpDestroyAll := pDestroy * cabs\n\n\t//fmt.Println(high, low, cabs, pLow, pHigh, pDestroyAll)\n\n\tfmt.Println(min0(min0(pLow, pHigh), pDestroyAll))\n}\n", "lang": "Go", "bug_code_uid": "dc824a9ff4e40578e78f4f4e84c0e5bf", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "ec8f013f6e12ba4a988c4a6ae51bf09e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9863791146424518, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"os\"\n\t\"strings\"\n\t\"sort\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\ntype Team struct {\n\tname string\n\tpts, x, y, played int\n}\n\ntype Sorter []Team\n\nfunc (s Sorter) Len() int { return len(s) }\nfunc (s Sorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s Sorter) Less(i, j int) bool { \n\tif s[i].pts > s[j].pts {\n\t\treturn true\n\t}\n\tif s[i].pts < s[j].pts {\n\t\treturn false\n\t}\n\tif s[i].x - s[i].y > s[j].x - s[j].y {\n\t\treturn true\n\t}\n\tif s[i].x - s[i].y < s[j].x - s[j].y {\n\t\treturn false\n\t}\n\tif s[i].x > s[j].x {\n\t\treturn true\n\t}\n\tif s[i].x < s[j].x {\n\t\treturn false\n\t}\n\treturn s[i].name < s[j].name\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\ts2m := make(map[string]*Team)\n\tfor i := 0; i < 5; i++ {\n\t\tname1, name2, score := Next(), Next(), Next()\n\t\tif _, exists := s2m[name1]; !exists {\n\t\t\ts2m[name1] = &Team{name: name1}\n\t\t}\n\n\t\tif _, exists:= s2m[name2]; !exists {\n\t\t\ts2m[name2] = &Team{name: name2}\n\t\t}\n\n\t\tt1, _ := s2m[name1]\n\t\tt2, _ := s2m[name2]\n\t\t\n\t\ts := strings.Split(score, \":\")\n\t\ts1, _ := strconv.Atoi(s[0])\n\t\ts2, _ := strconv.Atoi(s[1])\n\n\t\tt1.played += 1\n\t\tt2.played += 1\n\t\tt1.x += s1\n\t\tt1.y += s2\n\t\tt2.x += s2\n\t\tt2.y += s1\n\n\t\tif s1 > s2 {\n\t\t\tt1.pts += 3\n\t\t}else if s1 < s2 {\n\t\t\tt2.pts += 3\n\t\t}else {\n\t\t\tt1.pts += 1\n\t\t\tt2.pts += 1\n\t\t}\n\t}\n\n\tvar berland, other Team\n\tvar teams [4]*Team\n\tvar at int = 0\n\tfor _, value := range s2m {\n\t\tteams[at] = value\n\t\tat += 1\n\n\t\tif value.played == 2 {\n\t\t\tif value.name == \"BERLAND\" {\n\t\t\t\tberland = *value\n\t\t\t}else {\n\t\t\t\tother = *value\n\t\t\t}\n\t\t}\n\t}\n\n\tberland.pts += 3\n\tberland.played += 1\n\n\tother.played += 1\n\n\t// fmt.Fprintln(out, berland)\n\n\tvar score1, score2 int = -1, -1\n\tfor x := 0; x < 1000; x++ {\n\t\tfor y := 0; y < x; y++ {\n\t\t\tb := make([]Team, 0)\n\t\t\tfor i := 0; i < 4; i++ {\n\t\t\t\tif teams[i].name == berland.name || teams[i].name == other.name {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tb = append(b, *teams[i])\n\t\t\t}\n\n\t\t\t// fmt.Fprintln(out, b)\n\n\t\t\tbrld, othr := berland, other\n\t\t\tbrld.x += x\n\t\t\tbrld.y += y\n\t\t\tothr.x += y\n\t\t\tothr.y += x\n\t\t\tb = append(b, brld)\n\t\t\tb = append(b, othr)\n\t\t\tsort.Sort(Sorter(b))\n\n\t\t\t// fmt.Fprintln(out, b)\n\n\t\t\tif b[0].name == berland.name || b[1].name == berland.name {\n\t\t\t\tif score1 == -1 || score1 - score2 > x - y || (score1 - score2 == x - y && score2 > y){\n\t\t\t\t\tscore1, score2 = x, y\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif score1 == -1 {\n\t\tfmt.Fprintln(out, \"IMPOSSIBLE\")\n\t}else {\n\t\tfmt.Fprintln(out, score1, score2)\n\t}\t\n}\n\nfunc Next() string {\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\n\treturn in.Text()\n}\n\nfunc NextInt() int {\n\tret, _ := strconv.Atoi(Next())\n\treturn ret\n}", "lang": "Go", "bug_code_uid": "f2af6645a14b8f99dd90f7541cc7e8f3", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "75a16fe8cccdceaa08dd4370c018d3d9", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7405857740585774, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &n)\n\ti := 0\n\tfor i = 1; (i * (i + 1)) < n; i++ {\n\t}\n\tfmt.Println(i - 1)\n}\n", "lang": "Go", "bug_code_uid": "d3e0748f9fad5d2ed33b5513b8056262", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "e602a68c8fb4166abdb64b63f39dece2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8788501026694046, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main \nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar cubes, height, sum, i int = 0, 0, 0, 1\n\tfmt.Scan(&cubes)\n\tfor sum <= cubes {\n\t\tsum = sum + i\n\t\tcubes = cubes - sum\n\t\ti = i + 1\n\t\theight = height + 1\n\t}\n\tfmt.Println(height)\n}\t", "lang": "Go", "bug_code_uid": "1c0702a8788b2ac3acc3383ec3f2717c", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "8820a6d926f426f7e3237637a8682b63", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9294012511170688, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\"fmt\")\n\n// func calculate(s string, carry int, t int) int {\n\t\n// \tcarry = 1\n// \tcount := 0\n// \tfor i:=0;i=t{\n\t\t\tans = i-1\n\t\t\tbreak\n\t\t}\n\t}\n\tif t==1{\n\t\tfmt.Println(1)\n\t}else{\n\t\tfmt.Println(ans)\n\t}\n}", "lang": "Go", "bug_code_uid": "6c0000bdb93f057afb6e057bdb274973", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "e7e350f739f3f4be577e21521ba1710c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8725212464589235, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\n\nfunc main() {\n\tfmt.Fscan(reader, &n)\n\tfor i := 1; i < n; i++ {\n\t\tif i*(i+1) > n {\n\t\t\tfmt.Println(i - 1)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "7ff65b9a9bd12b8e9914432f10f8d4d1", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "5bf9ca47093fdfb908643d641be15c85", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8947730398899587, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Point struct {\n\tX, Y float64\n}\n\ntype Square struct {\n\tPoints [4]Point\n}\n\nfunc rotateAxis(p Point, angle float64) (res Point) {\n\tres = Point{}\n\tangle = (angle * math.Pi) / 180\n\tres.X = p.X*math.Cos(angle) + p.Y*math.Sin(angle)\n\tres.Y = -1*p.X*math.Sin(angle) + p.Y*math.Cos(angle)\n\treturn\n}\n\nfunc isInSquare(sq Square, p Point) (b bool) {\n\tvar minHoz float64 = 101\n\tfor _, v := range sq.Points {\n\t\tminHoz = math.Min(minHoz, v.Y)\n\t}\n\n\tvar maxHoz float64 = -101\n\tfor _, v := range sq.Points {\n\t\tmaxHoz = math.Max(maxHoz, v.Y)\n\t}\n\n\tvar minVer float64 = 101\n\tfor _, v := range sq.Points {\n\t\tminVer = math.Min(minVer, v.X)\n\t}\n\n\tvar maxVer float64 = -101\n\tfor _, v := range sq.Points {\n\t\tmaxVer = math.Max(maxVer, v.X)\n\t}\n\n\treturn (p.X >= minVer && p.X <= maxVer) && (p.Y >= minHoz && p.Y <= maxHoz)\n}\n\nfunc solve(sq, sq45 Square) bool {\n\tfor _, v := range sq45.Points {\n\t\tif isInSquare(sq, v) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\trotatedSquare := Square{}\n\tfor i := range rotatedSquare.Points {\n\t\trotatedSquare.Points[i] = rotateAxis(sq45.Points[i], 45)\n\t}\n\n\tfor _, v := range sq.Points {\n\t\trotatedPoint := rotateAxis(v, 45)\n\t\tif isInSquare(rotatedSquare, rotatedPoint) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc consoleInput() {\n\tvar x, y float64\n\tsq := Square{}\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tsq.Points[i] = Point{\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t}\n\t}\n\n\tsq45 := Square{}\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tsq45.Points[i] = Point{\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t}\n\t}\n\n\tif solve(sq, sq45) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc mustEqual(expected, actual bool) {\n\tif expected == actual {\n\t\tfmt.Println(\"OK\")\n\t} else {\n\t\tfmt.Println(\"FAILED\")\n\t}\n}\n\nfunc test() {\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{0, 0},\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{1, 3},\n\t\t\t\tPoint{3, 5},\n\t\t\t\tPoint{5, 3},\n\t\t\t\tPoint{3, 1},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{0, 0},\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{7, 3},\n\t\t\t\tPoint{9, 5},\n\t\t\t\tPoint{11, 3},\n\t\t\t\tPoint{9, 1},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(false, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t\tPoint{0, 0},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{7, 4},\n\t\t\t\tPoint{4, 7},\n\t\t\t\tPoint{7, 10},\n\t\t\t\tPoint{10, 7},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n}\n\nfunc main() {\n\tconsoleInput()\n\t// test()\n}\n", "lang": "Go", "bug_code_uid": "b878f9448c569f0835c5e956381645dc", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "fd46303ca15f0d425702d6f0ca2fb897", "difficulty": 1600, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.19499341238471674, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n var n,k int\n fmt.Scan(&n,&k)\n a := make([]int,n+1)\n ok := true\n for i := 1; i <= n; i++ {\n scanner.Scan()\n a[i], _ = strconv.Atoi(scanner.Text())\n if (i > k) && (a[i] != a[k]) {\n ok = false\n }\n }\n if ok {\n ans := k\n for a[ans-1] == a[k] { ans-- }\n fmt.Println(ans-1)\n } else {\n fmt.Println(-1)\n }\n}\n", "lang": "Go", "bug_code_uid": "50b3b6835d6b676c1b6cb96c821c0766", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "3ee70ace54be3b99b9212d6868cf386b", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982578397212544, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"io\"\n \"strings\"\n \"bytes\"\n \"os\"\n)\n\ntype contestIn struct {\n\treader io.Reader\n}\n\ntype contestOut struct {\n\twriter io.Writer\n}\n\ntype Contest struct {\n\tIn contestIn\n\tOut contestOut\n}\n\nfunc NewSubmitContest() Contest {\n\treturn Contest{contestIn{os.Stdin}, contestOut{os.Stdout}}\n}\n\nfunc NewTestContest(testIn string, testOut *bytes.Buffer) Contest {\n\treturn Contest{contestIn{strings.NewReader(testIn)}, contestOut{testOut}}\n}\n\nfunc (in contestIn) Var(a interface{}) {\n\tfmt.Fscan(in.reader, a)\n}\n\nfunc (in contestIn) Vars(a interface{}) {\n\tfmt.Fscanln(in.reader, a)\n}\n\nfunc (in contestIn) Str() string {\n\tvar s string\n\tin.Var(&s)\n\n\treturn s\n}\n\nfunc (in contestIn) Int() int {\n\tvar i int\n\tin.Var(&i)\n\n\treturn i\n}\n\nfunc (in contestIn) Ints(len int) []int {\n\tarr := make([]int, 0, len)\n\tfor ; len > 0; len-- {\n\t\tvar i int\n\t\tin.Var(&i)\n\t\tarr = append(arr, i)\n\t}\n\n\treturn arr\n}\n\nfunc (out contestOut) F(format string, a ...interface{}) contestOut {\n\tfmt.Fprintf(out.writer, format, a...)\n\treturn out\n}\n\nfunc (out contestOut) Str(s string) contestOut {\n\tfmt.Fprint(out.writer, s)\n\treturn out\n}\n\nfunc (out contestOut) Int(i int) contestOut {\n\tout.F(\"%d\", i)\n\treturn out\n}\n\nfunc (out contestOut) N() contestOut {\n\tfmt.Fprintln(out.writer)\n\treturn out\n}\n\n// https://codeforces.com/contest/981/problem/A\nfunc problem(c Contest) {\n\ts := c.In.Str()\n\tl := len(s)\n\te := true // same chars\n\n\tfor i := 0; i < len(s) / 2; i++ {\n\t\tif i > 0 {\n\t\t\te = e && (s[i] == s[i-1])\n\t\t}\n\n\t\tif s[i] != s[l - i - 1] {\n\t\t\t// Not palindrome\n\t\t\tc.Out.Int(l).N()\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Palindrome\n\tif e {\n\t\tc.Out.Int(0).N()\n\t} else {\n\t\tc.Out.Int(l - 1).N()\n\t}\n}\n\nfunc main() {\n\tc := NewSubmitContest()\n\tproblem(c)\n}\n", "lang": "Go", "bug_code_uid": "4fd053b17b56156e65a65244ec014d72", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "8b307e5b30aaad02446f45b5acfd9ea1", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9991489361702127, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tstr, _, _ := r.ReadLine()\n\tfmt.Print(getLongestLen(string(str)))\n}\n\nfunc getLongestLen(str string) int {\n\tif !isPalindrome(str) {\n\t\treturn len(str)\n\t}\n\tif isOneLetter(str) {\n\t\treturn 0\n\t}\n\treturn len(str)-1\n}\n\nfunc isPalindrome(str string) bool {\n\tfor i := 0; i < (len(str)-1) / 2; i++ {\n\t\tif str[i] != str[len(str)-1-i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc isOneLetter(str string) bool {\n\tfor i := 1; i < len(str); i++ {\n\t\tif str[0] != str[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "lang": "Go", "bug_code_uid": "72387aa399f63d5501623aed1e86dac1", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "a795d38bf5aef639ca73426e7f03daa8", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8725868725868726, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc isPalindrome(str string) bool {\n\tsize := len(str)\n\tvar rev_str string\n\tfor i := size-1; i >= 0; i--{\n\t\trev_str += string(str[i])\n\t}\n\tif str == rev_str{\n\t\treturn true\n\t}else{\n\t\treturn false\n\t}\n}\n\nfunc removeLast(str string)string {\n\tstr = str[:len(str)-1]\n\treturn str\n}\n\nfunc main(){\n\tvar str string\n\tfmt.Scanln(&str)\n\tif ! isPalindrome(str){\n\t\tfmt.Print(len(str))\n\t}else{\n\t\tfor (isPalindrome(str)){\n\t\t\tstr = removeLast(str)\n\t\t}\n\t\tfmt.Print(len(str))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "cede9a7825d660f067efd744ca7d15e9", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "121817a18168a43bc03cd5472014f5ea", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.943343760862009, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tk := readString()\n\tvalues := make([]int, 0)\n\tfor len(k) > 0 {\n\t\tvar maxValue int\n\t\tvar maxIndex int\n\t\tfor i := len(k) - 1; i >= 0; i-- {\n\t\t\tvalue, err := strconv.ParseInt(k[i:], 10, 32)\n\t\t\tif err == nil {\n\t\t\t\tif value <= n {\n\t\t\t\t\tmaxValue = int(value)\n\t\t\t\t\tmaxIndex = i\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\tif maxIndex+1 < len(k) {\n\t\t\tfor maxIndex < len(k) && k[maxIndex] == '0' {\n\t\t\t\tmaxIndex++\n\t\t\t}\n\t\t}\n\t\tk = k[:maxIndex]\n\t\tvalues = append(values, maxValue)\n\t}\n\tvar res int64\n\tfor i := len(values) - 1; i >= 0; i-- {\n\t\tres *= n\n\t\tres += int64(values[i])\n\t}\n\tfmt.Println(res)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "db6bb6fd2b4cad90c47d68262f36ad6f", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "034ea513d20bda0f1b448d4b88ec9fdb", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9949748743718593, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tk := readString()\n\tvalues := make([]int, 0)\n\tfor len(k) > 0 {\n\t\tvar maxValue int\n\t\tvar maxIndex int\n\t\tfor i := len(k) - 1; i >= 0; i-- {\n\t\t\tvalue, err := strconv.ParseInt(k[i:], 10, 64)\n\t\t\tif err == nil {\n\t\t\t\tif value < n {\n\t\t\t\t\tmaxValue = int(value)\n\t\t\t\t\tmaxIndex = i\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\tif maxIndex+1 < len(k) {\n\t\t\tif maxValue != 0 {\n\t\t\t\tfor maxIndex < len(k) && k[maxIndex] == '0' {\n\t\t\t\t\tmaxIndex++\n\t\t\t\t}\n\t\t\t} else if maxValue == 0 {\n\t\t\t\tmaxIndex = len(k) - 1\n\t\t\t}\n\t\t}\n\t\tk = k[:maxIndex]\n\t\tvalues = append(values, maxValue)\n\t}\n\tvar res int64\n\tfor i := len(values) - 1; i >= 0; i-- {\n\t\tres *= n\n\t\tres += int64(values[i])\n\t}\n\tfmt.Println(res)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "ca4b314636c5c4c2d1e3141a2c8af295", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "034ea513d20bda0f1b448d4b88ec9fdb", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9965034965034965, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := readInt64()\n\tb := readInt64()\n\n\tres := int64(1)\n\tcnt := 0\n\tfor i := a + 1; i <= b; i++ {\n\t\tm := int64(1)\n\t\tif i != 0 {\n\t\t\tm = i\n\t\t}\n\t\tm %= 10\n\t\tres %= 10\n\t\tres *= m\n\t\tif cnt > 10 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(res % 10)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "afa5e5be797ed67a26d47ad69dd9bb49", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "b44cb49c52d269b2746aa629ea2c5b03", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.972241029113067, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t_ \"math\"\n\t\"os\"\n\t_ \"sort\"\n)\n \nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n \nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n \ntype intPair struct {\n\ta int64\n\tb int64\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= n2 / k1 {\n\t\tfmt.Println(\"First\")\n\t}else{\n\t\tfmt.Println(\"Second\")\n\t}\n}", "lang": "Go", "bug_code_uid": "7ff95c9aa1c2e96494a4837543922dfc", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "547fbb07a14edaf1bbc149074e2cb537", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9891304347826086, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"strconv\"\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n// var file, _ = os.Open(\"input.txt\")\n// var outfile, _ = os.Create(\"output.txt\")\n// var in = bufio.NewScanner(file)\n// var out = bufio.NewWriter(outfile)\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n if !in.Scan() {\n panic(\"Scan error\")\n }\n return in.Text()\n}\n\nfunc nextInt() int {\n ret, _ := strconv.Atoi(next())\n return ret\n}\n\nfunc nextFloat() float64 {\n ret, _ := strconv.ParseFloat(next(), 64)\n return ret\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n n1 := nextInt()\n n2 := nextInt()\n k1 := nextInt()\n k2 := nextInt()\n if n1 > n2 {\n fmt.Fprintln(out, \"First\");\n } else {\n fmt.Fprintln(out, \"Second\");\n }\n}\n", "lang": "Go", "bug_code_uid": "0b8aa7e2d847de855719561f52c83d0e", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "e621a3e321cd3589dfeb1d04a9a7735d", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9985652797704447, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, a, b, p1, p2 int\n\n\tarr := [22]int{}\n\tscanf(\"%d %d %d\\n\", &n, &a, &b)\n\tfor i := 0; i < n; i = i + 1 {\n\t\tscanf(\"%d \", &arr[i])\n\t}\n\tp2 = n - 1\n\tans := 0\n\tfor p1 <= p2 {\n\n\t\tif p1 == p2 {\n\t\t\tif arr[p1] == 2 {\n\t\t\t\tans += min(a, b)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif arr[p1] == arr[p2] && arr[p1] == 2 {\n\t\t\tans = ans + min(a, b)\n\t\t}\n\t\tif arr[p1]^arr[p2] == 1 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tif arr[p1] == 2 && arr[p2] == 1 {\n\t\t\tans = ans + b\n\t\t}\n\t\tif arr[p2] == 2 && arr[p1] == 1 {\n\t\t\tans = ans + b\n\t\t}\n\t\tif arr[p1] == 2 && arr[p2] == 0 {\n\t\t\tans = ans + a\n\t\t}\n\t\tif arr[p2] == 2 && arr[p1] == 0 {\n\t\t\tans = ans + a\n\t\t}\n\t\tp1++\n\t\tp2--\n\t}\n\tprintf(\"%d\", ans)\n\n}\n", "lang": "Go", "bug_code_uid": "2ba2504b2a38628425bf435a370bce9d", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "625117b9931c0dda23021d495e37c932", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9943820224719101, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar Arr [105] int\n\tvar N,w,b int\n\tfmt.Scanf(\"%d %d %d \\n\",&N,&w,&b)\n\tfor i:=1; i i {\n\t\t\t\tans += \"***\"\n\t\t\t\ti = last\n\t\t\t} else {\n\t\t\t\tans += string(word[i])\n\t\t\t}\n\t\t} else {\n\t\t\tans += string(word[i])\n\t\t}\n\t}\n\treturn string(ans)\n}\n\nfunc findLast(word string, pos int) int {\n\tfor i := pos; i < len(word); i++ {\n\t\texpected := byte('o')\n\t\tif (i-pos)&1 == 1 {\n\t\t\texpected = 'g'\n\t\t}\n\t\tif word[i] != expected {\n\t\t\tif word[i-1] == 'o' {\n\t\t\t\treturn i - 1\n\t\t\t} else {\n\t\t\t\treturn i - 2\n\t\t\t}\n\t\t}\n\t}\n\treturn len(word) - 1\n}\n", "lang": "Go", "bug_code_uid": "ec3ae860b9d256d893161358836ce6aa", "src_uid": "619665bed79ecf77b083251fe6fe7eb3", "apr_id": "9103193b7d545c4abcd44a41545d18dd", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.97165991902834, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF894B(in io.Reader, out io.Writer) {\n\tconst mod int64 = 1e9 + 7\n\tpow := func(x, n int64) int64 {\n\t\tres := int64(1)\n\t\tfor ; n > 0; n >>= 1 {\n\t\t\tif n&1 == 1 {\n\t\t\t\tres = res * x % mod\n\t\t\t}\n\t\t\tx = x * x % mod\n\t\t}\n\t\treturn res\n\t}\n\tvar n, m int64\n\tFscan(in, &n, &m)\n\tif n&1 != m&1 {\n\t\tFprint(out, 0)\n\t} else {\n\t\tFprint(out, pow(pow(2, n-1), m-1))\n\t}\n}\n\nfunc main() { CF894B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "2b9f7a80a90b91c5720aab843291d916", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "dfc616dfcd19ac53074c29bb638bdc15", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8029925187032418, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "func main() {\n\tvar (\n\t\tn, m, a int\n\t)\n\tfmt.Scanln(&n, &m, &a)\n\tif n % a != 0 {\n\t\tn = ((n / a) + 1)\n\t}\n\tif m % a != 0 {\n\t\tm = ((m / a) + 1)\n\t}\n\tfmt.Println(n*m)\n}", "lang": "Go", "bug_code_uid": "3c4d7110b78b84a533a68dee572c4345", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "b6119ea681a1fc9c2cc1d7fc22f88fd1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5926928281461434, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n \"math\"\n \"math/big\"\n)\n\nfunc main() {\n var w1, w2, w3 string\n fmt.Scanln(&w1, &w2, &w3)\n n := big.NewInt(strconv.ParseFloat(w1, 64))\n m := big.NewInt(strconv.ParseFloat(w2, 64))\n a := big.NewInt(strconv.ParseFloat(w3, 64))\n fmt.Println(math.Ceil(n/a) * math.Ceil(m/a))\n}\n", "lang": "Go", "bug_code_uid": "64a21eb918e3d8603891cf4e9630057d", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "a9ce4f51cbeb98c44cee2db038216b2e", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6615678776290631, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, a uint64\n\tfmt.Scanf(\"%d %d %d\", &n, &m, &a)\n\trem := 0\n\tif n % a != 0 {\n\t\trem = 1\n\t}\n\tcols := (n / a) + rem\n\trem = 0\n\tif m % a != 0 {\n\t\trem = 1\n\t}\n\trows := (m / a) + rem\n\tfmt.Print(cols * rows)\n}\n", "lang": "Go", "bug_code_uid": "550d22446861b7a08df622c04861487c", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "0919aea3fa4294d6134e5fe5f18a4f40", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6625, "equal_cnt": 21, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 13, "fix_ops_cnt": 21, "bug_source_code": "package main \nimport \"fmt\"\n\nfunc main (){\n var m,n,a int\n fmt.scanf(\"%d\",&m,&n,&a)\n fmt.println(((m+a-1)/a)*((n+a-1)/a))\n}", "lang": "Go", "bug_code_uid": "532d52b07d2e8b394c1d6d582db91654", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e8d5e0a1ef90ee4aebb2599b087fc42e", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9898190045248869, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nconst (\n\tMaxN = 128\n)\n\ntype exam struct {\n\ts, d, c, index int\n}\n\nvar n, m int\nvar e [MaxN]exam\nvar s [MaxN]int\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d %d\\n\", &e[i].s, &e[i].d, &e[i].c)\n\t\te[i].index = i + 1\n\t}\n\tsort.Slice(e[:m], func(i, j int) bool {\n\t\treturn e[i].d < e[j].d\n\t})\n\tfor i := 0; i < m; i++ {\n\t\ts[e[i].d] = m + 1\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tstart := e[i].s\n\t\tfor ;start <= n; start++ {\n\t\t\tif s[start] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif start == n+1 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tfor counter := 0; counter < e[i].c; {\n\t\t\tif s[start + counter] != 0 {\n\t\t\t\tif start + counter == e[i].d {\n\t\t\t\t\tfmt.Println(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tstart++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ts[start + counter] = e[i].index\n\t\t\tcounter++\n\t\t}\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Printf(\"%d \", s[i])\n\t}\n}", "lang": "Go", "bug_code_uid": "849e3e528eddd12ea993f6c94be40e33", "src_uid": "02d8d403eb60ae77756ff96f71b662d3", "apr_id": "c66f22d78332491239d09e20071457fe", "difficulty": 1700, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8583856935717739, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n int\n\tvar m int\n\n\tfmt.Fscan(in, &n, &m)\n\n\ts := make([]int, m)\n\td := make([]int, m)\n\tc := make([]int, m)\n\tsched := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tsched[i] = 0\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscan(in, &s[i], &d[i], &c[i])\n\t\ts[i]--\n\t\td[i]--\n\t\tsched[d[i]] = m + 1\n\t}\n\n\tfail := false\n\n\tfor i := 0; i < n; i++ {\n\t\tbestt := n + 10\n\t\tbestj := -1\n\t\tfor j := 0; j < m; j++ {\n\t\t\tif s[j] <= i && i < d[j] && c[j] > 0 {\n\t\t\t\tt := 0\n\n\t\t\t\tfor k := i; k < d[j]; k++ {\n\t\t\t\t\tif sched[k] == 0 {\n\t\t\t\t\t\tt++\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt -= c[j]\n\n\t\t\t\tif t < bestt {\n\t\t\t\t\tbestt = t\n\t\t\t\t\tbestj = j\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif bestt < 0 {\n\t\t\tfail = true\n\t\t\tbreak\n\t\t}\n\n\t\tif bestj != -1 {\n\t\t\tsched[i] = bestj + 1\n\t\t\tc[bestj]--\n\t\t}\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tif c[i] > 0 {\n\t\t\tfail = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !fail {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfmt.Fprint(out, sched[i], \" \")\n\t\t}\n\n\t\tfmt.Fprintln(out)\n\t} else {\n\t\tfmt.Fprintln(out, -1)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "e609bd9ddfa2b729b7382a24ae889087", "src_uid": "02d8d403eb60ae77756ff96f71b662d3", "apr_id": "bb1701331853568508f7e1240e1fb609", "difficulty": 1700, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.0, "equal_cnt": 0, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n\n\n\n\n", "lang": "Go", "bug_code_uid": "d1ada8635b447444ffd9d9672b503488", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "d014f4dff235eec62eee7d308a670381", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8062953995157385, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tvar maxP int\n\tls := []int{a, b, c}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tvar i, j, k int\n\tfor i = 0; i <= n/ls[0]; i++ {\n\t\tfor j = 0; j <= n/ls[1]; j++ {\n\t\t\tfor k = 0; k <= n/ls[2]; k++ {\n\t\t\t\tif n == i*ls[0]+j*ls[1]+k*ls[2] {\n\t\t\t\t\tif maxP < i+j+k {\n\t\t\t\t\t\tmaxP = i + j + k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(maxP)\n}\n", "lang": "Go", "bug_code_uid": "0dc9e50ffcc0461aa004432f7cb17313", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "78fe77fd9f87ed50539f02939fc1ba87", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9971247843588269, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\t//maxP := bruteForce(n, a, b, c)\n\tmaxP := dp(n, a, b, c)\n\tfmt.Print(maxP)\n}\n\nfunc dp(n, a, b, c int) int {\n\tdp := make([]int, n+1)\n\tdp[a] = 1\n\tdp[b] = 1\n\tdp[c] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tdp[i] = max(dp, i, i-a, i-b, i-c)\n\t}\n\treturn dp[n]\n}\n\nfunc max(dp []int, nrs ...int) int {\n\tm := dp[nrs[0]]\n\tfor _, nr := range nrs[1:] {\n\t\tif nr < 0 || dp[nr] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif dp[nr]+1 > m {\n\t\t\tm = dp[nr] + 1\n\t\t}\n\t}\n\treturn m\n}\n\nfunc bruteForce(n, a, b, c int) int {\n\tvar maxP int\n\tls := []int{a, b, c}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tfor i := 0; i <= n/ls[0]; i++ {\n\t\tfor j := 0; j <= n/ls[1]; j++ {\n\t\t\td := n - i*ls[0] - j*ls[1]\n\t\t\tif d%ls[2] == 0 {\n\t\t\t\tk := d / ls[2]\n\t\t\t\tif maxP < i+j+k {\n\t\t\t\t\tmaxP = i + j + k\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn maxP\n}\n", "lang": "Go", "bug_code_uid": "7f8c98f8b7937310b22c38cefc772d46", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "78fe77fd9f87ed50539f02939fc1ba87", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.375, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst maxN = 4000\n\nfunc resolver(a, b, c, n int) int {\n\t// 최고로 많이 얻을 수 있는 조각의 수를 구한다\n\t// 0조각: 모든 계수를 0으로 맞추면 얻을 수 있다\n\t// 1조각: n == any of coeff\n\tvar maximum int\n\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 sum := a*i + b*j + c*k; sum == n {\n\t\t\t\t\tif maximum < i+j+k {\n\t\t\t\t\t\tmaximum = i+j+k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn maximum // STUB\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scanln(&n, &a, &b, &c)\n\n\tfmt.Println(resolver(a, b, c, n))\n}", "lang": "Go", "bug_code_uid": "9317340a4647e771867b23d5f1ab47c4", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "afcde027491499ac8748a3bb145b8594", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.986833855799373, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"math\"\n\t\"fmt\"\n)\n\nconst maxN = 4000\n\nfunc intMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\n\treturn a\n}\n\nfunc resolver(a, b, c, n int) int {\n\tif n > maxN {\n\t\tpanic(\"Limit exceeded\")\n\t}\n\n\tmemo := make([]int, n+1)\n\tunits := make([]int, 3)\n\n\tunits[0], units[1], units[2] = a, b, c\n\tmemo[0] = 0\n\tmemo[a] = 1\n\tmemo[b] = 1\n\tmemo[c] = 1\n\n\tfor i := 1; i <= n; i++ {\n\t\tvar localMax int = math.MinInt32\n\n\t\tfor _, v := range(units) {\n\t\t\tif delta := i - v; delta >= 0 {\n\t\t\t\tvar localMaxCand int = intMax(localMax, memo[delta] + 1)\n\n\t\t\t\tif localMaxCand > localMax {\n\t\t\t\t\tlocalMax = localMaxCand\n\t\t\t\t\tmemo[i] = localMax\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmemo[i] = localMax\n\t}\n\n\treturn memo[n]\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scanln(&n, &a, &b, &c)\n\n\tfmt.Println(resolver(a, b, c, n))\n}", "lang": "Go", "bug_code_uid": "d937ac89c14e2cdefa05afe5baf162cb", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "afcde027491499ac8748a3bb145b8594", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.2614035087719298, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\n\tn1 := n / a\n\tn2 := n / b\n\tn3 := n / c\n\n\tmax := 0\n\tfor i := 0; i <= n1; i++ {\n\t\tfor j := 0; j <= n2; j++ {\n\t\t\tfor k := 0; k <= n3; k++ {\n\t\t\t\tv := i*a + j*b + k*c\n\t\t\t\tif v >= n {\n\t\t\t\t\tif v == n && i+j+k > max {\n\t\t\t\t\t\tmax = i + j + k\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "lang": "Go", "bug_code_uid": "a83cff064b428c4580a6a5684a53980d", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "77734c31a2d6ba4ad5aef5c9b8bc6f1f", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9957567185289957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\n\treturn max\n}\n\nfunc main() {\n\tvar reader io.Reader\n\tvar writer io.Writer\n\n\treader = os.Stdin\n\twriter = os.Stdout\n\n\t//file, _ := os.Open(\"input.txt\")\n\t//reader = file\n\n\tvar n, a, b, c int\n\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &a, &b, &c)\n\n\n\tf := make([]int, n+1)\n\tf[a] = 1\n\tf[b] = 1\n\tf[c] = 1\n\n\tfor i := 0; i <= n; i++ {\n\t\tif i >= a && f[i-a] != 0 {\n\t\t\tf[i] = MaxOf(f[i-a]+1, f[i])\n\t\t}\n\t\tif i >= b && f[i-b] != 0 {\n\t\t\tf[i] = MaxOf(f[i-b]+1, f[i])\n\t\t}\n\t\tif i >= c && f[i-c] != 0 {\n\t\t\tf[i] = MaxOf(f[i-c]+1, f[i])\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, f[n])\n\n}\n", "lang": "Go", "bug_code_uid": "2d36648c0dbebc42b482cbea9c15a2ce", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "0dc031d6bf5debaf0ecb882235574ad1", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9844033369604642, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"strings\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Readln(r *bufio.Reader) (string, error) {\n\tvar (\n\t\tisPrefix bool = true\n\t\terr error = nil\n\t\tline, ln []byte\n\t)\n\tfor isPrefix && err == nil {\n\t\tline, isPrefix, err = r.ReadLine()\n\t\tln = append(ln, line...)\n\t}\n\treturn string(ln), err\n}\n\nfunc readIntArray(line string) []int {\n\t\n\tnumStrings := strings.Split(strings.TrimSpace(string(line)), \" \")\n\t\n\tnumbers := make([]int, 0)\n\t\n\tfor _, v := range numStrings {\n\t\tvar converted int\n\t\t\n\t\tfmt.Sscanf(v, \"%d\", &converted)\n\t\tnumbers = append(numbers, converted)\n\t}\n\t\n\treturn numbers\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t\n\tline, _ := Readln(reader)\n\tnumbers := readIntArray(line)\n\t\n\tlength := numbers[0]\n\tlengths := numbers[1:]\n\t\n\tcache := make(map[int]int, 0)\n\tfmt.Println(Cut(length, lengths, 0, cache))\n}\n\nfunc Cut(length int, lengths []int, pieces int, cache map[int]int) int {\n\t\n\tif cached, ok := cache[length]; ok {\n\t\treturn cached\n\t}\n\t\n\tmaxPieces := pieces\n\tisCut := false\n\tfor _, ln := range lengths {\n\t\tif (length - ln) >= 0 {\n\t\t\tnewPieces := Cut(length - ln, lengths, pieces + 1, cache)\n\t\t\tif maxPieces < newPieces {\n\t\t\t\tisCut = true\n\t\t\t\tmaxPieces = newPieces\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!isCut) && length > 0 {\n\t\tmaxPieces = -1\n\t\tcache[length] = maxPieces\n\t} else if isCut && length == 0 {\n\t\tcache[length] = maxPieces\n\t}\n\t\n\treturn maxPieces\n}\n", "lang": "Go", "bug_code_uid": "c152646051ffebeda329bbff2a5760b4", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "688516ccc93fc6bbf1438fc6b5d85b7f", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7239130434782609, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "package main\n\n\nimport \"fmt\"\n\n\nfunc max(a,b int) \nint { \nif a > b {\n return a \n} else {\n return b \n} \n}\n\n\nfunc main() {\n \nvar n int\n \nvar a [3]int\n \nfmt.Scan(&n,&a[0],&a[1],&a[2])\n \ndp := make([]int,n+1)\n \ndp[0] = 0\n \nfor i := 1; i <= n; i++ {\n \ndp[i] = -999999999\n \nfor k := 0; k < 3; k++ {\n \nif (i-a[k]) >= 0 {\n \ndp[i] = max(dp[i],1+dp[i-a[k]])\n \n}\n \n}\n \n}\n \nfmt.Println(dp[n])\n\n}\n", "lang": "Go", "bug_code_uid": "576bfcc91f4d0c1a6668eaa1088fdf19", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "6d1c099b63a762b2ba70ffd7b1ebc2ba", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6201279813845259, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc sortThree(a, b, c int) (int, int, int) {\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\treturn a, b, c\n}\n\n// https://codeforces.com/problemset/problem/189/A\n// комментарии к решению\n// Задача решается перебором. Для сокращения кол-ва комбинаций\n// пытаемся сначала разрезать ленту на максимальное кол-во мелких кусочков,\n// уменьшая их кол-во с каждой итерацией пробуем разрезать оставшуюся часть\n// на ленты среднего размера, проводя аналогичный критерий выбора для\n// среднего/крупного размера.\nfunc taskSolution(n, a, b, c int) int {\n\ta, b, c = sortThree(a, b, c)\n\tmax := 0\n\tfor i := n / a; i >= 0; i -= 1 {\n\t\tfor j := (n - i*a) / b; j >= 0; j -= 1 {\n\t\t\tfor k := (n - i*a - j*b) / c; k >= 0; k -= 1 {\n\t\t\t\tif n == i*a+j*b+k*c && max < i+j+k {\n\t\t\t\t\tmax = i + j + k\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn max\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tif _, err := fmt.Scan(&n, &a, &b, &c); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n, a, b, c))\n}\n", "lang": "Go", "bug_code_uid": "e9b45b1dce8b9f322eaa06a3d3040b64", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "107e5b1138136a21fb25b8d2cab65afd", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6706398996235885, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tk := readInt()\n\ta := make([]int, k)\n\tn4 := n\n\tn2 := n * 2\n\tfor i := 0; i < k; i++ {\n\t\ta[i] = readInt()\n\t\tcnt := min(n4, a[i]/4)\n\t\tn4 -= cnt\n\t\ta[i] -= cnt * 4\n\t\tcnt = min(n2, a[i]/2)\n\t\tn2 -= cnt\n\t\ta[i] -= cnt * 2\n\t}\n\tf := make([]int, 1)\n\tf[0] = -1\n\tfor i := 0; i < n4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tf = append(f, 0)\n\t\t}\n\t}\n\tf = append(f, -1)\n\tfor i := 0; i < n2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tf = append(f, 0)\n\t\t}\n\t\tf = append(f, -1)\n\t}\n\tfor i := 1; i <= k; i++ {\n\t\ta := a[i-1]\n\t\tfor j := 0; j < len(f) && a > 0; j++ {\n\t\t\tif f[j] == 0 && (f[j-1] == i || f[j-1] == 0 || f[j-1] == -1) && (f[j+1] == 0 || f[j+1] == -1) {\n\t\t\t\tf[j] = i\n\t\t\t\ta--\n\t\t\t}\n\t\t}\n\t\tif a > 0 {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "8359d2a3d31498509a79e4dbbe0ab3d4", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "4f2c2106d29a11daf0f7942d1ebd4efe", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9984639016897081, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar sto [1005]int\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\tfor index := 0; index < k; index++ {\n\t\tfmt.Scanf(\"%d\\n\", &sto[index])\n\t}\n\tsum, ans := n, 2*n\n\tfor index := 0; index < k; index++ {\n\t\tminn := min(sum, sto[index]/4)\n\t\tsum -= minn\n\t\tsto[index] -= minn * 4\n\t}\n\tans += sum\n\tfor index := 0; index < k; index++ {\n\t\tminn := min(ans, sto[index]/2)\n\t\tans -= minn\n\t\tsto[index] -= minn * 2\n\t}\n\tans += sum\n\tfor index := 0; index < k; index++ {\n\t\tans -= sto[index]\n\t}\n\tif ans >= 0 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "9f61bb6cfc79e7789370a8b9859aacf0", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "b7fff1aa180fa97806e202a791f1a02b", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9915537848605578, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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, K := sc.NextInt(), sc.NextInt()\n\ta := sc.NextIntArray()\n\n\tdouble := N * 2\n\tforth := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tforth[i] = make([]int, 2)\n\t}\n\tforth_pointer := 0\n\tfor i := 0; i < K; i++ {\n\t\tq := a[i] / 4\n\t\tfor k := 0; k < q; k++ {\n\t\t\tif forth_pointer < 2*N {\n\t\t\t\tforth[forth_pointer/2][forth_pointer%2] = i + 1\n\t\t\t\tforth_pointer++\n\n\t\t\t\tforth[forth_pointer/2][forth_pointer%2] = i + 1\n\t\t\t\tforth_pointer++\n\t\t\t\ta[i] -= 4\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < K; i++ {\n\n\t\tq := a[i] / 2\n\n\t\tdiff := min(double, q)\n\t\ta[i] -= diff * 2\n\t\tdouble -= diff\n\t}\n\tfor num := 2; num >= 1; num-- {\n\n\t\tfor i := 0; i < K; i++ {\n\t\t\tq := a[i] / num\n\t\t\te := forth_pointer\n\t\t\tfor k := 0; k < q; k++ {\n\t\t\t\tif double > 0 {\n\t\t\t\t\tdouble--\n\t\t\t\t\ta[i] -= num\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor ; e < 2*N; e++ {\n\t\t\t\t\tif num == 2 && e%2 == 1 {\n\t\t\t\t\t\to := e - 1\n\t\t\t\t\t\tif forth[o/2][0] == i+1 {\n\t\t\t\t\t\t\tforth_pointer += 2\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tforth[e/2][e%2] = i + 1\n\t\t\t\t\ta[i] -= num\n\t\t\t\t\te++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < K; i++ {\n\t\tif a[i] > 0 {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n\n}\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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", "lang": "Go", "bug_code_uid": "c3d01ddf0f0910c1dfc4ac4511095194", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "ad8bf64669d7b7ddcdeba284a6020146", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9457293753414678, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/937/B\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\tp, y int\n)\n\nfunc main() {\n\tp, y = ReadInt2()\n\n\tfor i := y; i > p; i-- {\n\t\tif IsPrime(i) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tvar i int\n\n\tif n == 1 {\n\t\treturn false\n\t}\n\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\n\treturn true\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", "lang": "Go", "bug_code_uid": "1adf62aff2154e8ee0c3e6cb5641db2e", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "99de79a4724b3ad262583f578a12fd96", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8568398727465536, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar p, y int\n\tr := RapidReader()\n\tfmt.Fscan(r, &p, &y)\n\tfor i := y; i >= 2 && i >= y-1000; i-- {\n\t\tok := true\n\t\tfor k := 2; k <= p && k < 31623; k++ {\n\t\t\tif i%k == 0 {\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\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\nfunc RapidReader() io.Reader {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\treturn bytes.NewReader(b)\n}\n", "lang": "Go", "bug_code_uid": "ea335d738fce542b8fe9c78e966edbe4", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "26344c3460be1bc34dedcd035873407d", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.984984984984985, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc distance(n,a,b,c int) int {\n\tif(n==1) {\n\t\treturn 0\n\t} else {\n\t\tif(a= 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", "lang": "Go", "bug_code_uid": "1e9d6b43e72a4ffabc524c29569e358b", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "0522a0f1916923cac7d1c0940739d2d0", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9579606440071556, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "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.NextInt()\n\tb := sc.NextInt()\n\tc := sc.NextInt()\n\n\tif N == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif a < b {\n\t\tif a < c {\n\t\t\tfmt.Println(a * (N - 1))\n\t\t} else {\n\t\t\tfmt.Println(a + c*(N-1))\n\t\t}\n\t}else {\n\t\tif b < c {\n\t\t\tfmt.Println(b * (N - 1))\n\t\t} else {\n\t\t\tfmt.Println(b + c*(N-2))\n\t\t}\t\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) 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", "lang": "Go", "bug_code_uid": "5c78da8d4c5371f390ae475f21689286", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "0522a0f1916923cac7d1c0940739d2d0", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6697848456501403, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tintegerWord, _ := reader.ReadString('\\n')\n\tintegerSufx := strings.TrimSuffix(integerWord, \"\\n\")\n\tintV, _ := strconv.Atoi(integerSufx)\n\tstones, _ := reader.ReadString('\\n')\n\tstones = strings.TrimSuffix(stones, \"\\r\\n\")\n\tttl := 0\n\tfor _, v := range stones {\n\t\tcount := strings.Count(stones, string(v))\n\t\tif count > 1 {\n\t\t\tcount--\n\t\t\tstones = strings.ReplaceAll(stones, string(v), \"\")\n\t\t\tttl += count\n\t\t}\n\t}\n\tfmt.Print(ttl)\n}\n", "lang": "Go", "bug_code_uid": "a1ed2732b989068646222dd522940c43", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "cc0c3ad54bd116b607bba74df32d9036", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.912, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint8\n\tvar c uint8\n\tvar s string\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfmt.Fscanf(in, \"%s\\n\", &s)\n\tif n%2 != 0 {\n\t\tfor i := 1; i < len(s)-1; {\n\t\t\tif s[i-1] == s[i] {\n\t\t\t\tc++\n\t\t\t}\n\t\t\tif s[i+1] == s[i] {\n\t\t\t\tc++\n\t\t\t}\n\t\t\ti += 2\n\t\t}\n\t\tfmt.Println(c)\n\t} else {\n\t\tfor i := 1; i < len(s); {\n\t\t\tif s[i-1] == s[i] {\n\t\t\t\tc++\n\t\t\t}\n\t\t\tif s[i+1] == s[i] {\n\t\t\t\tc++\n\t\t\t}\n\t\t\ti += 2\n\t\t}\n\t\tfmt.Println(c)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a89823a562ee0934e446e1d2e2937b98", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "4c3da37bd8e311f520f2e837ca8bf480", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9943368107302534, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n \"os\"\n \"bufio\"\n \"log\"\n \"strconv\"\n)\n\n\nfunc main() {\n\n//================== Variables used ====================\n var num, count int\n var stoneString,prev,curr string\n\n//======================================================\n ///*\n//============== Assign vars from file =================\n scanner := bufio.NewScanner(os.Stdin)\n \n if strings.Compare(os.Args[1], \"\") != 0{ \n file, err := os.Open(os.Args[1])\n if err != nil {\n log.Fatalf(\"failed opening file: %s\", err)\n }\n scanner = bufio.NewScanner(file)\n scanner.Scan()\n fmt.Println(scanner.Text())\n n, err2 := strconv.Atoi(scanner.Text())\n num = n\n if err2 != nil {\n log.Fatalf(\"failed opening file: %s\", err2)\n \n }\n scanner.Scan()\n stoneString = scanner.Text()\n//======================================================\n defer file.Close()\n }else{\n //*/\n//============== Assign vars from STDIN ================\n fmt.Scan(&num)\n fmt.Scan( &stoneString)\n//======================================================\n ///*\n }\n //*/\n//========== Implement Algorithm =======================\n prev = string(stoneString[0])\n for x:=1; x 1{\n\t\tif m%2==0{\n\t\t\tm/=2\n\t\t\tans++\n\t\t}else if m%3==0{\n\t\t\tm/=3\n\t\t\tans++\n\t\t}else{\n\t\t\tfmt.Printf(\"-1\\n\")\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\",ans)\n\n}\n", "lang": "Go", "bug_code_uid": "4f8edfa3fe79f9009fa15f9df3ff61f5", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "ec4d1a7f4e756317811a2ea65aa47744", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9816079873883342, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n input, _ := reader.ReadString('\\n')\n \n splitted := strings.Split(input, \" \")\n \n n, _ := strconv.Atoi(splitted[0])\n m, _ := strconv.Atoi(splitted[1])\n \n if n == m {\n fmt.Println(\"0\")\n os.Exit(0)\n } else if m % n != 0 {\n fmt.Println(\"-1\")\n os.Exit(0)\n }\n \n div := m / n\n if div % 2 != 0 && div % 3 != 0 {\n fmt.Println(\"-1\")\n os.Exit(0)\n }\n \n divisors := [3] int {6, 3, 2}\n ans := 0\n \n for i := 0; i < 3; i++ {\n for div % divisors[i] == 0 {\n if i == 0 {\n ans += 2\n } else {\n ans++\n }\n div /= divisors[i]\n }\n }\n \n if div == 1 {\n fmt.Println(ans)\n } else {\n fmt.Println(\"-1\")\n }\n}", "lang": "Go", "bug_code_uid": "f2820b52732945fd3adcf77ab90ce3c7", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "9bde0e8f6b51707e1d7cc09f98d98853", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8167441860465117, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,m int\n\td:=0\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tif m%n!=0{\n\t fmt.Printf(\"%d\", -1)\n\t}\n\tif m%n==0{\n\t x:=m/n\n\t for (x%2==0||x%3==0||x>1){\n\t if x%2==0{\n\t x=x/2\n\t d+=1\n\t }\n\t if x%3==0{\n\t x=x/3\n\t d+=1\n\t }\n\t }\n\t if x==1{\n\t fmt.Printf(\"%d\", d)\n\t }\n\t if x!=1{\n\t fmt.Printf(\"%d\", -1)\n\t }\n\t}\n\t\n}\n", "lang": "Go", "bug_code_uid": "a8d5c64706f3676f327885bdddb477b4", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "5d2e70efac8715b62d03c2e8d5608b85", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9904957616234267, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Cin struct {\n\tscanner *bufio.Scanner\n}\n\nfunc (c *Cin) NextInt() int {\n\tc.scanner.Scan()\n\tline := c.scanner.Text()\n\treturn c.convertInt(line)\n}\n\nfunc (c *Cin) NextIntSlice() []int {\n\tc.scanner.Scan()\n\tline := strings.Split(c.scanner.Text(), \" \")\n\tvar ret []int\n\tfor _, s := range line {\n\t\tret = append(ret, c.convertInt(s))\n\t}\n\treturn ret\n}\n\nfunc (c *Cin) NextTwoInt() (int, int) {\n\tline := c.NextIntSlice()\n\treturn line[0], line[1]\n}\n\nfunc (c *Cin) convertInt(data string) int {\n\ti, _ := strconv.Atoi(data)\n\treturn i\n}\n\nvar cin = &Cin{\n\tscanner: bufio.NewScanner(os.Stdin),\n}\n\ntype element struct {\n\tvalue int\n\tstep int\n\tnext *element\n\tlast *element\n}\n\nfunc newElement(value, step int) *element {\n\treturn &element{value: value, step: step}\n}\n\ntype queue struct {\n\thead *element\n\ttail *element\n}\n\nfunc (q *queue) push(value, step int) {\n\titem := newElement(value, step)\n\tif q.isEmpty() {\n\t\tq.head = item\n\t\tq.tail = q.head\n\t\treturn\n\t}\n\titem.last = q.tail\n\tq.tail.next = item\n\tq.tail = item\n}\n\nfunc (q *queue) isEmpty() bool {\n\treturn q.head == nil\n}\n\nfunc (q *queue) pop() *element {\n\tif q.isEmpty() {\n\t\tpanic(\"pop from empty queue\")\n\t}\n\titem := q.head\n\tq.head = q.head.next\n\treturn item\n}\n\nfunc newQueue() *queue {\n\treturn &queue{}\n}\n\nfunc handle(n, m int) int {\n\tq := newQueue()\n\tq.push(n, 0)\n\tset := map[int]int{n: 0}\n\tfor !q.isEmpty() {\n\t\tele := q.pop()\n\t\tif ele.value == m {\n\t\t\treturn ele.step\n\t\t}\n\t\tif _, ok := set[ele.value*2]; !ok {\n\t\t\tset[ele.value*2] = ele.step + 1\n\t\t\t// fmt.Printf(\"val=[%v],step=[%v]\\n\", ele.value*2, ele.step+1)\n\t\t\tq.push(ele.value*2, ele.step+1)\n\t\t}\n\t\tif _, ok := set[ele.value*3]; !ok {\n\t\t\tset[ele.value*3] = ele.step + 1\n\t\t\t// fmt.Printf(\"val=[%v],step=[%v]\\n\", ele.value*3, ele.step+1)\n\t\t\tq.push(ele.value*3, ele.step+1)\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tn, m := cin.NextTwoInt()\n\tfmt.Printf(\"%d\\n\", handle(n, m))\n}\n", "lang": "Go", "bug_code_uid": "cb2812f03912def502cf7f3a351d44f7", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "a9448768eeed9e6eacad99defa114349", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.933597621407334, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt() int {\n\tscanner.Scan()\n\tn,err := strconv.Atoi(scanner.Text())\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn n\n}\nfunc main() {\n\t// 1 2 3 4 5 6 7 8\n\t// 0 2 0 4 0 6 0 8\n\tn := ReadInt()\n\tm := ReadInt()\n\tif(m == 0){\n\t\tfmt.Println(1);\n\t}else if(m < (n + 1) / 2){\n\t\t\tfmt.Println(m)\n\t} else{\n\t\tfmt.Println(n - m)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "7c038ca98983395c955f17d8b1327609", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "e24983fb55f0e0cbcef373bbb2d436b1", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7230443974630021, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, m int\n fmt.Scanf(\"%d%d\", &n, &m)\n if m < n / 2 {\n if m == 0 {\n m = 1\n }\n fmt.Printf(\"%d\", m)\n } else {\n fmt.Printf(\"%d\", n - m)\n }\n}", "lang": "Go", "bug_code_uid": "a62769039090bd187976d677dbc11320", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "69e0bda7b977b28710444895fb847d55", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9445100354191264, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n a, b := getI(), getI()\n for {\n a++\n x, y := a, b\n for x != 0 {\n d := x%10\n x /= 10\n if d == 4 || d == 7 {\n if d == y%10 {\n y /= 10\n } else {\n x = 0\n }\n }\n }\n if y == 0 {\n break\n }\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", a))\n}\n", "lang": "Go", "bug_code_uid": "c37bfa248b12cdf18e48dc4532c2cbcb", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "1e667ac6a66fe1a267b1ff619bd0c6f5", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9702863317125878, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in[strings.Index(in, \"1\"):], \"0\") >= 6 {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n", "lang": "Go", "bug_code_uid": "280318f0ef9471a409b85c2bd2f205b5", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "7ad16f8eca01136b3ac51243dbe08ae2", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7044776119402985, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\tzero := 0\n\tone := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t} else {\n\t\t\tone++\n\t\t}\n\t}\n\n\tif one > 1 && zero >= 6 {\n\t\tfmt.Printf(\"yes\")\n\t} else {\n\t\tfmt.Printf(\"no\")\n\t}\n}\n\n\n", "lang": "Go", "bug_code_uid": "269b901afdfc680f098a950cf5daea8b", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "51d2f55d795f22c970f1b2b179072205", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8434925864909391, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\ti : = 0\n\tzero := 0\n\n\tfor i < len(s) {\n\t\tif s[i] == '1' { break }\n\t}\n\n\tfor i < len(s) {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t}\n\t}\n}\n\n\n", "lang": "Go", "bug_code_uid": "3bfed1675e9730e71d9ad74bd8e2ea7a", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "51d2f55d795f22c970f1b2b179072205", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9822485207100592, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\ti := 0\n\tzero := 0\n\n\tfor i < len(s) {\n\t\tif s[i] == '1' { break }\n\t}\n\n\tfor i < len(s) {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t}\n\t}\n\n\tif zero > 5 {\n\t\tfmt.Printf(\"yes\")\n\t\tos.Exit(0)\n\t}\n\tfmt.Printf(\"no\")\n}\n\n\n", "lang": "Go", "bug_code_uid": "42af1f7cefd15c53dd0252bb05dad62d", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "51d2f55d795f22c970f1b2b179072205", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9980769230769231, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc abs(a int) int{\n\t\n\tif(a > 0){\n\t\treturn a \n\t}else{\n\t\treturn a * (-1)\n\t}\n\t\n}\n\nfunc main(){\n\t\n\tvar n int\n\tvar ans int\n\t\n\tfmt.Scanln(&n)\n\t\n\tskills := make([]int, n)\n\tans = 0\n\t\n\tfor i := 0; i < n; i++{\n\t\tfmt.Scanln(&skills[i])\n\t}\n\t\n\tfor i := 0; i < n; i++{\n\t\tfor j := n - 1; j > i; j--{\n\t\t\tif skills[j] < skills[j-1]{\n\t\t\t\ttmp := skills[j]\n\t\t\t\tskills[j] = skills[j-1]\n\t\t\t\tskills[j-1] = tmp\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor i := 0; i < n; i += 2{\n\t\tans += abs(skills[i]-skills[i+1])\n\t}\n\t\n\tfmt.Print(ans)\n}", "lang": "Go", "bug_code_uid": "048d04e6a4552df07c866df192f66873", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "0842ed54ae02b6711fac241b20b720e5", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9970845481049563, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tlev := make([]int, n)\n\tfor i := range lev {\n\t\tfmt.Scan(&lev[i])\n\t}\n\tsort.Sort(sort.IntSlice(lev))\n\n\tb := 0\n\tfor i := 0; i < n/2; i++ {\n\t\tif lev[i*2] >= lev[i*2+1] {\n\t\t\tb += lev[i*2] - lev[i*2+1]\n\t\t} else {\n\t\t\tb += lev[i*2] - lev[i*2]\n\t\t}\n\t}\n\tfmt.Println(b)\n}\n", "lang": "Go", "bug_code_uid": "32628b7bf805ffdc2c6c525e832dca92", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "04ead0fc4d98d0b84c5b99a88f900cf4", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9709923664122138, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nconst alphabets = \"abcdefghijklmnopqrstuvwxyz\"\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tProblem1092B()\n}\n\nfunc Problem1092B() {\n\tn := getI()\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = getI()\n\t}\n\tsort.Ints(arr)\n\tmax := 0\n\tfor i := 0; i < n; i+=2 {\n\t\tif arr[i] != arr[i+1] {\n\t\t\tmax += arr[i+1] - arr[i]\n\t\t}\n\t}\n\tprintln(max)\n}", "lang": "Go", "bug_code_uid": "0e92aef8b340ea478378284452ff67a6", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "1ae49e2aa4ff0c6e35eeb22625fe6f76", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9775280898876404, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"sort\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nconst alphabets = \"abcdefghijklmnopqrstuvwxyz\"\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tProblem1092B()\n}\n\nfunc Problem1092B() {\n\tn := getI()\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = getI()\n\t}\n\tsort.Ints(arr)\n\tmax := 0\n\tfor i := 0; i < n; i+=2 {\n\t\tif arr[i] != arr[i+1] {\n\t\t\tmax += arr[i+1] - arr[i]\n\t\t}\n\t}\n\tprintln(max)\n}", "lang": "Go", "bug_code_uid": "44c563fc0464d1faf07718abb5c19bc8", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "1ae49e2aa4ff0c6e35eeb22625fe6f76", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8768, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n//bg менять на gb\nfunc checking(s string) {\n\tflag := strings.ReplaceAll(s, \"BG\", \"GB\")\n\treturn flag\n}\n \nfunc main() {\n\tvar itog string\n var x, y int\n\tfmt.Scan(&itog)\n fmt.Scan(&x, &y)\n\t\n\tfor i := 0; i < y; i++ {\n\t\titog = checking(itog)\n\t}\n\tfmt.Println(itog)\n}", "lang": "Go", "bug_code_uid": "9962354e86e20bfd748ee8336db0660e", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "9ee1353cc941294055708b26aef1ecd9", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.915929203539823, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, t uint\n\tvar s string\n\t//in := bufio.NewReader(os.Stdin)\n\tfmt.Scan(&n, &t)\n\tfmt.Scan(&s)\n\tfor j := uint(0); j < t; j++ {\n\t\tfor i := uint(0); i < uint(len(s)-1); {\n\t\t\tif string(s[i]) == \"B\" && string(s[i+1]) == \"G\" {\n\t\t\t\tr := []rune(s)\n\t\t\t\tt := r[i]\n\t\t\t\tr[i] = r[i+1]\n\t\t\t\tr[i+1] = t\n\t\t\t\ts = string(r)\n\t\t\t\ti += 2\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t}\n\n\tfmt.Println(s)\n\t//BGGBG\n\t//GBGGB\n}\n", "lang": "Go", "bug_code_uid": "5a958877c50bc3b7f8cb99c8465d8a65", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "7c97a280a862ef697ee8e4b4da017fe4", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9239013933547695, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\t\"fmt\"\n\t\t\"strings\"\n)\nfunc main() {\n\tvar n,t int\n\tvar s string\n\tfmt.Scan(&n,&t,&s)\n\tfor t > 0 {\n\t\tvar ans []string\n\t\tvar toggle = 0\n\t\tfor i := range s{\n\t\t\tif s[i] == 71 && i != 0 && toggle == 0{ //G\n\t\t\t\tif ans[i-1] == \"B\" {\n\t\t\t\t\tans[i-1] = \"G\"\n\t\t\t\t\tans = append(ans,\"B\")\n\t\t\t\t\ttoggle = 1;\n\t\t\t\t}\t\n\t\t\t} else{\n\t\t\t\tans = append(ans,string(s[i]))\n\t\t\t\ttoggle = 0;\n\t\t\t}\n\t\t}\n\t\ts = strings.Join(ans,\"\")\n\t\tt--\n\t}\n\tfmt.Println(s)\n}\n", "lang": "Go", "bug_code_uid": "7db75471bce2d6f55d2e5d999fc1b142", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "48e345309e49c5ae4aba382c634b5004", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.995334370139969, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn, t int\n\t\tl string\n\t\ts []rune\n\t)\n\n\tfmt.Scan(&n, &t)\n\tfmt.Scan(&l)\n\ts = []rune(l)\n\n\tfor i := 0; i < t; i++ {\n\t\tl = string(s)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif l[j] == 'B' && l[j+1] == 'G' {\n\t\t\t\ts[j], s[j+1] = 'G', 'B'\n\t\t\t\tj++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(string(s))\n}", "lang": "Go", "bug_code_uid": "3139c7efc04996d57b857120eda2e984", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "d217da1328cb0d5d6bff5deffbb14d9d", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.933579335793358, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\n\tvar n int\n\tfmt.Fscan(in, &n)\n\n\tcnt := 0\n\tfor n > 0 {\n\t\tcnt++\n\t\tn -= cnt\n\t}\n\n\tfmt.Fprintln(out, cnt)\n\n}\n", "lang": "Go", "bug_code_uid": "44830b08f4a18358527cc043867cf0f2", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "5d0ead18a822c7f79113f8b93fd94a94", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8473282442748091, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\nfunc main() {\n\t var n float64\n\tfmt.Scanf(\"%f\",&n);\n\tfmt.Println(int(math.Log(n))+1);\n}\n", "lang": "Go", "bug_code_uid": "061fcf0a211bf2aa7324784457e51f63", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "105c9947752cb46de3189150fbb199df", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9345794392523364, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var p,a,b int\n min := 1001\n for i := 0; i < 4; i++ {\n fmt.Scan(&p)\n if min > p { min = p }\n }\n fmt.Scan(&a,&b)\n ans := min-a\n if ans < 0 { ans = 0 }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "e55a964f0216ae3a0c5d56456c295654", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "9a053547b7e233d526f69a5c4456efbd", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8805570433851098, "equal_cnt": 29, "replace_cnt": 13, "delete_cnt": 6, "insert_cnt": 9, "fix_ops_cnt": 28, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\ntype pos struct{\n x int\n y int\n}\n\nfunc mark_rock(board *[9][9]int, pos_r pos){\n for i:=pos_r.x+1; i<=8; i++{\n if board[i][pos_r.y] < 2 {\n board[i][pos_r.y] = 1\n }else{\n break\n }\n }\n for i:=pos_r.x-1; i>=1; i--{\n if board[i][pos_r.y] < 2 {\n board[i][pos_r.y] = 1\n }else{\n break\n }\n }\n for j:=pos_r.y+1; j<=8; j++{\n if board[pos_r.x][j] < 2 {\n board[pos_r.x][j] = 1\n }else{\n break\n }\n }\n for j:=pos_r.y-1; j>=1; j--{\n if board[pos_r.x][j] < 2 {\n board[pos_r.x][j] = 1\n }else{\n break\n }\n }\n}\n\nfunc is_valid(x int, y int) bool{\n if x>=1 && x<=8{\n return y>=1 && y<=8\n }\n return false\n}\n\nvar move_x = [3]int{-1, 0, 1}\nvar move_y = [3]int{-1, 0, 1}\n\nfunc mark_king(board *[9][9]int, pos_k pos){\n for i:=0; i<3; i++{\n for j:=0; j<3; j++{\n x:= pos_k.x+move_x[i]\n y:= pos_k.y+move_y[j]\n if !is_valid(x,y){\n continue\n }\n if board[x][y] >=2{\n continue\n }\n board[x][y] = 1\n }\n }\n}\n\nfunc Result(bk pos, board [9][9]int) string{\n for i:= 0; i<3; i++{\n for j:=0; j<3; j++{\n x:= bk.x + move_x[i]\n y:= bk.y + move_y[j]\n if x==0 && y==0{\n continue\n }\n if !is_valid(x,y){\n continue\n }\n if board[x][y] == 2{\n return \"OTHER\"\n }\n if board[x][y] == 0{\n return \"OTHER\"\n }\n }\n }\n return \"CHECKMATE\"\n}\n\nfunc main(){\n chess := map[string]pos{}\n toi := [9]byte{'a','b', 'c', 'd', 'e', 'f', 'g', 'h'}\n for k, letter := range toi{\n for j:=1; j<=8; j++{\n chess[string(letter) + strconv.Itoa(j)] = pos{k+1, j}\n }\n }\n board := [9][9]int{}\n var wr, wr2, wk, bk string\n fmt.Scanf(\"%s %s %s %s\", &wr, &wr2, &wk, &bk)\n pos_wr, _ := chess[wr]\n board[pos_wr.x][pos_wr.y] = 2 //rock\n pos_wr2, _ := chess[wr2]\n board[pos_wr2.x][pos_wr2.y] = 2 //rock\n pos_wking, _ := chess[wk]\n board[pos_wking.x][pos_wking.y] = 3 //white king\n pos_bking, _ := chess[bk]\n mark_rock(&board, pos_wr)\n mark_rock(&board, pos_wr2)\n mark_king(&board, pos_wking)\n //show(board)\n fmt.Println(Result(pos_bking, board)) \n}\n\nfunc show(board [9][9]int){\n for i:=1; i<=8; i++{\n for j:=1; j<=8; j++{\n fmt.Printf(\"%d,%d:%v \", i, j, board[i][j])\n }\n fmt.Printf(\"\\n\")\n }\n fmt.Println(\"---------------\")\n}\n", "lang": "Go", "bug_code_uid": "36f05c113355a4964b48eda9bd9352d4", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "edf6a9a8951c027ebfd7485354609d83", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9504132231404959, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, m int64\n\n\tscanf(\"%d %d\", &n, &m)\n\n\tif m == 1 {\n\t\tfmt.Println(n * n)\n\t\treturn\n\t}\n\n\tmp := make(map[int64]int64)\n\n\tr := n / m\n\tc := n % m\n\n\tfor i := int64(1); i <= m; i++ {\n\t\tmp[i*i%m] += r\n\t}\n\n\tfor i := int64(1); i <= c; i++ {\n\t\tmp[i*i%m] += 1\n\t}\n\tans := int64(0)\n\tfor k, v := range mp {\n\n\t\tans += v * mp[m-k]\n\n\t}\n\n\tans += mp[int64(0)]\n\n\tfmt.Println(ans)\n\n}\n", "lang": "Go", "bug_code_uid": "ca8aed35def01a6307b8dd3bb953ea36", "src_uid": "2ec9e7cddc634d7830575e14363a4657", "apr_id": "5a5bbb3394e9b33270e99d1b5b7bfbb9", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5432900432900433, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n00, n01, n02, n10, n11, n12, n20, n21, n22 int\n\tfmt.Scan(&n00, &n01, &n02)\n\tfmt.Scan(&n10, &n11, &n12)\n\tfmt.Scan(&n20, &n21, &n22)\n\tif n00 == 0 && n11 == 0 && n22 == 0 {\n\t\tn00 = n02\n\t\tn22 = n20\n\t\tif n00 + n01 + n02 == n20 + n21 + n22 {\n\t\t\tn11 = n00 + n01 + n02 - n00 - n22\n\t\t}\n\t}\n\tfmt.Print(n00, n01, n02)\n\tfmt.Println()\n\tfmt.Print(n10, n11, n12)\n\tfmt.Println()\n\tfmt.Print(n20, n21, n22)\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "9ff3ddcb3a8c1816ee03cf5d2b2cbad5", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "a4d7f04df5f012d50dcd6c93cc29e27b", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5634132086499123, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc check(d... int) bool {\n for _, v := range d {\n if v != d[0] { return false }\n }\n return true\n}\n\nfunc main() {\n var a [3][3]int\n var x [3][2]int\n max := 0\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Scan(&a[i][j])\n x[i][0] += a[i][j]\n x[j][1] += a[i][j]\n if max < x[i][0] { max = x[i][0] }\n if max < x[j][0] { max = x[j][0] }\n }\n }\n if max > 100000 { max = 100000 }\n for i := 0; i <= max; i++ {\n for j := 0; j <= max; j++ {\n for k := 0; k <= max; k++ {\n if check((i+x[0][0]),(i+x[0][1]),(j+x[1][0]),(j+x[1][1]),(k+x[2][0]),(k+x[2][1])) {\n a[0][0] = i\n a[1][1] = j\n a[2][2] = k\n break\n }\n }\n }\n }\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Print(a[i][j])\n if j == 2 { fmt.Println() } else { fmt.Print(\" \") }\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "b0f16ffb746c88a75cf725e2d5991969", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "9fb31c87ccfa0709d0ce25ebb5c00a58", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9837133550488599, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar mod int64 = 1000000007\n\nfunc main() {\n\tvar a, b int64\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tsum1 := (b - 1) * b / 2\n\tsum1 = sum1 % mod\n\tsum2 := a * (a + 1)\n\tsum2 = sum2 % mod\n\tsum2 = sum2 * b / 2\n\tsum2 = sum2 % mod\n\tsum := sum1 * (a + sum2)\n\tsum = sum % mod\n\tfmt.Println(sum)\n}\n", "lang": "Go", "bug_code_uid": "3df76a7e5391b765d5773daf6188cb67", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "4cc9f836f8e45857aee3acd5157ab608", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9987975951903808, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport \"fmt\"\n\nvar s75 = \"What are you doing at the end of the world? Are you busy? Will you save us?\"\nvar s34 = \"What are you doing while sending \\\"\"\nvar s32 = \"\\\"? Are you busy? Will you send \\\"\"\nvar s2 = \"\\\"?\"\n\nvar f = make([]int64, 100001)\n\nfunc printChar(n int, k int64) {\n\tif k > f[n] {\n\t\tfmt.Print(\".\")\n\t\treturn\n\t}\n\n\tif n == 0 {\n\t\tfmt.Print(string(s75[k-1]))\n\t\treturn\n\t}\n\n\tif k <= 34 {\n\t\tfmt.Print(string(s34[k-1]))\n\t\treturn\n\t}\n\n\tk -= 34\n\tif k <= f[n-1] {\n\t\tprintChar(n-1, k)\n\t\treturn\n\t}\n\n\tk -= f[n-1]\n\tif k <= 32 {\n\t\tfmt.Print(string(s32[k-1]))\n\t\treturn\n\t}\n\n\tk -= 32\n\tif k <= f[n-1] {\n\t\tprintChar(n-1, k)\n\t\treturn\n\t}\n\n\tk -= f[n-1]\n\tfmt.Print(string(s2[k-1]))\n}\n\n// calc len(fi)\nfunc main() {\n\t// 75\n\t//f0 := \"What are you doing at the end of the world? Are you busy? Will you save us?\"\n\t// 34 + 75(f0) + 32 + 75(f0) + 2 = 68\n\t//f1 := \"What are you doing while sending \\\"\" + f0 + \"\\\"? Are you busy? Will you send \\\"\" + f0 + \"\\\"?\"\n\t//nLen := len(f0)\n\t//fmt.Println(nLen)\n\t//fmt.Println(f1)\n\n\tf[0] = 75\n\t// range ptr/ref\n\tfor i := 1; i < 100001; i++ {\n\t\tf[i] = 34 + f[i-1] + 32 + f[i-1] + 2\n\t}\n\n\tvar q int\n\tfmt.Scan(&q)\n\tfor i := 0; i < q; i++ {\n\t\tvar n int\n\t\tvar k int64\n\t\tfmt.Scan(&n, &k)\n\t\tprintChar(n, k)\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "f96ae1a1998a93472f4b0b61cc796b19", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "f9a8b50da3350ec04155b4114994f4d6", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9979181124219292, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar f0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\"\nvar a = \"What are you doing while sending \\\"\"\nvar b = \"\\\"? Are you busy? Will you send \\\"\"\nvar c = \"\\\"?\"\n\nvar cnt []int64\n\nfunc recv(n, k int64) byte {\n\tif n == 0 {\n\t\tif k < int64(len(f0)) {\n\t\t\treturn f0[k]\n\t\t}\n\t\treturn '.'\n\t}\n\tif k < int64(len(a)) {\n\t\treturn a[k]\n\t}\n\tk -= int64(len(a))\n\n\tif k < cnt[n-1] {\n\t\treturn recv(n-1, k)\n\t}\n\tk -= int64(cnt[n-1])\n\n\tif k < int64(len(b)) {\n\t\treturn b[k]\n\t}\n\n\tk -= int64(len(b))\n\n\tif k < cnt[n-1] {\n\t\treturn recv(n-1, k)\n\t}\n\tk -= int64(cnt[n-1])\n\n\tif k < int64(len(c)) {\n\t\treturn c[k]\n\t}\n\treturn '.'\n\n}\n\nfunc main() {\n\tcnt = make([]int64, 100001)\n\tcnt[0] = int64(len(f0))\n\tfor i := 1; i < len(cnt); i++ {\n\t\tcnt[i] = int64(len(a)) + cnt[i-1] + int64(len(b)) + cnt[i-1] + int64(len(c))\n\t\tif cnt[i] > 1e18 {\n\t\t\tcnt[i] = 1e18\n\t\t}\n\t}\n\tsc := NewScanner()\n\tq := sc.NextInt()\n\tfor i := 0; i < q; i++ {\n\t\ta, b := sc.NextInt64(), sc.NextInt64()\n\t\tfmt.Println(recv(a, b))\n\t}\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", "lang": "Go", "bug_code_uid": "c3eca7af76d274777881abfe54bbe626", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "ae0c3b4851dca1b2430cf6300077a5c3", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.875, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k, n, s, p int\n fmt.Scanf(\"%d %d %d %d\", &k, &n, &s, &p)\n fmt.Println((k * (n + s - 1) / s + p - 1) / p)\n}\n\n", "lang": "Go", "bug_code_uid": "d8debdc6ea78375a6280e51cc429dc02", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "21bc6476f6ab76a768f13fc6676fc914", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.996715157203191, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"time\"\n\t\"math\"\n)\n\nfunc resolve() {\n\tvar people, manAP, paperAP, sheets float64\n\tdata := toFloat64(getRow(), &people, &manAP, &paperAP, &sheets)\n\n\tpaperPerMan := math.Ceil(manAP / paperAP)\n\tsheetsNeeded := paperPerMan * people\n\tpacks := math.Ceil(sheetsNeeded / sheets)\n\n\tpp(data)\n\tpp(paperPerMan, sheetsNeeded)\n\tfmt.Print(packs)\n}\n\nfunc pp(args... interface{}) {\n\tif false {\n\t\tfmt.Println(args...)\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc getRow(vars... *string) []string {\n\tif scanner == nil {\n\t\tscanner = bufio.NewScanner(os.Stdin)\n\t}\n\n\tscanner.Scan()\n\tdata := strings.Split(scanner.Text(), \" \")\n\tfor k, _ := range vars {\n\t\tif len(data) > k {\n\t\t\t*vars[k] = data[k]\n\t\t}\n\t}\n\treturn data\n}\n\nfunc toFloat64(s []string, vars... *float64) []float64 {\n\tsI := make([]float64, len(s))\n\tvarsLen := len(vars)\n\n\tfor k, i := range s {\n\t\tsI[k], _ = strconv.ParseFloat(i, 64)\n\n\t\tif varsLen > k {\n\t\t\t*vars[k] = sI[k]\n\t\t}\n\t}\n\n\treturn sI\n}\n\nfunc main() {\n\tstart := time.Now()\n\tresolve()\n\tpp(time.Since(start))\n}\n", "lang": "Go", "bug_code_uid": "39700b7203573e07da7577ca477ebfd7", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "15a081e1ccb65b9494c958730b4a6ffb", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9996478253213594, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "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\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// 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\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 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\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\nfunc main() {\n\tdefer Flush()\n\n\tk := readll()\n\tn := readll()\n\ts := readll()\n\tp := readll()\n\n\ts2 := n / s\n\tif n%s != 0 {\n\t\ts2++\n\t}\n\tans := k * s2 / p\n\tif s2%p != 0 {\n\t\tans++\n\t}\n\tprintln(ans)\n}\n", "lang": "Go", "bug_code_uid": "17aa39669719a1223141c7da10bf88bb", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "b807424c51e65c977fc64119aead9447", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9738903394255874, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tA = 1\n\tB = 3\n\tC = 2\n\tD = 0\n)\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan() \n\ttext := scanner.Text()\n\tnum, _ := strconv.Atoi(text)\n\tswitch num % 4 {\n\tcase A:\n\t\tfmt.Println(0)\n\tcase B:\n\t\tfmt.Println(2)\n\tcase C:\n\t\tfmt.Println(1)\n\tcase D:\n\t\tfmt.Println(1)\n\tdefault:\n\t\tfmt.Println(0)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "196dcab33bf724d832d26511c18a7e31", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "0c7972ee87baf571ec599c4ba2d24835", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9555189456342669, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"enter text\")\n\tvar input int\n\tfmt.Scanln(&input)\n\tvar remainder = input % 4\n\tif remainder == 0 {\n\t\tfmt.Print(\"1 A\")\n\t} else if remainder == 1 {\n\t\tfmt.Print(\"0 A\")\n\t} else if remainder == 2 {\n\t\tfmt.Print(\"1 B\")\n\t} else if remainder == 3 {\n\t\tfmt.Print(\"2 A\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4d0838906b21fcdcf7c698882ab17d5e", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "b692d1fde163f6548ee9c72abf525386", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9913544668587896, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\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(a, 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.Scanln(&n)\n\tswitch n%4{\n\tcase 1:\n\t\tfmt.Println(\"0 A\")\n\tcase 2:\n\t\tfmt.Println(\"1 B\")\n\tcase 3:\n\t\tfmt.Println(\"0 B\")\n\tcase 0:\n\t\tfmt.Println(\"1 A\")\n\t}\n}", "lang": "Go", "bug_code_uid": "c636d25b2331157d31f2f9a043b60826", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "66969d33023c54529852355846ecbefc", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9963636363636363, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1191/problem/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Solution struct {\n\tMoves int\n\tCategory string\n}\n\nfunc Solve(x int) Solution {\n\tcategory := map[int]string{\n\t\t1: \"A\",\n\t\t3: \"B\",\n\t\t2: \"C\",\n\t\t0: \"D\",\n\t}\n\tmoves := 0\n\tbestMoves := 0\n\tbestCategory := category[x%4]\n\tfor x+moves <= 100 {\n\t\tcurrentCategory := category[(x+moves)%4]\n\t\tif currentCategory < bestCategory {\n\t\t\tbestMoves = moves\n\t\t\tbestCategory = currentCategory\n\t\t}\n\t\tmoves += 1\n\t}\n\treturn Solution{Moves: bestMoves, Category: bestCategory}\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar x int\n\tfmt.Fscanf(reader, \"%d\\n\", &x)\n\n\tsolution := Solve(x)\n\tfmt.Fprintf(writer, \"%d %s\\n\", solution.Moves, solution.Category)\n}\n", "lang": "Go", "bug_code_uid": "f6473a41aa8e94c4c2fd897ca89a227b", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "2f7b259df00269bae63d894d2214d2ae", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9857397504456328, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nvar mod int64 = 1000000007\n\nfunc main() {\n var n, m, k int64\n fmt.Scan(&n)\n fmt.Scan(&m)\n fmt.Scan(&k)\n if k > n {\n fmt.Println(pow(m, n))\n } else if k == n {\n fmt.Println(pow(m, (n + 1) / 2))\n } else if k == 1 {\n fmt.Println(pow(m, n))\n } else if k % 2 == 0 {\n fmt.Println(m)\n } else if k % 1 == 0 {\n fmt.Println(pow(m, 2))\n }\n return\n}\n\nfunc pow(int64 a, int64 b) int64 {\n var ans int64 = 1\n for; b > 0; b-- {\n ans = ans * a % mod\n }\n return ans\n}", "lang": "Go", "bug_code_uid": "a68dc1f5f16d4c34d6c5464dc44c7737", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "eacac8348050a42b6a19fb3b02f2744b", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9663526244952894, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tvar a int\n\t\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&k)\n\t\n\tmini := k\n\tmaxi := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanln(&a)\n\t\tmini = mini + a\n\t\tmaxi = int(math.Max(float64(maxi), float64(a)))\n\t}\n\t\n\tmini = int(math.Ceil(float64(mini) / float64(n)))\n\tmaxi = maxi + k\n\t\n\tfmt.Println(mini, maxi)\n}", "lang": "Go", "bug_code_uid": "6d81e4e57ee73029fd1b947794ee4da4", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "29348f3184eda8600509ec9c5bfce6b9", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9991197183098591, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tinput := bufio.NewScanner(os.Stdin)\n\thasInput := input.Scan()\n\tif hasInput == false {\n\t\tpanic(\"Number of problems missing\")\n\t}\n\n\ttmp := strings.Split(input.Text(), \" \")\n\tnumbers := []int{}\n\n\tfor _, v := range tmp {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(\"Something went wrong when processing first line\")\n\t\t}\n\n\t\tnumbers = append(numbers, n)\n\t}\n\n\tif len(numbers) != 2 {\n\t\tpanic(\"It has to be exactly 2 numbers in first line!! \")\n\t}\n\n\tscores := []int{}\n\n\tfor input.Scan() {\n\t\ts := strings.Split(input.Text(), \" \")\n\n\t\tfor _, v := range s {\n\t\t\tn, err := strconv.Atoi(v)\n\n\t\t\tif err != nil {\n\t\t\t\tpanic(\"Something went wrong with number processing shutting down!! :<\")\n\t\t\t}\n\n\t\t\tscores = append(scores, n)\n\t\t}\n\t}\n\n\tfmt.Println(noOfNextRoundParticipants(numbers[0], numbers[1], scores))\n\n}\n\nfunc noOfNextRoundParticipants(participantsNo, scoreNo int, scores []int) int {\n\tbase := scores[scoreNo]\n\n\tnextParticipants := 0\n\n\tfor _, v := range scores {\n\t\tif v == 0 || base > v {\n\t\t\tcontinue\n\t\t}\n\n\t\tnextParticipants++\n\t}\n\n\treturn nextParticipants\n}", "lang": "Go", "bug_code_uid": "61265bb5e927188cd67d3cf2a5bb8d51", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "4ab34e54574ab0ef912829e44ec227cd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.45095541401273886, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc covToIntSli(sli []string) []int {\n\tvar res []int\n\tfor _, v := range sli {\n\t\ti, _ := strconv.Atoi(v)\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\n\tscores := covToIntSli(strings.Split(scanner.Text(), \" \"))\n\n\tcnt := 0\n\tfor i := 0; i < n; i++ {\n\t\tif scores[i] >= scores[k] && scores[i] > 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n", "lang": "Go", "bug_code_uid": "4e45e6b1fea1bd7eba7833f732352328", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "7151cac16299ab4fb6a019d95805ea23", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9457831325301205, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tvar s int\n\tvar scores []int\n\tfor j := 0; j < n; j++ {\n\t\tfmt.Scanf(\"%d\\n\", &s)\n\t\tscores = append(scores, s)\n\t}\n\tnum := 0\n\tm--\n\tt := scores[m]\n\tfor j =0; j= t {\n\t\t\tnum++\n\t\t}\n \n\t}\n\tfmt.Println(num)\n}", "lang": "Go", "bug_code_uid": "2f793a9da485f61ab9781808b8ce47db", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c3b0e5ff18361d9110ead500ac14bdac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6930091185410334, "equal_cnt": 26, "replace_cnt": 17, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 25, "bug_source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var n, m int\n fmt.Scanf(\"%d\\n\", &n)\n var s int\n var scores []int\n for j := 0; j=t){num++}\n \n }\n fmt.Println(num)\n}", "lang": "Go", "bug_code_uid": "8019c5f34887c5498338a43fe5d92e25", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c3b0e5ff18361d9110ead500ac14bdac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.979381443298969, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, s, result int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\tscores := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\",&scores[i])\n\t}\n\tfor _, v := range scores {\n\t\tif v < scores[k-1] || v < 0 {\n\t\t\tbreak\n\t\t}\n\t\tresult++\n\t}\n\tfmt.Println(result)\n}", "lang": "Go", "bug_code_uid": "d2f1b46baf907db53753e365ed30e376", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "08a3393a8635503cc002b51d0dd21b3a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9973890339425587, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\n\tvar participants []int = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &participants[i])\n\t}\n\n\tvar kthScore int = participants[k]\n\n\tvar count int = 0\n\n\tfor _, element := range participants {\n\t\tif element >= kthScore && (element != 0) {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "822d91687224d69d3a367f0d48cd61d2", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "55f140d9912ed6bd8bb0793c4162bc67", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9985207100591716, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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\treader := bufio.NewReaderSize(os.Stdin, 1024 * 1024)\n\tvar n, k int\n\tfmt.Sscanf(readLine(reader), \"%d %d\", &n, &k)\n\tout := strings.Split(readLine(reader), \" \")\n\tints := make([]int, len(out))\n\n\tfor i, s := range out {\n\t\tints[i], _ = strconv.Atoi(s)\n\t}\n\tres := 0\n\tfor _, i := range ints {\n\t\tif i >= ints[k] && i > 0 {\n\t\t\tres += 1\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "1dbcb7ea3e609155484ca5afc94aba95", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "97758d4756441a838fd27566f60717a7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7408152994464016, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc PrintInts(ints ...int) {\n for _, value := range ints {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n }\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n \n var total_count, position int = ReadInt32(), ReadInt32()\n \n rating := []int{}\n for i:=0; i< total_count; i++ {\n rating = append(rating, ReadInt32())\n }\n \n if rating[position] <= 0 {\n position = 0\n } else {\n position -= 1\n }\n\n i:=0\n for position < total_count-1 && rating[position] == rating[position+1] && rating[position] > 0 {\n \n position += 1\n i += 1\n \n \n }\n\n if rating[0] > 0 { position += 1 }\n\n PrintInts(position); \n}", "lang": "Go", "bug_code_uid": "41098c10345e4272bd2f28e6b841600e", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "b941cb4cb1b6ec948a9e94597a96aa0c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.996309963099631, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, summ int\n\n\tfmt.Scan(&n, &k)\n\n\tmass := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&mass[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif mass[i] > 0 && mass[i] >= mass[k] {\n\t\t\tsumm++\n\t\t}\n\t}\n\n\tfmt.Println(summ)\n\n}\n", "lang": "Go", "bug_code_uid": "572a87bb59589a480721b7c0c9411a00", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "f03ee19e35bfb1ac7309f026567146b2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9974489795918368, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/*\n Next Round\n Tags : Implementation\n http://codeforces.com/problemset/problem/158/A\n*/\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, cant_passed int\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&array[i])\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif array[i] > 0 && array[i] >= array[k] {\n\t\t\tcant_passed++\n\t\t}\n\t}\n\tfmt.Println(cant_passed)\n}\n", "lang": "Go", "bug_code_uid": "b1314cfbf3db7d54b3e533e9418f833e", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "d219cd5012b6df734998bb4b893c7cde", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9967845659163987, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, l, cnt, b int\n\tfmt.Scanln(&n, &k)\n\t//fmt.Scanln(&buf)\n\tbuf := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&b)\n\t\tbuf[i] = b\n\t}\n\tl = buf[k]\n\tfor i := 0; i < n; i++ {\n\t\tif buf[i] < l || buf[i] == 0 {\n\t\t\tbreak\n\t\t}\n\t\tcnt += 1\n\t}\n\tfmt.Println(cnt)\n}\n", "lang": "Go", "bug_code_uid": "283a44fed3d834bf5e1ca53ceda83c92", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "872a1fe05cbd31f1d76fe3fbb94a6c37", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8195121951219512, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n uint64\n\tfor I(&n) == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n uint64) {\n\tvar k, o, ans uint64\n\tI(&k)\n\tfor i := uint64(1); i <= n/2; i++ {\n\t\tif n%i == 0 {\n\t\t\tans++\n\t\t\tif ans == k {\n\t\t\t\to = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif ans != k {\n\t\tO(-1, \"\\n\")\n\t} else {\n\t\tO(o, \"\\n\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "67816262f2d8fcd4d7b6df18eb7fe7b4", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "8abeebf8d0b7150ff870138e51c13eb4", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8346268656716418, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n uint64\n\tfor I(&n) == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n uint64) {\n\tvar k, o, ans uint64\n\tI(&k)\n\tfor i := uint64(1); i <= n/2; i++ {\n\t\tif n%i == 0 {\n\t\t\tans++\n\t\t\tif ans == k {\n\t\t\t\to = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif ans+1 == k {\n\t\tans++\n\t\to = n\n\t}\n\tif ans < k {\n\t\tO(-1, \"\\n\")\n\t} else {\n\t\tO(o, \"\\n\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "795d80f95c1eda62c570715193ea8f68", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "8abeebf8d0b7150ff870138e51c13eb4", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8639294197488971, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tk := readInt64() - 1\n\tres := make([]int64, 0)\n\td := int64(2)\n\tfor n >= d {\n\t\tfor n%d == 0 {\n\t\t\tres = append(res, d)\n\t\t\tn /= d\n\t\t}\n\t\td++\n\t}\n\n\tvisited := map[int64]bool{}\n\tarr := []int64{1}\n\tfor i := 0; i < len(res); i++ {\n\t\ttotal := int64(1)\n\t\tfor j := i; j < len(res); j++ {\n\t\t\ttotal *= res[j]\n\t\t\tif _, ok := visited[total]; !ok {\n\t\t\t\tvisited[total] = true\n\t\t\t\tarr = append(arr, total)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(int64arr(arr))\n\tif int(k) < len(arr) {\n\t\tfmt.Println(arr[k])\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\ntype int64arr []int64\n\nfunc (a int64arr) Len() int { return len(a) }\nfunc (a int64arr) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a int64arr) Less(i, j int) bool { return a[i] < a[j] }\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "e86036c1edc927095c3fe3be86746b5e", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "82113e0e4735afb09c3c6f9a9c6b57cd", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8767788962165914, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tk := readInt64() - 1\n\tres := map[int64]int{}\n\td := int64(2)\n\tfor n >= d {\n\t\tfor n%d == 0 {\n\t\t\taddres := []int64{}\n\t\t\tfor i, _ := range res {\n\t\t\t\taddres = append(addres, i*d)\n\t\t\t}\n\t\t\tfor _, t := range addres {\n\t\t\t\tres[t]++\n\t\t\t}\n\t\t\tres[d]++\n\t\t\tn /= d\n\t\t}\n\t\td++\n\t}\n\tarr := []int64{1}\n\tfor i, _ := range res {\n\t\tarr = append(arr, i)\n\t}\n\tsort.Sort(int64arr(arr))\n\tif int(k) < len(arr) {\n\t\tfmt.Println(arr[k])\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\ntype int64arr []int64\n\nfunc (a int64arr) Len() int { return len(a) }\nfunc (a int64arr) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a int64arr) Less(i, j int) bool { return a[i] < a[j] }\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "94df9726e15859190eca352e5271a1f8", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "82113e0e4735afb09c3c6f9a9c6b57cd", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9690385659967409, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n x, o := getI(), getI()\n xPairs := x/2\n if xPairs > o {\n xPairs = o\n }\n x -= 2*xPairs\n o -= xPairs\n oFours := o/3\n if oFours > xPairs {\n oFours = xPairs\n }\n xPairs -= oFours\n o -= 3*oFours\n teams := xPairs + 2*oFours\n if x > 0 && o > 1 {\n x--\n o -= 2\n teams++\n }\n writer.WriteString(fmt.Sprintf(\"%d %d\\n\", x, o))\n writer.WriteString(fmt.Sprintf(\"%d\\n\", teams))\n}\n", "lang": "Go", "bug_code_uid": "d1975d055a4cdad1ebf93e28ae2fec75", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "0ff86f48463148e528eaceef605c31f0", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9903743315508021, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //io\n scanner := bufio.NewReader(os.Stdin)\n writer := bufio.NewWriter(os.Stdout)\n //---\n var a, b, ans int\n fmt.Fscan(scanner, &a, &b)\n if a > b {\n a, b = b, a\n }\n \n for a > 0 {\n a--\n b -= 2\n ans++\n if a > b {\n a, b = b, a\n }\n }\n writer.WriteString(strconv.Itoa(ans))\n writer.Flush()\n}", "lang": "Go", "bug_code_uid": "c36533de18b8be22711e9e3a022696b5", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "b1c7b845c0775e5e5e3ad613b3d632f0", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.999083409715857, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\nfunc getLine2Int() (n int) {\n\tscanf(\"%d\\n\", &n)\n\treturn\n}\nfunc getLine2Int2() (a, b int) {\n\tscanf(\"%d %d\\n\", &a, &b)\n\treturn\n}\nfunc getLine2Ints(n int) []int {\n\tans := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d \", &ans[i])\n\t}\n\tscanf(\"%d\\n\", &ans[n-1])\n\treturn ans\n}\n\nfunc pcheck(i bool) {\n\tif i {\n\t\tprintf(\"Yes\\n\")\n\t} else {\n\t\tprintf(\"No\\n\")\n\t}\n}\n\nvar debug = true\n\nfunc see(a interface{}) {\n\tif debug {\n\t\tprintf(\"DEBUG:%v\\n\", a)\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tn, m := getLine2Int2()\n\tvar x int\n\tif n*2 < m {\n\t\tx = n\n\t} else if m*2 < n {\n\t\tx = m\n\t} else {\n\t\tx = (m + n) / 2\n\t}\n\tprintf(\"%d\\n\", x)\n}\n", "lang": "Go", "bug_code_uid": "46462e079bf5b8c82dd16d8852b3761c", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "fbf9238202a9f016ff192bb4e0710314", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.855, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "// 92A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tm %= (n * (n + 1) / 2)\n\tx := (math.Sqrt(float64(8*m+1)) - 1) / 2.0\n\tc := float64(m) - x*(x+1)/2\n\tfmt.Print(c)\n}\n", "lang": "Go", "bug_code_uid": "25df0e268e10aab2260118411fabce39", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "178440e182d2990256e9c61dbb25499f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9983579638752053, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tsums := make([]int, n+1, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tsums[i] = i + sums[i-1]\n\t}\n\n\tif m > sums[n] {\n\t\tm %= sums[n]\n\t}\n\n\tfor i := 1; i <= n; i++ {\n\t\tif m < sums[i] {\n\t\t\tm -= sums[i-1]\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(m)\n}\n", "lang": "Go", "bug_code_uid": "cbc02ada1377ac21112bf9a599925810", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "a5ec065f813a7809dfa637b60b0fd8c2", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.517814726840855, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "// 92A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, m, k, sum int\n fmt.Scan(&n, &m)\n for i := 1; i <= n; i++ {\n sum += i\n }\n m -= sum\n if m > 0 {\n for m > 0 && m > k {\n k = 1\n m -= k\n k++\n }\n } else {\n m = int(math.Abs(float64(m)))\n k = n\n for m > 0 {\n m -= k\n k--\n }\n m = int(math.Abs(float64(m)))\n }\n fmt.Println(m)\n}\n", "lang": "Go", "bug_code_uid": "11bece78c481bfdd03684f0c20cf066c", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "e423d57708b462d51aad7ac712632597", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9354838709677419, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tfor i := 1; m-i >= 0; i++ {\n\t\tm = i - m\n\t\tif i == n {\n\t\t\ti = 0\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "da7045077b40a228ee22e9d537d978c7", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "d12da7addd81437580f48c5452837283", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9831223628691983, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc fillBigCell(x int, y int, board [][]rune) int {\n\tcount := 0\n\tfor i := x * 3; i < x*3+3; i++ {\n\t\tfor j := y * 3; j < y*3+3; j++ {\n\t\t\tcoox, cooy := i+x, j+y\n\t\t\tif board[coox][cooy] == '.' {\n\t\t\t\tboard[coox][cooy] = '!'\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn count\n}\n\nfunc main() {\n\tboard := make([][]rune, 11)\n\tfor i := 0; i < 11; i++ {\n\t\tboard[i] = make([]rune, 11)\n\n\t\tif i != 3 && i != 7 {\n\t\t\tfor j := 0; j < 11; j++ {\n\t\t\t\tfmt.Scanf(\"%c\", &board[i][j])\n\t\t\t}\n\t\t}\n\t\tfmt.Scanf(\"\\n\")\n\t}\n\tvar lastX, lastY int\n\tfmt.Scanf(\"%d%d\", &lastX, &lastY)\n\n\tbigCellX := (lastX - 1) % 3\n\tbigCellY := (lastY - 1) % 3\n\n\tcount := fillBigCell(bigCellX, bigCellY, board)\n\tif count == 0 {\n\t\tfor i := 0; i < 11; i++ {\n\t\t\tfor j := 0; j < 11; j++ {\n\t\t\t\tif board[i][j] == '.' {\n\t\t\t\t\tboard[i][j] = '!'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < 11; i++ {\n\t\tfor j := 0; j < 11; j++ {\n\t\t\tfmt.Printf(\"%c\", board[i][j])\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "lang": "Go", "bug_code_uid": "e322699fb9de98ebd6ec9264403aa89a", "src_uid": "8f0fad22f629332868c39969492264d3", "apr_id": "b5217d5e6c2ba203ce9f5f2f9dbd4249", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9991742361684558, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, B int\n\tfmt.Scanf(\"%d %d\\n\", &n, &B)\n\n\tlist := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tvar cuts []int\n\n\todd := 0\n\teven := 0\n\tfor i := 0; i < n; i++ {\n\t\tif odd > 0 && even > 0 && odd == even {\n\t\t\tcuts = append(cuts, (int)(math.Abs((float64)(list[i]-list[i-1]))))\n\t\t\todd = 0\n\t\t\teven = 0\n\t\t}\n\n\t\tif list[i]%2 == 0 {\n\t\t\teven++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tsort.Ints(cuts)\n\tcost := 0\n\tcount := 0\n\tfor i := 0; i < len(cuts); i++ {\n\t\tcost += cuts[i]\n\n\t\tif cost >= B {\n\t\t\tbreak\n\t\t}\n\n\t\tcount++\n\t}\n\n\tfmt.Println(count)\n}", "lang": "Go", "bug_code_uid": "9cd6a67380be86db214c8d13b8db02a8", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e", "apr_id": "1353331378e26dd9ce35391d0abf5b8f", "difficulty": 1200, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9634015069967707, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tN := io.NextLong()\n\tK := io.NextLong()\n\t\n\tif smallestDivisor(N) <= K {\n\t io.Println(\"No\")\n\t} else {\n\t io.Println(\"Yes\")\n\t}\n}\n\nfunc smallestDivisor(n int64) int64 {\n if n % 2 == 0 {\n return 2\n }\n for d := int64(3); d * d <= n; d += 2 {\n if n % d == 0 {\n return d\n }\n }\n return n\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}", "lang": "Go", "bug_code_uid": "9e76ecb308e94b13d796372444fda2a7", "src_uid": "5271c707c9c72ef021a0baf762bf3eb2", "apr_id": "a9df824afd043a34c7522748fa484869", "difficulty": 1600, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9991850040749797, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\ntype Pair struct {\n a, b int\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\nfunc main(){\n var n int\n fmt.Scanln(&n)\n arr := make([]int, n)\n\n for i:=0; i < n; i++ {\n fmt.Scan(&arr[i])\n }\n\n pair := Pair{0, 101}\n for i:=0; i < n-2; i++ {\n if arr[i+2] - arr[i] < pair.b {\n pair.b = arr[i+2] - arr[i]\n pair.a = i+1\n }\n }\n\n arr = append(arr[:pair.a], arr[pair.a+1:]...)\n res := 0\n for i:=1; i < n-1; i++ {\n res = max(res, arr[i]-arr[i-1])\n }\n\n fmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "bb8fba9e3fea1e53ea4ae44724297bc2", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "dcc1c969a8529fa6f5d4a7b9b7de8711", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7388781431334622, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var total int\n \n var n, a int\n fmt.Scan(&n, &a)\n \n city := make([]int, n)\n for i:=0; i= 0 && b < n-1 {\n if city[f] == 1 && city[b] == 1 {\n total += 2\n if f == b {\n total--\n }\n }\n }\n fmt.Print(total)\n}", "lang": "Go", "bug_code_uid": "6a7acbbdb2aa719afdf21e6c4dfa1a68", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "f5b7bb59ad7d31cbc630ccf296f7b53f", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7863894139886578, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var total int\n \n var n, a int\n fmt.Scan(&n, &a)\n \n city := make([]int, n)\n for i:=0; i= 0 && b < n-1 {\n if city[f] == 1 && city[b] == 1 {\n total += 2\n if f == b {\n total--\n }\n }\n f--\n b++\n }\n fmt.Print(total)\n}", "lang": "Go", "bug_code_uid": "b536d7eebecd9d9e237a8bcae64069ee", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "f5b7bb59ad7d31cbc630ccf296f7b53f", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8345784418356457, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar bulbs string\n\tfmt.Scanln(&bulbs)\n\n\tr, b, y, g := 0, 0, 0, 0\n\n\tlen_bulbs := len(bulbs)\n\n\tfor i := 0; i < len_bulbs; i++ {\n\t\tif bulbs[i] == '!' {\n\t\t\tfor j := i % 4; j < len_bulbs; j = j + 4 {\n\t\t\t\tswitch bulbs[j] {\n\t\t\t\t\tcase 'R':\n\t\t\t\t\t\tr++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'B':\n\t\t\t\t\t\tb++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'Y':\n\t\t\t\t\t\ty++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'G':\n\t\t\t\t\t\tg++\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(r, b, y, g)\n}\n", "lang": "Go", "bug_code_uid": "3a73fdce51aaeb70ffd9e571c6b8cbe9", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "a2a7b55671f4b5d383cfec535a876f62", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.49504950495049505, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a,b int64) int64 { if a > b { return a } else { return b } }\n\nfunc main() {\n var a,b int64\n fmt.Scan(&a,&b)\n fmt.Println(max(a,b))\n}\n", "lang": "Go", "bug_code_uid": "eaa21f9700c9379cf57f866415a4d36e", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "a6bdd26857b5090bf95ef17180bd7b53", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9894179894179894, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// 343A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, ans int64\n\tans = 0\n\tfmt.Scan(&a, &b)\n\tfor b != 0 {\n\t\tans += a / b\n\t\ta %= b\n\t\tc = a\n\t\tb = a\n\t\tb = c\n\t}\n\tfmt.Print(ans)\n}\n", "lang": "Go", "bug_code_uid": "9e6e589e192b547a9c4dd3fc48e38a18", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "4247262317c5f6c55f34edb78e798719", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3935483870967742, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\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 f(a, b int64) int64 {\n\tif a == 0 {\n\t\treturn 0\n\t}\n\tif b == 1 {\n\t\treturn a\n\t}\n\tif a == b - 1 {\n\t\treturn 1 + f(a, 1)\n\t}\n\tg := gcd(a%b, b)\n\treturn a/b + f(a%b/g, b/g)\n}\n\nfunc main() {\n\tvar a, b int64\n\tfmt.Scan(&a, &b)\n\tfmt.Println(f(a,b))\n}\n", "lang": "Go", "bug_code_uid": "6f95bd5c821c4084b5841c278a529cc2", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "e50e0b73dc281de61efe6b21eb7109a0", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3777403035413153, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\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 f(a, b int64) int64 {\n\tif a == 0 {\n\t\treturn 0\n\t}\n\tt := (b-1) / a + a\n\treturn t\n}\n\nfunc main() {\n\tvar a, b int64\n\tfmt.Scan(&a, &b)\n\tcount := a/b\n\tg := gcd(a%b, b)\n\tcount += f((a%b)/g, b/g)\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "ea7b98ffd1e2840e61bebc063701fb8c", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "e50e0b73dc281de61efe6b21eb7109a0", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9893899204244032, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n for {\n d := n%10\n if d < 5 { fmt.Print(\"0-|\") } else { fmt.Print(\"-0|\") }\n d %= 5\n for i := 0; i < d; i++ { fmt.Print(\"0\") }\n fmt.Print(\"-\")\n for i := d; i < 4; i++ { fmt.Print(\"0\") }\n fmt.Println()\n n /= 10\n if n == 0 { break }\n }\n}\n", "lang": "Go", "bug_code_uid": "b7cf81ed0fbddd5882921875c7127885", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "546d68504dc788ad3ed3dc34d58df0ee", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9988331388564761, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var zero2four = [5]string{\"-OOOO\", \"O-OOO\", \"OO-OO\", \"OOO-O\", \"OOOO-\"}\n var num int\n fmt.Scan(&num)\n if num == 0 {\n fmt.Printf(\"O-|\" + zero2four[0])\n } else {\n for num != 0 {\n var div int = num % 10\n if div > 5 {\n fmt.Print(\"-O|\")\n } else {\n fmt.Print(\"O-|\")\n }\n fmt.Printf(\"%s\\n\", zero2four[div % 5])\n num /= 10\n }\n }\n}", "lang": "Go", "bug_code_uid": "06dc67a7c4dbf982276882f74135a52f", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "f259104645393e624f49f37bdca8f2d3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.891566265060241, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar output map[int]string = map[int]string{\n\t0: \"O-|-OOOO\",\n\t1: \"O-|O-OOO\",\n\t2: \"O-|OO-OO\",\n\t3: \"O-|OOO-O\",\n\t4: \"O-|OOOO-\",\n\t5: \"-O|-OOOO\",\n\t6: \"-O|O-OOO\",\n\t7: \"-O|OO-OO\",\n\t8: \"-O|OOO-O\",\n\t9: \"-O|OOOO-\",\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor n > 0 {\n\t\tfmt.Println(output[n%10])\n\t\tn /= 10\n\t}\n}", "lang": "Go", "bug_code_uid": "db1543c79fad9651de267b62017ad892", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "f3e5728300ddc523c0c0eb29ab066916", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9355432780847146, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, t int\n\tfmt.Scan(&n)\n\n\tfor i:=0;i= 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", "lang": "Go", "bug_code_uid": "3be4a42537c978bb7111d10adec14a6e", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "d52dc04b9921495540e2b45ed4a36e5f", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.945273631840796, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// 337B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(m, n int) int {\n\tvar x int\n\tfor n != 0 {\n\t\tx = n\n\t\tn = m % n\n\t\tm = x\n\t}\n\treturn m\n}\nfunc main() {\n\tvar a, b, c, d, e, j, k, l int\n\tfmt.Scan(&a, &b, &c, &d)\n\tj = a * d\n\tk = b * c\n\tif j >= k {\n\t\te = j - k\n\t\tl = gcd(e, j)\n\t\te /= l\n\t\tj /= l\n\t\tfmt.Println(e, \"/\", j)\n\t} else {\n\t\te = k - j\n\t\tl = gcd(e, k)\n\t\te /= l\n\t\tk /= l\n\t\tfmt.Println(e, \"/\", k)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "53490f7d11d025e91c3a523ccbce0d55", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "cf528972ad162297464f3bd0e3ca15e6", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6929392446633826, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, count0 int\n\tvar s string\n\tfmt.Scanf(\"%d\\n\", &a)\n\tfmt.Scanf(\"%s\\n\", &s)\n\tfor _, v := range s{\n\t\tif v == '0'{\n\t\t\tcount0++\n\t\t}\n\t}\n\tvar ss = \"1\"\n\tfor i:=0;i 0; i-- {\n\t// \tfor j := n - 1; j > 0; j-- {\n\t// \t\tif s[j] == '0' {\n\t// \t\t\ts[j], s[j-1] = s[j-1], s[j]\n\t// \t\t}\n\t// \t}\n\t// }\n\n\tif cnt == 0 {\n\t\tfmt.Println(\"0\")\n\n\t\treturn\n\t}\n\n\tres := \"\"\n\tfor i := 0; i < cnt; i++ {\n\t\tres += \"1\"\n\t}\n\n\tfor i := 0; i < zeroes; i++ {\n\t\tres += \"0\"\n\t}\n\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "e17f5cea4e121cecfabacf2f0699b258", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "1532404d5b90dc58b1d1c81ad01fc864", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9894606323620583, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar res []int\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tk, _ := strconv.Atoi(scanner.Text())\n\n\tsolve(n, k)\n\tif len(res) == 0 {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tcheck := 1\n\tfor _, el := range res {\n\t\tcheck *= el\n\t}\n\tif check != n {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tfor i, el := range res {\n\t\tif i == len(res)-1 {\n\t\t\tfmt.Printf(\"%d\\n\", el)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"%d \", el)\n\t}\n}\n\nfunc solve(n, k int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\tif k == 1 {\n\t\tres = append(res, n)\n\t\treturn\n\t}\n\tfor i := 2; i <= int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tsolve(n/i, k-1)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f4336108e469fb77e3e4bc8b36d1c33f", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "40e1c7a3220328aabe83ec14a26adb7b", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9626307922272048, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tboard := make([]string, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tboard[i], _ = reader.ReadString('\\n')\n\t}\n\tfmt.Println(solve(board))\n}\n\nfunc solve(board []string) string {\n\tcnt := make([]int, 2)\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tif board[i][j] == 'X' {\n\t\t\t\tcnt[0]++\n\t\t\t} else if board[i][j] == '0' {\n\t\t\t\tcnt[1]++\n\t\t\t}\n\t\t}\n\t}\n\n\tif cnt[1] > cnt[0] || cnt[0]-cnt[1] > 1 {\n\t\treturn \"illegal\"\n\t}\n\n\twin := func(x byte) bool {\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tvar ok = true\n\t\t\tfor j := 0; j < 3 && ok; j++ {\n\t\t\t\tok = board[i][j] == x\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tvar ok = true\n\t\t\tfor i := 0; i < 3 && ok; i++ {\n\t\t\t\tok = board[i][j] == x\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tif board[0][0] == x && board[1][1] == x && board[2][2] == x {\n\t\t\treturn true\n\t\t}\n\t\tif board[0][2] == x && board[1][1] == x && board[2][0] == x {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\ta := win('X')\n\tb := win('0')\n\tif a && b {\n\t\treturn \"illegal\"\n\t}\n\t// determine win next\n\tif a {\n\t\treturn \"the first player won\"\n\t}\n\tif b {\n\t\treturn \"the second player won\"\n\t}\n\tif cnt[0]+cnt[1] == 9 {\n\t\treturn \"draw\"\n\t}\n\tif cnt[0] > cnt[1] {\n\t\treturn \"second\"\n\t}\n\treturn \"first\"\n}\n", "lang": "Go", "bug_code_uid": "0622933a0f0d9694007215ac36c3cb80", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "bf6ed77b9e5c0ea115d5ed12d1f35efb", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9709483793517407, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar board string;\n\t\n\twinner := byte('.')\n\t\n\tfor i := 0; i < 3; i++ {\n\t\tvar line string;\n\t\tnargs, err := fmt.Scan(&line);\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif nargs != 1 {\n\t\t\tlog.Fatal(\"narg!\", nargs)\n\t\t}\n\n\t\tboard += line;\n\t}\n\n\tvar num_os, num_xs, num_empty int;\n\n\tfor _, c := range(board) {\n\t\tswitch c {\n\t\tcase 'X':\n\t\t\tnum_xs++;\n\t\t\tbreak;\n\t\tcase '0':\n\t\t\tnum_os++;\n\t\t\tbreak;\n\t\tcase '.':\n\t\t\tnum_empty++;\n\t\t\tbreak;\n\t\t}\n\t}\n\tdiff := num_xs - num_os\n\tif diff < 0 || diff > 1 {\n\t\tfmt.Println(\"illegal\");\n\t\treturn\n\t}\n\n\tfor i := 0; i < 3; i++ {\n\t\tif get(board, i, 0) != '.' &&\n\t\t\tget(board, i, 0) == get(board, i, 1) &&\n\t\t\tget(board, i, 1) == get(board, i, 2) {\n\t\t\tif winner == '.' || winner == get(board, i, 0) {\n\t\t\t\twinner = get(board, i, 0);\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"illegal\");\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor i := 0; i < 3; i++ {\n\t\tif get(board, 0, i) != '.' &&\n\t\t\tget(board, 0, i) == get(board, 1, i) &&\n\t\t\tget(board, 1, i) == get(board, 2, i) {\n\t\t\tif winner == '.' || winner == get(board, 0, i) {\n\t\t\t\twinner = get(board, 0, i);\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"illegal\");\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tif get(board, 0, 0) != '.' &&\n\t\tget(board, 0, 0) == get(board, 1, 1) &&\n\t\tget(board, 1, 1) == get(board, 2, 2) {\n\t\tif winner == '.' || winner == get(board, 0, 0) {\n\t\t\twinner = get(board, 0, 0);\n\t\t} else {\n\t\t\tfmt.Println(\"illegal\");\n\t\t\treturn\n\t\t}\n\t}\n\t\n\tif get(board, 2, 0) != '.' &&\n\t\tget(board, 2, 0) == get(board, 1, 1) &&\n\t\tget(board, 1, 1) == get(board, 0, 2) {\n\t\tif winner == '.' || winner == get(board, 2, 0) {\n\t\t\twinner = get(board, 2, 0);\n\t\t} else {\n\t\t\tfmt.Println(\"illegal\");\n\t\t\treturn\n\t\t}\n\t}\n\n\tif winner == 'X' {\n\t\tfmt.Println(\"the first player won\");\n\t\treturn;\n\t}\n\t\n\tif winner == '0' {\n\t\tfmt.Println(\"the second player won\");\n\t\treturn\n\t}\n\n\tif num_empty == 0 {\n\t\tfmt.Println(\"draw\");\n\t\treturn\n\t}\n\n\tif diff == 0 {\n\t\tfmt.Println(\"first\");\n\t\treturn\n\t}\n\tfmt.Println(\"second\")\n}\n\nfunc get(board string, x int, y int) byte {\n\treturn board[x * 3 + y]\n}\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Go", "bug_code_uid": "082e8c9048655312c6874f9b406bebf9", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "5fc1e1eec76f8f78fd799d51756f3e8a", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8590604026845637, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nvar grid = make([][]byte, 3)\n\nfunc isLine(r, c, dr, dc int, ch byte) int {\n for i := 0; i < 3; i++ {\n if grid[r+i*dr][c+i*dc] != ch {\n return 0\n }\n }\n return 1\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n xCount, oCount := 0, 0\n for i := range grid {\n grid[i] = []byte(getS())\n for j, ch := range grid[i] {\n if ch == 'X' {\n xCount++\n grid[i][j] = 'x'\n } else if ch == '0' {\n oCount++\n grid[i][j] = 'o'\n }\n }\n }\n diff := xCount - oCount\n if diff < 0 || diff > 1 {\n writer.WriteString(\"illegal\\n\")\n return\n }\n xLines, oLines := 0, 0\n for i := 0; i < 3; i++ {\n xLines += isLine(0, i, 1, 0, 'x')\n xLines += isLine(i, 0, 0, 1, 'x')\n oLines += isLine(0, i, 1, 0, 'o')\n oLines += isLine(i, 0, 0, 1, 'o')\n }\n xLines += isLine(0, 0, 1, 1, 'x')\n xLines += isLine(0, 2, 1, -1, 'x')\n oLines += isLine(0, 0, 1, 1, 'o')\n oLines += isLine(0, 2, 1, -1, 'o')\n if xLines > 0 && oLines > 0 {\n writer.WriteString(\"illegal\\n\")\n } else if xCount+oCount == 9 && xLines == 0 && oLines == 0 {\n writer.WriteString(\"draw\\n\")\n } else if xLines > 0 {\n writer.WriteString(\"the first player won\\n\")\n } else if oLines > 0 {\n writer.WriteString(\"the second player won\\n\")\n } else if xCount > oCount {\n writer.WriteString(\"second\\n\")\n } else {\n writer.WriteString(\"first\\n\")\n }\n}\n", "lang": "Go", "bug_code_uid": "f9aabe1b9dc69c0393b241c62ebfe28e", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "37d8ed8195cd7a1783abe37c0373ea15", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9887640449438202, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"errors\"\n)\n\nfunc main() {\n\tb := make([][]rune, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tb[i] = []rune(nextWord())\n\t}\n\txc, oc, xw, ow := 0, 0, 0, 0\n\tfor i := 0; i < 3; i++ {\n\t\tif b[i][0] == b[i][1] && b[i][1] == b[i][2] {\n\t\t\tif b[i][0] == 'X' {\n\t\t\t\txw++\n\t\t\t} else if b[i][0] == '0' {\n\t\t\t\tow++\n\t\t\t}\n\t\t}\n\t\tif b[0][i] == b[1][i] && b[1][i] == b[2][i] {\n\t\t\tif b[0][i] == 'X' {\n\t\t\t\txw++\n\t\t\t} else if b[0][i] == '0' {\n\t\t\t\tow++\n\t\t\t}\n\t\t}\n\t}\n\tif b[0][0] == b[1][1] && b[1][1] == b[2][2] {\n\t\tif b[0][0] == 'X' {\n\t\t\txw++\n\t\t} else if b[0][0] == '0' {\n\t\t\tow++\n\t\t}\n\t}\n\tif b[0][2] == b[1][1] && b[1][1] == b[2][0] {\n\t\tif b[0][2] == 'X' {\n\t\t\txw++\n\t\t} else if b[0][2] == '0' {\n\t\t\tow++\n\t\t}\n\t}\n\tfor y := 0; y < 3; y++ {\n\t\tfor x := 0; x < 3; x++ {\n\t\t\tif b[y][x] == 'X' {\n\t\t\t\txc++\n\t\t\t} else if b[y][x] == '0' {\n\t\t\t\toc++\n\t\t\t}\n\t\t}\n\t}\n\tif xc != oc && xc != oc + 1 {\n\t\tprintf(\"illegal\\n\")\n\t} else if xw > 0 && ow > 0 {\n\t\tprintf(\"illegal\\n\")\n\t} else if xw > 0 {\n\t\tprintf(\"the first player won\\n\")\n\t} else if ow > 0 {\n\t\tif xc == oc + 1 {\n\t\t\tprintf(\"illegal\\n\")\n\t\t} else {\n\t\t\tprintf(\"the second player won\\n\")\n\t\t}\n\t} else if xc + oc == 9 {\n\t\tprintf(\"draw\\n\")\n\t} else if oc == xc {\n\t\tprintf(\"first\\n\")\n\t} else {\n\t\tprintf(\"second\\n\")\n\t}\n}\n\nvar lineScanner *bufio.Scanner\nvar wordScanner *bufio.Scanner\n\nfunc init() {\n\tlineScanner = bufio.NewScanner(os.Stdin)\n\twordScanner = bufio.NewScanner(strings.NewReader(\"\"))\n\twordScanner.Split(bufio.ScanWords)\n}\nfunc printf(format string, a ...interface{}) {\n\tfmt.Printf(format, a...)\n}\nfunc nextLine() (string, error) {\n\tif !lineScanner.Scan() {\n\t\tif err := lineScanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn \"\", errors.New(\"nextLine: EOF reached\")\n\t}\n\treturn lineScanner.Text(), nil\n}\n\nfunc nextWord() string {\n\tfor !wordScanner.Scan() {\n\t\tif err := wordScanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tline, err := nextLine()\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\twordScanner = bufio.NewScanner(strings.NewReader(line))\n\t\twordScanner.Split(bufio.ScanWords)\n\t}\n\treturn wordScanner.Text()\n}\n\nfunc nextInt() int {\n\tres, err := strconv.Atoi(nextWord())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc nextInt64() int64 {\n\tres, err := strconv.ParseInt(nextWord(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc nextFloat64() float64 {\n\tres, err := strconv.ParseFloat(nextWord(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "70c1303b6fa2f8adba7e5124e11ba1c1", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "e67d08b353809dec3b27650e8e9a59cd", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.933806146572104, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nfunc main() {\n var r,g,b int\n fmt.Scan(&r,&g,&b)\n ans := min(r,min(g,b))\n r -= ans; g -= ans; b -= ans;\n ans += r/3; ans += g/3; ans += b/3\n if (ans > 0) && (((r%3 == 2) && (g%3 == 2)) || ((r%3 == 2) && (b%3 == 2)) || ((g%3 == 2) && (b%3 == 2))) {\n ans++\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "46e948efabe85c7f6e05aab84721f5b4", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "d1350a2716bfcc68c52d5fc1dcd2a955", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9783549783549783, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF322B(_r io.Reader, _w io.Writer) {\n\ta := make([]int, 3)\n\tans := 0\n\thas3 := false\n\tfor i := range a {\n\t\tFscan(_r, &a[i])\n\t\tif a[i] >= 3 {\n\t\t\thas3 = true\n\t\t}\n\t\tans += a[i] / 3\n\t\ta[i] %= 3\n\t}\n\tsort.Ints(a)\n\tif has3 && a[0] == 0 && a[1] == 2 && a[2] == 2 {\n\t\tans++\n\t} else {\n\t\tans += a[0]\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF322B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "a7450d4a26b30775499dc796d8f7992f", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "acd1e26fb30952129d79e0ae3628fd6b", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5051975051975052, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar r, g, b int\n\tfmt.Scan(&r, &g, &b)\n\tminVal := min(r, g, b)\n\tr, g, b = r-minVal, g-minVal, b-minVal\n\tfmt.Printf(\"%v\", (r/3)+(g/3)+(b/3)+minVal)\n\n}\nfunc min(a, b, c int) int {\n\tif a <= b && a <= c {\n\t\treturn a\n\t} else if b <= a && b <= c {\n\t\treturn b\n\t} else {\n\t\treturn c\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8b0b9cf99690a4169eac60334ff85b75", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "b412e4ad0808300a690df1a254f39a98", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.41767068273092367, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\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 main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tcnt := a / 3 + b / 3 + c / 3 + min(a%3, min(b%3, c%3))\n\tfmt.Println(cnt)\n}", "lang": "Go", "bug_code_uid": "1919cadb5c4f3dc96d7e53702ab9e1be", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "4734552f1a9dcf0d84adba7bd0587319", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9977426636568849, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.Atoi(r.Text())\n\ta := make([]int, 3000)\n\tcount := 0\n\tfor i:=2; i<=n; i++ {\n\t\tfor j:=2; jm{\n\t\t\tn=n-m\n\t\t}else{\n\t\t\tm=m-n\n\t\t}\n\t}\n\tres=x*y/n\n\treturn\n\n}\n\nfunc main(){\n\n\t/*a:= bufio.NewReader(os.Stdin)\n\tinput,_:= a.ReadString('\\n')\n\tn,m,z:= strings.Split(input,\" \")\n\tfmt.Println(n,m,z) */\n\n\tvar n,m,z int\n\tfmt.Scan(&n, &m, &z);\n\n\tlcm := find_lcm(n,m)\n\n\tfmt.Println(lcm)\n\n\t fmt.Println(z/lcm) \n}", "lang": "Go", "bug_code_uid": "0ed63209f103d06f747dc4cf184b7ce4", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "052df7a0be62931cb0b24c4f8b758991", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9005424954792043, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n )\n\nfunc GCD(a, b int) int {\n for b != 0 {\n a, b = b, a%b\n }\n\n return a\n}\n\nfunc getLine(s *bufio.Scanner) (int,int,int) {\n s.Scan()\n ab := strings.Fields(s.Text())\n a, _ := strconv.Atoi(ab[0])\n b, _ := strconv.Atoi(ab[1])\n c, _ := strconv.Atoi(ab[2])\n \n return a,b,c\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n n, m, z:= getLine(scanner)\n a := 0\n if GCD(n,m) == 1 {\n a = n*m\n } else {\n a = m\n }\n fmt.Println(z / a)\n}", "lang": "Go", "bug_code_uid": "f0ab1b573c0a7ffb59a3a0052ad2024a", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "00d6f2ab772d500db6e903210d5d0648", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.929159802306425, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, z int\n\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &m)\n\tfmt.Scanf(\"%d\", &z)\n\n\t// kill them all\n\tkill_count := 0\n\n\tif n == m {\n\t\tfmt.Println(z)\n\t\treturn\n\t}\n\n\tfor i := 1; i <= z; i++ {\n\t\tif (i)%m == 0 && (i)%n == 0 {\n\t\t\tkill_count += 1\n\t\t}\n\t}\n\n\tfmt.Println(kill_count)\n\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "81cf3b23607765a33a29b97721ceb5b2", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "4bfd0d8b1b17cb5a8ad83cbb0821a65c", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9825783972125436, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main(){\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tresult := 0\n\tcount := 0\n\tfor ; k != 0 && n != 0; {\n\t\tif n % 10 != 0{\n\t\t\tresult++\n\t\t} else{\n\t\t\tk--\n\t\t}\n\t\tcount++\n\t\tn /= 10\n\t}\n\tif k != 0 && n != 0{\n\t\tfmt.Println(count-1)\n\t} else{\n\t\tfmt.Println(result)\n\t}\n}\n\n\n", "lang": "Go", "bug_code_uid": "151f93575dc1fc60dd46d10eb382c0f5", "src_uid": "7a8890417aa48c2b93b559ca118853f9", "apr_id": "8855303323452d5796cabe546e46be3d", "difficulty": 1100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9658759883478985, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"fmt\"\n\t\"time\"\n\t\"log\"\n\t\"math\"\n)\n\n////////////////////////////////////////////////////////////////////////////////\n\n// INPUT TEMPLATE START\n\ntype MyInput struct {\n\trdr io.Reader\n\tlineChan chan string\n\tinitialized bool\n}\n\nfunc (mi *MyInput) start(done chan struct{}) {\n\tr := bufio.NewReader(mi.rdr)\n\tdefer func() {\n\t\tclose(mi.lineChan)\n\t}()\n\tfor {\n\t\tline, err := r.ReadString('\\n')\n\t\tif !mi.initialized {\n\t\t\tmi.initialized = true\n\t\t\tdone <- struct{}{}\n\t\t}\n\t\tmi.lineChan <- strings.TrimSpace(line)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\nfunc (mi *MyInput) readLine() string {\n\t// if this is the first call, initialize\n\tif !mi.initialized {\n\t\tmi.lineChan = make(chan string)\n\t\tdone := make(chan struct{})\n\t\tgo mi.start(done)\n\t\t<-done\n\t}\n\n\tres, ok := <-mi.lineChan\n\tif !ok {\n\t\tpanic(\"trying to read from a closed channel\")\n\t}\n\treturn res\n}\n\nfunc (mi *MyInput) readInt() int {\n\tline := mi.readLine()\n\ti, err := strconv.Atoi(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (mi *MyInput) readInt64() int64 {\n\tline := mi.readLine()\n\ti, err := strconv.ParseInt(line, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (mi *MyInput) readInts() []int {\n\tline := mi.readLine()\n\tparts := strings.Split(line, \" \")\n\tres := []int{}\n\tfor _, s := range parts {\n\t\ttmp, err := strconv.Atoi(s)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres = append(res, tmp)\n\t}\n\treturn res\n}\n\nfunc (mi *MyInput) readInt64s() []int64 {\n\tline := mi.readLine()\n\tparts := strings.Split(line, \" \")\n\tres := []int64{}\n\tfor _, s := range parts {\n\t\ttmp, err := strconv.ParseInt(s, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres = append(res, tmp)\n\t}\n\treturn res\n}\n\nfunc (mi *MyInput) readWords() []string {\n\tline := mi.readLine()\n\treturn strings.Split(line, \" \")\n}\n\n// INPUT TEMPLATE END\n\n////////////////////////////////////////////////////////////////////////////////\n\nfunc main() {\n\t/*tn := time.Now()\n\tsolve([]int64{6, 6, 4})\n\tlog.Println(time.Since(tn))\n\treturn*/\n\tmi := MyInput{rdr: os.Stdin}\n\tsolve(mi.readInt64s())\n\t/*\n\tfor caseNo := 1; caseNo <= t; caseNo++ {\n\t\t//solve(mi.readLine())\n\t\tfmt.Printf(\"Case #%d: %v\\n\", caseNo)\n\t}\n\t*/\n}\n\nfunc solve(args []int64) {\n\tw:=args[0]\n\th:=args[1]\n\tp:=args[2]\n\twc:=math.Ceil(float64(w)/float64(p))\n\thc:=math.Ceil(float64(h)/float64(p))\n\n\tfmt.Println(int(wc*hc))\n\n}\n", "lang": "Go", "bug_code_uid": "0e23599b74e66361fefcf9ef9d22053f", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "47cab8df2116fe8255e88245e9947437", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9544198895027625, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//a,b <=n && a+b==x\nfunc count(n, x int64) (ans int64) {\n\tif n >= x {\n\t\tn = x - 1\n\t}\n\tans = n - x/2\n\tif x%2 == 0 {\n\t\tans++\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tif n < 5 {\n\t\tfmt.Println(n * (n - 1) / 2)\n\t\treturn\n\t}\n\tvar ans int64\n\tvar max9 int64 = 9\n\tfor max9 < n {\n\t\tmax9 = max9*10 + 9\n\t}\n\tif max9/2+1 <= n {\n\t\tfmt.Println(count(n, max9))\n\t\treturn\n\t}\n\tsmax9 := fmt.Sprint(max9)\n\tfor i := 0; i < len(smax9); i++ {\n\t\ttmp := []byte(smax9)\n\t\tfor j := 0; j < 9; j++ {\n\t\t\ttmp[i] = byte(j) + '0'\n\t\t\tx, _ := strconv.ParseInt(string(tmp), 10, 64)\n\t\t\tans += count(n, x)\n\t\t\tfmt.Println(count(n, x), x)\n\t\t\ttmp[i] = '9'\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "8ffd3f0170e056db5a6fac813341d8c3", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "3f13da6cb4aaa4268d50e51ecd5da33d", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9888, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n\tfor _, v := range buf {\n\t\to = o*10 + int(v-'0')\n\t}\n\treturn\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\n\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t//in, _ := os.Open(\"a.txt\")\n\tvar n int64\n\tvar allNines = true\n\tfmt.Fscanf(in, \"%d\", &n)\n\tif n < 5 {\n\t\tfmt.Println(n * (n - 1) / 2)\n\t\tos.Exit(0)\n\t}\n\tsum := n + n - 1\n\tcnt := 0\n\tfor ; sum > 0; sum /= 10 {\n\t\tx := sum % 10\n\t\tif x != 9 {\n\t\t\tallNines = false\n\t\t}\n\t\tcnt++\n\t}\n\tif allNines {\n\t\tfmt.Println(1)\n\t\tos.Exit(0)\n\t}\n\tnumOfNines := cnt - 1\n\tvar deg int64 = 1\n\tfor i := 1;i <= numOfNines; i++ {\n\t\tdeg = deg * 10\n\t}\n\tmd := n % deg\n\tright := md\n\tmid := deg / 2 - 1\n\tless := n / deg\n\tmore := less + 1\n\tif right == 0 {\n\t\tfmt.Println(less * less * (mid + 1))\n\t\tos.Exit(0)\n\t}\n\tvar ans int64\n\tif right != deg - 1 {\n\t\tans = less * less\n\t} else {\n\t\tans = less * more\n\t}\n\tif right <= mid {\n\t\tans += right * more * less\n\t\tans += (mid - right) * less * less\n\t} else {\n\t\textra := right - mid - 1\n\t\tans += extra * more * more\n\t\tans += (mid - extra) * more * less\n\t}\n\tfmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "f49609a3fdf372c8f1876de3e8353f9c", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "a5153d7f68528f60a120bfa00d52bb21", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8102836879432624, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "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\treader := bufio.NewReader(os.Stdin)\n\ttestCases, _ := reader.ReadString('\\n')\n\ttestCases = strings.Replace(testCases, \"\\n\", \"\", -1)\n\ttc, _ := strconv.Atoi(testCases)\n\n\tfmt.Println(\"tc\", tc)\n\n\tfor tc > 0 {\n\t\tunits, digits := 1000, 4\n\t\tnumber, _ := reader.ReadString('\\n')\n\t\tnumber = strings.Replace(number, \"\\n\", \"\", -1)\n\t\tn, _ := strconv.Atoi(number)\n\n\t\tresult := (n % 10) * 10\n\t\tfor n/units == 0 {\n\t\t\tresult -= digits\n\t\t\tunits /= 10\n\t\t\tdigits--\n\t\t}\n\n\t\tfmt.Println(result)\n\t\ttc--\n\t}\n}\n", "lang": "Go", "bug_code_uid": "48c671adebe6818d9be87a727950f1ad", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "a1c5f6d8380c2a119749de29f7945bf2", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9978070175438597, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// -0-\n// | |\n// 1 2\n// | |\n// -3-\n// | |\n// 4 5\n// | |\n// -6-\n\nfunc main() {\n\tdigits := [10]string{\n\t\t// Index: 0654 3210\n\t\t\"01110111\", // 0\n\t\t\"00010100\", // 1\n\t\t\"01011101\", // 2\n\t\t\"01101101\", // 3\n\t\t\"00101110\", // 4\n\t\t\"01101011\", // 5\n\t\t\"01111011\", // 6\n\t\t\"00100101\", // 7\n\t\t\"01111111\", // 8\n\t\t\"01101111\", // 9\n\t}\n\n\tgood := make(map[int]map[int]bool)\n\tfor i := 0; i < 10; i++ {\n\t\tgood[i] = make(map[int]bool)\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tif i != j {\n\t\t\t\tif j_is_good_for_i(digits[i], digits[j]) {\n\t\t\t\t\tgood[i][j] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\td1 := n / 10\n\td2 := n - d1*10\n\n\tg1 := len(good[d1]) + 1\n\tg2 := len(good[d2]) + 1\n\n\tfmt.Println(g1 * g2)\n}\n\nfunc j_is_good_for_i(i, j string) bool {\n\tfor k := 0; k < 8; k++ {\n\t\tif i[k] == '1' && j[k] == '0' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "lang": "Go", "bug_code_uid": "d823ea81b9d81c2917c09abdb026e285", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "8f8f1fc197adb596af7764910b62400a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9992867332382311, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n\n\tn int\n\tresult int\n)\n\nvar x = map[int]int{\n\t0: 2,\n\t1: 7,\n\t2: 2,\n\t3: 3,\n\t4: 3,\n\t5: 3,\n\t6: 2,\n\t7: 5,\n\t8: 1,\n\t9: 2,\n}\n\nfunc in() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tn = readInt()\n}\n\nfunc out() {\n\twriter = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tprintInt(result)\n\tprintLine()\n}\n\nfunc run() {\n\tresult = x[n%10] * x[n/10]\n}\n\nfunc main() {\n\tin()\n\trun()\n\tout()\n}\n\n// Read.\n\nfunc readString() string {\n\tscanner.Scan()\n\tans := scanner.Text()\n\treturn ans\n}\n\nfunc readLine() string {\n\tscanner.Split(bufio.ScanLines)\n\tdefer scanner.Split(bufio.ScanWords)\n\treturn readString()\n}\n\nfunc readInt() int {\n\tans, _ := strconv.ParseInt(readString(), 10, 0)\n\treturn int(ans)\n}\n\nfunc readInt64() int64 {\n\tans, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn ans\n}\n\nfunc readFloat64() float64 {\n\tans, _ := strconv.ParseFloat(readString(), 64)\n\treturn ans\n}\n\n// Write.\n\nfunc printString(value string) {\n\twriter.WriteString(value)\n}\n\nfunc printLine() {\n\tprintString(\"\\n\")\n}\n\nfunc printSpace() {\n\tprintString(\" \")\n}\n\nfunc printInt(value int) {\n\tprintString(strconv.FormatInt(int64(value), 10))\n}\n\nfunc printInt64(value int64) {\n\tprintString(strconv.FormatInt(value, 10))\n}\n\nfunc printFloat64(value float64) {\n\tprintString(strconv.FormatFloat(value, 'f', 10, 64))\n}\n", "lang": "Go", "bug_code_uid": "5a8c19f95e253f879cd8f3305a31fc22", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "93c7f2510e56f864cdb3cd6a33070850", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9933373712901272, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc ParseBinary(x string) int64 {\n\tres, _ := strconv.ParseInt(x, 2, 64)\n\treturn res\n}\n\nvar mask [10]int64 = [...]int64{\n\tParseBinary(\"1111110\"), ParseBinary(\"0110000\"),\n\tParseBinary(\"1101101\"), ParseBinary(\"1111001\"),\n\tParseBinary(\"0110011\"), ParseBinary(\"1011011\"),\n\tParseBinary(\"1011111\"), ParseBinary(\"1110000\"),\n\tParseBinary(\"1111111\"), ParseBinary(\"1111011\")}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tvar n int64\n\tfmt.Fscan(reader, &n)\n\tnten := n / 10\n\tnone := n % 10\n\tcounter := 0\n\tfor i := int64(0); i < int64(100); i++ {\n\t\tten := i / 10\n\t\tone := i % 10\n\t\tif mask[ten]&mask[nten] == mask[nten] && mask[one]&mask[none] == mask[none] {\n\t\t\tcounter++\n\t\t}\n\t}\n\tfmt.Fprintln(writer, counter)\n\twriter.Flush()\n}\n", "lang": "Go", "bug_code_uid": "d73b4b48501855b283c26120aa09e427", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "ca8d8087d34c25dfaf6b1994002675a8", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9971428571428571, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tvar n string\n\tfmt.Fscan(reader, &n)\n\n\tmp := make(map[string]int)\n\tmp[\"0\"] = 2\n\tmp[\"1\"] = 5\n\tmp[\"2\"] = 2\n\tmp[\"3\"] = 3\n\tmp[\"4\"] = 3\n\tmp[\"5\"] = 4\n\tmp[\"6\"] = 2\n\tmp[\"7\"] = 5\n\tmp[\"8\"] = 1\n\tmp[\"9\"] = 2\n\n\tfmt.Println(mp[string(n[0])] * mp[string(n[1])])\n\n}\n", "lang": "Go", "bug_code_uid": "c040401f534e47bcd93076fcf64bd190", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "4f2ad7293892144371e5261b07efba4a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6666666666666666, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc verifyReallyBig(num int, minDiff int) (isReallyBig bool, diff int) {\n\tsum := 0\n\tfor n := num; n > 0; n /= 10 {\n\t\tsum += n % 10\n\t}\n\tdiff = num - sum\n\tif diff >= minDiff {\n\t\tisReallyBig = true\n\t} else {\n\t\tisReallyBig = false\n\t}\n\treturn\n}\n\nfunc searchMin(n int, s int) (min int) {\n\tvar left, right, diff int\n\tvar isReallyBig bool\n\tfor left, right, diff = 1, n/10 + 1, math.MaxInt32; right > left; {\n\t\tmin = (left + (right - left) / 2) * 10\n\t\tisReallyBig, diff = verifyReallyBig(min, s)\n\t\tif isReallyBig {\n\t\t\tright = min / 10\n\t\t} else {\n\t\t\tleft = min / 10 + 1\n\t\t}\n\t}\n\tif (diff < s) {\n\t\tmin = n + 1\n\t}\n\treturn min\n}\n\nfunc Solve(input io.Reader) (result string) {\n\tvar n, s int\n\tfmt.Fscan(input, &n, &s)\n\treturn fmt.Sprintln(n - searchMin(n, s) + 1)\n}\n\nfunc main() {\n\tfmt.Print(Solve(os.Stdin))\n}\n", "lang": "Go", "bug_code_uid": "baf3f775030e4f425e5f27dd19d54fdd", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "534aafdca8e174cd11abf465483e7aa2", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6495016611295681, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m int\n\tmod := 1000000007\n\tres := 1\n\n\tfmt.Scan(&n, &m)\n\tc := (exp(m) - 1) % mod\n\tfor i := 0; i < n; i++ {\n\t\tres = res * c % mod\n\t}\n\tfmt.Println(res)\n}\nfunc exp(x int) int {\n\treturn int(math.Exp2(float64(x)))\n}\nfunc comb(x, y int) int {\n\tm := 1\n\tn := 1\n\tfor i := 0; i < y; i++ {\n\t\tm = m * (x - i)\n\t\tn = n * (i + 1)\n\t}\n\treturn m / n\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\n\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n", "lang": "Go", "bug_code_uid": "69b1191b625f896eedbf870823f7b5a6", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "3e6b4c81924698907b9146c1ea1bb140", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5878489326765188, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "package R593_Div2_B\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar n, m int64\n\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &m)\n\n\tvar tmp big.Int\n\n\tvar t1 = tmp.Exp(big.NewInt(2), big.NewInt(m), nil);\n\tvar t2 = tmp.Sub(t1, big.NewInt(1))\n\tvar t3 = tmp.Exp(t2, big.NewInt(n), big.NewInt(1000000007))\n\n\tfmt.Print(t3)\n}\n", "lang": "Go", "bug_code_uid": "20253ea996058bd525aa81e12973c4db", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "448bf7a0c8271525575a1254747fec24", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8595890410958904, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\"fmt\"\n\"math/big\"\n)\n\nfunc main() {\n\tvar n, m int64\n\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &m)\n\n\tvar tmp big.Int\n\n\tvar t = tmp.Exp(big.NewInt(2), big.NewInt(m), nil);\n\tt = tmp.Sub(t, big.NewInt(1))\n\tt = t.Exp(t, big.NewInt(n), big.NewInt(1000000007))\n\n\tfmt.Print(t)\n}\n", "lang": "Go", "bug_code_uid": "b2c5558102356d8034722ceb01eea2f1", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "448bf7a0c8271525575a1254747fec24", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3470715835140998, "equal_cnt": 21, "replace_cnt": 8, "delete_cnt": 7, "insert_cnt": 6, "fix_ops_cnt": 21, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n)\n\n\tif n == 1 {\n\t\tprint(0)\n\t\treturn\n\t}\n\n\tcntOdd := (n + 1) / 2\n\tcntEven := n / 2\n\tvar odd, even []int\n\tlast, emptyLen := -1, 0\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x)\n\n\t\tif x == 0 {\n\t\t\temptyLen++\n\t\t\tcontinue\n\t\t}\n\n\t\tx %= 2\n\t\tif x == 1 {\n\t\t\tcntOdd--\n\t\t} else {\n\t\t\tcntEven--\n\t\t}\n\n\t\tif last != -1 && x != last {\n\t\t\tans++\n\t\t}\n\n\t\tif emptyLen > 0 {\n\t\t\tif last == -1 || last == x {\n\t\t\t\t// begin or same parity\n\t\t\t\tif x == 0 {\n\t\t\t\t\teven = append(even, emptyLen)\n\t\t\t\t} else {\n\t\t\t\t\todd = append(odd, emptyLen)\n\t\t\t\t}\n\t\t\t}\n\t\t\temptyLen = 0\n\t\t}\n\t\tlast = x\n\t}\n\n\tif last == -1 {\n\t\tprint(1)\n\t\treturn\n\t}\n\tif emptyLen > 0 {\n\t\tif last == 0 {\n\t\t\teven = append(even, emptyLen)\n\t\t} else {\n\t\t\todd = append(odd, emptyLen)\n\t\t}\n\t}\n\t// fmt.Println(\"ans\", ans, \"cntOdd\", cntOdd, \"cntEven\", cntEven)\n\t// fmt.Println(\"even\", even)\n\t// fmt.Println(\"odd\", odd)\n\tsort.Ints(even)\n\tsort.Ints(odd)\n\tans += len(even) + len(odd)\n\tfor _, x = range even {\n\t\tif x > cntEven {\n\t\t\tbreak\n\t\t}\n\t\tcntEven -= x\n\t\tans--\n\t}\n\tfor _, x = range odd {\n\t\tif x > cntOdd {\n\t\t\tbreak\n\t\t}\n\t\tcntOdd -= x\n\t\tans--\n\t}\n\tprint(ans)\n}\n", "lang": "Go", "bug_code_uid": "32a55251c3bb0e317b46a9227cd5dbbe", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "e989fa08c335cb5c80f6a98ca2f7b7da", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7359760658189978, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tconst modulo int = 1000000007\n\n\tvar n, k int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &n, &k); err != nil {\n\t\treturn\n\t}\n\n\tcs := make([][]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tcs[i] = make([]int, k+1)\n\t\tcs[i][1] = 1\n\t}\n\tfor j := 1; j <= k; j++ {\n\t\tcs[1][j] = 1\n\t}\n\n\tfor i := 2; i <= n; i++ {\n\t\tfor j := 2; j <= k; j++ {\n\t\t\tfor l := 1; l <= i; l++ {\n\t\t\t\tif i%l == 0 {\n\t\t\t\t\tcs[i][j] += cs[l][j-1]\n\t\t\t\t\tcs[i][j] %= modulo\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcnt := 0\n\tfor i := 1; i <= n; i++ {\n\t\tcnt += cs[i][k]\n\t\tcnt %= modulo\n\t}\n\tfmt.Println(cnt)\n}\n", "lang": "Go", "bug_code_uid": "024291104289c4f83d6deb29bf2cf6d9", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "8f3261f6079c6eb8737bb0f2ff493f6b", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9992337164750957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar s int\n\tfmt.Scan(&s)\n array1 := []string{\"zero\",\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"forteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"}\n\tarray2 := []string{\"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"}\n\tif 0 <= s && s <= 19 {\n\t\tfmt.Println(array1[s])\n\t} else if s == 20 || s == 30 || s == 40 || s == 50 || s == 60 || s == 70 || s == 80 || s == 90 {\n\t\tfmt.Println(array2[(s/10) - 2])\n\t} else {\n\t\tfmt.Print(array2[(s/10) - 2])\n\t\tfmt.Print(\"-\")\n\t\tfmt.Println(array1[s%10])\n\t} \n}", "lang": "Go", "bug_code_uid": "aa7f4e81646c3eb44261ce2e1c0f881d", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "d98564ff5964b8b6c96658a320fe9b6c", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9768190598840953, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tunit := []string{\"zero\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\"}\n\tten := []string{\"\", \"\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"}\n\tswitch {\n\t\tcase n >= 10 && n < 20: {\n\t\t\tswitch n {\n\t\t\t\tcase 10: println(\"ten\")\n\t\t\t\tcase 11: println(\"eleven\")\n\t\t\t\tcase 12: println(\"twelve\") \n\t\t\t\tcase 13: println(\"thirteen\")\n\t\t\t\tcase 14: println(\"fourteen\")\n\t\t\t\tcase 15: println(\"fifteen\")\n\t\t\t\tcase 16: println(\"sixteen\")\n\t\t\t\tcase 17: println(\"seventeen\")\n\t\t\t\tcase 18: println(\"eighteen\")\n\t\t\t\tcase 19: println(\"nineteen\")\n\t\t\t}\n\t\t}\n\n\t\tcase n < 10:\n\t\t\tprintln(unit[n])\n\t\tcase n >= 20:\n\t\t\tprint(ten[n/10])\n\t\t\tif n%10 != 0 {\n\t\t\t\tprint(\"-\", unit[n%10])\n\t\t\t}\n\t\t\tprintln()\n\t} \n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "c233553b8fa408b3d490e2948720be9f", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "c00d9889d3416c9fc2ed4ff71a33ebc2", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.985594237695078, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\texp := map[int]string{\n\t\t1: \"one\",\n\t\t2: \"two\",\n\t\t3: \"three\",\n\t\t4: \"four\",\n\t\t5: \"five\",\n\t\t6: \"six\",\n\t\t7: \"seven\",\n\t\t8: \"eight\",\n\t\t9: \"nine\",\n\t\t10: \"ten\",\n\t\t11: \"eleven\",\n\t\t12: \"twelve\",\n\t\t13: \"thirteen\",\n\t\t15: \"fifteen\",\n\t\t18: \"eighteen\",\n\t\t20: \"twenty\",\n\t\t30: \"thirty\",\n\t\t40: \"forty\",\n\t\t50: \"fifty\",\n\t\t80: \"eighty\",\n\t}\n\n\tvar scr int\n\tfmt.Fscan(reader, &scr)\n\tif scr == 0 {\n\t\tfmt.Println(\"zero\")\n\t\treturn\n\t}\n\tif _, exst := exp[scr]; exst {\n\t\tfmt.Println(exp[scr])\n\t\treturn\n\t}\n\n\tif scr/10 == 1 {\n\t\tfmt.Printf(\"%s%s\", exp[scr%10], \"teen\")\n\t} else {\n\t\tif _, exst := exp[(scr/10)*10]; exst {\n\t\t\tfmt.Print(exp[(scr/10)*10])\n\t\t} else {\n\t\t\tfmt.Printf(\"%s%s\", exp[scr/10], \"ty\")\n\t\t}\n\n\t\tfmt.Printf(\"-%s\", exp[scr%10])\n\t}\n}\n", "lang": "Go", "bug_code_uid": "9a0b8c653380ea5fb7db8c55bb96343d", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "4005fc4ef846c43d5b1cacea659a4685", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9542079207920792, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\texp := map[int]string{\n\t\t1: \"one\",\n\t\t2: \"two\",\n\t\t3: \"three\",\n\t\t4: \"four\",\n\t\t5: \"five\",\n\t\t6: \"six\",\n\t\t7: \"seven\",\n\t\t8: \"eight\",\n\t\t9: \"nine\",\n\t\t10: \"ten\",\n\t\t11: \"eleven\",\n\t\t12: \"twelve\",\n\t\t13: \"thirteen\",\n\t\t15: \"fifteen\"\n\t\t18: \"eighteen\",\n\t\t20: \"twenty\",\n\t\t30: \"thirty\",\n\t\t40: \"forty\",\n\t\t50: \"fifty\",\n\t\t80: \"eighty\",\n\t}\n\n\tvar scr int\n\tfmt.Fscan(reader, &scr)\n\tif _, exst := exp[scr]; exst {\n\t\tfmt.Println(exp[scr])\n\t\treturn\n\t}\n\n\tif scr/10 == 1 {\n\t\tfmt.Printf(\"%s%s\", exp[scr%10], \"teen\")\n\t} else {\n\t\tif _, exst := exp[(scr/10)*10]; exst {\n\t\t\tfmt.Print(exp[(scr/10)*10])\n\t\t} else {\n\t\t\tfmt.Printf(\"%s%s\", exp[scr/10], \"ty\")\n\t\t}\n\n\t\tfmt.Printf(\"-%s\", exp[scr%10])\n\t}\n}\n", "lang": "Go", "bug_code_uid": "c159a27fd76390008c36e1fe017e9681", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "4005fc4ef846c43d5b1cacea659a4685", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.4118382659441434, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n, k, d int\n\tfor I(&n, &k, &d) == nil {\n\t\tsolve(n, k, d)\n\t}\n}\n\nfunc solve(n, k, d int) {\n\tif d > n {\n\t\tO(\"0\\n\")\n\t\treturn\n\t}\n\tO(do(n, k, d)-1, \"\\n\")\n}\n\nfunc do(n, k, d int) int {\n\tif n < 0 {\n\t\treturn 0\n\t}\n\tans := 1\n\tfor i := d; i <= k; i++ {\n\t\tans += do(n-i, k, 1)\n\t\tans %= 1e9 + 7\n\t}\n\treturn ans\n}\n", "lang": "Go", "bug_code_uid": "610b6e70188d617cb901c680252497f1", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "234713ce32b1fb5a485c8633ab18a5cb", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9410029498525073, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol431C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, k, d int\n\tFscan(in, &n, &k, &d)\n\tdp := make([][2]int, n)\n\tfor i := range dp {\n\t\tdp[i][0] = -1\n\t\tdp[i][1] = -1\n\t}\n\tvar f func(int, int) int\n\tf = func(sum int, contain int) int {\n\t\tif sum == n {\n\t\t\treturn 1\n\t\t}\n\t\tif contain == 0 && sum+d > n {\n\t\t\treturn 0\n\t\t}\n\t\tif v := dp[sum][contain]; v != -1 {\n\t\t\treturn v\n\t\t}\n\t\tans := 0\n\t\tif contain == 0 {\n\t\t\tfor i := 1; i < d; i++ {\n\t\t\t\tif sum+i > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tans += f(sum+i, 0)\n\t\t\t}\n\t\t\tfor i := d; i <= k; i++ {\n\t\t\t\tif sum+i > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tans += f(sum+i, 1)\n\t\t\t}\n\t\t} else {\n\t\t\tfor i := 1; i <= k; i++ {\n\t\t\t\tif sum+i > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tans += f(sum+i, 1)\n\t\t\t}\n\t\t}\n\t\tdp[sum][contain] = ans\n\t\treturn ans\n\t}\n\tFprint(out, f(0, 0))\n}\n\nfunc main() {\n\tSol431C(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "a7faa123c0488fc47a75609f3debee4d", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "cb8259e2dbc950993835e0e8e0e77138", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9522832221652129, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nconst MOD = 1000000007\nvar n, k, d int\n\nfunc solve (sum, ok int, dp [][]int) int {\n\tif sum > n {\n\t\treturn 0\n\t}\n\tif sum == n {\n\t\treturn ok\n\t}\n\n\tif dp[ok][sum] != -1 {\n\t\treturn dp[ok][sum]\n\t}\n\n\tways := 0\n\tfor weight := 1; weight <= k; weight++ {\n\t\tif weight >= d {\n\t\t\tways = (ways + solve(sum+weight, 1, dp)) % MOD\n\t\t} else {\n\t\t\tways = (ways + solve(sum+weight, ok, dp)) % MOD\n\t\t}\n\t}\n\n\treturn ways\n}\n\nfunc main() {\n\tscanf(\"%d %d %d\\n\", &n, &k, &d)\n\n\tif n < d {\n\t\tfmt.Println(0)\n\t}\n\tdp := make([][]int, 2)\n\tdp[0] = make([]int, 102)\n\tdp[1] = make([]int, 102)\n\n\tfor i := 0; i < 102; i++ {\n\t\tdp[0][i] = -1\n\t\tdp[1][i] = -1\n\t}\n\n\tsolve(0,0, dp)\n\tfmt.Println(solve(0, 0, dp))\n}\n", "lang": "Go", "bug_code_uid": "73bd41ff8ef246bd9add18afabaac69e", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "443bb6852055f1e97f0f2fd5ee77f018", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9961089494163424, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// 431C\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a [100][2]int64\n\tvar n, d, m, i, j int64\n\tfmt.Scan(&n, &d, &m)\n\ta[0][0] = 1\n\tfor i = 1; i <= n; i++ {\n\t\tfor j = 1; j <= d && j <= i; j++ {\n\t\t\ta[i][0] += a[i-j][0]\n\t\t\tif j >= m {\n\t\t\t\ta[i][1] += a[i-j][0]\n\t\t\t} else {\n\t\t\t\ta[i][1] += a[i-j][1]\n\t\t\t}\n\t\t\ta[i][1] %= 1000000007\n\t\t\ta[i][0] %= 1000000007\n\t\t}\n\t}\n\tfmt.Println(a[n][1])\n}", "lang": "Go", "bug_code_uid": "b61ea282a18b466322ca3154608aa3ae", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "156f446f7c5edc3564300054edad287e", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9641434262948207, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc toBaseSeven(number int, size int) []int {\n\tresult := make([]int, size)\n\tfor i := range result {\n\t\tresult[i] = number % 7\n\t\tnumber /= 7\n\t}\n\treturn result\n}\n\nfunc checkDistinctOfNumbers(hour []int, minute [] int) bool {\n\tvar numbers [7]int\n\tfor _, v := range hour {\n\t\tnumbers[v]++\n\t}\n\n\tfor _, v := range minute {\n\t\tnumbers[v]++\n\t}\n\n\tfor _, v := range numbers {\n\t\tif v > 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc sizeInBaseSeven(number int) int {\n\tres := 1\n\tfor number /= 7; number != 0; number /= 7 {\n\t\tres++\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar n, m, res int\n\tfmt.Scan(&n, &m)\n\tn_size, m_size := sizeInBaseSeven(n), sizeInBaseSeven(m)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\tif checkDistinctOfNumbers(toBaseSeven(i, n_size), toBaseSeven(j, m_size)) {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "cc67bc8e0a63565b49fa4596df450d4f", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "a15496461a378f94488edc1cd4e7a69e", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9977949283351709, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc toBaseSeven(number int, size int) []int {\n\tresult := make([]int, size)\n\tfor i := range result {\n\t\tresult[i] = number % 7\n\t\tnumber /= 7\n\t}\n\treturn result\n}\n\nfunc checkDistinctOfNumbers(hour []int, minute [] int) bool {\n\tvar numbers [7]int\n\tfor _, v := range hour {\n\t\tnumbers[v]++\n\t}\n\n\tfor _, v := range minute {\n\t\tnumbers[v]++\n\t}\n\n\tfor _, v := range numbers {\n\t\tif v > 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc sizeInBaseSeven(number int) int {\n\tres := 1\n\tfor number /= 7; number != 0; number /= 7 {\n\t\tres++\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar n, m, res int\n\tfmt.Scan(&n, &m)\n\tn_size, m_size := sizeInBaseSeven(n), sizeInBaseSeven(m)\n\tif n_size + m_size > 7 {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\tif checkDistinctOfNumbers(toBaseSeven(i, n_size), toBaseSeven(j, m_size)) {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "007244599196d54177a95d94d75d6119", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "a15496461a378f94488edc1cd4e7a69e", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9993698802772527, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc minSlots(n int64) int {\n\tc := 1\n\ts := int64(7)\n\tfor {\n\t\tif s > n {\n\t\t\treturn c\n\t\t}\n\t\tc ++;\n\t\ts *= 7\n\t}\n}\n\nvar n, m int64\nvar slotN, slotM int\nvar ans = 0\nvar used = make([]bool, 7)\nfunc cal(num []int) int64 {\n\tvar result int64\n\tfor _, n := range num {\n\t\tresult = result * int64(7) + int64(n)\n\t}\n\treturn result\n}\nfunc dfs(num []int) {\n\tif len(num) == slotN {\n\t\tif cal(num[:slotN]) >= n {\n\t\t\treturn\n\t\t}\n\t} else if len(num) == slotN + slotM {\n\t\tif cal(num[slotN:]) < m {\n\t\t\tans ++\n\t\t}\n\t\treturn\n\t}\n\tfor i, use := range used {\n\t\tif !use {\n\t\t\tused[i] = true\n\t\t\tdfs(append(num, i))\n\t\t\tused[i] = false\n\t\t}\n\t}\n}\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tslotN = minSlots(n)\n\tslotM = minSlots(m)\n\tnum := make([]int, 0, slotN + slotM + 1)\n\tdfs(num)\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "1b1759c47fc2599e7a1c7c287bff5069", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "97171a390aeb2ca993b54150ec75c5d2", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.971214953271028, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc validate(arr []int64, nSlots int, n int64, m int64) bool {\n length := len(arr)\n for i:= 0; i < length; i++ {\n for j:= i+1; j < length; j++ {\n if arr[i] == arr[j] {\n return false\n }\n }\n }\n var num int64\n for i:=0; i < nSlots; i++ {\n num = num*7+arr[i]\n }\n if num >= n {\n return false\n }\n num = 0\n for i:=nSlots; i < length; i++ {\n num = num*7+arr[i]\n }\n if num >= m {\n return false\n }\n //fmt.Println(arr)\n return true\n}\n\nfunc try(arr []int64, depth int, cnt *int) {\n length := len(arr)\n if depth == length {\n if validate(arr, nSlots, n, m) {\n (*cnt)++\n }\n return\n }\n for i:=0; i < 7; i++ {\n arr[depth] = int64(i)\n try(arr, depth+1, cnt)\n }\n}\nvar n, m int64\nvar nSlots, mSlots int\nfunc main() {\n fmt.Scan(&n, &m)\n for i:=n-1; i > 0; {\n nSlots++\n i /= 7\n }\n for i:=m-1; i > 0; {\n mSlots++\n i /= 7\n }\n\n if mSlots + nSlots > 7 || mSlots + nSlots == 0 {\n fmt.Println(0)\n return\n }\n\n //fmt.Println(nSlots, mSlots)\n var arr []int64 = make([]int64, nSlots+mSlots)\n\n var cnt int\n try(arr, 0, &cnt)\n fmt.Println(cnt)\n //testValidate()\n}\n\nfunc testValidate() {\n arr := make([]int64, 3)\n arr[0] = 0\n arr[1] = 2\n arr[2] = 1\n fmt.Println(validate(arr, 2, 8, 2))\n}\n", "lang": "Go", "bug_code_uid": "717580d2b526fca7d5c9b4a958d74093", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "8c298ace7c994034b4de8221dc63f178", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.990409764603313, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar cs map[int]int = make(map[int]int)\n\nfunc Init() {}\nfunc Solve(io *FastIO) {\n\tn := io.NextInt()\n\ts := io.NextString()\n\tif n == 1 {\n\t\tio.Println(\"Yes\")\n\t\treturn\n\t}\n\ts += string(s[n-2])\n\tl := s[1]\n\to := false\n\tvar j byte\n\tfor i := 0; i < n; i++ {\n\t\tj = s[i]\n\t\tif j != '?' {\n\t\t\tif l == j {\n\t\t\t\to = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif s[i+1] == '?' || s[i+1] == l {\n\t\t\t\to = true\n\t\t\t}\n\t\t}\n\t\tl = j\n\t}\n\tif o {\n\t\tio.Println(\"Yes\")\n\t} else {\n\t\tio.Println(\"No\")\n\t}\n}\n\ntype FastIO struct {\n\t//by megaspazz\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = int64(-1)\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int64(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextInt() + 1\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextLong()\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\n', '\\r':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}\n", "lang": "Go", "bug_code_uid": "0c8303149fa13bc538d7abdb4441580f", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "11bf09b842f5c50a0e84cfb4e572835b", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9807692307692307, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc solve() bool {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tscanner.Scan()\n\tmaj := scanner.Text()\n\tfor i := 0; i < len(maj)-1; i++ {\n\t\tif maj[i] == maj[i+1] && maj[i] != '?' {\n\t\t\tfmt.Println(\"FIRST\")\n\t\t\treturn false\n\t\t}\n\t}\n\t// A?A -> Yes\n\t// A?B -> No\n\tfor i := range maj {\n\t\tif maj[i] == '?' {\n\t\t\tif i == 0 || i == len(maj)-1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == '?' || maj[i+1] == '?' {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == maj[i+1] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tif solve() {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "fdba6589b10b5dace8a9c85f18cf7b76", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "cbca41b4e141897a7f225a62b1a7c5a6", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9763779527559056, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Scanf(\"%s\\n\", &s)\n\tfor i:=1;i= possByReqSymb {\n\t\tfmt.Println(possByReqSymb)\n\t} else {\n\t\tfmt.Println(possBySum)\n\t}\n}", "lang": "Go", "bug_code_uid": "1e8b47db9c450577f86aee6e9c0a10e6", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "0eeeebb78723a3ace949c728325c1993", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8069027075275216, "equal_cnt": 22, "replace_cnt": 15, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 21, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/128/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Position struct {\n\tX int\n\tY int\n}\n\ntype Node struct {\n\tMaria Position\n\tTime int\n}\n\nfunc getNeighbors(p Position) []Position {\n\tneighbors := []Position{\n\t\t{X: p.X - 1, Y: p.Y - 1},\n\t\t{X: p.X - 1, Y: p.Y},\n\t\t{X: p.X - 1, Y: p.Y + 1},\n\t\t{X: p.X, Y: p.Y - 1},\n\t\t{X: p.X, Y: p.Y},\n\t\t{X: p.X, Y: p.Y + 1},\n\t\t{X: p.X + 1, Y: p.Y - 1},\n\t\t{X: p.X + 1, Y: p.Y},\n\t\t{X: p.X + 1, Y: p.Y + 1},\n\t}\n\tvar validNeighbors []Position\n\tfor _, neighbor := range neighbors {\n\t\tif 0 <= neighbor.X && neighbor.X < 8 && 0 <= neighbor.Y && neighbor.Y < 8 {\n\t\t\tvalidNeighbors = append(validNeighbors, neighbor)\n\t\t}\n\t}\n\treturn validNeighbors\n}\n\nfunc hasStatue(board [8]string, p Position, time int) bool {\n\tif 0 <= p.X-time && p.X-time < 8 {\n\t\tif string(board[p.X-time][p.Y]) == \"S\" {\n\t\t\treturn true\n\t\t}\n\t}\n\tif 0 <= p.X-time-1 && p.X-time-1 < 8 {\n\t\tif string(board[p.X-time-1][p.Y]) == \"S\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc Solve(board [8]string) string {\n\tstack := []Node{{Maria: Position{X: 7, Y: 0}, Time: 0}}\n\tfor {\n\t\tcurrentNode, stack := stack[len(stack)-1], stack[:len(stack)-1]\n\t\tif currentNode.Time == 8 || currentNode.Maria.X == 0 {\n\t\t\treturn \"WIN\"\n\t\t}\n\t\tfor _, neighbor := range getNeighbors(currentNode.Maria) {\n\t\t\tif !hasStatue(board, neighbor, currentNode.Time) {\n\t\t\t\tstack = append(stack, Node{Maria: neighbor, Time: currentNode.Time + 1})\n\t\t\t}\n\t\t}\n\t\tif len(stack) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn \"LOSE\"\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar board [8]string\n\tfor i := 0; i < 8; i++ {\n\t\tfmt.Fscanf(reader, \"%s\\n\", &board[i])\n\t}\n\tfmt.Fprintf(writer, \"%s\\n\", Solve(board))\n}\n", "lang": "Go", "bug_code_uid": "a04318e625fa5703b359de13e5b528f5", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "apr_id": "80f4f85da86db1109b7a50ce077ebd0f", "difficulty": 1500, "tags": ["dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9483146067415731, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc abs(a int, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\tv := make([]int, a/2)\n\tx := [100]bool{}\n\tfor b := range v {\n\t\tfmt.Scan(&v[b])\n\t\tx[v[b]] = true\n\t}\n\ttotal1 := 0\n\ttotal2 := 0\n\tsort.Ints(v)\n\tfor i, vv := range v {\n\t\ttotal1 += abs(vv, 2+i*2)\n\t\ttotal2 += abs(vv, (i*2)+1)\n\t\t\n\t}\n\tif total1 > total2 {\n\t\tfmt.Println(total1)\n\t} else {\n\t\tfmt.Println(total2)\n\t}\n\t\n}\n", "lang": "Go", "bug_code_uid": "2e5cc72149e50e1c0c6185d8d262cad2", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "13e3e6f0648e403c42e4a0d02cd4342d", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9605411499436303, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc abs(a int, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\tv := make([]int, a/2)\n\tx := [100]bool{}\n\tfor b := range v {\n\t\tfmt.Scan(&v[b])\n\t\tx[v[b]] = true\n\t}\n\ttotal1 := 0\n\ttotal2 := 0\n\tsort.Ints(v)\n\tfor i, vv := range v {\n\t\ttotal1 += abs(vv, 2+i*2)\n\t\ttotal2 += abs(vv, (i*2)+1)\n\n\t}\n\tif total1 < total2 {\n\t\tfmt.Println(total1)\n\t} else {\n\t\tfmt.Println(total2)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "8798f02bded4eb7564137e5bfd2cfac4", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "13e3e6f0648e403c42e4a0d02cd4342d", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9907192575406032, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tnum int\n\ti int\n\ts [50]int\n\n\tb_count int\n\tb_count1 int\n\tw_count int\n\tw_count1 int\n\tccl int\n\tcclp int\n\tflag bool\n)\n\nfunc main() {\n\tb_count = 0\n\tw_count = 0\n\n\tfmt.Scanln(&num)\n\n\tccl = num / 2\n\tfor i = 0; i < ccl; i++ {\n\t\tfmt.Scanf(\"%d\", &cclp)\n\t\ts[i] = cclp\n\t}\n\n\tif ccl == 1 {\n\n\t\tfmt.Println(0)\n\t} else {\n\n\t\tflag = true\n\t\tfor flag {\n\t\t\tflag = false\n\t\t\tfor i = 1; i < num/2; i++ {\n\n\t\t\t\tif s[i-1] > s[i] {\n\t\t\t\t\tflag = true\n\t\t\t\t\tccl = s[i]\n\t\t\t\t\ts[i] = s[i-1]\n\t\t\t\t\ts[i-1] = ccl\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(s)\n\t\tfor i = 0; i < num/2; i++ {\n\t\t\tccl = s[i] - 2*i - 1\n\t\t\tcclp = s[i] - 2*i - 2\n\t\t\tb_count += Iabs(ccl)\n\t\t\tw_count += Iabs(cclp)\n\n\t\t}\n\n\t\tif b_count < w_count {\n\t\t\tfmt.Println(b_count)\n\t\t} else {\n\t\t\tfmt.Println(w_count)\n\t\t}\n\t}\n\treturn\n}\nfunc Iabs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f138b24716cc755c691ad384427b6576", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "7c014e9ab6e1653ddaca6a9d850761ba", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.4613466334164589, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tnum int\n\ti int\n\ts [100]int\n\tb_count int\n\tw_count int\n\tccl int\n\tcclp int\n\tflag bool\n)\n\nfunc main() {\n\tb_count = 0\n\tw_count = 0\n\t//fmt.Scanf(\"%d\", &num)\n\tfmt.Scanln(&num)\n\tfor i = 0; i < num/2; i++ {\n\t\tfmt.Scanf(\"%d\", &s[i])\n\t}\n\tflag = true\n\tfor flag {\n\t\tfor i = 1; i < num/2; i++ {\n\t\t\tflag = false\n\t\t\tif s[i-1] > s[i] {\n\t\t\t\tflag = true\n\t\t\t\tccl = s[i]\n\t\t\t\ts[i] = s[i-1]\n\t\t\t\ts[i-1] = ccl\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i = 0; i < num/2; i++ {\n\t\tccl = s[i] - 2*i - 1\n\n\t\tcclp = s[i] - 2*i - 2\n\n\t\tb_count += Iabs(ccl)\n\t\tw_count += Iabs(cclp)\n\t}\n\tif b_count < w_count {\n\t\tfmt.Println(b_count)\n\t} else {\n\t\tfmt.Println(w_count)\n\t}\n}\nfunc Iabs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1ea6ef159e4698ddb108fdd9d0356754", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "7c014e9ab6e1653ddaca6a9d850761ba", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9791666666666666, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tscanner.Scan()\n\tans := strings.Split(scanner.Text(), \"\")\n\n\ttotal := 0\n\tfor i := 0; i < len(ans)-1; i++ {\n\t\ta, _ := strconv.Atoi(ans[i])\n\t\ttotal += a\n\t\tif findGolden(total, ans[i+1:]) {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n\nfunc findGolden(cut int, rem []string) bool {\n\ttotal := 0\n\tfor i := 0; i < len(rem); i++ {\n\t\ta, _ := strconv.Atoi(rem[i])\n\n\t\ttotal += a\n\t\tif total > cut {\n\t\t\treturn false\n\t\t}\n\t\tif total == cut {\n\t\t\treturn i+1 == len(rem) || findGolden(cut, rem[i+1:])\n\n\t\t}\n\t}\n\treturn false\n}\n", "lang": "Go", "bug_code_uid": "d253df0d3aea14f1eed1730c88263bf5", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "58749f64369ebde7572339623e696323", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9430796884361894, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype vec struct{ x, y int64 }\n\nfunc (a vec) sub(b vec) vec { return vec{a.x - b.x, a.y - b.y} }\nfunc (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }\nfunc (a vec) det(b vec) int64 { return a.x*b.y - a.y*b.x }\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF617D(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tf := func(a, b, c vec) bool {\n\t\ta, b = b.sub(a), c.sub(a)\n\t\treturn a.x == 0 && b.y == 0 || a.y == 0 && b.x == 0\n\t}\n\tvar a, b, c vec\n\tFscan(in, &a.x, &a.y, &b.x, &b.y, &c.x, &c.y)\n\tif b.sub(a).det(c.sub(b)) == 0 {\n\t\tFprint(out, 1)\n\t} else if f(a, b, c) || f(b, a, c) || f(c, a, b) {\n\t\tFprint(out, 2)\n\t} else {\n\t\tFprint(out, 3)\n\t}\n}\n\nfunc main() { CF617D(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "f9f2753704d5a92e1881ae21c0379dc7", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "c0818ab7896fb4109074b11bc8818668", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6476190476190476, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main () {\n var h, w, hs1, hw1, hs2, hw2 int32\n var count int32\n \n \n count = 0\n fmt.Scanf(\"%d %d\\n\", &w, &h)\n fmt.Scanf(\"%d %d\\n\", &hw1,&hs1)\n fmt.Scanf(\"%d %d\\n\", &hw2, &hs2)\n \n count = ((h*(h+1))/2) + w\n //fmt.Println(count)\n if (count < hw1) {\n count = 0\n } else {\n count = count - hw1\n }\n \n if (count < hw2) {\n count = 0\n } else {\n count = count - hw2\n }\n fmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "1aab4714335065a439df498cd131e5a3", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "58cdd9560ae3f5e9bb73d0598afb416f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.827972027972028, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc sum(st, end int) int {\n\tif st > end{\n\t\treturn 0\n\t}\n\treturn (st + end) * (end - st + 1) / 2\n}\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\tvar w, h int\n\tfmt.Fscanf(buf, \"%d %d\\n\", &w, &h)\n\t//_,err := ioutil.ReadFile(str)\n\tvar u1, d1 int\n\tvar u2, d2 int\n\tfmt.Fscanf(buf, \"%d %d\\n\", &u1, &d1)\n\tfmt.Fscanf(buf, \"%d %d\\n\", &u2, &d2)\n\tans := w+sum(d2,h)\n\t//fmt.Printf(\"ans1=%d\\n\",ans)\n\tans -= u2;\n\t//fmt.Printf(\"ans2=%d\\n\",ans)\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tans += sum(d1,d2-1)\n//\tfmt.Printf(\"ans3=%d\\n\",ans)\n\tans -= u1+1;\n//\tfmt.Printf(\"ans4=%d\\n\",ans)\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tans += sum(d1-1,1)\n\tfmt.Printf(\"%d\\n\",ans)\n}\n", "lang": "Go", "bug_code_uid": "2898ab6dbfea4721708b94f9f00cb27d", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "fe9b87d1d7a0df260b2e1dd8f8bfd26b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9784768211920529, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n\t// \"fmt\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc main() {\n\tdefer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n\tw, h := ReadInt(), ReadInt()\n\n\tu1,d1 := ReadInt(), ReadInt()\n\tu2,d2 := ReadInt(), ReadInt()\n\n\tfor ; h > 0; h-- {\n\t\tw += h\n\t\tif d1 == h {\n\t\t\tw -= u1\n\t\t}\n\t\tif d2 == h {\n\t\t\tw -= u2\n\t\t}\n\t}\n\n writer.WriteString(strconv.Itoa(w))\n}\n", "lang": "Go", "bug_code_uid": "654ff5817f09d3d94f07352f620d6951", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "4263ae77ba5a1a6631355ef89af7edaa", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7674144037780402, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\ta, b := Calculate854A(n)\n\tfmt.Print(a, b)\n}\n\nfunc Calculate854A(n int) (int, int) {\n\tvar maxA = 0\n\tvar maxB = 0\n\tfor i := 1; i < n; i++ {\n\t\tvar a = i\n\t\tvar b = n - i\n\t\tif a >= b {\n\t\t\tbreak\n\t\t}\n\t\tif Gcd(a, b) != 0 {\n\t\t\tmaxA = a\n\t\t\tmaxB = b\n\t\t}\n\t}\n\treturn maxA, maxB\n}\n\nfunc Gcd(a int, b int) (int) {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n", "lang": "Go", "bug_code_uid": "0e2b3d27586ef546690f964bd51a7365", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "0a066270d802b2c37ecce9ca2df2e640", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.38095238095238093, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a, b int\n\tif n %2 == 0{\n\t\ta = n/2-1\n\t\tb = n/2+1\n\t} else {\n\t\ta = n/2\n\t\tb = n/2+1\n\t}\n\tfmt.Println(a, \" \", b)\n}\n", "lang": "Go", "bug_code_uid": "e7b62f3a74c1bf0c8279dccae0fdf820", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "b1e90d3dd87723f956169dbc1b47bc2e", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.01662049861495845, "equal_cnt": 8, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include \n#define tr(v,it) for(auto it=v.begin(); it!=v.end(); it++)\n#define mp(x,y) make_pair(x,y)\n#define pb(x) push_back(x)\n#define F first\n#define S second\n#define endl \"\\n\"\n#define MOD 1000000007\n#define pie 3.141592653589793\n#define INF 1e18\nusing namespace std;\n\nint main()\n{\n //freopen(\"input.txt\",\"r\",stdin);\n //freopen(\"output.txt\",\"w\",stdout);\n\n ios::sync_with_stdio(0); cin.tie(0);\n\n long long n;\n cin>>n;\n double value=0;\n long long x,y;\n for(int i=1; i<=n; i++)\n {\n for(int j=i; j<=n; j++)\n {\n long long a=i;\n long long b=j;\n if(a+b==n)\n {\n long long k=__gcd(i,j);\n if(k==1)\n {\n double tempv=(a*1.0/b);\n if(tempv>value)\n {\n x=i;\n y=j;\n }\n }\n }\n\n }\n }\n cout< b {\n\t\t\ta -= b\n\t\t} else {\n\t\t\tb -= a\n\t\t}\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n%2 == 0 {\n\t\ta = n/2 - 1\n\t\tb = n/2 + 1\n\t} else {\n\t\ta = n / 2\n\t\tb = n/2 + 1\n\t}\n\tfor !vzaimnoProst(a, b) {\n\t\ta++\n\t\tb--\n\t}\n\tfmt.Println(a, b)\n}", "lang": "Go", "bug_code_uid": "73e899c5830d84a051067eae41720aa2", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "00777c5ec1bb2b8fcb987e163bf029d2", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9756888168557536, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tk int\n\t)\n\tfmt.Scan(&n, &k)\n\tmin, max := Calculate854B(n, k)\n\tfmt.Print(min, max)\n}\n\nfunc Calculate854B(n int, k int) (int, int) {\n\tvar min = 1\n\tvar max = n - k\n\tif k <= n/3 {\n\t\tmax = k * 2\n\t}\n\tif n == k || k == 0 {\n\t\tmin = 0\n\t\tmax = 0\n\t}\n\treturn min, max\n}\n", "lang": "Go", "bug_code_uid": "dd8be074ac3a4cdafa6afba2353a7722", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "0d88b886827edd76c452d11d62958445", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9835234474017744, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n n int\n k int\n)\n\nfunc main() {\n fmt.Scan(&n, &k)\n min := 1\n max := k + 1\n if k <= n/3 {\n max = k * 2\n } else if max > n-k {\n max = n - k\n }\n if k == n || k == 0 || n == 0 {\n min = 0\n max = 0\n }\n fmt.Println(min, max)\n}", "lang": "Go", "bug_code_uid": "a5a01c132b6dc07c25237701d6083d0c", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "50338787796238943c297128479c7a93", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9976280834914611, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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, K := sc.NextInt(), sc.NextInt()\n\tif N == K {\n\t\tfmt.Println(0, 0)\n\t\treturn\n\t}\n\tfmt.Println(1, min(K*2, N-K))\n\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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", "lang": "Go", "bug_code_uid": "ba808166da1edf82aa37b7f0032a3980", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "c94fda4a36b82bfcf3832a133120d697", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8691588785046729, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, lo, hi int64\n\tfmt.Scan(&n, &k)\n\tif k != 0 && k != n {\n\t\tlo = 1\n\t}\n\tn -= k\n\tif k*3 <= n {\n\t\thi = k * 2\n\t} else if n <= k {\n\t\thi = n\n\t} else {\n\t\thi = n - k\n\t}\n\tfmt.Println(lo, hi)\n}\n", "lang": "Go", "bug_code_uid": "b2be689e955b49cd078a3b6cab58c594", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "983a5b8ee095df231bb726951cf39ad3", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9772151898734177, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc fastRead(reader *bufio.Reader) (i int, j int) {\n\tvar c rune\n\tc, _, _ = reader.ReadRune()\n\n\t//space = 32\n\t//space and between 0-9\n\tfor c != 32 && c > 47 && c < 58 {\n\t\t//x = x*10+c\n\t\ti = (i << 1) + (i << 3) + int(c) - 48\n\t\tc, _, _ = reader.ReadRune()\n\t}\n\n\tc, _, _ = reader.ReadRune()\n\t//newline = 10\n\tfor c != 10 && c > 47 && c < 58 {\n\t\t//x = x*10+c\n\t\tj = (j << 1) + (j << 3) + int(c) - 48\n\t\tc, _, _ = reader.ReadRune()\n\t}\n\n\treturn\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tvar x, y = fastRead(reader)\n\n\tif y <= 0 || (x%2 == 0 && y%2 == 0) {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tvar x2 = x - (y - 1)\n\t/*for x1 < x {\n\t\tx1 += 2\n\t}*/\n\n\tif y <= 1 && x > 0 || x2%2 == 1 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "cb94139ef13eebd475f3d2fdec973dcb", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "6f3f0b1b9c184bea015b685ad56b14cb", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4843373493975904, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc failed() {\n fmt.Println(\"No\")\n}\nfunc Success() {\n fmt.Println(\"Yes\")\n}\n\nfunc main(){\n var copied, original int\n fmt.Scan(&copied, &original)\n for original > 1 {\n original--\n copied--\n if(copied < 0 ){\n failed();\n return\n }\n }\n for copied > 0{\n copied -= 2\n if(copied < 0){\n failed();\n return\n }\n }\n Success()\n}\n", "lang": "Go", "bug_code_uid": "309c1551143c67bc871989c56cc3a9b9", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "9a85b9f52af902dda607b3b96a8efe6d", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9474969474969475, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc failed() {\n fmt.Println(\"No\")\n}\nfunc Success() {\n fmt.Println(\"Yes\")\n}\n\nfunc main(){\n var copied, original int\n fmt.Scan(&copied, &original)\n\tif(original == 1){\n\t\tif(copied >= 1){\n\t\t\tfailed()\n\t\t\treturn\n\t\t}\n\t}\n\tif(original > copied + 1){\n\t\tfailed()\n\t\treturn\n\t}\n\tcopied -= original - 1\n\n if( copied % 2 == 0){\n\t\tSuccess()\n\t}\telse{\n\t\tfailed()\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ea25e013280fa49f69c3cfe1529428e0", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "9a85b9f52af902dda607b3b96a8efe6d", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.983941605839416, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int64\n\tfmt.Scan(&x, &y)\n\tcal := x - (y - 1)\n\tif x == 0 && y == 1 {\n\t\tfmt.Printf(\"yes\")\n\t} else if x == 1 && y == 0 {\n\t\tfmt.Printf(\"no\")\n\t} else if cal%2 == 0 && cal > 0 {\n\t\tfmt.Printf(\"yes\")\n\t} else if cal <= 0 && y-1 == x {\n\t\tfmt.Printf(\"yes\")\n\t} else {\n\t\tfmt.Printf(\"no\")\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "f33c2ab9de5931fc1b1ea3ea6c06a429", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "675aa341bf5178bcc0591273d7941c44", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.09044193216855087, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/go-redis/redis\"\n\n\t\"net/http\"\n\t\"log\"\n)\n\nfunc saveStat(redisClient *redis.Client) func (w http.ResponseWriter, r *http.Request) {\n\treturn func (w http.ResponseWriter, r *http.Request) {\n\t\terr := redisClient.Set(\"key\", \"value\", 0).Err()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Fprintf(w, \"{\\\"status\\\": \\\"ok\\\"}\")\n\t\tfmt.Println(r.URL.Query()[\"param\"])\n\t\tfmt.Println(r.URL.Query()[\"value\"])\n\t}\n}\n\nfunc main() {\n\n\tclient := redis.NewClient(&redis.Options{\n\t\tAddr: \"127.0.0.1:6379\",\n\t\tPassword: \"\",\n\t\tDB: 0,\n\t})\n\n\thttp.HandleFunc(\"/set\", saveStat(client)) // set router\n\terr := http.ListenAndServe(\":9090\", nil) // set listen port\n\tif err != nil {\n\t\tlog.Fatal(\"ListenAndServe: \", err)\n\t}\n\n\n\n\n\n}\n", "lang": "Go", "bug_code_uid": "3ca94fb5cd739d80bbdac6a4bf644d24", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "231c4b27085999ce18b0ce128c186e67", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5584192439862543, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int\nvar x int\nvar a [101]int\n\nfunc main() {\n fmt.Scan(&n, &x)\n cnt := 0\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n if a[0] != 0 {\n fmt.Println(0)\n } else {\n for i := 0; i < n; i++ {\n cnt += a[i]\n if cnt >= x {\n fmt.Println(i + 1)\n break\n }\n }\n }\n}", "lang": "Go", "bug_code_uid": "732d766111f4218d8b01b9d5180a2ee6", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "31f8a0f5466bc24c0bee9fa8f782f5b5", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9972451790633609, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc init() {\n\tlog.SetFlags(0)\n}\n\nfunc main() {\n\tvar flag bool\n\tvar n, x, mark int\n\tfmt.Scanf(\"%d %d\", &n, &x)\n\tarr := make([]int, x)\n\tfor i := range arr {\n\t\tarr[i] = i\n\t}\n\tfor i, tmp := 0, 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d \", &tmp)\n\t\tif tmp < x {\n\t\t\tfor j, val := range arr {\n\t\t\t\tif tmp == val {\n\t\t\t\t\tmark = j\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr = arr[:mark+copy(arr[mark:], arr[mark+1:])]\n\t\t} else if tmp == x {\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(len(arr) + 1)\n\t} else {\n\t\tfmt.Println(len(arr))\n\t}\n}", "lang": "Go", "bug_code_uid": "cf4b97cb639a6511471adb3270670afb", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "c906a75542e6e4916eaecd002a85b755", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9671232876712329, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar n,x,a int\n\tvar abc string\n\tfmt.Scan(&n,&abc)\n\tfor i:=0;i= 0 {\n\t\tfmt.Println(r)\n\t} else {\n\t\tprintln(0)\n\t}\n}", "lang": "Go", "bug_code_uid": "145ca13d69f41369ccf26a16767ddcc3", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "746ec4af4bf30f1ea9ade75cdf931496", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9869451697127938, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar a int\n var b int\n var c int\n\tfmt.Scan(&a, &b, &c)\n\tif b >=a and c >= a {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "lang": "Go", "bug_code_uid": "64ab24c3eef5674bd4aa9994a0c1c83b", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "2e8883eb5f8ad4161477721711271ab7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.967948717948718, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, k int\n\tfmt.Scan(&n, &m, &k)\n\tif n <= m || n <= k {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "12c86c8b120c8613d488fa1e9d838338", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "9824a9ae8f3619a7095520918744998a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.791095890410959, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tsubstrs := strings.Split(s, \"WUB\")\n\tfor i := 0; i < len(substrs)-2; i++ {\n\t\tif substrs[i] != \"\" {\n\t\t\tfmt.Print(substrs[i] + \" \")\n\t\t}\n\t}\n\tfmt.Print(substrs[len(substrs)-2])\n}\n", "lang": "Go", "bug_code_uid": "cfd00b116423fde738c761d165cca2b6", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "4451b1cdab3c9698d396414de1261f1b", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7718773373223635, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc IsWUB(pos int, s string) bool {\n if (pos+3 > len(s)) {\n return false\n } else if (s[pos] == 'W') && (s[pos+1] == 'U') && (s[pos+2] == 'B') {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n first := true\n for i := 0; i < len(s); {\n if IsWUB(i,s) {\n i += 3\n } else {\n if !first { fmt.Print(\" \") } else { first = false }\n for ; !IsWUB(i,s); i++ {\n fmt.Print(string(s[i]))\n if ((i+1) == len(s)) { break }\n }\n }\n if ((i+1) == len(s)) { break }\n }\n fmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "e64d1719a86fd2b8e1715b29efc6ef8a", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "e39c87697f81daae5a3fc31b70a1264d", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5909090909090909, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tconst WUB = \"WUB\"\n\tvar song string\n\tfmt.Scanf(\"%s\", &song)\n\twords := strings.Split(song, WUB)\n\tfmt.Println(words)\n\tvar result string\n\tfor _, word := range words {\n\t\tif len(word) == 0 {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tresult += word + \" \"\n\t\t}\n\t}\n\tfmt.Println(strings.TrimSpace(result))\n}\n", "lang": "Go", "bug_code_uid": "1a77fd8883ddff3b567fa197bda4eb77", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "010f01f808ffab7c57238838a4cb0776", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9770114942528736, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tvar flag bool\n\tvar count, i int\n\tfmt.Scanf(\"%s\", &s)\n\tcount = len(s)\n\tfor {\n\t\tif i == count {\n\t\t\tbreak\n\t\t}\n\t\tif s[i] == 'W' && s[i+1] == 'U' && s[i+2] == 'B' {\n\t\t\ti = i + 3\n\t\t\tif flag {\n\t\t\t\tfmt.Printf(\" \")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Printf(\"%c\", s[i])\n\t\t\tflag = true\n\t\t\ti++\n\t\t}\n\t}\n}", "lang": "Go", "bug_code_uid": "49e5aeb9cb3507aca83490f1a1055082", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "86d3991ba4503c276162edda808d1d7f", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9982847341337907, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n\tvar n, k int\n\tvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\t\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d %d\", &n, &k)\n\t\n\tx := 0\n\tfor m := (240 - k) / 5; m >= x && x < n; m -= x {\n\t\tx++\n\t}\n\t\n\tfmt.Print(x)\n}", "lang": "Go", "bug_code_uid": "52984a87aa45095a428ffd4acc78f869", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "9da9ecea756d87dd9aee842dc97a2633", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9233021077283372, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc solve() {\n n, k := readInt(), readInt()\n cur := 4*60-k\n ans := 0\n for i := 1; i <= n; i++ {\n cur -= 5*i\n if cur >= 0 {\n ans++\n }\n }\n fmt.Println(ans)\n}\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n const MaxTokenLength = 1024 * 1024\n scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n scanner.Split(bufio.ScanWords)\n solve()\n}\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/", "lang": "Go", "bug_code_uid": "6a0097534840e1b388a9cd489ed04c2b", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "d38693d4b2fb629c59a392176da2995d", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9807355516637478, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &a, &b); err != nil {\n\t\treturn\n\t}\n\n\tif abs(a-b) < 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc abs(n int) int {\n\tif n >= 0 {\n\t\treturn n\n\t} else {\n\t\treturn -n\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a0adf30f4aeac7e605979b3ecaf40152", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "71ca8044d9295774478c763366e4333a", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9110320284697508, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\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 main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\tif abs(a-b) == 1 || abs(a-b) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "cde4110da99c8fa740baa841598aea68", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "2b46967ca97ac1a12cb62e41a771f737", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9975062344139651, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(io *FastIO) {\n\tA := io.NextInt()\n\tB := io.NextInt()\n\n\tif Abs(A - B) <= 1 {\n\t\tio.Println(\"YES\")\n\t} else {\n\t\tio.Println(\"NO\")\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\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tSolve(&io)\n\tio.FlushOutput()\n}\n", "lang": "Go", "bug_code_uid": "800153f7c8a4859bcb642bc5e72e1c7a", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "5b3d876df9876fc71e5483e9b1062304", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9685171833693823, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\ta := sc.NextInt()\n\tb := sc.NextIntArray()\n\n\tif a == b || a == b + 1 {\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) 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", "lang": "Go", "bug_code_uid": "1c7151f8bcd5a8af94db5f11af721e85", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "829689ece4e62ed28f81f8c1751d7a27", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7785108388312912, "equal_cnt": 17, "replace_cnt": 2, "delete_cnt": 11, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tkeys := []string{\n\t\t\"qwertyuiop\",\n\t\t\"asdfghjkl;\",\n\t\t\"zxcvbnm, ./\",\n\t}\n\n\tdx := 1\n\tif next() == \"R\" {\n\t\tdx = -1\n\t}\n\n\tfor _, k := range next() {\n\t\tfor _, s := range keys {\n\t\t\tif strings.IndexRune(s, k) > -1 {\n\t\t\t\tfmt.Print(string(s[strings.IndexRune(s, k) + dx]))\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}", "lang": "Go", "bug_code_uid": "27b04e05db4f7756c5839f70b911cca1", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "61c9554097cca0c11ea244fd87bbff32", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9979919678714859, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tkeys := \"qwertyuiopasdfghjkl;zxcvbnm, ./\"\n\n\tdx := 1\n\tif next() == \"R\" {\n\t\tdx = -1\n\t}\n\n\tfor _, k := range next() {\n\t\tif strings.IndexRune(keys, k) > -1 {\n\t\t\tfmt.Print(string(keys[strings.IndexRune(keys, k) + dx]))\n\t\t}\n\t}\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}", "lang": "Go", "bug_code_uid": "3c9d075700e20a3c164384ca5bcdfdf4", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "61c9554097cca0c11ea244fd87bbff32", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9980976537729866, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tupperRow := map[string]int{\"q\": 1, \"w\": 2, \"e\": 3, \"r\": 4, \"t\": 5, \"y\": 6, \"u\": 7, \"i\": 8, \"o\": 9, \"p\": 10}\n\tlookUpUpperRow := map[int]string{1: \"q\", 2: \"w\", 3: \"e\", 4: \"r\", 5: \"t\", 6: \"y\", 7: \"u\", 8: \"i\", 9: \"o\", 10: \"p\"}\n\n\tmiddleRow := map[string]int{\"a\": 1, \"s\": 2, \"d\": 3, \"f\": 4, \"g\": 5, \"h\": 6, \"j\": 7, \"k\": 8, \"l\": 9, \";\": 10}\n\tlookUpMiddleRow := map[int]string{1: \"a\", 2: \"s\", 3: \"d\", 4: \"f\", 5: \"g\", 6: \"h\", 7: \"j\", 8: \"k\", 9: \"l\", 10: \";\"}\n\n\tlowerRow := map[string]int{\"z\": 1, \"x\": 2, \"c\": 3, \"v\": 4, \"b\": 5, \"n\": 6, \"m\": 7, \",\": 8, \".\": 9, \"/\": 10}\n\tlookUpLowerRow := map[int]string{1: \"z\", 2: \"x\", 3: \"c\", 4: \"v\", 5: \"b\", 6: \"n\", 7: \"m\", 8: \",\", 9: \".\", 10: \"/\"}\n\n\tvar shiftDirection, inputString string\n\n\tfmt.Scanf(\"%s\\n\", &shiftDirection)\n\n\tfmt.Scanf(\"%s\\n\", &inputString)\n\n\tstrSize := len(inputString)\n\n\tfor i := 0; i < strSize; i++ {\n\t\tif upperRow[string(inputString[i])] != 0 {\n\t\t\ttargetPos := upperRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"L\" {\n\t\t\t\tfmt.Print(lookUpUpperRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpUpperRow[targetPos+1])\n\t\t\t}\n\t\t} else if middleRow[string(inputString[i])] != 0 {\n\t\t\ttargetPos := middleRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"L\" {\n\t\t\t\tfmt.Print(lookUpMiddleRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpMiddleRow[targetPos+1])\n\t\t\t}\n\t\t} else {\n\t\t\ttargetPos := lowerRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"L\" {\n\t\t\t\tfmt.Print(lookUpLowerRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpLowerRow[targetPos+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println()\n\n}\n", "lang": "Go", "bug_code_uid": "44ea9b7f134ab3ff0e8be1e2a9201bb3", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "fe32d6a581980cafe4013d0a549f8065", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.992548435171386, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tsecondDigit := n / 10\n\tfirstDigit := n / 100 * 10 + n % 10\n\n\tif firstDigit > secondDigit && firstDigit > n {\n\t\tfmt.Printf(\"%d\", firstDigit)\n\t}else if secondDigit > firstDigit && secondDigit > n {\n\t\tfmt.Printf(\"%d\", secondDigit)\n\t}else {\n\t\tfmt.Printf(\"%d\", n)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1b54f4ae4c574b0208fa8bfe50c94801", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "754df676263f0a38e428320eecd6c513", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6379647749510763, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tif n < 0 {\n\t\tn = -n\n\t\tsteplast := (n / 10) % 10\n\t\tif steplast == 0 {\n\t\t\tn = n / 10\n\t\t} else {\n\t\t\tn = n%10 + (n/100)*10\n\t\t}\n\t\tn = -n\n\t}\n\tfmt.Print(n)\n}\n", "lang": "Go", "bug_code_uid": "c52231b5e8752a0457a6359b6a8f94ad", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "50c1b200322bf83b1902f7aef14ebb74", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5833333333333334, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if s[0] == '-' {\n del := 1\n for i := 1; i < len(s); i++ {\n if s[del] < s[i] { del = i }\n }\n ans := 0\n for i := 1; i < len(s); i++ {\n if i != del { ans = (ans*10) + int(s[i]-'0') }\n }\n fmt.Println(-ans)\n } else {\n fmt.Println(s)\n }\n}\n", "lang": "Go", "bug_code_uid": "00af9c96cd214e48f9fc238c531f3976", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "629b5a7154481b23f75e9d5cccc921a6", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9565217391304348, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\n// A. Nearly Lucky Number\n// time limit per test\n// 2 seconds\n// memory limit per test\n// 256 megabytes\n// input\n// standard input\n// output\n// standard output\n\n// Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\n// Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of lucky digits in it is a lucky number. He wonders whether number n is a nearly lucky number.\n// Input\n\n// The only line contains an integer n (1 ≤ n ≤ 1018).\n\n// Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.\n// Output\n\n// Print on the single line \"YES\" if n is a nearly lucky number. Otherwise, print \"NO\" (without the quotes).\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar nLuckyDigits int\n\tfor ; n > 0; n /= 10 {\n\t\tdigit := n % 10\n\t\tif digit == 4 || digit == 7 {\n\t\t\tnLuckyDigits++\n\t\t}\n\t}\n\n\tfor ; nLuckyDigits > 0; nLuckyDigits /= 10 {\n\t\tdigit := nLuckyDigits % 10\n\t\tif digit != 4 && digit != 7 {\n\t\t\tfmt.Print(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Print(\"YES\")\n}\n", "lang": "Go", "bug_code_uid": "5ffbb908f778f014dd6df04965a05aad", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "537f664855be682dfba30f4976b94f50", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.42868525896414345, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"bytes\"\n\t\"strings\"\n\t\"io\"\n)\n\nfunc main() {\n\n\tbuf := new(bytes.Buffer)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanLines)\n\n\tstr := \"\"\n\n\tfor sc.Scan() {\n\t\tstr = sc.Text()\n\t\tbreak\n\t}\n\tlower := \"qwertyuiopasdfghjklzxcvbnm\"\n\trd := strings.NewReader(str)\n\tsc = bufio.NewScanner(rd)\n\tsc.Split(bufio.ScanRunes)\n\ti := 0\n\tfor sc.Scan() {\n\t\ti ++\n\t\tif i == 1 {\n\t\t\t{\n\t\t\t\tbuf.WriteString(strings.ToUpper(sc.Text()))\n\n\t\t\t}\n\t\t\tbuf.WriteString(strings.ToLower(sc.Text()))\n\t\t}\n\n\t}\n\tio.Copy(os.Stdout, buf)\n}\n", "lang": "Go", "bug_code_uid": "dac3fc24929348e714a546678075c897", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "1ebe902503ef2364a2b02d8c839dc0ad", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8891352549889135, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar ok = true\n\tfor i := 1; i < len(s); i++ {\n\t\tif 'a' <= s[i] && s[i] <= 'z' {\n\t\t\tok = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif ok {\n\t\tvar buffer bytes.Buffer\n\t\tbuffer.WriteRune(unicode.ToUpper(rune(s[0])))\n\t\tbuffer.WriteString(strings.ToLower(s[1:]))\n\t\tfmt.Print(buffer.String())\n\t\treturn\n\t}\n\tfmt.Print(s)\n}\n", "lang": "Go", "bug_code_uid": "1d14782856e2a020e6b0142e2b68bcb7", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "3274dddfa50d9e7798b5fa03110cfd98", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.33980582524271846, "equal_cnt": 29, "replace_cnt": 11, "delete_cnt": 14, "insert_cnt": 3, "fix_ops_cnt": 28, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, z, cnt, cnt1, cnt2 int\n\n\tscr := bufio.NewReader(os.Stdin)\n\tocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Fscanln(scr, &n, &m)\n\tt := make([]int, n)\n\tres := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(scr, \"%d\", &z)\n\n\t\tt[i] = z\n\t}\n\n\tfor x, y := range t {\n\t\tcnt += y\n\t\tif cnt > m {\n\t\t\tcnt2 = cnt\n\t\t\tsort.Ints(t[:x])\n\t\t\tfor i := len(t[:x]) - 1; i >= 0; i-- {\n\n\t\t\t\tcnt2 -= t[i]\n\t\t\t\tcnt1++\n\n\t\t\t\tif cnt2 <= m {\n\t\t\t\t\tres[x] = cnt1\n\t\t\t\t\tcnt1 = 0\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tres[x] = 0\n\t\t}\n\t}\n\n\tfor _, y := range res {\n\t\tfmt.Fprintf(ocr, \"%d \", y)\n\t}\n\tocr.Flush()\n\n}\n", "lang": "Go", "bug_code_uid": "135e8ba47ecccf7cbe851c786211fafe", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "b16a4801eb7fa69e0bbcab85741391f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9650793650793651, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n, m, k int\n\tfmt.Scan(&n, &m, &k)\n\tif n <= m || n <= k {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "645195b4a6ac919e5851dc65ef1eb4f3", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "0f271c532a5fdaa6170364f88b789d2a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9971070395371263, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tdo()\n}\n\nfunc do() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\ts.Scan()\n\tm, _ := strconv.Atoi(s.Text())\n\ts.Scan()\n\tk, _ := strconv.ParseInt(s.Text(), 10, 64)\n\ts.Scan()\n\tx, _ := strconv.Atoi(s.Text())\n\ts.Scan()\n\ty, _ := strconv.Atoi(s.Text())\n\n\tmin := minAsk(n, m, k)\n\tmax := maxAsk(n, m, k)\n\tcnt := count(n, m, x, y, k)\n\tfmt.Printf(\"%v %v %v\\n\", max, min, cnt)\n}\n\nfunc minAsk(n, m int, k int64) int64 {\n\tif n <= 2 {\n\t\treturn k / int64(n*m)\n\t}\n\n\tt := int64(2*n*m - 2*m)\n\tth := int64(n * m)\n\td := k / t\n\tr := k % t\n\n\tif r < th {\n\t\treturn d\n\t}\n\treturn d + 1\n}\n\nfunc maxAsk(n, m int, k int64) int64 {\n\tif n <= 2 {\n\t\td := k / int64(n*m)\n\t\tr := k % int64(n*m)\n\t\tif r > 0 {\n\t\t\treturn d + 1\n\t\t}\n\t\treturn d\n\t}\n\n\tt := int64(2*n*m - 2*m)\n\tth := int64(n * m)\n\td := k / t\n\tr := k % t\n\n\tif r <= int64(m) {\n\t\treturn d * 2\n\t} else if r <= th {\n\t\treturn d*2 + 1\n\t}\n\n\treturn d*2 + 2\n}\n\nfunc count(n, m, x, y int, k int64) int64 {\n\tif n <= 2 {\n\t\td := k / int64(n*m)\n\t\tr := k % int64(n*m)\n\t\tif r >= int64((x-1)*m+y) {\n\t\t\treturn d + 1\n\t\t}\n\t\treturn d\n\t}\n\n\tt := int64(2*n*m - 2*m)\n\tth := int64(n * m)\n\td := k / t\n\tr := k % t\n\n\tif x == 1 {\n\t\tif r >= int64(y) {\n\t\t\treturn d + 1\n\t\t}\n\t\treturn d\n\t} else if x == n {\n\t\tif r-int64((n-1)*m) >= int64(y) {\n\t\t\treturn d + 1\n\t\t}\n\t\treturn d\n\t} else {\n\t\tif r < int64((x-1)*m+y) {\n\t\t\treturn d * 2\n\t\t} else if r >= int64((x-1)*m+y) && r < th+int64((n-x-1)*m+y) {\n\t\t\treturn d*2 + 1\n\t\t}\n\t}\n\n\treturn d*2 + 2\n}\n", "lang": "Go", "bug_code_uid": "cc1e462295fc14993a943fa3a09b93af", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "fb2c97be6dae7e7186c8b726da3c4ec9", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9995643966894149, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\t\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tK := io.NextLong()\n\tX := io.NextInt()\n\tY := io.NextInt()\n\n\tvar desksPerPass int64\n\tif N == 1 {\n\t\tdesksPerPass = int64(M)\n\t} else {\n\t\tdesksPerPass = int64(M * (N + N - 2))\n\t}\n\tpasses := K / desksPerPass\n\n\tG := MakeMatrix(N + 1, M + 1)\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= M; j++ {\n\t\t\tswitch i {\n\t\t\t\tcase 1, M:\n\t\t\t\t\tG[i][j] = passes\n\t\t\t\tdefault:\n\t\t\t\t\tG[i][j] = 2 * passes\n\t\t\t}\n\t\t}\n\t}\n\t\n\tdr := 1\n\tr := 1\n\tc := 1\n\tfor rem := K - (passes * desksPerPass); rem > 0; rem-- {\n\t\tG[r][c]++\n\t\tif c == M {\n\t\t\tif r == N {\n\t\t\t\tdr = -1\n\t\t\t}\n\t\t\tc = 1\n\t\t\tr += dr\n\t\t} else {\n\t\t\tc++\n\t\t}\n\t}\n\n\tmin := int64(math.MaxInt64)\n\tmax := int64(0)\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= M; j++ {\n\t\t\tmin = Min(min, G[i][j])\n\t\t\tmax = Max(max, G[i][j])\n\t\t}\n\t}\n\t\n\tio.Printf(\"%d %d %d\\n\", max, min, G[X][Y])\n\t\n\tio.FlushOutput()\n}\n\nfunc MakeMatrix(rows, cols int) [][]int64 {\n\tmat := make([][]int64, rows)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, cols)\n\t}\n\treturn mat\n}\n\nfunc Min(lhs, rhs int64) int64 {\n\tif lhs < rhs {\n\t\treturn lhs\n\t} else {\n\t\treturn rhs\n\t}\n}\n\nfunc Max(lhs, rhs int64) int64 {\n\tif lhs > rhs {\n\t\treturn lhs\n\t} else {\n\t\treturn rhs\n\t}\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif (c == '-') {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif (c == '-') {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8bd9fff2400adc191af66788b8049dea", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "ce4f5f6a13ee6458c3415f05d080f2fd", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9392736362299662, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\t\n\tN := io.NextLong()\n\tM := io.NextLong()\n\tK := io.NextLong()\n\tX := io.NextLong()\n\tY := io.NextLong()\n\n\tmax := Max(GetAt(N, M, 1, 1, K), GetAt(N, M, N - 1, 1, K))\n\tmin := GetAt(N, M, N, M, K)\n\tsergey := GetAt(N, M, X, Y, K)\n\t\n\tio.Printf(\"%d %d %d\\n\", max, min, sergey)\n\t\n\tio.FlushOutput()\n}\n\nfunc GetAt(N, M, R, C, K int64) int64 {\n\tR--\n\tC--\n\tvar cnt int64\n\tif N == 1 {\n\t\tcnt = K / M\n\t\tif C < K % M {\n\t\t\tcnt++\n\t\t}\n\t} else {\n\t\tT := M * (N + N - 2)\n\t\tP := K / T\n\t\tif R == 0 || R == N - 1 {\n\t\t\tcnt = P\n\t\t} else {\n\t\t\tcnt = P * 2\n\t\t}\n\t\trem := K % T\n\t\t// fmt.Printf(\"(%d, %d), T = %d, P = %d, cnt = %d, rem = %d\\n\", R, C, T, P, cnt, rem)\n\t\t// fmt.Printf(\" idx1 = %d, idx2 = %d\\n\", (M * R) + C, M * ((2 * N) - R - 2) + C)\n\t\tif R < N - 1 && (M * R) + C < rem {\n\t\t\tcnt++\n\t\t}\n\t\tif M * ((2 * N) - R - 2) + C < rem {\n\t\t\tcnt++\n\t\t}\n\t}\n\t// fmt.Printf(\" cnt = %d\\n\", cnt)\n\treturn cnt\n}\n\nfunc Min(lhs, rhs int64) int64 {\n\tif lhs < rhs {\n\t\treturn lhs\n\t} else {\n\t\treturn rhs\n\t}\n}\n\nfunc Max(lhs, rhs int64) int64 {\n\tif lhs > rhs {\n\t\treturn lhs\n\t} else {\n\t\treturn rhs\n\t}\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n", "lang": "Go", "bug_code_uid": "9706d9a89ded302c584d53ca14f200c1", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "ce4f5f6a13ee6458c3415f05d080f2fd", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9405469678953626, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t// \"os\"\n\t)\n\nconst INF = 0x3f3f3f3f\n\nvar n, m, tot int\n\nfunc min(x, y int) int {\n\tif xy {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc main() {\n\t// fd, _ := os.Open(\"in.txt\")\n\t// os.Stdin = fd\n\tvar T int = 1\n\t// fmt.Scanf(\"%d\", &T)\n\tfor ci:=1; ci<=T; ci++ {\n\t\tvar l, r int\n\t\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &m, &l, &r)\n\t\t// fmt.Printf(\"Case #%d: \", ci)\n\t\tif l==1 && r==n {\n\t\t\tfmt.Println(0)\n\t\t} else if l==1 {\n\t\t\tif m<=r {\n\t\t\t\tfmt.Println(1+r-m)\n\t\t\t} else {\n\t\t\t\tfmt.Println(1-r+m)\n\t\t\t}\n\t\t} else if r==n {\n\t\t\tif m>1\n\t\t\tif m<=mid {\n\t\t\t\tfmt.Println(r+2-l+m-l)\n\t\t\t} else {\n\t\t\t\tfmt.Println(r+2-l+r-m)\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "e989c8bd2631de442ad6cf3e1530dcf3", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "4b6b3a8a280a42ccfcca5a3854c7738b", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.998422712933754, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// http://codeforces.com/contest/915/problem/B\npackage main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n if 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\n// comentar que nem gente\nfunc main() {\n\tvar n, pos, l, r int\n\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &pos, &l, &r)\n\tif l == 1 && r == n {\n\t\tfmt.Printf(\"0\\n\")\n\t} else if l == 1 {\n\t\tfmt.Printf(\"%d\\n\", abs(r - pos) + 1)\n\t} else if r == n {\n\t\tfmt.Printf(\"%d\\n\", abs(l - pos) + 2)\n\t} else {\n\t\tif abs(l - pos) < abs(r - pos) {\n\t\t\tfmt.Printf(\"%d\\n\", abs(l - pos) + r - l + 2)\n\t\t} else {\n\t\t\tfmt.Printf(\"%d\\n\", abs(r - pos) + r - l + 2)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "c5094216997c70b12bf290eb83740029", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "7c6a8d5b9989df7f5d8c24422d6ae99c", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9608355091383812, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tpos := readInt()\n\tl := readInt()\n\tr := readInt()\n\tif l == 1 && r == n {\n\t\tfmt.Println(0)\n\t} else if l == 1 {\n\t\tfmt.Println(r - pos + 1)\n\t} else if r == n {\n\t\tfmt.Println(pos - l + 1)\n\t} else {\n\t\tfmt.Println(min(pos-l+1+r-l+1, r-pos+1+r-l+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\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "82bcc5878f8ee2ac29111c9e311e73e2", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "c629721d32eda3e109032e5c78fe92a1", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9989094874591058, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst mod = 998244353\n\nvar factor [200005]int64\n\nfunc getFactorial(n int) {\n\tfactor[0], factor[1] = 1, 1\n\tvar i int64\n\tfor i = 2; i <= int64(n); i++ {\n\t\tfactor[i] = factor[i-1] * i % mod\n\t}\n}\n\nfunc quickPow(base int64, p int) int64 {\n\tvar answer int64 = 1\n\tfor p > 0 {\n\t\tif p & 1 == 1 {\n\t\t\tanswer = answer * base % mod\n\t\t}\n\t\tbase = base * base % mod\n\t\tp >>= 1\n\t}\n\treturn answer\n}\n\nfunc inv(n int64) int64 {\n\treturn quickPow(n, mod - 2)\n}\n\nfunc comb(n, m int) int64 {\n\treturn factor[n] * inv(factor[n-m]*factor[m]%mod) % mod\n}\n\nfunc main() {\n\tvar n, k int\n\t_, _ = fmt.Scan(&n)\n\t_, _ = fmt.Scan(&k)\n\tif n < k {\n\t\tfmt.Println(0)\n\t} else if k == 1 {\n\t\tfmt.Println(n)\n\t} else if k == n {\n\t\tfmt.Println(1)\n\t} else {\n\t\tvar factor = 1\n\t\tvar answer int64 = 0\n\t\tgetFactorial(n)\n\t\tfor n/factor >= k {\n\t\t\tanswer = (answer + comb(n/factor-1, k-1)) % mod\n\t\t\tfactor++\n\t\t}\n\t\tfmt.Println(answer)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d558713d4c51b6d93ba5f04e7781507d", "src_uid": "8e8eb64a047cb970a549ee870c3d280d", "apr_id": "0af017aa42264532f0703701bf234764", "difficulty": 2000, "tags": ["math", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7673674588665448, "equal_cnt": 22, "replace_cnt": 19, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 22, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc readInt(bytes []byte, from int, val *int) int {\n\ti := from\n\tsign := 1\n\tif bytes[i] == '-' {\n\t\tsign = -1\n\t\ti++\n\t}\n\ttmp := 0\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tn, k := readTwoNums(reader)\n\n\tfmt.Println(solve(n, k))\n}\n\nconst MAX_N = 100010\nconst MOD = 998244353\n\nvar F []int64\nvar IF []int64\n\n// var PM []int\n\nfunc pow(a, b int64) int64 {\n\tvar r int64 = 1\n\tfor b > 0 {\n\t\tif b&1 == 1 {\n\t\t\tr *= a\n\t\t\tr %= MOD\n\t\t}\n\t\ta *= a\n\t\ta %= MOD\n\t\tb >>= 1\n\t}\n\treturn r\n}\n\nfunc init() {\n\t// PM = make([]int, 0, 10000)\n\t// PM = append(PM, 1)\n\t// set := make([]bool, MAX_N)\n\n\t// for x := 2; x < MAX_N; x++ {\n\t// \tif set[x] {\n\t// \t\tcontinue\n\t// \t}\n\t// \tPM = append(PM, x)\n\t// \tfor y := x + x; y < MAX_N; y += x {\n\t// \t\tset[y] = true\n\t// \t}\n\t// }\n\n\tF = make([]int64, MAX_N)\n\tF[0] = 1\n\n\tfor i := 1; i < MAX_N; i++ {\n\t\tF[i] = int64(i) * F[i-1]\n\t\tF[i] %= MOD\n\t}\n\n\tIF = make([]int64, MAX_N)\n\tIF[MAX_N-1] = pow(F[MAX_N-1], MOD-2)\n\n\tfor i := MAX_N - 2; i >= 0; i-- {\n\t\tIF[i] = int64(i+1) * IF[i+1]\n\t\tIF[i] %= MOD\n\t}\n}\n\nfunc nCr(n, r int) int64 {\n\tif n < r {\n\t\treturn 0\n\t}\n\tres := F[n]\n\tres *= IF[r]\n\tres %= MOD\n\tres *= IF[n-r]\n\tres %= MOD\n\treturn res\n}\n\nfunc solve(n, k int) int {\n\tvar res int64\n\n\tfor x := 1; ; x++ {\n\t\t// x := PM[i]\n\t\td := n / x\n\t\tif d < k {\n\t\t\tbreak\n\t\t}\n\t\tres += nCr(d-1, k-1)\n\t\tres %= MOD\n\t}\n\n\treturn int(res)\n}\n", "lang": "Go", "bug_code_uid": "21cfe712551330622ab69eae86e21b75", "src_uid": "8e8eb64a047cb970a549ee870c3d280d", "apr_id": "ef0a3361bd61377e314d6a700ee90ff5", "difficulty": 2000, "tags": ["math", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.654434250764526, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tconst max_digits int = 10\n\tdigits := make([]rune, max_digits)\n\tlength := 0\n\treader := bufio.NewReader(os.Stdin)\n\tfor i := 0; i < max_digits; i++ {\n\t\tif c, _, err := reader.ReadRune(); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if c == '\\n' {\n\t\t\tlength = i\n\t\t\tbreak\n\t\t} else {\n\t\t\tdigits[i] = c\n\t\t}\n\t}\n\n\tfmt.Println(length)\n\tvar index int = 1 + 2*((1< 0 {\n\t\ti = i << 1\n\t\tif n%10 == 7 {\n\t\t\ti++\n\t\t}\n\t\tn /= 10\n\t\tk += p\n\t\tp <<= 1\n\t}\n\t// sumamos los de menos cifras\n\tfmt.Printf(\"%d\\n\", (1+i)+(k-1))\n}\n", "lang": "Go", "bug_code_uid": "7d9897dccac658e857aa7197e987f664", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "c7deb69183412a7760ca7eb8d6adfef9", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9627906976744186, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, n, rest, result int\n\tfmt.Scanln(&a, &b)\n\tn = a - b\n\tif n < 0 {\n\t\tn = -n\n\t}\n\trest = n % 2\n\tn /= 2\n\tresult = n*(n+1) + rest*(n+1)\n\tfmt.Println(result)\n}\n", "lang": "Go", "bug_code_uid": "2bc2e7c966cbf7deb4f210d64a1b61b3", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "50c5a608549c44a1007cf403c2800f7c", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8940719144800777, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scanf(\"%d\\n%s\", &n, &s)\n\t// log.Println(n, s)\n\tvar c [300]int\n\tfor i := range s {\n\t\tx := int(s[i])\n\t\tif x < 90 {\n\t\t\tx += 'a' - 'A'\n\t\t}\n\t\tc[x]++\n\t\t// log.Println(s[i], x)\n\t}\n\tans := func() bool {\n\t\tfor i := 'a'; i <= 'z'; i++ {\n\t\t\tif c[i] == 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}()\n\tif ans {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a8f5bac3c1c8c0c4986997335db4796d", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "57430e942a0fe0616a86a83468cbb6a9", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9832214765100671, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1024 * 1024)\n\tn := 0\n\tfmt.Sscanf(readLine(reader), \"%d\", &n)\n\tset := make(map[string]bool)\n\tif n < 26 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tline := readLine(reader)\n\t\tfor _,c := range line {\n\t\t\tset[string(c)] = true\n\t\t}\n\t\tif len(set) >= 26 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}", "lang": "Go", "bug_code_uid": "d0959f74da10d95d24fd8d56ca726536", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "d4ad36c2eda3d05dfea1fc55db1fa66c", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9296875, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport (\"fmt\")\n\nfunc main(){\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tst := make(map[byte]bool)\n\tfor i:=0 ;i m {\n\t\tx = n\n\t}else{\n\t\tx = m\n\t}\n\n\tif n < m {\n\t\ty = n\n\t}else{\n\t\ty = m\n\t}\n\n\tfmt.Print( x-1, y)\n", "lang": "Go", "bug_code_uid": "6255c0f7b9f666079def367a66253878", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "f1f40f2717650d652d978296d281e5d0", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "package main\nimport (\n “bufio”\n “fmt”\n “os”\n “strings”\n)\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString(‘\\n’)\n text = strings.ToLower(text)\n vocales := []string{“a”, “e”, “i”, “o”, “u”, “y”}\n for _, v := range vocales {\n if strings.Contains(text, v) == true {\n text = strings.Replace(text, v, “”, -1)\n }\n }\n text = strings.TrimSpace(text)\n textSlice := strings.Split(text, “”)\n newtextslice := []string{}\n for _, ts := range textSlice {\n ts = “.” + ts\n newtextslice = append(newtextslice, ts)\n }\n finalText := strings.Join(newtextslice, “”)\n fmt.Println(finalText)\n}", "lang": "Go", "bug_code_uid": "4da22d5679783841cc17d8e5ec58ff09", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "28935dc510cbab802952d995c2935a47", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9304257528556594, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar glasnie [12]byte = [12]byte{'A', 'O', 'Y', 'E', 'U', 'I', 'a', 'o', 'y', 'e', 'u', 'i'}\n\tvar c byte = 0\n\tvar flag bool = false\n\tfor {\n\t\tfmt.Scanf(\"%c\", &c)\n\t\tif c == '-' {\n\t\t\tbreak\n\t\t}\n\t\tfor i := 0; i < 12; i++ {\n\t\t\tif c == glasnie[i] {\n\t\t\t\tflag = true\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tflag = false\n\t\t\tcontinue\n\t\t}\n\t\tif int(c) < 97 {\n\t\t\tc = byte(int(c) + 32)\n\t\t}\n\t\tfmt.Printf(\".%c\", c)\n\t}\n}", "lang": "Go", "bug_code_uid": "cd662b5f7cb82828699a6b661b82debf", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "e5a10edf2231615353be406a8aa33d66", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9968404423380727, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc isVowel(letter rune) bool {\n\tif letter == 'a' || letter == 'e' || letter == 'i' || letter == 'o' || letter == 'u' || letter == \"y\" {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc getManuplatedString(someString string) string {\n\tvar constructedString string\n\n\tfor _, letter := range someString {\n\t\tlowerLetter := unicode.ToLower(letter)\n\t\tif isVowel(lowerLetter) {\n\t\t\tcontinue\n\t\t}\n\t\tconstructedString = constructedString + \".\" + string(lowerLetter)\n\t}\n\n\treturn constructedString\n}\n\nfunc main() {\n\tvar someString string\n\tfmt.Scan(&someString)\n\n\tfmt.Println(getManuplatedString(someString))\n\t\n}", "lang": "Go", "bug_code_uid": "b92c8a0f3a7b47fd739c00d026f7afc0", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "764aacb547670357a618bc19724a9d27", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4416, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var i int\n var s string\n fmt.Scan(&s)\n s=strings.ToLower(s)\n for(i=0;i= 'a' && s[i] <= 'z' {\n\t\t\tcurSet[s[i]] = true\n\t\t} else {\n\t\t\tsets = append(sets, curSet)\n\t\t\tcurSet = byteSet{}\n\t\t}\n\t}\n\n\tmaxSet := byteSet{}\n\n\tfor _, set := range sets {\n\t\tif len(set) > len(maxSet) {\n\t\t\tmaxSet = set\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", len(maxSet))\n}\n", "lang": "Go", "bug_code_uid": "325eb5508ee67a88dc8b01fc1d4b4489", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "20706ae37e8ec3772a5c13895be8334e", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7967479674796748, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\tvar s string\n\tfmt.Scanf(\"%s\\n\", &s)\n\n\tset := make(map[byte]bool)\n\n\tans := 0\n\n\tfor i := 0; i < N; i++ {\n\n\t\tif s[i] >= 'a' && s[i] <= 'z' {\n\t\t\tif _, ok := set[s[i]]; !ok {\n\t\t\t\tset[s[i]] = true\n\t\t\t}\n\t\t} else {\n\n\t\t\tcount := len(set)\n\t\t\tif count == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif ans < count {\n\t\t\t\tans = count\n\t\t\t}\n\t\t\tset = make(map[byte]bool)\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "26729fab54438636968e54945bc9c616", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "721b1718c8376bd09b0662be30ca155a", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.758789860997547, "equal_cnt": 19, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 11, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar r,c, hewtee, bosoo int\n\tvar s []string\n\t\n\tvar so string\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d\\n\", &r, &c)\n\tfor i := 0; i < r; i++{\n\t\tfmt.Fscanf(in, \"%s\\n\", &so)\n\t\ts = append(s, so)\n\t}\n\tfor i:=0; i < r; i++{\n\t\tvar found bool = false\n\t\tfor j:=0; j < c; j++{\n\t\t\tif string(s[i][j]) == \"S\"{\n\t\t\t\tfound = true\n\t\t\t}\n\t\t}\n\t\tif !found{\n\t\t\thewtee++\n\t\t}\n\t}\n\tfor i:=0; i < c; i++{\n\t\tvar found bool = false\n\t\tfor j:=0; j < r; j++{\n\t\t\tif string(s[j][i]) == \"S\"{\n\t\t\t\tfound = true\n\t\t\t}\n\t\t}\n\t\tif !found{\n\t\t\tbosoo++\n\t\t}\n\t}\n\tfmt.Println((hewtee * c) + bosoo * r - bosoo) \n}", "lang": "Go", "bug_code_uid": "e310bf8893b2ae27b842ca2edc703c72", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "f6f78b0f0a3d5d44143ff34890308df5", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7405247813411079, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n )\n\nfunc main() {\n var r, c int\n fmt.Scan(&r, &c)\n\n rs := 0\n cx := make([]bool, c, c)\n for i := 0; i < r; i++ {\n var line string\n fmt.Scan(&line)\n idx := strings.Index(line, \"S\")\n if idx >= 0 {\n rs++\n cx[idx] = true\n }\n }\n\n cs := 0\n for i := 0; i < c; i++ {\n if cx[i] {\n cs++\n }\n }\n\n fmt.Println(r*c - rs*cs)\n}\n", "lang": "Go", "bug_code_uid": "36874c80b0ef2207b6b103ecd4e9fbd1", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "720ae0817fb78bd81a6a4f6c8125e7f1", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982014388489209, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var r, c int\n fmt.Scan(&r, &c)\n\n rs := 0\n cx := make([]bool, c, c)\n for i := 0; i < r; i++ {\n var line string\n fmt.Scan(&line)\n find := false\n for j := 0; j < r; j++ {\n if line[j] == 'S' {\n find = true\n cx[j] = true\n }\n }\n if find {\n rs++\n }\n }\n\n cs := 0\n for i := 0; i < c; i++ {\n if cx[i] {\n cs++\n }\n }\n\n fmt.Println(r*c - rs*cs)\n}\n", "lang": "Go", "bug_code_uid": "a2f5b370ef4d246d79830b5148349ec9", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "720ae0817fb78bd81a6a4f6c8125e7f1", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6666666666666666, "equal_cnt": 19, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, t int\n\tfmt.Scan(&n, &k, &t)\n\tif n < t {\n\t\tn += k - t\n\t}\n\tif n > k {\n\t\tn = k\n\t}\n\tfmt.Println(n)\n}\n", "lang": "Go", "bug_code_uid": "8e13ecf4d2a68a87258a195b9142cc4f", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "41c58c05bb571e5a34cac4f683d091d5", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.32964601769911506, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t//\"sort\"\n)\n\nfunc main() {\n\tvar n,x int\n\tout := bufio.NewWriter(os.Stdout)\n\tcek:=0\n\tfmt.Scan(&n)\n\tfor i:=0;i 0; n >>= 1 {\n\t\t\tif n&1 == 1 {\n\t\t\t\tres = res * x % mod\n\t\t\t}\n\t\t\tx = x * x % mod\n\t\t}\n\t\treturn res\n\t}\n\tinv := func(a int64) int64 { return pow(a, mod-2) }\n\tdiv := func(a, b int64) int64 { return a%mod * inv(b) % mod }\n\tvar n int\n\tFscan(in, &n)\n\tf := make([]int64, n+1)\n\tf[0] = 1\n\tf[1] = div(1, 2)\n\tf[2] = div(1,4)\n\tfor i := 3; i <= n; i++ {\n\t\tf[i] = div(2*f[i-1]+f[i-2],4)\n\t}\n\tFprint(out, f[n])\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "9277288ef321132627908889b3997a60", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "d2f129b79c24115df9d622d535ba399c", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6998841251448435, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\tmod = 998244353\n\ti2 = (mod + 1) / 2\n)\n\nfunc main() {\n\tn := 0\n\tfmt.Scanf(\"%d\", &n)\n\tres := make([]uint64, n+1)\n\tres[0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j <= n; j += 2 {\n\t\t\tres[j] = (res[j] + res[i])\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", (res[n]*exp(i2, n))%mod)\n}\n\nfunc exp(a uint64, p int) (r uint64) {\n\tr = 1\n\tfor ; p > 0; p /= 2 {\n\t\tif p%2 == 1 {\n\t\t\tr = (a * r) % mod\n\t\t}\n\t\ta = (a * a) % mod\n\t}\n\treturn r\n}\n", "lang": "Go", "bug_code_uid": "6184d233916cfbcfc56aa95e2cff95b9", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "3b5f7273f2d9b1500427e8ee4acbf557", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9096477794793262, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n \"os\"\n \"math\"\n \"strconv\"\n)\n \nfunc main() {\n\tvar n uint64\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d \\n\", &n)\n result := int(math.Pow(5, float64(n)))\n stringresult := strconv.Itoa(result)\n fmt.Println(stringresult[len(stringresult)-2:len(stringresult)])\n}\n", "lang": "Go", "bug_code_uid": "61afc1b377ab6507bb57f855d8a2c20b", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "5d26ec4d88091d22915c20fd3b1940ab", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9037037037037037, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"hello world\")\n}", "lang": "Go", "bug_code_uid": "f22889278056a9aa13191aa724963586", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "67cc94233f012985772da709e8af1136", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.904707233065442, "equal_cnt": 21, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "/*\nAttempting https://codeforces.com/contest/1384/problem/B2\nwhich will take care of B1 also, if works\n*/\n\npackage 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\treader := bufio.NewReader(os.Stdin)\n\tline1, _ := reader.ReadString('\\n')\n\tline1_arr := strings.Fields(line1)\n\t// fmt.Println(line1_arr)\n\tT, _ := strconv.Atoi(line1_arr[0])\n\t//fmt.Println(\"T:\", T)\n\tfor t := 0; t < T; t++ {\n\t\tline2, _ := reader.ReadString('\\n')\n\t\tline2_arr := strings.Fields(line2)\n\t\tN, _ := strconv.Atoi(line2_arr[0])\n\t\tK, _ := strconv.Atoi(line2_arr[1])\n\t\tL, _ := strconv.Atoi(line2_arr[2])\n\t\t// fmt.Println(N, K, L)\n\t\tline3, _ := reader.ReadString('\\n')\n\t\tAstr := strings.Fields(line3)\n\t\tA := make([]int, N)\n\t\tvar safe []int\n\t\tsoln_possible := true\n\t\tfor i:=0; i L {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\tsoln_possible = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(\"A:\", A)\n\t\t//fmt.Println(\"safe:\", safe)\n\n\t\tif !soln_possible {\n\t\t\tcontinue\n\t\t}\n\n\t\tsafe_ind := 0\n\t\tlower_bound := -1\n\t\tupper_bound := N\n\t\tif len(safe) > 0 {\n\t\t\tupper_bound = safe[safe_ind]\n\t\t}\n\t\tres := \"Yes\"\n\t\tfor true {\t\t\t\n\n\t\t\tretval := is_path_safe(lower_bound, upper_bound, K, L, A)\n\t\t\t//\tfmt.Println(\"is_path_safe() beg: \", lower_bound, \"end: \", upper_bound, \"retval: \", retval)\n\t\t\tif !retval {\n\t\t\t\tres = \"No\"\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tif safe_ind > len(safe) -1 {\n\t\t\t\t\tbreak \n\t\t\t\t}\n\n\t\t\t\tlower_bound = safe[safe_ind]\n\t\t\t\tsafe_ind++\n\t\t\t\tif safe_ind > len(safe) -1 {\n\t\t\t\t\tupper_bound = N\n\t\t\t\t} else {\n\t\t\t\t\tupper_bound = safe[safe_ind]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(res)\n\t}\n}\n\nfunc is_path_safe(beg, end, K, L int, A []int) bool {\t\n\tabeg := beg + 1\n\taend := end - 1\n\tif abeg >= aend {\n\t\treturn true\n\t}\n\n\tt := 0\n\tk := K\n\tfor i:=abeg; i<=aend; i++ {\n\t\tx := A[i] + k - L\n\t\tif x > 0 {\n\t\t\tt += x\n\t\t\tk = get_k_phase(K, k, t)\n\t\t} else {\n\t\t\tt++\n\t\t}\n\n\n\t}\n\n\t// fmt.Println(\"t: \", t)\n\tif t >= 2*K {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc get_k_phase(K, k, t int) int {\n\tt %= 2*K\n\tif t <= K {\n\t\treturn k - t\n\t} else {\n\t\treturn k\n\t}\n}", "lang": "Go", "bug_code_uid": "0cfdf2a5ca1097029f613d24099f8434", "src_uid": "4941b0a365f86b2e2cf686cdf5d532f8", "apr_id": "48c382ace55bf23cb5ecb15be5ac8b31", "difficulty": 1900, "tags": ["dp", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9218436873747495, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z, a, b, c int32\n\tfmt.Scanf(\"%d %d %d\\n\", x, y, z)\n\tfmt.Scanf(\"%d %d %d\", a, b, c)\n\tif (a < x) || (a+b < x+y) || (a+b+c < x+y+z) {\n\t\tfmt.Printf(\"NO\")\n\t\treturn\n\t}\n\tfmt.Printf(\"YES\")\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "7276254312ef149d0771d474c12dfab0", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "c57dc03d90dcc45c7dd879a9a63e7baa", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9980237154150198, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc check(x, y, z, a, b, c int) bool {\n if a < x {\n return false\n }\n if c < z {\n return x+y <= a+b\n }\n return x+y+z <= a+b+c\n}\n\nfunc main() {\n var x, y, z, a, b, c int\n for {\n _, err := fmt.Scanf(\"%d %d %d\\n%d %d %d\", &x, &y, &z, &a, &b, &c)\n if err != nil {\n return\n }\n if check(x, y, z, a, b, c) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n }\n}", "lang": "Go", "bug_code_uid": "a773e09a8be2521517946fb4a166ea7e", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "a5358a726045b16756426f7a035af795", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7301587301587301, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x {\n return 0\n }\n if a+b >= x+y {\n return 0\n }\n if a+b+c >= x+y+z {\n return 0\n }\n return 1\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tif solve(x,y,z,a,b,c) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "ab5b17d481c8d74b716a90065eaf3123", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "19abe834fba008c9669b9b9076674403", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9415292353823088, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x || a+b >= x+y || a+b+c >= x+y+z {\n return 0\n }\n return 1\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n if solve(x, y, z, a, b, c) == 1 {\n fmt.Println(\"YES\")\n\t} else {\n fmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "1e07c02d958063f21831c860177e7b06", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "19abe834fba008c9669b9b9076674403", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7183246073298429, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a,b int64\n fmt.Scanf(\"%d %d \",&a, &b)\n var sq int64\n for true{\n if a == b {\n sq++\n break\n }\n if a <= 0 || b <= 0 {\n break\n }\n if a == 1{\n sq+=b\n break\n }\n if b == 1{\n sq+=a\n break\n }\n if a>b{\n a,b = a-b, b\n sq++\n }else {\n a, b = a, b-a\n sq++\n }\n }\n fmt.Printf(\"%d\", sq)\n}\n", "lang": "Go", "bug_code_uid": "c94097d1322eb6acc0d232d5acff5e9b", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "67c0b9fa079dc9f32c127cadc8b31b80", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8103130755064457, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d%d\", &a, &b)\n var sum = 0\n var x = a % b\n sum = sum + a/b\n for x > 0 {\n sum = sum + a/b\n x = a % b\n }\n fmt.Println(sum)\n}\n", "lang": "Go", "bug_code_uid": "4cd78f797a6cdab731a96670b5aa6a6b", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "37594b71a586195406fa64ba0476f51e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9248554913294798, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, k int64\n\tfmt.Scanf(\"%d %d %d\", &l, &r, &k)\n\tm := foo(l, r, k)\n\tfmt.Print(m)\n}\nfunc foo(l, r, k int64) int64 {\n\tmin := Min(l, r)\n\tmax := Max(l, r)\n\tif min+k < max {\n\t\treturn 2 * (min + k)\n\t} else {\n\t\treturn 2 * max\n\t}\n}\nfunc Min(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc Max(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "lang": "Go", "bug_code_uid": "2c0ec9e66ca489b9eabb7310b7d37e9e", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "205c21c307fe8601e4a8b2c9fe28eba2", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9793406593406594, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "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\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// 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\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 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\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\nfunc main() {\n\tdefer Flush()\n\n\tl := readi()\n\tr := readi()\n\ta := readi()\n\n\tif a == 0 {\n\t\tprintln(min(l, r) * 2)\n\t} else if max(l, r)-max(l, r) <= a {\n\t\tprintln((l + r + a) &^ 1)\n\t} else {\n\t\tprintln((min(l, r) + a) * 2)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "2180cbcb448a4690cb09a8d9ec0d4bff", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "64f443c6f10b2ec594f960985d56edf9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8831683168316832, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r, a int\n\tfmt.Scanf(\"%d %d %d\", &l, &r, &a)\n\n\tif l > r {\n\t\ttmp := l\n\t\tl = r\n\t\tr = tmp\n\t}\n\n\tres := l\n\tif r-l < a/2 {\n\t\tres += (a + r - l) / 2\n\t} else {\n\t\tres += a / 2\n\t}\n\n\tres *= 2\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "ceb6ec691ffa009e01b530152ca92b31", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "dd29885d6158367d96bc7dfec880b8a3", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9490761604326273, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc gcd(a, b int64) int64 {\n//\tfmt.Printf(\"->%d %d\\n\",a,b)\n\tif b%a == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b%a, a)\n}\nfunc solveD(l, n, k int64) (int64) {\n\n\tgc := gcd(l, n*k)\n\ttmp := n * k/gc\n\tif tmp < 0{\n\t\tfmt.Printf(\"%d %d %d\\n\",l,n,k)\n\t}\n\ttmp *= l\n\tif tmp < 0{\n\t\tfmt.Printf(\"-%d %d %d\\n\",l,n,k)\n\t}\n\treturn tmp / l\n}\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\tvar n, k int64\n\tvar a, b int64\n\tfmt.Fscanf(buf, \"%d %d\\n\", &n, &k)\n\tfmt.Fscanf(buf, \"%d %d\\n\", &a, &b)\n\tbasic := make([]int64, 0)\n\tfor _, v1 := range [2]int64{a, (k - a)%k} {\n\t\tfor _, v2 := range [2]int64{b, (k - b)%k} {\n\t\t\tif v2-v1 == 0 {\n\t\t\t\tbasic = append(basic, k)\n\t\t\t} else if v2-v1 > 0 {\n\t\t\t\tbasic = append(basic, v2-v1)\n\t\t\t} else {\n\t\t\t\tbasic = append(basic, k+v2-v1)\n\t\t\t}\n\t\t}\n\t}\n\tvar minx int64 = -1\n\tvar maxx int64 = -1\n//\tfmt.Printf(\"%v\\n\", basic)\n\tfor _, v := range basic {\n\t\tfor i := int64(0); i < n; i++ {\n\t\t\ttmp := solveD(v+i*k,n,k)\n\t\t\tif minx == -1||minx > tmp{\n\t\t\t\tminx = tmp\n\t\t\t}\n\t\t\tif maxx == -1 || maxx < tmp{\n\t\t\t\tmaxx = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", minx,maxx)\n\n}\n\n/**\n01010101\n0101010\n */\n", "lang": "Go", "bug_code_uid": "d1130e61b4737095968b5386b42d7b62", "src_uid": "5bb4adff1b332f43144047955eefba0c", "apr_id": "657ac0c8247edf5177ee5847af6935d0", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.92141652613828, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tboard := make([]string, 8)\n\tmaxB, minW := 0, 10\n\n\tfor i := range board {\n\t\tboard[i] = next()\n\t}\n\n\tfor c := 0; c < 8; c++ {\n\t\tb, w := -1, -1\n\t\tfor r := 0; r < 8; r++ {\n\t\t\tif board[r][c] == 'B' {\n\t\t\t\tb = r\n\t\t\t}\n\n\t\t\tif w == -1 && board[r][c] == 'W' {\n\t\t\t\tw = r\n\t\t\t}\n\t\t}\n\n\t\t// println(w, b, minW, maxB)\n\t\tif w != -1 && b != -1 && w > b {\n\t\t\tcontinue\n\t\t}\n\n\t\tif w != -1 && w < minW {\n\t\t\tminW = w\n\t\t}\n\n\t\tif b != -1 && b > maxB {\n\t\t\tmaxB = b\n\t\t}\n\t}\n\n\t// println(minW, maxB)\n\tmaxB = 8 - maxB - 1\n\t// println(minW, maxB)\n\tif minW <= maxB {\n\t\tprintln(\"A\")\n\t} else {\n\t\tprintln(\"B\")\n\t}\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "ea19dc3930ead30f765a88e625adc9da", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "dd104d7097c9298d43fe6d9ad57f20d7", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8492274906766116, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/592/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(board [8]string) string {\n\thighestWhitePawn := 0\n\tlowestBlackPawn := 0\n\tfor j := 0; j < 8; j++ {\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tif string(board[i][j]) == \"B\" {\n\t\t\t\tbreak\n\t\t\t} else if string(board[i][j]) == \"W\" {\n\t\t\t\thighestWhitePawn = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor i := 7; i >= 0; i-- {\n\t\t\tif string(board[i][j]) == \"W\" {\n\t\t\t\tbreak\n\t\t\t} else if string(board[i][j]) == \"B\" {\n\t\t\t\tlowestBlackPawn = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif highestWhitePawn <= 7-lowestBlackPawn {\n\t\treturn \"A\"\n\t}\n\treturn \"B\"\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar board [8]string\n\tfor i := 0; i < 8; i++ {\n\t\tfmt.Fscanf(reader, \"%s\\n\", &board[i])\n\t}\n\tfmt.Fprintf(writer, \"%s\\n\", Solve(board))\n}\n", "lang": "Go", "bug_code_uid": "5fc7b34e8debbbaf60e660b32295cd8a", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "3107d33767155a423c32f094bbe51524", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.649645390070922, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "// Try Codeforces\n// author: Leonrdone @ NEETSDKASU\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\tans := n\n\tfor i, x := range xs[1:] {\n\t\tif xs[i] == 1 && x == 0 {\n\t\t\tans--\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "b45e2f1a7c43a4c9a1d5afcdce3d2e2e", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "7bdc0111d09f239b31e898080ef52115", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6004228329809725, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst maxTokenSize = 512 * 1024\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, maxTokenSize), maxTokenSize)\n\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\n\ta := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ta[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\n\tvar l, r int\n\n\tfor l < n {\n\t\tif a[l] == 1 {\n\t\t\tbreak\n\t\t}\n\t\tl++\n\t}\n\n\tr = n - 1\n\tfor r > n-1 {\n\t\tif a[r] == 0 {\n\t\t\tbreak\n\t\t}\n\t\tr--\n\t}\n\tvar ones, zeroes int\n\tfor i := l; i < r; i++ {\n\t\tif a[i] == 1 {\n\t\t\tones++\n\t\t} else {\n\t\t\tzeroes++\n\t\t}\n\t}\n\tif ones < zeroes {\n\t\tfmt.Println(n - ones)\n\t} else {\n\t\tfmt.Println(n - zeroes)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "23877eb6f46067dc9c65e3ca16c3f43e", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "53bf0095f6782d7697dcd8102cf1b757", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9630089374379345, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "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\"sync\"\n)\n\nfunc main() {\n\tA, B, C, D := scanInt64(), scanInt64(), scanInt64(), scanInt64()\n\tvar count = 0\n\tfor x := A; x <= B; x++ {\n\t\tfor y := B; y <= C; y++ {\n\t\t\tfor z := C; z <= D; z++ {\n\t\t\t\tif x + y > z && x + z > y && y + z > x {\n\t\t\t\t\tcount ++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t_, _ = printFmt(count)\n}\n\n\n/*********************** I/O ***********************/\n\nvar channelType chan string\nvar in *bufio.Scanner\nvar oWg *sync.WaitGroup\nvar printFmt func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tprintFmt = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n\n\tchannelType = make(chan string, 16)\n\toWg = &sync.WaitGroup{}\n\toWg.Add(1)\n\n\twriter := bufio.NewWriter(os.Stdout)\n\tgo func() {\n\t\tdefer oWg.Done()\n\t\tdefer writer.Flush()\n\n\t\tfor line := range channelType {\n\t\t\t_, _ = writer.WriteString(line + \"\\n\")\n\t\t}\n\t}()\n}\n\nfunc scanString() string {in.Scan(); return in.Text() }\nfunc scanInt() int {i, _ := strconv.Atoi(scanString()); return i}\nfunc scanInt64() int64 {i, _ := strconv.ParseInt(scanString(), 10, 64); return i}\nfunc scanStringSlice(n int) []string {s := make([]string, n); for i := 0; i < n; i++ {s[i] = scanString()}; return s}\nfunc scanIntSlice(n int) []int {arr := make([]int, n); for i := 0; i < n; i++ {arr[i] = scanInt()}; return arr}\nfunc scanInt64Slice(n int64) []int64 {arr := make([]int64, n); for i := int64(0); i < n; i++ {arr[i] = scanInt64()}; return arr}\n\n/*********************** Utils ***********************/\n\n\nfunc stringEquivalent(v interface{}) string {return fmt.Sprintf(\"%v\", v)}\nfunc spaceSeperatedStringFromArray(a []int) string {sb := strings.Builder{}; sb.Grow(len(a) * 9); for i := range a {sb.WriteString(strconv.Itoa(a[i]) + \" \")}; return sb.String()}\nfunc spaceSeperatedStringFromArray64(a []int64) string {sb := strings.Builder{}; sb.Grow(len(a) * 9); for i := range a {sb.WriteString(strconv.FormatInt(a[i], 10) + \" \")}; return sb.String()}\nfunc minMaxFromArray(args ...int64) (int64, int64) {minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64); for _, v := range args {if v < minVal {minVal = v}; if v > maxVal {maxVal = v}}; return minVal, maxVal}\nfunc minElementFromArray(args ...int64) int64 { mn, _ := minMaxFromArray(args...); return mn }\nfunc maxElementFromArray(args ...int64) int64 { _, mx := minMaxFromArray(args...); return mx }\nfunc lcmCalculation(a, b int64) int64 {return a / gcdCalculation(a, b) * b}\nfunc gcdCalculation(a, b int64) int64 {if a == 0 {return b}; return gcdCalculation(b%a, a)}\nfunc sortInt64Slice(a []int64) {sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })}\nfunc absoluteValue(x int64) int64 {if x < 0 {return -x}; return x}\nfunc min(args ...int64) int64 { mn, _ := MnMx(args...); return mn }\nfunc max(args ...int64) int64 { _, mx := MnMx(args...); return mx }\nfunc MnMx(args ...int64) (int64, int64) {\n\tminVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}\nfunc sorting(array []int64, fromElement int, toElement int) []int64 {\n\tvar arr []int64\n\tfor i := fromElement; i <= toElement; i++ {\n\t\tarr = append(arr, array[i])\n\t}\n\tsort.Slice(arr, func(i, j int) bool { return arr[i] < arr[j] })\n\ts := 0\n\tfor i := fromElement; i <= toElement; i++ {\n\t\tarray[i] = arr[s]\n\t\ts++\n\t}\n\treturn array\n}\n\nfunc reverse(numbers []int64) []int64 {\n\tfor i, j := 0, len(numbers)-1; i < j; i, j = i+1, j-1 {\n\t\tnumbers[i], numbers[j] = numbers[j], numbers[i] }\n\treturn numbers\n}\n\nfunc reversing(array []int64, fromElement int, toElement int) []int64 {\n\tvar arr []int64\n\tfor i := fromElement; i <= toElement; i++ {\n\t\tarr = append(arr, array[i])\n\t}\n\tarr = reverse(arr)\n\ts := 0\n\tfor i := fromElement; i <= toElement; i++ {\n\t\tarray[i] = arr[s]\n\t\ts++\n\t}\n\treturn array\n}\n\nfunc arraySum(array []int) int {\n\tvar ans = 0\n\tfor _, element := range array {\n\t\tans += element\n\t}\n\treturn ans\n}\n", "lang": "Go", "bug_code_uid": "5d6f87145c9866eefb254458084828b5", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "12ddd92ed380f9f008efc0e247c25564", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.790618044855333, "equal_cnt": 27, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 18, "fix_ops_cnt": 27, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\ta, b, c, d := ScanInt(), ScanInt(), ScanInt(), ScanInt()\n\tP(solve(a, b, c, d))\n\n\tout.Flush()\n}\n\nfunc solve(a, b, c, d int) int64 {\n\tsum := int64(0)\n\tp := make([]int, Mx(b+c+2, d+2))\n\tfor i := a; i <= b; i++ {\n\t\tp[i+b] += 1\n\t\tp[i+c+1] += -1\n\t}\n\tfor i := 1; i < len(p); i++ {\n\t\tp[i] += p[i-1]\n\t}\n\n\tfor i := Mx(b+c+1, d+1); i >= a; i-- {\n\t\tp[i-1] += p[i]\n\t}\n\n\tP(p)\n\tfor i := c; i <= d; i++ {\n\t\tsum += int64(p[i+1])\n\t}\n\treturn sum\n}\n\n/*********************** I/O ***********************/\nvar in *bufio.Scanner\nvar out *bufio.Writer\n\nfunc init() {\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n\tout = bufio.NewWriter(os.Stdout)\n}\n\nfunc P(args ...interface{}) {\n\tprint(\"\\n\", args...)\n}\n\nfunc PS(args ...interface{}) {\n\tprint(\" \", args...)\n\tprint(\"\\n\", nil)\n}\n\nfunc print(seperator string, args ...interface{}) {\n\tfor _, arg := range args {\n\t\tstr := \"\"\n\t\tswitch v := arg.(type) {\n\t\tcase byte:\n\t\t\tstr = string(v)\n\t\tcase rune:\n\t\t\tstr = string(v)\n\t\tcase int:\n\t\t\tstr = strconv.Itoa(v)\n\t\tcase []int:\n\t\t\tsb := strings.Builder{}\n\t\t\tfor i := 0; i < len(v); i++ {\n\t\t\t\tsb.WriteString(strconv.Itoa(v[i]) + \" \")\n\t\t\t}\n\t\t\tstr = sb.String()\n\t\tcase int64:\n\t\t\tstr = strconv.FormatInt(v, 10)\n\t\tcase []int64:\n\t\t\tsb := strings.Builder{}\n\t\t\tfor i := 0; i < len(v); i++ {\n\t\t\t\tsb.WriteString(strconv.FormatInt(v[i], 10) + \" \")\n\t\t\t}\n\t\t\tstr = sb.String()\n\t\tcase string:\n\t\t\tstr = v\n\t\t}\n\t\tout.WriteString(str + seperator)\n\t}\n}\n\nfunc ScanWord() string { in.Scan(); return in.Text() }\nfunc ScanWords(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ScanWord()\n\t}\n\treturn s\n}\nfunc ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }\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 MnMx(args ...int) (int, int) {\n\tminVal, maxVal := math.MaxInt32, math.MinInt32\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}\nfunc Mn(args ...int) int { mn, _ := MnMx(args...); return mn }\nfunc Mx(args ...int) int { _, mx := MnMx(args...); return mx }\nfunc LCM(a, b int) int { return a / GCD(a, b) * b }\nfunc GCD(a, b int) int {\n\tif a == 0 {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\nfunc Abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "lang": "Go", "bug_code_uid": "90b93723ba706ff43902458e3db687ff", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "eb1c1e6f39f7608b8421f94f1fe821fc", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9290953545232273, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\ntype BufferedWriter interface {\n\tPrintf(format string, a ...interface{})\n\tFlush()\n}\n\ntype writerImpl struct {\n\t*bufio.Writer\n}\n\nfunc NewBufferedWriter(writer io.Writer) BufferedWriter {\n\treturn &writerImpl{Writer: bufio.NewWriter(writer)}\n}\n\nfunc (impl *writerImpl) Printf(f string, a ...interface{}) {\n\tfmt.Fprintf(impl.Writer, f, a...)\n}\n\nfunc (impl *writerImpl) Flush() {\n\timpl.Writer.Flush()\n}\n\ntype WordScanner interface {\n\tNextInt64() int64\n\tNextUInt64() uint64\n\tNextString() string\n}\n\ntype wordScannerImpl struct {\n\t*bufio.Scanner\n}\n\nfunc NewWordScanner(reader io.Reader) WordScanner {\n\ts := bufio.NewScanner(reader)\n\ts.Split(bufio.ScanWords)\n\t// adjust the following size as needed\n\t// 2 << 17 is good enough to scan strings of len 2*10^5\n\t// it could go as high as 2 << 26 before cf judge breaks\n\tsize := 2 << 20\n\tbuf := make([]byte, size)\n\ts.Buffer(buf, size)\n\treturn &wordScannerImpl{Scanner: s}\n}\n\nfunc (impl *wordScannerImpl) NextInt64() int64 {\n\timpl.Scan()\n\tbb := impl.Bytes()\n\ti := int64(0)\n\tif bb[0] == '-' {\n\t\tfor _, b := range bb[1:] {\n\t\t\ti *= 10\n\t\t\ti -= int64(b - '0')\n\t\t}\n\t\treturn i\n\t}\n\tfor _, b := range bb {\n\t\ti *= 10\n\t\ti += int64(b - '0')\n\t}\n\treturn i\n}\n\nfunc (impl *wordScannerImpl) NextUInt64() uint64 {\n\timpl.Scan()\n\tbb := impl.Bytes()\n\ti := uint64(0)\n\tfor _, b := range bb {\n\t\ti *= 10\n\t\ti += uint64(b - '0')\n\t}\n\treturn i\n}\n\nfunc (impl *wordScannerImpl) NextString() string {\n\timpl.Scan()\n\treturn impl.Text()\n}\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn a * b / gcd(a, b)\n}\n\nfunc abs(a int64) int64 {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a int64, rest ...int64) int64 {\n\tfor _, r := range rest {\n\t\tif r < a {\n\t\t\ta = r\n\t\t}\n\t}\n\treturn a\n}\n\nfunc max(a int64, rest ...int64) int64 {\n\tfor _, r := range rest {\n\t\tif r > a {\n\t\t\ta = r\n\t\t}\n\t}\n\treturn a\n}\n\nconst (\n\tINF = math.MaxInt64\n\tMOD = 1e9 + 7\n)\n\nvar reader = NewWordScanner(os.Stdin)\nvar writer = NewBufferedWriter(os.Stdout)\n\nfunc main() {\n\tdefer writer.Flush()\n\ta, b, c, d := reader.NextInt64(),reader.NextInt64(),reader.NextInt64(),reader.NextInt64()\n\tans := int64(0)\n\tfor x := a; x <= b; x++ {\n\t\tfor y := b; y <= c; y++ {\n\t\t\tif x + y > d {\n\t\t\t\tans += d-c+1\n\t\t\t} else if x + y > c {\n\t\t\t\tans += (x+y-c)\n\t\t\t}\n\t\t\twriter.Printf(\"%d %d %d\\n\", x, y, ans)\n\t\t}\n\t}\n\twriter.Printf(\"%d\\n\", ans)\n}\n", "lang": "Go", "bug_code_uid": "62a3e138fdbd96b36cc1daa495d4c79b", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "a00a155fff4da56a559bbeaec13b5e0e", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9219071105630908, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\ntype BufferedWriter interface {\n\tPrintf(format string, a ...interface{})\n\tFlush()\n}\n\ntype writerImpl struct {\n\t*bufio.Writer\n}\n\nfunc NewBufferedWriter(writer io.Writer) BufferedWriter {\n\treturn &writerImpl{Writer: bufio.NewWriter(writer)}\n}\n\nfunc (impl *writerImpl) Printf(f string, a ...interface{}) {\n\tfmt.Fprintf(impl.Writer, f, a...)\n}\n\nfunc (impl *writerImpl) Flush() {\n\timpl.Writer.Flush()\n}\n\ntype WordScanner interface {\n\tNextInt64() int64\n\tNextUInt64() uint64\n\tNextString() string\n}\n\ntype wordScannerImpl struct {\n\t*bufio.Scanner\n}\n\nfunc NewWordScanner(reader io.Reader) WordScanner {\n\ts := bufio.NewScanner(reader)\n\ts.Split(bufio.ScanWords)\n\t// adjust the following size as needed\n\t// 2 << 17 is good enough to scan strings of len 2*10^5\n\t// it could go as high as 2 << 26 before cf judge breaks\n\tsize := 2 << 20\n\tbuf := make([]byte, size)\n\ts.Buffer(buf, size)\n\treturn &wordScannerImpl{Scanner: s}\n}\n\nfunc (impl *wordScannerImpl) NextInt64() int64 {\n\timpl.Scan()\n\tbb := impl.Bytes()\n\ti := int64(0)\n\tif bb[0] == '-' {\n\t\tfor _, b := range bb[1:] {\n\t\t\ti *= 10\n\t\t\ti -= int64(b - '0')\n\t\t}\n\t\treturn i\n\t}\n\tfor _, b := range bb {\n\t\ti *= 10\n\t\ti += int64(b - '0')\n\t}\n\treturn i\n}\n\nfunc (impl *wordScannerImpl) NextUInt64() uint64 {\n\timpl.Scan()\n\tbb := impl.Bytes()\n\ti := uint64(0)\n\tfor _, b := range bb {\n\t\ti *= 10\n\t\ti += uint64(b - '0')\n\t}\n\treturn i\n}\n\nfunc (impl *wordScannerImpl) NextString() string {\n\timpl.Scan()\n\treturn impl.Text()\n}\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn a * b / gcd(a, b)\n}\n\nfunc abs(a int64) int64 {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a int64, rest ...int64) int64 {\n\tfor _, r := range rest {\n\t\tif r < a {\n\t\t\ta = r\n\t\t}\n\t}\n\treturn a\n}\n\nfunc max(a int64, rest ...int64) int64 {\n\tfor _, r := range rest {\n\t\tif r > a {\n\t\t\ta = r\n\t\t}\n\t}\n\treturn a\n}\n\nconst (\n\tINF = math.MaxInt64\n\tMOD = 1e9 + 7\n)\n\nvar reader = NewWordScanner(os.Stdin)\nvar writer = NewBufferedWriter(os.Stdout)\n\nfunc main() {\n\tdefer writer.Flush()\n\ta, b, c, d := reader.NextInt64(),reader.NextInt64(),reader.NextInt64(),reader.NextInt64()\n\tans := int64(0)\n\tfor x := a; x <= b; x++ {\n\t\tfor y := b; y <= c; y++ {\n\t\t\tif x + y > d {\n\t\t\t\tans += d-c+1\n\t\t\t} else if x + y > c {\n\t\t\t\tans += (x+y-c)\n\t\t\t}\n\t\t}\n\t}\n\twriter.Printf(\"%d\\n\", ans)\n}\n", "lang": "Go", "bug_code_uid": "cd155e9124286a2fac6c6fe287f95873", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "a00a155fff4da56a559bbeaec13b5e0e", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9748987854251012, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "// aaa project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc getTime1(h, m int) int {\n\treturn h*60 + m\n}\n\nfunc getTime2(time int) (int, int) {\n\treturn time / 60, time % 60\n}\n\nfunc ok(curtime int) bool {\n\th, m := getTime2(curtime)\n\tif h/10 == 7 || h%10 == 7 {\n\t\treturn false\n\t} else if m/10 == 7 || m%10 == 7 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc main() {\n\tvar x, h, m int\n\tfmt.Scanf(\"%d\\n%d %d\", &x, &h, &m)\n\talltime := 0\n\tcurtime := getTime1(h, m)\n\t//fmt.Println(curtime)\n\tfor ok(curtime) {\n\t\tcurtime -= x\n\t\tif curtime < 0 {\n\t\t\tcurtime += 23*60 + 59\n\t\t}\n\t\talltime++\n\t}\n\tfmt.Println(alltime)\n}\n", "lang": "Go", "bug_code_uid": "1a2161e68b961a0c1c70f1840c9f3726", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "6f8b36be9050f2f6bb327325abbb102f", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.978891820580475, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc main() {\n\tvar x, h, m int\n\tfmt.Scanf(\"%d\\n%d %d\", &x, &h, &m)\n\tfmt.Println(m)\n\tt := time.Date(2000, time.November, 10, h, m, 0, 0, time.UTC)\n\ti := 0\n\tfor true {\n\t\thour := t.Hour()\n\t\tif hour%10 == 7 {\n\t\t\tbreak\n\t\t}\n\t\tminute := t.Minute()\n\t\tif minute%10 == 7 {\n\t\t\tbreak\n\t\t}\n\t\tt = t.Add(-time.Duration(x) * time.Minute)\n\t\ti++\n\t}\n\tfmt.Print(i)\n}\n", "lang": "Go", "bug_code_uid": "82005225789d82c71119d611b98f9c63", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "fa4c2b73455463b78b29ee127224ea65", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8036322360953462, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc main() {\n\tvar x, h, m int\n\tn, err := fmt.Scanln(&x)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif n != 1 {\n\t\tpanic(n)\n\t}\n\tn, err = fmt.Scanln(&h, &m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif n != 2 {\n\t\tpanic(n)\n\t}\n\tt := time.Date(2000, time.November, 10, h, m, 0, 0, time.UTC)\n\ti := 0\n\tfor true {\n\t\thour := t.Hour()\n\t\tif hour%10 == 7 {\n\t\t\tbreak\n\t\t}\n\t\tminute := t.Minute()\n\t\tif minute%10 == 7 {\n\t\t\tbreak\n\t\t}\n\t\tt = t.Add(-time.Duration(x) * time.Minute)\n\t\ti++\n\t}\n\tfmt.Print(i)\n}\n", "lang": "Go", "bug_code_uid": "6e7d350b6a36e9bb9f65139b97a00ab8", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "fa4c2b73455463b78b29ee127224ea65", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.85, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, h, m int\n\tfmt.Scanf(\"%d\", &x)\n\tfmt.Scanf(\"%d %d\", &h, &m)\n\ty := 0\n\tfor m%10 != 7 && m != 7 {\n\t\tif m <= x {\n\t\t\tm += 60\n\t\t\th--\n\t\t}\n\t\tm -= x\n\t\ty++\n\t}\n\tfmt.Println(y)\n}\n", "lang": "Go", "bug_code_uid": "ec5c59a3baf2ff974bb9c9cd0469dd1c", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "1f96521bb84be27d84eb690348f75c7c", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9580022701475596, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tl := readInt() - 1\n\tr := readInt() - 1\n\tif n == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\ttmpn := int64(1)\n\treq := 0\n\tfor tmpn < n {\n\t\ttmpn <<= 1\n\t\treq = req*2 + 1\n\t}\n\tdfs(0, req-1, n, l, r)\n\tfmt.Println(cnt)\n}\n\nvar cnt int\n\nfunc dfs(lo int, hi int, val int64, l int, r int) {\n\tif val == 0 {\n\t\treturn\n\t}\n\tmid := (lo + hi) / 2\n\tif val%2 == 1 && l <= mid && mid <= r {\n\t\tcnt++\n\t}\n\tdfs(lo, mid-1, val/2, l, r)\n\tdfs(mid+1, hi, val/2, l, r)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "d76d7890f94158e07e9a0896e8404368", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "5dafb30c091289e455f0078829940c0f", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9996289424860854, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tl := readInt64() - 1\n\tr := readInt64() - 1\n\tif n == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\ttmpn := int64(1)\n\tvar req int64\n\tfor tmpn < n {\n\t\ttmpn <<= 1\n\t\treq = req*2 + 1\n\t}\n\tdfs(0, req-1, n, l, r)\n\tfmt.Println(cnt)\n}\n\nvar cnt int\n\nfunc dfs(lo int64, hi int64, val int64, l int64, r int64) {\n\tif val == 0 {\n\t\treturn\n\t}\n\tif l > hi || lo > r {\n\t\treturn\n\t}\n\tmid := (lo + hi) / 2\n\tif val%2 == 1 && l <= mid && mid <= r {\n\t\tcnt++\n\t}\n\tdfs(lo, mid-1, val/2, l, r)\n\tdfs(mid+1, hi, val/2, l, r)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "56d94ab59b98fc9556154949613b495d", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "5dafb30c091289e455f0078829940c0f", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.37425910245554617, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\"fmt\")\n\n\nfunc monthfunc(date int) int {\n\tvar count int\n\tarr := []int{31,29,31,30,31,30,31,31,30,31,30,31}\n\tfor i:=0;i<12;i++{\n\t\tif date<=arr[i]{\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc weekfun(day int) int{\n\tvar count int\n\tvar current int = 5\n\tfor i:=0;i<366;i++{\n\t\tif current == day{\n\t\t\tcount++\n\t\t}\n\t\tcurrent++\n\t\tif current > 7{\n\t\t\tcurrent = 0\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main(){\n\n\tvar ans int\n\tvar str string\n\tfmt.Scan(&str)\n\tvar number int = int(str[0])\n\n\tif string(str[len(str)-1])==\"k\"{\n\t\tans = weekfun(number)\n\t}else{\n\t\tans = monthfunc(number)\n\t}\n\n\tfmt.Print(ans)\n}", "lang": "Go", "bug_code_uid": "b5dc97888d2032924067ae86607b9e03", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "20cf021bd6879cfb27933331ea661243", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9877949552481693, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\n//import \"strings\"\n\nvar s string\nvar n, ans int\n\nfunc main() {\n fmt.Scanf(\"%d of %s\", &n, &s)\n switch s {\n case \"week\":\n ans = cal_week(n)\n case \"month\":\n ans = cal_month(n)\n }\n fmt.Println(ans)\n}\n\nfunc cal_week(n int) int {\n if n == 5 {\n return 53\n } else {\n return 52\n }\n\n}\n\nfunc cal_month(n int) int {\n if n < 28 {\n return 12\n } else if n == 30 {\n return 11\n } else {\n return 7\n }\n}\n", "lang": "Go", "bug_code_uid": "c1b922e2e8d6d39a9d66bf6d4e2f1356", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "5e413375e222511ef67dcd760338d9cf", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8280773143438453, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tss := strings.Split(s, \" \")\n\td, _ := strconv.Atoi(ss[0])\n\tif ss[len(ss)-1] == \"month\" {\n\t\tif d <= 29 {\n\t\t\tfmt.Println(\"12\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 30 {\n\t\t\tfmt.Println(\"11\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 31 {\n\t\t\tfmt.Println(\"7\")\n\t\t\treturn\n\t\t}\n\t}\n\tcw := 366 / 7\n\tif d == 5 || d == 6 {\n\t\tcw++\n\t}\n\tfmt.Printf(\"%v\", cw)\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "7f6653d180587395624167f4c5fdfd5a", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "8f8f800ef0ad2d54a92150d82cea4097", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.997289972899729, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// cf611a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tvar s string\n\tfmt.Scanf(\"%d of %s\", &x, &s)\n\tm := []int{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\n\td := []int{52, 52, 52, 52, 53, 53, 52}\n\tif s == \"week\" {\n\t\tfmt.Println(d[x-1])\n\t} else {\n\t\tvar c int\n\t\tfor _, v := range m {\n\t\t\tif v <= x {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tfmt.Println(c)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "39b2e3fcf39e32f46966abc638592ae3", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "b60896419f656e94deba252988c6aba8", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9837767683322518, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\nimport \"strconv\"\nimport \"strings\"\n\nfunc L(n int) int {\n\tif n==0 { return 0 }\n\tvar P=make([]int, n+1)\n\tvar C=make([]int, 10)\n\n\tfor i:=0; i < 10; i++ { P[i]=1 }\n\tfor i:=10; i <= n; i++ {\n\t\tm:=cyfry(i, C)\n\t\tmin:=-1\n\t\tfor j:=0; j < m; j++ {\n\t\t\tif C[j] > 0 {\n\t\t\t\tif min < 0 {\n\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t} else {\n\t\t\t\t\tif P[i-C[j]] < min {\n\t\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tP[i]=min+1\n\t}\n\treturn P[n]\n}\n\nfunc cyfry(n int, c []int) int {\n\tvar i int\n\tfor i=0; n > 0; i++ {\n\t\tc[i]=n%10\n\t\tn/=10\n\t}\n\treturn i\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\n\nfunc main() {\n\tb:=make([]byte, 20)\n\tmax, _:=os.Stdin.Read(b)\n\ts:=strings.TrimRight(string(b)[0:max], \"\\r\\n\")\n\tn, _:=strconv.Atoi(s)\n\tfmt.Print(L(n))\n}\n", "lang": "Go", "bug_code_uid": "28f87bccfd1b1680972dc7a56a3560ee", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "a90abaa91f425d389111af69a5b0cd0f", "difficulty": 1100, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8800959232613909, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tli := make([]int, 5)\n\tsum := 0\n\tfor i := 0 ; i < 5; i++ {\n\t\tfmt.Scanf(\"%d\", &li[i])\n\t\tsum += li[i]\n\t}\n\tsort.Ints(li)\n\tcut := 0\n\tfor i:=4; i>= 0; i-- {\n\t\tif i >= 2 && li[i] == li[i-1] && li[i-1] == li[i-2] {\n\t\t\tcut += li[i] * 3\n\t\t\tbreak\n\t\t}\n\t\tif i >= 1 && li[i] == li[i-1] {\n\t\t\tcut += li[i] *2\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", sum-cut)\n}", "lang": "Go", "bug_code_uid": "fa386697ed87285ea795044556cc1f88", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "92d678ab478c00b7d1326e63e3286425", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8727272727272727, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"github.com/qiuyesuifeng/goyacc/Godeps/_workspace/src/github.com/cznic/mathutil\"\n)\n\nfunc main() {\n\tli := make([]int, 5)\n\tsum := 0\n\tfor i := 0 ; i < 5; i++ {\n\t\tfmt.Scanf(\"%d\", &li[i])\n\t\tsum += li[i]\n\t}\n\tsort.Ints(li)\n\tcut := 0\n\tfor i:=4; i>= 0; i-- {\n\t\tif i >= 2 && li[i] == li[i-1] && li[i-1] == li[i-2] {\n\t\t\tcut = mathutil.Max(cut, li[i] * 3)\n\t\t}\n\t\tif i >= 1 && li[i] == li[i-1] {\n\t\t\tcut = mathutil.Max(cut, li[i] * 2)\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", sum-cut)\n}", "lang": "Go", "bug_code_uid": "b963c046146876f3e8c632c923cb44dc", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "92d678ab478c00b7d1326e63e3286425", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9240121580547113, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main \n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc solve(cards [5]int) int {\n\tsort.Ints(cards[:])\n\tif cards[3] == cards[4] {\n\t\tif cards[2] == cards[3] {\n\t\t\treturn cards[0] + cards[1]\n\t\t}\n\t\treturn cards[0] + cards[1] + cards[2]\n\t}\n\t// cards[3] != cards[4]\n\tif cards[2] == cards[3] {\n\t\tif cards[1] == cards[2] {\n\t\t\treturn cards[0] + cards[4]\n\t\t}\n\t\treturn cards[0] + cards[1] + cards[4]\n\t}\n\t// cards[2] != cards[3]\n\tif cards[1] == cards[2] {\n\t\tif cards[0] == cards[1] {\n\t\t\treturn cards[3] + cards[4]\n\t\t}\n\t\treturn cards[0] + cards[3] + cards[4]\n\t}\n\t// cards[1] != cards[2]\n\tif cards[0] == cards[1] {\n\t\treturn cards[2] + cards[3] + cards[4]\n\t}\n\t// cards[0] != cards[1]\n\treturn cards[0] + cards[1] + cards[2] + cards[3] + cards[4]\n}\n\nfunc main() {\n\tvar cards [5]int\n\tn, err := fmt.Scanln(&cards[0], &cards[1], &cards[2], &cards[3], &cards[4])\n\tif n != 5 || err != nil {\n\t\tpanic(err)\n\t}\n\tsum := solve(cards)\n\tfmt.Println(sum)\n}\n\n", "lang": "Go", "bug_code_uid": "25c03dc44652493c06f7207ac314b0ab", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "35bd44742093498e0c46ed4c1296f02b", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8604651162790697, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"io/ioutil\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\tvar a1,b1,c1,a2,b2,c2 int\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &a1, &b1, &c1)\n\tfmt.Fscanf(reader, \"%d %d %d\", &a2, &b2, &c2)\n\n\tif a1 * b2 - a2 * b1 != 0 {\n\t\tfmt.Printf(\"1\")\n\t} else if a1 * c2 - a2 * c1 == 0 {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"0\")\n\t}\n\treturn\n}", "lang": "Go", "bug_code_uid": "433fbfce2556e2a2a87025b74c37f7ad", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "2f5d878dc6a6c1ca419ae0079d6e6572", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.4183168316831683, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc gcd(a, b int) int {\n sign := 1\n if a < 0 {\n a = -a\n sign = -sign\n }\n if b < 0 {\n b = -b\n sign = -sign\n }\n for b != 0 {\n a, b = b, a%b\n }\n return sign*a\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n result := 0\n a1, b1, c1 := getI(), getI(), getI()\n a2, b2, c2 := getI(), getI(), getI()\n g1, g2 := gcd(a1, b1), gcd(a2, b2)\n a1, b1, a2, b2 = a1/g1, b1/g1, a2/g2, b2/g2\n if a1 == a2 && b1 == b2 {\n if c1 == c2 {\n result = -1\n }\n } else {\n result = 1\n }\n\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang": "Go", "bug_code_uid": "3e4e66fe824aad3327444279fbe449b8", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "acb8e46951088b1f2f74e13cea38d844", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9547227036395147, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "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 int64\n\nfunc main() {\n\tn = ReadInt64()\n\n\tif n == 1 {\n\t\tfmt.Println(n)\n\t\treturn\n\t}\n\n\tif IsPrime(n) {\n\t\tfmt.Println(n)\n\t\treturn\n\t}\n\n\tfmt.Println(2)\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int64) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tfor i := int64(2); i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// エラトステネスの篩: O(NloglogN)\n// n以下の素数の数と素数のスライスを返す\nfunc sieve(n int) (int, []int) {\n\t// var prime [2000000 + 5]int\n\tprime := []int{}\n\tvar isPrime [2000000 + 5 + 1]bool\n\n\tp := 0\n\tfor i := 0; i <= n; i++ {\n\t\tisPrime[i] = true\n\t}\n\tisPrime[0], isPrime[1] = false, false\n\n\tfor i := 2; i <= n; i++ {\n\t\t// iがtrueで残っている場合は素数認定し、自分より大きい倍数を取り除いていく\n\t\tif isPrime[i] {\n\t\t\t// prime[p] = i\n\t\t\tprime = append(prime, i)\n\t\t\tp++\n\n\t\t\t// 倍数の除去\n\t\t\tfor j := 2 * i; j <= n; j += i {\n\t\t\t\tisPrime[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn p, prime\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n", "lang": "Go", "bug_code_uid": "1a5fa229e057fcbea866e77f225e201f", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "f54f7ea35befb383c5b275e5ca02a95d", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9136052698251836, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n)\n\nconst (\n\tMAX_INT int64 = math.MaxInt64\n\tMIN_INT int64 = math.MinInt64\n)\n\nfunc main() {\n\n\tnum := ScanInt64()\n\n\tif isPrime(num) {\n\t\tfmt.Println(num)\n\t} else if num%2 == 0 && num%3 == 0 {\n\t\tfmt.Println(\"1\")\n\t} else if num%2 != 0 && num%3 == 0 {\n\t\tfmt.Println(\"3\")\n\t} else if num%2 == 0 && num%3 != 0 {\n\t\tfmt.Println(\"2\")\n\t}\n\tclose(out)\n\toutWg.Wait()\n}\n\nfunc isPrime(num int64) bool {\n\treturn big.NewInt(num).ProbablyPrime(20)\n}\n\n/*********************** I/O ***********************/\n\nvar out chan string\nvar in *bufio.Scanner\nvar outWg *sync.WaitGroup\n\nfunc init() {\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(2e+5))\n\tin.Split(bufio.ScanWords)\n\n\tout = make(chan string, 16)\n\toutWg = &sync.WaitGroup{}\n\toutWg.Add(1)\n\n\twriter := bufio.NewWriterSize(os.Stdout, int(2e+5))\n\tgo func(writer *bufio.Writer) {\n\t\tdefer outWg.Done()\n\t\tdefer writer.Flush()\n\n\t\tfor line := range out {\n\t\t\twriter.WriteString(line + \"\\n\")\n\t\t}\n\t}(writer)\n}\n\nfunc ScanWord() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc ScanStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ScanWord()\n\t}\n\treturn s\n}\n\nfunc ScanInt64() int64 {\n\tintStr := ScanWord()\n\ti, err := strconv.ParseInt(intStr, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc ScanInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ScanInt64()\n\t}\n\treturn arr\n}\n\n/*********************** Utils ***********************/\n\nfunc Max(args ...int64) int64 {\n\tmaxVal := MIN_INT\n\tfor _, v := range args {\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc Min(args ...int64) int64 {\n\tminVal := MAX_INT\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a / GCD(a, b) * b\n}\n\nfunc GCD(a, b int64) int64 {\n\tif (a == 0) {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\n\nfunc iToS(v int64) string {\n\treturn strconv.FormatInt(v, 10)\n}\n", "lang": "Go", "bug_code_uid": "6438c44d46127f47e8a1fefaed1c3441", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "c7f012f94313ba06fdee268a1ff91d73", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9718076285240465, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\nimport \"math\"\n\nfunc sum(n int64) int64 {\n\tvar summ int64\n\tfor n > 0 {\n\t\tsumm += n%10\n\t\tn /= 10\n\t}\n\treturn summ\n}\n\nfunc main(){\n\tvar n int64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tvar l int64 = int64(math.Sqrt(float64(n)))-40\n\tif l < 0 {\n\t\tl = 1\n\t}\n\tvar s int64 = int64(math.Sqrt(float64(n)))+1\n\tfor i:=l; i2*k-1{\n\t\tfmt.Println(0)\n\t} else {\n\t\tif k-1= 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", "lang": "Go", "bug_code_uid": "b8a6f3cb6ab1ac19a73123fc9e2fb33b", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "60b51035120adeba65fd6a3a8788e893", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7973102785782901, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 10, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar count int\n\tvar point_war int\n\tsum_war := 0\n\tvar sum_my int;\n\tmin_k := 0;\n\tfmt.Scan(&count)\n\tvar points [100]int;\n\tvar result int;\n\tfor i := 0; i < count; i++ {\n\t\tfmt.Scan(&point_war)\n\t\tpoints[i] = point_war\n\t\tsum_war += point_war\n\t\tif (point_war > min_k) {\n\t\t\tmin_k = point_war\n\t\t}\n\t}\n\tfor i := min_k; i <= 100 ; i++ {\n\t\tsum_my = 0;\n\t\tfor j := 0; j < count; j++ {\n\t\t\tsum_my += min_k - points[i]\n\t\t}\n\t\tif (sum_my > sum_war) {\n\t\t\tresult = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfmt.Println(result)\n\n\n}\n", "lang": "Go", "bug_code_uid": "49f172bcbd7678c3fba27ec1b35e6351", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "1f1b86d14adc6d5e93ed8bee9d101214", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9970674486803519, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar count int\n\tvar point_war int\n\tsum_war := 0\n\tvar sum_my int\n\tmin_k := 0\n\tfmt.Scan(&count)\n\tvar points [150]int\n\tvar result int\n\tfor i := 0; i < count; i++ {\n\t\tfmt.Scan(&point_war)\n\t\tpoints[i] = point_war\n\t\tsum_war += point_war\n\t\tif point_war > min_k {\n\t\t\tmin_k = point_war\n\t\t}\n\t}\n\tfor i := min_k; i <= 100; i++ {\n\t\tsum_my = 0\n\t\tfor j := 0; j < count; j++ {\n\t\t\tsum_my += i - points[j]\n\t\t}\n\t\tif sum_my > sum_war {\n\t\t\tresult = i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(result)\n\n}\n", "lang": "Go", "bug_code_uid": "757c7712d368480588cff6f42767ed24", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "1f1b86d14adc6d5e93ed8bee9d101214", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9986168741355463, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar n, k int\n\tmaxElem, sumA := 0, 0\n\n\tfmt.Scan(&n)\n\tA := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&A[i])\n\t\tsumA += A[i]\n\t\tif A[i] > maxElem {\n\t\t\tmaxElem = A[i]\n\t\t}\n\t}\n\n\tk = maxElem\n\n\tsumB := 0\n\tfor i := 0; i < n; i++ {\n\t\tsumB += maxElem - A[i]\n\t}\n\n\tfor ; sumB < sumA; {\n\t\tk++\n\t\tsumB += n\n\t}\n\tfmt.Print(k)\n}", "lang": "Go", "bug_code_uid": "246b3b8547e05cdda8b1bc17dc3f0685", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "401f6639c323e78ffc69e709f9bd9c06", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9659498207885304, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\treader.ReadString('\\n')\n\tcs, _ := reader.ReadString('\\n')\n\n\tcodes := []string{}\n\tb := 0\n\tfor _, c := range strings.TrimSpace(cs) {\n\t\tif c == 'B' {\n\t\t\tb++\n\t\t} else {\n\t\t\tif b > 0 {\n\t\t\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t\t\t\tb = 0\n\t\t\t}\n\t\t}\n\t}\n\tif b > 0 {\n\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t}\n\n\tif len(codes) > 0 {\n\t\tfmt.Fprintln(os.Stdout, strings.Join(codes, \" \"))\n\t} else {\n\t\tfmt.Fprintln(os.Stdout, 0)\n\t}\n\n}", "lang": "Go", "bug_code_uid": "ac5b8d977ab2ed1373898e69a9fce69f", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "c947e982652e67a632ff32849db662ea", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9632867132867133, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "// hello project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(num1 int, num2 float32) int {\n\tvar result int\n\tif num1 > int(num2) {\n\t\tresult = num1\n\t} else {\n\t\tresult = int(num2)\n\t}\n\treturn result\n}\n\nfunc swap(x string, y string) (string, string) {\n\treturn y, x\n}\n\nfunc main() {\n\tn, m := 0, 0\n\tfmt.Scanf(\"%lld %lld\", &n, &m)\n\ta := n / 5\n\tb := m / 5\n\tc, d := n%5, m%5\n\tans := a * b * 5\n\tans += a * d\n\tans += b * c\n\t//\tfmt.Println(ans)\n\tvar i, j int\n\tfor i = 1; i <= c; i++ {\n\t\tfor j = 1; j <= d; j++ {\n\t\t\tif (i+j)%5 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "1160b32f368db6f0419c015453318bc4", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "2978156b7ed61a720b4f387bd3737eb2", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5677785663591199, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 11, "bug_source_code": "// test project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t//bio := bufio.NewReader(os.Stdin)\n\t//line, hasMoreInLine, err := bio.ReadLine()\n\t//fmt.Println(\"line: \", line, hasMoreInLine, err)\n\t\n\tvar num int\n\tvar num2 int\n\tfmt.Scanln(&num, &num2)\n\t\n\tcount := 0\n\t\n\tfor i := 1; i <= num; i++ {\n for j := 1; j <= num2; j++ {\n\t\t\tif (i + j) % 5 == 0 {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n }\n\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "b435e2f2a2bedf8a4393722c289d3af7", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "1e7bc8683148810ac139d3620f8e20ea", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6579634464751958, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "// cf682a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, l int64\n\tfmt.Scan(&n, &m)\n\n\tfmt.Println((((n * m) + 2) / 5) + l)\n}\n", "lang": "Go", "bug_code_uid": "02d4f4cd9107981494fcd3e275de4472", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "fb5abf57d291c01428e86a5f26221469", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9337606837606838, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\ta := make([]int, 6)\n\tvar l int\n\tfor i := range a {\n\t\tfmt.Scan(&l)\n\t\ta[i] = l\n\t}\n\tsort.Ints(a)\n\tisBear := func() bool {\n\t\treturn a[1] == a[4] && a[0] < a[5]\n\t}\n\tisElephant := func() bool {\n\t\treturn a[0] == a[1] && a[2] == a[5] || a[0] == a[3] && a[4] == a[5]\n\t}\n\n\tres := \"Alien\"\n\tswitch {\n\tcase isBear():\n\t\tres = \"Bear\"\n\tcase isElephant():\n\t\tres = \"Elephant\"\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "b72587356b729a1df505458f0d8f98cc", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "faa8e79a35d355bad7e4af9b1731fb75", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9434389140271493, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nvar sticks [10]int\n\nfunc main() {\n\tv := 0\n\tfor i := 0; i < 6; i++ {\n\t\tfmt.Scan(&v)\n\t\tsticks[v] += 1\n\t}\n\n\tlegOk := false\n\telephant := false\n\tfor i := 0; i < len(sticks); i++ {\n\t\tif sticks[i] == 4 {\n\t\t\tlegOk = true\n\t\t} else if sticks[i] == 2 {\n\t\t\telephant = true\n\t\t}\n\t}\n\n\tif !legOk {\n\t\tfmt.Println(\"Alien\")\n\t} else if elephant {\n\t\tfmt.Println(\"Elephant\")\n\t} else {\n\t\tfmt.Println(\"Bear\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "37091fe8acace74e1808dd87fccbc957", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "41c680489b95b5adbbc34c8db2e10b94", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9887760555852485, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var length[6] int\n var counts[10] int\n for i := 0; i < 6; i++ {\n fmt.Scan(&length[i])\n counts[length[i]]++\n }\n\n leg := -1\n for i := 0; i < 10; i++ {\n if counts[i] >= 4 {\n leg = i\n }\n }\n if leg == -1 {\n fmt.Println(\"Alien\")\n } else {\n\n a := -1\n b := -1\n if (counts[leg] == 5) {\n a = leg\n } else if (counts[leg] == 6) {\n b = leg\n }\n\n for i := 0; i < 10; i++ {\n if counts[i] > 0 && i != leg {\n if a == -1 {\n a = i\n } else if b == -1 {\n b = i\n }\n }\n }\n\n if b == -1 {\n b = a\n }\n\n if a == b {\n fmt.Println(\"Elephant\")\n } else {\n fmt.Println(\"Bear\")\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "06091e4fabd02c804afe50cda0eb7508", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "9d849a09b4cccdeb317cf87ca4c12768", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9368421052631579, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\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 d1, d2, d3 int\n\tfmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\n\tret := min(d1 + min(d1 + 2 * d2, d3 + d2),\n\t\t\t d2 + min(d2 + 2 * d1, d3 + d1))\n\tfmt.Printf(\"%d\", ret)\n}", "lang": "Go", "bug_code_uid": "ab9fecdbb8f09022646dc904a01d9a83", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "1418681f98a4eccfa21f53cac65cbab5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8861788617886179, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar writer *bufio.Writer\nvar scanner *bufio.Scanner\n\ntype MySlice [][2]int\n\nfunc (slice MySlice) Len() int { return len(slice) }\nfunc (slice MySlice) Less(i, j int) bool { return slice[i][1] < slice[j][1] }\nfunc (slice MySlice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\nfunc main() {\n\tini()\n\tdefer writer.Flush()\n\n\td1 := scanInt()\n\td2 := scanInt()\n\td3 := scanInt()\n\n\tif d3+d2+d1 < 2*(d1+d2) {\n\t\twriter.WriteString(strconv.Itoa(d3 + d2 + d1))\n\t} else {\n\t\twriter.WriteString(strconv.Itoa(2 * (d1 + d2)))\n\t}\n\n\treturn\n}\n\nfunc binSearch(a []int, key int) int {\n\tl := -1\n\tr := len(a)\n\tfor l < r-1 {\n\t\tm := (l + r) / 2\n\t\tif a[m] < key {\n\t\t\tl = m\n\t\t} else {\n\t\t\tr = m\n\t\t}\n\t}\n\n\tif a[r] != key {\n\t\treturn -1\n\t}\n\n\treturn r\n}\n\nfunc ini() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ti, _ := strconv.Atoi(scanner.Text())\n\treturn i\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n", "lang": "Go", "bug_code_uid": "264d472d23868bd4cc6cf15d31f09277", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "c1fbaff31c6704f5905b791e998f26be", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.4356120826709062, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\tconst (\n\t\tmod = 1e9 + 7\n\t)\n\n\tres := 0\n\n\tres = a * (a + 1)\n\tres %= mod\n\tres *= b\n\tres %= mod\n\tres /= 2\n\tres += a\n\tres = res * (((b * (b - 1)) % mod) / 2)\n\tres %= mod\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "396424b3f7d9dfff98e4222d6d31c43c", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "38101fb8c1654e79205900169c23169f", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9954285714285714, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"strconv\"\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n// var file, _ = os.Open(\"input.txt\")\n// var outfile, _ = os.Create(\"output.txt\")\n// var in = bufio.NewScanner(file)\n// var out = bufio.NewWriter(outfile)\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n if !in.Scan() {\n panic(\"Scan error\")\n }\n return in.Text()\n}\n\nfunc nextInt() int {\n ret, _ := strconv.Atoi(next())\n return ret\n}\n\nfunc nextFloat() float64 {\n ret, _ := strconv.ParseFloat(next(), 64)\n return ret\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n a := int64(nextInt())\n b := int64(nextInt())\n var sum, i int64\n mod := int64(1000000007)\n m := (b * (b - 1) / 2) % mod\n for i = 1; i <= a; i++ {\n sum = (sum + m * (i * b + 1)) % mod\n }\n fmt.Fprintln(out, sum)\n}\n", "lang": "Go", "bug_code_uid": "4bb047a7cf811b85c9f67a610bb0b8ff", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "88f4a76ba1e8366803bb22c15c025ab1", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.3580683156654888, "equal_cnt": 20, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\\n\", &s)\n\tstrings.ToLower(s)\n\tfor i:=0; i= b && d >= a (problem is symmetric)\n// i can be from 1 to (n-(c-b)-(d-a))\n// h = i + (c-b); from (1+(c-b)) to (n-(d-a))\n// f = i + (d-a); from (1+(d-a)) to (n-(c-b))\n// e = i + (c-b) + (d-a); from (1+(c-b)+(d-a)) to n\n//\n// total combinations: n * (n-(c-b)-(d-a)) assuming c>=b && d>=a\n// \nfunc Combinations(n, a, b, c, d uint64) uint64 {\n\tif b > c {\n\t\tc, b = b, c\n\t}\n\tif a > d {\n\t\td, a = a, d\n\t}\n\treturn n*(n-(c-b)-(d-a))\n}\n\nfunc CombinationsStr(s string) string {\n\tvar n, a, b, c, d uint64\n\tfmt.Sscanf(s, \"%d %d %d %d %d\", &n, &a, &b, &c, &d)\n\tres := Combinations(n, a, b, c, d)\n\treturn fmt.Sprint(res)\n}\n\nfunc main() {\n\t// fmt.Println(CombinationsStr(\"2 1 1 1 2\")) // 2\n\t// fmt.Println(CombinationsStr(\"3 3 1 2 3\")) // 6\n\tbuf, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tres := CombinationsStr(string(buf))\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "2f6c36f57626d29deaf911d2274b475f", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "df8ff51c91bf4a2ac810465ac4117a48", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9745977984758679, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tlog.SetOutput(ioutil.Discard)\n\t// log.SetOutput(os.Stderr)\n\n\tn, a, b, p, q := nextInt64(), nextInt64(), nextInt64(), nextInt64(), nextInt64()\n\n\tprintln(n/a*p + n/b*q - n/(a*b)*gcd(a, b)*min(p, q))\n}\n\nfunc gcd(x, y int64) int64 {\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "405149ecf8914c461183592221e6bd54", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "aaaf16cc3dc43a9e91dcc909d23318d8", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9346733668341709, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tif solve() {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc solve() bool {\n\tvar n, R, r float64\n\tfmt.Scan(&n, &R, &r)\n\tif r > R {\n\t\treturn false\n\t}\n\tif R == r {\n\t\treturn n == 1\n\t}\n\treturn math.Pi/math.Asin(r/(R-r))+1e-9 >= n\n}\n", "lang": "Go", "bug_code_uid": "566325b4f6347caf1c24e60a22a8075e", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "65f55afea05510421375240d26844638", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.994328922495274, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n,r,R float64\n fmt.Scan(&n,&R,&r)\n if ((n == 1) && (r <= R)) || ((math.Asin(r/(R-r))-(math.Pi/n)) <= 0.0000001) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n", "lang": "Go", "bug_code_uid": "6904f311731ab5799db9a1ddcaf32687", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "0743d5eae9735d624b3f3dd8b1c37ae9", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9921259842519685, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// 140A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, r, x int\n\tvar c float64\n\tfmt.Scan(&n, &r, &x)\n\tif n == 1 {\n\t\tif x > r {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tfmt.Println(\"YES\")\n\t\t}\n\n\t} else {\n\t\tc = float64(x)/math.Sin(float64(3.14159)/float64(n)) + float64(x)\n\t\tc = c - float64(r)\n\t\tif c > 0.00001 {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tprintln(\"YES\")\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "5b64feb5946ff8be3f4a14783f2d521c", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "243d318e93f535e39b1a42c265a31261", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5572842998585573, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\txs := make([]int, n)\n\tfor i, r := range []rune(s) {\n\t\txs[i] = int(r - '0')\n\t}\n\tx := 0\n\tfor i := n - 1; i >= 0; i-- {\n\t\tx <<= 1\n\t\tx += xs[i]\n\t}\n\ty := x + 1\n\tys := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tys[i] = y & 1\n\t\ty >>= 1\n\t}\n\tz := 0\n\tfor i := 0; i < n; i++ {\n\t\tif xs[i] != ys[i] {\n\t\t\tz++\n\t\t}\n\t}\n\tfmt.Println(z)\n}\n", "lang": "Go", "bug_code_uid": "586a025103487484e6ec058d8a75cd22", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "16e7cc878ddd92ad90eb52233d0b98a1", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9617706237424547, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tbil := []int{100, 20, 10, 5}\n\tin := bufio.NewReader(os.Stdin)\n\tans := 0\n\tfor _, v := range bil {\n\t\tans = ans + n/v\n\t\tn = n % v\n\t}\n\tans = ans + n\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "48efe24377274cd660eaa2ce5cee7ec6", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "81240d52bcccfe6554340232aa55d681", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8247126436781609, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "//A. Выиграть в лотерею\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n uint32\n\tfmt.Scan(&n)\n\tminKol(n)\n}\n\nfunc minKol(sum uint32) uint32 {\n\tbills := [...]uint32{1, 5, 10, 20, 100}\n\tvar uint32 mode = sum\n\tvar uint32 rez\n\tvar int i = 4\n\n\tfor mode != 0 {\n\t\trez = rez + mode/bills[i]\n\t\tmode = sum % bills[i]\n\t\tmode = mode % bills[i]\n\t\ti--\n\t}\n\treturn rez\n}\n", "lang": "Go", "bug_code_uid": "093503ccc3202f658bf425cdcd26273d", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "963772de3c47201c351bf0b6fce95539", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7298387096774194, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int\n ans = 0\n \n fmt.Scan(&n)\n ans += n/100\n n %= 100\n ans += n/50\n n %= 50\n ans += n/20\n n %= 20\n ans += n/5\n n %= 20\n ans + n\n \n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "d980434f241eae2e48cbb34b7f2eb6ca", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "544faaa3eb52147d20cec801c2b43055", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8320754716981132, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\n\nfunc main(){\n\tvar n string\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn = r.Text()\n\tif n <= \"127\" {\n\t\tw.WriteString(\"byte\")\n\t} else if n <= \"32767\" {\n\t\tw.WriteString(\"short\")\n\t} else if n <= \"2147483647\" {\n\t\tw.WriteString(\"int\")\n\t} else if n <= \"9223372036854775807\" {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n", "lang": "Go", "bug_code_uid": "764758b33ab415804e28975c5bd9490d", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "075669569b1c82e0eca17419b64f9867", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9882352941176471, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\n\tinputPiles := make([]int, n)\n\tpilesOutput := make([]int, n)\n\n\tfor i := range inputPiles {\n\t\tfmt.Scan(&inputPiles[i])\n\t}\n\tfor i := range pilesOutput {\n\t\tfmt.Scan(&pilesOutput[i])\n\t}\n\n\tinputPilesSum := sum(inputPiles)\n\toutputPilesSum := sum(pilesOutput)\n\n\tif inputPilesSum >= outputPilesSum {\n\t\tprintln(\"Yes\")\n\t\treturn\n\t}\n\tprintln(\"No\")\n}\n\nfunc sum(slice []int) int {\n\tsum := 0\n\tfor _, value := range slice {\n\t\tsum += value\n\t}\n\n\treturn sum\n}\n", "lang": "Go", "bug_code_uid": "51676a8b9f2fa90ef11ba74d146bd597", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "7b25198e15865d9265850fd135eb227f", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9961089494163424, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\n\tinputPiles := make([]int, n)\n\tpilesOutput := make([]int, n)\n\n\tfor i := range inputPiles {\n\t\tfmt.Scan(&inputPiles[i])\n\t}\n\tfor i := range pilesOutput {\n\t\tfmt.Scan(&pilesOutput[i])\n\t}\n\n\tinputPilesSum := sum(inputPiles)\n\toutputPilesSum := sum(pilesOutput)\n\n\tif inputPilesSum >= outputPilesSum {\n\t\tfmt.println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.println(\"No\")\n}\n\nfunc sum(slice []int) int {\n\tsum := 0\n\tfor _, value := range slice {\n\t\tsum += value\n\t}\n\n\treturn sum\n}\n", "lang": "Go", "bug_code_uid": "375c0875b0dbee8b26aeb8311ef7cf33", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "7b25198e15865d9265850fd135eb227f", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.08609271523178808, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package codeforces\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc convertAndCount(x []string) int {\n\tc := 0\n\tfor _, s := range x {\n\t\tn, _ := strconv.Atoi(s)\n\t\tc += n\n\t}\n\treturn c\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tvar s1, s2 string\n\tfmt.Scanln(&s1)\n\tfmt.Scanln(&s2)\n\n\tif convertAndCount(strings.Split(s1, \" \")) == convertAndCount(strings.Split(s2, \" \")) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d5a00b159c476af6cf0f24adfc874cbc", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "ca477ff9b4861c5c7b02971e33cc3c1e", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9110840438489647, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nvar (\n\tn, input, ans int\n\tmp1 map[int]int\n)\n\nfunc main() {\n\tfmt.Scanln(&n)\n\n\tmp1 = make(map[int]int)\n\tans = 1\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&input)\n\t\tmp1[int(input)] = 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&input)\n\t\tif input != 0 && mp1[int(input)] == 0 {\n\t\t\tans = 0\n\t\t}\n\t}\n\n\tif ans > 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "6e86efcc60ade213ed7abe5d01fe3a50", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "544d4a2eaa64758cef91f5a1f715a891", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9916434540389972, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s, r string\n\tfmt.Scan(&s)\n\tif strings.ContainsAny(s, \"HQ9\") {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4cb67e197c4e94012ba6caf1d75971d9", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "6b3defef1954c5f9f82dab5905247f59", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6438631790744467, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar code string\n\tfmt.Scanf(\"%s\\n\", &code)\n\tfor _, char := range code {\n\t\tif char == 'H' || char == 'Q' || char == '9' {\n\t\t\tfmt.Print(\"YES\")\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\n\tfmt.Print(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "47773c6fa051ba97f7023cfe2c6fa3e8", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "53b7db722d1616f13df55eb29d87788f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9478390461997019, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\toutput := false\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch {\n\t\tcase s[i] == 'H':\n\t\t\tfallthrough\n\t\tcase s[i] == '+':\n\t\t\tfallthrough\n\t\tcase s[i] == '9':\n\t\t\tfallthrough\n\t\tcase s[i] == 'Q':\n\t\t\toutput = true\n\t\t}\n\t}\n\tif output {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "64cbd762f9983c99f9fd53e7e3bc01ba", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "831d4ba3a87dbe2fd28871866b2a872c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9821138211382113, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\"fmt\")\nfunc main() {\n var s string\n fmt.Scan(&s)\n flag:=false\n for i:=range(s) {\n if s[i]=='H'||s[i]=='9'||s[i]=='Q'||s[i]=='+' {\n flag=true\n break\n }\n }\n if flag {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang": "Go", "bug_code_uid": "b15b9554fc1046179f4c8299c5e49dec", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "4b4402e5861018b20c147aa823062615", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9799173065564087, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bytes\"\n)\n\nconst ZERO int = int('0')\n\nfunc process(s string) []int {\n var cnt [10]int\n for _, c := range s {\n cnt[int(c) - ZERO]++\n }\n return cnt[:]\n}\n\nfunc getMax(cnt []int) string {\n var buffer bytes.Buffer\n for i := 9; i >= 0; i-- {\n for j := 0; j < cnt[i]; j++ {\n buffer.WriteRune(rune(i + ZERO))\n }\n }\n return buffer.String()\n}\n\nfunc main() {\n var a, b string\n fmt.Scan(&a, &b)\n cnt := process(a)\n var ans string\n if len(b) > len(a) {\n ans = getMax(cnt)\n } else {\n var buffer bytes.Buffer\n valid := true\n for i, c := range b {\n numb := int(c) - ZERO\n\n // attempt to go lower\n for numb--; cnt[numb] == 0 && numb >= 0; numb-- {}\n if numb >= 0 {\n buffer.WriteRune(rune(numb + ZERO))\n cnt[numb]--\n buffer.WriteString(getMax(cnt))\n ans = buffer.String()\n cnt[numb]++\n buffer.Truncate(i)\n }\n\n // reset\n numb = int(c) - ZERO\n if cnt[numb] > 0 {\n buffer.WriteRune(c)\n cnt[numb]--\n } else {\n for ; cnt[numb] == 0 && numb >= 0; numb-- { }\n if numb >= 0 {\n buffer.WriteRune(rune(numb + ZERO))\n cnt[numb]--\n buffer.WriteString(getMax(cnt))\n } else {\n valid = false\n }\n break\n }\n }\n if valid {\n ans = buffer.String()\n }\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "1729251314406d7495e75188d2d201ec", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "0d1e37fdc5efa6cd02041465a20c94ef", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.987783595113438, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := []byte(strconv.FormatInt(readInt64(), 10))\n\tb := []byte(strconv.FormatInt(readInt64(), 10))\n\tanum := make([]int, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tanum[i] = int(a[i] - '0')\n\t}\n\tbnum := make([]int, len(b))\n\tfor i := 0; i < len(b); i++ {\n\t\tbnum[i] = int(b[i] - '0')\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(anum)))\n\tif len(a) == len(b) {\n\t\tdfs(anum, bnum, 0)\n\t}\n\tfor _, v := range anum {\n\t\tfmt.Print(v)\n\t}\n\tfmt.Println()\n}\n\nfunc dfs(anum []int, bnum []int, pos int) bool {\n\tif pos == len(anum) {\n\t\treturn true\n\t}\n\tfor i := pos; i < len(anum); i++ {\n\t\tif anum[i] < bnum[pos] {\n\t\t\tanum[pos], anum[i] = anum[i], anum[pos]\n\t\t\tresort(anum, pos+1)\n\t\t\treturn true\n\t\t}\n\t\tif anum[i] <= bnum[pos] {\n\t\t\tanum[pos], anum[i] = anum[i], anum[pos]\n\t\t\tresort(anum, pos+1)\n\t\t\tif dfs(anum, bnum, pos+1) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tresort(anum, pos)\n\t\t}\n\t}\n\treturn false\n}\n\nfunc resort(nums []int, pos int) {\n\tfor i := pos; i < len(nums)-1; i++ {\n\t\tfor j := i + 1; j < len(nums); j++ {\n\t\t\tif nums[i] < nums[j] {\n\t\t\t\tnums[i], nums[j] = nums[j], nums[i]\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang": "Go", "bug_code_uid": "d002d5ddff9379f8a8674c671d3ae7c3", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "bd8d3109459235efd9525c2e673ff91e", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.33381157340985174, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 23, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\ts.Scan()\n\ta := s.Text()\n\ts.Scan()\n\tb, _ := strconv.ParseInt(s.Text(), 10, 64)\n\tdo([]rune(a), b)\n}\n\nfunc do(a []rune, b int64) {\n\tmax := int64(math.MinInt64)\n\tpermute(a, len(a), b, &max)\n\tfmt.Println(max)\n}\n\nfunc permute(a []rune, n int, b int64, max *int64) {\n\tif n < 1 {\n\t\tx, _ := strconv.ParseInt(string(a), 10, 64)\n\t\tif x > *max && x < b {\n\t\t\t*max = x\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tswap(a, i, n-1)\n\t\tpermute(a, n-1, b, max)\n\t\tswap(a, i, n-1)\n\t}\n}\n\nfunc swap(a []rune, i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n", "lang": "Go", "bug_code_uid": "408b584bf78dcb4da49f1dc5123580c4", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "b970660ea39d88b019bf414d78d49b69", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.514330585001963, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "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\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\ts.Scan()\n\ta := s.Text()\n\ts.Scan()\n\tb, _ := strconv.ParseInt(s.Text(), 10, 64)\n\n\txs := make([]int, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\txs[i] = int(a[i] - '0')\n\t}\n\tdo(xs, b)\n}\n\nfunc do(a []int, b int64) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tpermute(a, len(a), b, 0)\n}\n\nfunc permute(a []int, n int, b int64, ans int64) {\n\tif n == 0 {\n\t\tzeroes := 0\n\t\tfor i := 0; i < len(a); i++ {\n\t\t\tif a[i] == 0 {\n\t\t\t\tzeroes++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\trs := make([]rune, len(a)-zeroes)\n\t\tfor i := 0; i < len(a)-zeroes; i++ {\n\t\t\trs[i] = rune(a[i+zeroes]) + '0'\n\t\t}\n\t\tfmt.Println(string(rs))\n\t\treturn\n\t}\n\n\ti := len(a) - n\n\td := a[i]\n\tfor ans+int64(d)*powInt(10, n-1) > b {\n\t\ti++\n\t\td = a[i]\n\t}\n\tswap(a, len(a)-n, i)\n\tsort.Sort(sort.Reverse(sort.IntSlice(a[len(a)-n+1:])))\n\tpermute(a, n-1, b, ans+int64(d)*powInt(10, n-1))\n}\n\nfunc powInt(a, b int) int64 {\n\treturn int64(math.Pow(float64(a), float64(b)))\n}\n\nfunc swap(a []int, i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n", "lang": "Go", "bug_code_uid": "37040174565bde0f6b27c37378fa8877", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "b970660ea39d88b019bf414d78d49b69", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9987347110923661, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// _Channels_ are the pipes that connect concurrent\n// goroutines. You can send values into channels from one\n// goroutine and receive those values into another\n// goroutine.\n\npackage main\n\nimport \"fmt\"\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"unsafe\"\n)\n\n// var (\n// mess make(chan string, 2)\n// )\n\nfunc main() {\n\n\t// var test [3]int32\n\t// var p_test *[3]int32\n\n\t// fmt.Println(unsafe.Sizeof(test), unsafe.Sizeof(p_test))\n\n\tvar str_a string\n\tvar str_b int64\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &str_a)\n\tfmt.Fscan(input, &str_b)\n\tvar cnt [2560000]int\n\tfor i := 0; i < len(str_a); i++ {\n\t\tcnt[str_a[i]-'0']++\n\t}\n\tvar ans int64\n\t// fmt.Println(len(str_a))\n\tfor i := 0; i < len(str_a); i++ {\n\t\tfor j := 9; j >= 0; j-- {\n\t\t\tif cnt[j] == 0 {\n\t\t\t\t// fmt.Println(j, cnt[j])\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tflag := false\n\t\t\tt := ans\n\t\t\tt = t * 10\n\t\t\tt += int64(j)\n\t\t\tcnt[j]--\n\n\t\t\tif check(t, cnt, str_b) {\n\t\t\t\tans = t\n\t\t\t\tflag = true\n\t\t\t} else {\n\t\t\t\tcnt[j]++\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n\nfunc check(t int64, cnt [2560000]int, str_b int64) bool {\n\tfor i := 0; i < 10; i++ {\n\t\tfor cnt[i] > 0 {\n\t\t\tt = t * 10\n\t\t\tt += int64(i)\n\t\t\tcnt[i]--\n\t\t}\n\t}\n\treturn t <= str_b\n}\n", "lang": "Go", "bug_code_uid": "0f6f628512f8c3ca10ae72ecf14ccf50", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "0f795459eb3ea55af05270acfee3f1f7", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6963434022257552, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s1, s2 string\n\tfmt.Scanln(&s1, &s2)\n\tfmt.Println(run(s1, s2))\n}\n\nfunc run(s1, s2 string) int {\n\ts1, s2 = strings.ToLower(s1), strings.ToLower(s2)\n\tfor i := range s1 {\n\t\tswitch {\n\t\tcase s1[i] < s2[i]:\n\t\t\treturn -1\n\t\tcase s1[i] > s2[i]:\n\t\t\treturn 1\n\t\t}\n\t}\n\treturn 0\n}\n", "lang": "Go", "bug_code_uid": "4ab087525a747b8c586840cc51cba561", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "808bf2f5b7ce4bf64b22785f6a878294", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.888015717092338, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ttext := scanner.Text()\n\tstr := strings.Split(text, \" \")\n\tstr1 := strings.ToLower(str[0])\n\tstr2 := strings.ToLower(str[1])\n\n\tfor i := 0; i < len(str1); i++ {\n\t\tstr1Char := string([]rune(str1)[i])\n\t\tstr2Char := string([]rune(str2)[i])\n\t\tif str1Char < str2Char {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif str1Char > str2Char {\n\t\t\tfmt.Println(\"1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"0\")\n}\n", "lang": "Go", "bug_code_uid": "7b182b8827b8a322e107ac3a3707cad3", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "744e4487ec589dcafad46d9ea34c0314", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.997275204359673, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// 268B-arnold.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(n)\n\t// 1*(n-1)+1 + 2*(n-2)+1 + 3*(n-3)+1 + ... + n*(n-n)+1\n\tfmt.Println((n-1)*n*(n+1)/6 + n)\n}\n", "lang": "Go", "bug_code_uid": "cfc0984419e788d1ef7e5ba6ae75a06f", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "dba9e01411022edfa2bdd357e626c41c", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7880434782608695, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc prog(a int) int {\n\treturn ((1 + a) * a) / 2\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(prog(n) + prog(n - 2))\n}", "lang": "Go", "bug_code_uid": "9b16a1a5c2081e0d5c6b910055335ab8", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "4fe2b3402873aebd40d1272597f36bc9", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8355871886120997, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tn := nextInt()\n\tres := 0\n\tnFact := factorial(n)\n\tfor i := 1; i <= n; i++ {\n\t\tdown := factorial(i) * factorial(n-i)\n\t\tres += nFact / down\n\t}\n\tprintln(res)\n\n}\nfunc factorial(x int) int {\n\tif x == 0 {\n\t\treturn 1\n\t}\n\n\treturn x * factorial(x-1)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}", "lang": "Go", "bug_code_uid": "e76724f0e76ee6d1dd43ab29b041a0d6", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "8a2be2198c654e2b6336c397388a0dc3", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.843010752688172, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tn := nextInt()\n\tres := 0\n\tnFact := factorial(n)\n\tfor i := 1; i <= n; i++ {\n\t\tdown := factorial(i) * factorial(n-i)\n\t\tres += nFact / down\n\t}\n\tprintln(res)\n\n}\nfunc factorial(x int) int {\n\tif x == 0 {\n\t\treturn 1\n\t}\n\n\treturn x * factorial(x-1)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n", "lang": "Go", "bug_code_uid": "e01c1b8e6968d77fe4948f7650eccfad", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "8a2be2198c654e2b6336c397388a0dc3", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9006928406466512, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar stdin *bufio.Reader\nvar stdout *bufio.Writer\n\nfunc init() {\n\tstdin = bufio.NewReader(os.Stdin)\n stdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\n\tn, m := 0, 0\n\t\n\tfmt.Fscanf(stdin, \"%d%d\", &n, &m)\n\t\n\tx := 2 * n\n\t\n\tif 3 * m > x {\n\t\tx = 3 * m\n\t}\n\t\n\tif 3 * (n + m) > 2 * x {\n\t\tx = (3 * (n + m) + 1) / 2\n\t} \n\t\n\tfmt.Fprintf(stdout, \"%d\\n\", x)\n\n stdout.Flush()\n}", "lang": "Go", "bug_code_uid": "83a7acff17d41ec30316b87a44b4a30e", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "8bf036775aa8d6091c835e0d1cc3111e", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8461538461538461, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar c, v0, v1, a, l int\n\tfmt.Scanf(\"%d%d%d%d%d\", &c, &v0, &v1, &a, &l)\n\n\tdays := 0\n\tr := 0\n\tfor {\n\t\tdays += 1\n\t\tif days == 1 {\n\t\t\tr = c - v0\n\t\t} else {\n\t\t\tr = r - v0 - a*(days-1) + l\n\t\t}\n\n\t\tif r <= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(days)\n}\n", "lang": "Go", "bug_code_uid": "eef348d6c51f9c26862f9841e81ed471", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "5543d407001c0224d82b5c63024c9ebd", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5264483627204031, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar c, v0, v1, a, l int\n\tfmt.Scanf(\"%d %d %d %d %d\", &c, &v0, &v1, &a, &l)\n\n\tvar readPages int = 0\n\tvar day int = 0\n\tfor readPages < c {\n\t\tdelta := c - readPages\n\t\ttmp := v0 + day*a\n\t\tif day > 0 {\n\t\t\ttmp -= l\n\t\t}\n\n\t\tread := math.Min(float64(v1), float64(tmp))\n\t\tread = math.Min(float64(read), float64(delta))\n\n\t\treadPages += int(read)\n\t\tday++\n\t}\n\n\tfmt.Println(day)\n}\n", "lang": "Go", "bug_code_uid": "d52bd1d6d526be77df04942875f10c7c", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "d3aa77ec929837ea0ca5b4d9f8dc587e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9233038348082596, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar c, v0, v1, a, l int\n\tfmt.Scanf(\"%d %d %d %d %d\", &c, &v0, &v1, &a, &l)\n\tif v0 >= c {\n\t\tfmt.Println(1)\n\t} else {\n\t\tday := 2\n\t\tfor read := v0; read < c; day++ {\n\t\t\tread += min(v0 + a, v1)-l\n\t\t}\n\t\tfmt.Println(day-1)\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n", "lang": "Go", "bug_code_uid": "3d3ab36c39d80c3e2ca9546bc59590b1", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "eb5afd7963461ee499dc4c29965507a9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9906796999318027, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tc, v0, v1, a, l := sc.NextInt(), sc.NextInt(), sc.NextInt(), sc.NextInt(), sc.NextInt()\n\n\tremain := c - l\n\tcount := 0\n\tspeed := v0\n\tfor remain > 0 {\n\t\tremain += l\n\n\t\tcount++\n\n\t\tremain -= speed\n\t\tspeed += a\n\t\tif speed > v1 {\n\t\t\tspeed = v1\n\t\t}\n\t}\n\n\tfmt.Println(count)\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", "lang": "Go", "bug_code_uid": "4841ea970e2d57f46b944d2bed503b9a", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "231eeb52f8fea3983e5e3eab9ba6d7b0", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9711340206185567, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Team struct {\n main uint8\n second uint8\n}\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n,c uint8\n\tvar s []Team\n\t\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i:= uint8(0); i < n; i++{\n\t\tvar t Team\n\t\tfmt.Fscanf(in, \"%d %d\\n\", &t.main, &t.second)\n\t\ts = append(s, t)\n\t}\n\tfor i:= uint8(0); i < n; i++{\n\t\tfor j:= uint8(0); j < n; j++{\n\t\t\tif i != j{\n\t\t\t\tif s[i].main == s[j].second{\n\t\t\t\t\tc++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(c)\n\n}\n", "lang": "Go", "bug_code_uid": "a815622d3f2b272cebbd414075ef236a", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "67a84d2b9f80f6a8bce2216f8eb0fc74", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9619377162629758, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, a, count int\n\tvar arr []int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tarr = append(arr, a)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif arr[i] >= arr[k] && arr[k] > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "lang": "Go", "bug_code_uid": "ad173acd15c85200b10a3737e61baea6", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "667e6b36c3d159561bd4962474f4a6a6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.98661800486618, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tfmt.Println(checkInputs())\n}\n\n// 8 5\n// 10 9 8 7 7 7 5 5\n\nfunc checkInputs() int {\n\tin := getInput()\n\tindex, _ := strconv.Atoi(strings.Split(in[0], \" \")[1])\n\tcount := 0\n\n\tvalues := strings.Split(in[1], \" \")\n\n\tcheck, _ := strconv.Atoi(values[index])\n\n\tfor _, val := range values {\n\t\tv, err := strconv.Atoi(val)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tif v > 0 && v >= check {\n\t\t\tcount++\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn count\n}\n\nfunc getInput() []string {\n\tinputs := []string{}\n\treader := bufio.NewReader(os.Stdin)\n\n\tfor len(inputs) != 2 {\n\t\ts, err := reader.ReadString('\\n')\n\t\tif err != nil && err != io.EOF {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts = strings.TrimRight(s, \"\\r\\n\")\n\t\tinputs = append(inputs, s)\n\t}\n\treturn inputs\n}\n", "lang": "Go", "bug_code_uid": "f1c066bd482b4f4204423859364c7999", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "6cab747ec747f26b4c35ca2ba267ebfd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9840255591054313, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, ret int\n\tvar arr [50]byte\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar val byte\n\t\tfmt.Scan(&val)\n\t\tarr[val]++\n\t}\n\n\tfor i := 49; i > 0; i-- {\n\t\tif arr[i] > 0 && k > 0 {\n\t\t\tret += int(arr[i])\n\t\t\tk -= int(arr[i])\n\t\t}\n\t}\n\n\tfmt.Println(ret)\n}\n", "lang": "Go", "bug_code_uid": "43bb18949b69808d7a9d1c08ac9adc13", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "1fb037f101a14c2ab9ff13de80456254", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9818181818181818, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\"fmt\")\n\nfunc main() {\n\tvar i,n,k,score int\n\tcontestant:=[]int{}\n\tfmt.Scan(&n,&k)\n\tfor i=0;i0) {\n\t\t\tcontestant=append(contestant,score)\n\t\t}\n\t}\n\tif(k>=len(contestant)) {\n\t score = len(contestant)\n\t} else {\n\t score=k\n \tfor i=k;i= scores[k] {\n\t\t\tadvancers++\n\t\t}\n\t}\n\treturn advancers\n}\n", "lang": "Go", "bug_code_uid": "d12a260927828cfa2d06e4bb77fe586c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "3e00591b58c6ba6c664ee9219ab9e65e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9856035437430787, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc Round(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar T, target, si int\n\tvar result []int\n\tFscan(in, &T)\n\tFscan(in, &target)\n\n\tfor ; T > 0; T-- {\n\t\tFscan(in, &si)\n\t\tresult = append(result, si)\n\t}\n\n\tvar mid int\n\ti, j := 0, len(result)-1\n\tfor i <= j {\n\t\tmid = (i + j) / 2\n\t\tif result[mid] < result[target] {\n\t\t\tj = mid - 1\n\t\t} else if result[mid] > result[target] {\n\t\t\ti = mid + 1\n\t\t} else {\n\t\t\tif result[target] == 0 {\n\t\t\t\tfor ; mid > 0; mid-- {\n\t\t\t\t\tif result[mid] != result[target] {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tFprintln(out, mid)\n\n\t\t\t} else {\n\n\t\t\t\tfor ; mid < len(result); mid++ {\n\t\t\t\t\tif result[mid] != result[target] {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tFprintln(out, mid)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\t}\n\n\tFprintln(out, mid+1)\n\n}\n\nfunc main() {\n\tRound(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "de4876aab7617b58ca43053869a0f58c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "e2829ab0669a18a726625a293d169de4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9028871391076115, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\treader *bufio.Reader\n\twriter *bufio.Writer\n)\n\nfunc init() {\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n}\nfunc scanf(format string, args ...interface{}) (int, error) {\n\treturn fmt.Fscanf(reader, format, args...)\n}\n\nfunc printf(format string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(writer, format, args...)\n}\n\nfunc getAddresses(n []int) []interface{} {\n\tadds := make([]interface{}, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tadds[i] = &n[i]\n\t}\n\treturn adds\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, k int\n\tscanf(\"%d %d\\n\", &n, &k)\n\tarr := make([]int, n)\n\tfmt.Fscan(reader, getAddresses(arr)...)\n\tanswer := k\n\tif arr[k] > 0 {\n\t\tfor i := k; i < n; i++ {\n\t\t\tif arr[k-1] == arr[i] {\n\t\t\t\tanswer++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i := k - 2; i >= 0; k++ {\n\t\t\tif arr[i] > 0 {\n\t\t\t\tanswer = i + 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\\n\", answer)\n\n}\n", "lang": "Go", "bug_code_uid": "708f235e4b449145807d3521f61d98a2", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2a904cfc9d24d3db0dd45a569dd0d3ce", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9272918861959958, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\treader *bufio.Reader\n\twriter *bufio.Writer\n)\n\nfunc init() {\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n}\nfunc scanf(format string, args ...interface{}) (int, error) {\n\treturn fmt.Fscanf(reader, format, args...)\n}\n\nfunc printf(format string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(writer, format, args...)\n}\n\nfunc getAddresses(n []int) []interface{} {\n\tadds := make([]interface{}, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tadds[i] = &n[i]\n\t}\n\treturn adds\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, k int\n\tscanf(\"%d %d\\n\", &n, &k)\n\tarr := make([]int, n)\n\tfmt.Fscan(reader, getAddresses(arr)...)\n\tanswer := k\n\tif arr[k] > 0 {\n\t\tfor i := k; i < n; i++ {\n\t\t\tif arr[k-1] == arr[i] {\n\t\t\t\tanswer++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i := k - 1; i >= 0; i-- {\n\t\t\tif arr[i] > 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tanswer--\n\t\t}\n\t}\n\tprintf(\"%d\\n\", answer)\n\n}\n", "lang": "Go", "bug_code_uid": "daa489cc85223eca67cfd9868761e550", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2a904cfc9d24d3db0dd45a569dd0d3ce", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9553719008264463, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tscores := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&scores[i])\n\t}\n\n\tcutoffScore := scores[k-1]\n\n\tvar nAdvanced int\n\tfor i := 0; scores[i] >= cutoffScore; i++ {\n\t\tnAdvanced++\n\t}\n\n\tfmt.Print(nAdvanced)\n}\n", "lang": "Go", "bug_code_uid": "a5b9a88beb4345f088c597c770f37df6", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "a8bc0f7bd0c148de010a43f27c581e7c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6666666666666666, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k, n int\n fmt.Scanf(\"%d %d\\n\", &n, &k)\n members := make([]int, n)\n for i:= 0; i < n; i++ {\n fmt.Scanf(\"%d\", &members[i])\n }\n limitScore := members[k-1]\n if limitScore == 0 {\n fmt.Println(\"0\")\n return\n }\n membersFinalNum := k\n for i := k; members[i] >= limitScore && i < len(members); i++ {\n membersFinalNum += 1\n }\n fmt.Println(membersFinalNum)\n}", "lang": "Go", "bug_code_uid": "fc0ba41bc45c77c881bfaa1d83220c8a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2f8cbd2d3b44126f4a8def5539e4bb7d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9974489795918368, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"bytes\"\nimport \"io/ioutil\"\nimport \"os\"\nimport \"strconv\"\n\nfunc task_solution(n int, k int, a []int) int {\n\tif a[k - 1] > 0 {\n\t\tfor i := k; i < len(a); i += 1 {\n\t\t\tif a[i] != a[k - 1] {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\t\treturn len(a)\n\t}\n\tfor i := k; i > 0; i -= 1 {\n\t\tif a[i] != 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc main() {\n\tvar n, k int\n\t_, err := fmt.Scanf(\"%d %d\", &n, &k)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tin_raw, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tin_raw_arr := bytes.Split(bytes.TrimSpace(in_raw), []byte(\" \"))\n\tin := []int{}\n\tfor _, val := range in_raw_arr {\n\t\tparsed_int, err := strconv.Atoi(string(val))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tin = append(in, parsed_int)\n\t}\n\n\tfmt.Println(task_solution(n, k, in))\n}\n", "lang": "Go", "bug_code_uid": "62eebfc37d62d8d7b48ee1c30cf3913f", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "e960cce9b77af97c32084285cab58b17", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8189868933758413, "equal_cnt": 24, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 8, "fix_ops_cnt": 23, "bug_source_code": "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 k_cf702d, a_cf702d, b_cf702d, t_cf702d int\n\nfunc startCar(d int64) float64 {\n\tif d <= int64(k_cf702d) {\n\t\treturn float64(int64(a_cf702d)*d)\n\t}\n\treturn float64(a_cf702d*k_cf702d) + math.Min(float64(float64(t_cf702d) + startCar(d-int64(k_cf702d))), float64(int64(b_cf702d)*(d-int64(k_cf702d))))\n}\n\nfunc main() {\n\n\t//fmt.Printf(\"%f\\n\", math.MaxFloat64)\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Buffer([]byte{}, int(math.Pow(10,8)))\n\n\tscanner.Scan()\n\tdkabtStr := scanner.Text()\n\tdkabtStrArr := strings.Split(dkabtStr, \" \")\n\td, _ := strconv.ParseInt(dkabtStrArr[0], 10, 64)\n\tk_cf702d, _ = strconv.Atoi(dkabtStrArr[1])\n\ta_cf702d, _ = strconv.Atoi(dkabtStrArr[2])\n\tb_cf702d, _ = strconv.Atoi(dkabtStrArr[3])\n\tt_cf702d, _ = strconv.Atoi(dkabtStrArr[4])\n\n\tvar resp float64\n\tif d <= int64(k_cf702d) {\n\t\tresp = float64(int64(a_cf702d) * d)\n\t} else {\n\t\tresp = float64(a_cf702d*k_cf702d)\n\t\tcarAvg := (float64(t_cf702d)/float64(k_cf702d)) + float64(a_cf702d)\n\t\tif carAvg <= float64(b_cf702d) {\n\t\t\tresp += float64(d - int64(k_cf702d)) * carAvg\n\t\t} else {\n\t\t\tresp += float64((d - int64(k_cf702d)) * int64(b_cf702d))\n\t\t}\n\t}\n\n\t//resp := math.Min(float64(int64(b_cf702d)*d), startCar(d))\n\n\tfmt.Printf(\"%f\\n\", math.Ceil(resp))\n}", "lang": "Go", "bug_code_uid": "85f881aa3d99c51903c5299c7c77a536", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "apr_id": "85d30886d39d4ba86786fdfbc36eb734", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9995048687902294, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nconst (\n\tn = 1000000007\n)\n\nfunc sum(a, b int) int {\n\ts := a + b\n\tif s >= n {\n\t\treturn s - n\n\t}\n\treturn s\n}\n\nfunc mul(a, b int) int {\n\treturn int(int64(a) * int64(b) % n)\n}\n\nfunc g0(a, b, h, w int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := h + 1; x <= a; x++ {\n\t\ts += g0(b, a - x, w, h)\n\t}\n\treturn s\n}\n\nfunc f0(a, b int) int {\n\tif a == 0 || b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := 1; x <= a; x++ {\n\t\ts += f0(b, a - x)\n\t}\n\treturn s\n}\n\nfunc power(a, n int) int {\n\tr := 1\n\tfor n > 0 {\n\t\tif (n & 1) != 0 {\n\t\t\tr = mul(r, a)\n\t\t}\n\t\tn /= 2\n\t\tif n > 0 {\n\t\t\ta = mul(a, a)\n\t\t}\n\t}\n\treturn r\n}\n\nfunc inv(a int) int {\n\treturn power(a, n - 2)\n}\n\nvar facts []int\nvar ifacts []int\n\nfunc cnk(n, k int) int {\n\tif k < 0 || k > n || n < 0 {\n\t\treturn 0\n\t}\n\treturn mul(mul(facts[n], ifacts[k]), ifacts[n-k])\n}\n\nfunc f1(a, b int) int {\n\treturn sum(cnk(a + b - 1, a), cnk(a + b - 1, 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 solve(a, b, h int) int {\n\tq := f1(a, b)\n\th += 1\n\tif a == 0 {\n\t\treturn 1\n\t}\n\tif b == 0 {\n\t\tif a >= h {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tp := 0\n\tfor ka := 1; ka * h <= a; ka++ {\n\t\tfor kb := max(1, ka - 1); kb <= ka + 1 && kb <= b; kb++ {\n\t\t\tc0 := cnk(b - 1, kb - 1)\n\t\t\tc1 := cnk(a - ka * (h - 1) - 1, ka - 1)\n\t\t\tfmt.Printf(\"%d %d %d %d\\n\", ka, kb, c0, c1)\n\t\t\td := mul(c0, c1)\n\t\t\tif ka == kb {\n\t\t\t\tp = sum(p, d)\n\t\t\t}\n\t\t\tp = sum(p, d)\n\t\t}\n\t}\n\treturn mul(p, inv(q))\n}\n\nfunc main() {\n\tm := 200100\n\tfacts = make([]int, m)\n\tifacts = make([]int, m)\n\tfacts[0] = 1\n\tfor i := 1; i < m; i++ {\n\t\tfacts[i] = mul(facts[i-1], i)\n\t}\n\tifacts[m-1] = inv(facts[m-1])\n\tfor i := m-2; i >= 0; i-- {\n\t\tifacts[i] = mul(ifacts[i+1], i+1)\n\t}\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\ta := cin.nextInt()\n\tb := cin.nextInt()\n\th := cin.nextInt()\n\tfmt.Printf(\"%d\\n\", solve(b, a, h))\n}\n\n// some io\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint64(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang": "Go", "bug_code_uid": "413c4ce9741c14216a099742e1362749", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "d062e7ec50af1cd04aa4c3184aba0791", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.92578125, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc get_digits(n int) []bool {\n\toutput := make([]bool, 10)\n\tfor n > 0 {\n\t\toutput[n%10] = true\n\t\tn = n/10\n\t}\n\treturn output\n}\n\nfunc compatible(digits []bool, n int) bool {\n\tfor n > 0 {\n\t\tif digits[n%10] {\n\t\t\treturn true\n\t\t}\n\t\tn = n/10\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar input int\n\tfmt.Scan(&input)\n\tdigits := get_digits(input)\n\tans := 0\n\tfor i:=1; i<=input; i++ {\n\t\tif input%i == 0 && compatible(digits, i) {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "b60d4fc15482be25b62da4c23e505f12", "src_uid": "ada94770281765f54ab264b4a1ef766e", "apr_id": "4664388f09b03db81f54e6c01908d0c0", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9978540772532188, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nvar n int\nvar k int\nvar x int\n\nfunc main() {\n fmt.Scan(&n, &k, &x)\n cnt := 0\n a := make([]int, n+k)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n for i := n; i < n+k; i++ {\n a[i] = x\n }\n sort.Ints(a)\n a = a[:len(a)-2]\n for _, value := range a {\n cnt += value\n }\n fmt.Println(cnt)\n}", "lang": "Go", "bug_code_uid": "3eb9a84f66e41725e8417e868aef6d09", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "1f2dfa0df40a5d6fffa5ffc2df27aa19", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9858657243816255, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, k, x, res int\n var a []int\n\n fmt.Scan(&n, &k, &x)\n\n a = make([]int, n)\n\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n\n for i := 0; i < n - k; i++ {\n res += a[i]\n }\n\n fmt.Print(res + x * 2)\n}\n", "lang": "Go", "bug_code_uid": "18dabbece1670192428ea7d89ba7f394", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "2358c18e539eec5237f0ddc12fe28ca0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.5624233505028207, "equal_cnt": 26, "replace_cnt": 22, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 25, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int { return len(slice) }\nfunc (slice Int64Slice) Less(i, j int) bool { return slice[i] < slice[j] }\nfunc (slice Int64Slice) Swap(i, j int) { slice[i], slice[j] = slice[j], slice[i] }\n\ntype Sq struct {\n\tv [8]int\n}\n\nfunc (sq *Sq) isPara() bool {\n\tchk1, chk2 := false, false\n\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif sq.v[i] == sq.v[0] {\n\t\t\tchk1 = true\n\t\t}\n\t}\n\tfor i := 3; i < 8; i = i + 2 {\n\t\tif sq.v[i] == sq.v[1] {\n\t\t\tchk2 = true\n\t\t}\n\t}\n\n\tif chk1 && chk2 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc check2in1(s1 *Sq, s2 *Sq, j int) bool {\n\txin, yin := false, false\n\n\txlarge, xsmall := 0, 0\n\tylarge, ysmall := 0, 0\n\tfor i := 0; i < 8; i = i + 2 {\n\t\tif s1.v[i] < s2.v[j*2] {\n\t\t\txlarge = xlarge + 1\n\t\t}\n\t\tif s1.v[i] > s2.v[j*2] {\n\t\t\txsmall = xsmall + 1\n\t\t}\n\t}\n\tif xlarge != 4 && xsmall != 4 {\n\t\txin = true\n\t}\n\n\tfor i := 1; i < 8; i = i + 2 {\n\t\tif s1.v[i] < s2.v[j*2+1] {\n\t\t\tylarge = ylarge + 1\n\t\t}\n\t\tif s1.v[i] > s2.v[j*2+1] {\n\t\t\tysmall = ysmall + 1\n\t\t}\n\t}\n\tif ylarge != 4 && ysmall != 4 {\n\t\tyin = true\n\t}\n\tif xin && yin {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc check1in2(s1 *Sq, s2 *Sq, i int) bool {\n\txaddy := s1.v[i*2] + s1.v[i*2+1]\n\txsuby := s1.v[i*2] - s1.v[i*2+1]\n\n\tvar xaddy2 [4]int\n\tvar xsuby2 [4]int\n\n\tfor j := 0; j < 4; j++ {\n\t\txaddy2[j] = s2.v[j*2] + s2.v[j*2+1]\n\t\txsuby2[j] = s2.v[j*2] - s2.v[j*2+1]\n\t}\n\n xin, yin := false, false\n\txlarge, xsmall := 0, 0\n\tylarge, ysmall := 0, 0\n\n\tfor j := 0; j < 4; j++ {\n\t\tif xaddy2[j] < xaddy {\n\t\t\txlarge = xlarge + 1\n\t\t}\n\t\tif xaddy2[j] > xaddy {\n\t\t\txsmall = xsmall + 1\n\t\t}\n\t}\n\tif xlarge != 4 && xsmall != 4 {\n\t\txin = true\n\t}\n\n\tfor j := 0; j < 4; j++ {\n\t\tif xsuby2[j] < xsuby {\n\t\t\tylarge = ylarge + 1\n\t\t}\n\t\tif xsuby2[j] > xsuby {\n\t\t\tysmall = ysmall + 1\n\t\t}\n\t}\n\tif ylarge != 4 && ysmall != 4 {\n\t\tyin = true\n\t}\n\tif xin && yin {\n\t\treturn true\n\t}\n\treturn false\n\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tvar s1, s2 Sq\n\n\tfor i := 0; i < 8; i++ {\n\t\ts1.v[i] = ReadInt32()\n\t}\n\n\tfor i := 0; i < 8; i++ {\n\t\ts2.v[i] = ReadInt32()\n\t}\n\n\tif !s1.isPara() {\n\t\ts1, s2 = s2, s1\n\t}\n\n chk1in2, chk2in1 := false, false\n\n\tfor i := 0; i < 4; i++ {\n\t\tif check2in1(&s1, &s2, i) {\n\t\t\tchk2in1 = true\n\t\t}\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tif check1in2(&s1, &s2, i) {\n\t\t\tchk1in2 = true\n\t\t}\n\t}\n\n\tif chk1in2 || chk2in1 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n\nfunc Demo() {\n\tvar n, m int64 = ReadInt64(), ReadInt64()\n\tPrintInt64s(n, m)\n\twriter.WriteByte('\\n')\n\tslice := []int64{1, 2, 3, 4, 5}\n\tPrintInt64s(slice...)\n\n\t// sortDemo\n\t//slice := []int64{5, 3, 4, 2, 1}\n\tsort.Sort(Int64Slice(slice))\n\n\t//s := strconv.FormatBool(true)\n\t//s := strconv.FormatFloat(3.1415, 'E', -1, 64)\n\t//s := strconv.FormatInt(-42, 16)\n\t//s := strconv.FormatUint(42, 16)\n\n}\n\nfunc Min(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc ReadInt64() int64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn ans\n}\n\nfunc ReadFloat64() float64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn ans\n}\n\nfunc PrintInt64s(ints ...int64) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(int(value)))\n\t\twriter.WriteByte(' ')\n\t}\n}\n", "lang": "Go", "bug_code_uid": "3874f482babc22f618acd8f0b605fef2", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "ad9d5a8c8455b440ed291919569fdc9c", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8795180722891566, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\t\n\tvar n, m int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &m)\n\tvar pa, pb [10][10]bool\n\tfor i := 0;i < n;i ++ {\n\t\tvar x, y int\n\t\tif i == n - 1 {\n\t\t\tfmt.Fscanf(reader, \"%d %d\\n\", &x, &y)\n\t\t} else {\n\t\t\tfmt.Fscanf(reader, \"%d %d \", &x, &y)\n\t\t}\n\t\tpa[x][y] = true\n\t\tpa[y][x] = true\n\t}\n\tfor i := 0;i < m;i ++ {\n\t\tvar x, y int\n\t\tif i == m - 1 {\n\t\t\tfmt.Fscanf(reader, \"%d %d\\n\", &x, &y)\n\t\t} else {\n\t\t\tfmt.Fscanf(reader, \"%d %d \", &x, &y)\n\t\t}\n\t\tpb[x][y] = true\n\t\tpb[y][x] = true\n\t}\n\n\tsolution := make([]bool, 10)\n\n\tcanDeduce := true\n\tfor i := 1; i < 10;i ++ {\n\t\tfor j := 1;j < 10;j ++ {\n\t\t\tif !pa[i][j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar b1, b2 bool\n\t\t\tfor k := 1; k < 10;k ++ {\n\t\t\t\tif pb[i][k] && k != j {\n\t\t\t\t\tsolution[i] = true\n\t\t\t\t\tb1 = true\n\t\t\t\t}\n\t\t\t\tif pb[k][j] && k != i {\n\t\t\t\t\tsolution[j] = true\n\t\t\t\t\tb2 = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif b1 && b2 {\n\t\t\t\tcanDeduce = false\n\t\t\t}\n\t\t}\n\t}\n\n\tans, ansCount := 0, 0\n\tfor i := 1;i < len(solution);i ++ {\n\t\tif solution[i] {\n\t\t\tans, ansCount = i, ansCount + 1\n\t\t}\n\t}\n\tif ansCount == 1 {\n\t\tfmt.Printf(\"%d\", ans)\n\t} else if canDeduce {\n\t\tfmt.Printf(\"0\")\n\t} else {\n\t\tfmt.Printf(\"-1\")\n\t}\n\t\n}\n", "lang": "Go", "bug_code_uid": "79e27f924fbc9c42b87c835f588e1c36", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "2cd1747b2f443713aef085074327148e", "difficulty": 1900, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8321579689703809, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\ta := 0\n\tfmt.Fscanf(in, \"%d\\n\", &a)\n\tfor i := 2; i < int(math.Sqrt(float64(a)))+2; i++ {\n\t\tif a%i == 0 {\n\t\t\tfmt.Fprintf(out, \"%d\\n\", a/i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", 1)\n\treturn\n}", "lang": "Go", "bug_code_uid": "3265a2cca8887e286a5e59f73c0a062a", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "07858b71f0e552f8c6ca2a24b0258956", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9936708860759493, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "// Codeforces 1076 B Divisor Subtraction train\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i 0 && number < 11 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(\"Enter number > 2 and < 10^5\")\n\t\t}\n\t\tfmt.Println(err)\n\t}\n}\nfmt.Println(matrix(number)[number][number])\n}", "lang": "Go", "bug_code_uid": "e92b4502d665bdb21db3054ef2ec1d76", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "e9c79bdeab084ec97451a810523b0e9c", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9791790600832838, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n\nfunc matrix(a int) [][]int {\n\tvar matrix = [][]int{}\n\tfor j:= 0 ; j 0 && number < 11 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(\"Enter number > 2 and < 10^5\")\n\t\t}\n\t\tfmt.Println(err)\n\t}\n}\nfmt.Println(matrix(number)[number-1][number-1])\n}", "lang": "Go", "bug_code_uid": "f46ceedc0ac93c25e5e246ef285888a4", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "e9c79bdeab084ec97451a810523b0e9c", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9680589680589681, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tmatrix := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tmatrix[i] = make([]int, n)\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i == 0 {\n\t\t\t\tmatrix[0][j] = 1\n\t\t\t} else {\n\t\t\t\tmatrix[j][0] = 1\n\t\t\t}\n\t\t}\n\t}\n\tfill(matrix, 1, 1)\n\tfmt.Println(matrix[n-1][n-1])\n\t// for i := 0; i < n; i++ {\n\t// \tfor j := 0; j < n; j++ {\n\t// \t\tfmt.Print(matrix[i][j], \" \")\n\t// \t}\n\t// \tfmt.Println()\n\t// }\n}\n\nfunc fill(matrix [][]int, i int, j int) {\n\tif matrix[i][j] == 0 && matrix[i][j-1] != 0 && matrix[i-1][j] != 0 {\n\t\tmatrix[i][j] = matrix[i-1][j] + matrix[i][j-1]\n\t\tif i < len(matrix) && j+1 < len(matrix[i]) {\n\t\t\tfill(matrix, i, j+1)\n\t\t}\n\t\tif i+1 < len(matrix) && j < len(matrix[i]) {\n\t\t\tfill(matrix, i+1, j)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4cacade7257bafd80ca11f204cc2a439", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "161d2562fdac58f79ec08fa21188cba0", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8073089700996677, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(reader, &n)\n\n\tarr := []int{1, 1, 1, 1, 1}\n\n\tfor n > 1 {\n\t\tfor i := 1; i < 5; i++ {\n\t\t\tarr[i] = arr[i] + arr[i-1]\n\t\t}\n\n\t\tn--\n\t}\n\n\tfmt.Println(arr[4])\n}\n", "lang": "Go", "bug_code_uid": "27bcb3fd1577914498d7d4294dd9ce83", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "9692ccf8c50163f5831327cfd1c9fbaa", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9722943722943723, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar r *bufio.Reader = bufio.NewReader(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\ntype Vertice struct {\n\tX int\n\tY int\n}\n\nfunc dist(a, b Vertice) int {\n\tx, y := a.X-b.X, a.Y-b.Y\n\treturn x*x + y*y\n}\n\nfunc isRight(a, b, c Vertice) bool {\n\tes := []int{dist(a, b), dist(b, c), dist(c, a)}\n\tsort.Ints(es)\n\n\treturn es[0]+es[1] == es[2]\n}\n\nfunc getAdjs(v Vertice) []Vertice {\n\treturn []Vertice{Vertice{v.X - 1, v.Y}, Vertice{v.X + 1, v.Y}, Vertice{v.X, v.Y - 1}, Vertice{v.X, v.Y + 1}}\n}\n\nfunc solve(a, b, c Vertice) string {\n\tif isRight(a, b, c) {\n\t\treturn \"RIGHT\"\n\t}\n\n\tfor i := 0; i < 3; i++ {\n\t\tvar v1, v2, v3 Vertice\n\t\tswitch i {\n\t\tcase 0:\n\t\t\tv1, v2, v3 = a, b, c\n\t\tcase 1:\n\t\t\tv1, v2, v3 = b, c, a\n\t\tcase 2:\n\t\t\tv1, v2, v3 = c, a, b\n\t\t}\n\t\tadjs := getAdjs(v1)\n\t\tfor _, v := range adjs {\n\t\t\tif isRight(v, v2, v3) {\n\t\t\t\treturn \"ALMOST\"\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"NEITHER\"\n}\n\nfunc main() {\n\tdefer w.Flush()\n\n\ta, b, c := Vertice{}, Vertice{}, Vertice{}\n\tfmt.Fscanf(r, \"%d %d %d %d %d %d\", &a.X, &a.Y, &b.X, &b.Y, &c.X, &c.Y)\n\n\tfmt.Fprintf(w, \"%v\", solve(a, b, c))\n}\n", "lang": "Go", "bug_code_uid": "89c50f698f979440b4c0f458f88dbed9", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "75be3df3d997affc98ca7433713e03e4", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9579524680073126, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype Pont struct {\n\tx, y int32\n}\n\nfunc (o *Pont) read() {\n\tfmt.Scan(&o.x)\n\tfmt.Scan(&o.y)\n}\n\nfunc (o *Pont) add(oo Pont) {\n\to.x += oo.x\n\to.y += oo.y\n}\n\nfunc (o *Pont) eq(oo Pont) bool {\n\treturn o.x == oo.x && o.y == oo.y\n}\n\nfunc isRA(A, B, C Pont) bool {\n\tAB := Pont{B.x - A.x, B.y - A.y}\n\tAC := Pont{C.x - A.x, C.y - A.y}\n\treturn 0 == AB.x*AC.x+AB.y*AC.y\n}\n\nfunc isRATRI(A, B, C Pont) bool {\n\tif A.eq(B) || A.eq(C) || B.eq(C) {\n\t\treturn false\n\t}\n\treturn isRA(A, B, C) || isRA(B, A, C) || isRA(C, A, B)\n}\n\nfunc main() {\n\n\tvar (\n\t\tP [3]Pont\n\t\tdir = [4]Pont{Pont{0, 1}, Pont{1, -1}, Pont{-1, -1}, Pont{-1, 1}}\n\t\tdelta = Pont{1, 0}\n\t\ti, j int32\n\t)\n\n\tP[0].read()\n\tP[1].read()\n\tP[2].read()\n\tif isRATRI(P[0], P[1], P[2]) {\n\t\tfmt.Println(\"RIGHT\")\n\t\treturn\n\t}\n\n\talmost := false\n\nouter:\n\tfor i = 0; i < 3; i++ {\n\t\tfor j = 0; j < 4; j++ {\n\t\t\tP[i].add(dir[j])\n\t\t\tif isRATRI(P[0], P[1], P[2]) {\n\t\t\t\talmost = true\n\t\t\t\tbreak outer\n\t\t\t}\n\t\t\tP[i].add(delta)\n\t\t}\n\t}\n\n\tif almost {\n\t\tfmt.Println(\"ALMOST\")\n\n\t} else {\n\t\tfmt.Println(\"NEITHER\")\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "4c0c62a9179ccfb75120a8f4b2adbfa8", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "b5e3e4fce39449c471a2384564faeb6c", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9990079365079365, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc gcd(a, b int64) int64 {\n\tif a % b == 0 {\n\t\treturn b\n\t} else {\n\t\treturn gcd(b , a % b)\n\t}\n}\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar la, ra, ta, lb, rb, tb int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &la, &ra, &ta)\n\tfmt.Fscanf(reader, \"%d %d %d\", &lb, &rb, &tb)\n\n\tfactor := gcd(ta, tb)\n\n\tvar ans1, ans2 int64\n\n\t// Bob first, Alice after\n\t// (la - lb) + (ka * ta) - (kb * tb) = diff > 0\n\tdiff1 := (la - lb) % factor\n\tif diff1 < 0 {\n\t\tdiff1 += factor\n\t}\n\tif rb - lb + 1 < diff1 {\n\t\tans1 = 0\n\t} else if rb - lb + 1 > diff1 + (ra - la + 1) {\n\t\tans1 = ra - la + 1\n\t} else {\n\t\tans1 = rb - lb + 1 - diff1\n\t}\n\n\tdiff2 := (lb - la) % factor\n\tif diff2 < 0 {\n\t\tdiff2 += factor\n\t}\n\tif ra - la + 1 < diff2 {\n\t\tans2 = 0\n\t} else if ra - la + 1 > diff1 + (rb - lb + 1) {\n\t\tans2 = rb - lb + 1\n\t} else {\n\t\tans2 = ra - la + 1 - diff2\n\t}\n\tif ans1 > ans2 {\n\t\tfmt.Printf(\"%d\", ans1)\n\t} else {\n\t\tfmt.Printf(\"%d\", ans2)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "a75baef0f7fb1015710544a53f809640", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "2d9f0e6bbdc24e4708f263d2a96599a3", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9992542878448919, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := readInt()\n\tb := readInt()\n\tif a < b {\n\t\ta = b\n\t}\n\n\tar = []string{\"0/1\", \"1/1\", \"5/6\", \"2/3\", \"1/2\", \"1/3\", \"1/6\"}\n\tfmt.Println(ar[a])\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n", "lang": "Go", "bug_code_uid": "37043fdb10393ce4ab35f21ac71691a3", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "f8383075859e8c3459f4c92dc6bea812", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.70509977827051, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar y, w, z uint8\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d\\n\", &y, &w)\n\tif y >= w {\n\t\tz = 6 - y + 1\n\t} else {\n\t\tz = 6 - w + 1\n\t}\n\tif z == 1 {\n\t\tfmt.Println(\"1/1\")\n\t} else if z == 2 {\n\t\tfmt.Println(\"5/6\")\n\t} else if z == 3 {\n\t\tfmt.Println(\"1/2\")\n\t} else if z == 4 {\n\t\tfmt.Println(\"1/3\")\n\t} else if z == 5 {\n\t\tfmt.Println(\"1/5\")\n\t} else if z == 6 {\n\t\tfmt.Println(\"1/6\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "2da4c4e8f3fdeea02c4b70fd85ad9a02", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "c996ab8e5ff59e810dfacacceaef8d49", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9382198952879581, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar wWins, yWins, targetHigherWins int\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(reader, &yWins)\n\tfmt.Fscan(reader, &wWins)\n\tif wWins > yWins {\n\t\ttargetHigherWins = wWins\n\t} else {\n\t\ttargetHigherWins = yWins\n\t}\n\trolls := 6 - targetHigherWins + 1\n\tif rolls == 3 {\n\t\tfmt.Print(1, \"/\", 2)\n\t} else if rolls%2 == 0 {\n\t\tfmt.Print(rolls/2, \"/\", 3)\n\t} else {\n\t\tfmt.Print(rolls, \"/\", 6)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "823f538b1af841d437d8ed3cd8e51b55", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "8b1992ad683854a9c37b674846beaa78", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.46511627906976744, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "package main \n\nimport \"fmt\"\n\nfunc main() {\n\tvar yScore int\n\tfmt.Scan(&yScore)\n\tvar wScore int\n\tfmt.Scan(&wScore)\n\n\tmaxNo := yScore\n\n\tif yScore > wScore {\n\t\tmaxNo = yScore\n\t} else {\n\t\tmaxNo = wScore\n\t}\n\tmaxNo = 6 - maxNo+1\n\tmaxNo = 6 / 3\n\tif maxNo = 0 {\n\t\tmaxNo = 1\n\t}\n\tfmt.Printf(\"1/%d\", maxNo)\n}", "lang": "Go", "bug_code_uid": "464e31b7b7510e10b8bffa1f295a9783", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "2fedfc99335b2b031bd7fe68eb55a702", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9449438202247191, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "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\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tc := make([][]int, 2)\n\tc[0] = make([]int, n)\n\tc[1] = make([]int, n)\n\tk := make([]int, 2)\n\tpos := make([]int, 2)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tsteps := 0\n\twinner := -1\n\tloop := false\n\n\tfor j := 0; j < 2; j++ {\n\t\tscanner.Scan()\n\t\tvar ek error\n\t\tk[j], ek = strconv.Atoi(scanner.Text())\n\t\tif ek != nil {\n\t\t\treturn\n\t\t}\n\t\tfor i := 0; i < k[j] && scanner.Scan(); i++ {\n\t\t\ta, err := strconv.Atoi(scanner.Text())\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc[j][i] = a\n\t\t}\n\t}\n\n\tinit_sit := situation_to_code(c, k, pos, n)\n\n\tfor true {\n\t\tf := make([]int, 2)\n\t\tf[0] = c[0][pos[0]]\n\t\tf[1] = c[1][pos[1]]\n\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tc[i][pos[i]] = 0\n\t\t\tpos[i]++\n\t\t\tif pos[i] >= n {\n\t\t\t\tpos[i] = pos[i] % n\n\t\t\t}\n\t\t}\n\n\t\tic := -1\n\t\tif f[0] > f[1] {\n\t\t\tic = 0\n\t\t} else { // not equal guaranteed\n\t\t\tic = 1\n\t\t}\n\n\t\tip := pos[ic] + k[ic] - 1\n\t\tif ip >= n {\n\t\t\tip = ip % n\n\t\t}\n\t\tc[ic][ip] = f[(ic+1)%2]\n\t\tip++\n\t\tif ip >= n {\n\t\t\tip = ip % n\n\t\t}\n\t\tc[ic][ip] = f[ic]\n\n\t\tk[ic]++\n\t\tk[(ic+1)%2]--\n\n\t\tsteps++\n\n\t\tcurr_sit := situation_to_code(c, k, pos, n)\n\t\tif curr_sit == init_sit {\n\t\t\tloop = true\n\t\t\tbreak\n\t\t}\n\t\tif k[(ic+1)%2] == 0 {\n\t\t\twinner = ic + 1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif loop {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(steps, winner)\n\t}\n}\n\nfunc situation_to_code(c [][]int, k, p []int, n int) string {\n\tres := make([]string, n+2)\n\tres[0], res[1] = strconv.Itoa(k[0]), strconv.Itoa(k[1])\n\trp := 2\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < k[i]; j++ {\n\t\t\tpos := (p[0] + j) % n\n\t\t\tres[rp] = strconv.Itoa(c[i][pos])\n\t\t\trp++\n\t\t}\n\t}\n\treturn strings.Join(res, \",\")\n}\n", "lang": "Go", "bug_code_uid": "061dfc7adea35dadb13422f0e8d7e609", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "4f1be0c8de89c593a315f8735373aeb5", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9981046247156937, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst N = 10\n\ntype Deck struct {\n\tcards []int\n}\n\nfunc (d *Deck) addCard(c int) {\n\td.cards = append(d.cards, c)\n}\n\nfunc (d *Deck) isLosing() bool {\n\treturn len(d.cards) == 0\n}\n\nfunc (d *Deck) hash() int64 {\n\tvar h int64\n\tfor _, c := range d.cards {\n\t\th = N*h + int64(c)\n\t}\n\treturn h\n}\n\nfunc oneRound(d1, d2 *Deck) {\n\tvar c1, c2 int\n\tc1, d1.cards = d1.cards[0], d1.cards[1:]\n\tc2, d2.cards = d2.cards[0], d2.cards[1:]\n\td := d1\n\tif c1 < c2 {\n\t\tc1, c2 = c2, c1\n\t\td = d2\n\t}\n\td.addCard(c2)\n\td.addCard(c1)\n}\n\nfunc makeKey(d1, d2 Deck) string {\n\treturn strconv.FormatInt(d1.hash(), 10) + \"#\" + strconv.FormatInt(d2.hash(), 10)\n}\n\nfunc main() {\n\tnextInt()\n\tvar d1, d2 Deck\n\tk1 := nextInt()\n\tfor i := 0; i < k1; i++ {\n\t\td1.addCard(nextInt() - 1)\n\t}\n\tk2 := nextInt()\n\tfor i := 0; i < k2; i++ {\n\t\td2.addCard(nextInt() - 1)\n\t}\n\twas := make(map[string]struct{})\n\tfor rounds := 0; ; rounds++ {\n\t\tif d1.isLosing() {\n\t\t\tfmt.Println(rounds, 2)\n\t\t\treturn\n\t\t}\n\t\tif d2.isLosing() {\n\t\t\tfmt.Println(rounds, 1)\n\t\t\treturn\n\t\t}\n\t\tkey := makeKey(d1, d2)\n\t\tif _, ok := was[key]; ok {\n\t\t\tbreak\n\t\t}\n\t\twas[key] = struct{}{}\n\t\toneRound(&d1, &d2)\n\t}\n\tfmt.Println(-1)\n}\n\nfunc init() {\n\t// maybe defer writer.Flush() in main\n\n\tlineScanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\n\t/*\n\t\tinputFile, err := os.Open(\"a.in\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\toutputFile, err := os.Create(\"a.out\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tlineScanner = bufio.NewScanner(inputFile)\n\t\twriter = bufio.NewWriter(outputFile)\n\t*/\n\n\twordScanner = bufio.NewScanner(strings.NewReader(\"\"))\n\twordScanner.Split(bufio.ScanWords)\n}\n\nvar lineScanner *bufio.Scanner\nvar wordScanner *bufio.Scanner\n\nvar writer *bufio.Writer\n\nfunc nextLine() (string, error) {\n\tif !lineScanner.Scan() {\n\t\tif err := lineScanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn \"\", errors.New(\"nextLine: EOF reached\")\n\t}\n\treturn lineScanner.Text(), nil\n}\n\nfunc nextWord() string {\n\tfor !wordScanner.Scan() {\n\t\tif err := wordScanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tline, err := nextLine()\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\twordScanner = bufio.NewScanner(strings.NewReader(line))\n\t\twordScanner.Split(bufio.ScanWords)\n\t}\n\treturn wordScanner.Text()\n}\n\nfunc nextInt() int {\n\tres, err := strconv.Atoi(nextWord())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc nextInt64() int64 {\n\tres, err := strconv.ParseInt(nextWord(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc nextFloat64() float64 {\n\tres, err := strconv.ParseFloat(nextWord(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "c24fa2c33850666789ab49a03fa51b4a", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "65f2e68a6f48fee1a5f02719c8c4fa55", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.687218045112782, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tn := int64(scanInt(scanner))\n\tm := int64(scanInt(scanner))\n\tx := int64(1)\n\tfor i := int64(1); i <= n; i++ {\n\t\tx *= 3\n\t\tif x >= m {\n\t\t\tx = ((x%m)*(n/i))%m\n\t\t\tfor j := n%i; j != 0; j-- {\n\t\t\t\tx *= 3\n\t\t\t\tif x >= m {\n\t\t\t\t\tx %= m\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tx--\n\tif x == -1 {\n\t\tx = m-1\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", x))\n}\n", "lang": "Go", "bug_code_uid": "9a77754584879aa879ca32f8eba0ade5", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "b4cde848cc4867bfd079c8d4fc971db9", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7905882352941176, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "// 172B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x [100005]int\n\tvar a, b, m, r, s int\n\tfmt.Scan(&a, &b, &m, &r)\n\tfor ; ; r = (r*a + b) % m {\n\t\tx[r] += s\n\t}\n\tfmt.Print(s - x[r] + 1)\n}\n", "lang": "Go", "bug_code_uid": "10a0c4f89871be9a5f94fb7b9ba32293", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "1fd027b719418ad60bdd32c40eb100ba", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7412587412587412, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "// 172B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x [100005]int\n\tvar a, b, m, r, s int\n\tfmt.Scan(&a, &b, &m, &r)\n\tfor x[r] = 0; r == (r*a+b)%m; {\n\t\tx[r] += s\n\t}\n\tfmt.Print(s - x[r] + 1)\n}\n", "lang": "Go", "bug_code_uid": "82ee08faeb90a22f36db2e9edd6019e3", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "1fd027b719418ad60bdd32c40eb100ba", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9866939611054247, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n s := getS()\n n := len(s)\n for i := range s {\n if s[i] == '.' {\n continue\n }\n jump := 0\n for {\n jump++\n if i + 4*jump >= n {\n break\n }\n okay := true\n for j := 1; j <= 4; j++ {\n if s[i+j*jump] == '.' {\n okay = false\n break\n }\n }\n if okay {\n writer.WriteString(\"yes\\n\")\n return\n }\n }\n }\n writer.WriteString(\"no\\n\")\n}\n", "lang": "Go", "bug_code_uid": "015765069d0bd241b0fbba04fca63f2e", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "aa5acc4c13734e6dcfa95fbce04dc8b8", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9796163069544365, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar count [10]int\nvar numbers []int\n\nfunc initCount(n int64) int {\n\tvar cnt int\n\tfor ; n > 0; {\n\t\tcount[n%10]++\n\t\tnumbers = append(numbers, int(n%int64(10)))\n\t\tn /= 10\n\t\tcnt ++\n\t}\n\treturn cnt\n}\n\nvar dp [1<<18][100]int64\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tcnt := initCount(n)\n\tdp[0][0] = 1\n\tvar mask int = int(uint(1)< 0; {\n\t\tcount[n%10]++\n\t\tnumbers = append(numbers, int(n%int64(10)))\n\t\tn /= 10\n\t\tcnt ++\n\t}\n\treturn cnt\n}\n\nvar dp [1<<18][100]int\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tcnt := initCount(n)\n\tdp[0][0] = 1\n\tvar mask int = int(uint(1)< 0 && allzero(i) {\n for j := 0; j < m; j++ {\n a[i][j] = 0\n }\n }\n for j := 0; j < m; j++ {\n if a[i][j] == 0 {\n continue\n }\n for k := uint(0); k < wid; k++ {\n if (i & (1 << k)) != 0 {\n continue\n }\n a[i|(1<= 0; i-- {\n if a[i] == 1 {\n finishPos = i\n break\n }\n }\n// fmt.Printf(\"start = %d finish = %d\\n\", startPos, finishPos)\n if startPos == finishPos || startPos+1 == finishPos {\n fmt.Printf(\"%d\", 1)\n return\n }\n var totalCount uint64 = 1\n var previous1 int = startPos\n for i := startPos + 1; i <= finishPos; i++ {\n// fmt.Printf(\"totalCount at start = %d \", totalCount)\n// fmt.Printf(\"a[%d] = %d\\n\", i, a[i])\n if a[i] == 1 {\n totalCount *= i - previous1\n previous1 = i\n }\n// fmt.Printf(\"totalCount at finish = %d\\n\", totalCount)\n }\n fmt.Printf(\"%d\", totalCount)\n}\n", "lang": "Go", "bug_code_uid": "6b314fc205d0fa38eeba367e9c052cec", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "759b1f1c7e86426084a92b4dc7477713", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8916761687571265, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, a int\n fmt.Scan(&n)\n\n res := 1\n acum := 0\n first := true\n for i := 0; i < n; i++ {\n fmt.Scan(&a)\n if a == 1 {\n if !first {\n res *= acum + 1\n }\n first = false\n acum = 0 \n } else {\n acum++ \n }\n }\n fmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "366c15bdcecb0c8bb6f50ca36a21c404", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "87f907d389ab7927f7435f9366535022", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9641125121241513, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n var ans, m, t, i int64\n var a [200]int64\n fmt.Scanf(\"%I64d\\n\",&n)\n for i = 1; i <= n; i++ {\n fmt.Scanf(\"%I64d\",&a[i])\n }\n\n t = 1\n ans = 1\n for a[t] == 0 {\n t = t + 1\n if t == n+1 {\n break\n }\n }\n m = 0;\n for i = t; i <= n; i++ {\n if a[i]==1 {\n ans = ans * (m + 1)\n m = 0\n } else {\n m = m + 1\n }\n }\n\n fmt.Println(ans) \n}", "lang": "Go", "bug_code_uid": "aa064f44326c7acaff7c87c36f161d1b", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "a928f47f8797347473f1a587bf2f0ec1", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9653998865570051, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ta := nextInt()\n\tmin := 0\n\ti := a\n\n\tfor ; i <= 1000000008; i++ {\n\t\tif has8(i) {\n\t\t\tmin = i - a\n\t\t\tbreak\n\t\t}\n\t}\n\n\tprintln(min)\n}\n\nfunc has8(n int) bool {\n\tfor n > 0 {\n\t\tif n % 10 == 8 {\n\t\t\treturn true\n\t\t}\n\n\t\tn /= 10\n\t}\n\n\tfor n < 0 {\n\t\tif n % 10 == -8 {\n\t\t\treturn true\n\t\t}\n\n\t\tn /= 10\n\t}\n\n\treturn false\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}", "lang": "Go", "bug_code_uid": "64e040132a2efa0213804cfc3f00bba2", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "e7aa2fc4f52e90e0b2b14f50c7503508", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9922308546059934, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tscanner.Scan()\n\ta, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\tfor i := int64(1); i <= 10; i++ {\n\t\ts := strconv.FormatInt(a+i, 10)\n\t\tfor _, ch := range s {\n\t\t\tif ch == '8' {\n\t\t\t\twriter.WriteString(fmt.Sprintf(\"%d\\n\", i))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4f0a8df0b0b8851174eb4e9685954909", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "ba62bf2e9796c9432290e35f87312b56", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.20145631067961164, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min(x, y int) int {\n\tif y < x {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tt := make([][]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tt[i] = make([]int, 0, 5000)\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\tx--\n\t\tt[x] = append(t[x], i)\n\t}\n\tz := 1 << 30\n\tfor i := 0; i < 3; i++ {\n\t\tz = min(z, len(t[i]))\n\t}\n\tfmt.Println(z)\n\tfor i := 0; i < z; i++ {\n\t\tfmt.Printf(\"%d %d %d\\n\", t[0][0], t[1][0], t[2][0])\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tt[j] = t[j][1:]\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "9e900519a37102ff43036ca67e02f2bf", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "e526a551a3ac78120d583ea0fcee3f0e", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9883527454242929, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc isLucky(a int64) bool {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\tfor ; a > 0; a /= 10 {\n\t\tif a%10 == 8 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar a int64\n\tfmt.Scan(&a)\n\tfor i := int64(1); i <= 10; i++ {\n\t\tif isLucky(i + a) {\n\t\t\tfmt.Printf(\"%d\\n\", i)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "7518d3525dcbba97e02fc46a81cf5bc5", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "bd9070888215bbc3f05a3404196b5699", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9069124423963134, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar str string\n\tfmt.Scanf(\"%s\\n\", &str)\n\tvar dest = [5]string {\"Danil\", \"Olya\", \"Slava\", \"Ann\" ,\"Nikita\"}\n\tsum := 0\n\tfor i := 0; i < 5; i++{\n\t\tif matchStr(str, dest[i]){\n\t\t\tsum++\n\t\t}\n\t}\n\tif sum == 1{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc matchStr(src string, dest string) bool{\n\tfor i := 0; i + len(dest) - 1 < len(src); i++{\n\t\tflag := true\n\t\tfor j := 0; j < len(dest); j++{\n\t\t\tif src[i + j] != dest[j]{\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "lang": "Go", "bug_code_uid": "30c1f93e0f439e7398fd3fd6c6ade8ca", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "e2ea4c96ab3c914ae10696d4b7d54013", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9888888888888889, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc code877A(){\n\tvar str string\n\tfmt.Scanf(\"%s\\n\", &str)\n\tvar dest = [5]string {\"Danil\", \"Olya\", \"Slava\", \"Ann\" ,\"Nikita\"}\n\tsum := 0\n\tfor i := 0; i < 5; i++{\n\t\tsum += matchStr(str, dest[i])\n\t}\n\tif sum == 1{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc matchStr(src string, dest string) int{\n\tsum := 0\n\tfor i := 0; i + len(dest) - 1 < len(src); i++{\n\t\tflag := true\n\t\tfor j := 0; j < len(dest); j++{\n\t\t\tif src[i + j] != dest[j]{\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tsum++\n\t\t}\n\t}\n\treturn sum\n}", "lang": "Go", "bug_code_uid": "f799b942e86b6d4c70eafae1156a37a9", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "e2ea4c96ab3c914ae10696d4b7d54013", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.931899641577061, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n n, k := getI(), getI()\n\n notPrime := make([]bool, n+1)\n primes := []int{}\n p := 2\n for p <= n {\n primes = append(primes, p)\n for i := 2*p; i <= n; i += p {\n notPrime[i] = true\n }\n for p++; p <= n && notPrime[p]; p++ {\n }\n }\n\n count := 0\n for i := 1; i < len(primes); i++ {\n s := primes[i-1] + primes[i] + 1\n if s <= n && !notPrime[s] {\n count++\n if count == k {\n writer.WriteString(\"YES\\n\")\n return\n }\n }\n if s > n {\n writer.WriteString(\"NO\\n\")\n return\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "002f9e8ba18b46e2f994b2b18106f417", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "764575692c34b74e52fe4c4f878f9437", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9723856948845632, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n n, k := getI(), getI()\n\n notPrime := make([]bool, n+1)\n primes := []int{}\n p := 2\n for p <= n {\n primes = append(primes, p)\n for i := 2*p; i <= n; i += p {\n notPrime[i] = true\n }\n for p++; p <= n && notPrime[p]; p++ {\n }\n }\n\n count := 0\n for i := 1; i < len(primes); i++ {\n s := primes[i-1] + primes[i] + 1\n if s > n {\n break\n }\n if !notPrime[s] {\n count++\n if count == k {\n writer.WriteString(\"YES\\n\")\n return\n }\n }\n }\n writer.WriteString(\"NO\\n\")\n}\n", "lang": "Go", "bug_code_uid": "b6a115b640df286875ea878b2ca5c44c", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "764575692c34b74e52fe4c4f878f9437", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.996219281663516, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc seive_of_eratosthenes(n int64) ([]int64, []bool) {\n\tvar isPrime []bool = []bool{}\n\tvar i int64\n\tvar j int64\n\tfor i = 0; i <= n; i++ {\n\t\tisPrime = append(isPrime, true)\n\t}\n\n\tfor i = 2; i*i <= (n); i++ {\n\t\tif isPrime[i] == true {\n\t\t\tfor j = i * i; j <= n; j += i {\n\t\t\t\tisPrime[j] = false\n\t\t\t}\n\t\t}\n\t}\n\tvar result []int64 = []int64{}\n\tfor i = 2; i <= n; i++ {\n\t\tif isPrime[i] == true {\n\t\t\tresult = append(result, i)\n\t\t}\n\t}\n\treturn result, isPrime\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\twords := strings.Fields(scanner.Text())\n\tn, _ := strconv.ParseInt(words[0], 10, 64)\n\tk, _ := strconv.ParseInt(words[1], 10, 64)\n\tvar res []int64 = []int64{}\n\tvar isPrime []bool\n\tres, isPrime = seive_of_eratosthenes(n)\n\tvar count int64 = 0\n\t// var i int64\n\tfor i := 0; i < len(res)-1; i++ {\n\t\tif res[i]+res[i+1]+1 <= n {\n\t\t\tif isPrime[res[i]+res[i+1]+1] == true {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tif k <= count {\n\t\tfmt.Printf(\"YES\\n\", count)\n\n\t} else {\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n\n}", "lang": "Go", "bug_code_uid": "622f65b5a809ea61f1d5181e2e550131", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "5f246a12bce4b2897de344abc1a336ad", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9991508632889895, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype in struct {\n\tScanner *bufio.Scanner\n}\n\nfunc (in *in) s() string {\n\tin.Scanner.Scan()\n\treturn in.Scanner.Text()\n}\nfunc (in *in) i() int {\n\tret, _ := strconv.ParseInt(in.s(), 10, 32)\n\treturn int(ret)\n}\nfunc (in *in) i64() int64 {\n\tret, _ := strconv.ParseInt(in.s(), 10, 64)\n\treturn ret\n}\nfunc (in *in) f() float64 {\n\tret, _ := strconv.ParseFloat(in.s(), 64)\n\treturn ret\n}\nfunc (in *in) ss(n int64) []string {\n\ta := make([]string, n)\n\tfor i := range a {\n\t\ta[i] = in.s()\n\t}\n\treturn a\n}\nfunc (in *in) is(n int64) []int64 {\n\ta := make([]int64, n)\n\tfor i := range a {\n\t\ta[i] = in.i64()\n\t}\n\treturn a\n}\nfunc (in *in) fs(n int64) []float64 {\n\ta := make([]float64, n)\n\tfor i := range a {\n\t\ta[i] = in.f()\n\t}\n\treturn a\n}\nfunc (in *in) imat(h int64, w int64) [][]int64 {\n\ta := make([][]int64, h)\n\tfor y := range a {\n\t\ta[y] = make([]int64, w)\n\t\tfor x := range a[y] {\n\t\t\ta[y][x] = in.i64()\n\t\t}\n\t}\n\treturn a\n}\n\nfunc stdin() in {\n\tscn := bufio.NewScanner(os.Stdin)\n\tscn.Split(bufio.ScanWords)\n\tmax := 1048576\n\tbuf := make([]byte, max)\n\tscn.Buffer(buf, max)\n\treturn in{Scanner: scn}\n}\n\ntype arr []int\n\nfunc (a arr) Len() int {\n\treturn len(a)\n}\n\nfunc (a arr) Less(i, j int) bool {\n\treturn a[i] < a[j]\n}\n\nfunc (a arr) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nconst maxn = 2e5 + 7\nconst inf = 0x3f3f3f3f\n\nfunc main() {\n\tin := stdin()\n\tn, k := in.i(), in.i()\n\tar := make([]arr, maxn)\n\tfor i := 0; i < n; i++ {\n\t\tfor x, cnt := in.i(), 0; x > 0; x /= 2 {\n\t\t\tar[x] = append(ar[x], cnt)\n\t\t\tcnt++\n\t\t}\n\t}\n\tans := inf\n\tfor i := 0; i < n; i++ {\n\t\tif len(ar[i]) < k {\n\t\t\tcontinue\n\t\t}\n\t\tsort.Sort(ar[i])\n\t\tsum := 0\n\t\tfor j := 0; j < k; j++ {\n\t\t\tsum += ar[i][j]\n\t\t}\n\t\tif sum < ans {\n\t\t\tans = sum\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "7cf0619cea245392f428815ff6332836", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "6cd9ddaffadb11fb8e1e76ecb027d2b3", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9731182795698925, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n )\n\nfunc getLine(s *bufio.Scanner) (int,int,int) {\n s.Scan()\n ab := strings.Fields(s.Text())\n a, _ := strconv.Atoi(ab[0])\n b, _ := strconv.Atoi(ab[1])\n c, _ := strconv.Atoi(ab[2])\n \n return a,b,c\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n a, b, c:= getLine(scanner)\n n := int (float64(b - a )/float64(c) + 1)\n if n > 0 && a + c*(n-1) == b {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n } \n}", "lang": "Go", "bug_code_uid": "30e78279fa55a76a73c2dcc54afce47a", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "95de82f6d156832afdd5fd4e538bbb9e", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9457579972183588, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\n\tcan := false\n\tif c == 0 {\n\t\tif a == b {\n\t\t\tcan = true\n\t\t}\n\t} else {\n\t\tdelta := b - a\n\t\tif (delta < 0 && c < 0) || (delta > 0 && c > 0) {\n\t\t\tif delta%c == 0 {\n\t\t\t\tcan = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif can {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f97a1b77f5fe91b049e45e993dd6f712", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "58ef03b12363e157ccf3985e30f9625d", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.975975975975976, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c int\n fmt.Scan(&a, &b, &c)\n if c == 0 {\n if a == b {\n fmt.Print(\"YES\")\n } else {\n fmt.Print(\"NO\")\n }\n return\n }\n if (b-a)%c == 0 {\n fmt.Print(\"YES\")\n } else {\n fmt.Print(\"NO\")\n }\n \n}", "lang": "Go", "bug_code_uid": "2f0e4568d33a3a7a178e0ae2abcb0dee", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "903ed44ee9e449c9e87c774c58bb998e", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9985185185185185, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta, b, c int\n\t)\n\tfmt.Scanf(\"%d%d%d\", &a, &b, &c)\n\tif checkNum(a, b, c) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\nfunc checkNum(a, b, c int) bool {\n\tif c == 0 {\n\t\treturn a == b\n\t}\n\tleftOver := b - a\n\tif leftOver%c == 0 && leftOver/c > 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n", "lang": "Go", "bug_code_uid": "98ad701f819792a337daa24fcf0b1513", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "9971fd9d6fe4448c90c010e38a3c07f0", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6532033426183844, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var target string\n\t_, err := fmt.Scanln(&target)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n var count, first, second int\n\t_, err = fmt.Scanln(&count)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n for i:=0; i < count; i++{\n var word string\n\t\t_, err = fmt.Scanln(&word)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\n hasFirst := word[0] == target[1]\n hasSecond := word[1] == target[0]\n\n if hasFirst{\n first++\n }\n if hasSecond{\n second++\n }\n }\n if first > 0 && second > 0 {\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n}\n}\n", "lang": "Go", "bug_code_uid": "47cd8d16f5b594cc40efc53e2c86757c", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "a855bc68f5f041bed9f1eff9686a09b0", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5577190542420027, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var target string\n\t_, err := fmt.Scanln(&target)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n var count, first, second int\n\t_, err = fmt.Scanln(&count)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n for i:=0; i < count; i++{\n var word string\n\t\t_, err = fmt.Scanln(&target)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\n hasFirst := word[0] == target[1]\n hasSecond := word[1] == target[0]\n\n if hasFirst{\n first++\n }\n if hasSecond{\n second++\n }\n }\n if first > 0 && second > 0 {\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n}\n}\n", "lang": "Go", "bug_code_uid": "59ff885849a31e95329096154d0179be", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "a855bc68f5f041bed9f1eff9686a09b0", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5485636114911081, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var target string\n\t_, err := fmt.Scanln(reader, &target)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n var count, first, second int\n\t_, err = fmt.Scanln(reader, &count)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n for i:=0; i < count; i++{\n var word string\n\t\t_, err = fmt.Scanln(reader, &target)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\n hasFirst := word[0] == target[1]\n hasSecond := word[1] == target[0]\n\n if hasFirst{\n first++\n }\n if hasSecond{\n second++\n }\n }\n if first > 0 && second > 0 {\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n}\n}\n", "lang": "Go", "bug_code_uid": "5e3f1a66bdcf89280d19ca71588a00b9", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "a855bc68f5f041bed9f1eff9686a09b0", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.89171974522293, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "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\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tsum := 0\n\tw := make([]int, 7)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := 0; i < 7 && scanner.Scan(); i++ {\n\t\ta, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tw[i] = a\n\t\tsum += a\n\t}\n\n\tn = n % sum\n\tfor i := 0; i < 7; i++ {\n\t\tn -= w[i]\n\t\tif n <= 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4f450b6276585c8432a059424ea8a6fb", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "2f4ea1660abac711da3d90ed2d22b83c", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6545924967658473, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n var a [7]int\n fmt.Scan(&n)\n total := 0\n for i := 0; i < 7; i++ {\n fmt.Scan(&a[i])\n total += a[i]\n }\n n %= total\n ans := 0\n for n > a[ans] {\n n -= a[ans]\n ans++\n }\n fmt.Println(ans+1)\n}\n", "lang": "Go", "bug_code_uid": "70c11cfbef0d4540b76357738c8b27fa", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "77abacd71bfad0c5a6e3bd5bbc305c09", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.25457007447528773, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int // membuat variabel n dengan jenis int \n var a [7]int // membuat variabel array a dengan isi 7 elemen berjenis int\n fmt.Scan(&n) // mengambil input\n for i := 0; i < 7; i++ { // looping\n fmt.Scan(&a[i]) // mengambil input ke 2\n total += a[i] / total ditambah array elemen ke i\n } \n n %= total // n dimodulo total\n ans := 0 // membuat variabel ans kemudian diisi dengan 0\n if n == 0 { // jika n sama denga 0\n ans = 6 // ans sama dengan 6\n for ; ans >= 0; ans-- { // looping ke 2\n if a[ans] > 0 { // jika array a elemen ke ans lebih besar dari 0 \n break // keluar dari fungsi\n }\n }\n } else { // lainnya\n for n > a[ans] { // looping ke 3\n n -= a[ans] // n dikurang array a elemen ke ans\n ans++ // ans ditambah\n }\n }\n fmt.Println(ans+1) // cetak hasil ans ditambah 1\n}", "lang": "Go", "bug_code_uid": "adddae0075d648c6c6f886a74a16bffc", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "1357486b234b3b3101d07e1f4c6910cf", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9396378269617707, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(n int, is []int) {\n\tsum := 0\n\tfor _, v := range is {\n\t\tsum += v\n\t}\n\tif n > sum {\n\t\tn = n % sum\n\t}\n\n\tfor i, v := range is {\n\t\tif n-v <= 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\tn -= v\n\t}\n\n}\n\nfunc main() {\n\tvar n, tmp int\n\n\t_, err := fmt.Scan(&n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tis := make([]int, 0, 7)\n\tfor i := 0; i < 7; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tis = append(is, tmp)\n\t}\n\tsolve(n, is)\n}\n", "lang": "Go", "bug_code_uid": "7c25cce53154616c4d83fa9a2b362bed", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "56edb16b7cdfd412ceddb5e9904ef0f8", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8937583001328021, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\t\n\tvar wayLen, jumpDist int;\n\tfmt.Scanf(\"%d %d\\n\", &wayLen, &jumpDist)\n\t\n\tvar wayMap string;\n\tfmt.Scan(&wayMap)\n\t\n\tgIdx := strings.Index(wayMap, \"G\")\n\ttIdx := strings.Index(wayMap, \"T\")\n\t\n\tif gIdx > tIdx {\n\t\twayMap = Reverse(wayMap)\n\t\tgIdx, tIdx = tIdx, gIdx\n\t}\n\t\n\tfor i := gIdx + jumpDist; i < wayLen; i += jumpDist {\n\t\tswitch wayMap[i] {\n\t\t\tcase '#': {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcase 'T': {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfmt.Println(\"NO\")\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}", "lang": "Go", "bug_code_uid": "f5c3f176a0f42fb3c1c28dea33ca56ed", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "9adf324d5d84ad0c6be3612fe4c46999", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9736379613356766, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc pr(str string) int{\n\tk:=0;\n\tj:=0;\n\tk1:=-1\n\t//var newstr string\n\tfor _,i:=range str{\n\t\tif i=='0'{\n\t\t\tk++\n\t\t\tj++\n\t\t\tif k>k1{\n\t\t\t\tk1=k\n\t\t\t}\n\t\t}else{\n\t\t\tk=0\n\t\t\tstr=str[j:]\n\t\t}\n\t}\nreturn k1\n}\nfunc pr1(str string) int{\n\tk:=0;\n\tj:=0;\n\tk1:=-1\n\t//var newstr string\n\tfor _,i:=range str{\n\t\tif i=='1'{\n\t\t\tk++\n\t\t\tj++\n\t\t\tif k>k1{\n\t\t\t\tk1=k\n\t\t\t}\n\t\t}else{\n\t\t\tk=0\n\t\t\tstr=str[j:]\n\t\t}\n\t}\n\treturn k1\n}\n\nfunc main() {\n\tvar str string\nfmt.Scan(&str)\na:=pr1(str)\nb:=pr(str)\nif a>=7||b>=7{\n\tfmt.Println(\"YES\")\n}else{\n\tfmt.Println(\"NO\")\n}\n}\n", "lang": "Go", "bug_code_uid": "9bd72d7fe33ea6c84a0a945dd89262da", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "b7ba3d36d698760b6496b879b9569597", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9933216168717047, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"runtime/debug\"\n)\n\ntype Range struct {\n\tleft, right int\n}\n\nvar (\n\tisNotPrime []bool\n\tprimes []int\n\tn int\n)\n\nfunc main() {\n\tdebug.SetGCPercent(-1)\n\n\tfmt.Scanf(\"%d\", &n)\n\t// n = 14\n\n\tcalcPrimes(n)\n\n\tx1Range := getRange(n)\n\n\tx0Range := getRange(x1Range.left)\n\n\tfor i := x1Range.left + 1; i < x1Range.right; i++ {\n\t\tx0Range = joinRanges(x0Range, getRange(i))\n\t}\n\n\tfmt.Println(x0Range.left)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc joinRanges(r1, r2 Range) Range {\n\tleft := min(r1.left, r2.left)\n\n\tright := max(r1.right, r2.right)\n\n\treturn Range{left, right}\n}\n\nfunc getRange(n int) Range {\n\tdivider := findMaxPrimeDivider(n)\n\n\treturn Range{n - divider + 1, n}\n}\n\nfunc findMaxPrimeDivider(x int) int {\n\tsqrtx := int(math.Sqrt(float64(x))) + 1\n\n\tfor i := 0; i < len(primes) && primes[i] < sqrtx; i++ {\n\t\tif x%primes[i] == 0 {\n\t\t\td := x / primes[i]\n\n\t\t\tfor isNotPrime[d] && d%primes[i] == 0 {\n\t\t\t\td /= primes[i]\n\t\t\t}\n\n\t\t\tif !isNotPrime[d] {\n\t\t\t\treturn d\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 1\n}\n\nfunc calcPrimes(n int) {\n\tisNotPrime = make([]bool, n+1)\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif !isNotPrime[i] {\n\t\t\tfor j := i * i; j <= n; j += i {\n\t\t\t\tisNotPrime[j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprimes = make([]int, 0, n/2)\n\n\tfor i := 2; i <= n; i++ {\n\t\tif !isNotPrime[i] {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "dad60e6463cf7fa6440f062677b61186", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "090cd319b1570f70ecafd23c66e6a3d9", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7258129265355279, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"runtime/debug\"\n)\n\ntype Range struct {\n\tleft, right int\n}\n\nvar (\n\tisNotPrime []bool\n\tprimes []int\n\tn int\n)\n\nfunc main() {\n\tdebug.SetGCPercent(-1)\n\n\tfmt.Scanf(\"%d\", &n)\n\t// n = 1e6\n\n\tcalcPrimes(n)\n\n\tx1Range := getRange(n)\n\n\tx0RangeMin := x1Range.left\n\n\tfor i := x1Range.left + 1; i < x1Range.right; i++ {\n\t\tx0RangeMin = min(x0RangeMin, getRange(i).left)\n\t}\n\n\tfmt.Println(x0RangeMin)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc getRange(n int) Range {\n\tdivider := findMaxPrimeDivider(n)\n\n\treturn Range{n - divider + 1, n}\n}\n\nfunc findMaxPrimeDivider(x int) int {\n\tsqrtx := int(math.Sqrt(float64(x))) + 1\n\n\tfor i := 0; i < len(primes) && primes[i] < sqrtx; i++ {\n\t\tif x%primes[i] == 0 {\n\t\t\tx /= primes[i]\n\n\t\t\tfor isNotPrime[x] && x%primes[i] == 0 {\n\t\t\t\tx /= primes[i]\n\t\t\t}\n\n\t\t\tif !isNotPrime[x] {\n\t\t\t\treturn x\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 1\n}\n\nfunc calcPrimes(n int) {\n\tisNotPrime = make([]bool, n+1)\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif !isNotPrime[i] {\n\t\t\tfor j := i * i; j <= n; j += i {\n\t\t\t\tisNotPrime[j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprimes = make([]int, 0, n/2)\n\n\tfor i := 2; i <= n; i++ {\n\t\tif !isNotPrime[i] {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "b54e3d91a411e642ca8dba49c261d3df", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "090cd319b1570f70ecafd23c66e6a3d9", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9882697947214076, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\n\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tvar temp int\n\t\tfmt.Scan(&temp)\n\t\tm[temp] = 0\n\t}\n\n\tif len(m) > 3 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tk := make([]int, len(m))\n\ti := 0\n\tfor key := range m {\n\t\tk[i] = key\n\t\ti++\n\t}\n\n\tif len(m) == 1 {\n\t\tfmt.Println(k[0])\n\t}\n\n\tsort.Ints(k)\n\tif len(m) == 2 {\n\t\tans := k[1] - k[0]\n\t\tif (k[1] - k[0]) % 2 == 0 {\n\t\t\tans = (k[1] - k[0]) / 2\n\t\t}\n\t\tfmt.Println(ans)\n\t\treturn\n\t}\n\n\tsum := (k[0] + k[1] + k[2])\n\tif sum % 3 != 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tif sum / 3 != k[1] {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tans := k[2] - k[1]\n\tfmt.Println(ans)\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "b989199ca07a045ce275e554b29625d9", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "75d0095e6b17a857f9a1972a4b83f59b", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9719719719719719, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc solve(a []int) int {\n\tm := map[int]bool{}\n\tvar nums []int\n\n\tfor _, n := range a {\n\t\tm[n] = true\n\t}\n\n\tL := len(m)\n\n\tif L > 3 {\n\t\treturn -1\n\t}\n\n\tif L == 1 {\n\t\treturn 0\n\t}\n\n\ti, avg := 0, 0\n\tfor n := range m {\n\t\tnums = append(nums, n)\n\t\tavg += n\n\t\ti++\n\t}\n\n\tsort.IntSlice(nums).Sort()\n\n\tif avg%L > 0 {\n\t\tif L == 2 {\n\t\t\treturn (nums[1] - nums[0])\n\t\t}\n\t\treturn -1\n\t}\n\n\tavg /= L\n\tif L == 3 {\n\t\tif avg == nums[1] {\n\t\t\treturn nums[2] - nums[1]\n\t\t}\n\t}\n\n\tif L == 2 {\n\t\tif avg%2 == 0 {\n\t\t\tavg /= 2\n\t\t}\n\t\treturn avg\n\t}\n\n\treturn -1\n}\n\nfunc toInt(buf []byte) int {\n\tn, mul := int(0), int(1)\n\tfor i, v := range buf {\n\t\tif i == 0 && v == '-' {\n\t\t\tmul = int(-1)\n\t\t\tcontinue\n\t\t}\n\t\tn = n*10 + int(v-'0')\n\t}\n\n\treturn mul * n\n}\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := range a {\n\t\tscanner.Scan()\n\t\ta[i] = toInt(scanner.Bytes())\n\t}\n\n\tans := solve(a)\n\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "f5d6859c4aca2fbc6f221a9a73a8ff8a", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "8a4869943a348b12bee15d4efd744d77", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8946360153256705, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\n\tsort.Ints(nums)\n\tfor i := 1; i < n; i++ {\n\t\tnums[i] -= nums[0]\n\t}\n\n\tfor i := 1; i <= 100; i++ {\n\t\tfor j := 1; j < n; j++ {\n\t\t\tif nums[j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif nums[j]%i != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif nums[j]/i > 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == n-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}\n", "lang": "Go", "bug_code_uid": "3b95d9e2f76e053e5ff0a49e5baba44b", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "35f60380e371280519eb32100d455b60", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9578893962455606, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1154/problem/B\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc getUniqueElements(n int, a []int) []int {\n\tnums := make(map[int]bool)\n\telems := []int{}\n\tfor _, elem := range a {\n\t\tif !nums[elem] {\n\t\t\tnums[elem] = true\n\t\t\telems = append(elems, elem)\n\t\t}\n\t}\n\treturn elems\n}\n\nfunc max(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Solve(n int, a []int) int {\n\tb := getUniqueElements(n, a)\n\tk := len(b)\n\tif k > 3 {\n\t\treturn -1\n\t}\n\tsort.Ints(b)\n\tif len(b) == 1 {\n\t\treturn 0\n\t}\n\tdiff := b[len(b)-1] - b[0]\n\tif len(b) == 2 {\n\t\tif diff%2 == 1 {\n\t\t\treturn diff\n\t\t}\n\t\treturn diff / 2\n\t}\n\tif b[1]+diff/2 != b[2] {\n\t\treturn -1\n\t}\n\treturn diff / 2\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(reader, \"%d\", &a[i])\n\t}\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, a))\n}\n", "lang": "Go", "bug_code_uid": "905cf636b5323988279564756cd74073", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "5be64d64dd2b69b7b9705946e0be822b", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.986013986013986, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k, l, m1, n, d, res int\n\n\tfmt.Scanln(&k)\n\tfmt.Scanln(&l)\n\tfmt.Scanln(&m1)\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&d)\n\tm := make(map[int]bool)\n\n\tfor i := 0; i < d; i++ {\n\t\tm[i] = true\n\t}\n\tfor i := k; i < d; i += k {\n\t\tif m[i] {\n\t\t\tm[i] = false\n\t\t}\n\t}\n\tfor i := l; i < d; i += l {\n\t\tif m[i] {\n\t\t\tm[i] = false\n\t\t}\n\t}\n\tfor i := m1; i < d; i += m1 {\n\t\tif m[i] {\n\t\t\tm[i] = false\n\t\t}\n\t}\n\tfor i := n; i < d; i += n {\n\t\tif m[i] {\n\t\t\tm[i] = false\n\t\t}\n\t}\n\n\tfor _, y := range m {\n\t\tif y == false {\n\t\t\tres++\n\t\t}\n\t}\n\tfmt.Println(res)\n\n}\n", "lang": "Go", "bug_code_uid": "822f95b161c92865d34a4f16df04113d", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "135124c5fcf17208ccad45ff257fae5d", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8443908323281062, "equal_cnt": 21, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 13, "fix_ops_cnt": 21, "bug_source_code": " package main\n \n import \"fmt\"\n \n func main(){\n \tvar k,l,m,n int\n \tvar d int\n \n \tfmt.Scan(k)\n \tfmt.Scan(l)\n \t \tfmt.Scan(m) \n \t \tfmt.Scan(n)\n \t \tfmt.Scan(d)\n \n count:=0\n \tfor i := 1; i <=d; i++ {\n \t\tif i%k==0 ||i%l==0 ||i%m==0 ||i%n==0 {\n \t\t\tcount++\n \n \t\t}\n \t\n }\n fmt.Print(count)\n }", "lang": "Go", "bug_code_uid": "efbe2437f25f51b8de90c9e1c58ecf3f", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "a15f76c170a10a429c7ad95893228b49", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.774812030075188, "equal_cnt": 22, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 21, "bug_source_code": "/*\nInsomnia cure\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\n«One dragon. Two dragon. Three dragon», — the princess was counting. She had trouble falling asleep, and she got bored of counting lambs when she was nine.\n\nHowever, just counting dragons was boring as well, so she entertained herself at best she could. Tonight she imagined that all dragons were here to steal her, and she was fighting them off. Every k-th dragon got punched in the face with a frying pan. Every l-th dragon got his tail shut into the balcony door. Every m-th dragon got his paws trampled with sharp heels. Finally, she threatened every n-th dragon to call her mom, and he withdrew in panic.\n\nHow many imaginary dragons suffered moral or physical damage tonight, if the princess counted a total of d dragons?\n\nInput\nInput data contains integer numbers k, l, m, n and d, each number in a separate line (1 ≤ k, l, m, n ≤ 10, 1 ≤ d ≤ 105).\n\nOutput\nOutput the number of damaged dragons.\n\nSample test(s)\ninput\n1\n2\n3\n4\n12\noutput\n12\ninput\n2\n3\n4\n5\n24\noutput\n17\nNote\nIn the first case every first dragon got punched with a frying pan. Some of the dragons suffered from other reasons as well, but the pan alone would be enough.\n\nIn the second case dragons 1, 7, 11, 13, 17, 19 and 23 escaped unharmed.\n*/\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\n// 最大公約数\nfunc gcd(a, b int) int {\n if b == 0 {\n return a\n } \n return gcd(b, a % b)\n}\n\n// 最小公倍数\nfunc lcm(a, b int) int {\n return a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar k, l, m, n, d int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n%d\\n\", &k, &l, &m, &n, &d)\n\thurtDragon := []int{k, l, m, n}\n\tsort.Ints(hurtDragon)\n\tvar count int\n\tfor i, n := 1, len(hurtDragon); i < n; i++ {\n\t\tfor j := 0; j < i; j++ {\n\t\t\tif hurtDragon[j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif hurtDragon[i] % hurtDragon[j] == 0 {\n\t\t\t\thurtDragon[i] = 0\n\t\t\t\tcount++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t\n\tsort.Ints(hurtDragon)\n\thurtDragon = hurtDragon[count:]\n\tcount = 0\n\tfor i, v := range hurtDragon {\n\t\tcount += d/v\n\t\tfor j := 0; j < i; j++ {\n\t\t\tcount -= int(d/lcm(hurtDragon[j], hurtDragon[i]))\n\t\t}\n\t}\n\tdoubleCounts := make([]int, 0)\n\tif len(hurtDragon) == 3 {\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[1]), hurtDragon[2]))\n\t}\n\tif len(hurtDragon) == 4 {\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[1]), hurtDragon[2]))\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[1]), hurtDragon[3]))\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[1], hurtDragon[2]), hurtDragon[3]))\n\t}\n\tfor _, v := range doubleCounts {\n\t\tcount += d/v\n\t}\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "7b5b0e666d37deb6ef1edd5bcd2db259", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "acf0c5638d4b6de44d7d491fcc8ec02b", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7415577804174445, "equal_cnt": 24, "replace_cnt": 11, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 23, "bug_source_code": "/*\nInsomnia cure\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\n«One dragon. Two dragon. Three dragon», — the princess was counting. She had trouble falling asleep, and she got bored of counting lambs when she was nine.\n\nHowever, just counting dragons was boring as well, so she entertained herself at best she could. Tonight she imagined that all dragons were here to steal her, and she was fighting them off. Every k-th dragon got punched in the face with a frying pan. Every l-th dragon got his tail shut into the balcony door. Every m-th dragon got his paws trampled with sharp heels. Finally, she threatened every n-th dragon to call her mom, and he withdrew in panic.\n\nHow many imaginary dragons suffered moral or physical damage tonight, if the princess counted a total of d dragons?\n\nInput\nInput data contains integer numbers k, l, m, n and d, each number in a separate line (1 ≤ k, l, m, n ≤ 10, 1 ≤ d ≤ 105).\n\nOutput\nOutput the number of damaged dragons.\n\nSample test(s)\ninput\n1\n2\n3\n4\n12\noutput\n12\ninput\n2\n3\n4\n5\n24\noutput\n17\nNote\nIn the first case every first dragon got punched with a frying pan. Some of the dragons suffered from other reasons as well, but the pan alone would be enough.\n\nIn the second case dragons 1, 7, 11, 13, 17, 19 and 23 escaped unharmed.\n*/\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\n// 最大公約数\nfunc gcd(a, b int) int {\n if b == 0 {\n return a\n } \n return gcd(b, a % b)\n}\n\n// 最小公倍数\nfunc lcm(a, b int) int {\n return a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar k, l, m, n, d int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n%d\\n\", &k, &l, &m, &n, &d)\n\thurtDragon := []int{k, l, m, n}\n\tsort.Ints(hurtDragon)\n\tvar count int\n\tfor i, n := 1, len(hurtDragon); i < n; i++ {\n\t\tfor j := 0; j < i; j++ {\n\t\t\tif hurtDragon[j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif hurtDragon[i] % hurtDragon[j] == 0 {\n\t\t\t\thurtDragon[i] = 0\n\t\t\t\tcount++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t\n\tsort.Ints(hurtDragon)\n\thurtDragon = hurtDragon[count:]\n\tcount = 0\n\tfor i, v := range hurtDragon {\n\t\tcount += d/v\n\t\tfor j := 0; j < i; j++ {\n\t\t\tcount -= int(d/lcm(hurtDragon[j], hurtDragon[i]))\n\t\t}\n\t}\n\tdoubleCounts := make([]int, 0)\n\tif len(hurtDragon) == 3 {\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[1]), hurtDragon[2]))\n\t}\n\tif len(hurtDragon) == 4 {\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[1]), hurtDragon[2]))\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[1]), hurtDragon[3]))\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[0], hurtDragon[2]), hurtDragon[3]))\n\t\tdoubleCounts = append(doubleCounts, lcm(lcm(hurtDragon[1], hurtDragon[2]), hurtDragon[3]))\n\t\tdoubleCounts = append(doubleCounts, -lcm(lcm(lcm(hurtDragon[1], hurtDragon[2]), hurtDragon[3]), hurtDragon[0]))\n\t\tsort.Ints(doubleCounts)\n\t\tvar countDouble int\n\t\tfor i, n := 1, len(doubleCounts); i < n; i++ {\n\t\t\tfor j := 0; j < i; j++ {\n\t\t\t\tif doubleCounts[j] == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif doubleCounts[i] % doubleCounts[j] == 0 {\n\t\t\t\t\tdoubleCounts[i] = 0\n\t\t\t\t\tcountDouble++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort.Ints(doubleCounts)\n\t\tdoubleCounts = doubleCounts[countDouble:]\n\t}\n\t\n\tfor _, v := range doubleCounts {\n\t\tcount += d/v\n\t}\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "43e429db8a5cd5dcdece6b9991f6d757", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "acf0c5638d4b6de44d7d491fcc8ec02b", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8953560371517028, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF148D(_r io.Reader, _w io.Writer) {\n\tvar W, B int\n\tFscan(_r, &W, &B)\n\tdp := make([][][2]float64, W+1)\n\tfor i := range dp {\n\t\tdp[i] = make([][2]float64, B+1)\n\t\tfor j := range dp[i] {\n\t\t\tdp[i][j] = [2]float64{-1, -1}\n\t\t}\n\t}\n\tvar f func(w, b, who int) float64\n\tf = func(w, b, who int) (res float64) {\n\t\tif w == 0 {\n\t\t\tif who == 0 {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn 1\n\t\t}\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\tdv := &dp[w][b][who]\n\t\tif *dv != -1 {\n\t\t\treturn *dv\n\t\t}\n\t\tdefer func() { *dv = res }()\n\t\treturn (float64(w) + float64(b)*(1-f(w, b-1, who^1))) / float64(w+b)\n\t}\n\tFprintf(_w, \"%.10f\", f(W, B, 0))\n}\n\nfunc main() { CF148D(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "4189569b940427551f851dae368f12e6", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "e7ed5810c7ece07872ff1577efda0072", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.1978798586572438, "equal_cnt": 16, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc Sol1152C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar a, b int64\n\tFscan(in, &a, &b)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\n\tdelta := b - a\n\tif delta == 0 {\n\t\tFprintln(out, 0)\n\t} else {\n\t\tFprintln(out, (delta-a%delta)%delta)\n\t}\n}\n\nfunc main() {\n\tSol1152C(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "f6370b5e7202523f472463092398a640", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "b5d3b2aa18f5e1e8a16f1aec510b883d", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9851036269430051, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\n// var input, inputerr = os.Open(\"./input\")\n// var output, outputerr = os.Create(\"./output\")\n// var reader = bufio.NewReader(input)\n// var writer = bufio.NewWriter(output)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc scan(a ...interface{}) { fmt.Fscan(reader, a...) }\n\nfunc gcd(a, b int64) int64 {\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 lcm(a, b int64) int64 {\n\tresult := a * b / gcd(a, b)\n\n\treturn result\n}\n\nfunc main() {\n\tdefer writer.Flush() // STDOUT MUST BE FLUSHED MANUALLY!!!\n\tvar a, b int64\n\tscan(&a, &b)\n\n\tif b < a {\n\t\ta, b = b, a\n\t}\n\n\tif b%a == 0 {\n\t\tprint(0)\n\t\tprint(\"\\n\")\n\t\treturn\n\t}\n\n\td := b - a\n\tsqrtD := math.Sqrt(float64(d))\n\tvar divs []int64\n\tfor i := int64(1); i <= int64(sqrtD); i++ {\n\t\tif d%i == 0 {\n\t\t\tnxt := d / i\n\t\t\tdivs = append(divs, i)\n\t\t\tif nxt != i {\n\t\t\t\tdivs = append(divs, nxt)\n\t\t\t}\n\t\t}\n\t}\n\n\tlcmMin := math.Inf(1)\n\tminK := math.Inf(1)\n\n\tfor _, q := range divs {\n\t\tif a%q != b%q {\n\t\t\tcontinue\n\t\t}\n\t\tvar val float64\n\t\tk := q\n\t\tif a%q == 0 {\n\t\t\tval = float64(lcm(int64(a+q), int64(b+q)))\n\t\t} else {\n\t\t\tk = q - (a % q)\n\t\t\tval = float64(lcm(int64(a+k), int64(b+k)))\n\t\t}\n\t\tif val < lcmMin {\n\t\t\tlcmMin = val\n\t\t\tminK = float64(k)\n\t\t}\n\t}\n\n\tprint(int(minK))\n\tprint(\"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "2d65c1a1a38c0427f7267d42927b6545", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "bcd5186ac788f28090fa31fa8ddbe0fc", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8491542975491888, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\n// var input, inputerr = os.Open(\"./input\")\n// var output, outputerr = os.Create(\"./output\")\n// var reader = bufio.NewReader(input)\n// var writer = bufio.NewWriter(output)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc scan(a ...interface{}) { fmt.Fscan(reader, a...) }\n\nfunc gcd(a, b int64) int64 {\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 lcm(a, b int64) int64 {\n\tresult := a * b / gcd(a, b)\n\n\treturn result\n}\n\nfunc main() {\n\tdefer writer.Flush() // STDOUT MUST BE FLUSHED MANUALLY!!!\n\tvar a, b int64\n\tscan(&a, &b)\n\n\tif b < a {\n\t\ta, b = b, a\n\t}\n\n\tif b%a == 0 {\n\t\tprint(0)\n\t\tprint(\"\\n\")\n\t\treturn\n\t}\n\n\td := b - a\n\tlcmMin := math.Inf(1)\n\tminK := math.Inf(1)\n\n\tfor q := int64(1); q <= d; q++ {\n\t\tif d%q == 0 && (a%q == b%q) {\n\t\t\tvar val float64\n\t\t\tk := q\n\t\t\tif a%q == 0 {\n\t\t\t\tval = float64(lcm(int64(a+q), int64(b+q)))\n\t\t\t} else {\n\t\t\t\tk = q - (a % q)\n\t\t\t\tval = float64(lcm(int64(a+k), int64(b+k)))\n\t\t\t}\n\t\t\tif val < lcmMin {\n\t\t\t\tlcmMin = val\n\t\t\t\tminK = float64(k)\n\t\t\t}\n\t\t}\n\t}\n\tprint(int(minK))\n\tprint(\"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "24f4e0c052329101048a8600ba17218c", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "bcd5186ac788f28090fa31fa8ddbe0fc", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9800552316661553, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tk := scanInt(scanner)\n\tscanner.Scan()\n\ts := scanner.Text()\n\tn := len(s)\n\tpal := make([]uint8, n)\n\tfor i, ch := range s {\n\t\tpal[i] = uint8(ch)\n\t}\n\tfor i := (n-1)/2; i >= 0; i-- {\n\t\tj := n-1-i\n\t\tif pal[i] == pal[j] {\n\t\t\tcontinue\n\t\t}\n\t\tif pal[i] == '?' {\n\t\t\tpal[i] = pal[j]\n\t\t} else if pal[j] == '?' {\n\t\t\tpal[j] = pal[i]\n\t\t} else {\n\t\t\twriter.WriteString(\"IMPOSSIBLE\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tseen := map[uint8]bool{}\n\tfor i := 0; i < k; i++ {\n\t\tseen['a'+uint8(i)] = false\n\t}\n\tfor _, ch := range pal {\n\t\tif ch != '?' {\n\t\t\tseen[ch] = true\n\t\t}\n\t}\n\tneed := []uint8{}\n\tfor ch, ok := range seen {\n\t\tif !ok {\n\t\t\tneed = append(need, ch)\n\t\t}\n\t}\n\t/*\n\tfor _, ch := range pal {\n\t\twriter.WriteString(fmt.Sprintf(\"%c\", ch))\n\t}\n\twriter.WriteString(fmt.Sprintf(\" (k = %d)\\n\", k))\n\twriter.WriteString(fmt.Sprintf(\"need %d:\", len(need)))\n\tfor _, ch := range need {\n\t\twriter.WriteString(fmt.Sprintf(\" %c\", ch))\n\t}\n\twriter.WriteString(\"\\n\")\n\t*/\n\tnix := len(need)-1\n\tfor i := (n-1)/2; i >= 0; i-- {\n\t\tif pal[i] != '?' {\n\t\t\tcontinue\n\t\t}\n\t\tj := n-1-i\n\t\tif nix == -1 {\n\t\t\tpal[i] = 'a'\n\t\t\tpal[j] = 'a'\n\t\t} else {\n\t\t\tpal[i] = need[nix]\n\t\t\tpal[j] = need[nix]\n\t\t\tnix--\n\t\t}\n\t}\n\tif nix != -1 {\n\t\twriter.WriteString(\"IMPOSSIBLE\\n\")\n\t\treturn\n\t}\n\tfor _, ch := range pal {\n\t\twriter.WriteString(fmt.Sprintf(\"%c\", ch))\n\t}\n\twriter.WriteString(\"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "195d5c1ff293ecf7ee8af10d7f9d9385", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "apr_id": "d5c303665784d748d4dbf51ebad9136f", "difficulty": 1600, "tags": ["expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9852125693160814, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc transform(s string) string {\n\tt := strings.Split(s, \"e\")\n\n\ta := t[0][:1]\n\td := t[0][2:]\n\n\tb, _ := strconv.Atoi(t[1])\n\tfor len(d) < b {\n\t\td = d + \"0\"\n\t}\n\n\tr := a + d[:b]\n\tif b < len(d) {\n\t\tr = r + \".\" + d[b:]\n\t}\n\n\treturn r\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar s string\n\tfmt.Fscan(bufin, &s)\n\tfmt.Fprintln(bufout, transform(s))\n}\n", "lang": "Go", "bug_code_uid": "838a83aad88ae6427acb62fe00370cbe", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "69980de7f622b311de7489bfce2c665d", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9996968778417702, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bytes\"\n \"strconv\"\n )\n\nfunc Trim(x string, begin, end bool) string {\n var a, b int = 0, len(x) - 1\n\n if begin {\n for string(x[a]) == \"0\" && a < b && string(x[a + 1]) != \".\"{\n a++\n }\n }\n\n if end {\n for (string(x[b]) == \"0\" || string(x[b]) == \".\") && b > a {\n b--\n }\n }\n\n return x[a:b + 1]\n}\n\ntype ExponentialNumber struct {\n n string\n exp string\n}\n\nfunc (e ExponentialNumber) String() string {\n var result string\n var s string = e.n\n var length int = len(s)\n exp, _ := strconv.Atoi(e.exp)\n exp += 1\n\n var buffer bytes.Buffer\n\n var fs int = exp\n if fs > length {\n fs = length\n\n buffer.WriteString(s)\n\n for i := 0; i < exp - length; i++ {\n buffer.WriteString(\"0\")\n }\n\n result = Trim(buffer.String(), true, false)\n } else {\n buffer.WriteString(Trim(s[:fs], true, false))\n\n var p string = Trim(s[fs:], false, true)\n if p != \"0\" {\n buffer.WriteString(\".\")\n buffer.WriteString(p)\n }\n\n result = buffer.String()\n }\n\n return result\n}\n\nfunc main() {\n var input string\n fmt.Scanln(&input)\n var a_s string //= fmt.Sprint(a), fmt.Sprint(d)\n\n var buffer bytes.Buffer\n\n i := 0\n for i < len(input) {\n if string(input[i]) == \"e\" {\n break\n }\n\n if string(input[i]) != \".\" {\n buffer.WriteByte(input[i])\n }\n\n i++\n }\n\n a_s = buffer.String()\n\n e := ExponentialNumber{a_s, input[i + 1:]}\n\n fmt.Println(e)\n}", "lang": "Go", "bug_code_uid": "3be20f48ee53ac10b524e38b4a12ae70", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "4ddcf2fce8ff24b9047681c23e0c9a3f", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9952904238618524, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "package main\nimport \"fmt\"\n\n\nfunc max3(x, y, z int) (int, bool){\n\tif (x > y) && (x > z) && ((x - y - z) <= 0){\n\t\treturn x - y - z, true\n\t}else if (y > x) && (y > z) && ((y - x - z) <= 0){\n\t\treturn y - x - z, true\n\t}else if (z>y)&&(z > x)&&((z-y-x) <= 0){\n\t\treturn z-y-x, true\n\t}else{\n\t\treturn 0, false\n\t}\n}\n\nfunc main() {\n\tsticks := make([]int, 4)\n\tfmt.Scan(&sticks[0], &sticks[1], &sticks[2], &sticks[3])\n\tans := \"IMPOSSIBLE\"\n\tfor i := 0; i < 4; i++{\n\t\tif c, ok:= max3(sticks[i%4], sticks[(i+1)%4], sticks[(i+2)%4]); (c < 0) && ok {\n\t\t\tans = \"TRIANGLE\"\n\t\t\tbreak\n\t\t}else if (c == 0) && ok{\n\t\t\tans = \"SEGMENT\"\n\t\t}\n\t}\n\n\n\tfmt.Print(ans)\n}", "lang": "Go", "bug_code_uid": "0dfe01711af1e6849b7f18a0b467d900", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "b71a21dc7374fed4b8cd8f286bcf33af", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9829172141918529, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l [4]int\n\tif _, err := fmt.Scanf(\"%d %d %d %d\\n\", &l[0], &l[1], &l[2], &l[3]); err != nil {\n\t\treturn\n\t}\n\n\tsegment := false\n\n\tvar t [3]int\n\tfor i := 0; i < 4; i++ {\n\t\tk := 0\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif j != i {\n\t\t\t\tt[k] = l[j]\n\t\t\t\tk++\n\t\t\t}\n\t\t}\n\t\ts := traingle(t)\n\t\tif s == 1 { // Traingle\n\t\t\tfmt.Println(\"TRAINGLE\")\n\t\t\treturn\n\t\t} else if s == 2 { // Degenerate Traingle\n\t\t\tsegment = true\n\t\t}\n\t}\n\n\tif segment {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n\nfunc traingle(t [3]int) int {\n\tsum := 0\n\tmax := 0\n\tfor i := 0; i < 3; i++ {\n\t\tsum += t[i]\n\t\tif t[i] > max {\n\t\t\tmax = t[i]\n\t\t}\n\t}\n\n\tif sum-max == max {\n\t\treturn 2\n\t} else if sum-max > max {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n", "lang": "Go", "bug_code_uid": "168d89d6babe96de04668b81c67bc1f9", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "0ee287cbb26454c6bc648939b047d217", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9946409431939979, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\t// var a string\n\tvar n int\n\t// var x float64\n\t// var s string\n\tscr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Fscanln(scr, &n)\n\n\tif n == 1 {\n\t\tfmt.Println(\"0\")\n\t} else {\n\t\tif n%2 == 0 {\n\t\t\tfmt.Println(math.Pow(2, float64(n/2)))\n\t\t} else {\n\t\t\tfmt.Println(\"0\")\n\t\t}\n\t}\n\n\t// a := make([]int, n)\n\n\t// for i := 0; i < n; i++ {\n\t// \tfmt.Fscanf(scr, \"%d\", &a[i])\n\t// }\n}\n", "lang": "Go", "bug_code_uid": "f2a51a59a3c17c6eadef7ba4f4aaac2e", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "e7c8d6fea4cfc8ca8a959d57ca546377", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9813432835820896, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scanf(\"%d\", &n)\n if n<2 {\n fmt.Println(0)\n return\n }\n k := 1;\n for i:=0;i= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(arr []int) (max int) {\n\tmax = arr[0]\n\tfor _, val := range arr {\n\t\tif val > max {\n\t\t\tmax = val\n\t\t}\n\t}\n\treturn max\n}\n\nfunc power(x float64, y int) float64 {\n\tvar temp float64\n\tif y == 0 {\n\t\treturn 1\n\t}\n\ttemp = power(x, y/2)\n\tif y%2 == 0 {\n\t\treturn temp * temp\n\t} else {\n\t\tif y > 0 {\n\t\t\treturn x * temp * temp\n\t\t}\n\t\treturn (temp * temp) / x\n\t}\n}\n\nfunc main() {\n\tvar m int\n\tfmt.Scan(&m)\n\tif m%2 == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(power(float64(2), m/2))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "df8fe0d50a93432a3ae45608928db036", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "8fd4a48764fad58cd8e9880b24c1447c", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3342995169082126, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar input string\n\tvar stateArray = 0\n\tvar resetArray = func() {\n\t\tstateArray = 0\n\t}\n\tvar countArray = func() int {\n\t\treturn (stateArray&8)>>3 + (stateArray&4)>>2 + (stateArray&2)>>1 + (stateArray & 1)\n\t}\n\n\tfmt.Scanln(&input)\n\n\tfor _, v := range input {\n\t\tvar c = uint(0)\n\n\t\tswitch v {\n\t\tcase '.':\n\t\t\tc = 0\n\t\t\tbreak\n\t\tcase 'A':\n\t\t\tc = 1\n\t\t\tbreak\n\t\tcase 'B':\n\t\t\tc = 2\n\t\t\tbreak\n\t\tcase 'C':\n\t\t\tc = 3\n\t\t\tbreak\n\t\tdefault:\n\t\t\tpanic(\"should not reach here\")\n\t\t}\n\n\t\tif c == 0 {\n\t\t\tresetArray()\n\t\t\tcontinue\n\t\t}\n\n\t\tif ((1 << c) & stateArray) > 1 {\n\t\t\tresetArray()\n\n\t\t\tstateArray = 1 << c\n\t\t} else {\n\t\t\tstateArray |= 1 << c\n\t\t}\n\n\t\tif countArray() == 3 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "83af27aef0e93109cc93e00cb12187dc", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "8dedf9822985cb05ed773571150ce3a4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.992, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tsquares := []rune(s)\n\n\tisFound := false\n\tfor i := 0; i < len(s)-2; i++ {\n\t\tfirst, second, third := squares[i], squares[i+1], squares[i+2]\n\n\t\tif (first == 'A' && second == 'B' && third == 'C') ||\n\t\t\t(first == 'A' && second == 'C' && third == 'B') ||\n\t\t\t(first == 'B' && second == 'A' && third == 'C') ||\n\t\t\t(first == 'B' && second == 'C' && third == 'A') ||\n\t\t\t(first == 'C' && second == 'A' && third == 'B') ||\n\t\t\t(first == 'C' && second == 'B' && third == 'A') {\n\t\t\t\tfmt.Print(\"YES\")\n\t\t\t\tisFound = true\n\t\t}\n\t}\n\tif !isFound {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "1ec27df082a4c78d93bd3ce9b5ddcede", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "e3d288643fe885e447cef812a3b02cb9", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9344632768361582, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc readText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc printText(text string) {\n\twriter.WriteString(text)\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\t// letters := []string{\"A\", \"B\", \"C\"}\n\tstr := readText()\n\t// printText(str)\n\n\tstr_len := len(str)\n\tfor i, _ := range str {\n\t\tif i < str_len-2 {\n\t\t\tl1 := str[i]\n\t\t\tl2 := str[i+1]\n\t\t\tl3 := str[i+2]\n\n\t\t\tif (l1 == 'A' && l2 == 'B' && l3 == 'C') ||\n\t\t\t\t(l1 == 'A' && l2 == 'C' && l3 == 'B') ||\n\t\t\t\t(l1 == 'B' && l2 == 'A' && l3 == 'C') ||\n\t\t\t\t(l1 == 'B' && l2 == 'C' && l3 == 'A') ||\n\t\t\t\t(l1 == 'B' && l2 == 'A' && l3 == 'B') ||\n\t\t\t\t(l1 == 'C' && l2 == 'B' && l3 == 'A') {\n\t\t\t\tprintText(\"Yes\")\n\t\t\t\tgoto a1\n\t\t\t}\n\t\t}\n\t}\n\n\tprintText(\"No\")\na1:\n}\n", "lang": "Go", "bug_code_uid": "4bc86c8aa55ee27aad17a6b66fb3ac9e", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "e3f7abdf0adffb5345bab3d95dd91ce9", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9785575048732943, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype diameter struct {\n\tio *IO\n}\n\nfunc (d *diameter) out(deleteN int) {\n\td.io.Printf(\"%d\", deleteN)\n}\n\nfunc main() {\n\t//log.SetOutput(os.Stdout)\n\tlog.SetOutput(ioutil.Discard)\n\n\tio := NewStdIO()\n\tdefer io.Flush()\n\td := diameter{io: io}\n\n\tl1 := d.io.NextSplitLine(\" \")\n\tn, dmax := stoi(l1[0]), stoi(l1[1])\n\tlog.Printf(\"n=%d, dmax=%d\", n, dmax)\n\n\tif n <= 1 {\n\t\td.out(0)\n\t\treturn\n\t}\n\n\tl2 := d.io.NextSplitLine(\" \")\n\tnset := make([]int, n)\n\tfor i, ns := range l2 {\n\t\tnset[i] = stoi(ns)\n\t}\n\tsort.Ints(nset)\n\n\tminN := 101\n\tfor i := 0; i < n; i++ {\n\t\tcnt := 0\n\t\tfor j := i; j < n; j++ {\n\t\t\tlog.Printf(\"i=%d, j=%d, minN=%d\", i, j, minN)\n\t\t\tif (nset[j] - nset[i]) > dmax {\n\t\t\t\tminN = min(minN, n-cnt)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcnt++\n\t\t}\n\t}\n\tif minN == 101 {\n\t\td.out(0)\n\t\treturn\n\t}\n\td.out(minN)\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc stoi(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tfmt.Println(i)\n\t\tfmt.Println(err)\n\t}\n\treturn i\n}\n\n// NewStdIO return standard IO instance.\nfunc NewStdIO() *IO {\n\treturn &IO{\n\t\tIn: bufio.NewReader(os.Stdin),\n\t\tOut: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// IO supports IO processing.\ntype IO struct {\n\tIn *bufio.Reader\n\tOut *bufio.Writer\n}\n\n// Flush outputs buffed data.\nfunc (io *IO) Flush() {\n\tif err := io.Out.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// Printf writes string to buffer.\nfunc (io *IO) Printf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(io.Out, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextInt reads a next line and convert it to integer\nfunc (io *IO) NextInt() int {\n\treturn stoi(io.Next())\n}\n\n// NextSplitLine reads a next line and return split string\nfunc (io *IO) NextSplitLine(d string) []string {\n\treturn strings.Split(io.Next(), d)\n}\n\n// Next reads line and return string.\nfunc (io *IO) Next() string {\n\tvar b []byte\n\tfor {\n\t\tl, pre, err := io.In.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tb = append(b, l...)\n\t\tif !pre {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(b)\n}\n", "lang": "Go", "bug_code_uid": "7a8207ff4e628b3f7aab3ed07d77c106", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "2ea8b24dc69c10790a0a0691360e9c7e", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9986893840104849, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// Node to store in queue\ntype Node struct {\n\tvalue int64\n\tprev *Node\n}\n\n// NewNode to create node with value is n.\nfunc NewNode(n int64) *Node {\n\treturn &Node{\n\t\tvalue: n,\n\t}\n}\n\nfunc main() {\n\tvar stdin *bufio.Reader\n\t// LOCAL\n\tf, _ := os.Open(\"input.txt\")\n\tstdin = bufio.NewReader(f)\n\n\t// ONLINE JUDGE\n\t// stdin = bufio.NewReader(os.Stdin)\n\n\tvar a, b int64\n\tfmt.Fscan(stdin, &a, &b)\n\n\tvar queue = []*Node{NewNode(a)}\n\tvar seen = make(map[int64]bool)\n\tfor len(queue) > 0 {\n\t\tvar top = queue[0]\n\t\tqueue = queue[1:]\n\t\tseen[top.value] = true\n\n\t\tif top.value == b {\n\t\t\t// Trace\n\t\t\tfmt.Println(\"YES\")\n\t\t\tvar res []int64\n\t\t\tfor n := top; n != nil; n = n.prev {\n\t\t\t\tres = append(res, n.value)\n\t\t\t}\n\t\t\tfmt.Println(len(res))\n\t\t\tfor i := len(res) - 1; i >= 0; i-- {\n\t\t\t\tfmt.Print(res[i], \" \")\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\tif top.value*2 <= b && !seen[top.value*2] {\n\t\t\tvar n = NewNode(top.value * 2)\n\t\t\tn.prev = top\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t\tif top.value*10+1 <= b && !seen[top.value*10+1] {\n\t\t\tvar n = NewNode(top.value*10 + 1)\n\t\t\tn.prev = top\n\t\t\tqueue = append(queue, n)\n\t\t}\n\n\t}\n\n\tfmt.Println(\"NO\")\n\n}\n", "lang": "Go", "bug_code_uid": "959de07a6baa8ad9494529186d2c71c1", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "d6b1c564c5ae053cb4f19dff7bc9ba0d", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9988938053097345, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n t = append(t, b)\n steps = steps + 1\n for {\n if a == b || b < a {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; idx--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}", "lang": "Go", "bug_code_uid": "346c5c1a11a605e9a1b03cc052be9e44", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "57dc0f7700612a10742ce4c01242aefc", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9780775716694773, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; id--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}", "lang": "Go", "bug_code_uid": "b53b10ac40c0f7cefddf5e9af597fa79", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "57dc0f7700612a10742ce4c01242aefc", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9658263305322129, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\ntype node struct {\n\tvalue int\n\tcount int\n\tprev *node\n}\n\nfunc newNode(n int) *node {\n\treturn &node{\n\t\tvalue: n,\n\t}\n}\n\nfunc main() {\n\tseen := make(map[int]bool)\n\tvar a, b int\n\tfmt.Fscanf(os.Stdin, \"%d %d\", &a, &b)\n\tqueue := []*node{newNode(b)}\n\n\tfor len(queue) > 0 {\n\t\tcurr := queue[0]\n\t\tqueue = queue[1:]\n\n\t\tif curr.value == a {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tfmt.Println(curr.count + 1)\n\t\t\tfor n := curr; n != nil; n = n.prev {\n\t\t\t\tfmt.Printf(\"%d \", n.value)\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t\treturn\n\t\t}\n\t\tif curr.value < a || seen[curr.value] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[curr.value] = true\n\n\t\tn := newNode(curr.value >> 1)\n\t\tn.count = curr.count + 1\n\t\tn.prev = curr\n\t\tqueue = append(queue, n)\n\t\tif curr.value%10 == 1 {\n\t\t\tn := newNode(curr.value / 10)\n\t\t\tn.count = curr.count + 1\n\t\t\tn.prev = curr\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "eaa893fd9bbd8a434b74e1cedb01e8da", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "016656ef0fdd3607fb9e5152ff82beea", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9042056074766355, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\nvar input io.Reader\n\ntype qu struct {\n\tpos, old int\n}\n\nfunc main() {\n\tvar (\n\t\trecipe string\n\t\tnb, ns, nc int64\n\t\tpb, ps, pc int64\n\t\tcb, cs, cc int64\n\t\trub int64\n\t)\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &recipe)\n\tfmt.Fscan(input, &nb, &ns, &nc)\n\tfmt.Fscan(input, &pb, &ps, &pc)\n\tfmt.Fscan(input, &rub)\n\n\tfor i := 0; i < len(recipe); i++ {\n\t\tswitch recipe[i] {\n\t\tcase 'B': cb++\n\t\tcase 'S': cs++\n\t\tcase 'C': cc++\n\t\t}\n\t}\n\tl, r := int64(0), int64(1e12 + 1000)\n\tfor l < r {\n\t\tmid := l + (r - l) / 2\n\t\tvar b, s, c int64 \n\t\tif cb > 0 { b = mid*cb*pb - nb*pb }\n\t\tif cs > 0 { s = mid*cs*ps - ns*ps }\n\t\tif cc > 0 { c = mid*cc*pc - nc*pc }\n\t\tcost := b + s + c\n\t\tif cost <= rub {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Println(r - 1)\n}", "lang": "Go", "bug_code_uid": "a7e938eae5ec2ffa6946fa6f86e348e6", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "f7529f38775e1b4977a13ea5b2d624dd", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9992942836979535, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/371/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst MaxBurgers = int64(1e12)\n\nfunc max(x, y int64) int64 {\n\tif x >= y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc p(burgers, cb, cs, cc, nb, ns, nc, pb, ps, pc int64) int64 {\n\treturn max(0, cb*burgers-nb)*pb + max(0, cs*burgers-ns)*ps + max(0, cc*burgers-nc)*pc\n}\n\nfunc _Solve(left, right, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles int64) int64 {\n\tif !(left < right) {\n\t\treturn left\n\t}\n\tm := (left + right + 1) / 2\n\tcost := p(m, cb, cs, cc, nb, ns, nc, pb, ps, pc)\n\tif cost <= rubles {\n\t\treturn _Solve(m, right, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles)\n\t}\n\treturn _Solve(left, m-1, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles)\n}\n\nfunc Solve(s string, nb, ns, nc, pb, ps, pc, r int64) int64 {\n\tcb := int64(strings.Count(s, \"B\"))\n\tcs := int64(strings.Count(s, \"S\"))\n\tcc := int64(strings.Count(s, \"C\"))\n\treturn _Solve(0, MaxBurgers, cb, cs, cc, nb, ns, nc, pb, ps, pc, r)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tvar nb, ns, nc int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &nb, &ns, &nc)\n\tvar pb, ps, pc int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &pb, &ps, &pc)\n\tvar r int64\n\tfmt.Fscanf(reader, \"%d\\n\", &r)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(s, nb, ns, nc, pb, ps, pc, r))\n}\n", "lang": "Go", "bug_code_uid": "c3aefe0b5dfb146676fb525ad13e426d", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "ae6f6b5e760120350296199000940d80", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4132231404958678, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\nfunc main(){\n int n,s\n fmt.Scan(&n,&s)\n flag := True\n for i := 0; i < n; i++ {\n int a\n fmt.Scan(&a)\n if s<=a {\n flag = False;\n }\n }\n if flag {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n \n}", "lang": "Go", "bug_code_uid": "d575fb0cada8742f380e39574d3c3a5b", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "d53b39f8c5260cc4b8c1cfea4d6d4012", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7360594795539034, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\tflag := true\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tif s <= a {\n\t\t\tflag = false\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}", "lang": "Go", "bug_code_uid": "00ac9e37ba8f2151b1f21e4ca46dfc1b", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "d53b39f8c5260cc4b8c1cfea4d6d4012", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9973935708079931, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc read() int {\n\tvar number int\n\tfmt.Scan(&number)\n\treturn number\n}\n\nfunc main() {\n\tvar growRateForMonth []int = make([]int, 12)\n\n\tgrowMin := readInt()\n\n\tfor i := 0; i < 12; i++ {\n\t\tgrowRateForMonth[i] = readInt()\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(growRateForMonth)))\n\n\ttotalMonths := 0\n\n\tfor _, monthValue := range growRateForMonth {\n\t\tif growMin <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tgrowMin -= monthValue\n\t\ttotalMonths++\n\t}\n\n\t// wattt\n\n\tif totalMonths == 12 && growMin > 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(totalMonths)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "5f6fff6ea07ad531bdefca7aae3fd527", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "849df03a9cc1246676c578793822b7fd", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9245810055865922, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var k int\n a := make([]int,12)\n fmt.Scan(&k)\n for i := 0; i < 12; i++ {\n fmt.Scan(&a[i])\n }\n sort.Sort(sort.IntSlice(a))\n cnt, ans := 0, 0\n for i := 11; (i >= 0) && (cnt < k); i-- {\n cnt += a[i]\n ans++\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "92c32c890ea130b33b3a1a1497e9fbf1", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "ccc5dfc73ff7c76a6f5393dbe203b6ff", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8073555166374781, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "// 149A-Mic\npackage main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var k int\n x := 1\n y := 0\n cou := 1\n min := cou\n fmt.Scan(&k)\n m := make([]int, 12)\n for i := 0; i < 12; i++ {\n fmt.Scan(&m[i])\n }\n sort.Sort(sort.Reverse(sort.IntSlice(m)))\n if k == 0 {\n fmt.Println(\"0\")\n return\n }\n k -= m[y]\n for x != 11 {\n if k > 0 {\n k -= m[x]\n cou++\n } else if k <= 0 {\n min = cou\n break\n }\n }\n fmt.Println(min)\n}\n", "lang": "Go", "bug_code_uid": "ce9f330ac8a66fc889acab3432a6861a", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "13be2dab3748810d0b5f16f742fd41d4", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9655172413793104, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport (\n \"fmt\"\n \"sort\"\n )\n\nfunc main(){\n var n int\n var l [12]int\n fmt.Scan(&n)\n for i:=0;i<12;i++{\n fmt.Scan(&l[i])\n }\n sort.Sort(sort.Reverse(sort.IntSlice(l)))\n if n == 0 {\n fmt.Println(0)\n } else {\n k := 0\n m := 0\n for _,i := range l {\n m += i\n if m < n { \n k++\n }\n }\n if m >= n {\n fmt.Println(k+1)\n }else{\n fmt.Println(-1)\n }\n }\n}", "lang": "Go", "bug_code_uid": "c4b6dbdc2ed4c6fba1fb156bb494cad8", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "37724890b0cd7b5d37b7dd622773e187", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9681857265692175, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tn, m, k := 0, 0, 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\tfmt.Sscanf(line, \"%d %d %d\", &n, &m, &k)\n\n\t\tif n > m {\n\t\t\tn, m = m, n\n\t\t}\n\n\t\tif k < n {\n\t\t\tarea1 := n * (m / (k + 1))\n\t\t\tarea2 := n / (k + 1) * m\n\t\t\tif area1 > area2 {\n\t\t\t\tfmt.Println(area2)\n\t\t\t} else {\n\t\t\t\tfmt.Println(area1)\n\t\t\t}\n\t\t} else if n <= k && k < m {\n\t\t\tfmt.Println(n * (m / (k + 1)))\n\t\t} else if m <= k && k <= n+m-2 {\n\t\t\tfmt.Println((n / (k + 2 - m) * m / m))\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "e4eeafa9b47165ee55defe2fd147bd20", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "e05378e5ab67c0a71f1ba54c75fe596e", "difficulty": 1700, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.30387143900657415, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tn, m, k := 0, 0, 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\tfmt.Sscanf(line, \"%d %d %d\", &n, &m, &k)\n\n\t\tbestSize := -1\n\t\tfor i := 0; i < n && i < k+1; i++ {\n\t\t\tvar size_n, size_m, size_n1, size_n2, size_m1, size_m2 int\n\n\t\t\tsize_n1 = n / (i + 1)\n\t\t\tsize_n2 = n - size_n1*(i)\n\n\t\t\tif size_n1 > size_n2 && size_n2 != 0 {\n\t\t\t\tsize_n = size_n2\n\t\t\t} else {\n\t\t\t\tsize_n = size_n1\n\t\t\t}\n\n\t\t\tif m < k-i+1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsize_m1 = m / (k - i + 1)\n\t\t\tsize_m2 = m - size_m1*(k-i)\n\t\t\tif size_m1 > size_m2 && size_m2 != 0 {\n\t\t\t\tsize_m = size_m2\n\t\t\t} else {\n\t\t\t\tsize_m = size_m1\n\t\t\t}\n\n\t\t\tif size_n*size_m > bestSize {\n\t\t\t\tbestSize = size_n * size_m\n\t\t\t}\n\t\t}\n\t\tfmt.Println(bestSize)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "86702e6c5c666caae7cf25e63c405259", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "e05378e5ab67c0a71f1ba54c75fe596e", "difficulty": 1700, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9955012853470437, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nvar notes = []string{ \"C\", \"C#\", \"D\", \"D#\", \"E\", \"F\", \"F#\", \"G\", \"G#\",\n \"A\", \"B\", \"H\" }\n\nfunc position(a string) int {\n for i := 0; i < 12; i++ {\n if notes[i] == a {\n return i\n }\n }\n return -1\n}\n\nfunc distance(a, b string) int {\n i, j := position(a), position(b)\n if i <= j {\n return j-i\n } else {\n return 12+j-i\n }\n return -1\n}\n\nfunc kind(a, b, c string) string {\n x, y := distance(a, b), distance(b, c)\n if x == 4 && y == 3 {\n return \"major\"\n } else if x == 3 && y == 4 {\n return \"minor\"\n }\n return \"strange\"\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n x, y, z := getS(), getS(), getS()\n permutations := [][]string{\n []string{ x, y, z },\n []string{ x, z, y },\n []string{ y, x, z },\n []string{ y, z, x },\n []string{ z, x, y },\n []string{ z, y, x },\n }\n for _, p := range permutations {\n s := kind(p[0], p[1], p[2])\n if s != \"strange\" {\n writer.WriteString(fmt.Sprintf(\"%s\\n\", s))\n return\n }\n }\n writer.WriteString(\"neither\\n\")\n}\n", "lang": "Go", "bug_code_uid": "697e9dae1c8c762a7a68506b1fece540", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "8ea58e9a8ab2f0f6ba6306ecaa687e7b", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9765258215962441, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() \n{\n var a int\n fmt.Scanf(\"%a\", &a)\n fmt.Println(a / 2520)\n}", "lang": "Go", "bug_code_uid": "67466cc6b9453d2a8e50b02391434d1d", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "c6b98f0f43bd90a9b8bb82368aa8a0c7", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9907407407407407, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a int64\n fmt.Scanf(\"%lld\", &a)\n fmt.Println(a / 2520)\n}", "lang": "Go", "bug_code_uid": "c7fbc041d180271b492f4fcc788ca493", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "c6b98f0f43bd90a9b8bb82368aa8a0c7", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6798866855524079, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tx := int64(8 * 9 * 5 * 7)\n\tvar n int64\n\tfmt.Scan(&n)\n\tvar i = int64(0)\n\n\tfor ; i*x < n; i = i*i + 1 {\n\t}\n\n\tfor ; i*x > n; i /= 2 {\n\t}\n\n\tfor ; i*x < n; i++ {\n\t}\n\tfmt.Println(i - 1)\n}\n", "lang": "Go", "bug_code_uid": "03fe9c1f4b191430f9a373af330c05dd", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "db13e4db460485574d26f9e622f9d3d2", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8983911939034717, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"runtime\"\n\t\"strconv\"\n)\n\n/* solution */\n\nfunc solve() {\n\ta, b, c := readInt(), readInt(), readInt()\n\tmin := a\n\tif b < min {\n\t\tmin = b\n\t}\n\tif c < min {\n\t\tmin = c\n\t}\n\tprintInt(min + 1)\n}\n\n/* stubs */\n\nfunc main() {\n\n\tvar f *os.File\n\tif runtime.GOROOT() == \"C:\\\\Soft\\\\Go\" {\n\t\tf, _ = os.Open(\"input.txt\")\n\t\tdefer f.Close()\n\t} else {\n\t\tf = os.Stdin\n\t}\n\n\twriter = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\treader = bufio.NewScanner(f)\n\n\tconst maxCapacity = 1024 * 1024\n\tbuf := make([]byte, maxCapacity)\n\treader.Buffer(buf, maxCapacity)\n\n\treader.Split(bufio.ScanWords)\n\n\tsolve()\n\n}\n\nvar reader *bufio.Scanner\nvar writer *bufio.Writer\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc readInt() int {\n\treader.Scan()\n\tret, _ := strconv.Atoi(reader.Text())\n\treturn ret\n}\n\nfunc print(s string) {\n\twriter.WriteString(s)\n\twriter.WriteString(\"\\n\")\n}\n\nfunc printInt(i int) {\n\tprint(strconv.Itoa(i))\n}\n\nfunc printInt64(i int64) {\n\tprint(strconv.FormatInt(i, 10))\n}\n\nfunc readInt64() int64 {\n\treader.Scan()\n\tret, _ := strconv.ParseInt(reader.Text(), 10, 64)\n\treturn ret\n}\n", "lang": "Go", "bug_code_uid": "ad35e31b76384d4bce0825afa32293d0", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "11f9ef87cf4d71dbafb147737b210337", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9499467518636848, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nfunc main(){\n in := bufio.NewReader(os.Stdin)\n out := bufio.NewWriter(os.Stdout)\n defer out.Flush()\n \n var n, l, r int\n fmt.Fscan(in, &n, &l, &r)\n \n m1 := 0\n for i := 1; i <= l; i++ {\n m1 += i\n }\n m1 += n - l\n \n m2 := 1\n j := 1\n for i := 1; i < r; i++ {\n j *= 2\n m2 += j\n }\n m2 += (n - r) * j\n \n fmt.Fprintln(out, m1, m2)\n}", "lang": "Go", "bug_code_uid": "96c1594fdf0fa57c74c338c34ebb1e4b", "src_uid": "ce220726392fb0cacf0ec44a7490084a", "apr_id": "3b227e9aafbed5426b83298c6d51d517", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8147268408551069, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tmin := make([]int, 3)\n\tmax := make([]int, 3)\n\n\tfor i := 0; i < 3; i++ {\n\t\tif _, err := fmt.Scanf(\"%d %d\\n\", &min[i], &max[i]); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif max[i] > n {\n\t\t\tmax[i] = n\n\t\t}\n\t}\n\n\tvar f, s, t int\n\tvar ok bool = false\n\n\tfor i := max[0]; i >= min[0]; i-- {\n\t\tami := n - i - max[2]\n\t\tif ami < min[1] {\n\t\t\tami = min[1]\n\t\t}\n\t\tamx := n - i - min[2]\n\t\tif amx > max[1] {\n\t\t\tamx = max[1]\n\t\t}\n\t\tfor j := ami; j >= amx; j-- {\n\t\t\tk := n - i - j\n\t\t\tif k >= min[2] && k <= max[2] {\n\t\t\t\tf = i\n\t\t\t\ts = j\n\t\t\t\tt = k\n\t\t\t\tok = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d %d\\n\", f, s, t)\n}\n", "lang": "Go", "bug_code_uid": "3f8b95d1b55ced0a6ed45335a39f0553", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "21dc28d53a620a75dba1538958897fe6", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8729792147806005, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tmin := make([]int, 3)\n\tmax := make([]int, 3)\n\n\tfor i := 0; i < 3; i++ {\n\t\tif _, err := fmt.Scanf(\"%d %d\\n\", &min[i], &max[i]); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif max[i] > n {\n\t\t\tmax[i] = n\n\t\t}\n\t}\n\n\tvar f, s, t int\n\tvar ok bool = false\n\n\tfor i := max[0]; i >= min[0]; i-- {\n\t\tami := n - i - max[2]\n\t\tif ami < 1 || ami > n-2 || ami < min[1] {\n\t\t\tami = min[1]\n\t\t}\n\t\tamx := n - i - min[2]\n\t\tif amx < 1 || amx > n-2 || amx > max[1] {\n\t\t\tamx = max[1]\n\t\t}\n\t\tfor j := amx; j >= ami; j-- {\n\t\t\tk := n - i - j\n\t\t\tif k >= min[2] && k <= max[2] {\n\t\t\t\tf = i\n\t\t\t\ts = j\n\t\t\t\tt = k\n\t\t\t\tok = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d %d\\n\", f, s, t)\n}\n", "lang": "Go", "bug_code_uid": "8c7fd375f795f4659c18274758830bd5", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "21dc28d53a620a75dba1538958897fe6", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9427043544690603, "equal_cnt": 44, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 31, "fix_ops_cnt": 43, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nfunc readInt() int {\n\tvar o, neg bool\n\tvar i int\n\tb, err := r.ReadByte()\n\tfor err == nil {\n\t\tif b != ' ' && b != '\\n' && b != '\\r' {\n\t\t\tif b == '-' {\n\t\t\t\tneg = true\n\t\t\t} else {\n\t\t\t\ti = i*10 + int(b) - 48\n\t\t\t\to = true\n\t\t\t}\n\t\t} else if o {\n\t\t\tbreak\n\t\t}\n\t\tb, err = r.ReadByte()\n\t}\n\tif neg {\n\t\treturn -i\n\t}\n\treturn i\n}\n\nfunc writeInt(i int) {\n\tif i < 0 {\n\t\tw.WriteByte('-')\n\t\ti = -i\n\t}\n\tif i < 10 {\n\t\tw.WriteByte(byte(i + 48))\n\t\treturn\n\t}\n\tvar tmp, count int\n\ttmp = i\n\tfor tmp%10 == 0 {\n\t\ttmp /= 10\n\t\tcount++\n\t}\n\ttmp = 0\n\tfor i != 0 {\n\t\ttmp = tmp*10 + (i % 10)\n\t\ti /= 10\n\t}\n\tfor tmp != 0 {\n\t\tw.WriteByte(byte((tmp % 10) + 48))\n\t\ttmp /= 10\n\t}\n\tfor count > 0 {\n\t\tcount--\n\t\tw.WriteByte('0')\n\t}\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tvar n int\n\tfor I(&n) == nil {\n\t\tsolve(n)\n\t}\n\tw.Flush()\n}\n\nfunc solve(n int) {\n\tvar in [3][6]int\n\tvar arr []int\n\to := make(map[int]bool)\n\to[0] = true\n\tfor i := 0; i < n; i++ {\n\t\tfor j := range in[i] {\n\t\t\tin[i][j] = readInt()\n\t\t\tif _, exists := o[in[i][j]]; !exists {\n\t\t\t\tarr = append(arr, in[i][j])\n\t\t\t\to[in[i][j]] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 6; i++ {\n\t\tfor j := 0; j < 6; j++ {\n\t\t\tfor k := 0; k < 6; k++ {\n\t\t\t\ta := in[0][i]*100 + in[1][j]*10 + in[2][k]\n\t\t\t\tb := in[0][i]*100 + in[2][j]*10 + in[1][k]\n\t\t\t\tc := in[2][i]*100 + in[0][j]*10 + in[1][k]\n\t\t\t\td := in[1][i]*100 + in[0][j]*10 + in[2][k]\n\t\t\t\te := in[1][i]*100 + in[2][j]*10 + in[0][k]\n\t\t\t\tf := in[2][i]*100 + in[1][j]*10 + in[0][k]\n\t\t\t\tif _, exists := o[a]; !exists {\n\t\t\t\t\tarr = append(arr, a)\n\t\t\t\t\to[a] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[b]; !exists {\n\t\t\t\t\tarr = append(arr, b)\n\t\t\t\t\to[b] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[c]; !exists {\n\t\t\t\t\tarr = append(arr, c)\n\t\t\t\t\to[c] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[d]; !exists {\n\t\t\t\t\tarr = append(arr, d)\n\t\t\t\t\to[d] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[e]; !exists {\n\t\t\t\t\tarr = append(arr, e)\n\t\t\t\t\to[e] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[f]; !exists {\n\t\t\t\t\tarr = append(arr, f)\n\t\t\t\t\to[f] = true\n\t\t\t\t}\n\t\t\t\taa := in[0][i]*10 + in[1][j]\n\t\t\t\tbb := in[1][i]*10 + in[0][j]\n\t\t\t\tcc := in[0][i]*10 + in[2][j]\n\t\t\t\tdd := in[2][i]*10 + in[0][j]\n\t\t\t\tee := in[2][i]*10 + in[1][j]\n\t\t\t\tff := in[1][i]*10 + in[2][j]\n\t\t\t\tif _, exists := o[aa]; !exists {\n\t\t\t\t\tarr = append(arr, aa)\n\t\t\t\t\to[aa] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[bb]; !exists {\n\t\t\t\t\tarr = append(arr, bb)\n\t\t\t\t\to[bb] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[cc]; !exists {\n\t\t\t\t\tarr = append(arr, cc)\n\t\t\t\t\to[cc] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[dd]; !exists {\n\t\t\t\t\tarr = append(arr, dd)\n\t\t\t\t\to[dd] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[ee]; !exists {\n\t\t\t\t\tarr = append(arr, ee)\n\t\t\t\t\to[ee] = true\n\t\t\t\t}\n\t\t\t\tif _, exists := o[ff]; !exists {\n\t\t\t\t\tarr = append(arr, ff)\n\t\t\t\t\to[ff] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(arr)\n\tif arr[0] != 1 {\n\t\tO(\"0\\n\")\n\t\treturn\n\t}\n\tfor i := range arr {\n\t\tif i+1 != arr[i] {\n\t\t\tO(i, \"\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tO(arr[len(arr)-1], \"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "6c4990fbefc274aa0b77ea38b3babf87", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "fb0a63849a1e3ec2a7d3786c3be249ea", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.37215713301171605, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar freq [10]int\n\t_, _ = fmt.Scanf(\"%d\\n\", &n)\n\tfor i :=0; i < n; i++ {\n\t\tfor j := 0; j < 6; j++ {\n\t\t\tvar num int\n\t\t\tif j < 5 {\n\t\t\t\t_, _ = fmt.Scanf(\"%d\", &num);\n\t\t\t} else {\n\t\t\t\t_, _ = fmt.Scanf(\"%d\\n\", &num);\n\t\t\t}\n\t\t\tfreq[num]++\n\t\t}\n\t}\n\tfor i := 1; i <= 999; i++ {\n\t\ttemp := i\n\t\tvar taken [3]int;\n\t\tvar till = 0\n\t\tfor temp > 0 {\n\t\t\tdigit := temp % 10\n\t\t\tif freq[digit] > 0 {\n\t\t\t\tfreq[digit]--;\n\t\t\t\ttaken[till] = digit\n\t\t\t} else {\n\t\t\t\tfmt.Println(i - 1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttill++\n\t\t\ttemp /= 10\n\t\t}\n\t\tfor j := 0; j < till; j++ {\n\t\t\tfreq[taken[j]]++\n\t\t}\n\t}\n\tfmt.Println(999)\n}\n", "lang": "Go", "bug_code_uid": "76891a3a173381b30db070d24d828a91", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "1e7266d042205a220250aacc2e1c4d89", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.25884543761638734, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tx, y, n := nextInt(), nextInt(), nextInt()\n\tvar fi, fpre int64;\n\n\tif n == 1 {\n\t\tfi = int64(x)\n\t} else {\n\t\tfi = int64(y)\n\t}\n\n\tfpre = int64(x)\n\n\tfor i := 3; i <= n; i++ {\n\t\t// println(fi, fpre)\n\t\tfi, fpre = fi - fpre, fi \n\t\t// println(fi, fpre)\n\t}\n\n\tfi = fi % 1000000007\n\t\n\tif fi < 0 {\n\t\tfi = 1000000007 + fi\n\t}\n\n\tprintln(fi)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "40ff92ed46b491c43b737bae37a8c7b5", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "650576aedbc0326c6bd81a2654d3892b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9873843566021867, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, n int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &x, &y); err != nil {\n\t\treturn\n\t}\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tan := fn(x, y, n)\n\tif an < 0 {\n\t\tfmt.Println(1000000007 - (-an % 1000000007))\n\t} else {\n\t\tfmt.Println(an % 1000000007)\n\t}\n}\n\nfunc fn(x, y, n int) int {\n\tif n == 1 {\n\t\treturn x\n\t} else if n == 2 {\n\t\treturn y\n\t} else if n == 3 {\n\t\treturn y - x\n\t} else { // n > 3\n\t\thead := [3]int{y - x, x, y}\n\t\tpos := n % 3\n\t\tsign := 1\n\t\tif ((n-1)/3)%2 != 0 {\n\t\t\tsign = -1\n\t\t}\n\t\treturn head[pos] * sign\n\t}\n}\n", "lang": "Go", "bug_code_uid": "6b7b242a936384c73a129aa2e4ed47ea", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "f55a5addcbecd061f6d7412ed3388235", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.693565976008724, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar f1, f2, n int\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\tfmt.Sscanf(line, \"%d %d\", &f1, &f2)\n\n\t}\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d\", &n)\n\t}\n\n\tfn := f2%1000000007 - f1%1000000007\n\tfor i := 3; i <= n; i++ {\n\t\tfn, f2 = (fn-f2)%1000000007, fn%1000000007\n\t}\n\n\tfor f2 < 0 {\n\t\tf2 += 1000000007\n\t}\n\tfmt.Println(f2)\n}\n", "lang": "Go", "bug_code_uid": "1f80eef82691edc3e9c8b8e3f5ef6ac6", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "e2b5101f6e530183ee82a048bca65416", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9804772234273319, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar f1, f2, n int\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\tfmt.Sscanf(line, \"%d %d\", &f1, &f2)\n\n\t}\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d\", &n)\n\t}\n\n\tseries := [7]int{-1, f1, f2, f2 - f1, -f1, -f2, f1 - f2}\n\n\tfn := series[n%6]\n\n\tmodulo := fn % 1000000007\n\tfor modulo < 0 {\n\t\tmodulo += 1000000007\n\t}\n\tfmt.Println(modulo)\n}\n", "lang": "Go", "bug_code_uid": "3d12f7b4713ebe22c6a95dcd84f38016", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "e2b5101f6e530183ee82a048bca65416", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9921996879875195, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nvar n int \nvar str string\nfunc main() {\n fmt.Scanf(\"%d\\n\", &n)\n fmt.Scanf(\"%s\", &str)\t\n ll := 2\n max_subs := 1\n\tfor ll < n/2+1 {\n\t subs := strings.Contains(str[ll:], str[0:ll])\n\t if subs {\n\t max_subs = ll\n\t }\n\t ll+=1\n\t}\n\tfmt.Println(n-max_subs+1)\n}\n", "lang": "Go", "bug_code_uid": "3d5bc8dbd45e10dbd9b8e959a2cb0227", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "d915b564df32aae0de2263eb44dca63f", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8850325379609545, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tw, str, choice := 0, \"\", 0\n\tfmt.Scan(&w, &str)\n\tfor i := 1; i <= w/2; i++ {\n\t\tif str[0:i] == str[i:2*i] {\n\t\t\tchoice = i\n\t\t}\n\t}\n\tfmt.Println(w - choice + 1)\n}\n", "lang": "Go", "bug_code_uid": "ed8ba328f74a55aabb307857f94ed69a", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "42bd3526758b6f8d383d0cd72df95c02", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7224835371589841, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "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\treader := bufio.NewReaderSize(os.Stdin, 2048 * 2048)\n\tn1, _ := strconv.ParseInt(readLine(reader), 2, 64)\n\tn2, _ := strconv.ParseInt(readLine(reader), 2, 64)\n\tfmt.Println(strconv.FormatInt(n1 ^ n2, 2))\n}\n\n\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "39ae68c2ac7636b863e89b8e783944dd", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "a647a45fc6453a189fd34d357fc684ae", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.3779264214046823, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar a string\n\tvar b string\n\tfmt.Scanf(\"%s\\n\", b)\n\tfmt.Scanf(\"%s\\n\", a)\n\tval1, _ := strconv.ParseUint(a, 2, 32)\n\tval2, _ := strconv.ParseUint(b, 2, 32)\n\tval3 := val1 * val2\n\n\tans := strconv.FormatUint(val3, 2)\n\tif len(ans) != len(a)+1 {\n\t\tfmt.Println(\"0\" + ans)\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8c75059a73954e1f9c88508e6f7a2e3b", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "c206fba60dcc3cae59e7354fb7544739", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5008347245409015, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 8, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m string\n\tfmt.Fscan(os.Stdin, &n, &m)\n\tvar r []byte\n\tcarry := 0\n\tfor i := len(n) - 1; i >= 0; i-- {\n\t\tacc := runeToInt(n[i]) + runeToInt(m[i]) + carry\n\t\tr = append(r, byte(acc % 2))\n\t\tcarry = acc / 2\n\t}\n\tif carry == 1 { r = append(r, 1) }\n\tfor i := len(r)-1; i >= 0; i-- {\n\t\tfmt.Print(r[i])\n\t}\n}\n\nfunc runeToInt(r byte) int {\n\treturn int(r - '0')\n}", "lang": "Go", "bug_code_uid": "f223d7d4bfc6e2b7fa67e30ac7328240", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "fbc6e608f01dee9b194e989468ee2981", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.47755834829443444, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 22, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, l, m, n, d int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n%d\", &k, &l, &m, &n, &d)\n\tvar b = make([]bool, d, d)\n\tmult := 1\n\tfor _, num := range []int{k, l, m, n} {\n\t\tmult = 1\n\t\tfor ; mult*num <= d; mult++ {\n\t\t\tb[mult*num-1] = true\n\t\t}\n\t}\n\tcount := 0\n\tfor _, val := range b {\n\t\tif val {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "955add6aae364eab7c0765a6e36773a6", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "27ca9278e517f94e4709d875195995df", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.93158953722334, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF877A(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar s string\n\tFscan(in, &s)\n\tc := 0\n\tfor _, name := range []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"} {\n\t\tif strings.Index(s, name) >= 0 {\n\t\t\tc++\n\t\t}\n\t}\n\tif c == 1 {\n\t\tFprintln(out, \"YES\")\n\t} else {\n\t\tFprintln(out, \"NO\")\n\t}\n}\n\nfunc main() { CF877A(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "81ca97b816835b239388e357490d65ad", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "5d4ef5f7f1abd5efd3c3169d7066240b", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.942189421894219, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar friends = []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"}\n\tvar (\n\t\tproblems string\n\t\tcount int\n\t)\n\tfmt.Scan(&problems)\n\n\tfor _, friend := range friends {\n\t\tif has := strings.Contains(problems, friend); has {\n\t\t\tcount++\n\t\t}\n\t\tif count > 1 {\n\t\t\tfmt.Print(\"NO\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tif count == 0 {\n\t\tfmt.Print(\"NO\\n\")\n\t\treturn\n\t}\n\tfmt.Print(\"YES\\n\")\n}\n", "lang": "Go", "bug_code_uid": "c6f6a7539aaf65629aaa42922a95f8c2", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "8cbeb0f623e0de0e0c5322b1b86d780c", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9754194303550526, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main \n\nimport \"fmt\"\n\nfunc Max( x, y int ) int { // math.Max() は問題を起こすらしい。。。\n if x > y {\n return x\n }\n return y\n}\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan( &N, &K )\n\tvar S string\n\tfmt.Scan( &S )\n\typfx := make( []int, N + 1, N + 1 ); // type, length, capacity\n\tnpfx := make( []int, N + 1, N + 1 );\n\tqpfx := make( []int, N + 1, N + 1 );\n\tfor i := 0; i < N; i++ { // seems like go does not support ++i.....\n\t ypfx[ i + 1 ] = ypfx[ i ];\n\t npfx[ i + 1 ] = npfx[ i ];\n\t qpfx[ i + 1 ] = qpfx[ i ];\n\t if( S[ i ] == 'Y' ) {\n\t ypfx[ i + 1 ]++;\n\t } else if( S[ i ] == 'N' ) {\n\t npfx[ i + 1 ]++;\n\t } else {\n\t qpfx[ i + 1 ]++;\n\t }\n\t}\n\toriginal_max := 0;\n\tfor i := 0; i < N; i++ {\n\t if( S[ i ] != 'N' ) { // syntax error: missing { after if clause えええええ\n\t continue;\n\t }\n\t j := i;\n\t for j < N && S[ j ] == 'N' { // while() はだめなんかい!!\n\t j++;\n\t }\n\t original_max = Max( original_max, j - i );\n\t i = j;\n\t}\n\tif( original_max > K ) {\n\t fmt.Println( \"NO\" );\n\t return;\n\t}\n\tfor i := 0; i + K <= N; i++ { // i を左界とする長さ K の区間を調べる\n\t if( ypfx[ i + K ] - ypfx[ i ] > 0 ) { // ええええ -> line: 34\n\t continue;\n\t }\n\t if( i + K < N && S[ i + K ] == 'N' ) {\n\t continue;\n\t }\n\t fmt.Println( \"YES\" );\n\t return;\n\t}\n\tfmt.Println( \"NO\" );\n}", "lang": "Go", "bug_code_uid": "fdab6741f9b20a980a7c2e39e5907436", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "751675b2eb349ac815e78eff100016c0", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8460111317254174, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a,b,c,d,e int\n\tvar ans=false\n\tfmt.Scanf(\"%d %d %d %d %d\",&a,&b,&c,&d,&e)\n\tfor i:=c;i 0 && m[s[i - 1]] && m[s[i]] {\n\t\t\n\t\t} else {\n\t\t\tr = append(r , s[i])\n\t\t}\n\t}\n\n\tfmt.Println(string(r))\n}\n", "lang": "Go", "bug_code_uid": "7ffb5796ec39059d2d705bb0b3a7cb7f", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "7793377fb551da87e76fe43a0c91e23a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9672457989176872, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n)\n\nfunc init() {\n\tlog.SetLevel(log.ErrorLevel)\n\tlog.Println(\"started\")\n}\n\n// Case .\ntype Case struct {\n\ta, b, x, y, z int64\n}\n\nfunc solve(c Case, w io.Writer) {\n\ta := 2*c.x + c.y - c.a\n\tb := c.y + 3*c.z - c.b\n\tif a < 0 {\n\t\ta = 0\n\t}\n\tif b < 0 {\n\t\tb = 0\n\t}\n\tw.Write(([]byte)(fmt.Sprintf(\"%d\\n\", a+b)))\n}\n\nfunc parseInput(lines <-chan string, res chan<- Case) {\n\tfor {\n\t\tab1, ok := <-lines\n\t\tif !ok {\n\t\t\tclose(res)\n\t\t\treturn\n\t\t}\n\t\tab := int64s(words(ab1))\n\t\txyz := int64s(words(<-lines))\n\t\tres <- Case{ab[0], ab[1], xyz[0], xyz[1], xyz[2]}\n\t}\n}\n\nfunc int64s(w []string) []int64 {\n\tres := make([]int64, 0, len(w))\n\tfor _, word := range w {\n\t\ti, err := strconv.ParseInt(word, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\nfunc words(s string) []string {\n\tprep := strings.Split(s, \" \")\n\tres := make([]string, 0, len(prep))\n\tfor _, l := range prep {\n\t\tif len(l) > 0 {\n\t\t\tres = append(res, l)\n\t\t}\n\t}\n\treturn res\n}\n\nfunc run() error {\n\texp, err := ioutil.ReadFile(\"expected.txt\")\n\tif err == nil {\n\t\tfmt.Println(\"--------- expected --------- \")\n\t\tfmt.Println((string)(exp))\n\t\tfmt.Println(\"--------- computed --------- \")\n\t}\n\n\tinData, err := ioutil.ReadAll(os.Stdin)\n\t//inData, err := ioutil.ReadFile(\"in.txt\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read input: %s\", err)\n\t}\n\tlines := make(chan string, 8)\n\tcases := make(chan Case, 8)\n\tgo func() {\n\t\tfor _, line := range strings.Split((string)(inData), \"\\n\") {\n\t\t\ts := strings.TrimSpace(line)\n\t\t\tif len(s) > 0 {\n\t\t\t\tlines <- s\n\t\t\t}\n\t\t}\n\t\tclose(lines)\n\t}()\n\tgo parseInput(lines, cases)\n\tfor c := range cases {\n\t\tsolve(c, os.Stdout)\n\t}\n\treturn nil\n}\n\nfunc main() {\n\tif err := run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "cdb93298250e52ab5ea6bbf00dc3c352", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "8e0de431739e37763dea02d258d78011", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9858267716535433, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var yc, bc uint64\n var y,g,b uint64\n var yn, bn uint64\n fmt.Scan(&yc, &bc, &y, &g, &b)\n yn = 2*y + 1*g\n bn = 1*g + 3*b\n var total int\n if yn > yc {\n total += yn - yc\n }\n if bn > bc {\n total += bn - bc\n }\n fmt.Print(total)\n}", "lang": "Go", "bug_code_uid": "0378b59af41d068a4703d0ae1a26aff6", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "20dbfdd261555f712e5b4b8e7053ba59", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6895522388059702, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "package main\nimport \"fmt\"\nfunc main(){\n var yellowcris int64\nvar bluecris int64\nvar yellowball int64\nvar greenball int64\nvar blueball int64\n fmt.Scan(&yellowcris)\n fmt.Scan(&bluecris)\n fmt.Scan(&yellowball)\n fmt.Scan(&greenball)\n fmt.Scan(&blueball)\n // fmt.Print(yellowcris)\n // fmt.Print(bluecris)\n // fmt.Print(yellowball)\n // fmt.Print(greenball)\n // fmt.Print(blueball+yellowball)\n var totalcrris int64 = yellowcris+bluecris\n var predictecris int64 = 0\n predictecris += yellowball*2\n predictecris += greenball*2\n predictecris += blueball*3\n fmt.Print(predictecris-totalcrris)\n}\n", "lang": "Go", "bug_code_uid": "3446363d6a7cf7e160b410e3f442610b", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "9993327b785d829e9c1fae7413dcb4b6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9693251533742331, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t//\"sort\"\n)\nfunc find(x int) int{\n\tt,k:=0,1\n\tfor ;x>0; {\n\t\tif x%10==0 {\n\t\t\tt+= (x%10)*k\n\t\t\tk*= 10\n\t\t}\n\t\tx/=10\n\t}\n\treturn t\n}\n\nfunc main() {\n\tvar n,m,x,y int\n\tfmt.Scan(&n,&m)\n\tc:= n+m\n\tx=find(n)\n\ty=find(m)\n\tc=find(c)\n\tif x+y==c {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n\n", "lang": "Go", "bug_code_uid": "b5ba9a22b2a4e5ae82f4838998e953eb", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "cda7b709c02c377a8f9911d95326a87d", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9042145593869731, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\nvar writer *bufio.Writer\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc reduce(x int) int {\n y := 0\n for x != 0 {\n y = 10*y + x%10\n x /= 10\n }\n return y\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer = bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n a, b := getI(), getI()\n c := a + b\n result := \"NO\"\n if reduce(a) + reduce(b) == reduce(c) {\n result = \"YES\"\n }\n writer.WriteString(fmt.Sprintf(\"%s\\n\", result))\n}\n", "lang": "Go", "bug_code_uid": "d6d0cfe6a9a32d384a4ca73ea6156122", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "d5c70600fa21a48f746eeb39f16a2f65", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.623574144486692, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y uint16\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\tif x%2 == 0 || y%2 == 0 {\n\t\tfmt.Println(\"Malvika\")\n\t} else {\n\t\tfmt.Println(\"Akshat\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a95ac8d261e09a96e7119474d1741bd7", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "f7bdc311fe5d1a5d6a76648a7b1dffbc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8736842105263158, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tif (n * m) % 2 == 1 {\n\t\tfmt.Println(\"Akshat\")\n\t} else {\n\t\tfmt.Println(\"Malvika\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "18b104d0b720e6e82218215952dfddbc", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "70f4a20a24e893a77a353cad19eb8440", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9622926093514329, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n, m int\n\nfunc main() {\n\tfmt.Fscan(reader, &n, &m)\n\tif n*m%2 == 0 {\n\t\tfmt.Println(\"Malvika\")\n\t} else {\n\t\tfmt.Println(\"Akshat\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ff45443b659bce1b78ea4443cdef229a", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "368c2f9cc35b23fb1b48ccd9cef1ea22", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8460710441334769, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport (\"fmt\"\n\t\"math\")\nfunc main(){\nvar inputSquare float64\nvar inputSquare2 float64\nn, err := fmt.Scanf(\"%f\\n\", &inputSquare)\nif err != nil || n != 1 {\n // handle invalid input\n fmt.Println(n, err)\n}\nc, err := fmt.Scanf(\"%f\\n\", &inputSquare2)\nif err != nil || c != 1 {\n // handle invalid input\n fmt.Println(n, err)\n}\nvar x int\n\tx = int(math.Min(inputSquare,inputSquare2))\n\tif x%2 == 0 {\n\t\tfmt.Println(\"Malvika\")\n\t} else {\n\t\tfmt.Println(\"Akshat\")\n}\n//fmt.Println(inputSquare,inputSquare2)\n}\n", "lang": "Go", "bug_code_uid": "a6cb9284cb378e8be07775ead385850b", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "87c27b22fbb52f5ef9693cf0a594f90a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.45698924731182794, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, a float64\n\t_, err := fmt.Scanf(\"%f %f %f\", &n, &m, &a)\n\tfmt.Println(math.Ceil(m/a) * math.Ceil(n/a))\n}\n", "lang": "Go", "bug_code_uid": "b6f4a74e8f0d0e8470293dfa362b3d41", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e257b5014c868de8893faade8c3dfcaf", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.2292817679558011, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "func main() {\n var a int\n var m int\n var n int\n fmt.Scanf(\"%d %d %d\", &m, &n, &a)\n // fmt.Println(\"m:\",m)\n // fmt.Println(\"n:\",n)\n // fmt.Println(\"a:\",a)\n m = m/a\n n = n/a\n // m = int(float32(m/a) + 0.5)\n // n = int(float32(n/a) + 0.5)\n if m%a!=0 || m==0 {m++}\n if n%a!=0 || n==0 {n++}\n // fmt.Println(m)\n // fmt.Println(n)\n // fmt.Println(m*n)\n // fmt.Println(\"m:\",m)\n // fmt.Println(\"n:\",n)\n fmt.Println(m*n)\n}", "lang": "Go", "bug_code_uid": "5a9c87bf7ab59327abfdc8cbf899d626", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "4729b612451c594efc370877e1656915", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9227053140096618, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var i, j, k int\n fmt.Scanf(\"%d %d %d\\n\", &i, &j, &k)\n var int n = i/k\n var int m = j/k\n if i%k!=0{\n n++\n }\n if j%k!=0{\n m++\n }\n fmt.Println(n*m)\n}", "lang": "Go", "bug_code_uid": "382614ba0429ac6f74fa520ad7d34c2c", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "71e34c8721339a04a9acd27e759014e2", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.3795309168443497, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n,m,a int\n \tfmt.Scanf(\"%d\", &n,&m,&a);\n\tfmt.Println(\"%d\",(n/a+1)*(m/a+1));\n}", "lang": "Go", "bug_code_uid": "286019077cbc9d6f14659103a3cfcad3", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "35e7f39c0f8c6a75c83e7866e5bc70af", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8466453674121406, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc round(n float64) int {\n\tif n1-float64(n2) < 0.00000001 {\n\t\treturn int(n)\n\t} else {\n\t\treturn int(n) +1 \n\t}\n}\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scanf(\"%d,%d,%d\", &n, &m, &a)\n\tfmt.Println(round(float64(n)/float64(a)) * round(float64(m)/float64(a)))\n}", "lang": "Go", "bug_code_uid": "13e3768c1c090551320e7f714c409d9a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "35e7f39c0f8c6a75c83e7866e5bc70af", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5888594164456233, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar m, n, a uint64\n\tfmt.Scanf(\"%d %d %d\", m, n, a)\n\n\ttotal := m * n\n\tresult := total / a\n\n\tfmt.Println(result)\n}", "lang": "Go", "bug_code_uid": "e09bb1ca8c249be0d12d1c113e7b4d7b", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "eba09729998f5f8094fa1ef53759630b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5843230403800475, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport ( \"fmt\" )\n\nfunc main () {\n\t\n\tvar n, nn, m, a, i int\n\t\n\tfmt.Scan ( &n, &m, &a )\n\t\n\tnn = n\n\t\n\tfor m > 0 {\n\t\t\n\t\tfor nn > 0 { nn -= a ; i++ }\n\t\tnn = n ; m -= a\n\t\n\t}\n\t\n\tfmt.Println ( i )\n\t\n}\n", "lang": "Go", "bug_code_uid": "7f3cee31d38049d50c2a995492643429", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "12f30f372e14ce9d910d23654612b23b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.342451874366768, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "// hello\npackage main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var str string\n fmt.Scanf(\"%s\", &str)\n\n fmt.Print(strings.ToUpper(str[0:1]))\n len := len(str)\n if len > 1 {\n fmt.Print(strings.ToLower(str[1:len]))\n }\n}\n", "lang": "Go", "bug_code_uid": "d93cf5fcfcdfcc1b83dd38339692e5d5", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "79625fdf6bbf3f14049df3fdd18652f6", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9277777777777778, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\ta131()\n}\n\nfunc a131() {\n\tvar s, newS string\n\tfmt.Scan(&s)\n\tfor i := range s {\n\t\tswitch {\n\t\tcase s[i] > 96:\n\t\t\tif i == 0 {\n\t\t\t\tnewS += string(s[i] - 32)\n\t\t\t}\n\t\t\tif i == 1 {\n\t\t\t\tfmt.Println(s)\n\t\t\t}\n\t\tcase s[i] < 91:\n\t\t\tnewS += string(s[i] + 32)\n\t\tdefault:\n\t\t\tnewS += string(s[i])\n\t\t}\n\t}\n\tfmt.Println(newS)\n}", "lang": "Go", "bug_code_uid": "908ecefc47f8193233d85c851fa9dd0f", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "93d3c8eb9b16d8d2383705dd5b7f79d8", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9187713310580204, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar KBD = []string{\"qwertyuiop\", \"asdfghjkl;\", \"zxcvbnm,./\"}\n\n\tvar kbd [3][10]rune\n\tfor i := range KBD {\n\t\tfor j, c := range KBD[i] {\n\t\t\tkbd[i][j] = c\n\t\t}\n\t}\n\tL, R, shift := make(map[rune]rune), make(map[rune]rune), make(map[rune]rune)\n\t// make L\n\tfor i := range KBD {\n\t\tfor j := range KBD[i] {\n\t\t\tif j == 9 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tL[kbd[i][j]] = kbd[i][j+1]\n\t\t}\n\t}\n\t// make R\n\tfor i := range KBD {\n\t\tfor j := range KBD[i] {\n\t\t\tif j == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tR[kbd[i][j]] = kbd[i][j-1]\n\t\t}\n\t}\n\tvar d, mole string\n\tfmt.Scanln(&d)\n\tif d == \"R\" {\n\t\tshift = R\n\t} else {\n\t\tshift = L\n\t}\n\tfmt.Scanln(&mole)\n\tfmt.Println(mole)\n\tfor _, c := range mole {\n\t\tfmt.Printf(string(shift[c]))\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "d872ffe98eb00bc92fb3a0f6cbdffbd0", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "3fbd8a7ff909e88b95f1d51fea05be8c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8988603988603988, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tf := func() {\n\t\tfor _, v := range a {\n\t\t\tif i := sort.SearchInts(dp, v+1); i < len(dp) {\n\t\t\t\tdp[i] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 5 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tf()\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\nfunc main() { CF582B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "fe953032ffd0fd144abd190749565e61", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "741974fa96aa2cc26a88635b007a1fd5", "difficulty": 1900, "tags": ["matrices", "dp", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9942028985507246, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tfor i := 0; i < n+10 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tfor _, v := range a {\n\t\t\tif p := sort.SearchInts(dp, v+1); p < len(dp) {\n\t\t\t\tdp[p] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\n//func main() { CF582B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "a832b71638e9bbf92f10688f1808822d", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "741974fa96aa2cc26a88635b007a1fd5", "difficulty": 1900, "tags": ["matrices", "dp", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9972789115646259, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc Process(a []int64) (int64, []int64) {\n\tvar m = map[int64]bool{}\n\tvar r = make([]int64, 0)\n\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tif _, exist := m[a[i]]; !exist {\n\t\t\tr = append([]int64{a[i]}, r...)\n\t\t}\n\n\t\tm[a[i]] = true\n\t}\n\n\treturn int64(len(r)), r\n}\n\nfunc main() {\n\tvar n int64\n\n\tfmt.Scanln(&n)\n\n\tvar a, _ = ScanN(n)\n\n\tvar r1, r2 = Process(a)\n\n\tfmt.Println(r1)\n\tPrintSlice(r2)\n}\n\nfunc ScanN(n int64) ([]int64, error) {\n\tin := make([]int64, n)\n\tfor i := range in {\n\t\t_, err := fmt.Scan(&in[i])\n\t\tif err != nil {\n\t\t\treturn in[:i], err\n\t\t}\n\t}\n\treturn in, nil\n}\n\nfunc PrintSlice(a []int64) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i == len(a)-1 {\n\t\t\tfmt.Print(a[i])\n\t\t} else {\n\t\t\tfmt.Print(a, \" \")\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "b4ca94ea725f85c05f27d239f4cd6c3b", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "e3ac4424b4d99712439ad8269430486a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9934138309549945, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tN := io.NextInt()\n\tA := io.NextIntArray(N)\n\t\n\tseen := make(map[int]bool)\n\tgood := make([]bool, N)\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif !seen[A[i]] {\n\t\t\tseen[A[i]] = true\n\t\t\tgood[i] = true\n\t\t}\n\t}\n\t\n\tfor i, v := range A {\n\t\tif good[i] {\n\t\t\tio.Printf(\"%d \", v)\n\t\t}\n\t}\n\tio.Println()\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}", "lang": "Go", "bug_code_uid": "82136428d96d73b44b1278cf9d67f2fa", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "2418c01b45780a55ef0acd36eaae556c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9226206524669722, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype edge struct {\n\tid int\n\tn1 *node\n\tn2 *node\n\tw int\n\tleft int\n}\n\ntype node struct {\n\tid int\n\tedges []*edge\n}\nvar edges []*edge\nvar nodes []*node\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tq := 1\n\t//fmt.Fscanf(in, \"%d\\n\", &q)\n\tfor ii := 0; ii < q; ii++ {\n\t\tn := 0\n\t\tfmt.Fscanf(in, \"%d\\n\", &n)\n\t\tf := make([][][]int, n+1) // f[i][j] filled in the first i elements, remaining j odd number\n\t\ta := make([]int, n+1)\n\t\tfor i := 1; i <= n; i++ {\n\t\t\tfmt.Fscanf(in, \"%d\", &a[i])\n\t\t}\n\t\tfmt.Fscanf(in, \"\\n\")\n\t\tfor i := 0; i < n + 1; i++ {\n\t\t\tf[i] = make([][]int, n+1)\n\t\t\tfor j := 0; j < n + 1; j++ {\n\t\t\t\tf[i][j] = make([]int, 2)\n\t\t\t\tf[i][j][0] = -1\n\t\t\t\tf[i][j][1] = -1\n\t\t\t}\n\t\t}\n\t\tif a[0] == 0 {\n\t\t\tf[1][(n+1)/2-1][1] = 0\n\t\t\tif n > 1 {\n\t\t\t\tf[1][n/2-1][0] = 0\n\t\t\t}\n\t\t}\n\t\tfor i := 2; i <= n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tf[i][j][0] = min(f[i-1][j][0], f[i-1][j][1] + 1)\n\t\t\t\t\tf[i][j][1] = min(f[i-1][j+1][0] + 1, f[i-1][j+1][1])\n\t\t\t\t} else if a[i] % 2 == 0 {\n\t\t\t\t\tf[i][j][0] = min(f[i-1][j][0], f[i-1][j][1] + 1)\n\t\t\t\t} else {\n\t\t\t\t\tf[i][j][1] = min(f[i-1][j+1][0]+1, f[i-1][j+1][1])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintf(out, \"%d\\n\", min(f[n][0][0], f[n][0][1]))\n\t}\n\treturn\n}\n\nfunc min(a, b int) int {\n\tif a == -1 {\n\t\treturn b\n\t}\n\tif b == -1 {\n\t\treturn a\n\t}\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solve(e *edge, from *node) int {\n\tn1 := e.n1\n\tn2 := e.n2\n\tcur := 0\n\tif n1 != from {\n\t\tcur += solveNode(n1, e)\n\t\te.left = cur\n\t}\n\tif n2 != from {\n\t\tcur += solveNode(n2, e)\n\t\te.left = cur\n\t}\n\treturn e.left\n}\n\nfunc solveNode(n *node, from *edge) int {\n\tif len(n.edges) == 1 && n.edges[0] == from{\n\t\treturn 1\n\t}\n\tcur := 1\n\tfor _, e := range n.edges {\n\t\tif e != from {\n\t\t\tcur += solve(e, n)\n\t\t}\n\t}\n\treturn cur\n}", "lang": "Go", "bug_code_uid": "38d90254997d744526f14a03b7da27cd", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "cc6eda35062ddac798e01d2dc40627cc", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9200325291406886, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype edge struct {\n\tid int\n\tn1 *node\n\tn2 *node\n\tw int\n\tleft int\n}\n\ntype node struct {\n\tid int\n\tedges []*edge\n}\nvar edges []*edge\nvar nodes []*node\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tq := 1\n\t//fmt.Fscanf(in, \"%d\\n\", &q)\n\tfor ii := 0; ii < q; ii++ {\n\t\tn := 0\n\t\tfmt.Fscanf(in, \"%d\\n\", &n)\n\t\tf := make([][][]int, n+1) // f[i][j] filled in the first i elements, remaining j odd number\n\t\ta := make([]int, n+1)\n\t\tfor i := 1; i <= n; i++ {\n\t\t\tfmt.Fscanf(in, \"%d\", &a[i])\n\t\t}\n\t\tfmt.Fscanf(in, \"\\n\")\n\t\tfor i := 0; i < n + 1; i++ {\n\t\t\tf[i] = make([][]int, n+1)\n\t\t\tfor j := 0; j < n + 1; j++ {\n\t\t\t\tf[i][j] = make([]int, 2)\n\t\t\t\tf[i][j][0] = -1\n\t\t\t\tf[i][j][1] = -1\n\t\t\t}\n\t\t}\n\t\tif a[0] == 0 {\n\t\t\tf[1][(n+1)/2-1][1] = 0\n\t\t\tf[1][n/2-1][0] = 0\n\t\t}\n\t\tfor i := 2; i <= n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tf[i][j][0] = min(f[i-1][j][0], f[i-1][j][1] + 1)\n\t\t\t\t\tf[i][j][1] = min(f[i-1][j+1][0] + 1, f[i-1][j+1][1])\n\t\t\t\t} else if a[i] % 2 == 0 {\n\t\t\t\t\tf[i][j][0] = min(f[i-1][j][0], f[i-1][j][1] + 1)\n\t\t\t\t} else {\n\t\t\t\t\tf[i][j][1] = min(f[i-1][j+1][0]+1, f[i-1][j+1][1])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintf(out, \"%d\\n\", min(f[n][0][0], f[n][0][1]))\n\t}\n\treturn\n}\n\nfunc min(a, b int) int {\n\tif a == -1 {\n\t\treturn b\n\t}\n\tif b == -1 {\n\t\treturn a\n\t}\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solve(e *edge, from *node) int {\n\tn1 := e.n1\n\tn2 := e.n2\n\tcur := 0\n\tif n1 != from {\n\t\tcur += solveNode(n1, e)\n\t\te.left = cur\n\t}\n\tif n2 != from {\n\t\tcur += solveNode(n2, e)\n\t\te.left = cur\n\t}\n\treturn e.left\n}\n\nfunc solveNode(n *node, from *edge) int {\n\tif len(n.edges) == 1 && n.edges[0] == from{\n\t\treturn 1\n\t}\n\tcur := 1\n\tfor _, e := range n.edges {\n\t\tif e != from {\n\t\t\tcur += solve(e, n)\n\t\t}\n\t}\n\treturn cur\n}", "lang": "Go", "bug_code_uid": "45bd1abb8422852ac91d6a8a1076da84", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "cc6eda35062ddac798e01d2dc40627cc", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9926854754440961, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc change(first bool, digit string) string {\n\tn, _ := strconv.Atoi(digit)\n\tif n <= 4 {\n\t\treturn digit\n\t}\n\tif first && n == 9 {\n\t\treturn digit\n\t}\n\tn = 9 - n\n\treturn strconv.Itoa(n)\n}\n\nfunc main() {\n digits := \"\"\n ans := \"\"\n fmt.Scanf(\"%s\\n\", &digits)\n if (len(digits) == 1) {\n \tfmt.Println(change(false, digits))\n \treturn\n }\n for i := 0; i < len(digits); i ++ {\n \tans += change(i == 0, digits[i:i+1])\n }\n fmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "32be11f3d669f0112a5abcdc139f9717", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "ca21b37259075000f0087b6b401b03ac", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8874388254486134, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\ts.Scan()\n\ta := s.Text()\n\tvar c int\n\tfor i:=0; i\nimport \"fmt\"\nimport \"io\"\nimport \"os\"\nimport \"strings\"\nimport \"text/scanner\"\n// @snippet \ntype Int int64\ntype IntSlice []Int\n// @snippet \nvar sc scanner.Scanner\n\nfunc ReadInt(n *Int) bool {\n tok := sc.Scan()\n if tok != scanner.EOF {\n fmt.Sscan(sc.TokenText(), &n)\n return true\n } else {\n return false\n }\n}\n\nfunc ReadString(s *string) bool {\n tok := sc.Scan()\n if tok != scanner.EOF {\n *s = sc.TokenText()\n return true\n } else {\n return false\n }\n}\n// @snippet \nfunc Stdin() io.Reader {\n return os.Stdin\n}\n\nfunc Strin(s string) io.Reader {\n return strings.NewReader(s)\n}\n// @snippet \n\nfunc min(a rune, b rune) rune {\n if a < b {\n return a\n } else {\n return b\n }\n}\n\nfunc findMin(s string) string {\n res := \"\"\n for _, c := range s {\n res += string(min(c, '9' - c + '0'))\n }\n return res\n}\n\nfunc main() {\n sc.Init(Stdin())\n var s string\n for ReadString(&s) {\n fmt.Println(findMin(s))\n }\n}\n\n", "lang": "Go", "bug_code_uid": "076af46d20afa2103d01bf08c77154a2", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "c145d204c4a11d70f3d56a96bf229cdd", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8831168831168831, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc minInvert(t int) int {\n\tinv := 9 - t\n\tif t < inv {\n\t\treturn t\n\t}\n\treturn inv\n}\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tfor _, r := range S {\n\t\tt := int(r - '0')\n\t\tfmt.Printf(\"%d\", minInvert(t))\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "cb2721addfd996712f0c847952178bbd", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "5615e93fa0c336a90586386482b53307", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.18930041152263374, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d, cnt, index int\n\tvar st, st1 string\n\tfmt.Scanln(&d)\n\n\tfor d > 0 {\n\t\tfmt.Scanln(&st)\n\t\tfmt.Scanln(&st1)\n\t\ta := make([]rune, 0)\n\t\tb := make([]rune, 0)\n\n\t\tfor _, y := range st {\n\t\t\ta = append(a, y)\n\t\t}\n\t\tif len(st) > len(st1) {\n\t\t\tcnt = 5\n\t\t}\n\n\t\tfor _, y := range st1 {\n\t\t\tif len(b) > len(a) {\n\t\t\t\tcnt = 5\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif (index <= len(a)-1) && (a[index] == y) {\n\t\t\t\tb = append(b, y)\n\t\t\t\tindex++\n\t\t\t\tcontinue\n\t\t\t} else if (len(b) > 1) && (y == b[len(b)-1]) {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tcnt = 5\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif cnt == 5 {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tfmt.Println(\"YES\")\n\t\t}\n\t\tcnt = 0\n\t\tindex = 0\n\n\t\td--\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8cf7abb779ba49d049b853b68bba73a2", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "apr_id": "fcae9151bd243d2cbdf2159dc6c35126", "difficulty": 1200, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7696447793326158, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc init() {\n\tscanner = bufio.NewScanner(bufio.NewReader(os.Stdin))\n\t//scanner.Buffer(make([]byte, 311000), 311000)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tnum, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc main() {\n\tN := nextInt()\n\tdata := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tdata[i] = nextInt()\n\t}\n\n\tdel := 0\n\tstart := 0\n\tfor cur := 0; cur < N; cur++ {\n\t\tif cur+1 == N || data[cur]+1 != data[cur+1] {\n\t\t\trem := cur - start - 1\n\t\t\tif cur+1 < N {\n\t\t\t\trem--\n\t\t\t}\n\t\t\tif rem > 0 {\n\t\t\t\tdel += rem\n\t\t\t}\n\t\t\tstart = cur\n\t\t}\n\t}\n\tif len(data) > 1 {\n\t\tif data[0] == 1 && data[1] == 2 {\n\t\t\tdel += 1\n\t\t}\n\t\tif data[len(data)-1] == 1000 && data[len(data)-2] == 999 {\n\t\t\tdel += 1\n\t\t}\n\t}\n\tfmt.Println(del)\n}\n", "lang": "Go", "bug_code_uid": "724fe79d4263f724c352f9882febe2cf", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "bbcebaacbb36d669723c90bf348fc9e3", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8180318856514568, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "// Group the consecutive elements\n// When a group start with 1 or end with 1000, it can contribute \"length - 1\" items.\n// \"length - 2\" otherwise.\npackage 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\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\tg, cur := [][]int{[]int{-1}}, 0\n\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\tnum, _ := strconv.Atoi(scanner.Text())\n\t\tif g[cur][len(g[cur])-1] == num-1 {\n\t\t\tg[cur] = append(g[cur], num)\n\t\t} else {\n\t\t\tg = append(g, []int{num})\n\t\t\tcur++\n\t\t}\n\t}\n\n\tsum := 0\n\tfor _, v := range g {\n\t\tif len(v) < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tif (v[0] == 1) || (v[len(v)-1] == 1000) {\n\t\t\tsum += len(v) - 1\n\t\t} else {\n\t\t\tsum += len(v) - 2\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "lang": "Go", "bug_code_uid": "e56bb13fe045c18b62c60a9eb9d02c30", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "2c7a0ff63099efabb3a43d83270bd023", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9593561368209256, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc fastGetInt(b []byte) int64 {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tn = 0\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\n//========== Implement Algorithm =======================\nfunc solution(x int64) int64 {\n\tvar temp int64\n\ttemp = 1\n\tvar count int64\n\tcount = 0\n\tfor temp < x/2 {\n\t\ttemp = temp * 2\n\t\tcount++\n\t}\n\tif temp*2 == x {\n\t\treturn 0\n\t}\n\tif temp%2 == 1 {\n\t\tcount++\n\t}\n\treturn count\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar x, ret int64\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tx = fastGetInt(scanner.Bytes())\n\n\t//======================================================\n\tret = solution(x)\n\t//==================== OUTPUT ==========================\n\n\tfmt.Print(ret + 1)\n}\n", "lang": "Go", "bug_code_uid": "165a44002937f70e6eb9381b53ef4e6b", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "b6fe0706f31432c714c97e0d85851c57", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.984869325997249, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d \\n\", &n)\n\tfmt.Println(findMinBacteries(float64(n)))\n}\n\nfunc findMinBacteries(n float64) int {\n\tc := 0\n\tfor p := 0; n > 0; p++ {\n\t\ts := math.Pow(2, float64(p))\n\t\tif s > n {\n\t\t\tn -= math.Pow(2, float64(p-1))\n\t\t\tp = 0\n\t\t\tc++\n\t\t} else if s == n {\n\t\t\tn = 0\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}", "lang": "Go", "bug_code_uid": "abea5c71fb68dd1355ba26bf2a33e84d", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "dd4d633c7a98243374cedaf535003f62", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9174311926605505, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var (\n n int\n m int\n )\n fmt.Scan(&n)\n fmt.Scan(&m)\n\n a := m - 1\n if a < n - m {\n a = m + 1\n }\n fmt.Println(a)\n}\n", "lang": "Go", "bug_code_uid": "ed90b0a686b7a479826098df72199e58", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "cc4b43a7edeef495511fdda7775d81c4", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9811029695333591, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar N, M int\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN, M = fsc.NextInt(), fsc.NextInt()\n\tvar left, right int\n\tleft = M - 1\n\tright = N - M\n\tfmt.Println(left, right)\n\tif right > left {\n\t\tfmt.Println(M + 1)\n\t} else if right <= left {\n\t\tfmt.Println(M - 1)\n\t}\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) 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 *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) 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", "lang": "Go", "bug_code_uid": "5103b5196d591ecd7e1584512f37a38e", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "b57ff65b19972bbd18ec6676a88a6189", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9587155963302753, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main \n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n,m int;\n\t_,_ = fmt.Scanf(\"%d %d\",&n,&m)\n\tvar u = n-m;\n\tvar l = m-1;\n\tif n == m{\n\t\tfmt.Println(m)\n\t}else if(u > l){\n\t\tfmt.Println(m+1)\n\t}else{\n\t\tfmt.Println(m-1)\n\t}\n}", "lang": "Go", "bug_code_uid": "3c92909e9a1dbb29b671ef2cc63ba4f4", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "b63a58ace9f0cea3d34b94bd0b27bb21", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.954337899543379, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main \n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n,m int;\n\t_,_ = fmt.Scanf(\"%d %d\",&n,&m)\n\tvar u = n-m;\n\tvar l = m-1;\n\tif n == m{\n\t\tfmt.Println(m)\n\t}\n\telse if(u > l){\n\t\tfmt.Println(m+1)\n\t}else{\n\t\tfmt.Println(m-1)\n\t}\n}", "lang": "Go", "bug_code_uid": "6bb6a19aa7e1b3e8bce28c15029ed487", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "b63a58ace9f0cea3d34b94bd0b27bb21", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.42593957258658804, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main(){\n\tvar bfuck string\n\tfmt.Scan(&bfuck)\n\tvar size string\n\tfor i:=0; i\" {\n\t\t\tsize += \"1000\"\n\t\t}\n\t\tif string(bfuck[i]) == \"<\" {\n\t\t\tsize += \"1001\"\n\t\t}\n\t\tif string(bfuck[i]) == \"+\" {\n\t\t\tsize += \"1010\"\n\t\t}\n\t\tif string(bfuck[i]) == \"-\" {\n\t\t\tsize += \"1011\"\n\t\t}\n\t\tif string(bfuck[i]) == \".\" {\n\t\t\tsize += \"1100\"\n\t\t}\n\t\tif string(bfuck[i]) == \",\" {\n\t\t\tsize += \"1101\"\n\t\t}\n\t\tif string(bfuck[i]) == \"[\" {\n\t\t\tsize += \"1110\"\n\t\t}\n\t\tif string(bfuck[i]) == \"]\" {\n\t\t\tsize += \"1111\"\n\t\t}\n\t}\n\tvar hasil int64\n\thasil, _ = strconv.ParseInt(size, 2, 64)\n\thasil = hasil % 1000003\n\tfmt.Println(hasil)\n}\n", "lang": "Go", "bug_code_uid": "517090058f2caf5e96f6132aadf4d519", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "e998556b8096b7dfd2c19f8cf110133a", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3865877712031558, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n fmt.Scanf(\"%d\", &n)\n r := int64(0)\n for i := 2; i < n/2; i+=2 {\n r += 1 \n }\n fmt.Println(r)\n}\n", "lang": "Go", "bug_code_uid": "5248ea0d3a558b33f808dc643e54a743", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "fa1b1127cf8603ece7c22ce30e02151d", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9265905383360522, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(n int64) int64 {\n if n < 6 {\n return 0\n }\n if n == 6 {\n return 1 \n }\n if n%4 == 0 {\n return n/4 - 1\n }\n return n/4\n}\n\nfunc main() {\n var n int64\n fmt.Scanf(\"%d\", &n)\n fmt.Println(solve(n))\n}\n", "lang": "Go", "bug_code_uid": "d61fa2b7fcadba4b2ddaa106a6d33aea", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "fa1b1127cf8603ece7c22ce30e02151d", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9963503649635036, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nvar n float64\n\nfunc main() {\n fmt.Scanln(&n)\n if int(n)%2 == 0 {\n fmt.Println(0)\n return\n }\n ans := int(math.Ceil(((n / 2) / 2)))\n ans -= 1\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "b9fa90ae7836de7691ea6dc80b41febf", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "52e3dfbf4e58870a771455032ee8d905", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8783382789317508, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, o int\n\tfmt.Scanln(&n)\n\tif n%4 == 0 {\n\t\to = n/4 - 1\n\t} else {\n\t\to = n / 4\n\t}\n\tfmt.Println(o)\n}", "lang": "Go", "bug_code_uid": "2a41ae8b0147e775d3bd7f6eab08476e", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "8027440c2e7089280a8337bbc73a0b1b", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9908045977011494, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn, x, y, c := 0, 0, 0, int64(0)\n\tfmt.Scan(&n, &x, &y, &c)\n\tr,l,m:=n*2+1,-1,0\n\tfor r-l>1{\n\t\tm = int((int64(r)+int64(l))/2)\n\t\ttiles:=count(n,x,y,m)\n\t\tif (tiles0) {out+=(sq(h)+h)/2}\n\th=t-dist(x,y,n,-1)\n\tif (h>0) {out+=(sq(h)+h)/2}\n\th=t-dist(x,y,0,n+1)\n\tif (h>0) {out+=(sq(h)+h)/2}\n\th=t-dist(x,y,n,n+1)\n\tif (h>0) {out+=(sq(h)+h)/2}\n\treturn out\n}\n\nfunc sq(n int64) int64 {if (n<0) {return 0}else{return n*n}}\nfunc dist(x1,y1,x2,y2 int64) int64 {return abs(x1-x2)+abs(y1-y2)}\nfunc abs(n int64) int64 {if (n<0) {return -n}else{return n}}\n", "lang": "Go", "bug_code_uid": "8f4ec8e711855a7c5e00a34b21e06867", "src_uid": "232c5206ee7c1903556c3625e0b0efc6", "apr_id": "f76b5b70708d7bbc4cd626e197a05659", "difficulty": 1800, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9968186638388123, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar a []int\n\tvar flag int = 0\n\tvar ok bool = true\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tswitch {\n\t\tcase a[i-1] < a[i] && flag > 0:\n\t\t\tok = false\n\t\tcase a[i-1] == a[i] && flag == 0:\n\t\t\tflag = 1\n\t\tcase a[i-1] == a[i] && flag > 1:\n\t\t\tok = false\n\t\tcase a[i-1] > a[i] && flag < 2:\n\t\t\tflag = 2\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", "lang": "Go", "bug_code_uid": "73b2995afd0bab6b87734a0e3d7f9ee2", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "ad8b95cae7358e6f520682c5619066cc", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9662618083670715, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc check(nums []int) bool {\n\ti := 1\n\n\tfor ; i < len(nums); i++ {\n\t\tif nums[i] <= nums[i-1] {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// fmt.Println(\"Stop increasing \", i)\n\n\tfor ; i < len(nums); i++ {\n\t\tif nums[i] > nums[i-1] {\n\t\t\treturn false\n\t\t}\n\n\t\tif nums[i] < nums[i-1] {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// fmt.Println(\"Stop constant \", i)\n\n\tif i == 1 && len(nums) != 1 {\n\t\treturn false\n\t}\n\n\tfor ; i < len(nums); i++ {\n\t\tif nums[i] >= nums[i-1] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// fmt.Println(\"Stop decreasing \", i)\n\treturn i == len(nums)\n}\n\nfunc main() {\n\tvar t int\n\tfmt.Scanf(\"%d\\n\", &t)\n\n\tnums := make([]int, t)\n\n\tfor i := 0; i < t; i++ {\n\t\tfmt.Scanf(\"%d\", &nums[i])\n\t}\n\n\t// fmt.Println(nums)\n\tif check(nums) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "73350e9134fa0cebaa3fda698c0d5232", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "547a7e470789d1aaa8216c59dcdf9ef5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9991311902693311, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc Solve(input io.Reader) (result string) {\n\tvar n int\n\tfmt.Fscan(input, &n)\n\tn += 2\n\tarray := make([]int, n)\n\tfor i := 1; i < n-1; i++ {\n\t\tfmt.Fscan(input, &(array[i]))\n\t}\n\tindex := 1\n\tfor ; index < n; index++ {\n\t\tif array[index] <= array[index-1] {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor ; index < n; index++ {\n\t\tif array[index] != array[index-1] {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor ; index < n; index++ {\n\t\tif array[index] > array[index-1] {\n\t\t\tbreak\n\t\t}\n\t}\n\tif index < n {\n\t\treturn \"NO\\n\"\n\t}\n\treturn \"YES\\n\"\n}\n\nfunc main() {\n\tfmt.Print(Solve(os.Stdin))\n}\n", "lang": "Go", "bug_code_uid": "0ad64974c763a8f8899a6a78dbf7be6a", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "09495d24e0539c550858772cd12ef3da", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9971707010374096, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\ta := make([]int, n)\n\tfreq := make([]int, 101)\n\tstart := make([]int, 101)\n\tend := make([]int, 101)\n\tup := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t\tif freq[a[i]] == 0 {\n\t\t\tstart[a[i]] = i\n\t\t}\n\t\tfreq[a[i]]++\n\t\tend[a[i]] = i\n\t\tup = max(up, a[i])\n\t}\n\tindex := up\n\tfor i := 1; i <= start[index]; i++ {\n\t\tif a[i] <= a[i-1] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := start[index]; i <= end[index]; i++ {\n\t\tif a[i] != index {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := end[index] + 1; i < len(a); i++ {\n\t\tif a[i] >= a[i-1] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\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 int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang": "Go", "bug_code_uid": "b55f781012ba142b7b916435e3266db6", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "dbc64cfdb79410fcc6cfc5631f49f5a0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9856733524355301, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n if (n/k) & 2 == 0 {\n fmt.Print(\"NO\")\n } else {\n fmt.Print(\"YES\")\n }\n}", "lang": "Go", "bug_code_uid": "6d1969ecd273a2f6b8430a3e35cfb581", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "a639d107005825f215192de77461acc2", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9743589743589743, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scanf(\"%ld %ld\", &n, &k)\n\tret := false\n\n\tif k == n {\n\t\tret = true\n\t} else {\n\t\tdiv := n / k\n\n\t\tif div%2 == 0 {\n\t\t\tret = false\n\t\t} else {\n\t\t\tret = true\n\t\t}\n\t}\n\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ef593a41365d41e08a595d7b29addbb2", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "0e72aa24763b80466ecff950ab9371be", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9375, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math/big\"\n\nfunc main() {\n\tvar ns, ks string\n\tn, k := new(big.Int), new(big.Int)\n\tfmt.Scanf(\"%s %s\", &ns, &ks)\n\tfmt.Sscan(ns, n)\n\tfmt.Sscan(ks, k)\n\tr := new(big.Int).Div(n, k)\n\n\tif r.Mod(r, big.NewInt(2)) == big.NewInt(0) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\t// fmt.Printf(\"n: %d, k: %d, r: %d\\n\", n, k, r)\n}\n", "lang": "Go", "bug_code_uid": "7b578e4343f71a7115917fa11fff4f15", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "bd14894df4c0e96016a1f671c3dc109e", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9578231292517007, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tvar s string\n\tfmt.Scan(&s)\n\tans := 0\n\tjust_max := 0\n\tfor i := 0; i + k - 1 < n; i++ {\n\t was := 0\n\t for j := i; j < i + k; j++ {\n\t if s[j] == 'Y' {\n\t was = 1\n\t }\n\t }\n\t if was == 0 {\n\t if i + k >= n || s[i + k] != 'N' {\n\t ans = 1\n\t }\n\t }\n\t}\n\tif ans == 0 {\n\t fmt.Println(\"NO\")\n\t} else {\n\t for i := 0; i < n; i++ {\n\t cur := 0\n\t for j := i; j < n; j++ {\n\t if s[j] == 'N' {\n\t cur++\n\t if just_max < cur {\n\t just_max = cur\n\t }\n\t } else {\n\t cur = 0\n\t }\n\t }\n\t }\n\t if just_max > k {\n\t fmt.Println(\"NO\")\n\t } else {\n\t fmt.Println(\"YES\")\n\t }\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8e524e354273fe37f58ad77b57e9fe33", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "39a847d2cd846516226cf4c8010b0c68", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.24615384615384617, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var pos [2]int\n Loop:\n for j := 1; j <= 5; j++ {\n var l string\n fmt.Scanf(\"%d\", &l)\n ss := strings.Split(l, \" \")\n for i, s := range ss {\n if s == \"1\" {\n pos[0] = i+1\n pos[1] = j\n beak Loop\n }\n }\n }\n}", "lang": "Go", "bug_code_uid": "2bdc8d2af608ac4aede93713c428a6db", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "61c14e6d2aa9f168df2176047064173e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6521739130434783, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "import (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc p263a(in io.Reader) int {\n\tabs := func(x int) int {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tn := 5\n\ti, j := 0, 0\n\tfor {\n\t\tv := 0\n\t\tfmt.Fscanf(in, \"%d\", &v)\n\t\tif v == 1 {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\t// manhatten distance\n\ti, j = i/n, i%n\n\tif j == 0 {\n\t\tj = 5\n\t}\n\tx, y := abs(i-3), abs(j-3)\n\treturn x + y\n}\n\nfunc main() {\n\tfmt.Println(p263a(os.Stdin))\n}\n", "lang": "Go", "bug_code_uid": "2687f045dd9c137a396e5e2e6e6982b1", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "12be22d917bf6f0e82b1a6081e896b01", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tfor i := 0; i < 8; i++ {\n\t\t\n\t\tvar line string\n\t\tfmt.Scanln(&line)\n\t\t\n\t\tfirst := line[0]\n\t\tfor j := 1; j < 8; j += 2 {\n\t\t\tif line[j] == first {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfmt.Println(\"YES\")\n}\n", "lang": "Go", "bug_code_uid": "bf8466cf2a15afa7b97f54c4120cc0cf", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "e9d6e6efdc8a41fcadafe4e223f0c7a6", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8735806207418623, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc isVowel(c byte) bool {\n if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var s string\n fmt.Scanf(\"%s\", &s)\n succ := true\n for i, c := range []byte(s) {\n cur := true\n if !isVowel(c) {\n if c == 'n' {\n cur = (i == len(s) - 1) || isVowel(s[i+1])\n } else {\n cur = (i < len(s) - 1) && isVowel(s[i+1])\n }\n }\n if !cur {\n succ = false \n }\n }\n if succ {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n\n", "lang": "Go", "bug_code_uid": "65a0aa86657df6c02768832f2f9ff23c", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "864d48df283f4125ca5f85fb7aa2f50c", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9542342342342343, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tif len(word) > 1 {\n\t\tfor i := 0; i < len(word)-1; i++ {\n\t\t\tif isBerlanese == false {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tletter := rune(word[i])\n\t\t\tnextLetter := rune(word[i+1])\n\t\t\tif letter == 'n' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t_, isVowel := vowels[letter]\n\t\t\tif isVowel == true {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\t\tif nextIsVowel == false {\n\t\t\t\t\tisBerlanese = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tletter := rune(word[0])\n\t\tif letter == 'n' {\n\t\t\tisBerlanese = true\n\t\t} else if _, V := vowels[letter]; V == true {\n\t\t\tisBerlanese = true\n\t\t} else {\n\t\t\tisBerlanese = false\n\t\t}\n\t}\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "bff47c8909cd272d250ad024f56dec0c", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "db5a8c6790b8d6be033c7e604a845629", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.993010146561443, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tS := sc.NextLine()\n\n\tflag := false\n\tfor i := 0; i < len(S); i++ {\n\t\tswitch S[i] {\n\t\tcase 'a', 'i', 'u', 'e', 'o', 'n':\n\t\t\tflag = false\n\t\tdefault:\n\t\t\tif flag {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\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) 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", "lang": "Go", "bug_code_uid": "cd7b10614e245708e38ea84d375d84d2", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "fedde66cc3c878b6d8e02f9204489419", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9922212618841832, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\t\nfunc main() {\n var s string\n\tfmt.Scan(&s)\n\tt := true\n\tflag := false\n\tfor i,a := range(s){\n\t f := true\n\t for _,b := range([]rune{'a','o','u','i','e'}) {\n \t if a == b { f = false }\n \t}\n\t if flag && f {\n\t t = false\n\t break\n\t } else if flag && !f {\n\t flag = false \n\t } else if !flag && f && a != 'n'{\n\t flag = true\n\t } else if f && i == len(s)-1 && a != 'n' {\n\t t = false\n\t break\n\t }\n\t \n\t}\n\tif t {\n\t fmt.Println(\"YES\")\n\t} else {\n\t fmt.Println(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "51f84809331649f41bffe6df0599976d", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "cb0bb1e27e5f88bc180f4204bf71ccf1", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9791976225854383, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1024*1024)\n\nfunc Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tbTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tb := int64(bTemp)\n\tgTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tg := int64(gTemp)\n\tif g < min {\n\t\tmin = g\n\t}\n\tnTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tn := int64(nTemp)\n\tmin := Min(n, g)\n\tminBoys = n - min\n\tmaxBoys := Min(n, b)\n\tfmt.Print(maxBoys - minBoys + 1)\n}\n\nfunc readLine() string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n", "lang": "Go", "bug_code_uid": "9f684dc758cad801503b8877f72b5460", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "22d08cc550db09ab622b2cd89095aff5", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8207171314741036, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1024*1024)\n\nfunc main() {\n\tbTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tmin := int64(bTemp)\n\tgTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tg := int64(gTemp)\n\tif g < min {\n\t\tmin = g\n\t}\n\tnTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tn := int64(nTemp)\n\tif min >= n {\n\t\tfmt.Print(n + 1)\n\t} else {\n\t\tfmt.Print(min + 1)\n\t}\n}\n\nfunc readLine() string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n", "lang": "Go", "bug_code_uid": "329da60e06f4d8612976179afe594a65", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "22d08cc550db09ab622b2cd89095aff5", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6892655367231638, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scan(&a, &b, &n)\n\tans := a\n\tif b < ans {\n\t\tans = b\n\t}\n\tif n < ans {\n\t\tans = n\n\t}\n\tfmt.Println(ans + 1)\n}\n", "lang": "Go", "bug_code_uid": "052cb836fc4dc527359eaed0df90b419", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "1b2499786b60da7aab5493f1ae379220", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8592220828105396, "equal_cnt": 24, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 8, "fix_ops_cnt": 23, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n n := readInt()\n init := [2]int{}\n a, c := make([][2]int, n), make([]int, n)\n for i := 0; i < n; i++ {\n ch := readString()\n if ch == \"B\" {\n c[i] = 1\n }\n for j := range a[i] {\n v := readInt()\n if v > n {\n init[j] += v-n\n v = n\n }\n a[i][j] = v\n }\n }\n\n const inf = 100000000\n const mx = 1<<16\n mem := [mx][2][16*16+1]int{}\n was := [mx]bool{}\n for i, v := range mem {\n for col, u := range v {\n for j := range u {\n mem[i][col][j] = inf\n }\n }\n }\n mem[0][0][0] = 0\n\n ans := inf\n d := [mx][2]int{}\n q := []int{0}\n was[0] = true\n for len(q) > 0 {\n cur := q[0]\n curD := d[cur]\n //fmt.Println(\"BFS\", cur, curD)\n for col, u := range mem[cur] {\n for cnt, val := range u {\n if cur == (1< 0 {\n nextCol = 1\n }\n if nextVal < len(u) {\n mem[next][nextCol][nextVal] = min(mem[next][nextCol][nextVal], val+steps+1)\n //fmt.Println(\" Updated\", next, nextCol, nextVal, \"->\", mem[next][nextCol][nextVal])\n }\n\n if !was[next] {\n was[next] = true\n\n nextD := curD\n nextD[c[bit]]++\n d[next] = nextD\n\n q = append(q, next)\n }\n }\n }\n }\n }\n q = q[1:]\n }\n\n ans += max(init[0], init[1])\n fmt.Println(ans)\n}\n\n\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/\n", "lang": "Go", "bug_code_uid": "41f37dc9b45ff53f38c5ecae3830baeb", "src_uid": "25a77f2b7cb281ff3c7800a20b3e5969", "apr_id": "8cbf988174d64dca3b1ea2aa29d17063", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9686781956705769, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n n := readInt()\n init := [2]int{}\n a, c := make([][2]int, n), make([]int, n)\n for i := 0; i < n; i++ {\n ch := readString()\n if ch == \"B\" {\n c[i] = 1\n }\n for j := range a[i] {\n v := readInt()\n if v > n {\n init[j] += v-n\n v = n\n }\n a[i][j] = v\n }\n }\n\n const inf = 100000000\n const mx = 1<<16\n const sz = 16*16+1\n mem := [mx][2][sz]int{}\n was := [mx]bool{}\n for i := range mem {\n for col := range mem[0] {\n diff := max(init[col]-init[1-col], 0)\n for j := range mem[i][col] {\n val := inf\n if i == 0 && j <= diff {\n val = 0\n }\n mem[i][col][j] = val\n }\n }\n }\n\n ans := inf\n d := [mx][2]int{}\n q := make([]int, 1, 1<<16)\n q[0] = 0\n un := uint(n)\n was[0] = true\n for curI := 0; curI < len(q); curI++ {\n cur := q[curI]\n curD := d[cur]\n //fmt.Println(\"BFS\", cur, curD)\n for col, u := range mem[cur] {\n for cnt, val := range u {\n if cur == (1<= inf {\n continue\n }\n \n r, b := 0, 0\n if col == 0 {\n r = cnt\n } else {\n b = cnt\n }\n\n for bit := uint(0); bit < un; bit++ {\n mask := 1 << bit\n if cur & mask == 0 {\n next := cur | mask\n priceR, priceB := max(a[bit][0]-curD[0], 0), max(a[bit][1]-curD[1], 0)\n //fmt.Println(\" Price\", priceR, priceB, val)\n steps := max(priceR-r, priceB-b)\n nextR, nextB := r+steps-priceR, b+steps-priceB\n nextCol, nextVal := 0, nextR+nextB\n if nextB > 0 {\n nextCol = 1\n }\n if nextVal < sz {\n mem[next][nextCol][nextVal] = min(mem[next][nextCol][nextVal], val+steps+1)\n //fmt.Println(\" Updated\", next, nextCol, nextVal, \"->\", mem[next][nextCol][nextVal])\n }\n\n if !was[next] {\n was[next] = true\n\n nextD := curD\n nextD[c[bit]]++\n d[next] = nextD\n\n q = append(q, next)\n }\n }\n }\n }\n }\n }\n\n ans += max(init[0], init[1])\n fmt.Println(ans)\n}\n\n\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/\n", "lang": "Go", "bug_code_uid": "1563d26bf60a5eb09fd38c8fe5f6c02a", "src_uid": "25a77f2b7cb281ff3c7800a20b3e5969", "apr_id": "8cbf988174d64dca3b1ea2aa29d17063", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9650501874470916, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n n := readInt()\n init := [2]int{}\n a, c := make([][2]int, n), make([]int, n)\n for i := 0; i < n; i++ {\n ch := readString()\n if ch == \"B\" {\n c[i] = 1\n }\n for j := range a[i] {\n v := readInt()\n if v > n {\n init[j] += v-n\n v = n\n }\n a[i][j] = v\n }\n }\n\n const inf = 1000000\n const mx = 1<<16\n const sz = 16*16+1\n mem := [mx][2][sz]int{}\n was := [mx]bool{}\n for i := range mem {\n for col := range mem[0] {\n //diff := max(init[col]-init[1-col], 0)\n for j := range mem[i][col] {\n val := inf\n if i == 0 && init[col] >= j {\n val = 0\n }\n mem[i][col][j] = val\n }\n }\n }\n\n ans := inf\n d := [mx][2]int{}\n q := make([]int, 1, 1<<16)\n q[0] = 0\n un := uint(n)\n was[0] = true\n for curI := 0; curI < len(q); curI++ {\n cur := q[curI]\n curD := d[cur]\n //fmt.Println(\"BFS\", cur, curD)\n for col, u := range mem[cur] {\n for cnt, val := range u {\n if cur == (1<= inf {\n continue\n }\n \n r, b := 0, 0\n if col == 0 {\n r = cnt\n } else {\n b = cnt\n }\n\n for bit := uint(0); bit < un; bit++ {\n mask := 1 << bit\n if cur & mask == 0 {\n next := cur | mask\n priceR, priceB := max(a[bit][0]-curD[0], 0), max(a[bit][1]-curD[1], 0)\n //fmt.Println(\" Price\", priceR, priceB, val)\n steps := max(priceR-r, priceB-b)\n nextR, nextB := r+steps-priceR, b+steps-priceB\n nextCol, nextVal := 0, nextR+nextB\n if nextB > 0 {\n nextCol = 1\n }\n if nextVal < sz {\n mem[next][nextCol][nextVal] = min(mem[next][nextCol][nextVal], val+steps+1)\n //fmt.Println(\" Updated\", next, nextCol, nextVal, \"->\", mem[next][nextCol][nextVal])\n }\n\n if !was[next] {\n was[next] = true\n\n nextD := curD\n nextD[c[bit]]++\n d[next] = nextD\n\n q = append(q, next)\n }\n }\n }\n }\n }\n }\n\n ans += max(init[0], init[1])\n fmt.Println(ans)\n}\n\n\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/\n", "lang": "Go", "bug_code_uid": "e1d6e3390705ec73bf75da4aa15613ae", "src_uid": "25a77f2b7cb281ff3c7800a20b3e5969", "apr_id": "8cbf988174d64dca3b1ea2aa29d17063", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9702127659574468, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n var howmanya = strings.Count(s, \"a\")\n\tvar long = len(s)\n\tif 2*howmanya > long {\n\t\tfmt.Print(long)\n\t}\n else {\n\t\tfmt.Print(howmanya * 2 - 1)\n\t}\n}", "lang": "Go", "bug_code_uid": "022d2594d94a1bb4cdb3ecf3b99564ef", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "51ddd185ac75f43e5166c8743c6752f1", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9989094874591058, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a,b int) int {\n\tif(a < b){\n\t\treturn a\n\t\t}\n\treturn b\n}\nfunc katta(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}\n\treturn a\n}\nfunc ab(x int) int {\n\tif(x <= -1){\n\t\tx *= -1\n\t}\n\treturn x\n}\n\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tcnt := 0\n\tfor i := 0 ; i < len(s) ; i++{\n\t\tif(string(s[i]) == string(\"a\")){\n\t\t\tcnt++\n\t\t}\n\t}\n\tuzun := len(s) - cnt\n\tif(uzun > cnt){\n\t\tfmt.Println(cnt + cnt - 1)\n\t}else{\n\t\tfmt.Println(len(s))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "2ab4bdc047384f061ab905c164d6ce90", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "06f5fc1e4b128446bf0650e3ffc8b40a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9715189873417721, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\n\tvar s string\n\tfmt.Fscanf(in, \"%s\\n\", &s)\n\tfmt.Println(loveA(s))\n}\n\nfunc loveA(s string) int {\n\tlenS := len(s)\n\tlenA := strings.Count(s, \"a\")\n\n\tif lenA > lenS/2 {\n\t\treturn lenS\n\t}\n\n\treturn lenA + 1\n}\n", "lang": "Go", "bug_code_uid": "979f6ef415dfcff6a273647a77d1f03c", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "58a02d8e2c4ab061c5d6469f8b3f124e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8114126652748782, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/bits\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc init() {\n\tscanner = bufio.NewScanner(bufio.NewReader(os.Stdin))\n\t//scanner.Buffer(make([]byte, 311000), 311000)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tnum, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc genPrimes() []int {\n\tprimes := make([]int, 0, 170)\n\tvar isDivisible [1001]bool\n\tfor i := 2; i <= 1000; i++ {\n\t\tif !isDivisible[i] {\n\t\t\tprimes = append(primes, i)\n\t\t\tfor j := i + i; j <= 1000; j += i {\n\t\t\t\tisDivisible[j] = true\n\t\t\t}\n\t\t}\n\t}\n\treturn primes\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\tN := nextInt()\n\tif N == 1 {\n\t\tfmt.Println(\"1 0\")\n\t\treturn\n\t}\n\tprimes := genPrimes()\n\n\tprimeFactors := make(map[int]int)\n\tfor _, p := range primes {\n\t\tfor N%p == 0 {\n\t\t\tN /= p\n\t\t\tprimeFactors[p]++\n\t\t}\n\t\tif N == 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif N != 1 {\n\t\tprimeFactors[N]++\n\t}\n\n\tmaxExp := 0\n\tfor _, exp := range primeFactors {\n\t\tif exp > maxExp {\n\t\t\tmaxExp = exp\n\t\t}\n\t}\n\n\tpow := 1\n\tnumSqrts := 0\n\tmuls := 0\n\n\tbitlen := bits.Len(uint(maxExp))\n\tif bitlen < maxExp {\n\t\tbitlen++\n\t}\n\tnumSqrts = bitlen - 1\n\tpow = 1 << uint(bitlen-1)\n\n\tvar base int64 = 1\n\tfor p, exp := range primeFactors {\n\t\tbase *= int64(p)\n\t\tif exp < pow {\n\t\t\tmuls = 1\n\t\t}\n\t}\n\n\tfmt.Println(base, muls+numSqrts)\n}\n", "lang": "Go", "bug_code_uid": "528fae9c6952155cd2c28a8c0d411efa", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "3d364a66d0052edcee2212d307ae4af6", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9892359804290554, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1062/B\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\tn int\n)\n\nfunc main() {\n\tn = ReadInt()\n\n\tif n == 1 {\n\t\tfmt.Println(1, 0)\n\t\treturn\n\t}\n\n\tmemo := TrialDivision(n)\n\tPrintfDebug(\"n: %v\\n\", memo)\n\n\tfin := 1\n\tfor k := range memo {\n\t\tfin *= k\n\t}\n\n\tM := make(map[int]int)\n\tS := make(map[int]int)\n\tfor k, v := range memo {\n\t\tmul := 0\n\t\tsqrt := 0\n\t\tfor v > 1 {\n\t\t\tif v%2 == 1 {\n\t\t\t\tv++\n\t\t\t\tmul++\n\t\t\t} else {\n\t\t\t\tv /= 2\n\t\t\t\tsqrt++\n\t\t\t}\n\t\t}\n\t\tM[k] = mul\n\t\tS[k] = sqrt\n\t}\n\n\tmaxSqrt := 0\n\tfor _, v := range S {\n\t\tChMax(&maxSqrt, v)\n\t}\n\t// ans := 0\n\t// for k, v := range S {\n\t// \tans += v\n\t// \tans += M[k]\n\n\t// \tans += 2 * (maxSqrt - v)\n\t// }\n\n\t// if maxSqrt > 0 {\n\t// \tfmt.Println(fin, maxSqrt+1)\n\t// } else {\n\t// \tfmt.Println(fin, 0)\n\t// }\n\n\tif maxSqrt == 0 {\n\t\tfmt.Println(fin, 0)\n\t\treturn\n\t}\n\n\t// すべてがmaxsqrtなら掛け算は一切不要\n\tfor _, v := range S {\n\t\tif v != maxSqrt {\n\t\t\tfmt.Println(fin, maxSqrt+1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(fin, maxSqrt)\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// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tvar i, exp int\n\tp := map[int]int{}\n\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tfor i = 2; i*i <= n; 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/*******************************************************************/\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", "lang": "Go", "bug_code_uid": "d1618e7005cfdb53263f0e37d4f3baf9", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "b3a2f6976258c2e75b9231e27a2445b1", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7905004240882103, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var n int\n fmt.Scan(&n)\n maxV := 1\n ansV := 1\n ansCnt := 0\n is := false\n for i := 2; i <= n; i++ {\n if n % i == 0 {\n ansV *= i\n cnt := 0;\n for n % i == 0 {\n n /= i\n cnt++\n }\n if maxV != 1 {\n is = true\n }\n if maxV < cnt {\n maxV = cnt\n }\n\n }\n }\n for maxV > 1 {\n if maxV % 2 == 1 {\n maxV++\n is = true\n }\n ansCnt++\n maxV /= 2\n }\n if is == true {\n ansCnt++\n }\n fmt.Println(ansV, ansCnt)\n}\n", "lang": "Go", "bug_code_uid": "fafa37cd841cbf61e8c36c203b97ad14", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "986d18117c480f9ee3904e3b4d8a0a8f", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9123945489941596, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc factor(mp map[int]int,n int) {\n\tfor i:=2 ; i*i <= n; i++ {\n\t\tfor n%i==0&&n>0 {\n\t\t\tn/=i\n\t\t\tmp[i]++\n\t\t}\n\t}\n\tif n>1 {\n\t\tmp[n]++\n\t}\n}\nfunc newRes(mp map[int]int) int{\n\tval:=1\n\tfor k,v := range mp {\n\t\t//fmt.Printf(\"k:%d,v:%d\\n\",k,v)\n\t\tfor cnt:=0;cnt<(v+1)/2;cnt++ {\n\t\t\tval*=k\n\t\t}\n\t}\n\treturn val\n}\n\nfunc main() {\n\tvar n int\n\t_,_=fmt.Scanln(&n)\n\tmp:=make(map[int]int)\n\tres,step:=n,0\n\tfor {\n\t\tfor k,_:= range mp {\n\t\t\tdelete(mp,k)\n\t\t}\n\t\tfactor(mp,res)\n\t\tret:=newRes(mp)\n\t\t//fmt.Printf(\"before:%d ,after:%d\\n\",res,ret)\n\t\tif ret == res {\n\t\t\tbreak\n\t\t} else {\n\t\t\tstep++\n\t\t\tres=ret\n\t\t}\n\t}\n\tif res==n {//prime\n\t\tstep=0\n\t}else if res*res!=n {//square\n\t\tstep=step+1\n\t}\n\tfmt.Println(res,step)\n}\n", "lang": "Go", "bug_code_uid": "08bfbf5747cab9c010e87405e92ea85b", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "c1573259d2f0608096193c2f36a07382", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9703225806451613, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, d, m, sum int\n\tfmt.Scan(&n, &d)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfmt.Scan(&m)\n\tsort.IntSlice(a).Sort()\n\tif n >= m {\n\t\tfor i := 0; i < m; i++ {\n\t\t\tsum += a[i]\n\t\t\tfmt.Println(sum)\n\t\t}\n\t} else {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tsum += a[i]\n\t\t}\n\t\tsum -= d * (m - n)\n\t\tfmt.Println(sum)\n\t}\n}", "lang": "Go", "bug_code_uid": "7c16416038414f018038b90998ea217b", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "00a9dda3b62b30aecf6d0f022af6c125", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9946380697050938, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tfmt.Scan(&n, &k)\n\n\tvar participants []int\n\tfor i := 0; i < n; i++ {\n\t\tvar input int\n\t\tfmt.Scan(&input)\n\t\tparticipants = append(participants, input)\n\t}\n\n\tvar kValue = participants[k]\n\tvar count int\n\tfor _, p := range participants {\n\t\tif p >= kValue && p > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n\n}\n", "lang": "Go", "bug_code_uid": "3ce8d413764c835a998a3e32c82bbb15", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c47dc5a2311699a348c24c2b15c54469", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8228043143297381, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d%d\\n\", &n, &k)\n\n\tvar arr []int\n\tvar a int\n\tfor i:=0; i=arr[k-1]; i++ {\n\t}\n\tfmt.Println(i)\n}\n", "lang": "Go", "bug_code_uid": "d0f4a0498a1ada21403ad55467e3d314", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "20a9f19a65c7f85a9de06b0a49a2eed3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9818181818181818, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, c int\n\n\tfmt.Scan(&n, &c)\n\n\txi := make([]int, n)\n\n\tfor i := range xi {\n\t\tfmt.Scan(&xi[i])\n\t}\n\n\tmax, dif := 0, 0\n\n\tfor i:=0; i max {\n\t\t\tmax = dif\n\t\t}\n\t}\n\t\n\tif max == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(max - c)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "668d1ae40c187ddd36c3471ce97e2087", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "4c08b8039dad1937e5732a41ab8407a2", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9565217391304348, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,c,x,l,e int\n\tfmt.Scan(&n,&c)\n\tv:= make([]int,n)\n\tfmt.Scan(&l)\n\te=0\n\tfor i:=1;i(l-x-c) {\n\t\t\te=e\n\t\t} else {e=l-x-c}\n\t\tl=x\n\t}\n\tfmt.Println(e)\n}\n\n\n\n", "lang": "Go", "bug_code_uid": "8d2d2b8027677cc47462af61fb74ea1e", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "446cdd2a42ce202e76d5f674a2ec2f39", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.959511077158136, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "//https://codeforces.com/contest/385/problem/A\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar n, c int\n\t_, err := fmt.Scan(&n, &c)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tdays := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\t_, err := fmt.Scan(&days[i])\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(i, err)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(findMaxProffit(c, days))\n\t}\n}\n\nfunc findMaxProffit(berriesCost int, days []int) int {\n\tmaxDiff := 0\n\tfor i := 0; i < len(days)-1; i++ {\n\t\tleft := days[i]\n\t\tright := days[i+1]\n\t\tcurrentDiff := left - right\n\t\tif currentDiff > maxDiff {\n\t\t\tmaxDiff = currentDiff\n\t\t}\n\t}\n\treturn maxDiff - berriesCost\n}\n", "lang": "Go", "bug_code_uid": "8acfb39c222f4a31fafbd60464148a48", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "dc283309de658d48e5eb36a4de0c933a", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9348837209302325, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst div int64 = 1000000007\n\nfunc cucl(n int) int64 {\n\tvar a, b int64\n\ta = 2\n\tb = 4\n\tif n == 1 {\n\t\treturn a\n\t}\n\n\tif n == 2 {\n\t\treturn b\n\t}\n\n\tfor i := 3; i <= n; i++ {\n\t\ta, b = b%div, (a+b)%div\n\t}\n\n\treturn b\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, m int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &m)\n\n\tif m > n {\n\t\tn, m = m, n\n\t}\n\n\tfmt.Printf(\"%d\\n\", (cucl(n)+int64(2*(m-1)))%div)\n}\n", "lang": "Go", "bug_code_uid": "7b5e8f6c785c3d269820b9b89ad8feee", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "01f5d5ef13d0a90106aba848e0d75fd9", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9945504087193461, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1292B(_r io.Reader, _w io.Writer) {\n\ttype point struct{ x, y int64 }\n\tabs := func(x int64) int64 {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tdis := func(a, b point) int64 { return abs(a.x-b.x) + abs(a.y-b.y) }\n\n\tvar ax, ay, bx, by, tt int64\n\tvar p, st point\n\tFscan(_r, &p.x, &p.y, &ax, &ay, &bx, &by, &st.x, &st.y, &tt)\n\tps := []point{}\n\tfor ; p.x < 1e17 && p.y < 1e17; p.x, p.y = ax*p.x+bx, ay*p.y+by {\n\t\tps = append(ps, p)\n\t}\n\n\tans := 0\n\tfor i, p := range ps {\n\t\tt := tt\n\t\tif d := dis(st, p); d <= t {\n\t\t\tt -= d\n\t\t\tc := 1\n\t\t\tfor j := i; j > 0; j-- {\n\t\t\t\tif d := dis(ps[j], ps[j-1]); d <= t {\n\t\t\t\t\tt -= d\n\t\t\t\t\tc++\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif i+1 < len(ps) {\n\t\t\t\tif d := dis(ps[0], ps[i+1]); d <= t {\n\t\t\t\t\tt -= d\n\t\t\t\t\tc++\n\t\t\t\t\tfor j := i + 2; j < len(ps); j++ {\n\t\t\t\t\t\tif d := dis(ps[j], ps[j-1]); d <= t {\n\t\t\t\t\t\t\tt -= d\n\t\t\t\t\t\t\tc++\n\t\t\t\t\t\t} else {\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\t\t\t}\n\t\t\tif c > ans {\n\t\t\t\tans = c\n\t\t\t}\n\t\t}\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1292B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "a20a3aebf96ee605a2a1d8c82a09a38c", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "51217b5876d0c9cb886c006a7535ae1a", "difficulty": 1700, "tags": ["geometry", "greedy", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.99562154959071, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(j Jam) {\n\tsize := int32(j.Int())\n\tinfinite := false\n\tsum := int32(0)\n\tprevPrevFigure := int64(0)\n\tprevFigure := int64(0)\n\tfor i := int32(0); i < size; i++ {\n\t\tfigure := j.Int();\n\t\tswitch figure {\n\t\tcase 1: //\tcircle\n\t\t\tswitch prevFigure {\n\t\t\tcase 1:\n\t\t\t\tinfinite = true\n\t\t\tcase 2:\n\t\t\t\tsum += 3\n\t\t\tcase 3:\n\t\t\t\tsum += 4\n\t\t\t}\n\t\tcase 2: //\ttriangle\n\t\t\tswitch prevFigure {\n\t\t\tcase 1:\n\t\t\t\tif prevPrevFigure == 3 {\n\t\t\t\t\tsum += 2\n\t\t\t\t} else {\n\t\t\t\t\tsum += 3\n\t\t\t\t}\n\t\t\tcase 2:\n\t\t\t\tinfinite = true\n\t\t\tcase 3:\n\t\t\t\tsum += 3\n\t\t\t}\n\t\tcase 3: //\tsquare\n\t\t\tswitch prevFigure {\n\t\t\tcase 1:\n\t\t\t\tsum += 4\n\t\t\tcase 2:\n\t\t\t\tinfinite = true\n\t\t\tcase 3:\n\t\t\t\tinfinite = true\n\t\t\t}\n\t\t}\n\t\tif infinite {\n\t\t\tbreak\n\t\t}\n\n\t\tprevPrevFigure = prevFigure\n\t\tprevFigure = figure\n\t}\n\tif infinite {\n\t\tj.P(\"Infinite\\n\")\n\t} else {\n\t\tj.P(\"Finite\\n\")\n\t\tj.P(\"%d\\n\", sum)\n\t}\n}\n\nfunc main() {\n\tjam, closeFunc := JamNew()\n\tdefer closeFunc()\n\tsolve(jam)\n}\n\ntype Jam interface {\n\tScanner() *bufio.Scanner\n\tWriter() *bufio.Writer\n\tClose()\n\n\tStr() string\n\tInt() int64\n\tFloat() float64\n\n\tP(format string, values ...interface{})\n\tPF(format string, values ...interface{})\n}\n\nfunc JamNew() (Jam, func()) {\n\tif len(os.Args) > 1 {\n\t\tpanic(\"running with input file path is not supported\")\n\t}\n\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 0, 1024*1024), 1024*1024)\n\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tjam := &jam{scanner, writer}\n\treturn jam, jam.Close\n}\n\ntype jam struct {\n\tsc *bufio.Scanner\n\twr *bufio.Writer\n}\n\nfunc (j *jam) Close() {\n\tif err := j.wr.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (j *jam) Scanner() *bufio.Scanner {\n\treturn j.sc\n}\n\nfunc (j *jam) Writer() *bufio.Writer {\n\treturn j.wr\n}\n\nfunc (j *jam) Str() string {\n\tif !j.sc.Scan() {\n\t\tpanic(\"failed to scan next token\")\n\t}\n\n\treturn j.sc.Text()\n}\n\nfunc (j *jam) Int() int64 {\n\tif !j.sc.Scan() {\n\t\tpanic(\"failed to scan next token\")\n\t}\n\n\tres, err := strconv.ParseInt(j.sc.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, _ = fmt.Fprintf(os.Stderr, \"scanned %d\", res)\n\t_ = os.Stderr.Sync()\n\n\treturn res\n}\n\nfunc (j *jam) Float() float64 {\n\tj.sc.Scan()\n\tres, err := strconv.ParseFloat(j.sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc (j *jam) P(format string, values ...interface{}) {\n\t_, err := fmt.Fprintf(j.wr, format, values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (j *jam) PF(format string, values ...interface{}) {\n\t_, err := fmt.Fprintf(j.wr, format, values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err = j.wr.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "c568115a478b3b18d1beee44cf08fe6a", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "f0a53f5e62577ecae5ec0397bef103be", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6004750593824228, "equal_cnt": 27, "replace_cnt": 22, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 27, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(j Jam) {\n\tT := int16(j.Int())\n\tfor t := int16(0); t < T; t++ {\n\t\tin := j.Str()\n\t\truneCount := make([]int, 26)\n\t\tfor _, r := range []rune(in) {\n\t\t\trIdx := int(r - 'a')\n\t\t\truneCount[rIdx] += 1\n\t\t}\n\t\tpresentRunes := make([]int, 0, 26)\n\t\tfor r := range runeCount {\n\t\t\tif runeCount[r] > 0 {\n\t\t\t\tpresentRunes = append(presentRunes, r)\n\t\t\t}\n\t\t}\n\t\tresult := make([]rune, 0)\n\t\tseed := presentRunes[0]\n\t\tfor i := 0; i < runeCount[seed]; i++ {\n\t\t\tresult = append(result, rune('a'+seed))\n\t\t}\n\t\tpresentRunes = presentRunes[1:]\n\t\tleft, right := seed, seed\n\t\tretryRunes := make([]int, 0, 26)\n\t\tfor _, r := range presentRunes {\n\t\t\tif right+1 != r {\n\t\t\t\tfor i := 0; i < runeCount[r]; i++ {\n\t\t\t\t\tresult = append(result, rune('a'+r))\n\t\t\t\t}\n\t\t\t\tright = r\n\t\t\t} else if left+1 != r {\n\t\t\t\tfor i := 0; i < runeCount[r]; i++ {\n\t\t\t\t\tresult = append([]rune{rune('a' + r)}, result...)\n\t\t\t\t}\n\t\t\t\tleft = r\n\t\t\t} else {\n\t\t\t\tretryRunes = append(retryRunes, r)\n\t\t\t}\n\t\t}\n\t\tvalid := true\n\t\tfor _, r := range retryRunes {\n\t\t\tif abs(right-r) != 1 {\n\t\t\t\tfor i := 0; i < runeCount[r]; i++ {\n\t\t\t\t\tresult = append(result, rune('a'+r))\n\t\t\t\t}\n\t\t\t\tright = r\n\t\t\t} else if abs(left-r) != 1 {\n\t\t\t\tfor i := 0; i < runeCount[r]; i++ {\n\t\t\t\t\tresult = append([]rune{rune('a' + r)}, result...)\n\t\t\t\t}\n\t\t\t\tleft = r\n\t\t\t} else {\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\tj.P(\"No answer\\n\")\n\t\t} else {\n\t\t\tj.P(\"%s\\n\", string(result))\n\t\t}\n\t}\n}\n\nfunc main() {\n\tjam, closeFunc := JamNew()\n\tdefer closeFunc()\n\tsolve(jam)\n}\n\ntype Jam interface {\n\tScanner() *bufio.Scanner\n\tWriter() *bufio.Writer\n\tClose()\n\n\tStr() string\n\tInt() int64\n\tFloat() float64\n\n\tP(format string, values ...interface{})\n\tPF(format string, values ...interface{})\n}\n\nfunc JamNew() (Jam, func()) {\n\tif len(os.Args) > 1 {\n\t\tpanic(\"running with input file path is not supported\")\n\t}\n\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 0, 1024*1024), 1024*1024)\n\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tjam := &jam{scanner, writer}\n\treturn jam, jam.Close\n}\n\ntype jam struct {\n\tsc *bufio.Scanner\n\twr *bufio.Writer\n}\n\nfunc (j *jam) Close() {\n\tif err := j.wr.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (j *jam) Scanner() *bufio.Scanner {\n\treturn j.sc\n}\n\nfunc (j *jam) Writer() *bufio.Writer {\n\treturn j.wr\n}\n\nfunc (j *jam) Str() string {\n\tif !j.sc.Scan() {\n\t\tpanic(\"failed to scan next token\")\n\t}\n\n\treturn j.sc.Text()\n}\n\nfunc (j *jam) Int() int64 {\n\tif !j.sc.Scan() {\n\t\tpanic(\"failed to scan next token\")\n\t}\n\n\tres, err := strconv.ParseInt(j.sc.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, _ = fmt.Fprintf(os.Stderr, \"scanned %d\", res)\n\t_ = os.Stderr.Sync()\n\n\treturn res\n}\n\nfunc (j *jam) Float() float64 {\n\tj.sc.Scan()\n\tres, err := strconv.ParseFloat(j.sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc (j *jam) P(format string, values ...interface{}) {\n\t_, err := fmt.Fprintf(j.wr, format, values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (j *jam) PF(format string, values ...interface{}) {\n\t_, err := fmt.Fprintf(j.wr, format, values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err = j.wr.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n//\tGoLang shorthand methods for math go below\n//\tTODO wipe unused methods before submitting\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 min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "lang": "Go", "bug_code_uid": "5bc46f48d4cc0cf4a1af171b6211cf9f", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "f0a53f5e62577ecae5ec0397bef103be", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982917663136317, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype IO struct {\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n}\nfunc NewIO() IO {\n\tio := IO{scanner: bufio.NewScanner(os.Stdin), \n\t\twriter: bufio.NewWriter(os.Stdout)}\n\tio.scanner.Split(bufio.ScanWords)\n\treturn io\n}\nfunc toInt(buf []byte) (n int) {\n\tsgn bool := false\n\tfor _, v := range buf {\n\t\tif v == '-' {\n\t\t\tsgn = true\n\t\t} else {\n\t\t\tn = n*10 + int(v-'0')\n\t\t}\n\t}\n\tif sgn {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc (io *IO) NextInt() int {\n\tio.scanner.Scan()\n\treturn toInt(io.scanner.Bytes())\n}\nfunc (io *IO) Write(data ...interface{}) {\n\tfor _, el := range data {\n\t\tswitch el.(type) {\n\t\t\tcase int:\n\t\t\t\tio.writer.WriteString(strconv.Itoa(el.(int)))\n\t\t\tcase string:\n\t\t\t\tio.writer.WriteString(el.(string))\n\t\t\tcase rune:\n\t\t\t\tio.writer.WriteRune(el.(rune))\n\t\t}\n\t}\n}\nfunc (io *IO) Writeln(data ...interface{}) {\n\tio.Write(data...)\n\tio.writer.WriteRune('\\n')\n}\nfunc (io *IO) Flush() {\n\tio.writer.Flush()\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\nconst N int = 100\n\nfunc main() {\n\tio := NewIO()\n\n\tn := io.NextInt()\n\tvar a [N](int)\n\tans := 0\n\tfor i:=0; i0 && a[i]!=1 && a[i-1]!=1 {\n\t\t\tgoto Bad\n\t\t}\n\t\tif i>1 && a[i]==2 && a[i-1]==1 && a[i-2]==3 {\n\t\t\tans--\n\t\t}\n\t\tif i>0 {\n\t\t\tif Max(a[i],a[i-1])==2 {\n\t\t\t\tans += 3\n\t\t\t} else {\n\t\t\t\tans += 4\n\t\t\t}\n\t\t}\n\t}\n\n\tio.Writeln(\"Finite\")\n\tio.Writeln(ans)\n\tio.Flush()\n\treturn\n\nBad:\n\tio.Writeln(\"Infinite\")\n\tio.Flush()\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "dac0eaa3939f2bd0794d2aa9ca6072f9", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "b5a7b717cdb7cbac93cf1cf624fd3112", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9311224489795918, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"fmt\"\n)\n\nfunc main() {\n input := bufio.NewScanner(os.Stdin)\n input.Split(bufio.ScanWords)\n\n input.Scan()\n n, _ := strconv.Atoi(input.Text())\n\n a := make([]int, n, n)\n for i := range a {\n input.Scan()\n a[i], _ = strconv.Atoi(input.Text())\n }\n\n const (\n _ = iota\n circle\n triangle\n square\n )\n\n ans := 0\n for i := 1; i < n; i++ {\n if a[i - 1] == circle {\n if a[i] == triangle {\n ans += 3\n } else {\n ans += 4\n }\n } else if a[i - 1] == triangle {\n if a[i] == circle {\n ans += 3\n } else {\n ans = -1\n break\n }\n } else {\n if a[i] == circle {\n ans += 4\n } else {\n ans = -1\n break\n }\n }\n }\n\n if ans == -1 {\n fmt.Println(\"Infinite\")\n } else {\n fmt.Println(\"Finite\")\n fmt.Println(ans)\n }\n}\n", "lang": "Go", "bug_code_uid": "e7bfa53f6f2368e5362c818ecdfa3a75", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "89beda314eddd7fbf14b51b76e839026", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9963898916967509, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// http://codeforces.com/problemset/problem/189/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc main () {\n\tvar (\n\t\tn, a, b, c int\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &n, &a, &b, &c)\n\n\tdp := make([]struct{cnt, l int}, 15)\n\n\tdp[0].l = n\n\tdp[0].l = n\n\tdp[0].l = n\n\n\n\tfor i := 0; i <= n; i++ {\n\t\tif dp[i].cnt + 1 > dp[i + a].cnt && dp[i].l - a >= 0 {\n\t\t\tdp[i + a].cnt = dp[i].cnt + 1\n\t\t\tdp[i + a].l = dp[i].l - a\n\t\t}\n\n\t\tif dp[i].cnt + 1 > dp[i + b].cnt && dp[i].l - b >= 0 {\n\t\t\tdp[i + b].cnt = dp[i].cnt + 1\n\t\t\tdp[i + b].l = dp[i].l - b\n\t\t}\n\n\t\tif dp[i].cnt + 1 > dp[i + c].cnt && dp[i].l - c >= 0 {\n\t\t\tdp[i + c].cnt = dp[i].cnt + 1\n\t\t\tdp[i + c].l = dp[i].l - c\n\t\t}\n\t}\n\n\tfmt.Println(max(max(dp[n].cnt, dp[n].cnt), dp[n].cnt))\n}", "lang": "Go", "bug_code_uid": "c5ec14a962079a6ac1f97c4019101b85", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "40a2dcfaec5193b860692f03a235ed04", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.10023492560689115, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"errors\"\n )\n\nfunc Recur(n int, parts []int, count int) (int, error) {\n var result int\n var err error\n if n == 0 {\n result = count\n } else {\n if n < 0 {\n err = errors.New(\"Error\")\n } else {\n for _, part := range parts {\n answ, check := Recur(n - part, parts, count + 1)\n if check == nil && answ > result {\n result = answ\n }\n }\n }\n \n }\n\n return result, err\n}\n\nfunc main() {\n var n, a, b, c int\n fmt.Scanln(&n, &a, &b, &c)\n\n parts := [3]int{a, b, c}\n\n answ,_ := Recur(n, parts[:], 0)\n\n fmt.Println(answ)\n}", "lang": "Go", "bug_code_uid": "ed6ef4e9d42ec7de89dfe9ee7d1630f6", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "f4eafecb6ad308b4c58a4e0b5cd7c4c4", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9664233576642336, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(bufout, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(bufin, f, a...) }\n\n/*\nf(x) = 2*x - .5\n4*x - 1.5\n2^(n+1) x - (2^n - 1)\n*/\n\nconst M = 1000000007\n\nfunc main() {\n\tdefer bufout.Flush()\n\tvar N, K uint64\n\tscanf(\"%d%d\", &N, &K)\n\tN = (2*N - 1) % M\n\tz := getx(K)\n\tprintf(\"%d\\n\", (int64(z)*int64(N)+1)%M)\n}\n\nfunc getx(N uint64) int {\n\tif N < 30 {\n\t\treturn 1 << N\n\t}\n\tif N%2 == 0 {\n\t\tY := getx(N)\n\t\treturn int(int64(Y) * int64(Y) % M)\n\t}\n\treturn getx(N-1) * 2 % M\n}\n", "lang": "Go", "bug_code_uid": "50503f52903f367c84858135029410ad", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "5b304fbe3e89f4c12db8789e1e0d0dba", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9701818181818181, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(bufout, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(bufin, f, a...) }\n\n/*\nf(x) = 2*x - .5\n4*x - 1.5\n2^(n+1) x - (2^n - 1)\n*/\n\nconst M = 1000000007\n\nfunc main() {\n\tdefer bufout.Flush()\n\tvar N, K uint64\n\tscanf(\"%d%d\", &N, &K)\n\tN = (2*N - 1) % M\n\tz := getx(K)\n\tprintf(\"%d\\n\", (int64(z)*int64(N)+1)%M)\n}\n\nfunc getx(N uint64) int {\n\tif N < 30 {\n\t\treturn 1 << N\n\t}\n\tif N%2 == 0 {\n\t\tY := getx(N >> 1)\n\t\treturn int(int64(Y) * int64(Y) % M)\n\t}\n\treturn getx(N-1) * 2 % M\n}\n", "lang": "Go", "bug_code_uid": "33dcdb1d3c026cbd1a0cbcd4b917b526", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "5b304fbe3e89f4c12db8789e1e0d0dba", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9840319361277445, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"math\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tprintf(\"%d\", Problem791A())\n}\n\nfunc Problem791A () int {\n\tidx := 0\n\tvar a,b int\n\tscanf(\"%d %d\\n\", &a, &b)\n\t\n\tfor a < b {\n\t\ta = a * 3\n\t\tb = b * 2\n\t\tidx+=1\n\t}\n\t\n\treturn idx\n}\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc scanf(format string, x ...interface{}) {\n\tif _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang": "Go", "bug_code_uid": "7cb770abec3f7992549dac7302b1e6a5", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "8469a572185d4c7bafdffc2bb5073647", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7288693743139407, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main(){\n\treader := bufio.NewReader(os.Stdin);\n\tfor{\n\t\ttext,_ := reader.ReadString('\\n');\n\t\ttext = strings.Replace(text, \"\\n\", \"\", -1);\n\t\tsplitted := strings.Split(text, \" \");\n\t\ta,_ := strconv.ParseInt(splitted[0], 10, 32);\n\t\tb,_ := strconv.ParseInt(splitted[1], 10, 32);\n\t\tvar cnt int = 0;\n\t\tfor a<=b{\n\t\t\tcnt++;\n\t\t\ta*=3;\n\t\t\tb*=2;\n\t\t}\n\t\tfmt.Fprintf(os.Stdout, \"%d\\n\", cnt);\n\t}\n}", "lang": "Go", "bug_code_uid": "e4099ffd666b60fae822102fbe4dad5f", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "065ec8a3ed6fe25b3fb46ee822707d14", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8634453781512605, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main(){\n\treader := bufio.NewReader(os.Stdin);\n\tfor{\n\t\ttext,_ := reader.ReadString('\\n');\n\t\ttext = strings.TrimSuffix(text, \"\\n\");\n\t\tsplitted := strings.Split(text, \" \");\n\t\ta,_ := strconv.ParseInt(splitted[0], 10, 32);\n\t\tb,_ := strconv.ParseInt(splitted[1], 10, 32);\n\t\tfmt.println(b);\n\t\tfmt.Printf(\"%d %d\\n\", a, b);\n\t\tvar cnt int = 0;\n\t\tfor a<=b{\n\t\t\tcnt++;\n\t\t\ta*=3;\n\t\t\tb*=2;\n\t\t}\n\t\tfmt.Printf(\"%d\\n\", cnt);\n\t\tbreak;\n\t}\n}", "lang": "Go", "bug_code_uid": "41e89a7e63be0ee050fbbe2106234b6a", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "065ec8a3ed6fe25b3fb46ee822707d14", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8909299655568312, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar k string\n\tvar r int\n\tfmt.Scanf(\"%s %d\\n\", &k, &r)\n\tunitDigit, _ := strconv.Atoi(string(k[len(k)-1]))\n\tflag := false\n\tfor i := 0; i <= 9; i++ {\n\t\tx := strconv.Itoa(unitDigit * i)\n\t\tnewUnitDigit, _ := strconv.Atoi(string(x[len(x)-1]))\n\t\t// fmt.Println(unitDigit, i, x, newUnitDigit, r)\n\t\tif newUnitDigit == r {\n\t\t\tfmt.Println(i)\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\tfmt.Println(r)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "fba4e406b0f78006ca430b03d42e777b", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "493c7ddb8a490afe5459cfe802df0519", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8290062667860341, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\n\t\"strings\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc getString() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\treturn sc.Text()\n}\n\nfunc main() {\n\tstr := getString()\n\tar := strings.Split(str, \" \")\n\tk, _ := strconv.Atoi(ar[0])\n\tr, _ := strconv.Atoi(ar[1])\n\tif dec := k%10; dec != 0 {\n\t\ti := 1\n\t\tfor {\n\t\t\tif dec%r == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn \n\t\t\t} else {\n\t\t\t\ti++\n\t\t\t\tdec = dec * i\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(1)\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "b7771e110864bbcf9b2eb64d0057dcf6", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "94d77ad3bed3318506adf10cec8611fb", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.961038961038961, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scan(&k, &r)\n\tvar cnt = 1\n\tvar remain = k % 10\n\tfor remain != r {\n\t\tremain = (k + remain) % 10\n\t\tcnt++\n\t}\n\tfmt.Print(cnt)\n}\n", "lang": "Go", "bug_code_uid": "e6b3a758b67fcbcab1de809396deacf1", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "b0f6c30f4600467ac43fc471c3a32bd0", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.995, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scan(&k, &r)\n\tvar cnt = 1\n\tvar remain = k % 10\n\tfor remain != r && remain == 0 {\n\t\tremain = (k + remain) % 10\n\t\tcnt++\n\t}\n\tfmt.Print(cnt)\n}\n", "lang": "Go", "bug_code_uid": "b3339bb4227d4f5522c587ce0e5ce88d", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "b0f6c30f4600467ac43fc471c3a32bd0", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9217199558985667, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc solve(n int, arr []int) int {\n\tcurrent := 0\n\n\tfor i := range arr {\n\t\tif arr[i]-current > 15 {\n\t\t\treturn current + 15\n\t\t}\n\t\tcurrent = arr[i]\n\t}\n\n\treturn current\n}\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\n\tvar n int\n\tfmt.Fscanf(r, \"%d\\n\", &n)\n\n\tarr := make([]int, n)\n\n\tfor i := range arr {\n\t\tfmt.Fscanf(r, \"%d\", &arr[i])\n\t}\n\n\tfmt.Fprintf(os.Stdout, \"%d\\n\", solve(n, arr))\n}\n", "lang": "Go", "bug_code_uid": "94b518ce347f10b9cb739f7c808c6d45", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "77c715bb8f079f5efc87de84b1d83655", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.931899641577061, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var c,p,n,r int\n r=90\n fmt.Scan(&c)\n for i:=0; i15 {\n r=p+15\n break\n } else {\n p=n\n }\n }\n fmt.Println(r)\n}", "lang": "Go", "bug_code_uid": "64d087f881e1ec93c0aabb7883af28d2", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "6271fc0cf75e454b4a97a96386993e44", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9836956521739131, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ttn := make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&tn[i])\n\t}\n\n\tpre := 0\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif tn[i]-pre > 15 {\n\t\t\tans = pre + 15\n\t\t\tbreak\n\t\t} else {\n\t\t\tpre = tn[i]\n\t\t\tif i == n-1 {\n\t\t\t\tans = pre + 15\n\t\t\t}\n\t\t}\n\t}\n\n\tif ans == 0 {\n\t\tans = 90\n\t}\n\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "4248eaa35324e7e3c434c5ec1a81289f", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "759c06dc1e0b5dc6050053fff36d8009", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8424153166421208, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tstart := 0\n\tnext := 0\n\tminutes := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&next)\n\t\tif next - start > 15 {\n\t\t\tminutes = (start + 15)\n\t\t\tbreak\n\t\t}\n\t\tstart = next\n\t\tminutes = start\n\t\tif i == n-1 {\n\t\t\tminutes += (90 - next)\n\t\t}\n\t}\n\tfmt.Print(minutes)\n}", "lang": "Go", "bug_code_uid": "1c9110fd49d775acef1ce86f17934e8a", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "9705791235523880c45778c528b431fc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9453376205787781, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc weirdSum(a, b int) (int, int) {\n\tfor a != 0 && b != 0 {\n\t\tif a >= 2*b {\n\t\t\ta -= 2 * b\n\t\t\tcontinue\n\n\t\t} else if b >= 2*a {\n\t\t\tb -= 2 * a\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn a, b\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\tfmt.Println(weirdSum(a, b))\n}\n", "lang": "Go", "bug_code_uid": "dc31db5e625d846be04ded4f3bcded69", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "f51ba8d0c02b3ccdff3d93287188e0ee", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9936507936507937, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc weirdSum(a, b int64) (int64, int64) {\n\tfor a != 0 && b != 0 {\n\t\tif a >= 2*b {\n\t\t\ta -= 2 * b\n\t\t\tcontinue\n\n\t\t} else if b >= 2*a {\n\t\t\tb -= 2 * a\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn a, b\n}\n\nfunc main() {\n\tvar a, b int64\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\tfmt.Println(weirdSum(a, b))\n}\n", "lang": "Go", "bug_code_uid": "ecc0456e9540e42f3479847d76317e7f", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "f51ba8d0c02b3ccdff3d93287188e0ee", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9962564342536265, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "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, M := sc.NextInt64(), sc.NextInt64()\n\n\tfor {\n\t\tif N == 0 || M == 0 {\n\t\t\tbreak\n\t\t}\n\t\tif N/M >= 2 {\n\t\t\tN -= N / M * M\n\t\t} else if 2 <= M/N {\n\t\t\tM -= M / N * N\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(N, M)\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", "lang": "Go", "bug_code_uid": "3b28c6fc85e3f9ecfa49ee5c2ee8f613", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "a977a70298a7bdeac988461583e08298", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9645484949832775, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc power(n, mod int64) int64 {\n\tif n == 0 {\n\t\treturn int64(1)\n\t}\n\tif n % 2 == 0 {\n\t\tx := power(n/2, mod)\n\t\treturn (x*x) % mod\n\t} else {\n\t\tx := power(n/2, mod)\n\t\treturn (2*x*x) % mod\n\t}\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tscanner.Scan()\n\tmod := int64(1000)\n\tmod = mod*mod*mod + 7\n\tn, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\ta := power(n-1, mod)\n\tb := (2*a+1) % mod\n\tx := (a * b) % mod\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", x))\n}\n", "lang": "Go", "bug_code_uid": "92fe77e0f4a63a5956e72c9ad679b8ea", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "1b5aa14af042f3f13e58d4453b4e6964", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9202453987730062, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tstdin := bufio.NewReader(os.Stdin)\n\n\tvar a, b, c int\n\tvar tA, tB, tC int\n\t\n\tfmt.Fscanf(stdin, \"%d%d%d\\n\", &a, &b, &c)\n\tfmt.Fscanf(stdin, \"%d%d%d\\n\", &tA, &tB, &tC)\n\n\ta = a - tA\n\tb = b - tB\n\tc = c - tC\n\n\t// fmt.Println(a, b, c)\n\n\tif a < 0 {\n\t\ta = a * 2\n\t}\n\tif b < 0 {\n\t\tb = b * 2\n\t}\n\tif c < 0 {\n\t\tc = c * 2\n\t}\n\n\tif a + b + c >= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f99ca7d813bfc5e66382beff96c00a22", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "9cd799dfd89b6ce574192faad819616f", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9892156862745098, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nconst maxP int64 = 140\n\nvar (\n\tnProd [maxP]*big.Int\n\tfact [maxP]*big.Int\n\tbigNcr [maxP]*big.Int\n\tncr [maxP]int64\n)\n\nfunc main() {\n\tvar n, p, q int64\n\tvar md *big.Int = big.NewInt(int64((int64(1) << 32) - 1))\n\tvar imd int64 = int64((int64(1) << 32) - 1)\n\tfmt.Scanf(\"%d%d%d\", &n, &p, &q)\n\tfmt.Println(n, p, q)\n\tfor i := int64(0); i < maxP; i++ {\n\t\tbigNcr[i] = big.NewInt(1)\n\t\tfact[i] = big.NewInt(1)\n\t\tnProd[i] = big.NewInt(1)\n\t}\n\tfor i := int64(1); i < maxP; i++ {\n\t\tnProd[i].Mul(nProd[i-1], big.NewInt(int64(n-i+1)))\n\t\tfact[i].Mul(fact[i-1], big.NewInt(int64(i)))\n\t}\n\tfor i := int64(0); i < maxP; i++ {\n\t\tbigNcr[i].Div(nProd[i], fact[i])\n\t\tbigNcr[i].And(bigNcr[i], md)\n\t\tncr[i] = bigNcr[i].Int64()\n\t}\n\tvar x, m int64\n\tx = 0\n\tif p < (n - 1) {\n\t\tm = p\n\t} else {\n\t\tm = n - 1\n\t}\n\tfor i := int64(1); i <= q; i++ {\n\t\tvar s, pw int64\n\t\ts = 0\n\t\tpw = 1\n\t\tfor j := int64(0); j <= m; j++ {\n\t\t\ts += ncr[j] * pw\n\t\t\ts &= imd\n\t\t\tpw = (pw * i) & imd\n\t\t}\n\t\tx ^= (i * s) & imd\n\t}\n\tfmt.Println(x)\n}\n", "lang": "Go", "bug_code_uid": "17f3dbeefe32a33f950327ef20762fcd", "src_uid": "28cf4ff955d089318ea08d17bc4f43da", "apr_id": "9a4000a4301a6664b5f4e854b59f0a9b", "difficulty": 2900, "tags": ["dp", "meet-in-the-middle", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8631264023934181, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main(){\n\tvar n int;\n\tfmt.Scan (&n);\n\ta := make([]int, n);\n\tb := make([]int, n);\n\tcounta := make([]int, 6);\n\tcountb := make([]int, 6);\n\tfor i := 0; i < n; i++{\n\t\tfmt.Scan(&a[i]);\n\t\tcounta[a[i]]++;\n\t}\n\tfor i:= 0; i < n; i++{\n\t\tfmt.Scan(&b[i]);\n\t\tcountb[b[i]]++;\n\t}\n\tflag1 := 0;\n\tflag2 := 0;\n\n\tfor i:= 1; i <=5; i++ {\n\t\tif counta[i] == countb[i] {\n\t\t\tcontinue;\n\t\t} else if counta[i] < countb[i] {\n\t\t\tflag1 += countb[i] - counta[i]\n\t\t} else {\n\t\t\tflag2 += counta[i] - countb[i]\n\t\t}\n\t}\n\tif flag2 == flag1 && flag2 % 2 != 1{\n\t\tfmt.Printf(\"%d\\n\", flag1/2);\n\t}else{\n\t\tfmt.Printf(\"-1\\n\");\n\t}\n}\n\n\n", "lang": "Go", "bug_code_uid": "55f055d655f148becb6c5b1f03f364ef", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "2fab51714663505b5666f537f2974c34", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9993451211525868, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ta1, b1, a2, b2, a3, b3 := nextInt(), nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\n\tok := false\n\n\tswitch {\n\tcase a1 >= max(a2, a3) && b1 >= b2+b3:\n\t\tok = true\n\tcase a1 >= max(a2, b3) && b1 >= b2+a3:\n\t\tok = true\n\tcase a1 >= max(b2, a3) && b1 >= a2+b3:\n\t\tok = true\n\tcase a1 >= max(b2, b3) && b1 >= a2+a3:\n\t\tok = true\n\n\tcase b1 >= max(a2, a3) && a1 >= b2+b3:\n\t\tok = true\n\tcase b1 >= max(a2, b3) && a1 >= b2+a3:\n\t\tok = true\n\tcase b1 >= max(b2, a3) && a1 >= a2+b3:\n\t\tok = true\n\tcase b1 >= max(b2, b3) && a1 >= b2+a3:\n\t\tok = true\n\t}\n\n\tif ok {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "0d4bcd07a4c18cee5225aa8509d19d58", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "215fc3f7a27e23ca4d5bea111587d964", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9920948616600791, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar c string\n\tvar ct [5]string\n\tfmt.Scan(&c)\n\tfor i:=0; i<5; i++{\n\t\tfmt.Scan(&ct[i])\n\t\t\tif(c[0] == ct[i][0] || c[1] == ct[i][1]){\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "b1d0a8d3faf7be5641ac41a951a40f87", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "6bbe35581a53354b7ecf0eda22f65d20", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.08008898776418243, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main(){\n\tresp, err := http.Get(\"https://malshare.com/daily/\")\n\tif err != nil{\n\t\tlog.Fatalln(err)\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil{\n\t\tlog.Fatalln(err)\n\t}\n\n\tbody_str := string(body)\n\tfor{\n\t\ti := strings.Index(body_str, \"alt=\\\"[DIR]\\\"> 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc Converster(a byte) int {\n\tswitch {\n\tcase int(a) < 58:\n\t\treturn int(a) - 48\n\tcase int(a) == 84: //T\n\t\treturn 10\n\tcase int(a) == 74: //J\n\t\treturn 11\n\tcase int(a) == 81: //Q\n\t\treturn 12\n\tcase int(a) == 75: //K\n\t\treturn 13\n\tcase int(a) == 65: //A\n\t\treturn 14\n\t}\n\treturn 0\n}\n\nfunc Check(table string, hand []string) bool {\n\tfor _, val := range hand {\n\t\tif table[1] == val[1] {\n\t\t\tif Converster(val[0]) > Converster(table[0]) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\tif Converster(table[0]) == 14 {\n\t\tfor _, val := range hand {\n\t\t\tif Converster(val[0]) == 14 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar table string\n\tvar hande string\n\tfor {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\ttable, _ = reader.ReadString('\\n')\n\n\t\tchecked := CheckInput(table)\n\t\tif len(table) == 2 {\n\t\t\tif checked {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\thand := []string{}\n\tfor i := 0; i < 5; i++ {\n\t\tfor {\n\t\t\treader := bufio.NewReader(os.Stdin)\n\t\t\thande, _ = reader.ReadString('\\n')\n\t\t\tif len(hande) == 2 {\n\t\t\t\tif CheckInput(hande) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\thand = append(hand, hande)\n\t}\n\tif Check(table, hand) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8e1e68707274edb53d019b8d55069fc8", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "4f0b7a2550e41733f4e8a26a1c324427", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7792592592592592, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar input string\n\tfmt.Scan(&input)\n\n\tvar list_input [5]string\n\tfor i:=0; i<5; i++{\n\t\tfmt.Scan(&list_input[i])\n\t}\n\n\tfor j:=0; j<5; j++{\n\t\tif string(input[0]) ==string(list_input[j][0]) || string(input[1]) == string(list_input[j][1]){\n\t\t\tfmt.Println(\"YES\")\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n\n\n}\n", "lang": "Go", "bug_code_uid": "a62fa748353c1ea78ead205841c34869", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "83da5aa806676563fba8edfd7015ffdf", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9090909090909091, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, t, k, d int\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(reader, &n)\n\tfmt.Fscan(reader, &t)\n\tfmt.Fscan(reader, &k)\n\tfmt.Fscan(reader, &d)\n\tif n < k {\n\t\tfmt.Println(\"NO\")\n\t} else if n/k*t <= t+d {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d9417967c8b92ee2ab29b19297dd9f9a", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "ec41ae28196d97653a6b0105a5132e3a", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5169315825846579, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n\tvar noOfNeededCakes int\n\tfmt.Scan(&noOfNeededCakes)\n\tvar timeNeedForCakes int\n\tfmt.Scan(&timeNeedForCakes)\n\tvar noOfCakesAtSameTime int\n\tfmt.Scan(&noOfCakesAtSameTime)\n\tvar timeToBuildOven int\t\n\tfmt.Scan(&timeToBuildOven)\n\n\n\ttimePerOneCake := float64(timeNeedForCakes) / float64(noOfCakesAtSameTime)\n\ttimePerAllNeededCakesWithCurrentOven := timePerOneCake * float64(noOfNeededCakes)\n\t\n\ttimeWithSecondOven := timePerAllNeededCakesWithCurrentOven / 2 \n\ttimeWithSecondOven = timeWithSecondOven + float64(timeToBuildOven)\n\n\tif (noOfCakesAtSameTime >= noOfNeededCakes || timePerAllNeededCakesWithCurrentOven <= timeWithSecondOven) {\n\t\tfmt.Print(\"NO\")\n\t} else {\n\t\tfmt.Print(\"Yes\")\n\t}\n\n}", "lang": "Go", "bug_code_uid": "0a9162fa7338873b9ef9cc26e1b3a4a5", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "01c9f991bf857c94be9de933b61128ad", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7596899224806202, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, a int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &n)\n\tcoins := make(map[int]int, 0)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(in, &a)\n\t\tcoins[a]++\n\t}\n\tmax := 0\n\tfor i := 0; i < len(coins); i++ {\n\t\tif max < coins[i] {\n\t\t\tmax = coins[i]\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "lang": "Go", "bug_code_uid": "f7a64e024a641a3be664b84001ad51ca", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "84f4c99ca53c9ef22eac34f179917ca3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9984732824427481, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc MaxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tvar arr [101]int\n\tvar brr [101]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(arr[i])\n\t\tbrr[arr[i]]++\n\t}\n\tres := 0\n\tfor _, v := range brr {\n\t\tres = MaxInt(res, v)\n\t}\n\tfmt.Println(res)\n\n}\n", "lang": "Go", "bug_code_uid": "ed1c0129bc31131c7325210bc2b54552", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "4acf4cd1810b4bc0d8bbdec3324c385b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.11263073209975864, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "// test.go\n/*package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc changemap(mp map[int]string) {\n\t(mp)[1] = \"did hello\"\n\n}\n\nfunc main() {\n\n\tb := 6\n\tfmt.Println(strconv.Itoa(b)) // translate int to 'int'\n\t//\ta := \"abcd\"\n\tmp := map[int]string{1: \"hello\", 2: \"world\"}\n\t//mp[1] = \"hello\"\n\t//mp[2] = \"world\"\n\n\tfmt.Println(mp)\n\tchangemap(mp)\n\tfmt.Println(mp)\n\n\t/*list := []byte(a)\n\tfmt.Println(list)\n\tlist[0] = 34\n\tfmt.Println(list)\n\tfmt.Println(a)\n\n\tfmt.Printf(\"%d %c %d\\n\", a[0], a[1], a[2])\n\tfmt.Println(byte(10), byte('a'), string(byte('0')))\n}\n*/\npackage 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}\nfunc main() {\n\tvar n, a int\n\tfmt.Scanf(\"%d\", &n)\n\tvar cnt [200]int\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tcnt", "lang": "Go", "bug_code_uid": "bde62c1f1b356efea7a48b5a6bdfbd80", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "d21c8c30974bcdda83b1c099ceae5b35", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.990990990990991, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar m [100]int\n\tfor i:=0;i l {\n\t\t\tl = i\n\t\t}\n\t}\n\tfmt.Println(l)\n}", "lang": "Go", "bug_code_uid": "3c1d703e539e4b190c9303049c30a812", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "9b55e70898dfc3ca255496eecc0060b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6114221724524076, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts, t := next(), next()\n\tpos1, pos2 := 0, 0\n\tcntMark := 0\n\tcntEqual := 0\n\n\tfor i := range s {\n\t\tif s[i] == '+' {\n\t\t\tpos1++\n\t\t} else {\n\t\t\tpos1--\n\t\t}\n\t}\n\n\tfor i := range t {\n\t\tswitch t[i] {\n\t\tcase '+':\n\t\t\tpos2++\n\t\tcase '-':\n\t\t\tpos2--\n\t\tcase '?':\n\t\t\tcntMark++\n\t\t}\n\t}\n\t// println(pos1, pos2, cntMark, t)\n\tpermutation := 1 << uint64(cntMark)\n\tfor k := 0; k < permutation; k++ {\n\t\tcnt := 0\n\n\t\tfor i := 0; i < cntMark; i++ {\n\t\t\tif i&k > 0 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\n\t\tif pos2+cnt == pos1 {\n\t\t\tcntEqual++\n\t\t}\n\t}\n\t// println(cntEqual, permutation)\n\tprintln(float64(cntEqual)/float64(permutation))\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "6e75f8810c67f4f55b89c861b482c632", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "189596ff50be57b88ac67fd6884b4e19", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9949622166246851, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc pow(x, n int) int {\n\tresult := 1\n\tfor i := 0; i < n; i++ {\n\t\tresult *= x\n\t}\n\treturn result\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tvar ask, finish, current int\n\tfmt.Scan(&s1, &s2)\n\tfor i := 0; i < len(s1); i++ {\n\t\tif s1[i] == '+' {\n\t\t\tfinish += 1\n\t\t} else {\n\t\t\tfinish -= 1\n\t\t}\n\n\t\tswitch s2[i] {\n\t\tcase '+':\n\t\t\tcurrent += 1\n\t\tcase '-':\n\t\t\tcurrent -= 1\n\t\tcase '?':\n\t\t\task += 1\n\t\t}\n\t}\n\tif ask == 0 {\n\t\tif finish == current {\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\tpower := pow(2, ask)\n\tres := 0\n\tfor i := 0; i < power; i ++ {\n\t\tsum := 0\n\t\tfor j := 0; j < ask; j++ {\n\t\t\tif i&pow(2, j) > 0 {\n\t\t\t\tsum += 1\n\t\t\t} else {\n\t\t\t\tsum -= 1\n\t\t\t}\n\t\t}\n\t\tif finish == current+sum {\n\t\t\tres += 1\n\t\t}\n\t}\n\tfmt.Println(float32(res) / float32(power))\n}\n", "lang": "Go", "bug_code_uid": "94a6e3f3ce7b5a3419af396d032ec6d1", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "2bd76d4222e9e88607570578712d7606", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8730964467005076, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\tfmt.Printf(\"%d %d\\n\", a, b)\n\n\tships := 0\n\tfor a > 0 && b > 0 {\n\t\tif a < b {\n\t\t\tships += b / a\n\t\t\tb = b % a\n\t\t} else {\n\t\t\tships += a / b\n\t\t\ta = a % b\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", ships)\n}\n", "lang": "Go", "bug_code_uid": "0d827d4ec6950a4888c5fa4d80057972", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "2db7eea9891046d919e935a9d6fa43ee", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7547770700636943, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "lang": "Go", "bug_code_uid": "47070a6b8e4d06f61ec968241d378a9b", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "apr_id": "c1ed394fe0df6e7d0aac95488cc74b35", "difficulty": 2100, "tags": ["matrices", "math", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9907120743034056, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tc = a/2*b + a%2*b/2\n\tb = b/2*a + b%2*a/2\n\tif c < b {\n\t\tc = b\n\t}\n\tfmt.Print(c)\n}\n", "lang": "Go", "bug_code_uid": "e3e4a1777c7060c6f8206dcec324125d", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "09e179e17ba22c107f6642990ff5dc5f", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9816360601001669, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\" \n)\n\nfunc main() {\n var n uint16\n fmt.Scan(&n)\n ans := \"NO\"\n arr := [14]int{4,7,44,47,74,77,444,447,474,477,744,747,774,777}\n for _,v := range arr{\n if n%v==0{\n ans = \"YES\"\n break\n }\n }\n fmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "9acfdf3cab72fa3494e2c03c778986dd", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "7ff08ea28888446d76068e2f52e67111", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.34285714285714286, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s1, s2 string\n\tfmt.Scan(&s1)\n\tfmt.Scan(&s2)\n\n\tn := len(s1)\n\tfor i := 0; i < n; i++ {\n\t\tc1 := s1[i]\n\t\tc2 := s2[i]\n\t\tif c1 > 90 {\n\t\t\tc1 -= 32\n\t\t}\n\t\tif c2 > 90 {\n\t\t\tc2 -= 32\n\t\t}\n\t\tif c1 == c2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif c1 > c2 {\n\t\t\tfmt.Print(1)\n\t\t} else {\n\t\t\tfmt.Print(-1)\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Print(0)\n}\n", "lang": "Go", "bug_code_uid": "21d8e9eb4894efe23073ae0e98398784", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "898f4d6dd48ceb2de4572cea91c3347f", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6922183507549361, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc getInput() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor sc.Scan() {\n\t\treturn sc.Text()\n\t}\n}\n\nfunc main() {\n\tn := getInput()\n\tnumber, _ := strconv.Atoi(n)\n\tif number%4 == 0 || number%7 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "fb7d45b5e79b5c043a2500df20206f51", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "b065b047f6f7a4e7cb1330f610e14b81", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.988976377952756, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar inp int\n\tvar flag bool\n\tvar lst [12]int = [12]int{4, 7, 44, 47, 74, 77, 444, 447, 477, 744, 747, 777}\n\tfmt.Scan(&inp)\n\tfor i := 0; i < len(lst); i++ {\n\t\tif inp%lst[i] == 0 {\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "321f92f99061036193a3c8261c4bfa40", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "0828e107ec99f397e89f997df71fee85", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9691629955947136, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar luckynum = [...]int{4, 7, 44, 47, 74, 77, 444, 447, 477, 747, 774, 777}\n\n\ti := 0\n\tlucky := false\n\tfor luckynum[i] <= n {\n\t\tif n%luckynum[i] == 0 {\n\t\t\tlucky = true\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\tif lucky {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "22a2fbdb6f7d4d035b25c5ee9ef2a8f2", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "661b0bcc91434f40ced98e5a1cd821cc", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9922308546059934, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import (\n \"fmt\"\n)\n\nvar lucky = []int{4, 7, 44, 77, 47, 74, 444, 777, 477, 747, 774, 744, 474, 447}\n\nfunc main() {\n var num int\n fmt.Scanf(\"%d\\n\", &num)\n var a = num\n var fuck = true\n for {\n if a == 0 {\n break\n }\n if a%10 == 4 || a%10 == 7 {\n fuck = true\n a = a / 10\n } else {\n fuck = false\n break\n }\n }\n if !fuck {\n for _, i := range lucky {\n if num%i == 0 {\n fuck = true\n break\n }\n }\n }\n if fuck {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang": "Go", "bug_code_uid": "500ee6fe524cbcea0142f21eefef2fdc", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "432183e103c5f3167b265356510ccbd1", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9846153846153847, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n ax int64\n ay int64\n bx int64\n by int64\n cx int64\n cy int64\n)\n\nfunc main() {\n fmt.Scanf(\"%d %d %d %d %d %d\\n\", &ax, &ay, &bx, &by, &cx, &cy)\n if ((ax-bx)*(ax-bx)+(ay-by)*(ay-by)) == ((bx-cx)*(bx-cx)+(by-cy)*(by-cy)) && (bx-ax)*(cy-ay) != (by-ay)*(cx-bx) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }", "lang": "Go", "bug_code_uid": "c41219de3857f7afc152f551f0a5692f", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "50f043a935be46c616c861b07f0518a8", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9978118161925602, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n ax int64\n ay int64\n bx int64\n by int64\n cx int64\n cy int64\n)\n\nfunc main() {\n fmt.Scanf(\"%d %d %d %d %d %d\\n\", &ax, &ay, &bx, &by, &cx, &cy)\n if ((ax-bx)*(ax-bx)+(ay-by)*(ay-by)) == ((bx-cx)*(bx-cx)+(by-cy)*(by-cy)) && (bx-ax)*(cy-ay) != (by-ay)*(cx-bx) {\n fmt.Printf(\"YES\\n\")\n } else {\n fmt.Printf(\"NO\\n\")\n }\n}", "lang": "Go", "bug_code_uid": "6f1810247c76c2f969df1933afcbce0a", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "50f043a935be46c616c861b07f0518a8", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9716446124763705, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar ax, ay, bx, by, cx, cy int64\t\n\tfmt.Scan(&ax, &ay, &bx, &by, &cx, &cy)\n\tcx -= bx\n\tcy -= by\n\tbx -= ax\n\tby -= ay\n\tif bx*bx+by*by == cx*cx+cy*cy && bx != cx {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "7e8b7c1b2c95771c3cc05388f7d4cebc", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "363e6c6a9819d37a80146a16d81f15cf", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.18607954545454544, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport \"fmt\"\n\nvar success, k1, k2 int\n\nfunc lineUp(n1 int, n2 int, k3 int, k4 int, debug int) {\n if n1 == 0 && n2 == 0 && k3 >= 0 && k4 >= 0 {\n success++\n return\n } else if n1 < 0 || n2 < 0 || k3 < 0 || k4 < 0{\n return\n }\n \n if debug == 1 || debug == 0 {\n lineUp(n1-1, n2, k3-1, k2, 1)\n } else {\n lineUp(n1-1, n2, k1-1, k4, 1)\n }\n \n if debug == 2 || debug == 0 {\n lineUp(n1, n2-1, k1, k4-1, 2)\n } else {\n lineUp(n1, n2-1, k3, k2-1, 2)\n }\n} \n \nfunc main() {\n var n1, n2 int\n fmt.Scanf(\"%d %d %d %d\", &n1, &n2, &k1, &k2)\n lineUp(n1, n2, k1, k2, 0)\n \n fmt.Printf(\"%d\\n\", success)\n} ", "lang": "Go", "bug_code_uid": "84f17286f4ac85f9a4e91bc3dae1858a", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "a2ed1c4fb9205f3ab7318af886d4f6cb", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.917960088691796, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc reverse(s string) string {\n\tchars := []rune(s)\n\tfor i, j := 0, len(chars)-1; i < j; i, j = i+1, j-1 {\n\t\tchars[i], chars[j] = chars[j], chars[i]\n\t}\n\treturn string(chars)\n}\n\nfunc main() {\n\tvar p, l int\n\tvar s int64\n\tfmt.Scan(&p)\n\tfmt.Scan(&l)\n\tfor i := 1; i < p+1; i++ {\n\t\tr, k := strconv.Itoa(i), strconv.Itoa(i)\n\t\tr = reverse(r)\n\t\tm, _ := strconv.Atoi(k + r)\n\t\ts += m\n\t}\n\ts = s % l\n\tfmt.Println(s)\n}", "lang": "Go", "bug_code_uid": "b08164823390d57ef02cc3e601281114", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "eb9169ad33246643a476d0229b360f60", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.2625766871165644, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc checkEven(n int) (b bool) {\n\ti := 0\n\tfor n > 9 {\n\t\tn /= 10\n\t\ti++\n\t}\n\n\t// even\n\tif i % 2 == 1 {\n\t\tb = true\n\t\treturn\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc checkPalindrome(n int) bool {\n\tn2 := n\n\tm := 0\n\tfor n2 > 0 {\n\t\tm = 10 * m + n2 % 10\n\t\tn2 /= 10\n\t}\n\n\treturn m == n\n}\n\nfunc main() {\n\tvar k, p int\n\tfmt.Scan(&k, &p)\n\tnSum := 0\n\tnK := 0\n\tfor i := 1; ; i++ {\n\t\tif checkEven(i) && checkPalindrome(i) {\n\t\t\tnSum += i\n\t\t\tnK++\n\t\t\tif nK >= k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tnResult := nSum % p\n\tfmt.Println(nResult)\n}\n", "lang": "Go", "bug_code_uid": "85d722a7461b10f370c7c95aed4141fb", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "6b93a082086ea83ff424cdd2ea2306a0", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8675914249684742, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc palindrome(val int) int {\n\tres, count, n := 0, 0, val\n\tfor n > 0 {\n\t\tx := n % 10\n\t\tres += res*10 + x\n\t\tcount++\n\t\tn /= 10\n\t}\n\tres += val * int(math.Pow(10, float64(count)))\n\treturn res\n}\n\nfunc main() {\n\tvar k, p int\n\tfmt.Scan(&k, &p)\n\tsum := 0\n\tfor i := 1; i <= k; i++ {\n\t\tsum = (sum%p + palindrome(i)%p) % p\n\t}\n\tfmt.Println(sum)\n}\n", "lang": "Go", "bug_code_uid": "1e77c8037391256b442815aee89da1c8", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "d616e6789b9edfb139c3ed5b67980553", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.993006993006993, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\ta := make([]int, 2*n)\n\n\treader := bufio.NewReader(os.Stdin)\n\tre := regexp.MustCompile(`\\r?\\n`)\n\tif s, err := reader.ReadString('\\n'); err != nil {\n\t\tif err != io.EOF {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\ts = re.ReplaceAllString(s, \"\")\n\t\tfor i := 0; i < 2*n; i++ {\n\t\t\ta[i] = int(s[i] - '0')\n\t\t}\n\t}\n\n\tmerge_sort(a, 0, n-1)\n\tmerge_sort(a, n, 2*n-1)\n\n\tpos := 0\n\tneg := 0\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] > a[n] {\n\t\t\tpos++\n\t\t} else {\n\t\t\tneg++\n\t\t}\n\t}\n\n\tif pos == n || neg == n {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc merge(buffer []int, start, middle, end int) {\n\tsorted := make([]int, end-start+1)\n\n\ti := start\n\tj := middle + 1\n\tk := 0\n\tfor i <= middle && j <= end {\n\t\tif buffer[i] <= buffer[j] {\n\t\t\tsorted[k] = buffer[i]\n\t\t\ti++\n\t\t} else {\n\t\t\tsorted[k] = buffer[j]\n\t\t\tj++\n\t\t}\n\t\tk++\n\t}\n\tfor i <= middle {\n\t\tsorted[k] = buffer[i]\n\t\tk++\n\t\ti++\n\t}\n\tfor j <= end {\n\t\tsorted[k] = buffer[j]\n\t\tk++\n\t\tj++\n\t}\n\n\ti = start\n\tk = 0\n\tfor i <= end {\n\t\tbuffer[i] = sorted[k]\n\t\ti++\n\t\tk++\n\t}\n}\n\nfunc merge_sort(buffer []int, start, end int) {\n\tif end > start {\n\t\tmiddle := (end + start) / 2\n\t\tmerge_sort(buffer, start, middle)\n\t\tmerge_sort(buffer, middle+1, end)\n\t\tmerge(buffer, start, middle, end)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a7718265c36d684f91f5d09abe3552c6", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "6765815f9e578664adfee9b444e4ea5f", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9155749636098981, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n int\n var s string\n fmt.Scan(&n)\n fmt.Scan(&s)\n left := make([]int,n)\n for i := 0; i < n; i++ {\n left[i] = int(s[i])\n }\n sort.Ints(left)\n right := make([]int,n)\n for i := n; i < (2*n); i++ {\n right[i-n] = int(s[i])\n }\n sort.Ints(right)\n ans := true\n for i := 1; i < n; i++ {\n if ((left[i] >= right[i]) && (left[i-1] <= right[i-1])) || ((left[i] <= right[i]) && (left[i-1] >= right[i-1])) {\n ans = false\n break\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang": "Go", "bug_code_uid": "ca8abf9c32aa6aa26e39a94f184a486a", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "dbadca09c4fb19a615e940400ccd863c", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9260588657573582, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// 160B-mic\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tvar str string\n\tf := false\n\tfmt.Scan(&n, &str)\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = int(str[i])\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = int(str[i+n])\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tsort.Sort(sort.IntSlice(b))\n\t//fmt.Println(a)\n\t//fmt.Println(b)\n\tif n == 1 {\n\tfmt.Println(\"YES\")\n\treturn\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tif a[i] > b[i] && a[i+1] > b[i+1] {\n\t\t\tf = true\n\t\t} else if a[i] < b[i] && a[i+1] < b[i+1] {\n\t\t\tf = true\n\t\t} else {\n\t\t\tf = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif f {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "7d65bd7177554c34a7c91f261018b255", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "a0a4f9b9f8f2c8d9148b6a99731f05f4", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9795918367346939, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\tif a > b {\n\t\tfmt.Print(b + 1)\n\t} else {\n\t\tfmt.Print(n - a)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "947845b5a67b7e465a5eb855a83a905b", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "b480581f505f132af7cda3ce21831eb2", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6848484848484848, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\nimport (\"fmt\"\n)\nfunc main(){\n var n,a,b int\n fmt.Scanf(\"%d%d%d\",&n,&a,&b);\n fmt.Println(n-b+1)\n}\n", "lang": "Go", "bug_code_uid": "ab6f2d9baa18ed213634de23c0f3323a", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "4ada7ad75d04396bad1f71f5a0359f37", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8494983277591973, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "// 124A-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, a, b int\n fmt.Scan(&n, &a, &b)\n fmt.Println(n - a)\n}\n", "lang": "Go", "bug_code_uid": "5d1e6facc822834e76c91f6cd11b7691", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "f2a9086370ac48fcefd1c4974dfdde4d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.304307974335472, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\ntype point struct {\n\ttotal int\n\tnext int\n\teat int\n\tstep int\n}\n\nfunc main() {\n\tvar (\n\t\tactions int\n\t\ttotal int\n\t)\n\tif _, err := fmt.Scanln(&actions, &total); err != nil {\n\n\t}\n\tqueue := make([]point, 1000000000)\n\tqueue[0] = point{\n\t\ttotal: 1,\n\t\tnext: 2,\n\t\teat: 0,\n\t\tstep: 1,\n\t}\n\tfor i, e := 0, 1; i < e; i += 1 {\n\t\tp := queue[i]\n\t\tif p.step == actions && p.total == total {\n\t\t\tfmt.Println(p.eat)\n\t\t\treturn\n\t\t}\n\n\t\tif p.step >= actions {\n\t\t\tcontinue\n\t\t}\n\n\t\t//fmt.Println(i, e, p)\n\n\t\t// eat\n\t\tif p.total >= 1 {\n\t\t\tqueue[e] = point{\n\t\t\t\ttotal: p.total - 1,\n\t\t\t\tnext: p.next,\n\t\t\t\teat: p.eat + 1,\n\t\t\t\tstep: p.step + 1,\n\t\t\t}\n\t\t\te += 1\n\t\t}\n\n\t\t// add\n\t\tqueue[e] = point{\n\t\t\ttotal: p.total + p.next,\n\t\t\tnext: p.next + 1,\n\t\t\teat: p.eat,\n\t\t\tstep: p.step + 1,\n\t\t}\n\t\te += 1\n\t}\n}\n", "lang": "Go", "bug_code_uid": "5987e52318f174e84dea0e0c89fead3a", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "eba6133ba62a5f9a1a8341986df79b0a", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8206106870229007, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\n\tvar n, k int\n\tfmt.Fscanf(input, \"%d %d\\n\", &n, &k)\n\tfor m := 0; m <= n; m++ {\n\t\tif k == (n-m)*(n-m+1)/2-m {\n\t\t\tfmt.Println(m)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "db0ed0403f78a714c60a152a85de4e01", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "a5774a1e7dfd515d9590bc0f84ba02ed", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9928825622775801, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\n\tvar n, k int64\n\tfmt.Fscanf(input, \"%d %d\\n\", &n, &k)\n\ta := -(2*n + 3)\n\tb := n * (n + 1)\n\tfor m := int64(0); m <= n; m++ {\n\t\tif 2*k == m*m+a*m+b {\n\t\t\tfmt.Println(m)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "00c4b1f7f0cff13d34f807ddf1533494", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "a5774a1e7dfd515d9590bc0f84ba02ed", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8176795580110497, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar moveNum, candyNum int\n\n\t_, err := fmt.Scanln(&moveNum, &candyNum)\n\tif err != nil {\n\t}\n\n\tfor i := 1; i <= moveNum; i++ {\n\t\tj := int64(moveNum - i)\n\t\ta := int64((1 + i) * i / 2)\n\t\tif a < j {\n\t\t\tcontinue\n\t\t}\n\t\tcandy := a - j\n\t\tif (candy - int64(candyNum)) == 0 {\n\t\t\tfmt.Println(j)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "76ab7f54048222816b26823fee333f0e", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "87fa12bfc975db97dc17501ea6ae544b", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5940054495912807, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "package main \n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var i int\n fmt.Scan(&i)\n fmt.Println(i % 2 + 1)\n}", "lang": "Go", "bug_code_uid": "874eb3a117ed32d4391cc3652e887ea4", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "f618bef0f7726e622e041c0408855d73", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9581056466302368, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n in := bufio.NewReader(os.Stdin)\n out := bufio.NewWriter(os.Stdout)\n defer out.Flush()\n tot := 0\n fmt.Fscan(in, &tot)\n times := tot/3\n if tot % 3 > 0 {times++}\n fmt.Fprint(times, \"\\n\")\n}", "lang": "Go", "bug_code_uid": "d692554b25db148eb42603a4aa246f1d", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "2fb045cb0219509186871e8c3465ae17", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9927272727272727, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n \nfunc main() {\n in := bufio.NewReader(os.Stdin)\n out := bufio.NewWriter(os.Stdout)\n defer out.Flush()\n tot := 0\n fmt.Fscan(in, &tot)\n times := tot/3\n if tot % 3 > 0 {times++}\n fmt.Fprint(out, times)\n}", "lang": "Go", "bug_code_uid": "5fa36e8a943635fd637c4e40a4722dfc", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "2fb045cb0219509186871e8c3465ae17", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9983792544570502, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc main() {\n\tvar s strings\n\tfmt.Scan(&s)\n\tu, l := 0, 0\n\tfor _, r := range s {\n\t\tif unicode.IsLower(r) {\n\t\t\tl++\n\t\t} else if unicode.IsUpper(r) {\n\t\t\tu++\n\t\t}\n\t}\n\tif u > l {\n\t\tfmt.Println(strings.ToUpper(s))\n\t} else {\n\t\tfmt.Println(strings.ToLower(s))\n\t}\n}", "lang": "Go", "bug_code_uid": "389f28371783ff33c1167de60e466c78", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "db245b818bfc3f5dd3b7a1dc52b67414", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9881337648327939, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\ts \"strings\"\n\t\"unicode\"\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tfmt.Print(checkWord(text));\n}\n\nfunc checkWord (word string) string{\n\tisLower :=0\n\tisUpper :=0\n\tfor _,char := range word {\n\tif\tunicode.IsLower(char){\n\t\tisLower++;\n\t}else if unicode.IsUpper(char){\n\t\tisUpper++;\n\t}\n\t}\n\tif isUpper > isLower{\n\t\treturn s.ToUpper(word)\n\t}else{\n\t\treturn s.ToLower(word)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4a29adaeca24d5ca0d672b5fd9229bfb", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "b1b26dda2bb79f5adcf281e8cac8b9dd", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9653631284916201, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport (\n\ts \"strings\"\n\t\"unicode\"\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tfmt.Print(checkWord(text));\n}\n\nfunc checkWord (word string) string{\n isLower :=0\n\tisUpper :=0\n\tfor _,char := range word {\n\tif\tunicode.IsLower(char){\n\t\tisLower++;\n\t}else{\n\t\tisUpper++;\n\t}\n\t}\n\n\tif isUpper > isLower{\n\t\treturn s.ToUpper(word)\n\t}else{\n\t\treturn s.ToLower(word)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "b92b146b468dabe819aa641774321166", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "b1b26dda2bb79f5adcf281e8cac8b9dd", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5509761388286334, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\tstr string\n\t)\n\n\tfmt.Scan(&str)\n\tfmt.Println(strings.ToLower(str))\n}\n", "lang": "Go", "bug_code_uid": "0a36fdd329bc072cb2586893f9581b0c", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "179951a509d44f1f6806589e5849440d", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9690444145356663, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar init, goal, f int\n\tfmt.Scan(&init)\n\tfmt.Scan(&goal)\n\t//p := make([]int, n)\n\n\tvar ans = 0\n\tfor goal > init {\n\t\tif goal%init != 0 {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\tgoal = goal / init\n\t\tans++\n\t}\n\n\tif goal == init {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Println(ans)\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n\tfmt.Println(5 - ans)\n\tfmt.Scan(&f)\n}\n", "lang": "Go", "bug_code_uid": "caa794a94909898d19cec256b7dfc59e", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "a3db610309c35a01279f1f1653b480b1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.954248366013072, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n base, target := getI64(), getI64()\n for x := int64(1); x <= target; x *= base {\n if x == target {\n writer.WriteString(\"YES\\n\")\n return\n }\n }\n writer.WriteString(\"NO\\n\")\n}\n", "lang": "Go", "bug_code_uid": "58c653996f5a5b4c54e823085bcf9595", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "63b7791ad41cbe781edcafce063c9329", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9202350965575147, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF101C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar x, y [3]int64\n\tfor i := 0; i < 3; i++ {\n\t\tFscan(in, &x[i], &y[i])\n\t}\n\td := x[2]*x[2] + y[2]*y[2]\n\tfor i := 0; i < 4; i++ {\n\t\tx[0], y[0] = y[0], x[0]\n\t\ty[0] = -y[0]\n\t\tdx, dy := x[1]-x[0], y[1]-y[0]\n\t\td1, d2 := dx*x[2]+dy*y[2], dx*y[2]-dx*x[2]\n\t\tif d == 0 && dx == 0 && dy == 0 || d > 0 && d1%d == 0 && d2%d == 0 {\n\t\t\tFprint(out, \"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, \"NO\")\n}\n\nfunc main() { CF101C(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "4a52f5c19f52eeba5e5ec9525bc9febb", "src_uid": "cc8a8af1ba2b19bf081e379139542883", "apr_id": "0604c2ab6f0df46e88587faa251e926d", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8401232454638823, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "//A. Wrong Subtraction\n\n/*\nLittle girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm:\n\n if the last digit of the number is non-zero, she decreases the number by one;\n if the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).\n\nYou are given an integer number 𝑛\n. Tanya will subtract one from it 𝑘 times. Your task is to print the result after all 𝑘\n\nsubtractions.\n\nIt is guaranteed that the result will be positive integer number.\nInput\n\nThe first line of the input contains two integer numbers 𝑛\nand 𝑘 (2≤𝑛≤109, 1≤𝑘≤50\n\n) — the number from which Tanya will subtract and the number of subtractions correspondingly.\nOutput\n\nPrint one integer number — the result of the decreasing 𝑛\nby one 𝑘\n\ntimes.\n\nIt is guaranteed that the result will be positive integer number.\n\nExamples\nInput\n512 4\n\nOutput\n50\n\nInput\n1000000000 9\n\nOutput\n1\n\nNote: The first example corresponds to the following sequence: 512→511→510→51→50\n*/\npackage main\n\nimport (\n\tassert \"github.com/rnd\"\n)\n\nfunc main() {\n\tassert.Assert(substract(512, 4), 50)\n\tassert.Assert(substract(1000000000, 9), 1)\n}\n\nfunc substract(n, k int) int {\n\tfor i := 0; i < k; i++ {\n\t\tif n%10 == 0 {\n\t\t\tn /= 10\n\t\t} else {\n\t\t\tn--\n\t\t}\n\t}\n\treturn n\n}\n", "lang": "Go", "bug_code_uid": "4d891c2325cb8cd10e9dd945a05a1f1b", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "22df444a8122e92de5937989e281aeab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.2761596548004315, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\targs := os.Args[1:]\n\ti, _ := strconv.Atoi(args[0])\n\tj, _ := strconv.Atoi(args[1])\n\tfmt.Println(substract(i, j))\n}\n\nfunc substract(n, k int) int {\n\tfor i := 0; i < k; i++ {\n\t\tif n%10 == 0 {\n\t\t\tn /= 10\n\t\t} else {\n\t\t\tn--\n\t\t}\n\t}\n\treturn n\n}\n", "lang": "Go", "bug_code_uid": "49e11654e71e6dddee1b02b942d6cb4c", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "22df444a8122e92de5937989e281aeab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4452296819787986, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\nfunc dec(n int) int {\n if n<=0{\n return 0\n }\n if n%10 == 0 {\n return n/10\n }\n return n--;\n}\nfunc main() {\n var n, k int\n fmt.Scanf(\"%d\", &n)\n fmt.Scanf(\"%d\", &k)\n for ;k-->0;{\n n = dec(n);\n }\n\n fmt.Printf(\"%d\", n)\n}", "lang": "Go", "bug_code_uid": "0cc44c9fccf72cd771938b0546421cca", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "fe740b74d8361e28d1788728c9055642", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9957983193277311, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, k int\n fmt.Scanf(\"%d %d\\n\", &n, %k)\n for i := 0; i < k; i++ {\n if n % 10 == 0 {\n n = n / 10\n } else {\n n--\n }\n }\n fmt.Println(n)\n}", "lang": "Go", "bug_code_uid": "d0fadee23d6ca80415f3abc543cad899", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "2758640846d70a709e721d597491dee3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5598377281947262, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc WrongSubstraction(n int, k int) int {\n\tret := n\n\tif k > 0 {\n\t\tif n%10 == 0 {\n\t\t\tret = WrongSubstraction(n/10, k-1)\n\t\t} else {\n\t\t\tret = WrongSubstraction(n-1, k-1)\n\t\t}\n\t}\n\treturn ret\n\n}\n\nfunc main() {\n\n\tn, err := strconv.Atoi(os.Args[1])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tk, err := strconv.Atoi(os.Args[2])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Print(WrongSubstraction(n, k))\n}\n", "lang": "Go", "bug_code_uid": "e1f5b11861983286e6a545419eb76253", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "6fcdd7dfdb66853d1c891f8fc4a7776a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.41711229946524064, "equal_cnt": 20, "replace_cnt": 5, "delete_cnt": 12, "insert_cnt": 3, "fix_ops_cnt": 20, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main1() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tline := make([]int, n)\n\tfor i, _ := range line {\n\t\tfmt.Scanf(\"%d\", &line[i])\n\t}\n\n\tcount := 0\n\n\tfor ; !sort.SliceIsSorted(line, compare(line)); {\n\n\t}\n\tfmt.Print(count)\n\n}\n\nfunc compare(line []int) func(i int, j int) bool {\n\treturn func(i, j int) bool {\n\t\treturn line[i] < line[j]\n\t}\n}\n", "lang": "Go", "bug_code_uid": "5f076b751b5ee7021ab31945ed54d6f2", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "d5e8fbb77434c4ef28edd0e133f771d3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9923195084485407, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main10() {\n\t// rrr g bbbbb gg\n\tvar n int\n\tvar cu string\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanln(&cu)\n\tcorAnterior := cu[:1]\n\tpomba := 1\n\tfor i := 1; i < n; i++ {\n\t\tcorAtual := cu[i : i+1] // pegar i\n\t\tif corAtual != corAnterior {\n\t\t\tpomba++\n\t\t\tcorAnterior = corAtual\n\t\t}\n\t}\n\tfmt.Println(n - pomba)\n}\n", "lang": "Go", "bug_code_uid": "30f2a29a4bb3d39adc1e0da605babf70", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "b8bfbbae4d4dfa18210ea74b805f6c67", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9992695398100804, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"container/list\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\n\tvar distance [2005]int\n\tqueue := list.New()\n\n\tdistance[n] = 1\n\tqueue.PushBack(n)\n\n\tfor e := queue.Front(); e != nil; e = e.Next() {\n\t\tx := e.Value.(int)\n\n\t\tif x == m {\n\t\t\tfmt.Printf(\"%d\\n\", distance[x] - 1)\n\t\t\tbreak\n\t\t}\n\n\t\tif x > 1 && distance[x - 1] == 0 {\n\t\t\tdistance[x - 1] = distance[x] + 1\n\t\t\tqueue.PushBack(x - 1)\n\t\t\tif x - 1 == m {\n\t\t\t\tfmt.Printf(\"%d\\n\", distance[x])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif x < m && distance[x * 2] == 0 {\n\t\t\tdistance[x * 2] = distance[x] + 1\n\t\t\tqueue.PushBack(x * 2)\n\t\t\tif x * 2 == m {\n\t\t\t\tfmt.Printf(\"%d\\n\", distance[x])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d0d778a62c400850a3eaa6c76364ce59", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "a71c09fec75a1f5f663b080e3f4a0e01", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9600409836065574, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nvar cost = map[int]int{}\nvar target int\n\nfunc foo(x, steps int) {\n c, found := cost[x]\n if found && c <= steps {\n return\n }\n cost[x] = steps\n if x < target {\n foo(2*x, steps+1)\n }\n if x > 0 {\n foo(x-1, steps+1)\n }\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n x := getI()\n target = getI()\n if target <= x {\n writer.WriteString(fmt.Sprintf(\"%d\\n\", x-target))\n return\n }\n foo(x, 0)\n writer.WriteString(fmt.Sprintf(\"%d\\n\", cost[target]))\n}\n", "lang": "Go", "bug_code_uid": "01886af083a1284d086945740264fdc5", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "3d7904b64c2abdfe2b862233bef12fae", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9857651245551602, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// You can edit this code!\n// Click here and start typing.\npackage main\n\nimport (\n\t\"container/list\"\n\t\"fmt\"\n)\n\ntype stackval struct {\n\tcurrent int\n\tsteps int\n}\n\nfunc solve(n, m int) int {\n\tvar visited [10001]int\n\tvar best = 10000\n\n\ts := list.New()\n\tel := stackval{n, 0}\n\n\ts.PushBack(el)\n\n\tfor s.Len() > 0 {\n\t\tel := s.Remove(s.Front()).(stackval)\n\t\tvisited[el.current] = 1\n\t\tif el.current >= m {\n\t\t\tsteps := el.steps + (el.current - m)\n\t\t\tif steps < best {\n\t\t\t\tbest = steps\n\t\t\t}\n\t\t} else {\n\t\t\tif el.current > 0 {\n\t\t\t\tif visited[el.current-1] == 0 {\n\t\t\t\t\ts.PushBack(stackval{el.current - 1, el.steps + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif visited[el.current*2] == 0 {\n\t\t\t\ts.PushBack(stackval{el.current * 2, el.steps + 1})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn best\n}\n\nfunc main() {\n\tvar m, n int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tres := solve(n, m)\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "32348d388c13d71b81e597ca72075b25", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "fc6cead90a440dad58bc7895f11ebd73", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9953488372093023, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tans := 0\n\n\tfor m > n {\n\t\tif m % 2 != 0 {\n\t\t\tm++\n\t\t\tans++\n\t\t} else {\n\t\t\tm /= 2\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans + (n - m))", "lang": "Go", "bug_code_uid": "ae84e59dd93dbc2d2e619edc6a06fbe8", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "1db755f5e44aad1ea51c1587db1284da", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6201171875, "equal_cnt": 24, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 11, "fix_ops_cnt": 24, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bestTimes int\nvar m int\nvar ret []int\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscanln(reader, &n, &m)\n\tmax := 0\n\tif n > m {\n\t\tbestTimes = n - m\n\t\tmax = n\n\t} else {\n\t\tbestTimes, max = initBestTimes(n, m)\n\t}\n\tret = make([]int, max*2+1)\n\tfor i := 0; i < len(ret); i++ {\n\t\tret[i] = -1\n\t}\n\tdfs1(n, 0)\n\tfmt.Println(bestTimes)\n}\n\nfunc dfs1(n int, count int) {\n\tif count > bestTimes {\n\t\treturn\n\t}\n\tif n == m {\n\t\tif count < bestTimes {\n\t\t\tbestTimes = count\n\t\t}\n\t\treturn\n\t}\n\tif n == 0 {\n\t\treturn\n\t}\n\tif n-1 < len(ret) && ret[n-1] == -1 {\n\t\tdfs1(n-1, count+1)\n\t}\n\tif n*2 < len(ret) && ret[n*2] == -1 {\n\t\tdfs1(n*2, count+1)\n\t}\n}\n\nfunc initBestTimes(n, m int) (int, int) {\n\ttemp := n\n\tcount := 0\n\tfor {\n\t\tcount++\n\t\ttemp *= 2\n\t\tif temp > m {\n\t\t\treturn count + temp - m, temp\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "b6f6a777ba257bc30498682a9b2bcc3a", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "b8fe50dd9ca2c5571d6ec30cdf7a11bf", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8918420081210778, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"container/list\"\n\t\"fmt\"\n)\n\ntype Item struct {\n\tvalue int\n\tdepth int\n}\n\ntype Queue struct {\n\tdata *list.List\n}\n\nfunc NewQueue() *Queue {\n\tq := new(Queue)\n\tq.data = list.New()\n\treturn q\n}\n\nfunc (q *Queue) Enqueue(v interface{}) {\n\tq.data.PushBack(v)\n}\n\nfunc (q *Queue) Dequeue() interface{} {\n\titer := q.data.Front()\n\tv := iter.Value\n\tq.data.Remove(iter)\n\treturn v\n}\n\nfunc (q *Queue) Dump() {\n\tfor iter := q.data.Front(); iter != nil; iter = iter.Next() {\n\t\tfmt.Println(\"item:\", iter.Value)\n\t}\n}\n\nfunc (q *Queue) Empty() bool {\n\treturn q.data.Len() == 0\n}\n\nfunc solve(n, m int) int {\n\tif n >= m {\n\t\treturn n - m\n\t}\n\n\tlen := m*2 + 1\n\tgraph := make([][]int, len, len)\n\tfor i := 0; i < m*2+1; i++ {\n\t\tgraph[i] = make([]int, len, len)\n\t}\n\n\tfor i := 1; i < len; i++ {\n\t\tgraph[i][0] = i - 1\n\t\tgraph[i][1] = i * 2\n\t}\n\n\tans := 0\n\tq := NewQueue()\n\tq.Enqueue(Item{value: n, depth: 0})\n\tfor !q.Empty() {\n\t\tv := q.Dequeue().(Item)\n\t\tif v.value == m {\n\t\t\tans = v.depth\n\t\t\tbreak\n\t\t}\n\n\t\tval := v.value\n\t\tif val > 0 && val < len {\n\t\t\tit := Item{value: graph[val][0], depth: v.depth + 1}\n\t\t\tq.Enqueue(it)\n\n\t\t\tit.value = graph[val][1]\n\t\t\tq.Enqueue(it)\n\t\t}\n\t}\n\n\treturn ans\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tfmt.Println(solve(n, m))\n}\n", "lang": "Go", "bug_code_uid": "6cc4eb972015ea105dacbbdb903a9837", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "ba308b773d7b3d73c5837001ade63d37", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8946395563770795, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"container/list\"\n\t\"fmt\"\n)\n\ntype Item struct {\n\tvalue int\n\tdepth int\n}\n\ntype Queue struct {\n\tdata *list.List\n}\n\nfunc NewQueue() *Queue {\n\tq := new(Queue)\n\tq.data = list.New()\n\treturn q\n}\n\nfunc (q *Queue) Enqueue(v interface{}) {\n\tq.data.PushBack(v)\n}\n\nfunc (q *Queue) Dequeue() interface{} {\n\titer := q.data.Front()\n\tv := iter.Value\n\tq.data.Remove(iter)\n\treturn v\n}\n\nfunc (q *Queue) Dump() {\n\tfor iter := q.data.Front(); iter != nil; iter = iter.Next() {\n\t\tfmt.Println(\"item:\", iter.Value)\n\t}\n}\n\nfunc (q *Queue) Empty() bool {\n\treturn q.data.Len() == 0\n}\n\nfunc solve(n, m int) int {\n\tif n >= m {\n\t\treturn n - m\n\t}\n\n\tlen := m*2 + 1\n\tgraph := make([][]int, len, len)\n\tfor i := 0; i < m*2+1; i++ {\n\t\tgraph[i] = make([]int, 2, 2)\n\t}\n\n\tfor i := 1; i < len; i++ {\n\t\tgraph[i][0] = i - 1\n\t\tgraph[i][1] = i * 2\n\t}\n\n\tans := 0\n\tq := NewQueue()\n\tq.Enqueue(Item{value: n, depth: 0})\n\tfor !q.Empty() {\n\t\tv := q.Dequeue().(Item)\n\t\tif v.value == m {\n\t\t\tans = v.depth\n\t\t\tbreak\n\t\t}\n\n\t\tval := v.value\n\t\tif val > 0 && val < len {\n\t\t\tit := Item{value: graph[val][0], depth: v.depth + 1}\n\t\t\tq.Enqueue(it)\n\n\t\t\tit.value = graph[val][1]\n\t\t\tq.Enqueue(it)\n\t\t}\n\t}\n\n\treturn ans\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tfmt.Println(solve(n, m))\n}\n", "lang": "Go", "bug_code_uid": "dfdddd11b705b6b9577822334e7f6723", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "ba308b773d7b3d73c5837001ade63d37", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6578449905482041, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tvar n, m int\n\tscan(&n, &m)\n\tc := 0\n\tfor n != m {\n\t\tif n*2 == m {\n\t\t\tc++\n\t\t\tfmt.Println(c)\n\t\t\treturn\n\t\t}\n\t\tn--\n\t\tc++\n\t}\n\tfmt.Println(c)\n\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n", "lang": "Go", "bug_code_uid": "9e0c38e8075c1b03c9fee28c13244150", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "a1ee889ca78c58ff32b8154b8936e305", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7419753086419754, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, m int\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(reader, &n, &m)\n\ttims := 0\n\tif n >= m {\n\t\ttims = n - m\n\t} else {\n\t\tif m%2 != 0 {\n\t\t\tm += 1\n\t\t\ttims++\n\t\t\tif m/2 <= n {\n\t\t\t\tm = m / 2\n\t\t\t\ttims++\n\t\t\t} else {\n\t\t\t\tfor m/2+m%2 >= n {\n\t\t\t\t\tm = m/2 + m%2\n\t\t\t\t\tif m%2 != 0 {\n\t\t\t\t\t\ttims++\n\t\t\t\t\t}\n\t\t\t\t\t//fmt.Println(\"M: \", m)\n\t\t\t\t\tif m == n {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\ttims++\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor n != m {\n\t\t\t\tn--\n\t\t\t\ttims++\n\t\t\t}\n\t\t} else {\n\t\t\tif m/2 <= n {\n\t\t\t\tm = m / 2\n\t\t\t\ttims++\n\t\t\t} else {\n\t\t\t\tfor {\n\t\t\t\t\tif m <= n {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif m%2 != 0 {\n\t\t\t\t\t\tm++\n\t\t\t\t\t\ttims++\n\t\t\t\t\t}\n\t\t\t\t\tm = m / 2\n\t\t\t\t\ttims++\n\t\t\t\t}\n\t\t\t}\n\t\t\ttims += n - m\n\t\t}\n\t}\n\tfmt.Println(tims)\n}\n", "lang": "Go", "bug_code_uid": "48226491c7fb0fac3df5dafd9c106ae2", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "e71374429b25dbfabf0f529d50aba49c", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6666666666666666, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype pair struct {\n\tnn int\n\tdd int\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d%d\", &n, &m)\n\n\tif n >= m {\n\t\tfmt.Println(n - m)\n\t} else {\n\t\tdevice := make([]pair, 1)\n\t\tdevice[0] = pair{n, 0}\n\n\t\tans := 0\n\t\tfor {\n\t\t\t// pop front element\n\t\t\ttmp := device[0]\n\t\t\tdevice = device[1:]\n\n\t\t\tif tmp.nn == m { // reached destination\n\t\t\t\tans = tmp.dd\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// add neighbors to the queue\n\t\t\tdevice = append(device, pair{tmp.nn - 1, tmp.dd + 1})\n\t\t\tdevice = append(device, pair{tmp.nn * 2, tmp.dd + 1})\n\t\t}\n\n\t\tfmt.Println(ans)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "b7b39f75fd6eb1ac10ea7f6ed952bba3", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "7718d02f189b9e221a101928e8c2e7f7", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9727164887307236, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype pair struct {\n\tnn int\n\tdd int\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d%d\", &n, &m)\n\n\tif n >= m {\n\t\tfmt.Println(n - m)\n\t} else {\n\t\tvisited := make([]bool, 2*m+1)\n\n\t\tdevice := make([]pair, 1)\n\t\tdevice[0] = pair{n, 0}\n\n\t\tans := 0\n\t\tvisited[n] = true\n\t\tfor {\n\t\t\t// pop front element\n\t\t\ttmp := device[0]\n\t\t\t// device = device[1:]\n\t\t\tcopy(device[0:len(device)-1], device[1:])\n\n\t\t\tif tmp.nn == m { // reached destination\n\t\t\t\tans = tmp.dd\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// add neighbors to the queue\n\t\t\tif tmp.nn*2 < 2*m+1 && visited[tmp.nn*2] == false {\n\t\t\t\tdevice = append(device, pair{tmp.nn * 2, tmp.dd + 1})\n\t\t\t\tvisited[tmp.nn*2] = true\n\t\t\t}\n\t\t\tif tmp.nn-1 >= 0 && visited[tmp.nn-1] == false {\n\t\t\t\tdevice = append(device, pair{tmp.nn - 1, tmp.dd + 1})\n\t\t\t\tvisited[tmp.nn-1] = true\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(ans)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "9046d821a239fbcfab5efe7648536f48", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "7718d02f189b9e221a101928e8c2e7f7", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8541300527240774, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "// 192A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, i, j float64\n\tfmt.Scan(&n)\n\tfor i = 1; i*(i+1)/2 <= n; i++ {\n\t\tj = math.Sqrt(n*2 - i*(i+1))\n\t\tif j > 0 && j*(j+1)+i*(i+1) == n*2 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "6be518486a6e39ff7c12b7d0bf9164d2", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "93202a212cfb877e9434cfcb4f20bfd6", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5294515910629655, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"sort\"\n)\n\nvar mem [1e6 + 1]*big.Int\n\nfunc exp(k int) *big.Int {\n\tif k < len(mem) && mem[k] != nil {\n\t\treturn mem[k]\n\t}\n\tt := exp(k / 2)\n\tret := new(big.Int).Mul(t, t)\n\tif k&1 != 0 {\n\t\tret.Mul(ret, mem[1])\n\t}\n\tif k < len(mem) {\n\t\tmem[k] = ret\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar k, b, n, t int64\n\tfmt.Scan(&k, &b, &n, &t)\n\tif k == 1 {\n\t\tans := (b*n + b - t) / b\n\t\tif ans < 0 {\n\t\t\tans = 0\n\t\t}\n\t\tfmt.Println(ans)\n\t\treturn\n\t}\n\ttarget := big.NewInt(k)\n\ttarget.Exp(target, big.NewInt(n), nil)\n\ttarget.Mul(target, big.NewInt(k-1+b))\n\tmul := big.NewInt(t*(k-1) + b)\n\tmem[0] = big.NewInt(1)\n\tmem[1] = big.NewInt(k)\n\tcur := new(big.Int)\n\tfmt.Println(sort.Search(int(n), func(n int) bool {\n\t\treturn target.Cmp(cur.Mul(exp(n), mul)) <= 0\n\t}))\n}\n", "lang": "Go", "bug_code_uid": "44cf53d8302454091d48c75bc9d2504a", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "39431ea146926ca5563f9b5f481998cd", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6247319513938527, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"sort\"\n)\n\nvar mem [1e6 + 1]*big.Int\n\nfunc exp(k int) *big.Int {\n\tif mem[k] != nil {\n\t\treturn mem[k]\n\t}\n\tt := exp(k / 2)\n\tmem[k] = new(big.Int).Mul(t, t)\n\tif k&1 != 0 {\n\t\tmem[k].Mul(mem[k], mem[1])\n\t}\n\treturn mem[k]\n}\n\nfunc main() {\n\tvar k, b, n, t int64\n\tfmt.Scan(&k, &b, &n, &t)\n\tif k == 1 {\n\t\tans := (b*n + b - t) / b\n\t\tif ans < 0 {\n\t\t\tans = 0\n\t\t}\n\t\tfmt.Println(ans)\n\t\treturn\n\t}\n\ttarget := big.NewInt(k)\n\ttarget.Exp(target, big.NewInt(n), nil)\n\ttarget.Mul(target, big.NewInt(k-1+b))\n\tmul := big.NewInt(t*(k-1) + b)\n\tmem[1] = big.NewInt(k)\n\tfmt.Println(sort.Search(int(n), func(n int) bool {\n\t\treturn target.Cmp(new(big.Int).Mul(exp(n), mul)) <= 0\n\t}))\n}\n", "lang": "Go", "bug_code_uid": "427edf2cb9015f986db6366d13675222", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "39431ea146926ca5563f9b5f481998cd", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9135254988913526, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nvar mem [1e6 + 1]*big.Int\n\nfunc exp(k int) *big.Int {\n\tif mem[k] != nil {\n\t\treturn mem[k]\n\t}\n\tt := exp(k / 2)\n\tmem[k] = new(big.Int).Mul(t, t)\n\tif k&1 != 0 {\n\t\tmem[k].Mul(mem[k], mem[1])\n\t}\n\treturn mem[k]\n}\n\nfunc main() {\n\tvar k, b, n, t int64\n\tfmt.Scan(&k, &b, &n, &t)\n\tif k == 1 {\n\t\tans := (b*n + b - t) / b\n\t\tif ans < 0 {\n\t\t\tans = 0\n\t\t}\n\t\tfmt.Println(ans)\n\t\treturn\n\t}\n\tmem[0] = big.NewInt(1)\n\tmem[1] = big.NewInt(k)\n\tmul := big.NewInt(k - 1 + b)\n\ttarget := big.NewInt(t*(k-1) + b)\n\tfor i := 0; ; i++ {\n\t\tif target.Cmp(new(big.Int).Mul(exp(i), mul)) < 0 {\n\t\t\tfmt.Println(int(n) - i + 1)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "192cc1bff7fddfb65e8fa27c8c84ba41", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "39431ea146926ca5563f9b5f481998cd", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.899349023535303, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\tvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush() // очищает буфер при выходе из функции main\n\tscanner.Split(bufio.ScanWords) // заставляет scanner считать отдельными токенами слова, разделенные пробелами\n\n\tscanner.Scan()\n\ts1 := scanner.Text()\n\tscanner.Scan()\n\ts1 += scanner.Text()\n\n\tscanner.Scan()\n\ts2 := scanner.Text()\n\tscanner.Scan()\n\ts2 += scanner.Text()\n\n\tse := make([]byte, 0, 3)\n\tsb := make([]byte, 0, 3)\n\tfor i := 0; i < 4; i++ {\n\t\tif s1[i] != 'X' {\n\t\t\tse = append(se, s1[i])\n\t\t}\n\t\tif s2[i] != 'X' {\n\t\t\tsb = append(sb, s2[i])\n\t\t}\n\t}\n\tec := 0\n\teb := 0\n\tgse := string(se)\n\tgsb := string(sb)\n\n\tif gse == \"ABC\" || gse == \"CAB\" || gse == \"BCA\" {\n\t\tec = 1\n\t}\n\tif gsb == \"ABC\" || gsb == \"CAB\" || gsb == \"BCA\" {\n\t\teb = 1\n\t}\n\tif ec == eb {\n\t\twriter.WriteString(\"YES\")\n\t} else {\n\t\twriter.WriteString(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ef6b6ff55bccc0f3252523e5de0b940f", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "9a511c0a43a2e1dd3875566d7ddcd8a3", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.731011608623549, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tarr := gsls(reader)\n\trot := gsli(reader)[0]\n\n\tstart := pos(arr[0])\n\tend := pos(arr[1])\n\n\t// fmt.Printf(\"arr: %#v \\n rot: %#v \\n start: %v \\n end: %v\", arr, rot, start, end)\n\n\tcwEnd := (start + rot) % 4\n\tccwEnd := (start - rot) % 4\n\tif ccwEnd < 0 {\n\t\tccwEnd += 4\n\t}\n\n\tif diff := (end - start) % 4; diff == 0 || diff == 2 {\n\t\tfmt.Print(\"undefined\")\n\t} else if end == cwEnd {\n\t\tfmt.Print(\"cw\")\n\t} else if end == ccwEnd {\n\t\tfmt.Print(\"ccw\")\n\t} else {\n\t\tfmt.Printf(\"cwEnd = %v, ccwEnd = %v\", cwEnd, ccwEnd)\n\t}\n\treturn\n\n}\n\nfunc pos(x string) (pos int) {\n\tswitch x {\n\tcase \"^\":\n\t\tpos = 0\n\tcase \">\":\n\t\tpos = 1\n\tcase \"v\":\n\t\tpos = 2\n\tcase \"<\":\n\t\tpos = 3\n\t}\n\n\treturn\n}\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\n\tinput, _ := reader.ReadString('\\n')\n\n\t// fmt.Printf(\"Got %#v \\n\", input)\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "a7ea00cd9f1402843522eb1cc1b3b439", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "f6cad809f9f0286c7292afebd30bcd07", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9871011541072641, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tarr := gsls(reader)\n\trot := gsli(reader)[0]\n\n\tstart := pos(arr[0])\n\tend := pos(arr[1])\n\n\t// fmt.Printf(\"arr: %#v \\n rot: %#v \\n start: %v \\n end: %v\", arr, rot, start, end)\n\n\tcwEnd := posMod(start+rot, 4)\n\tccwEnd := posMod(start-rot, 4)\n\n\tdiff := posMod(end-start, 4)\n\n\tif diff == 0 || diff == 2 {\n\t\tfmt.Print(\"undefined\")\n\t} else if end == cwEnd {\n\t\tfmt.Print(\"cw\")\n\t} else if end == ccwEnd {\n\t\tfmt.Print(\"ccw\")\n\t} else {\n\t\tfmt.Printf(\"cwEnd = %v, ccwEnd = %v\", cwEnd, ccwEnd)\n\t}\n\treturn\n}\n\nfunc pos(x string) (pos int) {\n\tswitch x {\n\tcase \"^\":\n\t\tpos = 0\n\tcase \">\":\n\t\tpos = 1\n\tcase \"v\":\n\t\tpos = 2\n\tcase \"<\":\n\t\tpos = 3\n\t}\n\n\treturn\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls() (arr []string) {\n\t// Get a full line\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n", "lang": "Go", "bug_code_uid": "5079c194d729122ae3ed6ac42d1f3225", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "f6cad809f9f0286c7292afebd30bcd07", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9987239472564866, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getR(b byte) int {\n\tswitch b {\n\tcase '^':\n\t\treturn 0\n\tcase '>':\n\t\treturn 1\n\tcase 'v':\n\t\treturn 2\n\tcase '<':\n\t\treturn 3\n\t}\n\treturn -1\n}\nfunc main() {\n\tsc := NewScanner()\n\tS, E := sc.Next(), sc.Next()\n\tN := sc.NextInt()\n\n\trS := getR(S[0])\n\trE := getR(E[0])\n\n\tbit := 0\n\n\tif (rS+N)%4 == rE {\n\t\tbit |= 1\n\t}\n\tif (rS-N)%4 == rE {\n\t\tbit |= 2\n\t}\n\tif bit == 1 {\n\t\tfmt.Println(\"cw\")\n\t} else if bit == 2 {\n\t\tfmt.Println(\"ccw\")\n\t} else {\n\t\tfmt.Println(\"undefined\")\n\t}\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", "lang": "Go", "bug_code_uid": "189e4f659b46cc33117627a3745c1939", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "ac96f1c9864923773d714829d58aea46", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9656121045392022, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tvar a, b string\n\tfmt.Scanln(&n, &m)\n\tfmt.Scanln(&a)\n\tfmt.Scanln(&b)\n\tsame := make([]int, len(b))\n\tfor k := range b {\n\t\tj := k\n\t\tfor i := range a {\n\t\t\tif a[i] == b[j] {\n\t\t\t\tsame[k]++\n\t\t\t\tj = (j + 1) % len(b)\n\t\t\t}\n\t\t}\n\t}\n\tj := 0\n\tfor i := 0; i < n; i++ {\n\t\tj += same[j%m]\n\t}\n\tfmt.Println(j / (m * len(b)))\n}\n", "lang": "Go", "bug_code_uid": "60630b01cf52d99805b4009071df90c1", "src_uid": "5ea0351ac9f949dedae1928bfb7ebffa", "apr_id": "7554d2ae34c538e3aa6c4b17a18b2bcf", "difficulty": 2000, "tags": ["dfs and similar", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.28963558920965454, "equal_cnt": 19, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar numCases int\n\tfmt.Scanf(\"%d\", &numCases)\n\n\tanswers := make([]int, numCases)\n\n\tfor i := 0; i < numCases; i++ {\n\t\tvar n, k, d int\n\t\tfmt.Scanf(\"%d %d %d\", &n, &k, &d)\n\t\tfmt.Println(\"d = \", d, \"n = \", n)\n\n\t\t_ = k // unused\n\n\t\tschedule := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tfmt.Scanf(\"%d\", &schedule[j])\n\t\t}\n\n\t\tanswers[i] = solveCase(schedule, d)\n\t}\n\n\tfor _, a := range answers {\n\t\tfmt.Println(a)\n\t}\n}\n\n// solveCase solves single task case for:\n// * schedule -- index - day, value - show id\n// * days -- target number of days for subscription\nfunc solveCase(schedule []int, days int) (numShows int) {\n\tshows := make(map[int]int)\n\n\tfor i := 0; i < days; i++ {\n\t\tshows[schedule[i]]++\n\t}\n\n\tnumShows = len(shows)\n\n\tfor i := days; i < len(schedule); i++ {\n\t\tcnt := shows[schedule[i-days]]\n\t\tif cnt == 1 {\n\t\t\tdelete(shows, schedule[i-days])\n\t\t} else {\n\t\t\tshows[schedule[i-days]]--\n\t\t}\n\n\t\tshows[schedule[i]]++\n\n\t\tif len(shows) < numShows {\n\t\t\tnumShows = len(shows)\n\t\t}\n\t}\n\n\treturn numShows\n}\n", "lang": "Go", "bug_code_uid": "52153f84237124bce008992c9a84a9be", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "1e5388695440be6ce77b7bfe6bb20e00", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9977194982896237, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _, _ := reader.ReadLine()\n\tinputs := strings.Split(string(input), \" \")\n\n\n\tfirst, _ := strconv.Atoi(inputs[0])\n\tsec, _ := strconv.Atoi(inputs[1])\n\tsec = sec - 1\n\tthird, _ := strconv.Atoi(inputs[2])\n\n\tf, _, _ := reader.ReadLine()\n\tprices := strings.Split(string(f), \" \")\n\n\n\tcosts := make([]int, len(prices))\n\tfor i := 0; i < first; i++ {\n\t\tcosts[i], _ = strconv.Atoi(prices[i])\n\t}\n\n\tlowR := 99999\n\tlowL := 99999\n\n\tfor i := sec + 1; i < first; i++ {\n\t\tif costs[i] <= third && costs[i] != 0 {\n\t\t\tlowR = (i - sec) * 10\n\t\t\tbreak\n\t\t}\n\t}\n\n\n\tif sec > 0 {\n\t\tfor i := sec - 1; i >= 0; i-- {\n\t\t\tif costs[i] <= third && costs[i] != 0 {\n\t\t\t\tlowL = (sec - i - 2) * 10\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif lowR >= lowL {\n\t\tfmt.Println(lowL)\n\t} else {\n\t\tfmt.Println(lowR)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "09e42deb6e5f04b239a39abcb63bea5d", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "ae6f7baf92542ae58fffc11bb7ad613a", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.3917995444191344, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d, answer1, answer2, j int\n\tj = 1\n\tanswer1, answer2 = 1000, 1000\n\tvar arr []int\n\tfmt.Scanf(\"%d %d %d\\n\", &a, &b, &c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scanf(\"%d\", &d)\n\t\tarr = append(arr, d)\n\t}\n\tfor i := b; i < len(arr); i++ {\n\t\tif arr[i] <= c && c != 0 {\n\t\t\tanswer1 = i * 10\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := b + 1; i >= 0; i-- {\n\t\tj++\n\t\tif arr[i] <= c && c != 0 {\n\t\t\tanswer2 = j * 10\n\t\t\tbreak\n\t\t}\n\t}\n\tif answer1 > answer2 {\n\t\tfmt.Println(answer2)\n\t} else {\n\t\tfmt.Println(answer1)\n\t}\n}", "lang": "Go", "bug_code_uid": "24d1360a9126f50f667f6ba3b8b7de61", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "0c50ae70745dcc4d7065cf482a5c21a7", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982773471145564, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "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, M, K := sc.NextInt(), sc.NextInt(), sc.NextInt()\n\ta := sc.NextIntArray()\n\n\tM--\n\tleft := -N\n\tright := N\n\tfor i := M - 1; i >= 0; i-- {\n\t\tif a[i] <= K && a[i] != 0 {\n\t\t\tleft = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := M + 1; i < N; i++ {\n\t\tif a[i] <= K && a[i] != 0 {\n\t\t\tright = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(min(M-left, right-M) * 10)\n\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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", "lang": "Go", "bug_code_uid": "c482b7811431b51aaeb809dc76236023", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "fd03f2933f83f95e0609c69f7e73a6f8", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5622406639004149, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 10, "insert_cnt": 2, "fix_ops_cnt": 22, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main(){\n\treader := bufio.NewReader(os.Stdin)\n\tfirstLineTemp, _ := reader.ReadString('\\n')\n\tfirstLine := strings.TrimRight(firstLineTemp, \"\\n\")\n\tfirstLineSlice := strings.Split(firstLine, \" \")\n//\tn := firstLineSlice[0] //总共的数量\n\ttmpM, _ := strconv.Atoi(firstLineSlice[1])\n\tm := tmpM - 1//公主的位置\n\tk, _ := strconv.Atoi(firstLineSlice[2]) //勇者的金钱\n\n\tsecondReader := bufio.NewReader(os.Stdin)\n\tsecondLineTemp, _ := secondReader.ReadString('\\n')\n\tsecondLine := strings.TrimRight(secondLineTemp, \"\\n\")\n\tsecondLineSlice := strings.Split(secondLine, \" \")\n\n\t//开始处理\n\tdistance := 0\n\tfor {\n\t\tif (m + distance >= 0 && secondLineSlice[m + distance] != \"\" && secondLineSlice[m + distance] != \"0\"){\n\t\t\t//进行判断\n\t\t\tcurrentHousePrice, _ := strconv.Atoi(secondLineSlice[m + distance])\n\t\t\tif (currentHousePrice <= k){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (m - distance >= 0 && secondLineSlice[m - distance] != \"\" && secondLineSlice[m - distance] != \"0\"){\n\t\t\t//再次进行判断\n\t\t\tcurrentHousePrice, _ := strconv.Atoi(secondLineSlice[m - distance])\n\t\t\tif (currentHousePrice <= k){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdistance++\n\t}\n\tfmt.Println(distance * 10)\n\treturn ;\n}\n\n", "lang": "Go", "bug_code_uid": "30cfd5f4106c488f7be65831a61c380e", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "0481d992905968e4802e1b98faee6603", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9217877094972067, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, p, l int\n\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &n)\n\n\tfor i := 0; i < n; i++ {\n\t\t\tp = l\n\t\tfmt.Fscan(input, &l)\n\t}\n\n\tif n == 1 {\n\t\tif l == 15 {\n\t\t\tfmt.Println(\"DOWN\")\n\t\t} else if l == 0 {\n\n\t\t\tfmt.Println(\"UP\")\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t\n\treturn\n}\n\tif p > l {\n\t\tif l == 1 {\n\t\t\tfmt.Println(\"UP\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"DOWN\")\n\t} else {\n\t\tif l == 15 {\n\t\t\tfmt.Println(\"DOWN\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"UP\")\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "9953bbc59dc5f184328a2b7119cc8ade", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "d6b85ad62cea3b004278394f8f92de7d", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9025, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nfunc Sum(num int64) int64 {\n\tvar sum int64\n\tsum = 0\n\tfor num > 0 {\n\t\tsum += num % 10\n\t\tnum /= 10\n\t}\n\n\treturn sum\n}\n\nfunc main() {\n\tvar n, a int64\n\n\tfmt.Scanln(&n)\n\n\tstr := strconv.FormatInt(n/2, 10)\n\tdigits := len(str)\n\ta = int64(str[0]-48) * int64(math.Pow10(digits-1))\n\tif digits > 1 {\n\t\ta += a - 1\n\t}\n\n\tfmt.Println(Sum(a) + Sum(n-a))\n}", "lang": "Go", "bug_code_uid": "d9f8443c565f41d483525d7197c1079b", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "fdc18fadc953e093cc819c86bc0ce7db", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8542999289267946, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc scanln(a ...interface{}) { fmt.Fscanln(reader, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n int64\n\tscanln(&n)\n\tvar a,b int64\n\tif n%2 != 0 {\n\t\ta = n / 2\n\t\tb = n - a\n\t} else {\n\t\ta = n / 2 - 1\n\t\tb = n - a\n\t}\n\tvar r int64\n\tfor ;a >0;{\n\t\tr += a%10\n\t\ta /= 10\n\t\t\n\t} \n\tfor b>0 {\n\t\tr += b%10\n\t\tb /= 10\n\t}\n\tprintln(r)\n}", "lang": "Go", "bug_code_uid": "85102513632db29dfb02a4070b4bdd08", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "c643e90bd4572d69f0b3dbe075c998b1", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8666666666666667, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\trd := bufio.NewReader(os.Stdin)\n\tvar n int\n\tvar v int\n\tfmt.Fscanf(rd, \"%d\", &n)\n\tfmt.Fscanf(rd, \"%d\", &v)\n\tvar res int\n\tvar r int\n\tfor i := 0; i < n; i++ {\n\t\tre := n - i\n\t\tif r < re {\n\t\t\ta := 0\n\t\t\tif v < re-r {\n\t\t\t\ta = v\n\t\t\t} else {\n\t\t\t\ta = re - r\n\t\t\t}\n\t\t\tr += a\n\t\t\tres += (i + 1) * a\n\t\t} else {\n\t\t\tr--\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "f124c7a92fdefbe6206d366151186b06", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "c233c6e1fab31d79e32071dad6c5c193", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9982332155477032, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc readLine()(string,error) \t\t\t{ return reader.ReadString('\\n') }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, v int\n\tscanf(\"%d %d\", &n, &v)\n\tvar c int;\n\tif (n < v) {\n\t\tc = n - 1\n\t} else {\n\t\tc = v\n\t\tfor i := 2; i <= n-v; i++ {\n\t\t\tc += i\n\t\t}\n\t}\n\tprintf(\"%d\\n\" ,c)\n}", "lang": "Go", "bug_code_uid": "ce86562ec68436a6bbaa982c3ee63cd4", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "ae64d40cbd6867c9f4a3b2591af38f63", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.95878889823381, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nconst mod = 998244353\nconst N = 10\n\nvar factor = [N + 1][]int{}\nvar primes = []int64{}\n\nfunc comb(m int, n int) int64 {\n\tres := int64(1)\n\tfnm := make([]int, len(primes))\n\tcopy(fnm, factor[n])\n\tfor i, x := range factor[m] {\n\t\tfnm[i] += x\n\t}\n\tfor w := 1; w <= m; w++ {\n\t\tr := int64(1)\n\t\tfor i, p := range primes {\n\t\t\tfor pw := fnm[i] - factor[w][i] - factor[n-w][i] -\n\t\t\t\tfactor[m-w][i]; pw > 0; pw-- {\n\t\t\t\tr *= p;\n\t\t\t}\n\t\t\tr %= mod\n\t\t}\n\t\tres += r\n\t}\n\treturn res % mod\n}\n\nfunc main() {\n\tabc := []int{0, 0, 0}\n\tfmt.Scan(&abc[0], &abc[1], &abc[2])\n\tsort.Ints(abc)\n\tsieve := [N + 1]bool{true, true}\n\tfor p := range sieve {\n\t\tif !sieve[p] {\n\t\t\tprimes = append(primes, int64(p))\n\t\t\tfor q := p * p; q <= N; q += p {\n\t\t\t\tsieve[q] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor j := range factor {\n\t\tfactor[j] = make([]int, len(primes))\n\t}\n\tfor i, p := range primes {\n\t\tfor pp := p; pp <= N; pp *= p {\n\t\t\tfor j := pp; j <= N; j += pp {\n\t\t\t\tfactor[j][i]++\n\t\t\t}\n\t\t}\n\t}\n\ta := factor[0]\n\tfor _, b := range factor {\n\t\tfor i, x := range a {\n\t\t\tb[i] += x\n\t\t}\n\t\ta = b\n\t}\n\tfmt.Println(comb(abc[0], abc[1]) * comb(abc[0], abc[2]) % mod * comb(abc[1], abc[2]) % mod)\n}\n", "lang": "Go", "bug_code_uid": "3a8b263b37807e2418dfc87089a70845", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "7bdda339abed222110343465d20da41b", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9605042016806723, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nconst mod = 998244353\nconst N = 5000\n\nvar factor = [N + 1][]int{}\nvar primes = []int64{}\n\nfunc comb(m int, n int) int64 {\n\tres := int64(1)\n\tfnm := make([]int, len(primes))\n\tcopy(fnm, factor[n])\n\tfor i, x := range factor[m] {\n\t\tfnm[i] += x\n\t}\n\tfor w := 1; w <= m; w++ {\n\t\tr := int64(1)\n\t\tfor i, p := range primes {\n\t\t\tfor pw := fnm[i] - factor[w][i] - factor[n-w][i] -\n\t\t\t\tfactor[m-w][i]; pw > 0; pw-- {\n\t\t\t\tr *= p;\n\t\t\t}\n\t\t\tr %= mod\n\t\t}\n\t\tres += r\n\t}\n\treturn res % mod\n}\n\nfunc main() {\n\tabc := []int{0, 0, 0}\n\tfmt.Scan(&abc[0], &abc[1], &abc[2])\n\tsort.Ints(abc)\n\tsieve := [N + 1]bool{true, true}\n\tfor p := range sieve {\n\t\tif !sieve[p] {\n\t\t\tprimes = append(primes, int64(p))\n\t\t\tfor q := p * p; q <= N; q += p {\n\t\t\t\tsieve[q] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor j := range factor {\n\t\tfactor[j] = make([]int, len(primes))\n\t}\n\tfor i, p := range primes {\n\t\tfor pp := p; pp <= N; pp *= p {\n\t\t\tfor j := pp; j <= N; j += pp {\n\t\t\t\tfactor[j][i]++\n\t\t\t}\n\t\t}\n\t}\n\ta := factor[0]\n\tfor _, b := range factor {\n\t\tfor i, x := range a {\n\t\t\tb[i] += x\n\t\t}\n\t\ta = b\n\t}\n\tfmt.Println(comb(abc[0], abc[1]) * comb(abc[0], abc[2]) % mod * comb(abc[1], abc[2]) % mod)\n}\n", "lang": "Go", "bug_code_uid": "d092315c53235698b2cc869b82765f38", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "7bdda339abed222110343465d20da41b", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9988998899889989, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nconst mod = 998244353\nconst N = 5001\n\nvar factor = [N][]int{}\nvar primes = []int64{}\n\nfunc comb(m int, n int) int64 {\n\tfor i := len(primes) - 1; i >= 0; i-- {\n\t\tif primes[i] <= int64(n) {\n\t\t\tprimes = primes[:i+1]\n\t\t\tbreak\n\t\t}\n\t}\n\tres := int64(1)\n\tfnm := make([]int, len(factor[0]))\n\tcopy(fnm, factor[n])\n\tfor i, x := range factor[m] {\n\t\tfnm[i] += x\n\t}\n\tfor w := 1; w <= m; w++ {\n\t\tfw, fmw, fnw, r := factor[w], factor[m-w], factor[n-w], int64(1)\n\t\tfor i, p := range primes {\n\t\t\tfor pw := fnm[i] - fw[i] - fmw[i] - fnw[i]; pw > 0; pw >>= 1 {\n\t\t\t\tif pw&1 == 1 {\n\t\t\t\t\tr = r * p % mod\n\t\t\t\t}\n\t\t\t\tp = p * p % mod\n\t\t\t}\n\t\t}\n\t\tres += r\n\t}\n\treturn res % mod\n}\n\nfunc main() {\n\tabc := []int{0, 0, 0}\n\tfmt.Scan(&abc[0], &abc[1], &abc[2])\n\tsort.Ints(abc)\n\ta, b, c := abc[0], abc[1], abc[2]\n\tsieve := [N]bool{true, true}\n\tfor p := range sieve {\n\t\tif !sieve[p] {\n\t\t\tprimes = append(primes, int64(p))\n\t\t\tfor q := p * p; q < N; q += p {\n\t\t\t\tsieve[q] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor j := range factor {\n\t\tfactor[j] = make([]int, len(primes))\n\t}\n\tfor i, p := range primes {\n\t\tfor pp := p; pp < N; pp *= p {\n\t\t\tfor j := pp; j < N; j += pp {\n\t\t\t\tfactor[j][i]++\n\t\t\t}\n\t\t}\n\t}\n\tcur := factor[2]\n\tfor _, nxt := range factor[3:c+1] {\n\t\tfor i, x := range cur {\n\t\t\tnxt[i] += x\n\t\t}\n\t\tcur = nxt\n\t}\n\tfmt.Println(comb(b, c) * comb(a, c) % mod * comb(a, b) % mod)\n}\n", "lang": "Go", "bug_code_uid": "45639c3a39b8614a9f7e40cf18d2a9a9", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "7bdda339abed222110343465d20da41b", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4073455759599332, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar input string\n\n\tfmt.Scanln(&input)\n\tnum, _ := strconv.Atoi(input)\n\n\tstrings.Split(\"\", input)\n\tvar decimal string = string(input[len(input)-2])\n\tvar unidad string = string(input[len(input)-1])\n\n\t//fmt.Println(\"Decimal: \", decimal)\n\t//fmt.Println(\"Unidad: \", unidad)\n\n\tif num % 4 == 0 || num % 7 == 0 || evalDecimal(decimal, unidad){\n\t\tfmt.Println(\"YES\")\n\t\tos.Exit(0)\n\t}\n\n\tfmt.Println(\"NO\")\n}\n\nfunc evalDecimal(d string, u string) bool{\n\tif d == \"4\" || d == \"7\"{\n\t\t//fmt.Println(\"Decimal es 4 o 7\")\n\t\tif u == \"4\" || u == \"7\" {\n\t\t\t//fmt.Println(\"Unidad es 4 o 7\")\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n", "lang": "Go", "bug_code_uid": "c9d4a3423d954bad9dce3e5a0bde36e1", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "752b298a5d77d63712fcc59e2af3061e", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5358744394618834, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tcy, err := strconv.Atoi(os.Args[1])\n\tif err != nil {\n\t\tfmt.Println(-2)\n\t\treturn\n\t}\n\tcc := cy / 10\n\tcp := cy\n\ti := 0\n\tfor cc > 0 {\n\t\tcp = cc\n\t\tcc = cc / 10\n\t\ti++\n\t}\n\tfmt.Println((cp+1)*(int(math.Pow10(i))) - cy)\n}\n", "lang": "Go", "bug_code_uid": "0f0545e81cfd7ba2dccd3c3c7620f76e", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "208fb0a11ececd8aac57cf72e076cbd4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8553719008264463, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n count := strings.Count(s[1:], \"0\")\n if count == len(s) - 1 {\n fmt.Println(s)\n return\n }\n if s[0:1] != \"9\" {\n c := s[0] + 1\n res := string(c)\n for i := 0; i < len(s) - 1; i++ {\n res += \"0\"\n }\n fmt.Println(res)\n return\n }\n res := \"1\"\n for i := 0; i < len(s); i++ {\n res += \"0\"\n }\n fmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "5298e59722d9a1c47931e3637117798e", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "11edea5f76d5390f9c30a161c6647f8b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9333333333333333, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tmax := 10e9\n\tmin := float64(1)\n\tstep := float64(1)\n\tvar n string\n\t_, _ = fmt.Scanln(&n)\n\tcurrent, _ := strconv.ParseFloat(n, 64)\n\n\tnext := min\n\tsize := min\n\tfor next < max {\n\t\tnext += step\n\t\tif len(fmt.Sprintf(\"%f\", next)) != len(fmt.Sprintf(\"%f\", size)) {\n\t\t\tsize = next\n\t\t\tstep *= 10\n\t\t}\n\n\t\tif next - current > 0 {\n\t\t\tfmt.Println(next - current)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "5a7e6dbdb0f9e53a4fd8722e18020f1c", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "be8a3e52f1cb0f923e21aeb05f191ed2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9909805062554553, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { 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\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 1 << 60\n\n\tfor x[len(x)-1]*ax+bx <= mat && y[len(y)-1]*ay+by < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < len(x); i++ {\n\t\tfor j := i; j < len(x); j++ {\n\t\t\tltor := x[j]-x[i]+y[j]-y[i]\n\t\t\ttol := abs(xs-x[i])+abs(ys-y[i])\n\t\t\ttor := abs(xs-x[j])+abs(ys-y[j])\n\n\t\t\tif t >= ltor+tor || t >= tol+ltor {\n\t\t\t\t// fmt.Println(ltor,tol,ltor+tor,j,i)\n\t\t\t\tans = max(ans, j-i+1)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\t// fmt.Println(x)\n\n}\n", "lang": "Go", "bug_code_uid": "49f8d302b70026db9bd91123d9533505", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "2e808b904b2edc19cddee797ab159315", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8018171493469619, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { 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\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 100000000000000000\n\n\tfor x[len(x)-1] < mat || y[len(y)-1] < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tto := int64(0)\n\tans := 0\n\n\tdone := make([]bool, len(x))\n\n\tfor {\n\t\tmi := int64(1 << 63 -1)\n\t\tnext := -1\n\t\tfor i := 0; i < len(x); i++ {\n\t\t\tif done[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif mi > abs(xs-x[i])+abs(ys-y[i]) {\n\t\t\t\tnext = i\n\t\t\t\tmi = abs(xs-x[i])+abs(ys-y[i])\n\t\t\t}\n\t\t}\n\n\t\tif next == -1 {\n\t\t\tbreak\n\t\t}\n\n\t\tif to+mi > t {\n\t\t\tbreak\n\t\t}\n\n\t\tans++\n\t\tto += mi\n\t\txs = x[next]\n\t\tys = y[next]\n\t\tdone[next] = true\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "lang": "Go", "bug_code_uid": "ae5b66b2d026ae1dfcdd22bad5c60275", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "2e808b904b2edc19cddee797ab159315", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9520132377275234, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nconst M int = 998244353\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n fmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a ...interface{}) {\n fmt.Fscanf(reader, f, a...)\n}\n\nfunc sp(x, y int) int {\n var mul, res int = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n defer writer.Flush()\n var n, m, k int\n scanf(\"%d%d%d\", &n, &m, &k)\n printf(\"%d %d %d\\n\", n, m, k);\n fac := make([]int, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * i) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(m-1, k)) % M\n sol = (sol * m) % M\n printf(\"%d\\n\", sol)\n}", "lang": "Go", "bug_code_uid": "c512105834eb1276b85269f8c3713b99", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "218de4409d6dbe3fcec3eae52fbdff66", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7919543680576403, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst fn1 = \"What are you doing while sending \\\"\"\nconst fn2 = \"\\\"? Are you busy? Will you send \\\"\"\nconst fn3 = \"\\\"?\"\nconst f1 = \"What are you doing at the end of the world? Are you busy? Will you save us?\"\n\nfunc solve() {\n\ttab := make([]uint64, 65)\n\ttab[0] = uint64(len(f1))\n\tfor i := 1; i < len(tab); i++ {\n\t\ttab[i] = uint64(len(fn1)+len(fn2)+len(fn3)) +\n\t\t\ttab[i-1] + tab[i-1]\n\t}\n\t//\tfmt.Println(tab)\n\n\tq := readInt()\n\tfor i := 0; i < q; i++ {\n\t\tn := readInt()\n\t\tk := readUInt64() - 1\n\n\t\tfor n >= len(tab) && k >= uint64(len(fn1)) {\n\t\t\tn -= 1\n\t\t\tk -= uint64(len(fn1))\n\t\t}\n\n\t\tfmt.Print(string(get_str(tab, n, k)))\n\t}\n}\n\nfunc get_str(tab []uint64, n int, k uint64) byte {\n\tif n == 0 {\n\t\treturn f1[k]\n\t}\n\n\tif k < uint64(len(fn1)) {\n\t\treturn fn1[k]\n\t}\n\tk -= uint64(len(fn1))\n\n\tif k < tab[n-1] {\n\t\treturn get_str(tab, n-1, k)\n\t}\n\tk -= tab[n-1]\n\n\tif k < uint64(len(fn2)) {\n\t\treturn fn2[k]\n\t}\n\tk -= uint64(len(fn2))\n\n\tif k < tab[n-1] {\n\t\treturn get_str(tab, n-1, k)\n\t}\n\tk -= tab[n-1]\n\n\tif k < uint64(len(fn3)) {\n\t\treturn fn3[k]\n\t}\n\n\treturn '.'\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readUInt64() uint64 {\n\tv, _ := strconv.ParseUint(readString(), 10, 64)\n\treturn v\n}\n", "lang": "Go", "bug_code_uid": "9a1574ed9139b7b6bd42c06a74df0b02", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "ad5a982f79d869da710d8fd17b4ae5cb", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9326718639262934, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar scanner = bufio.NewScanner(reader)\nvar lens [200000]int64\n\nconst (\n\tf0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\"\n\tfi0 = \"What are you doing while sending \\\"\"\n\tfi1 = \"\\\"? Are you busy? Will you send \\\"\"\n\tfi2 = \"\\\"?\"\n)\n\nfunc f(n int, k int64) byte {\n\tfor {\n\t\tif n == 0 {\n\t\t\tif k < int64(len(f0)) {\n\t\t\t\treturn f0[k]\n\t\t\t}\n\t\t\treturn '.'\n\t\t}\n\n\t\tif k < int64(len(fi0)) {\n\t\t\treturn fi0[k]\n\t\t}\n\t\tk -= int64(len(fi0))\n\n\t\tnxtlen := lens[n-1]\n\t\t//fmt.Println(\"len \", n-1, nxtlen)\n\t\tif k < nxtlen {\n\t\t\tn--\n\t\t\tcontinue\n\t\t}\n\t\tk -= nxtlen\n\n\t\tif k < int64(len(fi1)) {\n\t\t\treturn fi1[k]\n\t\t}\n\t\tk -= int64(len(fi1))\n\n\t\tif k < nxtlen {\n\t\t\tn--\n\t\t\tcontinue\n\t\t}\n\t\tk -= nxtlen\n\n\t\tif k < int64(len(fi2)) {\n\t\t\treturn fi2[k]\n\t\t}\n\t\treturn '.'\n\t}\n}\n\nfunc readint() int {\n\tscanner.Scan()\n\ti, _ := strconv.ParseInt(scanner.Text(), 10, 32)\n\treturn int(i)\n}\n\nfunc readint64() int64 {\n\tscanner.Scan()\n\ti, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tlens[0] = int64(len(f0))\n\tfor i := 1; i < cap(lens); i++ {\n\t\tlens[i] = int64(len(fi0)+len(fi1)+len(fi2)) + 2*lens[i-1]\n\t}\n\n\tq := readint()\n\n\tfor i := 0; i < q; i++ {\n\t\tn, k := readint(), readint64()-1\n\t\tfmt.Print(string(f(n, k)))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "3c63083889cc5813276a2322b15ac11c", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "cadb3648a40c445caa0596dc0b8382af", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8723702664796634, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var k,a,b,v int\n fmt.Scan(&k,&a,&b,&v)\n n := int(math.Ceil(float64(a)/float64(v)))\n ans := b/(k-1)\n n -= (ans*k)\n if (b%(k-1) != 0) {\n ans++\n n -= (b%(k-1))+1\n }\n if (n >= 0) { ans += n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "ec097bcea5e5ab708666f8721d70d00c", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "227d21d4e949c03cfcd7e42b89afec9b", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7877358490566038, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "// 402A-mic_rizal\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k, a, b, n, hasil int\n fmt.Scan(&k, &a, &b, &n)\n for a > 0 {\n if b >= k-1 {\n b -= (k - 1)\n a -= n * k\n hasil++\n } else if b == 1 {\n a -= n * (b + 1)\n hasil++\n b = 0\n } else {\n a -= n\n hasil++\n }\n }\n fmt.Println(hasil)\n}\n", "lang": "Go", "bug_code_uid": "adcdd95c879d656809013b924b0d0947", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "bffbcb6fb4795053c0a414ff0bb5ff5a", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9297297297297298, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main () {\n\tvar a, b, c int32\n\tresult := 1\n\tfmt.Scan(&a);\n\tfmt.Scan(&b);\n\tfmt.Scan(&c);\n\tif (a%c == 0) {\n\t\tresult *= a/c\n\t} else {\n\t\tresult *= (a/c)+1\n\t}\n\tif (b%c == 0) {\n\t\tresult *= b/c\n\t} else {\n\t\tresult *= (b/c)+1\n\t}\n\tfmt.Println(result)\n}", "lang": "Go", "bug_code_uid": "9bfb8dad2f9254162ca12ded6323b1dd", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6a318cf93acfac1297f7cb69f21c5a9a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.89375, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 9, "bug_source_code": "import (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scanf(\"%d %d %d\",&n, &m, &a)\n\twidth := n/a+1;\n\theight := m/a+1;\n\tfmt.Println(width*height)\n}", "lang": "Go", "bug_code_uid": "baa5ae9855630d6377039ba120eb7319", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2022e60657286cfabada19577ea97d27", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.97165991902834, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n,m,a int \n fmt.Scan(&n,&m,&a)\n var tiles1,tiles2 uint = n/a, m/a\n \n if(n%a!=0) {tiles1++}\n if(m%a!=0) {tiles2++}\n \n var hasil uint = tiles1 * tiles2\n fmt.Println(hasil)\n}", "lang": "Go", "bug_code_uid": "26942fa4dc57d81ca269e2e74e7e49f8", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "848c6017203d7fe18cb132eb288ae2e8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9676425269645609, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, a int64\n\tfmt.Scanf(\"%d%d%d\", &n, &m, &a)\n\tvar inN, inM int64 = n / a, m / a\n\tvar count int64 = inN * inM\n\tvar add bool = true\n\tif n % a == 0 {\n\t\tcount = n / a\n\t} else {\n\t\tcount = n / a + 1\n\t}\n\tif m % a == 0 {\n\t\tcount *= m / a\n\t} else {\n\t\tcount *= m / a + 1\n\t}\t\n\tfmt.Println(count)\n}", "lang": "Go", "bug_code_uid": "30ca72790e7cf3385190a1f13dbd87f5", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2e61e82dc72ac16b9420126f53e0dae1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.43144424131627057, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, a, count int\n\tfmt.Scanf(\"%d%d%d\", &n, &m, &a)\n\tvar nn, mm int = n, m\n\tfor {\n\t\tif nn < n {\n\t\t\tnn += n\n\t\t\tcount++\n\t\t}\n\t\tif mm < m {\n\t\t\tmm += m\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "lang": "Go", "bug_code_uid": "d669368980f6e8dcf6d860c4af49dc73", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2e61e82dc72ac16b9420126f53e0dae1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.979757085020243, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar m,n,a int64\nfunc main() {\n\tfmt.Scanf(\"%d %d %d\",&m,&n,&a)\n\n\tvar s int\n\ty:=n/a \n\tif float64(n)/float64(a)>float64(y){\n\ty=y+1\n\t} \n\t\n\tx:=m/a\n\tif float64(m)/float64(a)>float64(x){\n\tx=x+1\n\t} \n\t\n\ts=y*x\n\tfmt.Println(s)\n}\n", "lang": "Go", "bug_code_uid": "23e2f7f830d0c405dedc4ce8f9871a20", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fa07e6f634c47601e6d8549d7aa3c1e0", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9956416464891041, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ta, b := nextInt(), nextInt()\n\n\tif a < b {\n\t\tprintln(0)\n\t} else if a == b {\n\t\tprintln(\"infinity\")\n\t} else {\n\t\tcount := 0\n\t\t// for i := 1; i <= a; i++ {\n\t\t// \tif a % i == b {\n\t\t// \t\tprintln(i)\n\t\t// \t\tcount++\n\t\t// \t}\n\t\t// }\n\n\t\tmod := a - b\n\t\ti := 1\n\n\t\tfor ; i * i < mod; i++ {\n\t\t\tif mod % i == 0 {\n\t\t\t\tif mod / i > b {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\n\t\t\t\tif i > b {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif i * i == mod {\n\t\t\tcount++\n\t\t}\n\n\t\tprintln(count)\n\t}\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}", "lang": "Go", "bug_code_uid": "09ec22d3b8695638238d10efb0cbc6ed", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "0b1a3adf7a85a0f6e72f0d240a800678", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8563656147986942, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ta, b := nextInt(), nextInt()\n\n\tif a < b {\n\t\tprintln(0)\n\t} else if a == b {\n\t\tprintln(\"infinity\")\n\t} else {\n\t\tcount := 0\n\t\tfor i := 1; i <= a; i++ {\n\t\t\tif a % i == b {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\n\t\tprintln(count)\n\t}\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}", "lang": "Go", "bug_code_uid": "342c75404a56572db6709c9f9e1216c6", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "0b1a3adf7a85a0f6e72f0d240a800678", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9034749034749034, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n, m, k int\n\tvar a [50]int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tm, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tk, _ = strconv.Atoi(r.Text())\n\tsum := 0\n\tx := 0\n\ti := 0\n\tfor i:=0; ik {\n\t\tfor i:=49; i>=0; i-- {\n\t\t\tif a[i] > 0 {\n\t\t\t\tk += i;\n\t\t\t\ta[i] -= 1\n\t\t\t\tsum += 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i<0 {\n\t\t\tw.WriteString(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tw.WriteString(strconv.Itoa(sum)+\"\\n\")\n\tw.Flush()\n}\n", "lang": "Go", "bug_code_uid": "a66c3675e94cd629c7b59c03ac6b6027", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "11a4e1d0ecfaf383ae8b8e42ba4295e0", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9557416267942583, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "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\nfunc ReadNumber(in *bufio.Reader) int64 {\n\tline, _ := in.ReadString('\\n')\n\tnum, _ := strconv.ParseInt(strings.TrimSpace(line[:len(line)-1]), 10, 64)\n\treturn num\n}\n\nfunc ReadArray(in *bufio.Reader) []int64 {\n\tline, _ := in.ReadString('\\n')\n\tstrs := strings.Split(strings.TrimSpace(line[:len(line)-1]), \" \")\n\tnums := make([]int64, len(strs))\n\tfor i, str := range strs {\n\t\tnums[i], _ = strconv.ParseInt(str, 10, 64)\n\t}\n\treturn nums\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tnums := ReadArray(in)\n\tmax_val := nums[0] - int64(math.Ceil((1.0 + math.Sqrt(float64(1 + 8 * nums[1]))) / 2))\n\tfmt.Printf(\"%d %d\", max(nums[0] - nums[1]*2, 0), max_val)\n}\n", "lang": "Go", "bug_code_uid": "76055480443d19ea9eaf415c0d012e68", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "5661c90758539040f259685901d73d64", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9723756906077348, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tm := readInt64()\n\tmaxAns := int64(0)\n\tfor i := int64(2); i < 1000000; i++ {\n\t\tt := i * (i - 1) / 2\n\t\tif t >= m {\n\t\t\tmaxAns = n - i\n\t\t\tbreak\n\t\t}\n\t}\n\tif 2 * m < n {\n\t\tfmt.Println(n - (2 * m), maxAns)\n\t} else {\n\t\tfmt.Println(0, maxAns)\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n", "lang": "Go", "bug_code_uid": "8d9b8cc2f930bdcadf5bae9f72dcf073", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "576e80cb83107238ff0d7cf0abd69985", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9976384151141433, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// Codeforces 1065 B Vasya and Isolated Vertices\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i= int64(n)) {\n\t\tminV = 0\n\t} else {\n\t\tminV = int(int64(n) - 2*m)\n\t}\n\t// max izo - when part is fully connected\n\tn6 := int64(0)\n\tfor ; n6 <= int64(n); n6++ {\n\t\tee := n6*(n6-1)/2\n\t\tif m == ee {\n\t\t\tmaxV = n - int(n6)\n\t\t} else if m > ee {\n\t\t\tmaxV = n - (int(n6) + 1)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t} \n}\n\nfunc printRes() {\n\tfmt.Printf(\"%v %v\\n\", minV, maxV)\n}\n\nfunc main() {\n\treadData()\n\tsolve()\n\tprintRes()\n}\n\n", "lang": "Go", "bug_code_uid": "33558773e8aab5e0a49fc5c5a06a2921", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "efe9a509272b848896666221dfd661ea", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.93666204345816, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "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, M := sc.NextInt(), sc.NextInt()\n\tif M == 0 {\n\t\tfmt.Println(N, N)\n\t\treturn\n\t}\n\tfmt.Println(N-2*M, N-(M+1))\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", "lang": "Go", "bug_code_uid": "24be15ace63f929dd2b8718163ca7e61", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "d87c2d5970bf4f0c08343ed8753d849f", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8732283464566929, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar rotate = [][]int{\n\t{5, 6, 17, 18, 21, 22, 13, 14},\n\t{7, 8, 19, 20, 23, 24, 15, 16},\n\t{3, 4, 19, 20, 23, 24, 15, 16},\n\t{1, 2, 18, 20, 12, 11, 15, 13},\n\t{2, 4, 6, 8, 10, 12, 23, 21},\n\t{1, 3, 5, 7, 9, 11, 24, 22}}\n\nfunc main() {\n\tvar cube = make([]int, 24)\n\tfor i := 0; i < 24; i++ {\n\t\tfmt.Scanf(\"%d\", &cube[i])\n\t}\n\t//check already solved\n\tif check_solved(cube) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\t//rotate\n\tfor i := 0; i < 6; i++ {\n\t\t//90-angle\n\t\tif check_rotate(cube, rotate[i], move_left2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\t//another 90-angle\n\t\tif check_rotate(cube, rotate[i], move_right2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc move_left2(in []int) []int {\n\tret := append(in[2:len(in)], in[0:2]...)\n\treturn ret\n}\n\nfunc move_right2(in []int) []int {\n\tret := append(in[len(in)-2:len(in)], in[0:len(in)-2]...)\n\treturn ret\n}\n\nfunc check_rotate(cube, rotate, moved []int) bool {\n\tafter := make([]int, len(cube))\n\tcopy(after, cube)\n\tfor i := 0; i < 8; i++ {\n\t\tafter[moved[i]-1] = cube[rotate[i]-1]\n\t}\n\treturn check_solved(after)\n}\n\nfunc check_solved(cube []int) bool {\n\tfor i := 0; i < 6; i++ {\n\t\tif cube[i*4] != cube[i*4+1] || cube[i*4] != cube[i*4+2] || cube[i*4] != cube[i*4+3] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "lang": "Go", "bug_code_uid": "40d1839a2162a798b0b7522f6c5c7cd5", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "60d460414ad282a74fef9da17825eb40", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5359189070074923, "equal_cnt": 25, "replace_cnt": 20, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 24, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tvar data [6][2][2]int\n\tfor i := 0; i < 20; i++ {\n\t\tdata[i/4][(i%4)/2][i%2] = readInt()\n\t}\n\tdata[5][1][1] = readInt()\n\tdata[5][1][0] = readInt()\n\tdata[5][0][1] = readInt()\n\tdata[5][0][0] = readInt()\n\n\tvar sides []int\n\tif isSideFull(&data, 3) && isSideFull(&data, 4) {\n\t\tsides = []int{0, 1, 2, 5}\n\t} else if isSideFull(&data, 0) && isSideFull(&data, 2) {\n\t\tsides = []int{1, 4, 5, 3}\n\t} else if isSideFull(&data, 1) && isSideFull(&data, 5) {\n\t\tsides = []int{0, 4, 2, 3}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\trotate0(&data, 1, sides)\n\tif isSolved(&data) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\trotate0(&data, -1, sides)\n\trotate0(&data, -1, sides)\n\tif isSolved(&data) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc isSolved(data *[6][2][2]int) bool {\n\tfor i := 0; i < 6; i++ {\n\t\tif !isSideFull(data, i) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc rotate0(data *[6][2][2]int, dir int, sides []int) {\n\tvar nums [4][2]int\n\tfor i := 0; i < len(sides); i++ {\n\t\tside := sides[i]\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tnums[i][j] = data[side][j][0]\n\t\t}\n\t}\n\tfor i := 0; i < len(sides); i++ {\n\t\tside := sides[(i+dir+4)%4]\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tdata[side][j][0] = nums[i][j]\n\t\t}\n\t}\n}\n\nfunc isSideFull(data *[6][2][2]int, side int) bool {\n\tcolor := data[side][0][0]\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tif data[side][i][j] != color {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang": "Go", "bug_code_uid": "46fa7cb370557d00b6834485b56c87b5", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "f298b7c399bd0c410f026d3370cc2a37", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9981718464351006, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a [3][2]int\n\tfor i := 0; i < 3; i++ {\n\t\tif _, err := fmt.Scanf(\"%d %d\\n\", &a[i][0], &a[i][1]); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tm := a[0][0]\n\tn := a[0][1]\n\tfor j := 0; j < 2; j++ {\n\t\ts := a[1][j]\n\t\tt := a[1][(j+1)%2]\n\t\tfor k := 0; k < 2; k++ {\n\t\t\tu := a[2][k]\n\t\t\tv := a[2][(k+1)%2]\n\n\t\t\tif (s+u <= m && max(t, v) <= n) || (t+v <= m && max(s, u) <= m) {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\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", "lang": "Go", "bug_code_uid": "75acd057aed2039851c98af9b0a9e3fb", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "d8bb2c59c08e61fa0ab8e6e83b9d139c", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9782903663500678, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc can_place_in(a1, b1, a2, b2 int) bool {\n\tif a1 >= a2 && b1 >= b2 {\n\t\treturn true\n\t} else if a1 >= b2 && b1 >= a2 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc main() {\n\t// f, _ := os.Open(\"input.txt\")\n\tf := os.Stdin\n\tvar a1, b1, a2, b2, a3, b3 int\n\tfmt.Fscanf(f, \"%d %d\\n%d %d\\n%d %d\", &a1, &b1, &a2, &b2, &a3, &b3)\n\t// puts B into A 2 times\n\tvar res bool\n\tres = false\n\tif b1 >= b2 && (can_place_in(a1-a2, b1, a3, b3) || can_place_in(a1, b1-b2, a3, b3)) {\n\t\tres = true\n\t}\n\tvar tmp int\n\ttmp = a2\n\ta2 = b2\n\tb2 = tmp\n\tif b1 >= b2 && (can_place_in(a1-a2, b1, a3, b3) || can_place_in(a1, b1-b2, a3, b3)) {\n\t\tres = true\n\t}\n\n\tif res {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "96c2ad2dcbb4ce73e59cc3b6b88afb86", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "64816c299cc5e46eac2d5b71c5d8c21e", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9805157593123209, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"math\"\n\t\"sort\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\n\ta := make([]int, n)\n\tpermutations := make([][]int, 0, 10)\n\tmaxP := 0\n\tminP := 0\n\n\tfor i := range a {\n\t\ta[i] = i+1\n\t}\n\n\tfor i := n-1; i > 0; {\n\t\tminP = sumMin(a)\n\t\tif maxP < minP {\n\t\t\tmaxP = minP\n\t\t\tpermutations = make([][]int, 0, 10)\n\t\t} \n\n\t\tif maxP <= minP {\n\t\t\tb := make([]int, n)\n\t\t\tcopy(b, a)\n\t\t\tpermutations = append(permutations, b)\n\t\t}\n\t\t// println(a, minP, maxP, permutations)\n\n\t\ti = n-1\n\n\t\tfor ; i > 0; i-- {\n\t\t\tif a[i] > a[i-1] {\n\t\t\t\tsort.Ints(a[i:])\n\n\t\t\t\tfor j := i; j < n; j++ {\n\t\t\t\t\tif a[i-1] < a[j] {\n\t\t\t\t\t\ta[i-1], a[j] = a[j], a[i-1]\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfor i := range a {\n\t\tprintf(\"%d \", permutations[m-1][i])\n\t}\n\n\tprintln()\n}\n\nfunc sumMin(a []int) int {\n\tsum := 0\n\n\tfor i := range a {\n\t\tfor j := i; j < len(a); j++ {\n\t\t\tsum += min(a[i:j+1]...)\n\t\t}\n\t}\n\n\treturn sum\n}\n\nfunc min(a ...int) int {\n\tmin := math.MaxInt32\n\n\tif a != nil {\n\t\tfor i := range a {\n\t\t\tif min > a[i] {\n\t\t\t\tmin = a[i]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn min\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "303241d9ca5e48a7f5ebdb5767500de8", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "0c2cfc63ea8e5757d9953dad6a67ad5a", "difficulty": 1400, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9983108108108109, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"math\"\n\t\"sort\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\n\ta := make([]int, n)\n\tpermutations := make([][]int, 0, 10)\n\tmaxP := 0\n\tminP := 0\n\n\tif n == 1 {\n\t\tprintln(1)\n\t\treturn\n\t}\n\n\tfor i := range a {\n\t\ta[i] = i+1\n\t}\n\n\tfor i := n-1; i > 0; {\n\t\tminP = sumMin(a)\n\t\tif maxP < minP {\n\t\t\tmaxP = minP\n\t\t\tpermutations = make([][]int, 0, 10)\n\t\t} \n\n\t\tif maxP <= minP {\n\t\t\tb := make([]int, n)\n\t\t\tcopy(b, a)\n\t\t\tpermutations = append(permutations, b)\n\t\t}\n\t\tprintln(a, minP, maxP, permutations)\n\n\t\ti = n-1\n\n\t\tfor ; i > 0; i-- {\n\t\t\tif a[i] > a[i-1] {\n\t\t\t\tsort.Ints(a[i:])\n\n\t\t\t\tfor j := i; j < n; j++ {\n\t\t\t\t\tif a[i-1] < a[j] {\n\t\t\t\t\t\ta[i-1], a[j] = a[j], a[i-1]\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\n\tprintln(a, permutations)\n\tfor i := range a {\n\t\tprintf(\"%d \", permutations[m-1][i])\n\t}\n\n\tprintln()\n}\n\nfunc sumMin(a []int) int {\n\tsum := 0\n\n\tfor i := range a {\n\t\tfor j := i; j < len(a); j++ {\n\t\t\tsum += min(a[i:j+1]...)\n\t\t}\n\t}\n\n\treturn sum\n}\n\nfunc min(a ...int) int {\n\tmin := math.MaxInt32\n\n\tif a != nil {\n\t\tfor i := range a {\n\t\t\tif min > a[i] {\n\t\t\t\tmin = a[i]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn min\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang": "Go", "bug_code_uid": "a2bacbe94bca64ca13d11e11915227a3", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "0c2cfc63ea8e5757d9953dad6a67ad5a", "difficulty": 1400, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9637681159420289, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"strconv\"\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n// var file, _ = os.Open(\"input.txt\")\n// var outfile, _ = os.Create(\"output.txt\")\n// var in = bufio.NewScanner(file)\n// var out = bufio.NewWriter(outfile)\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n if !in.Scan() {\n panic(\"Scan error\")\n }\n return in.Text()\n}\n\nfunc nextInt() int {\n ret, _ := strconv.Atoi(next())\n return ret\n}\n\nfunc nextInt64() int64 {\n ret, _ := strconv.ParseInt(next(), 10, 64)\n return ret\n}\n\nfunc nextFloat() float64 {\n ret, _ := strconv.ParseFloat(next(), 64)\n return ret\n}\n\nfunc swap(a []int, i int, j int) {\n a[i], a[j] = a[j], a[i]\n}\n\nfunc reverse(a []int, i int, j int) {\n for i < j {\n swap(a, i, j)\n i++\n j--\n }\n}\n\nfunc nextPermutation(a []int) bool {\n k := len(a) - 2\n for k > -1 && a[k] > a[k + 1] { k-- }\n if k == -1 { return false }\n l := len(a) - 1\n for k < l && a[k] > a[l] { l-- }\n swap(a, k, l)\n reverse(a, k + 1, len(a) - 1)\n return true\n}\n\nfunc f(a []int) int {\n n := len(a)\n sum := 0\n for i := 0; i < n; i++ {\n for j := i; j < n; j++ {\n min := -1;\n for k := i; k <= j; k++ {\n if min == -1 || min > a[k] {\n min = a[k]\n }\n }\n sum += min\n }\n }\n return sum\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n n := nextInt()\n m := nextInt()\n a := make([]int, n)\n for i := 0; i < n; i++ {\n a[i] = i + 1\n }\n ms := f(a)\n for nextPermutation(a) {\n sum := f(a)\n if ms < sum { ms = sum }\n }\n for i := 0; i < n; i++ {\n a[i] = i + 1\n }\n if ms == f(a) {\n m--\n }\n for nextPermutation(a) {\n sum := f(a)\n if ms == sum {\n m--\n if m == 0 {\n for i := 0; i < n; i++ {\n fmt.Fprint(out, strconv.Itoa(a[i]) + \" \")\n }\n fmt.Fprintln(out)\n return\n }\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "c2df709716db5073e60417c9fa202f04", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "f2d313b63bb71528b54a66d0dbfccd49", "difficulty": 1400, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.996060776589758, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\n// MAX32 is\nvar MAX32 int32 = 2147483647\n\n// MIN32 is\nvar MIN32 int32 = -2147483648\n\n// MAX64 is\nvar MAX64 int64 = 9223372036854775807\n\n// MIN64 is\nvar MIN64 int64 = -9223372036854775808\n\nfunc ri32(pn *int32) {\n\tfmt.Scanf(\"%d\", pn)\n}\nfunc rai32(nums int32) []int32 {\n\tre := make([]int32, nums+1, nums+1)\n\tfor idx := int32(1); idx != nums+1; idx++ {\n\t\tri32(&re[idx])\n\t}\n\treturn re\n}\n\nfunc ri64(pn *int64) {\n\tfmt.Scanf(\"%d\", pn)\n}\nfunc rai64(nums int64) []int64 {\n\tre := make([]int64, nums+1, nums+1)\n\tfor idx := int64(1); idx != nums+1; idx++ {\n\t\tri64(&re[idx])\n\t}\n\treturn re\n}\n\nfunc rstr(ps *string) {\n\tfmt.Scanf(\"%s\", ps)\n}\nfunc rastr(nums int32) []string {\n\tre := make([]string, nums+1, nums+1)\n\tfor idx := int32(1); idx != nums+1; idx++ {\n\t\trstr(&re[idx])\n\t}\n\treturn re\n}\n\n// OUT is\nvar OUT string\n\nfunc oi32(i int32) {\n\tOUT += fmt.Sprintf(\"%d\", i)\n}\nfunc oi64(i int64) {\n\tOUT += fmt.Sprintf(\"%d\", i)\n}\n\nfunc oi32c(i int32, c string) {\n\tOUT += fmt.Sprintf(\"%d%s\", i, c)\n}\nfunc oi64c(i int64, c string) {\n\tOUT += fmt.Sprintf(\"%d%s\", i, c)\n}\n\nfunc oi32n(i int32) {\n\toi32c(i, \"\\n\")\n}\nfunc oi64n(i int64) {\n\toi64c(i, \"\\n\")\n}\n\nfunc oi32space(i int32) {\n\toi32c(i, \" \")\n}\nfunc oi64space(i int64) {\n\toi64c(i, \" \")\n}\n\nfunc ostring(s string) {\n\tOUT += s\n}\nfunc ob(b byte) {\n\tOUT += fmt.Sprintf(\"%c\", b)\n}\n\nfunc p() {\n\tfmt.Print(OUT)\n}\n\n// 2 3 5 6\nvar N []int64\n\nfunc min3(a, b, c int64) int64 {\n\tabxiao := int64(0)\n\tif N[a] <= N[b] {\n\t\tabxiao = N[a]\n\t}\n\tabxiao = N[b]\n\tif abxiao <= N[c] {\n\t\treturn abxiao\n\t}\n\treturn N[c]\n}\nfunc main() {\n\tN = rai64(4)\n\ta := min3(1, 3, 4)\n\tvar count int64\n\tcount += (a * 256)\n\tsheng2 := N[1] - a\n\tif sheng2 <= N[2] {\n\t\tcount += (sheng2 * 32)\n\t\toi64n(count)\n\t\tp()\n\t\treturn\n\t}\n\tcount += (N[2] * 32)\n\toi64n(count)\n\tp()\n}\n", "lang": "Go", "bug_code_uid": "9ddf4f0c1b1b209058e1a01dbf1f9de0", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "73c4da21aad5135b2e35016f97ccd2a2", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9841986455981941, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar k2, k3, k5, k6 float64\n\n\tfmt.Scan(&k2, &k3, &k5, &k6)\n\tn256 := math.Min(k2, math.Min(k5, k6))\n\tn32 := math.Min(k3, k2-n256)\n\tfmt.Println(n256*256 + n32*32)\n}\n", "lang": "Go", "bug_code_uid": "cffa7894bb57ca42084da39083769d54", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "b13d8321a6dae2f493b15890cb125ce0", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6244131455399061, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tstart := strings.Split(scanner.Text(), \" \")\n\tx1, _ := strconv.Atoi(start[0])\n\ty1, _ := strconv.Atoi(start[1])\n\n\tscanner.Scan()\n\tstop := strings.Split(scanner.Text(), \" \")\n\tx2, _ := strconv.Atoi(stop[0])\n\ty2, _ := strconv.Atoi(stop[1])\n\n\tcount := 0\n\tfor x1 != x2 || y1 != y2 {\n\t\tif x1-x2 < 0 {\n\t\t\tx1++\n\t\t} else if x1-x2 > 0 {\n\t\t\tx1--\n\t\t}\n\n\t\tif y1-y2 < 0 {\n\t\t\ty1++\n\t\t} else if y1-y2 > 0 {\n\t\t\ty1--\n\t\t}\n\t\tcount++\n\t}\n\tfmt.Print(count)\n}\n", "lang": "Go", "bug_code_uid": "d14157dec612be0bfc3bcc42b5202a30", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "bb021a7f85be0bec1a363c6bc92c3cee", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.40078585461689586, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc lsb(x int64) int64 {\n\treturn x & -x\n}\n\nfunc main() {\n\tvar l, r int64\n\tfmt.Scan(&l, &r)\n\n\tif l == r {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tvar msb int64\n\tx := r\n\tfor x > 0 {\n\t\tmsb = lsb(x)\n\t\tx -= msb\n\t}\n\n\tfmt.Println(2*r - 1) // might as well try it\n}\n", "lang": "Go", "bug_code_uid": "c9108953cf225ff9e7629632fa3bb526", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "3730e597c55efaffaf2ae4a2d9dbb0b8", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.984375, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol276D(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar l, r int64\n\tFscan(in, &l, &r)\n\tif l == r {\n\t\tFprint(out, 0)\n\t\treturn\n\t}\n\tfor m := l ^ r; ; m += m & -m {\n\t\tif m&(m-1) == 0 {\n\t\t\tFprint(out, m-1)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc main() {\n\tSol276D(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "7d919b43387bca05c39ce149f3d6dcd4", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "0aa9541deb9576027456826f9b602542", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9508928571428571, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol276D(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar l, r int64\n\tFscan(in, &l, &r)\n\tif l == r {\n\t\tFprint(out, 0)\n\t\treturn\n\t}\n\tfor m := l ^ r; ; m += m&-m - 1 {\n\t\tif m&(m+1) == 0 {\n\t\t\tFprint(out, m)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc main() {\n\tSol276D(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "5d6c1cea86970a0394213984d3f7d1f1", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "0aa9541deb9576027456826f9b602542", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.7688524590163934, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype T struct {\n\ts string\n\tv int\n}\n\nfunc comp(h1, h2 T) int {\n\tif h1.s != h2.s {\n\t\treturn 2\n\t}\n\tif h2.v-h1.v < 3 {\n\t\treturn 1\n\t}\n\treturn 2\n}\n\nfunc parse(h string) T {\n\ts := h[1:]\n\tv, _ := strconv.Atoi(h[:1])\n\treturn T{s: s, v: v}\n}\nfunc main() {\n\tvar a, b, c string\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\th := []T{parse(a), parse(b), parse(c)}\n\tsort.Slice(h, func(i, j int) bool {\n\t\treturn h[i].v < h[j].v\n\t})\n\n\tif h[0].s == h[1].s && h[1].s == h[2].s {\n\t\tif (h[2].v)-(h[1].v) == 0 && (h[1].v)-(h[0].v) == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tif (h[2].v)-(h[1].v) == 1 && (h[1].v)-(h[0].v) == 1 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tif (h[2].v)-(h[1].v) < 3 && (h[1].v)-(h[0].v) < 3 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(2)\n\t\treturn\n\t}\n\tr := comp(h[0], h[1])\n\tif r == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tr = comp(h[1], h[2])\n\tif r == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tfmt.Println(comp(h[0], h[2]))\n\t// ints := make([]int, n)\n\t// var c int\n\t// for c < n {\n\t// \tfmt.Scan(&a)\n\t// \tints[c] = a\n\t// \tc++\n\t// }\n\t// sort.Ints(ints)\n\t// cyc, err := circle(ints, len(ints))\n\t// // fmt.Println(\"Ints: \", ints)\n\t// if err != nil {\n\t// \tfmt.Println(\"NO\")\n\t// \treturn\n\t// }\n\t// if !valid(cyc) {\n\t// \tfmt.Println(\"NO\")\n\t// \treturn\n\t// }\n\t// fmt.Println(\"YES\")\n\t// // fmt.Println(\"Cyc: \", cyc)\n\t// for i := 0; i < len(cyc)-1; i++ {\n\t// \tfmt.Printf(\"%v \", cyc[i])\n\t// }\n\t// fmt.Printf(\"%v\\n\", cyc[len(cyc)-1])\n\n}\n", "lang": "Go", "bug_code_uid": "0b6d311cf9a9a17466afa7952f38dd60", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "e8bf8d4112c208e62528cc8954953b50", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9045751633986928, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tkoutsu := make(map[string]int)\n\tshuntsu := make(map[string][]int)\n\tscanner.Scan() \n\ttext := scanner.Text()\n\ttiles := strings.Split(text, \" \")\n\tfor _, s := range tiles {\n\t\tif _, ok := koutsu[s]; !ok {\n\t\t\tkoutsu[s] = 1\n\t\t} else {\n\t\t\tkoutsu[s]++\n\t\t}\n\t\tchar := strings.Split(s, \"\")\n\t\tsuit := char[1]\n\t\tdigit, _ := strconv.Atoi(char[0])\n\t\tdigit = digit - 1\n\t\tif _, ok := shuntsu[suit]; !ok {\n\t\t\tarr := make([]int, 9)\n\t\t\tarr[digit] = 1\n\t\t\tshuntsu[suit] = arr\n\t\t} else {\n\t\t\tshuntsu[suit][digit] = 1\n\t\t}\n\t}\n\n\tminKou := 2\n\tfor _, v := range koutsu {\n\t\tif 3 - v < minKou {\n\t\t\tminKou = 3 - v\n\t\t}\n\t\tif minKou == 0 {\n\t\t\tfmt.Println(minKou)\n\t\t\treturn\n\t\t}\n\t}\n\tminShun := 2\n\tfor _, arr := range shuntsu {\n\t\tcount := 0\n\t\tfor _, v := range arr {\n\t\t\tif v == 1 {\n\t\t\t\tcount++\n\t\t\t} else if v == 0 {\n\t\t\t\tif 3 - count < minShun {\n\t\t\t\t\tminShun = 3 - count\n\t\t\t\t}\n\t\t\t\tcount = 0\n\t\t\t}\n\t\t}\n\t\tif 3 - count < minShun {\n\t\t\tminShun = 3 - count\n\t\t}\n\t\tif minShun == 0 {\n\t\t\tfmt.Println(minShun)\n\t\t\treturn\n\t\t}\n\t}\n\tif minKou < minShun {\n\t\tfmt.Println(minKou)\n\t} else {\n\t\tfmt.Println(minShun)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4d59072f6e2ed73f4a6aa3e036d50ab6", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "b448bf111f13c2be645b50d968ec87cc", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9977595220313666, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc consec(arr []int) int {\n\n\tans := 0\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tcur := 1\n\t\tlast := arr[i]\n\t\tfor j := i + 1; j < len(arr); j++ {\n\t\t\tif arr[j] == last+1 {\n\t\t\t\tlast = last + 1\n\t\t\t\tcur++\n\t\t\t} else {\n\t\t\t\tans = max(ans, cur)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tans = max(ans, cur)\n\t}\n\treturn ans\n}\n\nfunc same(arr []int) int {\n\n\tans := 0\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tcur := 1\n\t\tlast := arr[i]\n\t\tfor j := i + 1; j < len(arr); j++ {\n\t\t\tif arr[j] == last {\n\t\t\t\tcur++\n\t\t\t} else {\n\t\t\t\tans = max(ans, cur)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tans = max(ans, cur)\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar a, b, c string\n\n\ts := []int{}\n\tm := []int{}\n\tp := []int{}\n\n\tscanf(\"%s %s %s\\n\", &a, &b, &c)\n\n\tif a[1] == byte('s') {\n\t\tcur := int(a[0] - byte('0'))\n\t\ts = append(s, cur)\n\t}\n\tif a[1] == byte('m') {\n\t\tcur := int(a[0] - byte('0'))\n\t\tm = append(m, cur)\n\t}\n\tif a[1] == byte('p') {\n\t\tcur := int(a[0] - byte('0'))\n\t\tp = append(p, cur)\n\t}\n\n\tif b[1] == byte('s') {\n\t\tcur := int(b[0] - byte('0'))\n\t\ts = append(s, cur)\n\t}\n\tif b[1] == byte('m') {\n\t\tcur := int(b[0] - byte('0'))\n\t\tm = append(m, cur)\n\t}\n\tif b[1] == byte('p') {\n\t\tcur := int(b[0] - byte('0'))\n\t\tp = append(p, cur)\n\t}\n\n\tif c[1] == byte('s') {\n\t\tcur := int(c[0] - byte('0'))\n\t\ts = append(s, cur)\n\t}\n\tif c[1] == byte('m') {\n\t\tcur := int(c[0] - byte('0'))\n\t\tm = append(m, cur)\n\t}\n\tif c[1] == byte('p') {\n\t\tcur := int(c[0] - byte('0'))\n\t\tp = append(p, cur)\n\t}\n\n\tsort.Ints(s)\n\tsort.Ints(p)\n\tsort.Ints(m)\n\n\t// fmt.Println(s, p, m)\n\n\t// fmt.Println(consec(p))\n\n\tif same(s) == 3 || consec(s) == 3 || same(p) == 3 || consec(p) == 3 || same(m) == 3 || consec(m) == 3 {\n\t\tprintf(\"0\")\n\t\treturn\n\t}\n\n\tif same(s) == 2 || consec(s) == 2 || same(p) == 2 || consec(p) == 2 || same(m) == 2 || consec(m) == 2 {\n\t\tprintf(\"1\")\n\t\treturn\n\t}\n\n\tif len(s) == 2 {\n\t\ts = []int{s[0], s[0] + 1, s[1]}\n\t} else if len(s) == 3 {\n\t\ts = []int{s[0], s[0] + 1, s[1], s[1] + 1, s[2]}\n\t}\n\tif len(m) == 2 {\n\t\tm = []int{m[0], m[0] + 1, m[1]}\n\t} else if len(m) == 3 {\n\t\tm = []int{m[0], m[0] + 1, m[1], m[1] + 1, m[2]}\n\t}\n\tif len(p) == 2 {\n\t\tp = []int{p[0], p[0] + 1, p[1]}\n\t} else if len(p) == 3 {\n\t\tp = []int{p[0], p[0] + 1, p[1], p[1] + 1, p[2]}\n\t}\n\n\tif same(s) >= 2 || consec(s) >= 2 || same(p) >= 2 || consec(p) >= 2 || same(m) >= 2 || consec(m) >= 2 {\n\t\tprintf(\"1\")\n\t\treturn\n\t}\n\n\tprintf(\"2\")\n\n}\n", "lang": "Go", "bug_code_uid": "956467579d447b8cfe1ac7c5f2eadc99", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "e4c197cbde8c7308815cbacfed684813", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.951063829787234, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "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\tA := make([]string, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tS := sc.Next()\n\t\tA[i] = string(S[1]) + string(S[0])\n\t}\n\tsort.Strings(A)\n\t//fmt.Printf(\"%+v\\n\", A)\n\tif A[0] == A[1] && A[1] == A[2] {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif A[0] == A[1] || A[1] == A[2] {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tif A[0][0] == A[1][0] && A[1][0] == A[2][0] {\n\t\tif A[0][1]+1 == A[1][1] && A[1][1]+1 == A[2][1] {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\n\t\tif A[0][1]+1 == A[1][1] || A[1][1]+1 == A[2][1] {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\n\t}\n\tif A[0][0] == A[1][0] {\n\t\tif A[0][1]+1 == A[1][1] {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t}\n\tif A[1][0] == A[2][0] {\n\t\tif A[1][1]+1 == A[2][1] {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(2)\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", "lang": "Go", "bug_code_uid": "e12bba4cd163d44f3e214ade4b413314", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "57b6278460f030d04cdd20177b3f1a47", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9653882132834425, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc countDivisor(a, b int) int {\n\tq := a - b\n\tret := 0\n\tsqrtQ := int(math.Sqrt(float64(q)))\n\tfor i := 1; i < sqrtQ; i++ {\n\t\tif q%i != 0 || q/i < b {\n\t\t\tcontinue\n\t\t}\n\t\tret++\n\t\tif i <= b {\n\t\t\tcontinue\n\t\t}\n\t\tret++\n\t}\n\tif sqrtQ > b && sqrtQ*sqrtQ == q {\n\t\tret++\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\tif a < b || (a != b && a-b <= b) {\n\t\tfmt.Println(0)\n\t} else if a == b {\n\t\tfmt.Println(\"infinity\")\n\t} else {\n\t\tfmt.Println(countDivisor(a, b))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4abb7f2f1661283c57c9fdf380dd5efb", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "ea48d24bc84810a46753aa9761287c09", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9884678747940692, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar a, b, c int\n\tif Scan(&a, &b); a == b {\n\t\tPrint(\"infinity\")\n\t\treturn\n\t}\n\ta -= b\n\tfor d := 1; d*d <= a; d++ {\n\t\tif a%d == 0 {\n\t\t\tif d >= b {\n\t\t\t\tc++\n\t\t\t}\n\t\t\tif d*d < a && a/d >= b {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\tPrint(c)\n}\n", "lang": "Go", "bug_code_uid": "02b93aa9f1376edabe2ad043304b155b", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "fb5b8356e5a5b980618a2454d41161eb", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9889867841409692, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, f, k int64\n\tfmt.Scan(&a, &b, &f, &k)\n\tstart := true\n\tfue := b\n\tstops := 0\n\tfor i := 0; i < int(k); i++ {\n\t\tdist := f\n\t\tif !start {\n\t\t\tdist = a - f\n\t\t}\n\t\tif fue < dist {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tif fue < a || fue < a+(a-dist) && i+1 != int(k) {\n\t\t\tfue = b - (a - dist)\n\t\t\tstops++\n\t\t} else {\n\t\t\tfue -= a\n\t\t}\n\t\tif fue < 0 {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t\tstart = !start\n\t}\n\tfmt.Println(stops)\n}\n", "lang": "Go", "bug_code_uid": "30e80f360509a5693384618a42c7522b", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "432c26eb4701147ae6ef11ae245aec89", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9932945909700491, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, f, k int\n\tfmt.Scanf(\"%d\", &a)\n\tfmt.Scanf(\"%d\", &b)\n\tfmt.Scanf(\"%d\", &f)\n\tfmt.Scanf(\"%d\", &k)\n\t\n\t//fmt.Printf(\"%v %v %v %v\\n\", a, b, f, k)\n\t\n\tif (f > b) {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\t\n\tif ((k > 1) && (2*(a-f) > b)) {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\t\n\tif ((k > 2) && (2*f > b)) {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\t\n\ttotalCount := 0\n\tb_current := b\n\tk0 := 0\n\tfor {\n\t\t//forward\n\t\tb_current -= f\n\t\tif (k0 != k-1) {\n\t\t\tif (((b_current - 2*(a-f)) < 0) || (b_current == 0)) {\n\t\t\t\tb_current = b\n\t\t\t\ttotalCount++\n\t\t\t}\n\t\t} else {\n\t\t\tif (((b_current - (a-f)) < 0) || (b_current == 0)) {\n\t\t\t\tb_current = b\n\t\t\t\ttotalCount++\n\t\t\t}\n\t\t}\n\t\tk0++\n\t\tif (k0 == k) {\n\t\t\tfmt.Printf(\"%v\", totalCount)\n\t\t\treturn\n\t\t}\n\t\tb_current -= (a-f)\n\t\t//backward\n\t\tb_current -= (a-f)\n\t\tif (k0 != k-1) {\n\t\t\tif ((b_current == 0) || ((b_current - 2*f) < 0)) {\n\t\t\t\tb_current = b\n\t\t\t\ttotalCount++\n\t\t\t}\n\t\t} else {\n\t\t\tif ((b_current == 0) || ((b_current - f) < 0)) {\n\t\t\t\tb_current = b\n\t\t\t\ttotalCount++\n\t\t\t}\n\t\t}\n\t\tk0++\n\t\tif (k0 == k) {\n\t\t\tfmt.Printf(\"%v\", totalCount)\n\t\t\treturn\n\t\t}\n\t\tb_current -= f\n\t}\n}\n", "lang": "Go", "bug_code_uid": "170fd120a045d6672f8d4ef02e8a03f6", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "e0a9073468d1a3cfe40aae922ba31a58", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9388185654008439, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, f, k int\n\tfmt.Scan(&a, &b, &f, &k)\n\tcurFuel := b\n\trefuelsNeeded := 0\n\tisInA := false\n\tfor i := k; i > 0; i-- {\n\t\tvar fuelNeeded int\n\t\tif isInA {\n\t\t\tcurFuel -= a - f\n\t\t\tif i == 1 {\n\t\t\t\tfuelNeeded = f\n\t\t\t} else {\n\t\t\t\tfuelNeeded = 2 * f\n\t\t\t}\n\t\t\tif curFuel < fuelNeeded {\n\t\t\t\tcurFuel = b\n\t\t\t\trefuelsNeeded++\n\t\t\t}\n\t\t\tif curFuel < fuelNeeded {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcurFuel -= f\n\t\t\tif curFuel < 0 {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tcurFuel -= f\n\t\t\tif i == 1 {\n\t\t\t\tfuelNeeded = a - f\n\t\t\t} else {\n\t\t\t\tfuelNeeded = 2 * (a - f)\n\t\t\t}\n\t\t\tif curFuel < fuelNeeded {\n\t\t\t\tcurFuel = b\n\t\t\t\trefuelsNeeded++\n\t\t\t}\n\t\t\tif curFuel < fuelNeeded {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcurFuel -= a - f\n\t\t\tif curFuel < 0 {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tisInA = !isInA\n\t}\n\tfmt.Printf(\"%d\\n\", refuelsNeeded)\n}\n", "lang": "Go", "bug_code_uid": "ae2fcac84332626bcf8905ba139a5037", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "ad9604ce898b87f7a0a533cecd3626ee", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9238410596026491, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "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\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\tm, _ := strconv.Atoi(scanner.Text())\n\n\ta := make([]int, n)\n\tl := make([]int, m)\n\n\ti := 0\n\tfor scanner.Scan() {\n\t\tl[i], _ = strconv.Atoi(scanner.Text())\n\t\tl[i]--\n\t\ti++\n\t}\n\n\tmm := map[int]int{}\n\tfor i := 0; i < m-1; i++ {\n\t\ta[l[i]] = (l[i+1] - l[i]) % n\n\t\tif a[l[i]] <= 0 {\n\t\t\ta[l[i]] += n\n\t\t}\n\t\tif j, ok := mm[a[l[i]]]; ok && j != l[i] {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tmm[a[l[i]]] = l[i]\n\t}\n\n\t// fill in zeroes\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 1; j <= n; j++ {\n\t\t\tif _, ok := mm[j]; !ok {\n\t\t\t\tmm[j] = i\n\t\t\t\ta[i] = j\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%d \", a[i])\n\t}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "31831d341d4afa32b11c91ea52235b79", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "apr_id": "24b4fcfe4f2f901861b13de1292a7910", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4549950544015826, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1034B(in io.Reader, out io.Writer) {\n\tvar n, m int64\n\tFscan(in, &n, &m)\n\tans := n * m\n\tn %= 6\n\tm %= 6\n\tif n == 0 || m == 0 {\n\t\tFprint(out, ans)\n\t\treturn\n\t}\n\tmat := [][]int64{\n\t\t{0, 0, 0, 2, 4},\n\t\t{0, 0, 4, 8, 10},\n\t\t{0, 4, 8, 12, 14},\n\t\t{2, 8, 12, 16, 20},\n\t\t{4, 10, 14, 20, 24},\n\t}\n\tFprint(out, ans-n*m+mat[n-1][m-1])\n}\n\nfunc main() { CF1034B(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "d038eedca1fd7feefc812d363faf7b23", "src_uid": "02ce135a4b276d1e9ba6a4ce37f2fe70", "apr_id": "b9cf88dd80787ccac57cb30e97f9719f", "difficulty": 2200, "tags": ["brute force", "flows", "constructive algorithms", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9794238683127572, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, c;\n fmt.Scan(&a, &b, &c);\n base := a;\n if (base > b - 1) {\n base = b - 1;\n }\n if (base > c - 2) {\n base = c - 2;\n }\n fmt.Println(3 * base + 3);\n}", "lang": "Go", "bug_code_uid": "4da4584233c1eb138ae9f36e37a24991", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "867ad21876dbbf486bdd73149d2ae5b9", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9767441860465116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d, e, s int\n\tfmt.Scanf(\"%d %d %d %d %d\\n\", &a, &b, &c, &d, &e)\n\ts = a + b + c + d + e\n\tif s%5 != 0 {\n\t\tfmt.Print(-1)\n\t\treturn\n\t}\n\tfmt.Print(s / 5)\n}\n", "lang": "Go", "bug_code_uid": "e1fffd9ba4ecf744edb27b55961c4a32", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "94daf5b552cf6c5c40c8a3965efdf50e", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9728395061728395, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tsum := 0\n\tfor i := 0; i < 5; i++ {\n\t\tvar b int\n\t\tfmt.Scan(&b)\n\t\tsum += b\n\t}\n\tif sum%5 == 0 {\n\t\tfmt.Println(sum / 5)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "dfa25f722209a8f38d35b7698d78488a", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "74847ce1dfd2a166c0df8d4077dcc790", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9744897959183674, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfor i := 0; i < 5; i++ {\n\t\tvar y int\n\t\tfmt.Scan(&y)\n\t\tx += y\n\t}\n\tif x%5 > 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(x / 5)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "df3ce89117a28cc4fe10723927ca9238", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "74847ce1dfd2a166c0df8d4077dcc790", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9548936170212766, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar\twriter *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n defer writer.Flush()\n var a, b, c, d, e int64\n scanf(\"%d %d %d %d %d\\n\", &a, &b, &c, &d, &e)\n total := a + b + c + d + e\n if total % 5 == 0 {\n printf(\"%d\", total / 5)\n } else {\n printf(\"%d\", -1)\n }\n}\n", "lang": "Go", "bug_code_uid": "8a024db5c5803f735ac27c1cf1603b7f", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "04aea657965cc69d11ce82f65a3da371", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9970873786407767, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanner() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc main() {\n\tvar input []string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tinput = append(input, scanner.Text())\n\t}\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\n\ta1, _ := strconv.Atoi(input[0])\n\ta2, _ := strconv.Atoi(input[1])\n\tk1, _ := strconv.Atoi(input[2])\n\tk2, _ := strconv.Atoi(input[3])\n\tn, _ := strconv.Atoi(input[4])\n\n\tif a1*k1 > a2*k2 {\n\t\tk1, k2, a1, a2 = k2, k1, a2, a1\n\t}\n\tvar min, max int\n\n\tif a1*k1 >= n {\n\t\tmax = n / k1\n\t} else {\n\t\tmax = a1\n\t\tmax += (n - a1*k1) / k2\n\t}\n\n\tvar minCard int\n\n\tif k1 > 1 {\n\t\tminCard = a1 * (k1 - 1)\n\t}\n\tif k2 > 1 {\n\t\tminCard += a2 * (k2 - 1)\n\t}\n\n\tif minCard >= n {\n\t\tmin = 0\n\t} else {\n\t\tmin = n - minCard\n\t}\n\n\tfmt.Printf(\"%v %v\", min, max)\n}\n", "lang": "Go", "bug_code_uid": "6d5bf5d43b544b987161d4dff3df2eb7", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "5794f1a6ce1efd4cadfce783583e168c", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9974457215836526, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a1, a2, k1, k2, n int\n\n\t// scr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Scanln(&a1)\n\tfmt.Scanln(&a2)\n\tfmt.Scanln(&k1)\n\tfmt.Scanln(&k2)\n\tfmt.Scanln(&n)\n\n\tmin := n - (((k1 - 1) * a1) + ((k2 - 1) * a2))\n\n\tif min <= 0 {\n\t\tmin = 0\n\t} else if min >= a1+a2 {\n\t\tmin = a1 + a2\n\t}\n\n\tmax := 0\n\tif k1 < k2 {\n\t\tmax = n / k1\n\n\t\tif max > a1 {\n\t\t\tmax = a1\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k1 * max\n\n\t\tx := n / k2\n\t\tif x > a2 {\n\t\t\tx = a2\n\t\t} else if x < 1 {\n\t\t\tx = 0\n\t\t}\n\t\tmax += x\n\n\t} else {\n\t\tmax = n / k2\n\n\t\tif max > a2 {\n\t\t\tmax = a2\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k2 * max\n\n\t\tx := n / k1\n\t\tif x > a1 {\n\t\t\tmax = a1\n\t\t} else if x < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tmax += x\n\t}\n\n\tfmt.Println(min, max)\n\n}\n", "lang": "Go", "bug_code_uid": "89a1dfd2c84ca0246c19a574c7ab07d2", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "cb2055f5c023bc099157515eac03fa76", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9874213836477987, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc vowel_l(r rune) bool {\n if r == 'a' || r == 'e' || r == 'i' || r == 'u' {\n return true\n }\n return false\n}\n\nfunc odd(r rune) bool {\n if r == '1' || r == '3' || r == '5' || r == '7' || r == '9' {\n return true\n } \n return false\n}\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n var cnt int\n for _, r := range s {\n if vowel_l(r) || odd(r) {\n cnt++\n }\n }\n fmt.Print(cnt)\n}", "lang": "Go", "bug_code_uid": "d62283702fabcb98b250025ae78de452", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "c3a49445de346be122c159465ada56b4", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9899377096310493, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "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\tcount := 0\n\tfor _, v := range S {\n\t\tswitch v {\n\t\tcase 'a', 'i', 'u', 'e', 'o', '0', '2', '4', '6', '8':\n\t\t\tcount++\n\n\t\t}\n\t}\n\tfmt.Println(count)\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", "lang": "Go", "bug_code_uid": "2dbb13232f98d4018873e2573788f793", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "de415e98044029d773e7f5f393cb5eae", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.996742671009772, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tvar ans int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] >= '0' && s[i] <= '9' {\n\t\t\tif (s[i]-'0')%2 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t} else {\n\t\t\tif strings.IndexByte(\"aeiou\", s[i]) != -1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "02f3b8bb073b0f75d387ec480eee30b9", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "432d738b42468d31979eb558fb6f2623", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8938519447929737, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "// Codeforces 676 B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i= 0.999999999999 {\n countFull ++\n v := (aa[j] - 1.0)/2.0\n //fmt.Printf(\"a,v= %f %f\\n\",aa[j], v)\n an[j] += v\n an[j+1] += v\n }\n }\n // copy an -> a\n //fmt.Println(i)\n for j:=0; j bytes2[i] {\n\t\t\tresult = 1\n\t\t} else if bytes1[i] < bytes2[i] {\n\t\t\tresult = -1\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\n// https://codeforces.com/problemset/problem/112/A\n", "lang": "Go", "bug_code_uid": "0a682f04dab728d53bd92d457360f2c3", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "59ed3c5d81a3120856580c876ce4148f", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9309245483528161, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc run(s1, s2 string) int {\n\ts1 = strings.ToLower(s1)\n\ts2 = strings.ToLower(s2)\n\tif s1 < s2 {\n\t\treturn -1\n\t} else if s1 > s2 {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc Test(t *testing.T) {\n\tassert.Equal(t, run(\"aaaa\", \"aaaA\"), 0)\n\tassert.Equal(t, run(\"abs\", \"Abz\"), -1)\n\tassert.Equal(t, run(\"abcdefg\", \"AbCdEfF\"), 1)\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tfmt.Scan(&s1, &s2)\n\tfmt.Println(run(s1, s2))\n}\n", "lang": "Go", "bug_code_uid": "eeae7afce05d51d45647107e4ed36b54", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "7626738975df77c4ffb1677a21342bf4", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9986320109439124, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, min int\n\n\tfmt.Scanln(&n, &m)\n\ta := make([]int, m)\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tfor i := 0; i < m-n; i++ {\n\t\tif i == 0 {\n\t\t\tmin = a[i+n-1] - a[i]\n\t\t} else {\n\t\t\tif min > a[i+n-1]-a[i] {\n\t\t\t\tmin = a[i+n-1] - a[i]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n\n}\n", "lang": "Go", "bug_code_uid": "f6ace4653b319d8a5a771d82516822c0", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "53e14f167c2d3527dbf9e6c966fd49c6", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9977578475336323, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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 (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\t_ = nextInt()\n\ts := next()\n\tvar outsideWords []string\n\n\tfor i := strings.Index(s, \"(\"); i >= 0; i = strings.Index(s, \"(\") {\n\t\tj := strings.Index(s, \")\")\n\t\toutsideWords = append(outsideWords, splitWords(s[i+1:j], '_')...)\n\t\ts = s[:i] + s[j+1:]\n\t}\n\n\tprintln(maxLength(splitWords(s, '_')), len(outsideWords))\n\n}\n\nfunc splitWords(s string, c rune) []string {\n\treturn strings.FieldsFunc(s, func(c rune) bool { return c == '_' })\n}\n\nfunc maxLength(s []string) int {\n\tl := 0\n\n\tfor i := range s {\n\t\tif len(s[i]) > l {\n\t\t\tl = len(s[i])\n\t\t}\n\t}\n\n\treturn l\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "d9c86178223f21227db0f17732c93609", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "74b47c867544edcf744bf30d1c81e0a8", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7760956175298804, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main;\n\nimport (\"fmt\"; \"bufio\"; \"os\"; \"strings\")\n\n\nfunc groups(line string) ([]string, []string) {\n outside, inside := make([]string, 0, 10), make([]string, 0, 10)\n parts := strings.FieldsFunc(line, func(c rune) bool {\n return c=='(' || c==')'\n })\n out := line[0]!='('\n for _, p := range parts {\n if out { \n outside = append(outside, strings.Split(p, \"_\") ...)\n } else {\n inside = append(inside, strings.Split(p, \"_\") ...)\n }\n out = !out\n }\n\n return outside, inside\n\n}\n\n\nfunc main() {\n inp := bufio.NewReader(os.Stdin)\n scanner := bufio.NewScanner(inp)\n\n scanner.Scan() // number\n scanner.Scan()\n outside, inside := groups(scanner.Text())\n\n fmt.Fprintf(os.Stderr, \"%v - %v \\n\", outside, inside)\n\n longestOutside := 0\n for _, w := range outside {\n if len(w) > longestOutside {\n longestOutside = len(w)\n }\n }\n\n inParenthesis := 0\n for _, w := range inside {\n if len(w) > 0 {\n inParenthesis++\n }\n }\n\n fmt.Println(longestOutside, inParenthesis)\n}", "lang": "Go", "bug_code_uid": "e9c692e7a7b158136e45db09585d5af4", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "c0523f8d68c6114a26a990415b8e64c0", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9740145985401459, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tn := fsc.NextInt()\n\ttext := fsc.Next()\n\tvar flag, maxLength, inLength, outLength, count int\n\tfor i := 0; i < n; i++ {\n\t\tif text[i] == '(' {\n\t\t\tif maxLength < outLength {\n\t\t\t\tmaxLength = outLength\n\t\t\t}\n\t\t\toutLength = 0\n\t\t\tflag = 1\n\t\t} else if text[i] == ')' {\n\t\t\tif inLength != 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tinLength = 0\n\t\t\tflag = 0\n\t\t} else if text[i] == '_' {\n\t\t\tif inLength != 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tinLength = 0\n\t\t\tif outLength != 0 {\n\t\t\t\tif maxLength < outLength {\n\t\t\t\t\tmaxLength = outLength\n\t\t\t\t}\n\t\t\t}\n\t\t\toutLength = 0\n\t\t} else if flag == 0 {\n\t\t\toutLength++\n\t\t} else if flag == 1 {\n\t\t\tinLength++\n\t\t}\n\t}\n\n\tfmt.Println(maxLength, count)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 2028)\n\treturn &FastScanner{r: rdr}\n}\n\nfunc (s *FastScanner) 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}\n\nfunc (s *FastScanner) NextInt() int {\n\tval, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tval, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *FastScanner) ReadLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\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", "lang": "Go", "bug_code_uid": "0d5ea9bf29c8f0562e0031474e740526", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "fecb2923f773274933d189c2a11c3b9b", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9435253850541928, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\ntype TupleInt struct {\n\tfirst int\n\tsecond int\n\tthird int\n}\n\nfunc main() {\n\tin := NewScanner()\n\t_ = in.NextInt()\n\tS := in.NextLine()\n\tinside := false\n\tlast := 0\n\tmx := 0\n\tcount := 0\n\tcomma := false\n\n\tfor i, s := range S {\n\t\tif s == '(' {\n\t\t\tinside = true\n\t\t\tcomma = true\n\t\t} else if s == ')' {\n\t\t\tinside = false\n\t\t\tcomma = true\n\t\t\tlast = i + 1\n\n\t\t} else if s == '_' {\n\t\t\tcomma = true\n\t\t} else {\n\t\t\tif comma {\n\t\t\t\tif inside {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tcomma = false\n\t\t\t}\n\t\t}\n\t\tif comma {\n\t\t\tif !inside {\n\t\t\t\tmx = max(mx, i - last)\n\t\t\t}\n\t\t\tlast = i + 1\n\t\t}\n\n\t}\n\tfmt.Println(mx, count)\n}\nfunc max(a int, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\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}\n\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\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); 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}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif 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\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\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", "lang": "Go", "bug_code_uid": "7b942ddd2d71def55d8c1ce22f318844", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "6cb5cf177bc9778cd0b9e2152b234e50", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6550657385924207, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt64()\n\tvar ret int64 = 1\n\n\tfor i := int64(2); n > 1; i++ {\n\t\tif n%i == 0 {\n\t\t\tret *= i\n\n\t\t\tfor n%i == 0 {\n\t\t\t\tn /= i\n\t\t\t}\n\t\t}\n\t}\n\n\tprintln(ret)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "14f0df139eddcce785bb04fd7018e513", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "92bf39fb3afc8c24068476190698014a", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.48045178105994785, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var n int\n fmt.Sscanln(Read(reader), &n)\n\n a := make([]int, 0)\n\n for int(math.Mod(float64(n), 2)) == 0 {\n n = n / 2\n a = append(a, 2)\n }\n\n for i := 3; i <= n; i++ {\n for int(math.Mod(float64(n), float64(i))) == 0 {\n n = n / i\n a = append(a, i) \n } \n }\n\n var result int = a[0]\n for i := 1; i < len(a); i++ {\n if a[i] != a[i - 1] {\n result *= a[i]\n }\n }\n\n writer := bufio.NewWriter(os.Stdout) \n Write(writer, result)\n}", "lang": "Go", "bug_code_uid": "4482386f6363907504b967adc4d99352", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "990001b1e1e197b08ee94de625d867fa", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4221276595744681, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var n int\n fmt.Sscanln(Read(reader), &n)\n\n a := make([]int, 0)\n\n if n == 1 {\n a = append(a, 1)\n }\n\n for int(math.Mod(float64(n), 2)) == 0 {\n n = n / 2\n a = append(a, 2)\n }\n\n for i := 3; i <= n; i++ {\n for int(math.Mod(float64(n), float64(i))) == 0 {\n n = n / i\n a = append(a, i) \n } \n }\n\n var result int = a[0]\n for i := 1; i < len(a); i++ {\n if a[i] != a[i - 1] {\n result *= a[i]\n }\n }\n\n writer := bufio.NewWriter(os.Stdout) \n Write(writer, result)\n}", "lang": "Go", "bug_code_uid": "e504febafa1de1876bba07705d01d2d9", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "990001b1e1e197b08ee94de625d867fa", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4342273307790549, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var n int\n fmt.Sscanln(Read(reader), &n)\n\n a := make([]int, 0)\n\n if n < 2 {\n a = append(a, n)\n }\n\n for int(math.Mod(float64(n), 2)) == 0 {\n n = n / 2\n a = append(a, 2)\n }\n\n for i := 3; i <= n; i++ {\n for int(math.Mod(float64(n), float64(i))) == 0 {\n n = n / i\n a = append(a, i) \n } \n }\n\n var result int = a[0]\n for i := 1; i < len(a); i++ {\n if a[i] != a[i - 1] {\n result *= a[i]\n }\n }\n\n writer := bufio.NewWriter(os.Stdout) \n Write(writer, result)\n}", "lang": "Go", "bug_code_uid": "5728242d7ad2031289f8420f46efe51d", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "990001b1e1e197b08ee94de625d867fa", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.43994943109987356, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var n int64\n fmt.Sscanln(Read(reader), &n)\n\n a := make([]int64, 0)\n\n if n < 2 {\n a = append(a, n)\n }\n\n for int64(math.Mod(float64(n), 2)) == 0 {\n n = n / 2\n a = append(a, 2)\n }\n\n var i int64\n for i = 3; i <= n; i++ {\n for int64(math.Mod(float64(n), float64(i))) == 0 {\n n = n / i\n a = append(a, i)\n } \n }\n\n var result int64 = a[0]\n for i = 1; i < int64(len(a)); i++ {\n if a[i] != a[i - 1] {\n result *= a[i]\n }\n }\n\n writer := bufio.NewWriter(os.Stdout) \n Write(writer, result)\n}", "lang": "Go", "bug_code_uid": "c2598d8c42ccecb1bfa4f1cde3adb4f4", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "990001b1e1e197b08ee94de625d867fa", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7703281027104137, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/list\"\n\t\"fmt\"\n\t\"os\"\n\t//\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc ReadInt32() int64 {\n\tscanner.Scan()\n\treturn toInt(scanner.Bytes())\n}\n\nfunc toInt(buf []byte) (n int64) {\n\tfor _, v := range buf {\n\t\tn = n*10 + int64(v-'0')\n\t}\n\treturn n\n}\n\nfunc main() {\n\t//:\tfmt.Print64(strconv.IntSize)\n\tscanner.Split(bufio.ScanWords)\n\tl := list.New()\n\n\t//var n int64\n\tm := ReadInt32()\n\tvar r int64 = 1\n\tvar i int64\n\n\tfor i = 2; i <= m && m > 1; i++ {\n\t\tisPrime := true\n\t\tfor e := l.Front(); e != nil; e = e.Next() {\n\t\t\tvar n int64\n\n\t\t\tn = e.Value.(int64)\n\t\t\tif i%n == 0 {\n\t\t\t\tisPrime = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif n*n > i {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\t\tif isPrime {\n\t\t\tl.PushBack(i)\n\t\t\tif m%i == 0 {\n\t\t\t\tr = r * i\n\t\t\t}\n\t\t\tfor ; m%i == 0; m = m / i {\n\t\t\t}\n\n\t\t}\n\t}\n\tfmt.Print(r)\n\n}\n", "lang": "Go", "bug_code_uid": "09261fe45eee8a130b9439f7cbcd01fd", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "93ebb36254c68f91354bf46566c1ea85", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6717791411042945, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin);\n var n int64\n \n fmt.Fscanln(reader, &n)\n \n var cnt, i int64 = 1, 2\n \n for i <= n {\n if n % i == 0 {\n cnt *= i\n }\n for n % i == 0 {\n n /= i\n }\n i++\n }\n \n fmt.Println(cnt * n)\n}", "lang": "Go", "bug_code_uid": "7cf79b866163f3fc9678485959c86549", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "a002d3d56704190b2f84c34e8972106b", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9867060561299852, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfor i := n + 1; i < 9001; i++ {\n\t\tif isBeautiful(i) {\n\t\t\tfmt.Print(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc isBeautiful(n int) bool {\n\tvar a [10]int\n\tfor n > 0 {\n\t\ti := n % 10\n\t\ta[i]++\n\t\tn = n / 10\n\t}\n\tfor i := 0; i < 10; i++ {\n\t\tif a[i] >= 2 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "lang": "Go", "bug_code_uid": "ad2a1b11daddcb8dd22f81872242cfaf", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "02c5e7464fa04b3825c9e6836e7acf69", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9860335195530726, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc difnomb(k int) bool {\n\tvar a, b, c, d int\n\tf := true\n\ta = int(k / 1000)\n\tb = int(k/100) % 10\n\tc = int(k/10) % 10\n\td = k % 10\n\tif a == b || a == c || b == c || b == d || c == d {\n\t\tf = false\n\t}\n\treturn f\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfor true {\n\t\tn++\n\t\tif difnomb(n) {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(n)\n}\n", "lang": "Go", "bug_code_uid": "5d55554bd4cc9841d76b6a757f358da1", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "d18c5168da9f5cbaede8b3e4a1b5b389", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9608220937700707, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol552C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar w, m int\n\tFscan(in, &w, &m)\n\tif w <= 3 {\n\t\tFprint(out, \"YES\")\n\t\treturn\n\t}\n\tcoef := []int{}\n\tfor ; m > 0; m /= w {\n\t\tc := m % w\n\t\tif c > 1 {\n\t\t\tif c < w-1 {\n\t\t\t\tFprint(out, \"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc = -1\n\t\t}\n\t\tcoef = append(coef, c)\n\t}\n\tn := len(coef)\n\tfor i := 0; i < n; i++ {\n\t\tc := coef[i]\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < n; j++ {\n\t\t\t\tcoef[j]++\n\t\t\t\tif coef[j] != 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else if c > 1 {\n\t\t\tif c < w-1 {\n\t\t\t\tFprint(out, \"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc = -1\n\t\t\ti--\n\t\t}\n\t}\n\tFprint(out, \"YES\")\n}\n\nfunc main() {\n\tSol552C(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "a99588c2dead41b2926bbe809f3894d2", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "693bb05a502eec2a4c06cdbe9acf144d", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9491307147456536, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol552C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar w, m int\n\tFscan(in, &w, &m)\n\tif w <= 3 {\n\t\tFprint(out, \"YES\")\n\t\treturn\n\t}\n\tcoef := []int{}\n\tfor ; m > 0; m /= w {\n\t\tc := m % w\n\t\tif c > 1 {\n\t\t\tif c < w-1 {\n\t\t\t\tFprint(out, \"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc = -1\n\t\t}\n\t\tcoef = append(coef, c)\n\t}\n\tn := len(coef)\n\tfor i := 0; i < n; {\n\t\tc := coef[i]\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < n; j++ {\n\t\t\t\tcoef[j]++\n\t\t\t\tif coef[j] != 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++\n\t\t} else if c > 1 {\n\t\t\tif c < w-1 {\n\t\t\t\tFprint(out, \"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc = -1\n\t\t}\n\t}\n\tFprint(out, \"YES\")\n}\n\nfunc main() {\n\tSol552C(os.Stdin, os.Stdout)\n}\n", "lang": "Go", "bug_code_uid": "10bfe7bb98fd7d4154b9a906ae42e8e2", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "693bb05a502eec2a4c06cdbe9acf144d", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8083275980729525, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Cell int\n\nconst (\n\tEmptyCell Cell = iota\n\tPigCell\n\tWolfCell\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\tn := nextInt(s)\n\tm := nextInt(s)\n\tgs := make([][]Cell, n)\n\twolves := make([]Wolf, 0, n)\n\tfor i := 0; i < len(gs); i++ {\n\t\tgs[i] = make([]Cell, m)\n\t\ts.Scan()\n\t\trow := s.Text()\n\t\tfor j := 0; j < m; j++ {\n\t\t\tswitch row[j] {\n\t\t\tcase 'P':\n\t\t\t\tgs[i][j] = PigCell\n\t\t\tcase 'W':\n\t\t\t\tgs[i][j] = WolfCell\n\t\t\t\twolves = append(wolves, Wolf{i, j})\n\t\t\tdefault:\n\t\t\t\tgs[i][j] = EmptyCell\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(solve(gs, wolves, len(wolves)-1))\n}\n\nfunc solve(gs [][]Cell, wolves []Wolf, k int) int {\n\tif k < 0 {\n\t\treturn 0\n\t}\n\n\ti := wolves[k].i\n\tj := wolves[k].j\n\n\ta, b, c, d, e := 0, 0, 0, 0, 0\n\tif ix(gs, i-1, j) == PigCell {\n\t\ths := copyGrid(gs)\n\t\ths[i-1][j] = EmptyCell\n\t\ths[i][j] = EmptyCell\n\t\ta = 1 + solve(hs, wolves, k-1)\n\t}\n\tif ix(gs, i+1, j) == PigCell {\n\t\ths := copyGrid(gs)\n\t\ths[i+1][j] = EmptyCell\n\t\ths[i][j] = EmptyCell\n\t\tb = 1 + solve(hs, wolves, k-1)\n\t}\n\tif ix(gs, i, j+1) == PigCell {\n\t\ths := copyGrid(gs)\n\t\ths[i][j+1] = EmptyCell\n\t\ths[i][j] = EmptyCell\n\t\tc = 1 + solve(hs, wolves, k-1)\n\t}\n\tif ix(gs, i, j-1) == PigCell {\n\t\ths := copyGrid(gs)\n\t\ths[i][j-1] = EmptyCell\n\t\ths[i][j] = EmptyCell\n\t\td = 1 + solve(hs, wolves, k-1)\n\t}\n\te = solve(gs, wolves, k-1)\n\n\treturn maximum(a, b, c, d, e)\n\n\t//max := 0\n\t//for i := 0; i < len(gs); i++ {\n\t//\tfor j := 0; j < len(gs[i]); j++ {\n\t//\t\tif gs[i][j] == WolfCell {\n\t//\t\t\ta, b, c, d := 0, 0, 0, 0\n\t//\t\t\tif ix(gs, i-1, j) == PigCell {\n\t//\t\t\t\ths := copyGrid(gs)\n\t//\t\t\t\ths[i-1][j] = EmptyCell\n\t//\t\t\t\ths[i][j] = EmptyCell\n\t//\t\t\t\ta = 1 + solve(hs)\n\t//\t\t\t}\n\t//\t\t\tif ix(gs, i+1, j) == PigCell {\n\t//\t\t\t\ths := copyGrid(gs)\n\t//\t\t\t\ths[i+1][j] = EmptyCell\n\t//\t\t\t\ths[i][j] = EmptyCell\n\t//\t\t\t\tb = 1 + solve(hs)\n\t//\t\t\t}\n\t//\t\t\tif ix(gs, i, j+1) == PigCell {\n\t//\t\t\t\ths := copyGrid(gs)\n\t//\t\t\t\ths[i][j+1] = EmptyCell\n\t//\t\t\t\ths[i][j] = EmptyCell\n\t//\t\t\t\tc = 1 + solve(hs)\n\t//\t\t\t}\n\t//\t\t\tif ix(gs, i, j-1) == PigCell {\n\t//\t\t\t\ths := copyGrid(gs)\n\t//\t\t\t\ths[i][j-1] = EmptyCell\n\t//\t\t\t\ths[i][j] = EmptyCell\n\t//\t\t\t\td = 1 + solve(hs)\n\t//\t\t\t}\n\t//\t\t\tif m := maximum(a, b, c, d); m > max {\n\t//\t\t\t\tmax = m\n\t//\t\t\t}\n\t//\t\t}\n\t//\t}\n\t//}\n\t//return max\n}\n\ntype Wolf struct {\n\ti, j int\n}\n\ntype Pair struct {\n\tx, y int\n}\n\nfunc maximum(xs ...int) int {\n\tmax := 0\n\tfor i := 0; i < len(xs); i++ {\n\t\tif xs[i] > max {\n\t\t\tmax = xs[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc ix(gs [][]Cell, i, j int) Cell {\n\tif i < 0 || j < 0 || i > len(gs)-1 || j > len(gs[i])-1 {\n\t\treturn EmptyCell\n\t}\n\n\treturn gs[i][j]\n}\n\nfunc copyGrid(gs [][]Cell) [][]Cell {\n\tcs := make([][]Cell, len(gs))\n\tfor i := 0; i < len(gs); i++ {\n\t\tcs[i] = make([]Cell, len(gs[i]))\n\t\tcopy(cs[i], gs[i])\n\t}\n\treturn cs\n}\n\nfunc copyAppend(ys []int, xs ...int) []int {\n\tns := make([]int, len(ys), len(ys)+len(xs))\n\tcopy(ns, ys)\n\treturn append(ns, xs...)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toLower(x byte) byte {\n\treturn x + ('a' - 'A')\n}\n\nfunc isUpper(x byte) bool {\n\treturn x >= 'A' && x <= 'Z'\n}\n\nfunc initArray(n, x int) []int {\n\txs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\txs[i] = x\n\t}\n\treturn xs\n}\n\nfunc nextInt(s *bufio.Scanner) (n int) {\n\ts.Scan()\n\tn, _ = strconv.Atoi(s.Text())\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "7b77fb323a14743b8e4b8373841c8500", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "2a393158da6a599566054d13188c3ab2", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.3537234042553192, "equal_cnt": 20, "replace_cnt": 19, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 21, "bug_source_code": " b = max[i][j-1] + 1\n }\n if i < n - 1 && board[i+1][j] == 'P' {\n c = max[i+1][j] + 1\n }\n if j < m - 1 && board[i][j+1] == 'P' {\n d = max[i][j+1] + 1\n }\n var s = []int {a, b, c, d}\n sort.Sort(sort.Reverse(sort.IntSlice(s)))\n max[i][j] = s[0]\n }\n }\n }\n r := 0;\n for i := 0; i < n; i++ {\n for j := 0; j < m; j++ {\n r += max[i][j]\n }\n }\n return r\n}\n\nfunc main() {\n fmt.Scan(&n, &m)\n board = make([][]byte, n)\n max = make([][]int, n)\n for i := 0; i < n; i++ {\n board[i] = make([]byte, m)\n max[i] = make([]int, m)\n var s string\n fmt.Scan(&s)\n for j := 0; j < m; j++ {\n board[i][j] = s[j]\n }\n }\n fmt.Println(findMax())\n}", "lang": "Go", "bug_code_uid": "e411838bd6539b0a719fc04c1620876c", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "2391b0aef9a656d005bdeba33cd7929e", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9597701149425287, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import \"fmt\"\n\nfunc main() {\n\n\tvar n, k int\n\t_, _ = fmt.Scan(&n, &k)\n\n\tfor i := 0; i < k; i++ {\n\t\tif n%10 == 0 {\n\t\t\tn /= 10\n\t\t} else {\n\t\t\tn--\n\t\t}\n\t}\n\n\tfmt.Println(n)\n\n}", "lang": "Go", "bug_code_uid": "f705d6201a7a6d783b5f31e4c05314c4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "a355594d83a8fedb880cebf3f86dda34", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.11799410029498525, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "import \"fmt\"\n\nfunc main(){\n fmt.Println(\"hi\")\n \n}", "lang": "Go", "bug_code_uid": "dc2eda983424c0371875cc4fd2096cf7", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "36a0d365e126b0c491a2534d6f946dea", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7252747252747253, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc wrongSubstraction() int {\n\tinput := os.Args[1:]\n\n\tnumber, _ := strconv.Atoi(input[0])\n\titer, _ := strconv.Atoi(input[1])\n\n\tfor i := 0; i < iter; i++ {\n\t\tif number%10 == 0 {\n\t\t\tnumber /= 10\n\t\t} else {\n\t\t\tnumber--\n\t\t}\n\t}\n\treturn number\n}\n\nfunc main() {\n\tfmt.Println(wrongSubstraction())\n}\n", "lang": "Go", "bug_code_uid": "c63c3b92e1703beb514d290defd8f8cb", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "1578eeb2c8e7ba7b4318a9dfd44744a6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9986091794158554, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nconst MOD int64 = 1000000007\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt64()\n\tvar ret, a int64 = 1, 1\n\n\tfor ; n > 0; n-- {\n\t\tret = (ret * 27) % MOD\n\t\ta = (a * 7) % MOD\n\t}\n\tprintln(ret, a)\n\tif ret < a {\n\t\tret += MOD\n\t}\n\tprintln(ret - a)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "098fcf727bc694c266c676e2f9ee6def", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "5740461f998b4b512177d1142f83ac0c", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9977426636568849, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\tmod = 1000000007\n)\n\nfunc pow(n int, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tres := pow(n, k>>1)\n\tres = int((int64(res) * int64(res)) % mod)\n\tif k&1 != 0 {\n\t\tres = int((int64(res) * int64(n)) % mod)\n\t}\n\treturn res\n}\n\nfunc solve(n int) int {\n\ta := pow(3, 3*n)\n\ta -= pow(7, n)\n\ta %= mod\n\tif a < 0 {\n\t\treturn a - mod\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Println(solve(n))\n}\n", "lang": "Go", "bug_code_uid": "e0c42cd3574d11e487507ab95cbba29d", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "3c805ef64a1dba46aaebdc5bb5c78a2b", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5727602278612118, "equal_cnt": 29, "replace_cnt": 15, "delete_cnt": 4, "insert_cnt": 9, "fix_ops_cnt": 28, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc factorize(x int64) (length int, result [50]int64) {\n ri:=0\n reminder:=x\n lastdivider:=int64(2)\n for 1=0; i-- {\n vec[i]++\n if pab[i]=0; i-- {\n veca[i]=0\n }\n \nMainLoopA:\n for {\n for i:=la; i>=0; i-- {\n veca[i]++\n if pa[i]=0; i-- {\n vecb[i]=0\n }\n \n MainLoopB:\n for {\n for i:=lb; i>=0; i-- {\n vecb[i]++\n if pb[i] s {\n\t\t\tbreak\n\t\t}\n\t\tbigger := s / smaller\n\t\tcheckBest(aDiv, a, smaller, bigger, &best)\n\t\tcheckBest(bDiv, b, smaller, bigger, &best)\n\t}\n\n\tfmt.Println(best)\n}", "lang": "Go", "bug_code_uid": "661496cd8c943ee2c2f76d7dad1bc251", "src_uid": "7d0c5f77bca792b6ab4fd4088fe18ff1", "apr_id": "be914e1f5f01f63f13f9f14308670608", "difficulty": 2000, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9974358974358974, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc countRotations(inStr string) int{\n\tvar cur = 'a'\n\tvar ans = 0\n\tvar dis = 0\n\tfor _, c := range inStr{\n\t\tfmt.Println(cur,c,int(cur),int(c))\n\t\tdis=int(cur)-int(c)\n\t\tif dis<0{\n\t\t\tdis=-dis\n\t\t}\n\t\tif (26-dis) 0 {\n\t\tres += sig[n%10]\n\t\tn /= 10\n\t}\n\treturn res\n}\n\nfunc main() {\n\n\tvar k, n int\n\tvar res int64 = 0\n\tnice := []int{0, 1, 11, 111, 1111, 11111, 111111}\n\tnice2 := []int{1, 10, 100, 1000, 10000, 100000, 1000000}\n\ta := 1\n\tb := 100\n\tfmt.Scan(&a, &b)\n\tfor n = 0; b > a+9; n++ {\n\t\tk = getsumm(b/10)*nice2[n] + sig[10]*nice[n]\n\t\tfor ; b%10 != 9; b-- {\n\t\t\tres += int64(k + sig[b%10])\n\t\t}\n\t\tk = getsumm(a/10)*nice2[n] + sig[10]*nice[n]\n\t\tfor ; a%10 != 0; a++ {\n\t\t\tres += int64(k + sig[a%10])\n\t\t}\n\t\ta /= 10\n\t\tb /= 10\n\t}\n\tfor ; b+1 > a; a++ {\n\t\tres += int64(getsumm(a)*nice2[n] + sig[10]*nice[n])\n\t}\n\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "3154f529885fa36f0ee1f95203ef5790", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "156a0100e119b8b8a972aa9211db8cea", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8666666666666667, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"math\"\n)\n\n//N _\nconst (\n\tN = 1e6 + 5\n)\n\nvar values []byte \n\nfunc inputter(inputReader *bufio.Reader,strs chan *string){\n\tfor {\n\t\tinput , _ := inputReader.ReadString('\\n')\n\t\tinput = strings.TrimSpace(input)\n\t\tif len(input) > 0 {\n\t\t\tinputs := strings.Split(input, \" \")\n\t\t\tfor i := range inputs{\n\t\t\t\tstrs <- &inputs[i]\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc digits(x int32, ch chan byte){\n\ta := byte(0)\n\tfor x > 0 {\n\t\ta += values[x%10]\n\t\tx/=10\n\t}\n\tch <- a\n}\n\nfunc main(){\n\trs := bufio.NewReader(os.Stdin)\n\tws := bufio.NewWriter(os.Stdout)\n\n\tstrs := make(chan *string, 100)\n\n\tgo inputter(rs, strs)\n\n\ta , _ := strconv.ParseInt(*<-strs, 10, 64)\n\tb , _ := strconv.ParseInt(*<-strs, 10, 64)\n\n\tvalues = []byte{6, 2, 5, 5, 4, 5, 6, 3, 7, 6}\n\n\tch := make(chan byte)\n\n\tfor i := a; i <= b; i++ {\n\t\tgo digits(int32(i), ch)\n\t}\n\n\ttotal := int64(0)\n\tfor i := int64(0); i < b - a + 1; i++ {\n\t\ttotal += int64(<-ch)\n\t}\n\n\tws.WriteString(fmt.Sprint(total))\n\tws.Flush()\n}\n\n\n", "lang": "Go", "bug_code_uid": "3f32e52158a9f322efacc5a5cb9bbb13", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "5bbfc9326fe527637ba388e97fcb25f2", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9431438127090301, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar dig = map[int]int{\n\t0: 6,\n\t1: 2,\n\t2: 5,\n\t3: 5,\n\t4: 4,\n\t5: 5,\n\t6: 6,\n\t7: 3,\n\t8: 7,\n\t9: 6,\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tstart := strings.Split(scanner.Text(), \" \")\n\tx1, _ := strconv.Atoi(start[0])\n\tx2, _ := strconv.Atoi(start[1])\n\n\tsum := 0\n\tfor i := x1; i <= x2; i++ {\n\t\tsum += dig[i]\n\t}\n\tfmt.Print(sum)\n}\n", "lang": "Go", "bug_code_uid": "9442a49d49d1a15927edb79887c5bf4b", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "b42685ea1fc05f2d1e7581e866ed8fd0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9559939301972686, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n total, found, min, max := getI(), getI(), getI(), getI()\n foundMin, foundMax := false, false\n for i := 0; i < found; i++ {\n x := getI()\n if x == min {\n foundMin = true\n } else if x == max {\n foundMax = true\n }\n }\n result := \"Correct\"\n if !foundMin && !foundMax && total-found == 1 {\n result = \"Incorrect\"\n }\n writer.WriteString(fmt.Sprintf(\"%s\\n\", result))\n}\n", "lang": "Go", "bug_code_uid": "43cee9808d41f0ed32ef5a8493441423", "src_uid": "99f9cdc85010bd89434f39b78f15b65e", "apr_id": "4beee424f6986e228e8de67d70eff2e8", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.962246192893401, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1114/C\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\tn, b int64\n)\n\nfunc main() {\n\tn, b = ReadInt64_2()\n\n\tif n == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tmemo := TrialDivision(b)\n\n\tcounts := make(map[int64]int64)\n\tfor a := range memo {\n\t\tcnt := int64(0)\n\t\tcur := a\n\t\tfor n/cur != 0 {\n\t\t\tcnt += n / cur\n\n\t\t\tcur *= a\n\t\t}\n\n\t\tcounts[a] = cnt\n\t}\n\n\tans := int64(INF_INT64)\n\tfor a, cnt := range counts {\n\t\te := memo[a]\n\t\tChMin(&ans, cnt/e)\n\t}\n\tfmt.Println(ans)\n}\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 *int64, target int64) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int64) map[int64]int64 {\n\tvar i, exp int64\n\tp := map[int64]int64{}\n\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tfor i = 2; i*i <= n; 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/*******************************************************************/\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", "lang": "Go", "bug_code_uid": "5d91967f7a9628e9f42a85d449d9c7af", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "a82d407d79a57077b1b4f518c278b020", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6638225255972696, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1114C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, x int64\n\tFscan(in, &n, &x)\n\tans := int64(1e18)\n\tf := func(p, e int64) {\n\t\tc := int64(0)\n\t\tfor pp := p; pp <= n; pp *= p {\n\t\t\tc += n / pp\n\t\t}\n\t\tif c/e < ans {\n\t\t\tans = c / e\n\t\t}\n\t}\n\tfor i := int64(2); i*i <= x; i++ {\n\t\te := int64(0)\n\t\tfor ; x%i == 0; x /= i {\n\t\t\te++\n\t\t}\n\t\tif e > 0 {\n\t\t\tf(i, e)\n\t\t}\n\t}\n\tif x > 1 {\n\t\tf(x, 1)\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF1114C(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "fde19bcf1ec723bca5dd430538f88737", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "ccb1fabf2e2577da86223e45569a1e6d", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.918007662835249, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tx, t := scanInt(scanner), scanInt(scanner)\n\ta, b := scanInt(scanner), scanInt(scanner)\n\tda, db := scanInt(scanner), scanInt(scanner)\n\tfor i := 0; i < t; i++ {\n\t\tfor j := 0; j < t; j++ {\n\t\t\tif a-i*da + b-j*db == x {\n\t\t\t\twriter.WriteString(\"YES\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\twriter.WriteString(\"NO\\n\")\n}\n", "lang": "Go", "bug_code_uid": "45383b1bd94b26ed1dfeeaff2fe5d8ee", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "d89235609c9f0b2f27e915b45c614d87", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8571428571428571, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x,t,a,b,da,db int\n fmt.Scan(&x,&t,&a,&b,&da,&db)\n m := make(map[int]bool)\n for i := 0; i < t; i++ {\n m[a-(da*i)] = true\n }\n ans := false\n for i := 0; i < t; i++ {\n if m[x-(b-(db*i))] {\n ans = true\n break\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang": "Go", "bug_code_uid": "72f77c0d86e802eb4f36f6141e56d289", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "3d113739b2fe5dfc967c55117a120c85", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.97708082026538, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "// 203A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tx, t, a, b, va, vb int\n\t\tax, bx [305]int\n\t)\n\tfmt.Scan(&x, &t, &a, &b, &va, &vb)\n\tax[0], ax[t] = a, 0\n\tbx[0], bx[t] = b, 0\n\tfor i := 1; i < t; i++ {\n\t\tbx[i] = bx[i-1] - vb\n\t\tax[i] = ax[i-1] - va\n\t}\n\tfor i := 0; i <= t; i++ {\n\t\tfor j := 0; j <= t; j++ {\n\t\t\tif ax[i]+bx[j] == x {\n\t\t\t\tfmt.Print(\"YES\")\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "9d8b9647783e514d2b5f2d88308a57a4", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "b1d4d844ae3bbd064dbc80969af09719", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7197802197802198, "equal_cnt": 20, "replace_cnt": 20, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 20, "bug_source_code": "// 203A-mic_rizal\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, t, a, b, y, k int\n\n\tfmt.Scan(&x, &t, &a, &b, &y, &k)\n\n\tret := false\n\n\tif x == 0 {\n\t\tret = true\n\t}\n\tfor i := 0; i < t; i++ {\n\t\tif x == a-i*y {\n\t\t\tret = true\n\t\t}\n\t}\n\tfor i := 0; i < t; i++ {\n\t\tif x == b-i*k {\n\t\t\tret = true\n\t\t}\n\t}\n\tfor i := 0; i < t; i++ {\n\t\tfor r := 0; r < t; r++ {\n\t\t\tif x == a-i*y+b-r*k {\n\t\t\t\tret = true\n\t\t\t}\n\t\t}\n\t}\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {4\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "6b8ec95f4e30fe1ef77311e07a5ef346", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "69df9d9bb3d6b3922d5a637c07e6ceaa", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8440366972477065, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "// 304A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, n int\n\ts := 0\n\tfmt.Scan(&n)\n\tfor a = 1; a <= n; a++ {\n\t\tfor b = a; b <= n; b++ {\n\t\t\tc := math.Sqrt(float64(a ^ 2 + b ^ 2))\n\t\t\tif int(c) <= n && int(c*c) == a^2+b^2 {\n\t\t\t\ts++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(s)\n}\n", "lang": "Go", "bug_code_uid": "fb53912cbd2078148db4c8a82b8f3d24", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "a3d8604117a4bd3c379066fbb1952c4d", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5253077975376197, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nvar x, k, A, B, res int64\n\nfunc main() {\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\", &x, &k, &A, &B)\n\tfor x > 1 {\n\t\tif (k == 1) || (x % k != 0) {\n\t\t\tx--\n\t\t\tres += A\n\t\t} else {\n\t\t\td := x / k;\n\t\t\tif B > (x - d) * A {\n\t\t\t\tx--\n\t\t\t\tres += A\n\t\t\t} else {\n\t\t\t\tx /= k\n\t\t\t\tres += B\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "c18e9842edc543127b8329d5fb187120", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "5c9f8e0d4042963ef1fdc58095553bb0", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.42278481012658226, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nvar x, k, A, B, res int64\n\nfunc main() {\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\", &x, &k, &A, &B)\n\tx--;\n\tif k == 1 {\n\t\tres = x * A\n\t\tx = 0\n\t}\n\tfor x > 0 {\n\t\tif x % k != 0 {\n\t\t\td := x % k;\n\t\t\tx -= d\n\t\t\tres += A * d\n\t\t} else {\n\t\t\td := x / k;\n\t\t\tif B > (x - d) * A {\n\t\t\t\tx -= d\n\t\t\t\tres += A * d\n\t\t\t} else {\n\t\t\t\tx /= k\n\t\t\t\tres += B\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "64a4b1570044f0a1dac41237a2748e1d", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "5c9f8e0d4042963ef1fdc58095553bb0", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6485568760611206, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\tvar t int64\n\n\n\tfmt.Fscanf(buf, \"%d\\n\", &t)\n\tvar ans int64 = 1+t\n\n\tfor i := int64(2);i*i <= t;i++{\n\t\tif t%i == 0{\n\t\t\tif ans > i+t/i{\n\t\t\t\tans = i+t/i\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\",ans)\n}\n", "lang": "Go", "bug_code_uid": "2f7e7c2cf318717122a0f182ae9d431f", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "ed73120c4997b9b93a5aa89a51c978d4", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5953079178885631, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n\t// \"fmt\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc main() {\n\tdefer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n\tn := ReadInt()\n\n\tif n == 1 {\n\t writer.WriteString(\"2\")\n\t return\n\t}\n\n\tif n == 2 {\n\t writer.WriteString(\"3\")\n\t\treturn\n\t}\n\n\tif n%2 == 0 {\n\t writer.WriteString(strconv.Itoa((n/2) + 2))\n\t} else {\n\t writer.WriteString(strconv.Itoa(((1+n)/2) + 2))\t\t\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "5a209df3a1c6278d1f7affdf6647e418", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "0ab914aabf86bb6461d1f8087f13d9f4", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7519061583577713, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBIG = 1024 * 1024 * 10\n)\n\nfunc readLine(r *bufio.Reader) string {\n\tbytes, _, err := r.ReadLine()\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to read line\")\n\t}\n\n\treturn string(bytes)\n}\n\nfunc readInts(r *bufio.Reader) []int {\n\telems := strings.Fields(readLine(r))\n\n\tret := make([]int, len(elems))\n\tfor i, el := range elems {\n\t\ttmp, err := strconv.ParseInt(el, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to parse number %v\", el)\n\t\t}\n\t\tret[i] = int(tmp)\n\t}\n\n\treturn ret\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, BIG)\n\n\ttmp := readInts(r)\n\tw, h := tmp[0], tmp[1]\n\ttmp = readInts(r)\n\tu1, d1 := tmp[0], tmp[1]\n\ttmp = readInts(r)\n\tu2, d2 := tmp[0], tmp[1]\n\n\tfor i := h; i > 0; i-- {\n\t\tw += i\n\t\tif i == d1 {\n\t\t\tif w > u1 {\n\t\t\t\tw -= u1\n\t\t\t} else {\n\t\t\t\tw = 0\n\t\t\t}\n\t\t} else if i == d2 {\n\t\t\tif w > u2 {\n\t\t\t\tw -= u2\n\t\t\t} else {\n\t\t\t\tw = 0\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(w)\n}\n", "lang": "Go", "bug_code_uid": "324e9e1e0ca98db66105d7800bb21c82", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "1139e5983737b76a577c7bfd4df557f2", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5868263473053892, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "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\tinputreader := bufio.NewReader(os.Stdin)\n\t_, _ = inputreader.ReadString('\\n')\n\tinput, _ := inputreader.ReadString('\\n')\n\n\thours := 0\n\tfirst := false\n\tskips := 0\n\t\n\tfor _, n := range strings.Split(input, \" \") {\n\t\tk, _ := strconv.Atoi(n)\n\t\tif k == 1 {\n\t\t\tif !first {\n\t\t\t\thours++\n\t\t\t\tfirst = true\n\t\t\t} else if skips == 1 {\n\t\t\t\thours+=2\n\t\t\t} else {\n\t\t\t\thours++\n\t\t\t}\n\t\t\tskips = 0\n\t\t} else {\n\t\t\tskips ++\n\t\t}\n\t}\n\n\n\n\tfmt.Print(hours)\n\n\n\n}\n", "lang": "Go", "bug_code_uid": "5777e8e4462d102a98c36477b64a0ad2", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "9ae96b45bdcf348663c29dde921b1fc8", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9947552447552448, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n)\n\n// Node -> node in Linked-List\ntype Node struct {\n\tD int\n\tNext *Node\n}\n\n// Head -> head of Linked-List\ntype Head struct {\n\tFront *Node\n\tBack *Node\n\tC int\n}\n\nfunc (h *Head) createNode(i int) *Node {\n\tvar n *Node = new(Node)\n\tn.D = i\n\tn.Next = nil\n\th.C++\n\treturn n\n}\n\nfunc (h *Head) solve() int {\n\tvar c int\n\th.Back = h.Front\n\tfor i := 0; i < h.C-1; i++ {\n\t\tif (h.Back.Next.D - h.Back.D) == 1 {\n\t\t\tc++\n\t\t} else if (h.Back.Next.D - h.Back.D) == 2 {\n\t\t\tc += 2\n\t\t} else {\n\t\t\tc++\n\t\t}\n\t\th.Back = h.Back.Next\n\t}\n\tc++\n\n\treturn c\n}\n\nfunc (h *Head) free() {\n\th.Back = h.Front\n\tfor h.Back != nil {\n\t\th.Front = h.Back.Next\n\t\th.Back.D = 0\n\t\th.Back.Next = nil\n\t\th.Back = h.Front\n\t}\n\th.C = 0\n}\n\nfunc main() {\n\tvar head *Head = new(Head)\n\tvar newNode *Node\n\tvar scanner *bufio.Scanner\n\tvar s string\n\tvar count int = 0\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\thead.Front = nil\n\thead.Back = nil\n\thead.C = 0\n\t// n\n\tscanner.Scan()\n\n\t// data\n\tscanner.Scan()\n\ts = regexp.MustCompile(\"\\\\s*\").ReplaceAllString(scanner.Text(), \"\")\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '1' {\n\t\t\tnewNode = head.createNode(i + 1)\n\t\t\tif head.Front == nil {\n\t\t\t\thead.Front = newNode\n\t\t\t\thead.Back = newNode\n\t\t\t} else {\n\t\t\t\thead.Back.Next = newNode\n\t\t\t\thead.Back = newNode\n\t\t\t}\n\t\t}\n\t}\n\n\thead.Back = head.Front\n\t// fmt.Println(\"number of node(s):\", head.C)\n\t// for head.Back != nil {\n\t// \tfmt.Printf(\"%d \", head.Back.D)\n\t// \thead.Back = head.Back.Next\n\t// }\n\t// fmt.Println()\n\n\tcount = head.solve()\n\n\tfmt.Println(count)\n\n\thead.free()\n\n\t// fmt.Println(\"number of node(s):\", head.C)\n\t// for head.Back != nil {\n\t// \tfmt.Printf(\"%d \", head.Back.D)\n\t// \thead.Back = head.Back.Next\n\t// }\n\n}\n", "lang": "Go", "bug_code_uid": "bd9811316806bce165d8dc5798b38892", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "b5de6f9c38e56fc716c3926e4d71ccfe", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.3501683501683502, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "// 已知某广场的长宽(都为整数),现有瓷砖(数量大于0小于10的9次方),请问最少需要多少块能把广场铺满,瓷砖不能打碎,瓷砖长宽与广场长宽平行\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc needNumber(m, n, a int32) int32 {\n\tvar w, h int32\n\tif m%a > 0 {\n\t\tw = m/a + 1\n\t} else {\n\t\tw = m / a\n\t}\n\tif n%a > 0 {\n\t\th = n/a + 1\n\t} else {\n\t\th = n / a\n\t}\n\treturn w * h\n}\nfunc main() {\n\tvar m, n, a int32\n\tfmt.Scanln(&m, &n, &a)\n\tnum := needNumber(m, n, a)\n\tfmt.Println(num)\n\n}\n\n//学会使用if else语法\n//学会使用标准输入输出语法\n", "lang": "Go", "bug_code_uid": "0b57cdebb4ab094f84fac93bd306eddd", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "5d8f9dcba76fc1c64040aadc0ad31961", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9921259842519685, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\n\n\nfunc main() {\n\n\tvar a, b int;\n\n\tfmt.Scan(&a, &b);\n\n\tfmt.Println((a * b) / 2)\n}\n", "lang": "Go", "bug_code_uid": "c7f8a0d8d707be2f5d374254c017cb66", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "dc46498100f4e36df8cfed8094a422d8", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9827586206896551, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main \n\nimport (\"fmt\"\n \"math\"\n)\n\nfunc main (){\n var m float64\n var n float64\n fmt.Scan(&m,&n)\n \n h := int64(math.Floor(n*m/2)\n fmt.Println(h)\n}\n", "lang": "Go", "bug_code_uid": "07335a0a3302ecfdfebcc198e71b48d6", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "363e6bc2865a3305332214cf2525815f", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9285714285714286, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar m, n int\n\tfmt.Scan(&m, &n)\n\tfmt.Println(int(math.Floor(m * n / 2)))\n}\n", "lang": "Go", "bug_code_uid": "19f294408b5cdcc96a6451373cca7067", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "25e9a018ed01bd1d1e61b6fcd6e170c2", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9954337899543378, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var m, n int\n fmt.Scanf(&m, &n)\n fmt.Println(m * n / 2)\n}\n", "lang": "Go", "bug_code_uid": "85ab664aa3b40e8876e1016fef96c967", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "baa27647ba45014cf41d907cb4b8edd2", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.1254125412541254, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc calc(t int) string {\n\tvar a int\n\tvar b int\n\tfmt.Scanln(&a,&b)\n\tvar prev int = a\n\tvar sum1 int = a\n\tvar sum2 int = b\n\tvar flag bool = false\n\n\tif a!=b{\n\t\treturn \"rated\"\n\t}\n\tfor i:=1;i 0 {\n\t\titem := heap.Pop(&queue).(*Item)\n\t\tu := item.value\n\n\t\tif !fixed[u] {\n\t\t\tfixed[u] = true\n\t\t\tdelta := []int{u - 1, u + 1, u * 2}\n\t\t\tcost := []int{x, x, y}\n\t\t\tfor idx, v := range delta {\n\t\t\t\tif (v > 0) && (v <= 2*n) && (!fixed[v]) {\n\t\t\t\t\tcost := int64(cost[idx])\n\t\t\t\t\tif best[v] > best[u]+cost {\n\t\t\t\t\t\tbest[v] = best[u] + cost\n\t\t\t\t\t\tnewItem := &Item{value: v, priority: best[v]}\n\t\t\t\t\t\theap.Push(&queue, newItem)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tout.WriteString(strconv.FormatInt(best[n], 10))\n\tout.WriteByte('\\n')\n}\n", "lang": "Go", "bug_code_uid": "cf9e3f61e9ad8db8e05c2e4803abb221", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "f9b373471ed9cbfb14fc3fde4bb2c3fc", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.926729986431479, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nvar in *bufio.Scanner\nvar out *bufio.Writer\n\nfunc dp(n int, x int64, y int64) int64 {\n\tf := make([]int64, n+1)\n\n\tf[0] = 0\n\tfor i := 1; i <= n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tf[i] = min(f[i-1]+x, f[i/2]+y)\n\t\t} else {\n\t\t\tf[i] = min(f[i-1]+x, f[(i+1)/2]+y+x)\n\t\t}\n\t}\n\n\treturn f[n]\n}\n\nfunc main() {\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n\n\tin.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tin.Scan()\n\tn, _ := strconv.Atoi(in.Text())\n\n\tin.Scan()\n\tx, _ := strconv.Atoi(in.Text())\n\n\tin.Scan()\n\ty, _ := strconv.Atoi(in.Text())\n\n\tres := dp(n, int64(x), int64(y))\n\n\tout.WriteString(strconv.FormatInt(res, 10))\n\tout.WriteByte('\\n')\n}\n", "lang": "Go", "bug_code_uid": "2242752161ea517352484be89f0c41e1", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "f9b373471ed9cbfb14fc3fde4bb2c3fc", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9921328671328671, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, x, y := nextInt(), nextInt64(), nextInt64()\n\ta := make([]int64, n+1)\n\n\tdp(a, x, y)\n\n\tprintln(a[n])\n}\n\nfunc dp(a []int64, x, y int64) {\n\tfor i := 1; i < len(a); i++ {\n\t\tif i%2 == 0 {\n\t\t\ta[i] = min(a[i-1]+x, a[i/2]+y)\n\t\t} else {\n\t\t\ta[i] = min(a[i-1]+x, a[i/2]+x+y)\n\t\t}\n\t}\n}\n\nfunc min(a, b int64) int64 {\n\tif a <= b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "62b5712523f97ab3e0e73988e8c1b691", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "c893775e539dc02154acdd70cea9bcce", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9715489989462592, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "// http://codeforces.com/problemset/problem/710/E\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min (a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc main() {\n\tvar n int\n\tvar x, y int64\n\n\tfmt.Scanln(&n, &x, &y)\n\ttimes := make([]int64, n)\n\n\ttimes[0] = x\n\tfor i := 1; i < n; i++ {\n\t\tif i % 2 == 0 {\n\t\t\t// odd\n\t\t\ttimes[i] = x + times[i - 1]\n\t\t} else {\n\t\t\t// even\n\t\t\ttimes[i] = min(x + times[i - 1], y + times[i / 2])\n\t\t}\n\t}\n\n\tfmt.Println(times[n - 1])\n}\n\n", "lang": "Go", "bug_code_uid": "97ba9fa4ea9e28e9df412161d8eea125", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "659c90ddcad0bf5a3799caa7d86f92a2", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9772727272727273, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scanf(\"%s\", &s)\n c := s[0] - 'a'\n d := s[1] - '1'\n answ := 8\n var b1, b2 bool\n if c == 0 || c == 7 {\n answ -= 3\n b1 = true\n }\n if d == 0 || d == 7 {\n answ -= 3\n b2 = true\n }\n if b1 && b2 {\n answ++\n }\n print(answ)\n}", "lang": "Go", "bug_code_uid": "add9393bea3a0d8d890bf65375eff85c", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "ed998e404fffb3d8ad4b4c9e18d2e19a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9512341962673089, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "// Try Codeforces\n// author: Leonrdone @ NEETSDKASU\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Foo []int64\n\nfunc (f Foo) Len() int { return len(f) }\nfunc (f Foo) Swap(i, j int) { f[i], f[j] = f[j], f[i] }\nfunc (f Foo) Less(i, j int) bool { return f[i] < f[j] }\n\nfunc main() {\n\tvar n, k int\n\tvar m int64\n\tfmt.Scan(&n, &k, &m)\n\txs := make([]int64, k)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\tsum := int64(0)\n\tfor _, x := range xs {\n\t\tsum += x\n\t}\n\tsort.Sort(Foo(xs))\n\tans := int64(0)\n\tfor i := 0; i < n; i++ {\n\t\taltm := sum * int64(i)\n\t\tif altm > m {\n\t\t\tbreak\n\t\t}\n\t\ttmp := int64((k + 1) * i)\n\t\tp := int64(n - i)\n\t\tfor _, x := range xs {\n\t\t\tw := p\n\t\t\tfor altm+w*x > m {\n\t\t\t\tw--\n\t\t\t}\n\t\t\taltm += w * x\n\t\t\ttmp += w\n\t\t}\n\t\tif tmp > ans {\n\t\t\tans = tmp\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "63ee776c8d1803c0a2cfee911a17dc9a", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "apr_id": "053c0f597246651ab2ca282bc78c94fe", "difficulty": 1800, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9982425307557118, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nvar in *bufio.Reader = bufio.NewReader(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc f(x, y, z int, c chan int) {\n\tc <- x + y + z\n\tc <- x + y * z\n\tc <- (x + y) * z\n\tc <- x * y + z\n\tc <- x * (y * z)\n\tc <- x * y * z\n\tclose(c)\n}\n\nfunc max(x, y int) int {\n\tif (x < y) {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\tvar a, b, c int\n\tfmt.Fscan(in, &a, &b, &c)\n\n\tch := make(chan int)\n\tgo f(a,b,c, ch)\n\n\tvar res int\n\tfor i := range ch {\n\t\tres = max(res, i)\n\t}\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "16fcea57ae590af2dc0b8ed95547aa99", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "d7d6cbdc95371fd4473495ef60fcd9a3", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8846880907372401, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x1, y1 float64\n\tvar x2, y2 float64\n\tfmt.Scanf(\"%f %f\\n\", &x1, &y1)\n\tfmt.Scanf(\"%f %f\\n\", &x2, &y2)\n\n\txDiff := math.Abs(x1 - x2)\n\tyDiff := math.Abs(y1 - y2)\n\n\tfmt.Println(math.Max(xDiff, yDiff))\n}\n", "lang": "Go", "bug_code_uid": "203beb5f90e8e6c01b42ea1dc9293c5e", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "94e4568cbfe0f3ec71d3f2cb039b2bf2", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9899888765294772, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\tt string\n\t\ta string\n\t\tb bool\n\t)\n\tfmt.Scan(&t)\n\ttslice := strings.Split(t, \"\")\n\tn := len(tslice)\n\tif n % 2 != 0 {\n\t\ta += tslice[n / 2]\n\t\tfor i := n / 2; i < n - 1; i++ {\n\t\t\ttslice[i] = tslice[i + 1]\n\t\t}\n\t\tb = true\n\t\tn--\n\t}\n\tfor i := n / 2 - 1; i >= 0; i-- {\n\t\tif b {\n\t\t\ta += tslice[i] + tslice[n - i - 1]\n\t\t} else {\n\t\t\ta += tslice[n - i - 1] + tslice[i]\n\t\t}\n\t}\n\tfmt.Println(a)\n}\n", "lang": "Go", "bug_code_uid": "1ba7e5fb746bb1c082960002896033de", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "e76710a8a0840c392f3ccff1e8f55dea", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5942275042444821, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\ta, b := make([]byte, m), make([]byte, m)\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = '#'\n\t\tb[i] = '.'\n\t}\n\tb[m - 1] = '#'\n\tfor i := 0; i < n; i++ {\n\t\tif i % 2 == 0 {\n\t\t\tfmt.Println(string(a))\n\t\t} else {\n\t\t\tfmt.Println(string(b))\n\t\t\trev(b)\n\t\t}\n\t}\n\n}\n\nfunc rev(a []byte) {\n\tfor i, j := 0, len(a) - 1; i <= j; {\n\t\ta[i], a[j] = a[j], a[i]\n\t\ti++\n\t\tj--\n\t}\n}\n\nfunc nextInt() int {\n\tin.Scan()\n\tres, _ := strconv.Atoi(in.Text())\n\treturn res\n}", "lang": "Go", "bug_code_uid": "e66349132835fc3d95aa37d03f099e07", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "f6b23649a01ccb13acafecb6b568c2a4", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4068181818181818, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "package main\n\n//14:17\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, m int\n fmt.Scanf(\"%d %d\", &n,&m)\n var i,j int\n for true {\n for j=0;j<=i;j++ {\n if n == j + m*i{\n fmt.Printf(\"%d\", i+j)\n return\n }else if n <= j+m*i {\n fmt.Printf(\"-1\");\n return;\n }\n }\n i++\n }\n}\n", "lang": "Go", "bug_code_uid": "d65dcabda27e00bf5ec4e59b75301b74", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "4960c8edfeb48d6bc49cad2cd943a0d3", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9747530186608123, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tvar n, x int\n\tscan(&n, &x)\n\tif n/x > 0 {\n\t\tv2 := n / 2\n\t\tv1 := n % 2\n\t\tfor v2 >= 0 {\n\t\t\tfmt.Println(v2, v1)\n\t\t\tif (v2+v1)%x == 0 {\n\t\t\t\tfmt.Println(v2 + v1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tv2--\n\t\t\tv1 += 2\n\t\t}\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n", "lang": "Go", "bug_code_uid": "66e01c4a56f327016adac35cff9ff768", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "d68e81cb535d69171b94356daea7c67c", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9259694477085781, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, m int // n台阶级数,m移动次数是m倍\n\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(reader, &n, &m)\n\n\tif m > n { // 如果倍数比台阶还多,肯定不可能\n\t\tfmt.Println(-1)\n\t} else {\n\t\tvar move int\n\t\t//如果台阶是偶数 直接先除2\n\t\tif n%2 == 0 {\n\t\t\tmove = n / 2\n\n\t\t} else {\n\t\t\tmove = (n + 1) / 2\n\t\t}\n\t\tif move%m == 0 {\n\t\t\tfmt.Println(move)\n\t\t} else {\n\t\t\tfmt.Println(move + 1)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a9223501a37f0bd76e6231f55aaee813", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "50589bb57eb601c868d39a0d3d8944a8", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9865897131217111, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int { return len(slice) }\nfunc (slice Int64Slice) Less(i, j int) bool { return slice[i] < slice[j] }\nfunc (slice Int64Slice) Swap(i, j int) { slice[i], slice[j] = slice[j], slice[i] }\n\nvar usr1 [20]int\nvar usr2 [20]int\n\nvar n, m int\nvar val [2][30]int\n\nfunc guess(v int) int {\n\tret := 0\n\tfor i := 0; i < n; i++ {\n\t\tif v == val[0][i*2] || v==val[0][i*2+1] {\n\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\tif v == val[1][j*2] || v==val[1][j*2+1] {\n // fmt.Printf(\"v:%v %v - %v\\n\",v,i,j)\n\t\t\t\t\tif val[0][i*2] == val[1][j*2] && val[0][i*2+1] == val[1][j*2+1] {\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (usr1[i] == 0 || usr1[i] == v) && (usr2[j] == 0 || usr2[j] == v) {\n\t\t\t\t\t\t\tusr1[i] = v\n\t\t\t\t\t\t\tusr2[j] = v\n\t\t\t\t\t\t\tret = v\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m = ReadInt32(), ReadInt32()\n\n\tfor i := 0; i < n; i++ {\n\t\tval[0][i*2] = ReadInt32()\n\t\tval[0][i*2+1] = ReadInt32()\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tval[1][i*2] = ReadInt32()\n\t\tval[1][i*2+1] = ReadInt32()\n\t}\n\n\t// 1 zu pei 1 -> res\n\tans := -1\n\tfor i := 1; i < 10; i++ {\n\t\tret := guess(i)\n\t\tif ret == -1 {\n\t\t\tfmt.Printf(\"-1\\n\")\n\t\t\treturn\n\t\t}\n if ret == 0 {\n continue\n }\n\t\tif ans == -1 {\n\t\t\tans = ret\n\t\t} else {\n\t\t\tans = 0\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", ans)\n\n\t// quan pei 1 -> 0\n\n\t// else -1\n\n}\n\nfunc Demo() {\n\tvar n, m int64 = ReadInt64(), ReadInt64()\n\tPrintInt64s(n, m)\n\twriter.WriteByte('\\n')\n\tslice := []int64{1, 2, 3, 4, 5}\n\tPrintInt64s(slice...)\n\n\t// sortDemo\n\t//slice := []int64{5, 3, 4, 2, 1}\n\tsort.Sort(Int64Slice(slice))\n\n\t//s := strconv.FormatBool(true)\n\t//s := strconv.FormatFloat(3.1415, 'E', -1, 64)\n\t//s := strconv.FormatInt(-42, 16)\n\t//s := strconv.FormatUint(42, 16)\n\n}\n\nfunc Min(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc ReadInt64() int64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn ans\n}\n\nfunc ReadFloat64() float64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn ans\n}\n\nfunc PrintInt64s(ints ...int64) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(int(value)))\n\t\twriter.WriteByte(' ')\n\t}\n}\n", "lang": "Go", "bug_code_uid": "77cdc40f776baa3f2e9e39ca2f259d6d", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "3ffacfb79073f1c12430919ab82e365d", "difficulty": 1900, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9767441860465116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\ts := \"\"\n\tfmt.Scan(&s)\n\tn := strings.Count(s, \"-\")\n\tb := strings.Count(s, \"o\")\n\tif n%b == 0 {\n\t\tfmt.Printf(\"YES\\n\")\n\t} else {\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "57761a30cc1a78c1844b1bcba9e37285", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "3b12e279220536710c0585eb3cede4ea", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8845208845208845, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"strings\"\n\t\"fmt\"\n)\n\nvar YES = \"YES\"\nvar NO = \"NO\"\n\nvar bead = \"o\"\nvar thread = \"-\"\n\nfunc Resolve(input string) string {\n\tvar beadCount = strings.Count(input, bead)\n\tvar threadCount = strings.Count(input, thread)\n\n\tif threadCount%beadCount == 0 {\n\t\treturn YES\n\t}\n\n\treturn NO\n}\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tfmt.Println(Resolve(input))\n}\n", "lang": "Go", "bug_code_uid": "b65bea7542598167f065684fc6fe11b7", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "f68a588ef166b0b22004e8ab939f8af3", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9773635153129161, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar line string\n\tvar businki, nitki int64\n\treader := bufio.NewReader(os.Stdin)\n\tline, _ = reader.ReadString('\\n')\n\tfor _, v := range line {\n\t\tif v == 'o' {\n\t\t\tbusinki++\n\t\t} else if v == '-' {\n\t\t\tnitki++\n\t\t}\n\t}\n\tif nitki == 0 || nitki%businki == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "ae875e6333408cb4fca14853b15fccbd", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "89964afb989f8639dd35c79263793a4b", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9720998531571219, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar line string\n\tfmt.Scan(&line)\n\n\telems := []rune(line)\n\n\tcountFibres, countBeads := 0, 0\n\tfor i := 0; i < len(elems); i++ {\n\t\tif elems[i] == '-' {\n\t\t\tcountFibres++\n\t\t} else {\n\t\t\tcountBeads++\n\t\t}\n\t}\n\n\tif countFibres % countBeads == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "9fab3040f0652a6c1ffb862d58b63b37", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "15e2d5209b9d76d59b2d30dc287a4303", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7452054794520548, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, ans int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tans += a\n\t\ta = a/b + a%b\n\t\tif a < b {\n\t\t\tans += a\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Print(ans)\n}\n", "lang": "Go", "bug_code_uid": "f25b12acfbe557ecd598dbfb735b637e", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "e0fa97948e9d87bb65d58e72b3b29cb6", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9941520467836257, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, t int\n\tfmt.Scanln(&n, &t)\n\n\tcnt := n\n\n\tfor n/t > 0 {\n\t\tcnt += n / t\n\t\tn = (n / t) + (n % 2)\n\t}\n\n\tfmt.Println(cnt)\n}\n", "lang": "Go", "bug_code_uid": "80ded1aa4e28ed9b40d8bede100d6688", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "fe2057ad79ef4bf3061062560ad7106a", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\n\tvar hours int = 0\n\tvar rest = 0\n\tfor candles := a; candles > 0; {\n\t\trest += candles % b\n\t\thours += candles\n\t\tif rest/b > 0 {\n\t\t\tcandles += 1\n\t\t\trest %= b\n\t\t}\n\t\tcandles /= b\n\t}\n\n\tfmt.Printf(\"%d\\n\", hours)\n}\n", "lang": "Go", "bug_code_uid": "c2e5d9f4dcbd17c8cf3af1c96e78e2fd", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "9eb20bde531db7d12b9142f5b43b4ed8", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.994540109197816, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc fastGetInt(b []byte) int {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\n//========== Implement Algorithm =======================\nfunc solution(a int, b int) int {\n\ttemp := a\n\tfor a > 0 {\n\t\ttemp += a / b\n\t\ta = a / b\n\n\t}\n\treturn temp\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar a, b, ret int\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\ta = fastGetInt(scanner.Bytes())\n\tscanner.Scan()\n\tb = fastGetInt(scanner.Bytes())\n\t//======================================================\n\tret = solution(a, b)\n\t//==================== OUTPUT ==========================\n\tfmt.Print(ret)\n}\n", "lang": "Go", "bug_code_uid": "4d6eaf623bf689d0280e8b834653435f", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "a85933198521feaa6c3ddc3ede23eabb", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9975278121137207, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// http://acm.timus.ru/problem.aspx?space=1&num=1741\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nvar\n\tdays = [...]string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\nfunc main () {\n\tvar (\n\t\ts1, s2 string\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &s1)\n\tfmt.Fscanln(input, &s2)\n\n\tp1, p2 := 0, 0\n\tfor i := 0; i < len(days); i++ {\n\t\tif days[i] == s1 {\n\t\t\tp1 = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0; i < len(days); i++ {\n\t\tif days[i] == s2 {\n\t\t\tp2 = i + 7\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Solve\n\tdiff := (p2 - p1)\n\tif 31 % 7 == diff || 28 % 7 == diff || 30 % 7 == diff {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n}", "lang": "Go", "bug_code_uid": "7363dd41a70cee4326cdf1fb71610203", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "657391c5d673f113032d083df1bc7513", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9992343032159265, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc (sc *scanner) next() string {\n\tsc.sc.Scan()\n\treturn sc.sc.Text()\n}\n\nfunc (sc *scanner) nextInt() int {\n\ti, err := strconv.Atoi(sc.next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc newScanner(r io.Reader, split bufio.SplitFunc) *scanner {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(split)\n\treturn &scanner{\n\t\tsc: sc,\n\t}\n}\n\nvar wsc = newScanner(os.Stdin, bufio.ScanWords)\nvar lsc = newScanner(os.Stdin, bufio.ScanLines)\n\nfunc next() string {\n\treturn wsc.next()\n}\n\nfunc nextInt() int {\n\treturn wsc.nextInt()\n}\n\nfunc nextLine() string {\n\treturn lsc.next()\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}\nfunc joinInts(a []int, sep string) string {\n\tb := make([]string, len(a))\n\tfor i, v := range a {\n\t\tb[i] = strconv.Itoa(v)\n\t}\n\treturn strings.Join(b, sep)\n}\n\nvar weekdays = map[string]int{\n\t\"sunday\": 1,\n\t\"monday\": 2,\n\t\"tuesday\": 3,\n\t\"wednesday\": 4,\n\t\"thursday\": 5,\n\t\"friday\": 6,\n\t\"saturday\": 7,\n}\n\nfunc main() {\n\td1, d2 := weekdays[next()], weekdays[next()]\n\tif d1-d2 == 4 || d2-d1 == 3 || d1-d2 == 3 || d2-d1 == 2 || d1 == d2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "8480e80eb2caa4f032239b45f3080309", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "4402567a3fe3cf39188bfd469f39e417", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.996288548485053, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"sort\"\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc find_last_le_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] <= target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\treturn s - 1\n}\n\n\nfunc find_first_ge_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] < target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\n\treturn s\n}\n\nfunc maxSumSubmatrix(a [][]int, target int) int {\n\trow := len(a)\n\tif row == 0{\n\t\treturn 0\n\t}\n\tcol := len(a[0])\n\n\tpre_sum := make([][]int, row)\n\tfor i := range pre_sum{\n\t\tpre_sum[i] = make([]int ,col)\n\t}\n\n\tfor i := 0;i < row; i ++{\n\t\tfor j :=0;j < col; j ++{\n\t\t\tif j == 0 {\n\t\t\t\tpre_sum[i][j] = a[i][j]\n\t\t\t}else {\n\t\t\t\tpre_sum[i][j] = pre_sum[i][j-1] + a[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tnear := -100000000\n\tfor i := 0; i < col ; i ++{\n\t\tfor j :=i ;j near) {\n\t\t\t\t//\t\tnear = cur\n\t\t\t\t//\t}\n\t\t\t\t//\ttmp = append(tmp, cur)\n\t\t\t\t//}\n\t\t\t}\n\n\t\t}\n\t}\n\treturn near\n}\n\nfunc q(matrix [][]int, k int) int {\n\trow := len(matrix)\n\tcol := len(matrix[0])\n\tnear := -1000000\n\tfor left := 0; left < col ; left ++{\n\t// 以left为左边界,每行的总和\n\t\t_sum :=make([]int, row)\n\t//for right in range(left, col):\n\t\tfor right :=left ;right 1 {\n\t\t\tif idx - left +1 < min_l{\n\t\t\t\tmin_l = idx - left + 1\n\t\t\t\tm_l = left\n\t\t\t\tm_r = idx\n\t\t\t}\n\t\t\tcounter[record[left]] --\n\n\t\t\t//}else {\n\t\t\t//\n\t\t\t//}\n\t\t\tif counter[record[left]] == 0 {\n\t\t\t\ttarget --\n\t\t\t}\n\t\t\tleft ++\n\t\t}else{\n\t\t\t\tidx ++\n\t\t\tcounter[record[idx]] ++\n\t\t\tif counter[record[idx]] == 1{\n\t\t\t\ttarget ++\n\t\t\t}\n\t\t\t//idx++\n\t\t}\n\t}\n\tfmt.Println(m_l + 1, m_r + 1)\n}\n\nfunc ini(){\n\tvar n int\n\t//var k int\n\tfmt.Scan(&n)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < n; i ++{\n\t\tfmt.Scan(&ori[i])\n\t\tfmt.Scan(&energy[i])\n\t}\n\tR := -1\n\tL := 0\n\tfor i :=0; i < n; i ++{\n\t\t//if record[L] == i - k{\n\t\t//\tL ++\n\t\t//}\n\t\tfor ;R >= L &&ori[i] >ori[record[R]];R--{\n\t\t\tcounter[i]\t+= energy[record[R]]\n\t\t}\n\t\ttmp := energy[i]\n\t\tfor ;R >= L &&ori[i] ==ori[record[R]];R--{\n\t\t\ttmp += energy[i]\n\t\t}\n\t\tR ++\n\t\trecord[R] = i\n\t\tif R != 0 {\n\t\t\tcounter[record[R - 1]] += tmp\n\t\t}\n\t}\n\tm := -1\n\tfor i :=0; i m{\n\t\t\tm = counter[i]\n\t\t}\n\t}\n\tfmt.Println(m)\n}\ntype S struct {\n\tIdx int\n\tTime int\n\n}\ntype intSlice []S\n\nfunc (p intSlice) Len() int { return len(p) }\nfunc (p intSlice) Less(i, j int) bool { return p[i].Time > p[j].Time }\nfunc (p intSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nvar roww [1000]int\nvar coll [1000]int\nfunc inii(){\n\tvar m,n,k,l,d int\n\t//var k int\n\trow := make(intSlice, 10000)\n\tcol := make(intSlice, 10000)\n\tfmt.Scan(&m, &n, &k, &l,&d)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < d; i ++{\n\t\tvar x1,y1,x2,y2 int\n\t\tfmt.Scan(&x1,&y1,&x2,&y2)\n\t\tif x1 == x2 {\n\t\t\tif y1 > y2 {\n\t\t\t\ty1,y2 = y2,y1\n\t\t\t}\n\t\t\tcol[y1].Idx = y1\n\t\t\tcol[y1].Time ++\n\t\t}else{\n\t\t\t\tif x1 > x2{\n\t\t\t\t\tx1,x2 = x2,x1\n\t\t\t\t}\n\t\t\t\trow[x1].Idx = x1\n\t\t\trow[x1].Time ++\n\t\t}\n\t\t//fmt.Scan(&energy[i])\n\t}\n\t//row = row[:m+1]\n\t//col = col[:n + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\trow = row[:k+1]\n\tcol = col[:l + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\tfor i := 0;i < k-1;i ++ {\n\t\tfmt.Print(row[i].Idx,\" \")\n\t}\n\tfmt.Print(row[k -1 ].Idx,\"\\n\")\n\tfor i := 0;i < l-1;i ++ {\n\t\tfmt.Print(col[i].Idx,\" \")\n\t}\n\tfmt.Print(col[l -1 ].Idx,\"\\n\")\n\n}\n\n\nfunc next_per(){\n\tvar n int\n\tvar m int\n\tfmt.Scan(&n,&m)\n\ta :=make([]int, n)\n\tfor i:=0;i 0;m--{\n\t\ti := 0\n\t\tfor i = n-2;i >=0;i --{\n\t\t\tif a[i] < a[i + 1]{\n\t\t\t\tbreak\n\t\t\t}\n\n\n\t\t}\n\t\t//t := a[i+1]\n\t\tj := 0\n\t\tfor j = i + 1;j < n;j ++{\n\t\t\tif a[j] <= a[i]{\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ta[i],a[j-1] = a[j-1],a[i]\n\t\tsort.Ints(a[i + 1:])\n\n\t}\n\tfmt.Println(a)\n\n\n}\nvar s string\nvar n,ans,length,carry float64\n//var ans int\n//var length int\n//var carry int\n//func max(x,y int)int{\n//\tif x > y{\n//\t\treturn x\n//\t}\n//\treturn y\n//}\nfunc maxf(x, y float64)float64{\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc get(k int)int{\n\tvar x float64\n\tvar t float64 = 1\n\ti := k\n\tfor ;i >= 0; i -- {\n\t\tif x + maxf(float64(1), (float64)(s[i]-'0')) * float64(t) >=n{\n\t\t\tbreak\n\t\t}\n\t\tx += float64(s[i]-'0') * t\n\t\tt *= 10\n\t}\n\tfor ;s[i+ 1] == '0'&& i < k-1;i ++{\n\n\t}\n\tans += x * carry\n\treturn i\n}\nfunc qq(){\n\n\tcarry = 1\n\tfmt.Scan(&n, &s)\n\ti := len(s) - 1\n\tfor ;i >=0;{\n\t\ti = get(i)\n\t\tcarry *=n\n\t}\n\tfmt.Println(ans)\n\n}\n\nfunc main(){\n\t//a := [][]int{{28,4,-19,18,-7,-10,27,19,1,16,0,10,-17,11,11,27,-1,10,12,-1},\n\t//\t{-2,-19,17,4,25,-20,4,3,4,28,-10,7,16,-14,-3,-19,6,17,-4,-7},\n\t//\t{2,8,18,-17,-2,10,-6,-5,11,10,22,-6,19,-16,6,-4,18,5,22,-17},\n\t//\t{-14,-7,-20,13,-19,-20,-15,21,-11,-10,-8,-9,10,13,6,-10,15,9,-15,-2},\n\t//\t{-18,26,12,8,2,16,-17,12,0,-5,9,-3,-12,-11,3,-6,-18,16,-7,-14},\n\t//\t{5,29,25,22,11,-3,-2,-15,4,13,-17,-2,0,-2,20,10,-18,6,25,-20},\n\t//\t{5,-7,8,5,15,22,8,-5,22,-18,-5,-14,23,2,-8,12,-16,-18,12,-12},\n\t//\t{27,18,4,11,-3,12,-4,-8,-3,25,-9,24,-14,5,11,-9,-17,0,25,-15},\n\t//\t{26,-7,18,4,4,18,-17,9,-19,-9,-19,-8,-4,-13,10,-11,6,-16,-12,12},\n\t//\t{28,22,7,11,-6,13,8,22,7,-14,17,14,10,29,16,9,-3,18,-9,10},\n\t//\t{27,19,-10,-9,1,3,14,1,7,3,-3,16,-2,9,14,-7,-19,-5,23,19},\n\t//\t{-17,7,-20,8,-5,-6,-2,25,29,16,23,4,4,27,16,17,9,20,-6,22},\n\t//\t{2,9,-13,1,-18,25,4,7,25,26,-4,8,-19,18,6,-7,-5,7,21,-8},\n\t//\t{-2,11,1,29,6,-16,-8,3,7,11,10,-2,-1,-20,20,4,19,5,29,-7},\n\t//\t{29,-12,-3,17,6,19,23,12,-19,13,19,5,27,22,-17,27,10,-12,12,23},\n\t//\t{24,16,4,25,15,13,24,-19,1,-7,-19,13,-13,14,13,26,9,18,-9,-18},\n\t//\t{-17,4,-18,-18,-19,3,-13,12,23,-17,-10,-20,14,2,18,21,-12,27,-3,4},\n\t//\t{27,13,12,14,16,-9,-2,-15,-20,8,-2,24,18,15,26,21,27,17,-15,-3},\n\t//\t{25,-8,17,-10,-16,13,26,-11,-15,6,-5,-13,23,2,24,-4,5,8,-15,-1},\n\t//\t{15,-12,18,5,-3,7,5,11,-4,-13,28,20,0,-4,-13,-5,-13,-8,-16,3}}\n\n\t//log.Println(find_last_le_idx(a, 3))\n\t//log.Println(q(a, -123))\n\n\t//aa := []int{2,3,1,3,4,6,1,2}\n\t//mm(aa, 1)\n\t//ini()\n//inii()\n\t//next_per()\n\tqq()\n}\n", "lang": "Go", "bug_code_uid": "7ffbdaa3ef9cb9997a18e986119c59bb", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "af3d67f0ebdeb06fe54ec8bd6dcce9d6", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8880666049953746, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else if a > b && a%2 != 0 && a%3 != 0 && a%5 != 0 {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n", "lang": "Go", "bug_code_uid": "b1b0070987d3c2b61ec4d56938d77070", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "bbfc2f3db11402ee5a37c7469886adb7", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.2977346278317152, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "// 318A-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar m, pos int\n\tcou := 0\n\tk := 1\n\tfmt.Scan(&m, &pos)\n\ta := make([]int, m)\n\tfor i := 0; i < m; {\n\t\tif k%2 != 0 {\n\t\t\ta[i] = k\n\t\t\ti++\n\t\t\tcou++\n\t\t}\n\t\tif k < m {\n\t\t\tk++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tk = 1\n\tfor i := cou; i < m; {\n\t\tif k%2 == 0 {\n\t\t\ta[i] = k\n\t\t\ti++\n\t\t\tcou++\n\t\t}\n\t\tif k < m {\n\t\t\tk++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(a[pos-1])\n}\n", "lang": "Go", "bug_code_uid": "5538dbb12f39e7e6c633ecc628220874", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "579ad9c7bf929fea9c0642072d1ad09c", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.534629404617254, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\t\n\t\"bufio\"\n\t\"os\"\n)\n\nvar in *bufio.Reader = bufio.NewReader(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\n\nfunc main() {\n\tvar n,k int\n \tvar idx int = 0\n\n\tfmt.Fscan(in,&n)\n\tfmt.Fscan(in,&k)\n\n\tarr := make([]int, n)\n\n\tfor i := 1; i <= n; i++ {\n\t\tif i % 2 != 0 {\n\t\t\tarr[idx] = i\n\t\t\tidx++\t\t\n\t\t}\n\t}\n\n\tfor i := 1; i <= n; i++ {\n\t\tif i % 2 == 0 {\n\t\t\tarr[idx] = i\n\t\t\tidx++\t\t\n\t\t}\n\t}\n\n\tfmt.Println(arr[k-1])\n}", "lang": "Go", "bug_code_uid": "ec73d1ecc356ca4eded96a70f1fb0c16", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "979c46d4fbccf16add71572f4d479b34", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4817150063051702, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "package main\n\nimport (\n\t//\"bufio\"\n\t\"fmt\"\n//\t\"log\"\n\t\"os\"\n)\n\n\n\nfunc solveFromFile() int {\n\t/*var nu int\n\tfile, err := os.Open(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t}\n\tscanner := bufio.NewScanner(file)\n\tscanner.Scan()\n\tnu = fastGetInt(scanner.Bytes())\n\n\tdefer file.Close()*/\n \n\treturn -1//solution(nu)\n}\n\n//========== Implement Algorithm =======================\nfunc solution(num1 int, num2 int) int {\n\tretval := 0\n\tif num2 <= num1/2+num1%2 {\n\t\tretval = num2*2 - 1\n\t} else {\n\t\tretval = num1- num1%num2*2-1\n\t}\n\treturn retval\n}\n\nfunc main() {\n\n\t//================== Variables used ====================\n\tvar num1, num2, ret int\n\t//======================================================\n\n\tif len(os.Args) >= 2 {\n\t\t//============== Get return value from File ============\n\t\tret = solveFromFile()\n\n\t} else {\n\t\t//============== Get return value from STDIN ===========\n\t\t//scanner := bufio.NewScanner(os.Stdin)\n\t\tfmt.Scan(&num1)\n\t\tfmt.Scan(&num2)\n\t\t//scanner.Scan()\n\t\t//num = fastGetInt(scanner.Bytes())\n\t\tret = solution(num1, num2)\n\t}\n\n\t//================== OUTPUT ============================\n\tfmt.Println(ret)\n}\n", "lang": "Go", "bug_code_uid": "01dee5151a25868286e0daafcd4b641a", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "3fd2fff6c41f6b59a7040e0db4c190db", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.27111111111111114, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, n int\n\tx := 1\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\tfor i := 1; i != k; i++ {\n\t\tx += 2\n\t\tif x > n {\n\t\t\tx = 2\n\t\t}\n\t}\n\n\tfmt.Println(x)\n}\n", "lang": "Go", "bug_code_uid": "1bd421ac1a249dbc6fa170ccdb5d87d3", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "142102c5bd25df5a44ba7bb8f85ebef1", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9929824561403509, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n n, m, a, b := getI(), getI(), getI(), getI()\n a--\n b--\n p, q := a%m, b%m\n result := 3\n if a/m == b/m || (p == 0 && (q == m-1 || b == n-1)) {\n result = 1\n } else if a/m + 1 == b/m || p == 0 || q == m-1 || b == n-1 {\n result = 2\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang": "Go", "bug_code_uid": "0e7a37e033db843b1da5660e266ac571", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "75d309fdc4fd5ecc08500d5e194dc84e", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9856262833675564, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, m int\n\tfmt.Scan(&a, &m)\n\tvar v [10010]bool\n\tfor {\n\t\tif v[a] {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tif a%m == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\tv[a] = true\n\t\ta = (a + a%m) % m\n\t}\n}\n", "lang": "Go", "bug_code_uid": "200e0fcb1b9dcee496597e5aa078371a", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "99aa149731d3a9b96d47086b771fa019", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.997946611909651, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, m int\n\tfmt.Scan(&a, &m)\n\tvar v [10010]bool\n\tfor {\n\t\tif v[a] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif a%m == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t\tv[a] = true\n\t\ta = (a + a%m) % m\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a7e6a40b0f723110199f3da5ccf34620", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "99aa149731d3a9b96d47086b771fa019", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9969135802469136, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//package main\nimport \"fmt\"\nfunc main(){\n a,m:= 0,1\n ma:=make(map[int]int)\n fmt.Scan(&a,&m)\n for true{\n _,ok:=ma[a];\n if ok{\n break\n }\n ma[a]=1;\n a*=2\n a%=m;\n }\n if _,ok:=ma[0];ok{\n fmt.Println(\"Yes\")\n } else{\n fmt.Println(\"No\")\n }\n}\n", "lang": "Go", "bug_code_uid": "f36e43811284f098be2aac4db35c37bf", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "4463de6ba8808693dad05645ad1416b2", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.933579335793358, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// 75A-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc rem(x int64) int64 {\n var rr, r int64\n for x > int64(0) {\n if x%10 != 0 {\n rr *= 10\n rr += x % 10\n }\n x /= 10\n }\n\n r = 0\n for rr > int64(0) {\n r *= 10\n r += rr % 10\n rr /= 10\n }\n return r\n}\n\nfunc main() {\n var a, b,c int64\n fmt.Scan(&a, &b)\n c = a + b\n fmt.Println(rem(c))\n fmt.Println(rem(a))\n fmt.Println(rem(b))\n if rem(c) == rem(a)+rem(b) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n\n}\n", "lang": "Go", "bug_code_uid": "54b3a8871ca124530fce71e50bb2f084", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "fd494ae169cdb5088d60cd9aa31922ed", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9986559139784946, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF87C(in io.Reader, out io.Writer) {\n\tn := 0\n\tFscan(in, &n)\n\n\ttype pair struct{ a0, len int }\n\tconst mx = 1e5\n\tps := [mx + 1][]pair{}\n\tfor l := 2; l*(l+1)/2 <= mx; l++ {\n\t\tfor a0 := 1; ; a0++ {\n\t\t\ts := (2*a0 + l - 1) * l / 2\n\t\t\tif s > mx {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tps[s] = append(ps[s], pair{a0, l})\n\t\t}\n\t}\n\tsgs := [mx + 1]int{}\n\tfor i := 3; i <= n; i++ {\n\t\tmex := map[int]bool{}\n\t\tfor _, p := range ps[i] {\n\t\t\ts := sgs[p.a0] ^ sgs[p.a0+p.len]\n\t\t\tif i == n && s == 0 {\n\t\t\t\tFprint(out, p.len)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tmex[s] = true\n\t\t}\n\t\tsg := 0\n\t\tfor ; mex[sg]; sg++ {\n\t\t}\n\t\tsgs[i+1] = sgs[i] ^ sg\n\t}\n\tFprint(out, -1)\n}\n\nfunc main() { CF87C(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "6d0545eeed607cc2593af402e868aa3e", "src_uid": "63262317ba572d78163c91b853c05506", "apr_id": "f92f668b93fa949d58b80a08f1e16689", "difficulty": 2000, "tags": ["math", "dp", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9500554938956715, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar r1, r2 int\n\tvar c1, c2 int\n\tvar d1, d2 int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tr1, _= strconv.Atoi(r.Text())\n\tr.Scan()\n\tr2, _= strconv.Atoi(r.Text())\n\tr.Scan()\n\tc1, _= strconv.Atoi(r.Text())\n\tr.Scan()\n\tc2, _= strconv.Atoi(r.Text())\n\tr.Scan()\n\td1, _= strconv.Atoi(r.Text())\n\tr.Scan()\n\td2, _= strconv.Atoi(r.Text())\n\t\n\tvar a, b, c, d int\n\ta = (r1+c1-d2)/2\n\td = d1-a\n\tb = c2-d\n\tc = r2-d\n\t\n\tif a < 1 || b < 1 || c < 1 || d < 1 || a > 9 || b > 9 || c > 9 || d > 9 || a == b || a == c || a == d || b == c || b == d || c == d {\n\t\tw.WriteString(\"-1\\n\")\n\t\tw.Flush()\n\t} else {\n\t\tw.WriteString(strconv.Itoa(a)+\" \"+strconv.Itoa(b)+\"\\n\")\n\t\tw.Flush()\n\t\tw.WriteString(strconv.Itoa(c)+\" \"+strconv.Itoa(d)+\"\\n\")\n\t\tw.Flush()\n\t}\n}\n", "lang": "Go", "bug_code_uid": "808f712ef7b3f8910f5c7575c8669dff", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "b2e1687e90a6aa6c32f004fa7d5ec8af", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.004705882352941176, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar m map[string]string = map[string]string{\"374655\":\"1234\",\"384765\":\"1235\",\"394875\":\"1236\",\"3104985\":\"1237\",\"31141095\":\"1238\",\"312411105\":\"1239\",\"375546\":\"1243\",\"395766\":\"1245\",\"3105876\":\"1246\",\"3115986\":\"1247\",\"31251096\":\"1248\",\"313511106\":\"1249\",\"386547\":\"1253\",\"396657\":\"1254\",\"3116877\":\"1256\",\"3126987\":\"1257\",\"31361097\":\"1258\",\"314611107\":\"1259\",\"397548\":\"1263\",\"3107658\":\"1264\",\"3117768\":\"1265\",\"3137988\":\"1267\",\"31471098\":\"1268\",\"315711108\":\"1269\",\"3108549\":\"1273\",\"3118659\":\"1274\",\"3128769\":\"1275\",\"3138879\":\"1276\",\"31581099\":\"1278\",\"316811109\":\"1279\",\"31195410\":\"1283\",\"31296510\":\"1284\",\"31397610\":\"1285\",\"31498710\":\"1286\",\"31599810\":\"1287\",\"3179111010\":\"1289\",\"312105411\":\"1293\",\"313106511\":\"1294\",\"314107611\":\"1295\",\"315108711\":\"1296\",\"316109811\":\"1297\",\"3171010911\":\"1298\",\"463755\":\"1324\",\"473865\":\"1325\",\"483975\":\"1326\",\"4931085\":\"1327\",\"41031195\":\"1328\",\"411312105\":\"1329\",\"465537\":\"1342\",\"495867\":\"1345\",\"4105977\":\"1346\",\"41151087\":\"1347\",\"41251197\":\"1348\",\"413512107\":\"1349\",\"476538\":\"1352\",\"496758\":\"1354\",\"4116978\":\"1356\",\"41261088\":\"1357\",\"41361198\":\"1358\",\"414612108\":\"1359\",\"487539\":\"1362\",\"4107759\":\"1364\",\"4117869\":\"1365\",\"41371089\":\"1367\",\"41471199\":\"1368\",\"415712109\":\"1369\",\"4985310\":\"1372\",\"41187510\":\"1374\",\"41288610\":\"1375\",\"41389710\":\"1376\",\"415811910\":\"1378\",\"4168121010\":\"1379\",\"41095311\":\"1382\",\"41297511\":\"1384\",\"41398611\":\"1385\",\"41499711\":\"1386\",\"415910811\":\"1387\",\"4179121011\":\"1389\",\"411105312\":\"1392\",\"413107512\":\"1394\",\"414108612\":\"1395\",\"415109712\":\"1396\",\"4161010812\":\"1397\",\"4171011912\":\"1398\",\"553746\":\"1423\",\"573966\":\"1425\",\"5831076\":\"1426\",\"5931186\":\"1427\",\"51031296\":\"1428\",\"511313106\":\"1429\",\"554637\":\"1432\",\"584967\":\"1435\",\"5941077\":\"1436\",\"51041187\":\"1437\",\"51141297\":\"1438\",\"512413107\":\"1439\",\"576639\":\"1452\",\"586749\":\"1453\",\"51161079\":\"1456\",\"51261189\":\"1457\",\"51361299\":\"1458\",\"514613109\":\"1459\",\"5876310\":\"1462\",\"5977410\":\"1463\",\"51179610\":\"1465\",\"513711810\":\"1467\",\"514712910\":\"1468\",\"5157131010\":\"1469\",\"5986311\":\"1472\",\"51087411\":\"1473\",\"51289611\":\"1475\",\"513810711\":\"1476\",\"515812911\":\"1478\",\"5168131011\":\"1479\",\"51096312\":\"1482\",\"51197412\":\"1483\",\"51399612\":\"1485\",\"514910712\":\"1486\",\"515911812\":\"1487\",\"5179131012\":\"1489\",\"511106313\":\"1492\",\"512107413\":\"1493\",\"514109613\":\"1495\",\"5151010713\":\"1496\",\"5161011813\":\"1497\",\"5171012913\":\"1498\",\"653847\":\"1523\",\"663957\":\"1524\",\"6831177\":\"1526\",\"6931287\":\"1527\",\"61031397\":\"1528\",\"611314107\":\"1529\",\"654738\":\"1532\",\"674958\":\"1534\",\"6941178\":\"1536\",\"61041288\":\"1537\",\"61141398\":\"1538\",\"612414108\":\"1539\",\"665739\":\"1542\",\"675849\":\"1543\",\"61051179\":\"1546\",\"61151289\":\"1547\",\"61251399\":\"1548\",\"613514109\":\"1549\",\"6877311\":\"1562\",\"6978411\":\"1563\",\"61079511\":\"1564\",\"613712811\":\"1567\",\"614713911\":\"1568\",\"6157141011\":\"1569\",\"6987312\":\"1572\",\"61088412\":\"1573\",\"61189512\":\"1574\",\"613811712\":\"1576\",\"615813912\":\"1578\",\"6168141012\":\"1579\",\"61097313\":\"1582\",\"61198413\":\"1583\",\"61299513\":\"1584\",\"614911713\":\"1586\",\"615912813\":\"1587\",\"6179141013\":\"1589\",\"611107314\":\"1592\",\"612108414\":\"1593\",\"613109514\":\"1594\",\"6151011714\":\"1596\",\"6161012814\":\"1597\",\"6171013914\":\"1598\",\"753948\":\"1623\",\"7631058\":\"1624\",\"7731168\":\"1625\",\"7931388\":\"1627\",\"71031498\":\"1628\",\"711315108\":\"1629\",\"754839\":\"1632\",\"7741059\":\"1634\",\"7841169\":\"1635\",\"71041389\":\"1637\",\"71141499\":\"1638\",\"712415109\":\"1639\",\"7658310\":\"1642\",\"7759410\":\"1643\",\"79511610\":\"1645\",\"711513810\":\"1647\",\"712514910\":\"1648\",\"7135151010\":\"1649\",\"7768311\":\"1652\",\"7869411\":\"1653\",\"79610511\":\"1654\",\"712613811\":\"1657\",\"713614911\":\"1658\",\"7146151011\":\"1659\",\"7988313\":\"1672\",\"71089413\":\"1673\",\"711810513\":\"1674\",\"712811613\":\"1675\",\"715814913\":\"1678\",\"7168151013\":\"1679\",\"71098314\":\"1682\",\"71199414\":\"1683\",\"712910514\":\"1684\",\"713911614\":\"1685\",\"715913814\":\"1687\",\"7179151014\":\"1689\",\"711108315\":\"1692\",\"712109415\":\"1693\",\"7131010515\":\"1694\",\"7141011615\":\"1695\",\"7161013815\":\"1697\",\"7171014915\":\"1698\",\"8531049\":\"1723\",\"8631159\":\"1724\",\"8731269\":\"1725\",\"8831379\":\"1726\",\"81031599\":\"1728\",\"811316109\":\"1729\",\"8549310\":\"1732\",\"87411510\":\"1734\",\"88412610\":\"1735\",\"89413710\":\"1736\",\"811415910\":\"1738\",\"8124161010\":\"1739\",\"8659311\":\"1742\",\"87510411\":\"1743\",\"89512611\":\"1745\",\"810513711\":\"1746\",\"812515911\":\"1748\",\"8135161011\":\"1749\",\"8769312\":\"1752\",\"88610412\":\"1753\",\"89611512\":\"1754\",\"811613712\":\"1756\",\"813615912\":\"1758\",\"8146161012\":\"1759\",\"8879313\":\"1762\",\"89710413\":\"1763\",\"810711513\":\"1764\",\"811712613\":\"1765\",\"814715913\":\"1768\",\"8157161013\":\"1769\",\"81099315\":\"1782\",\"811910415\":\"1783\",\"812911515\":\"1784\",\"813912615\":\"1785\",\"814913715\":\"1786\",\"8179161015\":\"1789\",\"811109316\":\"1792\",\"8121010416\":\"1793\",\"8131011516\":\"1794\",\"8141012616\":\"1795\",\"8151013716\":\"1796\",\"8171015916\":\"1798\",\"95311410\":\"1823\",\"96312510\":\"1824\",\"97313610\":\"1825\",\"98314710\":\"1826\",\"99315810\":\"1827\",\"9113171010\":\"1829\",\"95410311\":\"1832\",\"97412511\":\"1834\",\"98413611\":\"1835\",\"99414711\":\"1836\",\"910415811\":\"1837\",\"9124171011\":\"1839\",\"96510312\":\"1842\",\"97511412\":\"1843\",\"99513612\":\"1845\",\"910514712\":\"1846\",\"911515812\":\"1847\",\"9135171012\":\"1849\",\"97610313\":\"1852\",\"98611413\":\"1853\",\"99612513\":\"1854\",\"911614713\":\"1856\",\"912615813\":\"1857\",\"9146171013\":\"1859\",\"98710314\":\"1862\",\"99711414\":\"1863\",\"910712514\":\"1864\",\"911713614\":\"1865\",\"913715814\":\"1867\",\"9157171014\":\"1869\",\"99810315\":\"1872\",\"910811415\":\"1873\",\"911812515\":\"1874\",\"912813615\":\"1875\",\"913814715\":\"1876\",\"9168171015\":\"1879\",\"9111010317\":\"1892\",\"9121011417\":\"1893\",\"9131012517\":\"1894\",\"9141013617\":\"1895\",\"9151014717\":\"1896\",\"9161015817\":\"1897\",\"105312411\":\"1923\",\"106313511\":\"1924\",\"107314611\":\"1925\",\"108315711\":\"1926\",\"109316811\":\"1927\",\"1010317911\":\"1928\",\"105411312\":\"1932\",\"107413512\":\"1934\",\"108414612\":\"1935\",\"109415712\":\"1936\",\"1010416812\":\"1937\",\"1011417912\":\"1938\",\"106511313\":\"1942\",\"107512413\":\"1943\",\"109514613\":\"1945\",\"1010515713\":\"1946\",\"1011516813\":\"1947\",\"1012517913\":\"1948\",\"107611314\":\"1952\",\"108612414\":\"1953\",\"109613514\":\"1954\",\"1011615714\":\"1956\",\"1012616814\":\"1957\",\"1013617914\":\"1958\",\"108711315\":\"1962\",\"109712415\":\"1963\",\"1010713515\":\"1964\",\"1011714615\":\"1965\",\"1013716815\":\"1967\",\"1014717915\":\"1968\",\"109811316\":\"1972\",\"1010812416\":\"1973\",\"1011813516\":\"1974\",\"1012814616\":\"1975\",\"1013815716\":\"1976\",\"1015817916\":\"1978\",\"1010911317\":\"1982\",\"1011912417\":\"1983\",\"1012913517\":\"1984\",\"1013914617\":\"1985\",\"1014915717\":\"1986\",\"1015916817\":\"1987\",\"375564\":\"2134\",\"385674\":\"2135\",\"395784\":\"2136\",\"3105894\":\"2137\",\"31159104\":\"2138\",\"312510114\":\"2139\",\"376455\":\"2143\",\"396675\":\"2145\",\"3106785\":\"2146\",\"3116895\":\"2147\",\"31269105\":\"2148\",\"313610115\":\"2149\",\"387456\":\"2153\",\"397566\":\"2154\",\"3117786\":\"2156\",\"3127896\":\"2157\",\"31379106\":\"2158\",\"314710116\":\"2159\",\"398457\":\"2163\",\"3108567\":\"2164\",\"3118677\":\"2165\",\"3138897\":\"2167\",\"31489107\":\"2168\",\"315810117\":\"2169\",\"3109458\":\"2173\",\"3119568\":\"2174\",\"3129678\":\"2175\",\"3139788\":\"2176\",\"31599108\":\"2178\",\"316910118\":\"2179\",\"31110459\":\"2183\",\"31210569\":\"2184\",\"31310679\":\"2185\",\"31410789\":\"2186\",\"31510899\":\"2187\",\"3171010119\":\"2189\",\"312114510\":\"2193\",\"313115610\":\"2194\",\"314116710\":\"2195\",\"315117810\":\"2196\",\"316118910\":\"2197\",\"3171191010\":\"2198\",\"553764\":\"2314\",\"563874\":\"2315\",\"573984\":\"2316\",\"5831094\":\"2317\",\"59311104\":\"2318\",\"510312114\":\"2319\",\"556437\":\"2341\",\"596877\":\"2345\",\"5106987\":\"2346\",\"51161097\":\"2347\",\"512611107\":\"2348\",\"513612117\":\"2349\",\"567438\":\"2351\",\"597768\":\"2354\",\"5117988\":\"2356\",\"51271098\":\"2357\",\"513711108\":\"2358\",\"514712118\":\"2359\",\"578439\":\"2361\",\"5108769\":\"2364\",\"5118879\":\"2365\",\"51381099\":\"2367\",\"514811109\":\"2368\",\"515812119\":\"2369\",\"5894310\":\"2371\",\"51197610\":\"2374\",\"51298710\":\"2375\",\"51399810\":\"2376\",\"5159111010\":\"2378\",\"5169121110\":\"2379\",\"59104311\":\"2381\",\"512107611\":\"2384\",\"513108711\":\"2385\",\"514109811\":\"2386\",\"5151010911\":\"2387\",\"51710121111\":\"2389\",\"510114312\":\"2391\",\"513117612\":\"2394\",\"514118712\":\"2395\",\"515119812\":\"2396\",\"5161110912\":\"2397\",\"51711111012\":\"2398\",\"643755\":\"2413\",\"663975\":\"2415\",\"6731085\":\"2416\",\"6831195\":\"2417\",\"69312105\":\"2418\",\"610313115\":\"2419\",\"645537\":\"2431\",\"685977\":\"2435\",\"6951087\":\"2436\",\"61051197\":\"2437\",\"611512107\":\"2438\",\"612513117\":\"2439\",\"667539\":\"2451\",\"687759\":\"2453\",\"61171089\":\"2456\",\"61271199\":\"2457\",\"613712109\":\"2458\",\"614713119\":\"2459\",\"6785310\":\"2461\",\"6987510\":\"2463\",\"61189710\":\"2465\",\"613811910\":\"2467\",\"6148121010\":\"2468\",\"6158131110\":\"2469\",\"6895311\":\"2471\",\"61097511\":\"2473\",\"61299711\":\"2475\",\"613910811\":\"2476\",\"6159121011\":\"2478\",\"6169131111\":\"2479\",\"69105312\":\"2481\",\"611107512\":\"2483\",\"613109712\":\"2485\",\"6141010812\":\"2486\",\"6151011912\":\"2487\",\"61710131112\":\"2489\",\"610115313\":\"2491\",\"612117513\":\"2493\",\"614119713\":\"2495\",\"6151110813\":\"2496\",\"6161111913\":\"2497\",\"61711121013\":\"2498\",\"743856\":\"2513\",\"753966\":\"2514\",\"7731186\":\"2516\",\"7831296\":\"2517\",\"79313106\":\"2518\",\"710314116\":\"2519\",\"745638\":\"2531\",\"775968\":\"2534\",\"7951188\":\"2536\",\"71051298\":\"2537\",\"711513108\":\"2538\",\"712514118\":\"2539\",\"756639\":\"2541\",\"776859\":\"2543\",\"71061189\":\"2546\",\"71161299\":\"2547\",\"712613109\":\"2548\",\"713614119\":\"2549\",\"7786311\":\"2561\",\"7988511\":\"2563\",\"71089611\":\"2564\",\"713812911\":\"2567\",\"7148131011\":\"2568\",\"7158141111\":\"2569\",\"7896312\":\"2571\",\"71098512\":\"2573\",\"71199612\":\"2574\",\"713911812\":\"2576\",\"7159131012\":\"2578\",\"7169141112\":\"2579\",\"79106313\":\"2581\",\"711108513\":\"2583\",\"712109613\":\"2584\",\"7141011813\":\"2586\",\"7151012913\":\"2587\",\"71710141113\":\"2589\",\"710116314\":\"2591\",\"712118514\":\"2593\",\"713119614\":\"2594\",\"7151111814\":\"2596\",\"7161112914\":\"2597\",\"71711131014\":\"2598\",\"843957\":\"2613\",\"8531067\":\"2614\",\"8631177\":\"2615\",\"8831397\":\"2617\",\"89314107\":\"2618\",\"810315117\":\"2619\",\"845739\":\"2631\",\"8751069\":\"2634\",\"8851179\":\"2635\",\"81051399\":\"2637\",\"811514109\":\"2638\",\"812515119\":\"2639\",\"8567310\":\"2641\",\"8769510\":\"2643\",\"89611710\":\"2645\",\"811613910\":\"2647\",\"8126141010\":\"2648\",\"8136151110\":\"2649\",\"8677311\":\"2651\",\"8879511\":\"2653\",\"89710611\":\"2654\",\"812713911\":\"2657\",\"8137141011\":\"2658\",\"8147151111\":\"2659\",\"8897313\":\"2671\",\"81099513\":\"2673\",\"811910613\":\"2674\",\"812911713\":\"2675\",\"8159141013\":\"2678\",\"8169151113\":\"2679\",\"89107314\":\"2681\",\"811109514\":\"2683\",\"8121010614\":\"2684\",\"8131011714\":\"2685\",\"8151013914\":\"2687\",\"81710151114\":\"2689\",\"810117315\":\"2691\",\"812119515\":\"2693\",\"8131110615\":\"2694\",\"8141111715\":\"2695\",\"8161113915\":\"2697\",\"81711141015\":\"2698\",\"9431058\":\"2713\",\"9531168\":\"2714\",\"9631278\":\"2715\",\"9731388\":\"2716\",\"99315108\":\"2718\",\"910316118\":\"2719\",\"9458310\":\"2731\",\"97511610\":\"2734\",\"98512710\":\"2735\",\"99513810\":\"2736\",\"9115151010\":\"2738\",\"9125161110\":\"2739\",\"9568311\":\"2741\",\"97610511\":\"2743\",\"99612711\":\"2745\",\"910613811\":\"2746\",\"9126151011\":\"2748\",\"9136161111\":\"2749\",\"9678312\":\"2751\",\"98710512\":\"2753\",\"99711612\":\"2754\",\"911713812\":\"2756\",\"9137151012\":\"2758\",\"9147161112\":\"2759\",\"9788313\":\"2761\",\"99810513\":\"2763\",\"910811613\":\"2764\",\"911812713\":\"2765\",\"9148151013\":\"2768\",\"9158161113\":\"2769\",\"99108315\":\"2781\",\"9111010515\":\"2783\",\"9121011615\":\"2784\",\"9131012715\":\"2785\",\"9141013815\":\"2786\",\"91710161115\":\"2789\",\"910118316\":\"2791\",\"9121110516\":\"2793\",\"9131111616\":\"2794\",\"9141112716\":\"2795\",\"9151113816\":\"2796\",\"91711151016\":\"2798\",\"10431159\":\"2813\",\"10531269\":\"2814\",\"10631379\":\"2815\",\"10731489\":\"2816\",\"10831599\":\"2817\",\"1010317119\":\"2819\",\"10459311\":\"2831\",\"107512611\":\"2834\",\"108513711\":\"2835\",\"109514811\":\"2836\",\"1010515911\":\"2837\",\"10125171111\":\"2839\",\"10569312\":\"2841\",\"107611512\":\"2843\",\"109613712\":\"2845\",\"1010614812\":\"2846\",\"1011615912\":\"2847\",\"10136171112\":\"2849\",\"10679313\":\"2851\",\"108711513\":\"2853\",\"109712613\":\"2854\",\"1011714813\":\"2856\",\"1012715913\":\"2857\",\"10147171113\":\"2859\",\"10789314\":\"2861\",\"109811514\":\"2863\",\"1010812614\":\"2864\",\"1011813714\":\"2865\",\"1013815914\":\"2867\",\"10158171114\":\"2869\",\"10899315\":\"2871\",\"1010911515\":\"2873\",\"1011912615\":\"2874\",\"1012913715\":\"2875\",\"1013914815\":\"2876\",\"10169171115\":\"2879\",\"1010119317\":\"2891\",\"10121111517\":\"2893\",\"10131112617\":\"2894\",\"10141113717\":\"2895\",\"10151114817\":\"2896\",\"10161115917\":\"2897\",\"114312510\":\"2913\",\"115313610\":\"2914\",\"116314710\":\"2915\",\"117315810\":\"2916\",\"118316910\":\"2917\",\"1193171010\":\"2918\",\"114510312\":\"2931\",\"117513612\":\"2934\",\"118514712\":\"2935\",\"119515812\":\"2936\",\"1110516912\":\"2937\",\"11115171012\":\"2938\",\"115610313\":\"2941\",\"117612513\":\"2943\",\"119614713\":\"2945\",\"1110615813\":\"2946\",\"1111616913\":\"2947\",\"11126171013\":\"2948\",\"116710314\":\"2951\",\"118712514\":\"2953\",\"119713614\":\"2954\",\"1111715814\":\"2956\",\"1112716914\":\"2957\",\"11137171014\":\"2958\",\"117810315\":\"2961\",\"119812515\":\"2963\",\"1110813615\":\"2964\",\"1111814715\":\"2965\",\"1113816915\":\"2967\",\"11148171015\":\"2968\",\"118910316\":\"2971\",\"1110912516\":\"2973\",\"1111913616\":\"2974\",\"1112914716\":\"2975\",\"1113915816\":\"2976\",\"11159171016\":\"2978\",\"1191010317\":\"2981\",\"11111012517\":\"2983\",\"11121013617\":\"2984\",\"11131014717\":\"2985\",\"11141015817\":\"2986\",\"11151016917\":\"2987\",\"465573\":\"3124\",\"475683\":\"3125\",\"485793\":\"3126\",\"4958103\":\"3127\",\"41059113\":\"3128\",\"411510123\":\"3129\",\"467355\":\"3142\",\"497685\":\"3145\",\"4107795\":\"3146\",\"41178105\":\"3147\",\"41279115\":\"3148\",\"413710125\":\"3149\",\"478356\":\"3152\",\"498576\":\"3154\",\"4118796\":\"3156\",\"41288106\":\"3157\",\"41389116\":\"3158\",\"414810126\":\"3159\",\"489357\":\"3162\",\"4109577\":\"3164\",\"4119687\":\"3165\",\"41398107\":\"3167\",\"41499117\":\"3168\",\"415910127\":\"3169\",\"4910358\":\"3172\",\"41110578\":\"3174\",\"41210688\":\"3175\",\"41310798\":\"3176\",\"415109118\":\"3178\",\"4161010128\":\"3179\",\"41011359\":\"3182\",\"41211579\":\"3184\",\"41311689\":\"3185\",\"41411799\":\"3186\",\"415118109\":\"3187\",\"4171110129\":\"3189\",\"411123510\":\"3192\",\"413125710\":\"3194\",\"414126810\":\"3195\",\"415127910\":\"3196\",\"4161281010\":\"3197\",\"4171291110\":\"3198\",\"554673\":\"3214\",\"564783\":\"3215\",\"574893\":\"3216\",\"5849103\":\"3217\",\"59410113\":\"3218\",\"510411123\":\"3219\",\"557346\":\"3241\",\"597786\":\"3245\",\"5107896\":\"3246\",\"51179106\":\"3247\",\"512710116\":\"3248\",\"513711126\":\"3249\",\"568347\":\"3251\",\"598677\":\"3254\",\"5118897\":\"3256\",\"51289107\":\"3257\",\"513810117\":\"3258\",\"514811127\":\"3259\",\"579348\":\"3261\",\"5109678\":\"3264\",\"5119788\":\"3265\",\"51399108\":\"3267\",\"514910118\":\"3268\",\"515911128\":\"3269\",\"5810349\":\"3271\",\"51110679\":\"3274\",\"51210789\":\"3275\",\"51310899\":\"3276\",\"5151010119\":\"3278\",\"5161011129\":\"3279\",\"59113410\":\"3281\",\"512116710\":\"3284\",\"513117810\":\"3285\",\"514118910\":\"3286\",\"5151191010\":\"3287\",\"51711111210\":\"3289\",\"510123411\":\"3291\",\"513126711\":\"3294\",\"514127811\":\"3295\",\"515128911\":\"3296\",\"5161291011\":\"3297\",\"51712101111\":\"3298\",\"734655\":\"3412\",\"764985\":\"3415\",\"7741095\":\"3416\",\"78411105\":\"3417\",\"79412115\":\"3418\",\"710413125\":\"3419\",\"735546\":\"3421\",\"775986\":\"3425\",\"7851096\":\"3426\",\"79511106\":\"3427\",\"710512116\":\"3428\",\"711513126\":\"3429\",\"768549\":\"3451\",\"778659\":\"3452\",\"71181099\":\"3456\",\"712811109\":\"3457\",\"713812119\":\"3458\",\"714813129\":\"3459\",\"7795410\":\"3461\",\"7896510\":\"3462\",\"71199810\":\"3465\",\"7139111010\":\"3467\",\"7149121110\":\"3468\",\"7159131210\":\"3469\",\"78105411\":\"3471\",\"79106511\":\"3472\",\"712109811\":\"3475\",\"7131010911\":\"3476\",\"71510121111\":\"3478\",\"71610131211\":\"3479\",\"79115412\":\"3481\",\"710116512\":\"3482\",\"713119812\":\"3485\",\"7141110912\":\"3486\",\"71511111012\":\"3487\",\"71711131212\":\"3489\",\"710125413\":\"3491\",\"711126513\":\"3492\",\"714129813\":\"3495\",\"7151210913\":\"3496\",\"71612111013\":\"3497\",\"71712121113\":\"3498\",\"834756\":\"3512\",\"854976\":\"3514\",\"8741196\":\"3516\",\"88412106\":\"3517\",\"89413116\":\"3518\",\"810414126\":\"3519\",\"835647\":\"3521\",\"865977\":\"3524\",\"8851197\":\"3526\",\"89512107\":\"3527\",\"810513117\":\"3528\",\"811514127\":\"3529\",\"857649\":\"3541\",\"867759\":\"3542\",\"81071199\":\"3546\",\"811712109\":\"3547\",\"812713119\":\"3548\",\"813714129\":\"3549\",\"8796411\":\"3561\",\"8897511\":\"3562\",\"81099711\":\"3564\",\"8139121011\":\"3567\",\"8149131111\":\"3568\",\"8159141211\":\"3569\",\"88106412\":\"3571\",\"89107512\":\"3572\",\"811109712\":\"3574\",\"8131011912\":\"3576\",\"81510131112\":\"3578\",\"81610141212\":\"3579\",\"89116413\":\"3581\",\"810117513\":\"3582\",\"812119713\":\"3584\",\"8141111913\":\"3586\",\"81511121013\":\"3587\",\"81711141213\":\"3589\",\"810126414\":\"3591\",\"811127514\":\"3592\",\"813129714\":\"3594\",\"8151211914\":\"3596\",\"81612121014\":\"3597\",\"81712131114\":\"3598\",\"934857\":\"3612\",\"9541077\":\"3614\",\"9641187\":\"3615\",\"98413107\":\"3617\",\"99414117\":\"3618\",\"910415127\":\"3619\",\"935748\":\"3621\",\"9651078\":\"3624\",\"9751188\":\"3625\",\"99513108\":\"3627\",\"910514118\":\"3628\",\"911515128\":\"3629\",\"9577410\":\"3641\",\"9678510\":\"3642\",\"99711810\":\"3645\",\"9117131010\":\"3647\",\"9127141110\":\"3648\",\"9137151210\":\"3649\",\"9687411\":\"3651\",\"9788511\":\"3652\",\"99810711\":\"3654\",\"9128131011\":\"3657\",\"9138141111\":\"3658\",\"9148151211\":\"3659\",\"98107413\":\"3671\",\"99108513\":\"3672\",\"9111010713\":\"3674\",\"9121011813\":\"3675\",\"91510141113\":\"3678\",\"91610151213\":\"3679\",\"99117414\":\"3681\",\"910118514\":\"3682\",\"9121110714\":\"3684\",\"9131111814\":\"3685\",\"91511131014\":\"3687\",\"91711151214\":\"3689\",\"910127415\":\"3691\",\"911128515\":\"3692\",\"9131210715\":\"3694\",\"9141211815\":\"3695\",\"91612131015\":\"3697\",\"91712141115\":\"3698\",\"1034958\":\"3712\",\"10541178\":\"3714\",\"10641288\":\"3715\",\"10741398\":\"3716\",\"109415118\":\"3718\",\"1010416128\":\"3719\",\"1035849\":\"3721\",\"10651179\":\"3724\",\"10751289\":\"3725\",\"10851399\":\"3726\",\"1010515119\":\"3728\",\"1011516129\":\"3729\",\"10578411\":\"3741\",\"10679511\":\"3742\",\"109712811\":\"3745\",\"1010713911\":\"3746\",\"10127151111\":\"3748\",\"10137161211\":\"3749\",\"10688412\":\"3751\",\"10789512\":\"3752\",\"109811712\":\"3754\",\"1011813912\":\"3756\",\"10138151112\":\"3758\",\"10148161212\":\"3759\",\"10798413\":\"3761\",\"10899513\":\"3762\",\"1010911713\":\"3764\",\"1011912813\":\"3765\",\"10149151113\":\"3768\",\"10159161213\":\"3769\",\"109118415\":\"3781\",\"1010119515\":\"3782\",\"10121111715\":\"3784\",\"10131112815\":\"3785\",\"10141113915\":\"3786\",\"101711161215\":\"3789\",\"1010128416\":\"3791\",\"1011129516\":\"3792\",\"10131211716\":\"3794\",\"10141212816\":\"3795\",\"10151213916\":\"3796\",\"101712151116\":\"3798\",\"11341059\":\"3812\",\"11541279\":\"3814\",\"11641389\":\"3815\",\"11741499\":\"3816\",\"118415109\":\"3817\",\"1110417129\":\"3819\",\"11359410\":\"3821\",\"116512710\":\"3824\",\"117513810\":\"3825\",\"118514910\":\"3826\",\"1195151010\":\"3827\",\"11115171210\":\"3829\",\"11579412\":\"3841\",\"116710512\":\"3842\",\"119713812\":\"3845\",\"1110714912\":\"3846\",\"11117151012\":\"3847\",\"11137171212\":\"3849\",\"11689413\":\"3851\",\"117810513\":\"3852\",\"119812713\":\"3854\",\"1111814913\":\"3856\",\"11128151013\":\"3857\",\"11148171213\":\"3859\",\"11799414\":\"3861\",\"118910514\":\"3862\",\"1110912714\":\"3864\",\"1111913814\":\"3865\",\"11139151014\":\"3867\",\"11159171214\":\"3869\",\"118109415\":\"3871\",\"1191010515\":\"3872\",\"11111012715\":\"3874\",\"11121013815\":\"3875\",\"11131014915\":\"3876\",\"111610171215\":\"3879\",\"1110129417\":\"3891\",\"11111210517\":\"3892\",\"11131212717\":\"3894\",\"11141213817\":\"3895\",\"11151214917\":\"3896\",\"111612151017\":\"3897\",\"123411510\":\"3912\",\"125413710\":\"3914\",\"126414810\":\"3915\",\"127415910\":\"3916\",\"1284161010\":\"3917\",\"1294171110\":\"3918\",\"123510411\":\"3921\",\"126513711\":\"3924\",\"127514811\":\"3925\",\"128515911\":\"3926\",\"1295161011\":\"3927\",\"12105171111\":\"3928\",\"125710413\":\"3941\",\"126711513\":\"3942\",\"129714813\":\"3945\",\"1210715913\":\"3946\",\"12117161013\":\"3947\",\"12127171113\":\"3948\",\"126810414\":\"3951\",\"127811514\":\"3952\",\"129813714\":\"3954\",\"1211815914\":\"3956\",\"12128161014\":\"3957\",\"12138171114\":\"3958\",\"127910415\":\"3961\",\"128911515\":\"3962\",\"1210913715\":\"3964\",\"1211914815\":\"3965\",\"12139161015\":\"3967\",\"12149171115\":\"3968\",\"1281010416\":\"3971\",\"1291011516\":\"3972\",\"12111013716\":\"3974\",\"12121014816\":\"3975\",\"12131015916\":\"3976\",\"121510171116\":\"3978\",\"1291110417\":\"3981\",\"12101111517\":\"3982\",\"12121113717\":\"3984\",\"12131114817\":\"3985\",\"12141115917\":\"3986\",\"121511161017\":\"3987\",\"556473\":\"4123\",\"576693\":\"4125\",\"5867103\":\"4126\",\"5968113\":\"4127\",\"51069123\":\"4128\",\"511610133\":\"4129\",\"557364\":\"4132\",\"587694\":\"4135\",\"5977104\":\"4136\",\"51078114\":\"4137\",\"51179124\":\"4138\",\"512710134\":\"4139\",\"579366\":\"4152\",\"589476\":\"4153\",\"51197106\":\"4156\",\"51298116\":\"4157\",\"51399126\":\"4158\",\"514910136\":\"4159\",\"5810367\":\"4162\",\"5910477\":\"4163\",\"51110697\":\"4165\",\"513108117\":\"4167\",\"514109127\":\"4168\",\"5151010137\":\"4169\",\"5911368\":\"4172\",\"51011478\":\"4173\",\"51211698\":\"4175\",\"513117108\":\"4176\",\"515119128\":\"4178\",\"5161110138\":\"4179\",\"51012369\":\"4182\",\"51112479\":\"4183\",\"51312699\":\"4185\",\"514127109\":\"4186\",\"515128119\":\"4187\",\"5171210139\":\"4189\",\"511133610\":\"4192\",\"512134710\":\"4193\",\"514136910\":\"4195\",\"5151371010\":\"4196\",\"5161381110\":\"4197\",\"5171391210\":\"4198\",\"645573\":\"4213\",\"665793\":\"4215\",\"6758103\":\"4216\",\"6859113\":\"4217\",\"69510123\":\"4218\",\"610511133\":\"4219\",\"647355\":\"4231\",\"687795\":\"4235\",\"6978105\":\"4236\",\"61079115\":\"4237\",\"611710125\":\"4238\",\"612711135\":\"4239\",\"669357\":\"4251\",\"689577\":\"4253\",\"61198107\":\"4256\",\"61299117\":\"4257\",\"613910127\":\"4258\",\"614911137\":\"4259\",\"6710358\":\"4261\",\"6910578\":\"4263\",\"61110798\":\"4265\",\"613109118\":\"4267\",\"6141010128\":\"4268\",\"6151011138\":\"4269\",\"6811359\":\"4271\",\"61011579\":\"4273\",\"61211799\":\"4275\",\"613118109\":\"4276\",\"6151110129\":\"4278\",\"6161111139\":\"4279\",\"69123510\":\"4281\",\"611125710\":\"4283\",\"613127910\":\"4285\",\"6141281010\":\"4286\",\"6151291110\":\"4287\",\"61712111310\":\"4289\",\"610133511\":\"4291\",\"612135711\":\"4293\",\"614137911\":\"4295\",\"6151381011\":\"4296\",\"6161391111\":\"4297\",\"61713101211\":\"4298\",\"735564\":\"4312\",\"765894\":\"4315\",\"7759104\":\"4316\",\"78510114\":\"4317\",\"79511124\":\"4318\",\"710512134\":\"4319\",\"736455\":\"4321\",\"776895\":\"4325\",\"7869105\":\"4326\",\"79610115\":\"4327\",\"710611125\":\"4328\",\"711612135\":\"4329\",\"769458\":\"4351\",\"779568\":\"4352\",\"71199108\":\"4356\",\"712910118\":\"4357\",\"713911128\":\"4358\",\"714912138\":\"4359\",\"7710459\":\"4361\",\"7810569\":\"4362\",\"71110899\":\"4365\",\"7131010119\":\"4367\",\"7141011129\":\"4368\",\"7151012139\":\"4369\",\"78114510\":\"4371\",\"79115610\":\"4372\",\"712118910\":\"4375\",\"7131191010\":\"4376\",\"71511111210\":\"4378\",\"71611121310\":\"4379\",\"79124511\":\"4381\",\"710125611\":\"4382\",\"713128911\":\"4385\",\"7141291011\":\"4386\",\"71512101111\":\"4387\",\"71712121311\":\"4389\",\"710134512\":\"4391\",\"711135612\":\"4392\",\"714138912\":\"4395\",\"7151391012\":\"4396\",\"71613101112\":\"4397\",\"71713111212\":\"4398\",\"935766\":\"4512\",\"945876\":\"4513\",\"97511106\":\"4516\",\"98512116\":\"4517\",\"99513126\":\"4518\",\"910514136\":\"4519\",\"936657\":\"4521\",\"956877\":\"4523\",\"98611107\":\"4526\",\"99612117\":\"4527\",\"910613127\":\"4528\",\"911614137\":\"4529\",\"947658\":\"4531\",\"957768\":\"4532\",\"99711108\":\"4536\",\"910712118\":\"4537\",\"911713128\":\"4538\",\"912714138\":\"4539\",\"97106511\":\"4561\",\"98107611\":\"4562\",\"99108711\":\"4563\",\"91310121111\":\"4567\",\"91410131211\":\"4568\",\"91510141311\":\"4569\",\"98116512\":\"4571\",\"99117612\":\"4572\",\"910118712\":\"4573\",\"91311111012\":\"4576\",\"91511131212\":\"4578\",\"91611141312\":\"4579\",\"99126513\":\"4581\",\"910127613\":\"4582\",\"911128713\":\"4583\",\"91412111013\":\"4586\",\"91512121113\":\"4587\",\"91712141313\":\"4589\",\"910136514\":\"4591\",\"911137614\":\"4592\",\"912138714\":\"4593\",\"91513111014\":\"4596\",\"91613121114\":\"4597\",\"91713131214\":\"4598\",\"1035867\":\"4612\",\"1045977\":\"4613\",\"10651197\":\"4615\",\"108513117\":\"4617\",\"109514127\":\"4618\",\"1010515137\":\"4619\",\"1036758\":\"4621\",\"1056978\":\"4623\",\"10761198\":\"4625\",\"109613118\":\"4627\",\"1010614128\":\"4628\",\"1011615138\":\"4629\",\"1047759\":\"4631\",\"1057869\":\"4632\",\"10871199\":\"4635\",\"1010713119\":\"4637\",\"1011714129\":\"4638\",\"1012715139\":\"4639\",\"10697511\":\"4651\",\"10798611\":\"4652\",\"10899711\":\"4653\",\"10129131111\":\"4657\",\"10139141211\":\"4658\",\"10149151311\":\"4659\",\"108117513\":\"4671\",\"109118613\":\"4672\",\"1010119713\":\"4673\",\"10121111913\":\"4675\",\"101511141213\":\"4678\",\"101611151313\":\"4679\",\"109127514\":\"4681\",\"1010128614\":\"4682\",\"1011129714\":\"4683\",\"10131211914\":\"4685\",\"101512131114\":\"4687\",\"101712151314\":\"4689\",\"1010137515\":\"4691\",\"1011138615\":\"4692\",\"1012139715\":\"4693\",\"10141311915\":\"4695\",\"101613131115\":\"4697\",\"101713141215\":\"4698\",\"1135968\":\"4712\",\"11451078\":\"4713\",\"11651298\":\"4715\",\"117513108\":\"4716\",\"119515128\":\"4718\",\"1110516138\":\"4719\",\"1136859\":\"4721\",\"11561079\":\"4723\",\"11761299\":\"4725\",\"118613109\":\"4726\",\"1110615129\":\"4728\",\"1111616139\":\"4729\",\"11478510\":\"4731\",\"11579610\":\"4732\",\"118712910\":\"4735\",\"1197131010\":\"4736\",\"11117151210\":\"4738\",\"11127161310\":\"4739\",\"11698512\":\"4751\",\"11799612\":\"4752\",\"118910712\":\"4753\",\"11119131012\":\"4756\",\"11139151212\":\"4758\",\"11149161312\":\"4759\",\"117108513\":\"4761\",\"118109613\":\"4762\",\"1191010713\":\"4763\",\"11111012913\":\"4765\",\"111410151213\":\"4768\",\"111510161313\":\"4769\",\"119128515\":\"4781\",\"1110129615\":\"4782\",\"11111210715\":\"4783\",\"11131212915\":\"4785\",\"111412131015\":\"4786\",\"111712161315\":\"4789\",\"1110138516\":\"4791\",\"1111139616\":\"4792\",\"11121310716\":\"4793\",\"11141312916\":\"4795\",\"111513131016\":\"4796\",\"111713151216\":\"4798\",\"12351069\":\"4812\",\"12451179\":\"4813\",\"12651399\":\"4815\",\"127514109\":\"4816\",\"128515119\":\"4817\",\"1210517139\":\"4819\",\"12369510\":\"4821\",\"125611710\":\"4823\",\"127613910\":\"4825\",\"1286141010\":\"4826\",\"1296151110\":\"4827\",\"12116171310\":\"4829\",\"12479511\":\"4831\",\"125710611\":\"4832\",\"128713911\":\"4835\",\"1297141011\":\"4836\",\"12107151111\":\"4837\",\"12127171311\":\"4839\",\"12699513\":\"4851\",\"127910613\":\"4852\",\"128911713\":\"4853\",\"12119141013\":\"4856\",\"12129151113\":\"4857\",\"12149171313\":\"4859\",\"127109514\":\"4861\",\"1281010614\":\"4862\",\"1291011714\":\"4863\",\"12111013914\":\"4865\",\"121310151114\":\"4867\",\"121510171314\":\"4869\",\"128119515\":\"4871\",\"1291110615\":\"4872\",\"12101111715\":\"4873\",\"12121113915\":\"4875\",\"121311141015\":\"4876\",\"121611171315\":\"4879\",\"1210139517\":\"4891\",\"12111310617\":\"4892\",\"12121311717\":\"4893\",\"12141313917\":\"4895\",\"121513141017\":\"4896\",\"121613151117\":\"4897\",\"133511610\":\"4912\",\"134512710\":\"4913\",\"136514910\":\"4915\",\"1375151010\":\"4916\",\"1385161110\":\"4917\",\"1395171210\":\"4918\",\"133610511\":\"4921\",\"135612711\":\"4923\",\"137614911\":\"4925\",\"1386151011\":\"4926\",\"1396161111\":\"4927\",\"13106171211\":\"4928\",\"134710512\":\"4931\",\"135711612\":\"4932\",\"138714912\":\"4935\",\"1397151012\":\"4936\",\"13107161112\":\"4937\",\"13117171212\":\"4938\",\"136910514\":\"4951\",\"137911614\":\"4952\",\"138912714\":\"4953\",\"13119151014\":\"4956\",\"13129161114\":\"4957\",\"13139171214\":\"4958\",\"1371010515\":\"4961\",\"1381011615\":\"4962\",\"1391012715\":\"4963\",\"13111014915\":\"4965\",\"131310161115\":\"4967\",\"131410171215\":\"4968\",\"1381110516\":\"4971\",\"1391111616\":\"4972\",\"13101112716\":\"4973\",\"13121114916\":\"4975\",\"131311151016\":\"4976\",\"131511171216\":\"4978\",\"1391210517\":\"4981\",\"13101211617\":\"4982\",\"13111212717\":\"4983\",\"13131214917\":\"4985\",\"131412151017\":\"4986\",\"131512161117\":\"4987\",\"657483\":\"5123\",\"667593\":\"5124\",\"6877113\":\"5126\",\"6978123\":\"5127\",\"61079133\":\"5128\",\"611710143\":\"5129\",\"658374\":\"5132\",\"678594\":\"5134\",\"6987114\":\"5136\",\"61088124\":\"5137\",\"61189134\":\"5138\",\"612810144\":\"5139\",\"669375\":\"5142\",\"679485\":\"5143\",\"61097115\":\"5146\",\"61198125\":\"5147\",\"61299135\":\"5148\",\"613910145\":\"5149\",\"6811377\":\"5162\",\"6911487\":\"5163\",\"61011597\":\"5164\",\"613118127\":\"5167\",\"614119137\":\"5168\",\"6151110147\":\"5169\",\"6912378\":\"5172\",\"61012488\":\"5173\",\"61112598\":\"5174\",\"613127118\":\"5176\",\"615129138\":\"5178\",\"6161210148\":\"5179\",\"61013379\":\"5182\",\"61113489\":\"5183\",\"61213599\":\"5184\",\"614137119\":\"5186\",\"615138129\":\"5187\",\"6171310149\":\"5189\",\"611143710\":\"5192\",\"612144810\":\"5193\",\"613145910\":\"5194\",\"6151471110\":\"5196\",\"6161481210\":\"5197\",\"6171491310\":\"5198\",\"746583\":\"5213\",\"756693\":\"5214\",\"7768113\":\"5216\",\"7869123\":\"5217\",\"79610133\":\"5218\",\"710611143\":\"5219\",\"748365\":\"5231\",\"778695\":\"5234\",\"7988115\":\"5236\",\"71089125\":\"5237\",\"711810135\":\"5238\",\"712811145\":\"5239\",\"759366\":\"5241\",\"779586\":\"5243\",\"71098116\":\"5246\",\"71199126\":\"5247\",\"712910136\":\"5248\",\"713911146\":\"5249\",\"7711368\":\"5261\",\"7911588\":\"5263\",\"71011698\":\"5264\",\"713119128\":\"5267\",\"7141110138\":\"5268\",\"7151111148\":\"5269\",\"7812369\":\"5271\",\"71012589\":\"5273\",\"71112699\":\"5274\",\"713128119\":\"5276\",\"7151210139\":\"5278\",\"7161211149\":\"5279\",\"79133610\":\"5281\",\"711135810\":\"5283\",\"712136910\":\"5284\",\"7141381110\":\"5286\",\"7151391210\":\"5287\",\"71713111410\":\"5289\",\"710143611\":\"5291\",\"712145811\":\"5293\",\"713146911\":\"5294\",\"7151481111\":\"5296\",\"7161491211\":\"5297\",\"71714101311\":\"5298\",\"836574\":\"5312\",\"856794\":\"5314\",\"8769114\":\"5316\",\"88610124\":\"5317\",\"89611134\":\"5318\",\"810612144\":\"5319\",\"837465\":\"5321\",\"867795\":\"5324\",\"8879115\":\"5326\",\"89710125\":\"5327\",\"810711135\":\"5328\",\"811712145\":\"5329\",\"859467\":\"5341\",\"869577\":\"5342\",\"81099117\":\"5346\",\"811910127\":\"5347\",\"812911137\":\"5348\",\"813912147\":\"5349\",\"8711469\":\"5361\",\"8811579\":\"5362\",\"81011799\":\"5364\",\"8131110129\":\"5367\",\"8141111139\":\"5368\",\"8151112149\":\"5369\",\"88124610\":\"5371\",\"89125710\":\"5372\",\"811127910\":\"5374\",\"8131291110\":\"5376\",\"81512111310\":\"5378\",\"81612121410\":\"5379\",\"89134611\":\"5381\",\"810135711\":\"5382\",\"812137911\":\"5384\",\"8141391111\":\"5386\",\"81513101211\":\"5387\",\"81713121411\":\"5389\",\"810144612\":\"5391\",\"811145712\":\"5392\",\"813147912\":\"5394\",\"8151491112\":\"5396\",\"81614101212\":\"5397\",\"81714111312\":\"5398\",\"936675\":\"5412\",\"946785\":\"5413\",\"97610115\":\"5416\",\"98611125\":\"5417\",\"99612135\":\"5418\",\"910613145\":\"5419\",\"937566\":\"5421\",\"957786\":\"5423\",\"98710116\":\"5426\",\"99711126\":\"5427\",\"910712136\":\"5428\",\"911713146\":\"5429\",\"948567\":\"5431\",\"958677\":\"5432\",\"99810117\":\"5436\",\"910811127\":\"5437\",\"911812137\":\"5438\",\"912813147\":\"5439\",\"97115610\":\"5461\",\"98116710\":\"5462\",\"99117810\":\"5463\",\"91311111210\":\"5467\",\"91411121310\":\"5468\",\"91511131410\":\"5469\",\"98125611\":\"5471\",\"99126711\":\"5472\",\"910127811\":\"5473\",\"91312101111\":\"5476\",\"91512121311\":\"5478\",\"91612131411\":\"5479\",\"99135612\":\"5481\",\"910136712\":\"5482\",\"911137812\":\"5483\",\"91413101112\":\"5486\",\"91513111212\":\"5487\",\"91713131412\":\"5489\",\"910145613\":\"5491\",\"911146713\":\"5492\",\"912147813\":\"5493\",\"91514101113\":\"5496\",\"91614111213\":\"5497\",\"91714121313\":\"5498\",\"1136877\":\"5612\",\"1146987\":\"5613\",\"11561097\":\"5614\",\"118613127\":\"5617\",\"119614137\":\"5618\",\"1110615147\":\"5619\",\"1137768\":\"5621\",\"1157988\":\"5623\",\"11671098\":\"5624\",\"119713128\":\"5627\",\"1110714138\":\"5628\",\"1111715148\":\"5629\",\"1148769\":\"5631\",\"1158879\":\"5632\",\"11781099\":\"5634\",\"1110813129\":\"5637\",\"1111814139\":\"5638\",\"1112815149\":\"5639\",\"11597610\":\"5641\",\"11698710\":\"5642\",\"11799810\":\"5643\",\"11119131210\":\"5647\",\"11129141310\":\"5648\",\"11139151410\":\"5649\",\"118127613\":\"5671\",\"119128713\":\"5672\",\"1110129813\":\"5673\",\"11111210913\":\"5674\",\"111512141313\":\"5678\",\"111612151413\":\"5679\",\"119137614\":\"5681\",\"1110138714\":\"5682\",\"1111139814\":\"5683\",\"11121310914\":\"5684\",\"111513131214\":\"5687\",\"111713151414\":\"5689\",\"1110147615\":\"5691\",\"1111148715\":\"5692\",\"1112149815\":\"5693\",\"11131410915\":\"5694\",\"111614131215\":\"5697\",\"111714141315\":\"5698\",\"1236978\":\"5712\",\"12461088\":\"5713\",\"12561198\":\"5714\",\"127613118\":\"5716\",\"129615138\":\"5718\",\"1210616148\":\"5719\",\"1237869\":\"5721\",\"12571089\":\"5723\",\"12671199\":\"5724\",\"128713119\":\"5726\",\"1210715139\":\"5728\",\"1211716149\":\"5729\",\"12488610\":\"5731\",\"12589710\":\"5732\",\"127811910\":\"5734\",\"1298131110\":\"5736\",\"12118151310\":\"5738\",\"12128161410\":\"5739\",\"12598611\":\"5741\",\"12699711\":\"5742\",\"127910811\":\"5743\",\"12109131111\":\"5746\",\"12129151311\":\"5748\",\"12139161411\":\"5749\",\"127118613\":\"5761\",\"128119713\":\"5762\",\"1291110813\":\"5763\",\"12101111913\":\"5764\",\"121411151313\":\"5768\",\"121511161413\":\"5769\",\"129138615\":\"5781\",\"1210139715\":\"5782\",\"12111310815\":\"5783\",\"12121311915\":\"5784\",\"121413131115\":\"5786\",\"121713161415\":\"5789\",\"1210148616\":\"5791\",\"1211149716\":\"5792\",\"12121410816\":\"5793\",\"12131411916\":\"5794\",\"121514131116\":\"5796\",\"121714151316\":\"5798\",\"13361079\":\"5812\",\"13461189\":\"5813\",\"13561299\":\"5814\",\"137614119\":\"5816\",\"138615129\":\"5817\",\"1310617149\":\"5819\",\"13379610\":\"5821\",\"135711810\":\"5823\",\"136712910\":\"5824\",\"1387141110\":\"5826\",\"1397151210\":\"5827\",\"13117171410\":\"5829\",\"13489611\":\"5831\",\"135810711\":\"5832\",\"137812911\":\"5834\",\"1398141111\":\"5836\",\"13108151211\":\"5837\",\"13128171411\":\"5839\",\"13599612\":\"5841\",\"136910712\":\"5842\",\"137911812\":\"5843\",\"13109141112\":\"5846\",\"13119151212\":\"5847\",\"13139171412\":\"5849\",\"137119614\":\"5861\",\"1381110714\":\"5862\",\"1391111814\":\"5863\",\"13101112914\":\"5864\",\"131311151214\":\"5867\",\"131511171414\":\"5869\",\"138129615\":\"5871\",\"1391210715\":\"5872\",\"13101211815\":\"5873\",\"13111212915\":\"5874\",\"131312141115\":\"5876\",\"131612171415\":\"5879\",\"1310149617\":\"5891\",\"13111410717\":\"5892\",\"13121411817\":\"5893\",\"13131412917\":\"5894\",\"131514141117\":\"5896\",\"131614151217\":\"5897\",\"143611710\":\"5912\",\"144612810\":\"5913\",\"145613910\":\"5914\",\"1476151110\":\"5916\",\"1486161210\":\"5917\",\"1496171310\":\"5918\",\"143710611\":\"5921\",\"145712811\":\"5923\",\"146713911\":\"5924\",\"1487151111\":\"5926\",\"1497161211\":\"5927\",\"14107171311\":\"5928\",\"144810612\":\"5931\",\"145811712\":\"5932\",\"147813912\":\"5934\",\"1498151112\":\"5936\",\"14108161212\":\"5937\",\"14118171312\":\"5938\",\"145910613\":\"5941\",\"146911713\":\"5942\",\"147912813\":\"5943\",\"14109151113\":\"5946\",\"14119161213\":\"5947\",\"14129171313\":\"5948\",\"1471110615\":\"5961\",\"1481111715\":\"5962\",\"1491112815\":\"5963\",\"14101113915\":\"5964\",\"141311161215\":\"5967\",\"141411171315\":\"5968\",\"1481210616\":\"5971\",\"1491211716\":\"5972\",\"14101212816\":\"5973\",\"14111213916\":\"5974\",\"141312151116\":\"5976\",\"141512171316\":\"5978\",\"1491310617\":\"5981\",\"14101311717\":\"5982\",\"14111312817\":\"5983\",\"14121313917\":\"5984\",\"141413151117\":\"5986\",\"141513161217\":\"5987\",\"758493\":\"6123\",\"7685103\":\"6124\",\"7786113\":\"6125\",\"7988133\":\"6127\",\"71089143\":\"6128\",\"711810153\":\"6129\",\"759384\":\"6132\",\"7795104\":\"6134\",\"7896114\":\"6135\",\"71098134\":\"6137\",\"71199144\":\"6138\",\"712910154\":\"6139\",\"7610385\":\"6142\",\"7710495\":\"6143\",\"79106115\":\"6145\",\"711108135\":\"6147\",\"712109145\":\"6148\",\"7131010155\":\"6149\",\"7711386\":\"6152\",\"7811496\":\"6153\",\"79115106\":\"6154\",\"712118136\":\"6157\",\"713119146\":\"6158\",\"7141110156\":\"6159\",\"7913388\":\"6172\",\"71013498\":\"6173\",\"711135108\":\"6174\",\"712136118\":\"6175\",\"715139148\":\"6178\",\"7161310158\":\"6179\",\"71014389\":\"6182\",\"71114499\":\"6183\",\"712145109\":\"6184\",\"713146119\":\"6185\",\"715148139\":\"6187\",\"7171410159\":\"6189\",\"711153810\":\"6192\",\"712154910\":\"6193\",\"7131551010\":\"6194\",\"7141561110\":\"6195\",\"7161581310\":\"6197\",\"7171591410\":\"6198\",\"847593\":\"6213\",\"8576103\":\"6214\",\"8677113\":\"6215\",\"8879133\":\"6217\",\"89710143\":\"6218\",\"810711153\":\"6219\",\"849375\":\"6231\",\"8796105\":\"6234\",\"8897115\":\"6235\",\"81099135\":\"6237\",\"811910145\":\"6238\",\"812911155\":\"6239\",\"8510376\":\"6241\",\"8710596\":\"6243\",\"89107116\":\"6245\",\"811109136\":\"6247\",\"8121010146\":\"6248\",\"8131011156\":\"6249\",\"8611377\":\"6251\",\"8811597\":\"6253\",\"89116107\":\"6254\",\"812119137\":\"6257\",\"8131110147\":\"6258\",\"8141111157\":\"6259\",\"8813379\":\"6271\",\"81013599\":\"6273\",\"811136109\":\"6274\",\"812137119\":\"6275\",\"8151310149\":\"6278\",\"8161311159\":\"6279\",\"89143710\":\"6281\",\"811145910\":\"6283\",\"8121461010\":\"6284\",\"8131471110\":\"6285\",\"8151491310\":\"6287\",\"81714111510\":\"6289\",\"810153711\":\"6291\",\"812155911\":\"6293\",\"8131561011\":\"6294\",\"8141571111\":\"6295\",\"8161591311\":\"6297\",\"81715101411\":\"6298\",\"937584\":\"6312\",\"9577104\":\"6314\",\"9678114\":\"6315\",\"98710134\":\"6317\",\"99711144\":\"6318\",\"910712154\":\"6319\",\"938475\":\"6321\",\"9687105\":\"6324\",\"9788115\":\"6325\",\"99810135\":\"6327\",\"910811145\":\"6328\",\"911812155\":\"6329\",\"9510477\":\"6341\",\"9610587\":\"6342\",\"99108117\":\"6345\",\"9111010137\":\"6347\",\"9121011147\":\"6348\",\"9131012157\":\"6349\",\"9611478\":\"6351\",\"9711588\":\"6352\",\"99117108\":\"6354\",\"9121110138\":\"6357\",\"9131111148\":\"6358\",\"9141112158\":\"6359\",\"98134710\":\"6371\",\"99135810\":\"6372\",\"9111371010\":\"6374\",\"9121381110\":\"6375\",\"91513111410\":\"6378\",\"91613121510\":\"6379\",\"99144711\":\"6381\",\"910145811\":\"6382\",\"9121471011\":\"6384\",\"9131481111\":\"6385\",\"91514101311\":\"6387\",\"91714121511\":\"6389\",\"910154712\":\"6391\",\"911155812\":\"6392\",\"9131571012\":\"6394\",\"9141581112\":\"6395\",\"91615101312\":\"6397\",\"91715111412\":\"6398\",\"1037685\":\"6412\",\"1047795\":\"6413\",\"10679115\":\"6415\",\"108711135\":\"6417\",\"109712145\":\"6418\",\"1010713155\":\"6419\",\"1038576\":\"6421\",\"1058796\":\"6423\",\"10789116\":\"6425\",\"109811136\":\"6427\",\"1010812146\":\"6428\",\"1011813156\":\"6429\",\"1049577\":\"6431\",\"1059687\":\"6432\",\"10899117\":\"6435\",\"1010911137\":\"6437\",\"1011912147\":\"6438\",\"1012913157\":\"6439\",\"10611579\":\"6451\",\"10711689\":\"6452\",\"10811799\":\"6453\",\"10121111139\":\"6457\",\"10131112149\":\"6458\",\"10141113159\":\"6459\",\"108135711\":\"6471\",\"109136811\":\"6472\",\"1010137911\":\"6473\",\"10121391111\":\"6475\",\"101513121411\":\"6478\",\"101613131511\":\"6479\",\"109145712\":\"6481\",\"1010146812\":\"6482\",\"1011147912\":\"6483\",\"10131491112\":\"6485\",\"101514111312\":\"6487\",\"101714131512\":\"6489\",\"1010155713\":\"6491\",\"1011156813\":\"6492\",\"1012157913\":\"6493\",\"10141591113\":\"6495\",\"101615111313\":\"6497\",\"101715121413\":\"6498\",\"1137786\":\"6512\",\"1147896\":\"6513\",\"11579106\":\"6514\",\"118712136\":\"6517\",\"119713146\":\"6518\",\"1110714156\":\"6519\",\"1138677\":\"6521\",\"1158897\":\"6523\",\"11689107\":\"6524\",\"119812137\":\"6527\",\"1110813147\":\"6528\",\"1111814157\":\"6529\",\"1149678\":\"6531\",\"1159788\":\"6532\",\"11799108\":\"6534\",\"1110912138\":\"6537\",\"1111913148\":\"6538\",\"1112914158\":\"6539\",\"11510679\":\"6541\",\"11610789\":\"6542\",\"11710899\":\"6543\",\"11111012139\":\"6547\",\"11121013149\":\"6548\",\"11131014159\":\"6549\",\"118136712\":\"6571\",\"119137812\":\"6572\",\"1110138912\":\"6573\",\"11111391012\":\"6574\",\"111513131412\":\"6578\",\"111613141512\":\"6579\",\"119146713\":\"6581\",\"1110147813\":\"6582\",\"1111148913\":\"6583\",\"11121491013\":\"6584\",\"111514121313\":\"6587\",\"111714141513\":\"6589\",\"1110156714\":\"6591\",\"1111157814\":\"6592\",\"1112158914\":\"6593\",\"11131591014\":\"6594\",\"111615121314\":\"6597\",\"111715131414\":\"6598\",\"1337988\":\"6712\",\"13471098\":\"6713\",\"135711108\":\"6714\",\"136712118\":\"6715\",\"139715148\":\"6718\",\"1310716158\":\"6719\",\"1338879\":\"6721\",\"13581099\":\"6723\",\"136811109\":\"6724\",\"137812119\":\"6725\",\"1310815149\":\"6728\",\"1311816159\":\"6729\",\"13498710\":\"6731\",\"13599810\":\"6732\",\"1379111010\":\"6734\",\"1389121110\":\"6735\",\"13119151410\":\"6738\",\"13129161510\":\"6739\",\"135108711\":\"6741\",\"136109811\":\"6742\",\"1371010911\":\"6743\",\"13910121111\":\"6745\",\"131210151411\":\"6748\",\"131310161511\":\"6749\",\"136118712\":\"6751\",\"137119812\":\"6752\",\"1381110912\":\"6753\",\"13911111012\":\"6754\",\"131311151412\":\"6758\",\"131411161512\":\"6759\",\"139148715\":\"6781\",\"1310149815\":\"6782\",\"13111410915\":\"6783\",\"131214111015\":\"6784\",\"131314121115\":\"6785\",\"131714161515\":\"6789\",\"1310158716\":\"6791\",\"1311159816\":\"6792\",\"13121510916\":\"6793\",\"131315111016\":\"6794\",\"131415121116\":\"6795\",\"131715151416\":\"6798\",\"14371089\":\"6812\",\"14471199\":\"6813\",\"145712109\":\"6814\",\"146713119\":\"6815\",\"148715139\":\"6817\",\"1410717159\":\"6819\",\"14389710\":\"6821\",\"145811910\":\"6823\",\"1468121010\":\"6824\",\"1478131110\":\"6825\",\"1498151310\":\"6827\",\"14118171510\":\"6829\",\"14499711\":\"6831\",\"145910811\":\"6832\",\"1479121011\":\"6834\",\"1489131111\":\"6835\",\"14109151311\":\"6837\",\"14129171511\":\"6839\",\"145109712\":\"6841\",\"1461010812\":\"6842\",\"1471011912\":\"6843\",\"14910131112\":\"6845\",\"141110151312\":\"6847\",\"141310171512\":\"6849\",\"146119713\":\"6851\",\"1471110813\":\"6852\",\"1481111913\":\"6853\",\"14911121013\":\"6854\",\"141211151313\":\"6857\",\"141411171513\":\"6859\",\"148139715\":\"6871\",\"1491310815\":\"6872\",\"14101311915\":\"6873\",\"141113121015\":\"6874\",\"141213131115\":\"6875\",\"141613171515\":\"6879\",\"1410159717\":\"6891\",\"14111510817\":\"6892\",\"14121511917\":\"6893\",\"141315121017\":\"6894\",\"141415131117\":\"6895\",\"141615151317\":\"6897\",\"153711810\":\"6912\",\"154712910\":\"6913\",\"1557131010\":\"6914\",\"1567141110\":\"6915\",\"1587161310\":\"6917\",\"1597171410\":\"6918\",\"153810711\":\"6921\",\"155812911\":\"6923\",\"1568131011\":\"6924\",\"1578141111\":\"6925\",\"1598161311\":\"6927\",\"15108171411\":\"6928\",\"154910712\":\"6931\",\"155911812\":\"6932\",\"1579131012\":\"6934\",\"1589141112\":\"6935\",\"15109161312\":\"6937\",\"15119171412\":\"6938\",\"1551010713\":\"6941\",\"1561011813\":\"6942\",\"1571012913\":\"6943\",\"15910141113\":\"6945\",\"151110161313\":\"6947\",\"151210171413\":\"6948\",\"1561110714\":\"6951\",\"1571111814\":\"6952\",\"1581112914\":\"6953\",\"15911131014\":\"6954\",\"151211161314\":\"6957\",\"151311171414\":\"6958\",\"1581310716\":\"6971\",\"1591311816\":\"6972\",\"15101312916\":\"6973\",\"151113131016\":\"6974\",\"151213141116\":\"6975\",\"151513171416\":\"6978\",\"1591410717\":\"6981\",\"15101411817\":\"6982\",\"15111412917\":\"6983\",\"151214131017\":\"6984\",\"151314141117\":\"6985\",\"151514161317\":\"6987\",\"8594103\":\"7123\",\"8695113\":\"7124\",\"8796123\":\"7125\",\"8897133\":\"7126\",\"81099153\":\"7128\",\"811910163\":\"7129\",\"8510394\":\"7132\",\"87105114\":\"7134\",\"88106124\":\"7135\",\"89107134\":\"7136\",\"811109154\":\"7138\",\"8121010164\":\"7139\",\"8611395\":\"7142\",\"87114105\":\"7143\",\"89116125\":\"7145\",\"810117135\":\"7146\",\"812119155\":\"7148\",\"8131110165\":\"7149\",\"8712396\":\"7152\",\"88124106\":\"7153\",\"89125116\":\"7154\",\"811127136\":\"7156\",\"813129156\":\"7158\",\"8141210166\":\"7159\",\"8813397\":\"7162\",\"89134107\":\"7163\",\"810135117\":\"7164\",\"811136127\":\"7165\",\"814139157\":\"7168\",\"8151310167\":\"7169\",\"81015399\":\"7182\",\"811154109\":\"7183\",\"812155119\":\"7184\",\"813156129\":\"7185\",\"814157139\":\"7186\",\"8171510169\":\"7189\",\"811163910\":\"7192\",\"8121641010\":\"7193\",\"8131651110\":\"7194\",\"8141661210\":\"7195\",\"8151671310\":\"7196\",\"8171691510\":\"7198\",\"9485103\":\"7213\",\"9586113\":\"7214\",\"9687123\":\"7215\",\"9788133\":\"7216\",\"99810153\":\"7218\",\"910811163\":\"7219\",\"9410385\":\"7231\",\"97106115\":\"7234\",\"98107125\":\"7235\",\"99108135\":\"7236\",\"9111010155\":\"7238\",\"9121011165\":\"7239\",\"9511386\":\"7241\",\"97115106\":\"7243\",\"99117126\":\"7245\",\"910118136\":\"7246\",\"9121110156\":\"7248\",\"9131111166\":\"7249\",\"9612387\":\"7251\",\"98125107\":\"7253\",\"99126117\":\"7254\",\"911128137\":\"7256\",\"9131210157\":\"7258\",\"9141211167\":\"7259\",\"9713388\":\"7261\",\"99135108\":\"7263\",\"910136118\":\"7264\",\"911137128\":\"7265\",\"9141310158\":\"7268\",\"9151311168\":\"7269\",\"99153810\":\"7281\",\"9111551010\":\"7283\",\"9121561110\":\"7284\",\"9131571210\":\"7285\",\"9141581310\":\"7286\",\"91715111610\":\"7289\",\"910163811\":\"7291\",\"9121651011\":\"7293\",\"9131661111\":\"7294\",\"9141671211\":\"7295\",\"9151681311\":\"7296\",\"91716101511\":\"7298\",\"1038594\":\"7312\",\"10587114\":\"7314\",\"10688124\":\"7315\",\"10789134\":\"7316\",\"109811154\":\"7318\",\"1010812164\":\"7319\",\"1039485\":\"7321\",\"10697115\":\"7324\",\"10798125\":\"7325\",\"10899135\":\"7326\",\"1010911155\":\"7328\",\"1011912165\":\"7329\",\"10511487\":\"7341\",\"10611597\":\"7342\",\"109118127\":\"7345\",\"1010119137\":\"7346\",\"10121111157\":\"7348\",\"10131112167\":\"7349\",\"10612488\":\"7351\",\"10712598\":\"7352\",\"109127118\":\"7354\",\"1011129138\":\"7356\",\"10131211158\":\"7358\",\"10141212168\":\"7359\",\"10713489\":\"7361\",\"10813599\":\"7362\",\"1010137119\":\"7364\",\"1011138129\":\"7365\",\"10141311159\":\"7368\",\"10151312169\":\"7369\",\"109154811\":\"7381\",\"1010155911\":\"7382\",\"10121571111\":\"7384\",\"10131581211\":\"7385\",\"10141591311\":\"7386\",\"101715121611\":\"7389\",\"1010164812\":\"7391\",\"1011165912\":\"7392\",\"10131671112\":\"7394\",\"10141681212\":\"7395\",\"10151691312\":\"7396\",\"101716111512\":\"7398\",\"1138695\":\"7412\",\"11487105\":\"7413\",\"11689125\":\"7415\",\"117810135\":\"7416\",\"119812155\":\"7418\",\"1110813165\":\"7419\",\"1139586\":\"7421\",\"11597106\":\"7423\",\"11799126\":\"7425\",\"118910136\":\"7426\",\"1110912156\":\"7428\",\"1111913166\":\"7429\",\"11410587\":\"7431\",\"11510697\":\"7432\",\"118109127\":\"7435\",\"1191010137\":\"7436\",\"11111012157\":\"7438\",\"11121013167\":\"7439\",\"11612589\":\"7451\",\"11712699\":\"7452\",\"118127109\":\"7453\",\"11111210139\":\"7456\",\"11131212159\":\"7458\",\"11141213169\":\"7459\",\"117135810\":\"7461\",\"118136910\":\"7462\",\"1191371010\":\"7463\",\"11111391210\":\"7465\",\"111413121510\":\"7468\",\"111513131610\":\"7469\",\"119155812\":\"7481\",\"1110156912\":\"7482\",\"11111571012\":\"7483\",\"11131591212\":\"7485\",\"111415101312\":\"7486\",\"111715131612\":\"7489\",\"1110165813\":\"7491\",\"1111166913\":\"7492\",\"11121671013\":\"7493\",\"11141691213\":\"7495\",\"111516101313\":\"7496\",\"111716121513\":\"7498\",\"1238796\":\"7512\",\"12488106\":\"7513\",\"12589116\":\"7514\",\"127811136\":\"7516\",\"129813156\":\"7518\",\"1210814166\":\"7519\",\"1239687\":\"7521\",\"12598107\":\"7523\",\"12699117\":\"7524\",\"128911137\":\"7526\",\"1210913157\":\"7528\",\"1211914167\":\"7529\",\"12410688\":\"7531\",\"12510798\":\"7532\",\"127109118\":\"7534\",\"1291011138\":\"7536\",\"12111013158\":\"7538\",\"12121014168\":\"7539\",\"12511689\":\"7541\",\"12611799\":\"7542\",\"127118109\":\"7543\",\"12101111139\":\"7546\",\"12121113159\":\"7548\",\"12131114169\":\"7549\",\"127136811\":\"7561\",\"128137911\":\"7562\",\"1291381011\":\"7563\",\"12101391111\":\"7564\",\"121413131511\":\"7568\",\"121513141611\":\"7569\",\"129156813\":\"7581\",\"1210157913\":\"7582\",\"12111581013\":\"7583\",\"12121591113\":\"7584\",\"121415111313\":\"7586\",\"121715141613\":\"7589\",\"1210166814\":\"7591\",\"1211167914\":\"7592\",\"12121681014\":\"7593\",\"12131691114\":\"7594\",\"121516111314\":\"7596\",\"121716131514\":\"7598\",\"1338897\":\"7612\",\"13489107\":\"7613\",\"135810117\":\"7614\",\"136811127\":\"7615\",\"139814157\":\"7618\",\"1310815167\":\"7619\",\"1339788\":\"7621\",\"13599108\":\"7623\",\"136910118\":\"7624\",\"137911128\":\"7625\",\"1310914158\":\"7628\",\"1311915168\":\"7629\",\"13410789\":\"7631\",\"13510899\":\"7632\",\"1371010119\":\"7634\",\"1381011129\":\"7635\",\"13111014159\":\"7638\",\"13121015169\":\"7639\",\"135117810\":\"7641\",\"136118910\":\"7642\",\"1371191010\":\"7643\",\"13911111210\":\"7645\",\"131211141510\":\"7648\",\"131311151610\":\"7649\",\"136127811\":\"7651\",\"137128911\":\"7652\",\"1381291011\":\"7653\",\"13912101111\":\"7654\",\"131312141511\":\"7658\",\"131412151611\":\"7659\",\"139157814\":\"7681\",\"1310158914\":\"7682\",\"13111591014\":\"7683\",\"131215101114\":\"7684\",\"131315111214\":\"7685\",\"131715151614\":\"7689\",\"1310167815\":\"7691\",\"1311168915\":\"7692\",\"13121691015\":\"7693\",\"131316101115\":\"7694\",\"131416111215\":\"7695\",\"131716141515\":\"7698\",\"15381099\":\"7812\",\"154811109\":\"7813\",\"155812119\":\"7814\",\"156813129\":\"7815\",\"157814139\":\"7816\",\"1510817169\":\"7819\",\"15399810\":\"7821\",\"1559111010\":\"7823\",\"1569121110\":\"7824\",\"1579131210\":\"7825\",\"1589141310\":\"7826\",\"15119171610\":\"7829\",\"154109811\":\"7831\",\"1551010911\":\"7832\",\"15710121111\":\"7834\",\"15810131211\":\"7835\",\"15910141311\":\"7836\",\"151210171611\":\"7839\",\"155119812\":\"7841\",\"1561110912\":\"7842\",\"15711111012\":\"7843\",\"15911131212\":\"7845\",\"151011141312\":\"7846\",\"151311171612\":\"7849\",\"156129813\":\"7851\",\"1571210913\":\"7852\",\"15812111013\":\"7853\",\"15912121113\":\"7854\",\"151112141313\":\"7856\",\"151412171613\":\"7859\",\"157139814\":\"7861\",\"1581310914\":\"7862\",\"15913111014\":\"7863\",\"151013121114\":\"7864\",\"151113131214\":\"7865\",\"151513171614\":\"7869\",\"1510169817\":\"7891\",\"15111610917\":\"7892\",\"151216111017\":\"7893\",\"151316121117\":\"7894\",\"151416131217\":\"7895\",\"151516141317\":\"7896\",\"163811910\":\"7912\",\"1648121010\":\"7913\",\"1658131110\":\"7914\",\"1668141210\":\"7915\",\"1678151310\":\"7916\",\"1698171510\":\"7918\",\"163910811\":\"7921\",\"1659121011\":\"7923\",\"1669131111\":\"7924\",\"1679141211\":\"7925\",\"1689151311\":\"7926\",\"16109171511\":\"7928\",\"1641010812\":\"7931\",\"1651011912\":\"7932\",\"16710131112\":\"7934\",\"16810141212\":\"7935\",\"16910151312\":\"7936\",\"161110171512\":\"7938\",\"1651110813\":\"7941\",\"1661111913\":\"7942\",\"16711121013\":\"7943\",\"16911141213\":\"7945\",\"161011151313\":\"7946\",\"161211171513\":\"7948\",\"1661210814\":\"7951\",\"1671211914\":\"7952\",\"16812121014\":\"7953\",\"16912131114\":\"7954\",\"161112151314\":\"7956\",\"161312171514\":\"7958\",\"1671310815\":\"7961\",\"1681311915\":\"7962\",\"16913121015\":\"7963\",\"161013131115\":\"7964\",\"161113141215\":\"7965\",\"161413171515\":\"7968\",\"1691510817\":\"7981\",\"16101511917\":\"7982\",\"161115121017\":\"7983\",\"161215131117\":\"7984\",\"161315141217\":\"7985\",\"161415151317\":\"7986\",\"95104113\":\"8123\",\"96105123\":\"8124\",\"97106133\":\"8125\",\"98107143\":\"8126\",\"99108153\":\"8127\",\"9111010173\":\"8129\",\"95113104\":\"8132\",\"97115124\":\"8134\",\"98116134\":\"8135\",\"99117144\":\"8136\",\"910118154\":\"8137\",\"9121110174\":\"8139\",\"96123105\":\"8142\",\"97124115\":\"8143\",\"99126135\":\"8145\",\"910127145\":\"8146\",\"911128155\":\"8147\",\"9131210175\":\"8149\",\"97133106\":\"8152\",\"98134116\":\"8153\",\"99135126\":\"8154\",\"911137146\":\"8156\",\"912138156\":\"8157\",\"9141310176\":\"8159\",\"98143107\":\"8162\",\"99144117\":\"8163\",\"910145127\":\"8164\",\"911146137\":\"8165\",\"913148157\":\"8167\",\"9151410177\":\"8169\",\"99153108\":\"8172\",\"910154118\":\"8173\",\"911155128\":\"8174\",\"912156138\":\"8175\",\"913157148\":\"8176\",\"9161510178\":\"8179\",\"9111731010\":\"8192\",\"9121741110\":\"8193\",\"9131751210\":\"8194\",\"9141761310\":\"8195\",\"9151771410\":\"8196\",\"9161781510\":\"8197\",\"10495113\":\"8213\",\"10596123\":\"8214\",\"10697133\":\"8215\",\"10798143\":\"8216\",\"10899153\":\"8217\",\"1010911173\":\"8219\",\"10411395\":\"8231\",\"107116125\":\"8234\",\"108117135\":\"8235\",\"109118145\":\"8236\",\"1010119155\":\"8237\",\"10121111175\":\"8239\",\"10512396\":\"8241\",\"107125116\":\"8243\",\"109127136\":\"8245\",\"1010128146\":\"8246\",\"1011129156\":\"8247\",\"10131211176\":\"8249\",\"10613397\":\"8251\",\"108135117\":\"8253\",\"109136127\":\"8254\",\"1011138147\":\"8256\",\"1012139157\":\"8257\",\"10141311177\":\"8259\",\"10714398\":\"8261\",\"109145118\":\"8263\",\"1010146128\":\"8264\",\"1011147138\":\"8265\",\"1013149158\":\"8267\",\"10151411178\":\"8269\",\"10815399\":\"8271\",\"1010155119\":\"8273\",\"1011156129\":\"8274\",\"1012157139\":\"8275\",\"1013158149\":\"8276\",\"10161511179\":\"8279\",\"1010173911\":\"8291\",\"10121751111\":\"8293\",\"10131761211\":\"8294\",\"10141771311\":\"8295\",\"10151781411\":\"8296\",\"10161791511\":\"8297\",\"11395104\":\"8312\",\"11597124\":\"8314\",\"11698134\":\"8315\",\"11799144\":\"8316\",\"118910154\":\"8317\",\"1110912174\":\"8319\",\"11310495\":\"8321\",\"116107125\":\"8324\",\"117108135\":\"8325\",\"118109145\":\"8326\",\"1191010155\":\"8327\",\"11111012175\":\"8329\",\"11512497\":\"8341\",\"116125107\":\"8342\",\"119128137\":\"8345\",\"1110129147\":\"8346\",\"11111210157\":\"8347\",\"11131212177\":\"8349\",\"11613498\":\"8351\",\"117135108\":\"8352\",\"119137128\":\"8354\",\"1111139148\":\"8356\",\"11121310158\":\"8357\",\"11141312178\":\"8359\",\"11714499\":\"8361\",\"118145109\":\"8362\",\"1110147129\":\"8364\",\"1111148139\":\"8365\",\"11131410159\":\"8367\",\"11151412179\":\"8369\",\"118154910\":\"8371\",\"1191551010\":\"8372\",\"11111571210\":\"8374\",\"11121581310\":\"8375\",\"11131591410\":\"8376\",\"111615121710\":\"8379\",\"1110174912\":\"8391\",\"11111751012\":\"8392\",\"11131771212\":\"8394\",\"11141781312\":\"8395\",\"11151791412\":\"8396\",\"111617101512\":\"8397\",\"12396105\":\"8412\",\"12497115\":\"8413\",\"12699135\":\"8415\",\"127910145\":\"8416\",\"128911155\":\"8417\",\"1210913175\":\"8419\",\"12310596\":\"8421\",\"125107116\":\"8423\",\"127109136\":\"8425\",\"1281010146\":\"8426\",\"1291011156\":\"8427\",\"12111013176\":\"8429\",\"12411597\":\"8431\",\"125116107\":\"8432\",\"128119137\":\"8435\",\"1291110147\":\"8436\",\"12101111157\":\"8437\",\"12121113177\":\"8439\",\"12613599\":\"8451\",\"127136109\":\"8452\",\"128137119\":\"8453\",\"12111310149\":\"8456\",\"12121311159\":\"8457\",\"12141313179\":\"8459\",\"127145910\":\"8461\",\"1281461010\":\"8462\",\"1291471110\":\"8463\",\"12111491310\":\"8465\",\"121314111510\":\"8467\",\"121514131710\":\"8469\",\"128155911\":\"8471\",\"1291561011\":\"8472\",\"12101571111\":\"8473\",\"12121591311\":\"8475\",\"121315101411\":\"8476\",\"121615131711\":\"8479\",\"1210175913\":\"8491\",\"12111761013\":\"8492\",\"12121771113\":\"8493\",\"12141791313\":\"8495\",\"121517101413\":\"8496\",\"121617111513\":\"8497\",\"13397106\":\"8512\",\"13498116\":\"8513\",\"13599126\":\"8514\",\"137911146\":\"8516\",\"138912156\":\"8517\",\"1310914176\":\"8519\",\"13310697\":\"8521\",\"135108117\":\"8523\",\"136109127\":\"8524\",\"1381011147\":\"8526\",\"1391012157\":\"8527\",\"13111014177\":\"8529\",\"13411698\":\"8531\",\"135117108\":\"8532\",\"137119128\":\"8534\",\"1391111148\":\"8536\",\"13101112158\":\"8537\",\"13121114178\":\"8539\",\"13512699\":\"8541\",\"136127109\":\"8542\",\"137128119\":\"8543\",\"13101211149\":\"8546\",\"13111212159\":\"8547\",\"13131214179\":\"8549\",\"137146911\":\"8561\",\"1381471011\":\"8562\",\"1391481111\":\"8563\",\"13101491211\":\"8564\",\"131314121511\":\"8567\",\"131514141711\":\"8569\",\"138156912\":\"8571\",\"1391571012\":\"8572\",\"13101581112\":\"8573\",\"13111591212\":\"8574\",\"131315111412\":\"8576\",\"131615141712\":\"8579\",\"1310176914\":\"8591\",\"13111771014\":\"8592\",\"13121781114\":\"8593\",\"13131791214\":\"8594\",\"131517111414\":\"8596\",\"131617121514\":\"8597\",\"14398107\":\"8612\",\"14499117\":\"8613\",\"145910127\":\"8614\",\"146911137\":\"8615\",\"148913157\":\"8617\",\"1410915177\":\"8619\",\"14310798\":\"8621\",\"145109118\":\"8623\",\"1461010128\":\"8624\",\"1471011138\":\"8625\",\"1491013158\":\"8627\",\"14111015178\":\"8629\",\"14411799\":\"8631\",\"145118109\":\"8632\",\"1471110129\":\"8634\",\"1481111139\":\"8635\",\"14101113159\":\"8637\",\"14121115179\":\"8639\",\"145127910\":\"8641\",\"1461281010\":\"8642\",\"1471291110\":\"8643\",\"14912111310\":\"8645\",\"141112131510\":\"8647\",\"141312151710\":\"8649\",\"146137911\":\"8651\",\"1471381011\":\"8652\",\"1481391111\":\"8653\",\"14913101211\":\"8654\",\"141213131511\":\"8657\",\"141413151711\":\"8659\",\"148157913\":\"8671\",\"1491581013\":\"8672\",\"14101591113\":\"8673\",\"141115101213\":\"8674\",\"141215111313\":\"8675\",\"141615151713\":\"8679\",\"1410177915\":\"8691\",\"14111781015\":\"8692\",\"14121791115\":\"8693\",\"141317101215\":\"8694\",\"141417111315\":\"8695\",\"141617131515\":\"8697\",\"15399108\":\"8712\",\"154910118\":\"8713\",\"155911128\":\"8714\",\"156912138\":\"8715\",\"157913148\":\"8716\",\"1510916178\":\"8719\",\"15310899\":\"8721\",\"1551010119\":\"8723\",\"1561011129\":\"8724\",\"1571012139\":\"8725\",\"1581013149\":\"8726\",\"15111016179\":\"8729\",\"154118910\":\"8731\",\"1551191010\":\"8732\",\"15711111210\":\"8734\",\"15811121310\":\"8735\",\"15911131410\":\"8736\",\"151211161710\":\"8739\",\"155128911\":\"8741\",\"1561291011\":\"8742\",\"15712101111\":\"8743\",\"15912121311\":\"8745\",\"151012131411\":\"8746\",\"151312161711\":\"8749\",\"156138912\":\"8751\",\"1571391012\":\"8752\",\"15813101112\":\"8753\",\"15913111212\":\"8754\",\"151113131412\":\"8756\",\"151413161712\":\"8759\",\"157148913\":\"8761\",\"1581491013\":\"8762\",\"15914101113\":\"8763\",\"151014111213\":\"8764\",\"151114121313\":\"8765\",\"151514161713\":\"8769\",\"1510178916\":\"8791\",\"15111791016\":\"8792\",\"151217101116\":\"8793\",\"151317111216\":\"8794\",\"151417121316\":\"8795\",\"151517131416\":\"8796\",\"1739111010\":\"8912\",\"1749121110\":\"8913\",\"1759131210\":\"8914\",\"1769141310\":\"8915\",\"1779151410\":\"8916\",\"1789161510\":\"8917\",\"1731010911\":\"8921\",\"17510121111\":\"8923\",\"17610131211\":\"8924\",\"17710141311\":\"8925\",\"17810151411\":\"8926\",\"17910161511\":\"8927\",\"1741110912\":\"8931\",\"17511111012\":\"8932\",\"17711131212\":\"8934\",\"17811141312\":\"8935\",\"17911151412\":\"8936\",\"171011161512\":\"8937\",\"1751210913\":\"8941\",\"17612111013\":\"8942\",\"17712121113\":\"8943\",\"17912141313\":\"8945\",\"171012151413\":\"8946\",\"171112161513\":\"8947\",\"1761310914\":\"8951\",\"17713111014\":\"8952\",\"17813121114\":\"8953\",\"17913131214\":\"8954\",\"171113151414\":\"8956\",\"171213161514\":\"8957\",\"1771410915\":\"8961\",\"17814111015\":\"8962\",\"17914121115\":\"8963\",\"171014131215\":\"8964\",\"171114141315\":\"8965\",\"171314161515\":\"8967\",\"1781510916\":\"8971\",\"17915111016\":\"8972\",\"171015121116\":\"8973\",\"171115131216\":\"8974\",\"171215141316\":\"8975\",\"171315151416\":\"8976\",\"105114123\":\"9123\",\"106115133\":\"9124\",\"107116143\":\"9125\",\"108117153\":\"9126\",\"109118163\":\"9127\",\"1010119173\":\"9128\",\"105123114\":\"9132\",\"107125134\":\"9134\",\"108126144\":\"9135\",\"109127154\":\"9136\",\"1010128164\":\"9137\",\"1011129174\":\"9138\",\"106133115\":\"9142\",\"107134125\":\"9143\",\"109136145\":\"9145\",\"1010137155\":\"9146\",\"1011138165\":\"9147\",\"1012139175\":\"9148\",\"107143116\":\"9152\",\"108144126\":\"9153\",\"109145136\":\"9154\",\"1011147156\":\"9156\",\"1012148166\":\"9157\",\"1013149176\":\"9158\",\"108153117\":\"9162\",\"109154127\":\"9163\",\"1010155137\":\"9164\",\"1011156147\":\"9165\",\"1013158167\":\"9167\",\"1014159177\":\"9168\",\"109163118\":\"9172\",\"1010164128\":\"9173\",\"1011165138\":\"9174\",\"1012166148\":\"9175\",\"1013167158\":\"9176\",\"1015169178\":\"9178\",\"1010173119\":\"9182\",\"1011174129\":\"9183\",\"1012175139\":\"9184\",\"1013176149\":\"9185\",\"1014177159\":\"9186\",\"1015178169\":\"9187\",\"114105123\":\"9213\",\"115106133\":\"9214\",\"116107143\":\"9215\",\"117108153\":\"9216\",\"118109163\":\"9217\",\"1191010173\":\"9218\",\"114123105\":\"9231\",\"117126135\":\"9234\",\"118127145\":\"9235\",\"119128155\":\"9236\",\"1110129165\":\"9237\",\"11111210175\":\"9238\",\"115133106\":\"9241\",\"117135126\":\"9243\",\"119137146\":\"9245\",\"1110138156\":\"9246\",\"1111139166\":\"9247\",\"11121310176\":\"9248\",\"116143107\":\"9251\",\"118145127\":\"9253\",\"119146137\":\"9254\",\"1111148157\":\"9256\",\"1112149167\":\"9257\",\"11131410177\":\"9258\",\"117153108\":\"9261\",\"119155128\":\"9263\",\"1110156138\":\"9264\",\"1111157148\":\"9265\",\"1113159168\":\"9267\",\"11141510178\":\"9268\",\"118163109\":\"9271\",\"1110165129\":\"9273\",\"1111166139\":\"9274\",\"1112167149\":\"9275\",\"1113168159\":\"9276\",\"11151610179\":\"9278\",\"1191731010\":\"9281\",\"11111751210\":\"9283\",\"11121761310\":\"9284\",\"11131771410\":\"9285\",\"11141781510\":\"9286\",\"11151791610\":\"9287\",\"123105114\":\"9312\",\"125107134\":\"9314\",\"126108144\":\"9315\",\"127109154\":\"9316\",\"1281010164\":\"9317\",\"1291011174\":\"9318\",\"123114105\":\"9321\",\"126117135\":\"9324\",\"127118145\":\"9325\",\"128119155\":\"9326\",\"1291110165\":\"9327\",\"12101111175\":\"9328\",\"125134107\":\"9341\",\"126135117\":\"9342\",\"129138147\":\"9345\",\"1210139157\":\"9346\",\"12111310167\":\"9347\",\"12121311177\":\"9348\",\"126144108\":\"9351\",\"127145118\":\"9352\",\"129147138\":\"9354\",\"1211149158\":\"9356\",\"12121410168\":\"9357\",\"12131411178\":\"9358\",\"127154109\":\"9361\",\"128155119\":\"9362\",\"1210157139\":\"9364\",\"1211158149\":\"9365\",\"12131510169\":\"9367\",\"12141511179\":\"9368\",\"1281641010\":\"9371\",\"1291651110\":\"9372\",\"12111671310\":\"9374\",\"12121681410\":\"9375\",\"12131691510\":\"9376\",\"121516111710\":\"9378\",\"1291741011\":\"9381\",\"12101751111\":\"9382\",\"12121771311\":\"9384\",\"12131781411\":\"9385\",\"12141791511\":\"9386\",\"121517101611\":\"9387\",\"133106115\":\"9412\",\"134107125\":\"9413\",\"136109145\":\"9415\",\"1371010155\":\"9416\",\"1381011165\":\"9417\",\"1391012175\":\"9418\",\"133115106\":\"9421\",\"135117126\":\"9423\",\"137119146\":\"9425\",\"1381110156\":\"9426\",\"1391111166\":\"9427\",\"13101112176\":\"9428\",\"134125107\":\"9431\",\"135126117\":\"9432\",\"138129147\":\"9435\",\"1391210157\":\"9436\",\"13101211167\":\"9437\",\"13111212177\":\"9438\",\"136145109\":\"9451\",\"137146119\":\"9452\",\"138147129\":\"9453\",\"13111410159\":\"9456\",\"13121411169\":\"9457\",\"13131412179\":\"9458\",\"1371551010\":\"9461\",\"1381561110\":\"9462\",\"1391571210\":\"9463\",\"13111591410\":\"9465\",\"131315111610\":\"9467\",\"131415121710\":\"9468\",\"1381651011\":\"9471\",\"1391661111\":\"9472\",\"13101671211\":\"9473\",\"13121691411\":\"9475\",\"131316101511\":\"9476\",\"131516121711\":\"9478\",\"1391751012\":\"9481\",\"13101761112\":\"9482\",\"13111771212\":\"9483\",\"13131791412\":\"9485\",\"131417101512\":\"9486\",\"131517111612\":\"9487\",\"143107116\":\"9512\",\"144108126\":\"9513\",\"145109136\":\"9514\",\"1471011156\":\"9516\",\"1481012166\":\"9517\",\"1491013176\":\"9518\",\"143116107\":\"9521\",\"145118127\":\"9523\",\"146119137\":\"9524\",\"1481111157\":\"9526\",\"1491112167\":\"9527\",\"14101113177\":\"9528\",\"144126108\":\"9531\",\"145127118\":\"9532\",\"147129138\":\"9534\",\"1491211158\":\"9536\",\"14101212168\":\"9537\",\"14111213178\":\"9538\",\"145136109\":\"9541\",\"146137119\":\"9542\",\"147138129\":\"9543\",\"14101311159\":\"9546\",\"14111312169\":\"9547\",\"14121313179\":\"9548\",\"1471561011\":\"9561\",\"1481571111\":\"9562\",\"1491581211\":\"9563\",\"14101591311\":\"9564\",\"141315121611\":\"9567\",\"141415131711\":\"9568\",\"1481661012\":\"9571\",\"1491671112\":\"9572\",\"14101681212\":\"9573\",\"14111691312\":\"9574\",\"141316111512\":\"9576\",\"141516131712\":\"9578\",\"1491761013\":\"9581\",\"14101771113\":\"9582\",\"14111781213\":\"9583\",\"14121791313\":\"9584\",\"141417111513\":\"9586\",\"141517121613\":\"9587\",\"153108117\":\"9612\",\"154109127\":\"9613\",\"1551010137\":\"9614\",\"1561011147\":\"9615\",\"1581013167\":\"9617\",\"1591014177\":\"9618\",\"153117108\":\"9621\",\"155119128\":\"9623\",\"1561110138\":\"9624\",\"1571111148\":\"9625\",\"1591113168\":\"9627\",\"15101114178\":\"9628\",\"154127109\":\"9631\",\"155128119\":\"9632\",\"1571210139\":\"9634\",\"1581211149\":\"9635\",\"15101213169\":\"9637\",\"15111214179\":\"9638\",\"1551371010\":\"9641\",\"1561381110\":\"9642\",\"1571391210\":\"9643\",\"15913111410\":\"9645\",\"151113131610\":\"9647\",\"151213141710\":\"9648\",\"1561471011\":\"9651\",\"1571481111\":\"9652\",\"1581491211\":\"9653\",\"15914101311\":\"9654\",\"151214131611\":\"9657\",\"151314141711\":\"9658\",\"1581671013\":\"9671\",\"1591681113\":\"9672\",\"15101691213\":\"9673\",\"151116101313\":\"9674\",\"151216111413\":\"9675\",\"151516141713\":\"9678\",\"1591771014\":\"9681\",\"15101781114\":\"9682\",\"15111791214\":\"9683\",\"151217101314\":\"9684\",\"151317111414\":\"9685\",\"151517131614\":\"9687\",\"163109118\":\"9712\",\"1641010128\":\"9713\",\"1651011138\":\"9714\",\"1661012148\":\"9715\",\"1671013158\":\"9716\",\"1691015178\":\"9718\",\"163118109\":\"9721\",\"1651110129\":\"9723\",\"1661111139\":\"9724\",\"1671112149\":\"9725\",\"1681113159\":\"9726\",\"16101115179\":\"9728\",\"1641281010\":\"9731\",\"1651291110\":\"9732\",\"16712111310\":\"9734\",\"16812121410\":\"9735\",\"16912131510\":\"9736\",\"161112151710\":\"9738\",\"1651381011\":\"9741\",\"1661391111\":\"9742\",\"16713101211\":\"9743\",\"16913121411\":\"9745\",\"161013131511\":\"9746\",\"161213151711\":\"9748\",\"1661481012\":\"9751\",\"1671491112\":\"9752\",\"16814101212\":\"9753\",\"16914111312\":\"9754\",\"161114131512\":\"9756\",\"161314151712\":\"9758\",\"1671581013\":\"9761\",\"1681591113\":\"9762\",\"16915101213\":\"9763\",\"161015111313\":\"9764\",\"161115121413\":\"9765\",\"161415151713\":\"9768\",\"1691781015\":\"9781\",\"16101791115\":\"9782\",\"161117101215\":\"9783\",\"161217111315\":\"9784\",\"161317121415\":\"9785\",\"161417131515\":\"9786\",\"1731010119\":\"9812\",\"1741011129\":\"9813\",\"1751012139\":\"9814\",\"1761013149\":\"9815\",\"1771014159\":\"9816\",\"1781015169\":\"9817\",\"1731191010\":\"9821\",\"17511111210\":\"9823\",\"17611121310\":\"9824\",\"17711131410\":\"9825\",\"17811141510\":\"9826\",\"17911151610\":\"9827\",\"1741291011\":\"9831\",\"17512101111\":\"9832\",\"17712121311\":\"9834\",\"17812131411\":\"9835\",\"17912141511\":\"9836\",\"171012151611\":\"9837\",\"1751391012\":\"9841\",\"17613101112\":\"9842\",\"17713111212\":\"9843\",\"17913131412\":\"9845\",\"171013141512\":\"9846\",\"171113151612\":\"9847\",\"1761491013\":\"9851\",\"17714101113\":\"9852\",\"17814111213\":\"9853\",\"17914121313\":\"9854\",\"171114141513\":\"9856\",\"171214151613\":\"9857\",\"1771591014\":\"9861\",\"17815101114\":\"9862\",\"17915111214\":\"9863\",\"171015121314\":\"9864\",\"171115131414\":\"9865\",\"171315151614\":\"9867\",\"1781691015\":\"9871\",\"17916101115\":\"9872\",\"171016111215\":\"9873\",\"171116121315\":\"9874\",\"171216131415\":\"9875\",\"171316141515\":\"9876\",}\n\tvar r1, r2, c1, c2, d1, d2 string\n\tvar key string\n\tfmt.Scanf(\"%s %s\\n%s %s\\n%s %s\", &r1, &r2, &c1, &c2, &d1, &d2)\n\tkey = r1 + r2 + c1 + c2 + d1 + d2\n\tfmt.Println(m[key][0]-48,m[key][1]-48)\n\tfmt.Println(m[key][2]-48,m[key][3]-48)\n}", "lang": "Go", "bug_code_uid": "b8fbf31614efcdeb8bf356671f4b3381", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "fe389e0b6cc8e2de26dffd51580df755", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8993414863593603, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var r1,r2,c1,c2,d1,d2 int\n fmt.Scan(&r1,&r2,&c1,&c2,&d1,&d2)\n b := (d2+r1-c1)/2\n c := d2-b\n a := c1-c\n d := r2-c\n f := func(n int) bool {\n if (n >= 1) && (n <= 9) { return true }\n return false\n }\n if (a != b) && (a != c) && (a != d) && (b != c) && (b != d) && (c != d) && f(a) && f(b) && f(c) && f(d) {\n fmt.Println(a,b)\n fmt.Println(c,d)\n } else {\n fmt.Println(-1)\n }\n}\n", "lang": "Go", "bug_code_uid": "3c9e3fc0e98c25b8449c5b28ab4c4ab6", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "18214bec9dfb15203fdf4386c18ba404", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.835909631391201, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\tvar m int\n\tI(&m, \"\\n\")\n\tmax := int64(n - (m - 1))\n\tmin := int64(n / m)\n\tif n%m == 0 {\n\t\tmin = C(int(min)) * int64(m)\n\t} else {\n\t\tmin = C(int(min))*int64(m-1) + C(int(min)+n%m)\n\t}\n\tmax = C(int(max))\n\tO(min, \" \")\n\tO(max, \"\\n\")\n}\n\nfunc C(a int) int64 {\n\treturn int64(a) * int64(a-1) / int64(2)\n}\n", "lang": "Go", "bug_code_uid": "ad87b228f99bcce1dabbec47dd6cbb2a", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "48afb553a50a61a903544ef51cc2edb4", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := int64(nextInt()), int64(nextInt())\n\n\tif n % m == 0 {\n\t\tprintln(pair(n/m) * m, pair(n-m+1))\n\t} else {\n\t\tprintln(pair(n/m) * (m-1) + pair(n/m + (n%m)), pair(n-m+1))\n\t}\n\n\t// println(n)\n}\n\nfunc pair(n int64) int64 {\n\treturn n * (n-1) / 2\n} \n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}", "lang": "Go", "bug_code_uid": "36246fde11e7dca4aad6151fdd34b2b1", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "e147d52bdcc2c97ed9493aeaa3fded82", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.44214876033057854, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scan(&n, &m)\n\tmax := n - m + 1\n\tmin := n / m\n\tif min == 1 && n%m > 0 {\n\t\tmin++\n\t}\n\tpair := func(x int64) int64 {\n\t\treturn x * (x - 1) / 2\n\t}\n\tfmt.Println(pair(max), pair(min))\n}\n", "lang": "Go", "bug_code_uid": "5e481a4cb002a6bdee1aa77ee88b7429", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "8a9408cbdb26fd146312527f0459c319", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.46481178396072015, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tvar min int64 = 0\n\tnn := n\n\tmm := m\n\tfor m > 0 {\n\t\tif (n % m == 0) {\n\t\t\tx := n / m\n\t\t\tmin += m * x * (x - 1) / 2\n\t\t\tm = 0\n\t\t} else {\n\t\t\tx := n / m\n\t\t\tmin += x * (x - 1) / 2\n\t\t\tn -= x\n\t\t\tm--\n\t\t}\n\t}\n\tx := nn - mm + 1\n\tmax := x * (x - 1) / 2\n\tfmt.Printf(\"%d %d\\n\", min, max)\n}\n", "lang": "Go", "bug_code_uid": "7a70bcb59fa6b545e1fabedaa123044b", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "1cd7c4d49f979234641fa656ffa91534", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.998745294855709, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc mabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar s, x1, x2, t1, t2, p, d int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s, &x1, &x2, &t1, &t2, &p, &d)\n\tbest := mabs(x1-x2) * t2\n\ttraintime := 0\n\tif d == 1 {\n\t\tif p <= x1 {\n\t\t\ttraintime = (x1 - p) * t1\n\t\t} else {\n\t\t\ttraintime = (s-p)*t1 + (s-x1)*t1\n\t\t\td = -1\n\t\t}\n\t} else {\n\t\tif p >= x1 {\n\t\t\ttraintime = (p - x1) * t1\n\t\t} else {\n\t\t\ttraintime = (p * t1) + (x1 * t1)\n\t\t\td = 1\n\t\t}\n\t}\n\tif d == 1 {\n\t\tif x1 < x2 {\n\t\t\ttraintime += (x2 - x1) * t1\n\t\t} else {\n\t\t\ttraintime += (s-x1)*t1 + (s-x2)*t1\n\t\t}\n\t} else {\n\t\tif x2 < x1 {\n\t\t\ttraintime += (x1 - x2) * t1\n\t\t} else {\n\t\t\ttraintime += x1*t1 + x2*t2\n\t\t}\n\t}\n\tif traintime < best {\n\t\tbest = traintime\n\t}\n\tfmt.Println(best)\n}\n", "lang": "Go", "bug_code_uid": "1d3f34d6ee4b42659b58ce813eef5e8e", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "56fb6971aa5765a0ebca793e33b8606b", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9921011058451816, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, x1, x2, t1, t2, p, d int\n\tfmt.Scan(&s, &x1, &x2, &t1, &t2, &p, &d)\n\tbyFoot := abs(x1-x2) * t2\n\twT := abs(p-x1) * t1\n\tif x1 < p {\n\t\tif d == 1 {\n\t\t\twT += 2 * (s - p) * t1\n\t\t\td = -1\n\t\t}\n\t} else {\n\t\tif d == -1 {\n\t\t\twT += 2 * p * t1\n\t\t\td = 1\n\t\t}\n\t}\n\ttT := abs(x1-x2) * t1\n\tif x1 < x2 {\n\t\tif d == -1 {\n\t\t\ttT += 2 * x1 * t1\n\t\t}\n\t} else {\n\t\tif d == 1 {\n\t\t\ttT += 2 * (s - x1) * t1\n\t\t}\n\t}\n\n\tbyTrain := tT + wT\n\tfmt.Println(min(byFoot, byTrain))\n}\n\nfunc min(a, b int) int {\n\tmin := a\n\tif b < a {\n\t\tmin = b\n\t}\n\treturn min\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -1 * x\n\t}\n\treturn x\n}\n", "lang": "Go", "bug_code_uid": "4a831e11a4ac3f41ab1ef3a92a3b1538", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "9eb623ab8f85f0c9dc61fe2c4a3c540e", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9991549295774648, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n\t\"unicode/utf8\"\n)\n\n// ******************************** CODE STARTS ********************************\n\nconst (\n\tMOD int = 1000 * 1000 * 1000 + 7\n)\n\nvar (\n)\n\nfunc solve() {\n\t_ = readInt()\n\ta := readInt()\n\tb := readInt()\n\tmovesNum := readInt()\n\n\tdp := make([][]int, 2)\n\tfor i := 0; i < len(dp); i++ {\n\t\tdp[i] = make([]int, b)\n\t}\n\n\tfor i := 1; i < b; i++ {\n\t\tdp[0][i] = 1 + dp[0][i - 1] \n\t\tif dp[0][i] >= MOD {\n\t\t\tdp[0][i] -= MOD\n\t\t}\n\t}\n\n\tfor move := 0; move < movesNum; move++ {\n\t\tfor x := 1; x < b; x++ {\n\t\t\tlength := absInt(x - b)\n\t\t\tdp[(move & 1) ^ 1][x] = dp[(move & 1) ^ 1][x - 1]\n\t\t\tif length != 1 {\n\t\t\t\tleft := maxInt(x - (length - 1), 1)\n\t\t\t\tright := minInt(x + (length - 1), b - 1)\n\t\t\t\tadd := dp[(move & 1)][right] - dp[(move & 1)][left - 1]\n\t\t\t\tif add < 0 {\n\t\t\t\t\tadd += MOD\n\t\t\t\t}\n\t\t\t\tsub := dp[(move & 1)][x] - dp[(move & 1)][x - 1]\n\t\t\t\tif sub < 0 {\n\t\t\t\t\tsub += MOD\n\t\t\t\t}\n\t\t\t\tdiff := add - sub\n\t\t\t\tif diff < 0 {\n\t\t\t\t\tdiff += MOD\n\t\t\t\t}\n\t\t\t\tdp[(move & 1) ^ 1][x] += diff \n\t\t\t\tif dp[(move & 1) ^ 1][x] >= MOD {\n\t\t\t\t\tdp[(move & 1) ^ 1][x] -= MOD \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n//\tlogln(dp)\n\tans := dp[((movesNum - 1) & 1) ^ 1][a] - dp[((movesNum - 1) & 1) ^ 1][a - 1]\n\tif ans < 0 {\n\t\tans += MOD\n\t}\n\tprintInt(ans)\n\tprintLine()\n\n\n}\n\n// ********************************* CODE ENDS *********************************\n\n// IO.\n\nvar (\n\tscanner *Scanner\n\twriter *bufio.Writer\n)\n\nfunc main() {\n\tinput := os.Stdin\n\toutput := os.Stdout\n\t//\tinput, _ := os.Open(\"\")\n\t//\toutput, _ := os.Create(\"\")\n\n\tdefer input.Close()\n\tdefer output.Close()\n\n\tscanner = NewScanner(input)\n\tscanner.Split(bufio.ScanWords)\n\n\twriter = bufio.NewWriter(output)\n\tdefer writer.Flush()\n\n\trand.Seed(int64(time.Now().Nanosecond()))\n\tsolve()\n}\n\n// Read.\n\nfunc readString() string {\n\tscanner.Scan()\n\tans := scanner.Text()\n\treturn ans\n}\n\nfunc readLine() string {\n\tscanner.Split(bufio.ScanLines)\n\tdefer scanner.Split(bufio.ScanWords)\n\treturn readString()\n}\n\nfunc readInt() int {\n\tans, _ := strconv.ParseInt(readString(), 10, 0)\n\treturn int(ans)\n}\n\nfunc readInt64() int64 {\n\tans, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn ans\n}\n\nfunc readFloat64() float64 {\n\tans, _ := strconv.ParseFloat(readString(), 64)\n\treturn ans\n}\n\n// Write.\n\nfunc printString(value string) {\n\twriter.WriteString(value)\n}\n\nfunc printLine() {\n\tprintString(\"\\n\")\n}\n\nfunc printSpace() {\n\tprintString(\" \")\n}\n\nfunc printInt(value int) {\n\tprintString(strconv.FormatInt(int64(value), 10))\n}\n\nfunc printInt64(value int64) {\n\tprintString(strconv.FormatInt(value, 10))\n}\n\nfunc printFloat64(value float64) {\n\tprintString(strconv.FormatFloat(value, 'f', 20, 64))\n}\n\n// Tuple\n\ntype Tuple struct {\n\ta, b int\n}\n\nfunc (p Tuple) Equals(key Key) bool {\n\treturn p.a == key.(Tuple).a\n}\n\nfunc (p Tuple) Less(key Key) bool {\n\treturn p.a < key.(Tuple).a\n}\n\n// Sorting\n\ntype TupleSlice []Tuple\n\nfunc (p TupleSlice) Len() int {\n\treturn len(p)\n}\n\nfunc (p TupleSlice) Less(j, i int) bool {\n\tif p[j].a == p[i].a {\n\t\treturn p[j].b < p[i].b\n\t} else {\n\t\treturn p[j].a < p[i].a\n\t}\n}\n\nfunc (p TupleSlice) Swap(j, i int) {\n\tp[j], p[i] = p[i], p[j]\n}\n\n// Min, max, abs.\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 a\n\t} else {\n\t\treturn b\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 maxInt64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc absInt64(a int64) int64 {\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 a\n\t} else {\n\t\treturn b\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\n// Set Key interface implementations.\n\ntype Int int\n\nfunc (p Int) Equals(key Key) bool {\n\treturn int(p) == int(key.(Int))\n}\n\nfunc (p Int) Less(key Key) bool {\n\treturn int(p) < int(key.(Int))\n}\n\n// Set.\n\ntype Key interface {\n\tEquals(key Key) bool\n\tLess(key Key) bool\n}\n\ntype node struct {\n\tkey Key\n\tleft *node\n\tright *node\n}\n\nfunc newNode(key Key) *node {\n\treturn &node{key, nil, nil}\n}\n\ntype SplayTree struct {\n\troot *node\n\ttmp *node\n\tlen int\n}\n\nfunc NewSplayTree() *SplayTree {\n\treturn &SplayTree{nil, newNode(nil), 0}\n}\n\nfunc rotateLeft(x, p *node) {\n\tp.right = x.left\n\tx.left = p\n}\n\nfunc rotateRight(x, p *node) {\n\tp.left = x.right\n\tx.right = p\n}\n\nfunc (p *SplayTree) splay(x *node, key Key) *node {\n\tif x == nil {\n\t\treturn nil\n\t}\n\n\tleft := p.tmp\n\tright := p.tmp\n\n\tfor {\n\t\tif key.Less(x.key) {\n\t\t\ty := x.left\n\t\t\tif y == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif key.Less(y.key) { // zig-zig\n\t\t\t\trotateRight(y, x)\n\t\t\t\tx = y\n\t\t\t\tif x.left == nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// link right\n\t\t\tright.left = x\n\t\t\tright = x\n\t\t\t// move left\n\t\t\tx = x.left\n\t\t} else if x.key.Less(key) {\n\t\t\ty := x.right\n\t\t\tif y == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif y.key.Less(key) { // zig-zig\n\t\t\t\trotateLeft(y, x)\n\t\t\t\tx = y\n\t\t\t\tif x.right == nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// link left\n\t\t\tleft.right = x\n\t\t\tleft = x\n\t\t\t// move right\n\t\t\tx = x.right\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tleft.right = x.left\n\tright.left = x.right\n\tx.left = p.tmp.right\n\tx.right = p.tmp.left\n\n\treturn x\n}\n\n// left <= key < right\nfunc (p *SplayTree) split(key Key) (left, right *node) {\n\tp.root = p.splay(p.root, key)\n\tif p.root.key.Equals(key) || p.root.key.Less(key) {\n\t\tright := p.root.right\n\t\tp.root.right = nil\n\t\treturn p.root, right\n\t} else {\n\t\tleft := p.root.left\n\t\tp.root.left = nil\n\t\treturn left, p.root\n\t}\n}\n\n// keys from left tree must be less then keys from right tree\nfunc (p *SplayTree) join(left, right *node) *node {\n\tif left == nil {\n\t\treturn right\n\t} else if right == nil {\n\t\treturn left\n\t}\n\tleft = p.splay(left, right.key)\n\tleft.right = right\n\treturn left\n}\n\ntype Set interface {\n\tLen() int\n\tInsert(key Key) error\n\tFind(key Key) bool\n\tRemove(key Key) error\n}\n\nfunc NewSet() Set {\n\treturn Set(NewSplayTree())\n}\n\nfunc (p *SplayTree) Len() int {\n\treturn p.len\n}\n\nfunc (p *SplayTree) Insert(key Key) error {\n\tif p.root == nil {\n\t\tp.root = newNode(key)\n\t\tp.len++\n\t} else {\n\t\tp.root = p.splay(p.root, key)\n\t\tif p.root.key.Equals(key) {\n\t\t\treturn errors.New(\"Such key already exists\")\n\t\t} else {\n\t\t\tleft, right := p.split(key)\n\t\t\tp.root = newNode(key)\n\t\t\tp.root.left = left\n\t\t\tp.root.right = right\n\t\t\tp.len++\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (p *SplayTree) Find(key Key) bool {\n\tif p.root == nil {\n\t\treturn false\n\t}\n\tp.root = p.splay(p.root, key)\n\treturn p.root.key.Equals(key)\n}\n\nfunc (p *SplayTree) Remove(key Key) error {\n\tp.root = p.splay(p.root, key)\n\tif p.root == nil || !p.root.key.Equals(key) {\n\t\treturn errors.New(\"Such key doesn't exist\")\n\t}\n\tp.root = p.join(p.split(key))\n\treturn nil\n}\n\n// Copied scan.go\n// Scanner provides a convenient interface for reading data such as\n// a file of newline-delimited lines of text. Successive calls to\n// the Scan method will step through the 'tokens' of a file, skipping\n// the bytes between the tokens. The specification of a token is\n// defined by a split function of type SplitFunc; the default split\n// function breaks the input into lines with line termination stripped. Split\n// functions are defined in this package for scanning a file into\n// lines, bytes, UTF-8-encoded runes, and space-delimited words. The\n// client may instead provide a custom split function.\n//\n// Scanning stops unrecoverably at EOF, the first I/O error, or a token too\n// large to fit in the buffer. When a scan stops, the reader may have\n// advanced arbitrarily far past the last token. Programs that need more\n// control over error handling or large tokens, or must run sequential scans\n// on a reader, should use bufio.Reader instead.\n//\ntype Scanner struct {\n\tr io.Reader // The reader provided by the client.\n\tsplit SplitFunc // The function to split the tokens.\n\tmaxTokenSize int // Maximum size of a token; modified by tests.\n\ttoken []byte // Last token returned by split.\n\tbuf []byte // Buffer used as argument to split.\n\tstart int // First non-processed byte in buf.\n\tend int // End of data in buf.\n\terr error // Sticky error.\n}\n\n// SplitFunc is the signature of the split function used to tokenize the\n// input. The arguments are an initial substring of the remaining unprocessed\n// data and a flag, atEOF, that reports whether the Reader has no more data\n// to give. The return values are the number of bytes to advance the input\n// and the next token to return to the user, plus an error, if any. If the\n// data does not yet hold a complete token, for instance if it has no newline\n// while scanning lines, SplitFunc can return (0, nil, nil) to signal the\n// Scanner to read more data into the slice and try again with a longer slice\n// starting at the same point in the input.\n//\n// If the returned error is non-nil, scanning stops and the error\n// is returned to the client.\n//\n// The function is never called with an empty data slice unless atEOF\n// is true. If atEOF is true, however, data may be non-empty and,\n// as always, holds unprocessed text.\ntype SplitFunc func(data []byte, atEOF bool) (advance int, token []byte, err error)\n\n// Errors returned by Scanner.\nvar (\n\tErrTooLong = errors.New(\"bufio.Scanner: token too long\")\n\tErrNegativeAdvance = errors.New(\"bufio.Scanner: SplitFunc returns negative advance count\")\n\tErrAdvanceTooFar = errors.New(\"bufio.Scanner: SplitFunc returns advance count beyond input\")\n)\n\nconst (\n\t// Maximum size used to buffer a token. The actual maximum token size\n\t// may be smaller as the buffer may need to include, for instance, a newline.\n\tMaxScanTokenSize = 1 << 20\n)\n\n// NewScanner returns a new Scanner to read from r.\n// The split function defaults to ScanLines.\nfunc NewScanner(r io.Reader) *Scanner {\n\treturn &Scanner{\n\t\tr: r,\n\t\tsplit: ScanLines,\n\t\tmaxTokenSize: MaxScanTokenSize,\n\t\tbuf: make([]byte, 4096), // Plausible starting size; needn't be large.\n\t}\n}\n\n// Err returns the first non-EOF error that was encountered by the Scanner.\nfunc (s *Scanner) Err() error {\n\tif s.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn s.err\n}\n\n// Bytes returns the most recent token generated by a call to Scan.\n// The underlying array may point to data that will be overwritten\n// by a subsequent call to Scan. It does no allocation.\nfunc (s *Scanner) Bytes() []byte {\n\treturn s.token\n}\n\n// Text returns the most recent token generated by a call to Scan\n// as a newly allocated string holding its bytes.\nfunc (s *Scanner) Text() string {\n\treturn string(s.token)\n}\n\n// Scan advances the Scanner to the next token, which will then be\n// available through the Bytes or Text method. It returns false when the\n// scan stops, either by reaching the end of the input or an error.\n// After Scan returns false, the Err method will return any error that\n// occurred during scanning, except that if it was io.EOF, Err\n// will return nil.\nfunc (s *Scanner) Scan() bool {\n\t// Loop until we have a token.\n\tfor {\n\t\t// See if we can get a token with what we already have.\n\t\tif s.end > s.start {\n\t\t\tadvance, token, err := s.split(s.buf[s.start:s.end], s.err != nil)\n\t\t\tif err != nil {\n\t\t\t\ts.setErr(err)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !s.advance(advance) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ts.token = token\n\t\t\tif token != nil {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t// We cannot generate a token with what we are holding.\n\t\t// If we've already hit EOF or an I/O error, we are done.\n\t\tif s.err != nil {\n\t\t\t// Shut it down.\n\t\t\ts.start = 0\n\t\t\ts.end = 0\n\t\t\treturn false\n\t\t}\n\t\t// Must read more data.\n\t\t// First, shift data to beginning of buffer if there's lots of empty space\n\t\t// or space is neded.\n\t\tif s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf)/2) {\n\t\t\tcopy(s.buf, s.buf[s.start:s.end])\n\t\t\ts.end -= s.start\n\t\t\ts.start = 0\n\t\t}\n\t\t// Is the buffer full? If so, resize.\n\t\tif s.end == len(s.buf) {\n\t\t\tif len(s.buf) >= s.maxTokenSize {\n\t\t\t\ts.setErr(ErrTooLong)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tnewSize := len(s.buf) * 2\n\t\t\tif newSize > s.maxTokenSize {\n\t\t\t\tnewSize = s.maxTokenSize\n\t\t\t}\n\t\t\tnewBuf := make([]byte, newSize)\n\t\t\tcopy(newBuf, s.buf[s.start:s.end])\n\t\t\ts.buf = newBuf\n\t\t\ts.end -= s.start\n\t\t\ts.start = 0\n\t\t\tcontinue\n\t\t}\n\t\t// Finally we can read some input. Make sure we don't get stuck with\n\t\t// a misbehaving Reader. Officially we don't need to do this, but let's\n\t\t// be extra careful: Scanner is for safe, simple jobs.\n\t\tfor loop := 0; ; {\n\t\t\tn, err := s.r.Read(s.buf[s.end:len(s.buf)])\n\t\t\ts.end += n\n\t\t\tif err != nil {\n\t\t\t\ts.setErr(err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif n > 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tloop++\n\t\t\tif loop > 100 {\n\t\t\t\ts.setErr(io.ErrNoProgress)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n// advance consumes n bytes of the buffer. It reports whether the advance was legal.\nfunc (s *Scanner) advance(n int) bool {\n\tif n < 0 {\n\t\ts.setErr(ErrNegativeAdvance)\n\t\treturn false\n\t}\n\tif n > s.end-s.start {\n\t\ts.setErr(ErrAdvanceTooFar)\n\t\treturn false\n\t}\n\ts.start += n\n\treturn true\n}\n\n// setErr records the first error encountered.\nfunc (s *Scanner) setErr(err error) {\n\tif s.err == nil || s.err == io.EOF {\n\t\ts.err = err\n\t}\n}\n\n// Split sets the split function for the Scanner. If called, it must be\n// called before Scan. The default split function is ScanLines.\nfunc (s *Scanner) Split(split SplitFunc) {\n\ts.split = split\n}\n\n// Split functions\n\n// ScanBytes is a split function for a Scanner that returns each byte as a token.\nfunc ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif atEOF && len(data) == 0 {\n\t\treturn 0, nil, nil\n\t}\n\treturn 1, data[0:1], nil\n}\n\nvar errorRune = []byte(string(utf8.RuneError))\n\n// ScanRunes is a split function for a Scanner that returns each\n// UTF-8-encoded rune as a token. The sequence of runes returned is\n// equivalent to that from a range loop over the input as a string, which\n// means that erroneous UTF-8 encodings translate to U+FFFD = \"\\xef\\xbf\\xbd\".\n// Because of the Scan interface, this makes it impossible for the client to\n// distinguish correctly encoded replacement runes from encoding errors.\nfunc ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif atEOF && len(data) == 0 {\n\t\treturn 0, nil, nil\n\t}\n\n\t// Fast path 1: ASCII.\n\tif data[0] < utf8.RuneSelf {\n\t\treturn 1, data[0:1], nil\n\t}\n\n\t// Fast path 2: Correct UTF-8 decode without error.\n\t_, width := utf8.DecodeRune(data)\n\tif width > 1 {\n\t\t// It's a valid encoding. Width cannot be one for a correctly encoded\n\t\t// non-ASCII rune.\n\t\treturn width, data[0:width], nil\n\t}\n\n\t// We know it's an error: we have width==1 and implicitly r==utf8.RuneError.\n\t// Is the error because there wasn't a full rune to be decoded?\n\t// FullRune distinguishes correctly between erroneous and incomplete encodings.\n\tif !atEOF && !utf8.FullRune(data) {\n\t\t// Incomplete; get more bytes.\n\t\treturn 0, nil, nil\n\t}\n\n\t// We have a real UTF-8 encoding error. Return a properly encoded error rune\n\t// but advance only one byte. This matches the behavior of a range loop over\n\t// an incorrectly encoded string.\n\treturn 1, errorRune, nil\n}\n\n// dropCR drops a terminal \\r from the data.\nfunc dropCR(data []byte) []byte {\n\tif len(data) > 0 && data[len(data)-1] == '\\r' {\n\t\treturn data[0 : len(data)-1]\n\t}\n\treturn data\n}\n\n// ScanLines is a split function for a Scanner that returns each line of\n// text, stripped of any trailing end-of-line marker. The returned line may\n// be empty. The end-of-line marker is one optional carriage return followed\n// by one mandatory newline. In regular expression notation, it is `\\r?\\n`.\n// The last non-empty line of input will be returned even if it has no\n// newline.\nfunc ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif atEOF && len(data) == 0 {\n\t\treturn 0, nil, nil\n\t}\n\tif i := bytes.IndexByte(data, '\\n'); i >= 0 {\n\t\t// We have a full newline-terminated line.\n\t\treturn i + 1, dropCR(data[0:i]), nil\n\t}\n\t// If we're at EOF, we have a final, non-terminated line. Return it.\n\tif atEOF {\n\t\treturn len(data), dropCR(data), nil\n\t}\n\t// Request more data.\n\treturn 0, nil, nil\n}\n\n// isSpace reports whether the character is a Unicode white space character.\n// We avoid dependency on the unicode package, but check validity of the implementation\n// in the tests.\nfunc isSpace(r rune) bool {\n\tif r <= '\\u00FF' {\n\t\t// Obvious ASCII ones: \\t through \\r plus space. Plus two Latin-1 oddballs.\n\t\tswitch r {\n\t\tcase ' ', '\\t', '\\n', '\\v', '\\f', '\\r':\n\t\t\treturn true\n\t\tcase '\\u0085', '\\u00A0':\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\t// High-valued ones.\n\tif '\\u2000' <= r && r <= '\\u200a' {\n\t\treturn true\n\t}\n\tswitch r {\n\tcase '\\u1680', '\\u180e', '\\u2028', '\\u2029', '\\u202f', '\\u205f', '\\u3000':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ScanWords is a split function for a Scanner that returns each\n// space-separated word of text, with surrounding spaces deleted. It will\n// never return an empty string. The definition of space is set by\n// unicode.IsSpace.\nfunc ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\t// Skip leading spaces.\n\tstart := 0\n\tfor width := 0; start < len(data); start += width {\n\t\tvar r rune\n\t\tr, width = utf8.DecodeRune(data[start:])\n\t\tif !isSpace(r) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif atEOF && len(data) == 0 {\n\t\treturn 0, nil, nil\n\t}\n\t// Scan until space, marking end of word.\n\tfor width, i := 0, start; i < len(data); i += width {\n\t\tvar r rune\n\t\tr, width = utf8.DecodeRune(data[i:])\n\t\tif isSpace(r) {\n\t\t\treturn i + width, data[start:i], nil\n\t\t}\n\t}\n\t// If we're at EOF, we have a final, non-empty, non-terminated word. Return it.\n\tif atEOF && len(data) > start {\n\t\treturn len(data), data[start:], nil\n\t}\n\t// Request more data.\n\treturn 0, nil, nil\n}", "lang": "Go", "bug_code_uid": "96ef4d9533c2700492e9f0d65e9008ca", "src_uid": "142b06ed43b3473513995de995e19fc3", "apr_id": "314b0b2d8b03b384637e20ebdaa3e926", "difficulty": 1900, "tags": ["dp", "combinatorics", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9992821249102656, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n )\n\nvar a [100000]int\nvar l, r int\nvar ans, ans1, j int64\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\", &l, &r)\n\tnum:=0\n\tans=1\n for i:=0; i<=30; i++{\n a[num]=int(ans)\n num++\n ans1=ans\n for (ans1=i){\n fmt.Printf(\"%d\", j-i)\n \n } else{\n fmt.Printf(\"%d\", 0)\n }\n}", "lang": "Go", "bug_code_uid": "155cdf429228f429867f523adfbfca3c", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "cc5a9b3ab02ceead90a77a13ff35f123", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6509316770186335, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n )\n \nvar log3 = math.Log2(3.0) \nvar l,r float64 \nfunc find_divs(upper float64, num float64) int {\n var total_num int \n for i := int(upper); i>0; i-- {\n d := num/math.Pow(3,float64(i))\n total_num += int(math.Log2(d))\n }\n return total_num\n}\nfunc main(){\n\tfmt.Scanf(\"%f %f\", &l, &r)\n\tr2max := math.Log2(r)\n r3max := r2max/log3\n r2min := math.Log2(l)\n r3min := r2min/log3 \n var extra int\n if l == 1 {\n extra = 1\n } else {\n extra = 0\n }\n var total23divs int \n total23divs = find_divs(r3max, r) - find_divs(r3min, l)\n total := int(r2max) + int(r3max) - int(r2min) - int(r3min) + total23divs + extra\n\tfmt.Println( total)\n}", "lang": "Go", "bug_code_uid": "9836cc5ae363ec6e9d8d688e75e3ac14", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "4da7ca087f4cd679a780e7354adf4340", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.984646878198567, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nRashidov_Anis\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n var afl int64\n var bfa int64\n var lrt int64\n var rgh int64\n var cnt int64\n afl = 1\n bfa = 1\n cnt = 0\n\tfmt.Scan(&lrt)\n\tfmt.Scan(&rgh)\n\tfor it := 0; it <= 19; it++ {\n\t bfa = 1\n\t for jt := 0; jt <= 30; jt ++ {\n\t if afl * bfa >= lrt {\n\t if afl * bfa <= rgh {\n\t cnt = cnt + 1\n\t }\n\t }\n\t bfa = bfa * 2\n\t }\n\t afl = afl * 3\n\t}\n\tfmt.Printf( \"%d\", cnt )\n}", "lang": "Go", "bug_code_uid": "8c7b78ee5782b82377683c60c1956d50", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "4636ef7a1fd9513c9d424ff94682ad49", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9871812931398789, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\n arr := [326]int{1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632 }\n \n var L int\n var R int\n \n fmt.Scan(&L)\n fmt.Scan(&R)\n //fmt.Print(arr[0])\n \n var l int\n var r int\n \n l = 0\n r = 325\n \n for l != r {\n mid := (l + r) / 2\n if arr[mid] >= L {\n r = mid\n }\n if arr[mid] < L {\n l = mid + 1\n }\n }\n \n lb := l\n \n l = 0\n r = 325\n \n for l != r {\n mid := (l + r) / 2\n if mid == l{\n mid += 1\n }\n if arr[mid] <= R {\n l = mid\n }\n if arr[mid] > R {\n r = mid - 1\n }\n }\n \n rb := l\n \n fmt.Print(rb - lb + 1)\n}", "lang": "Go", "bug_code_uid": "3a84179e218c047182f8bd5e562fbdea", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "6404b96196e1a1f833a8cea1150fe1f7", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.19400544959128066, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Node struct {\n\tsta int\n\tele int\n\tsum int\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\n\treturn y\n}\n\nfunc main() {\n\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, k int\n\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &k)\n\n\tg := [200][200]int{}\n\ta := make([]int, n+1)\n\n\tfor i := 0; i < n; i++ {\n\t\tif i+1 != n {\n\t\t\tfmt.Fscanf(reader, \"%d\", &a[i])\n\t\t} else {\n\t\t\tfmt.Fscanf(reader, \"%d\\n\", &a[i])\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tg[i][j] = 100000\n\t\t\tif i == j {\n\t\t\t\tg[i][j] = 0\n\t\t\t}\n\t\t}\n\t}\n\n\tx, y := 0, 0\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fscanf(reader, \"%d %d\\n\", &x, &y)\n\t\tx--\n\t\ty--\n\t\tg[x][y] = 1\n\t\tg[y][x] = 1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif j == i {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tg[i][j] = min(g[i][j], g[i][k]+g[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\t// for i := 0; i < n; i++ {\n\t// \tfor j := 0; j < n; j++ {\n\t// \t\tfmt.Printf(\"%6d \", g[i][j])\n\t// \t}\n\n\t// \tfmt.Println()\n\t// }\n\tans := make(map[int]map[int]bool)\n\tans[0] = make(map[int]bool)\n\tfor i := 0; i < n; i++ {\n\t\ttmp := make(map[int]map[int]bool)\n\n\t\tfor w, v := range ans {\n\t\t\tok := true\n\t\t\tset := make(map[int]bool)\n\t\t\tfor p, _ := range v {\n\t\t\t\tif g[i][p] <= k {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tset[p] = true\n\t\t\t}\n\n\t\t\tif ok {\n\t\t\t\tset[i] = true\n\t\t\t\ttmp[w+a[i]] = set\n\t\t\t}\n\t\t}\n\n\t\tfor w, v := range tmp {\n\t\t\tans[w] = v\n\t\t}\n\t}\n\n\tansans := 0\n\tfor w, _ := range ans {\n\t\tif w > ansans {\n\t\t\tansans = w\n\t\t}\n\t}\n\n\tfmt.Println(ansans)\n}\n", "lang": "Go", "bug_code_uid": "4b0b387bc8df9be507d62c06ecc488d7", "src_uid": "9e86d87ce5a75c6a982894af84eb4ba8", "apr_id": "a3f3f6cb55b481ab6a30109ddb51a330", "difficulty": 1600, "tags": ["math", "brute force", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.43768400392541706, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, p int64\n\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &p)\n\n\ta := make([]int64, 0, 32)\n\tfor i := 0; i < 32; i++ {\n\t\tt := (1 << uint(i)) + p\n\t\tif t >= n+1000 {\n\t\t\tbreak\n\t\t}\n\t\tif t != 0 {\n\t\t\ta = append(a, t)\n\t\t}\n\t}\n\n\tans := make(map[int64]int)\n\tans[0] = 0\n\n\tfor {\n\t\ttmp := make(map[int64]int, 2*len(ans))\n\t\tfor k, v := range ans {\n\t\t\tfor i := 0; i < len(a); i++ {\n\t\t\t\tif k+a[i] == n {\n\t\t\t\t\tfmt.Println(v + 1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif k+a[i] <= n+1000 {\n\t\t\t\t\ttmp[k+a[i]] = v + 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tans = tmp\n\t\tif len(ans) == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\n\t\t//fmt.Println(ans)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "46937dc248d2c0a0fc3aa58e37948f65", "src_uid": "9e86d87ce5a75c6a982894af84eb4ba8", "apr_id": "a3f3f6cb55b481ab6a30109ddb51a330", "difficulty": 1600, "tags": ["math", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7068676716917923, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "// 265A-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s, inst string\n pos := 1\n r := 0\n fmt.Scan(&s)\n fmt.Scan(&inst)\n for i := 0; i < len(inst); i++ {\n if inst[i] == s[r] {\n if pos != len(s)-1 {\n r++\n pos++\n }\n }\n }\n fmt.Println(pos)\n}\n", "lang": "Go", "bug_code_uid": "2bbab8e91bcba12305ce4a8a9df47e9b", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "fe56a2d8ef8ee79cc917e786bb61efd0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9953703703703703, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar a, b, c , d int\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\\n\", &a, &b, &c, &d);\n\tif c != 0{\n\t\ta--\n\t\td--\n\t}\n\tif a > 0 && d > 0 && a == d{\n\t\tfmt.Println(1)\n\t}else{\n\t\tfmt.Println(0)\n\t}\n}", "lang": "Go", "bug_code_uid": "cc937dc39920da4b126552ba22b5ce89", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "40e1a1dfb1dcd095cb515c4234f0de12", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9689119170984456, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1132A(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar a, b, c, d int\n\tFscan(in, &a, &b, &c, &d)\n\tif a != d || a+d < c {\n\t\tFprint(out, 0)\n\t} else {\n\t\tFprint(out, 1)\n\t}\n}\n\nfunc main() { CF1132A(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "cbfbce0afdc39614a09798152908c15f", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "5c29899ef13e2c036ea8de2c30df358e", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.958981612446959, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nconst mod int64 = 1e9 + 7\n\ntype matrix [][]int64\n\nfunc newMatrix(n int) matrix {\n\tmat := make(matrix, n)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, n)\n\t}\n\treturn mat\n}\n\nfunc newMatrixI(n int) matrix {\n\tmat := make(matrix, n)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, n)\n\t\tmat[i][i] = 1\n\t}\n\treturn mat\n}\n\nfunc (a matrix) mul(b matrix) matrix {\n\tc := newMatrix(len(a))\n\tfor i := range a {\n\t\tfor j := range b[0] {\n\t\t\tfor k, aik := range a[i] {\n\t\t\t\tc[i][j] += aik * b[k][j] % mod\n\t\t\t}\n\t\t\tc[i][j] %= mod\n\t\t}\n\t}\n\treturn c\n}\n\nfunc (a matrix) pow(k int64) matrix {\n\tres := newMatrixI(len(a))\n\tfor ; k > 0; k >>= 1 {\n\t\tif k&1 == 1 {\n\t\t\tres = res.mul(a)\n\t\t}\n\t\ta = a.mul(a)\n\t}\n\treturn res\n}\n\nfunc CF1117D(in io.Reader, out io.Writer) {\n\tvar n, m int64\n\tFscan(in, &n, &m)\n\tif n < m {\n\t\tFprint(out, 1)\n\t\treturn\n\t}\n\ta := newMatrix(int(m))\n\ta[0][0] = 1\n\ta[0][m-1] = 1\n\ta[m-1][0] = 1\n\tFprint(out, a.pow(n)[0][0])\n}\n\nfunc main() { CF1117D(os.Stdin, os.Stdout) }\n", "lang": "Go", "bug_code_uid": "09c85fbbfe4de6b4ae322b91139fcab4", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "apr_id": "a3f83d3f4ffb7a2d704f24be8bd8517b", "difficulty": 2100, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9923076923076923, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"os\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc count(n int64) int64 {\n\tif n < 10 {\n\t\treturn int64(n)\n\t}\n\tvar l, p int64 = 1, 1\n\tfor p * 10 <= n {\n\t\tl++\n\t\tp *= 10\n\t}\n\n\treturn l * (n / p) * (n % p + 1) + count(p - 1)\n}\n\nfunc main() {\n\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tfmt.Fprintln(out, count(NextInt64()))\n}\n\nfunc Next() string{\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn in.Text()\n}\n\nfunc NextInt() int{\n\tret, _ := strconv.Atoi(Next())\n\treturn ret\n}\n\nfunc NextInt64() int64 {\n\tret, _ := strconv.ParseInt(Next(), 10, 64)\n\treturn ret\n}", "lang": "Go", "bug_code_uid": "2b87db3859561ad58c235a81903049bf", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "6376ab4c810b2e0ae1f58330c60a1f74", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.935064935064935, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //io\n scanner := bufio.NewReader(os.Stdin)\n writer := bufio.NewWriter(os.Stdout)\n //---\n var n, d, c, ans int\n \n fmt.Fscan(scanner, &n)\n for c = 1; c <= n; c *= 10 {\n d++\n }\n //writer.WriteString(strconv.Itoa(c))\n c /= 10\n b := d\n ans = (n - c) * d;\n for d > 0 {\n ans += (c - c / 10) * (b-d+1);\n d--\n c /= 10\n }\n \n writer.WriteString(strconv.Itoa(ans))\n writer.Flush()\n}", "lang": "Go", "bug_code_uid": "1543ab00489698d733e6a27cfc2c0f2f", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "5efd2c813a45c9552c6f500fb308fedf", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.892578125, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int\n\tfmt.Scanf(\"%d\", &input)\n\tdigits := countDigits(input)\n\trem := (input - pow10(digits-1) + 1) * digits\n\tres := 0\n\tfor i := 1; i < digits; i++ {\n\t\tres += pow10(i) - 1\n\t}\n\tfmt.Println(res + rem)\n}\n\nfunc pow10(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor ; n > 0; n-- {\n\t\t\tres *= 10\n\t\t}\n\t\treturn res\n\t}\n}\n\nfunc countDigits(ub int) int {\n\tcount := 0\n\tfor ; ub > 0; ub /= 10 {\n\t\tcount++\n\t}\n\treturn count\n}\n", "lang": "Go", "bug_code_uid": "4405b6e97813787e54394e4daaec8c35", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "bbe5eab73c083d1313d4b987fd1da3e2", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9740622505985634, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tif len(b) == 0 {\n\t\ttest()\n\t} else {\n\t\tsolve(bytes.NewReader(b), os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int\n\tfmt.Fscanln(r, &n)\n\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\n\tfmt.Fprintln(w, f(cs))\n}\n\nfunc f(cs []int) int {\n\tgs := graphs(cs)\n\n\tif len(gs) == 0 {\n\t\treturn -1\n\t}\n\n\tif len(gs) == 1 {\n\t\treturn gs[0]\n\t}\n\n\tfor i, g := range gs {\n\t\tif g%2 == 0 {\n\t\t\tgs[i] = g / 2\n\t\t}\n\t}\n\n\treturn lcmm(gs...)\n}\n\nfunc graphs(cs []int) []int {\n\tseen := make(map[int]bool, len(cs))\n\n\tvar ls []int\n\n\tfor j, c := range cs {\n\t\ti := j + 1\n\n\t\tif seen[i] {\n\t\t\tcontinue\n\t\t}\n\n\t\tif cs[i-1] == i {\n\t\t\tseen[i] = true\n\t\t\tseen[cs[i-1]] = true\n\t\t\tls = append(ls, 1)\n\t\t\tcontinue\n\t\t}\n\n\t\tl := 2\n\n\t\tfor ; ; l++ {\n\t\t\tseen[c] = true\n\t\t\tnext := cs[c-1]\n\t\t\tif next == i {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seen[next] {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tc = next\n\t\t}\n\t\tseen[i] = true\n\t\tls = append(ls, l)\n\t}\n\treturn ls\n}\n\nfunc gcd(a, b int) int {\n\tfor b > 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(xs ...int) int {\n\tr := 1\n\tfor _, x := range xs {\n\t\tr = lcm(r, x)\n\t}\n\treturn r\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `\n4\n2 3 1 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n4 4 4 4\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n2 1 4 3\n`,\n\t\t\twant: `1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 3 1 5 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n7\n2 3 1 5 6 7 4\n`,\n\t\t\twant: `6`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 4 3 1 2\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n10\n8 10 4 3 2 1 9 6 5 7\n`,\n\t\t\twant: `15`,\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tfmt.Printf(\"=== TEST %d\\n\", i)\n\t\tbuf := new(bytes.Buffer)\n\t\tsolve(strings.NewReader(chomp(tt.in)), buf)\n\t\tif got, want := chomp(buf.String()), chomp(tt.want); got != want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc chomp(s string) string {\n\treturn strings.Trim(s, \"\\n\")\n}\n\nfunc assert(b bool) {\n\tif !b {\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif ok {\n\t\t\tf, _ := os.Open(file)\n\t\t\tdefer f.Close()\n\t\t\ts := bufio.NewScanner(f)\n\t\t\tlnum := 0\n\t\t\tfor s.Scan() {\n\t\t\t\tlnum++\n\t\t\t\tif lnum == line {\n\t\t\t\t\twd, _ := os.Getwd()\n\t\t\t\t\tfname, _ := filepath.Rel(wd, file)\n\t\t\t\t\tfmt.Printf(\"assertion fails: %s:%d: %v\\n\", fname, line, s.Text())\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pow(a, b int) int {\n\tr := 1\n\tfor i := 0; i < b; i++ {\n\t\tr *= a\n\t}\n\treturn r\n}\n", "lang": "Go", "bug_code_uid": "dbef37e56f6ec3dfdcc2d0ade5097e8b", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "9b5b0721e4142f5904551ccd939fabaf", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9983361064891847, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc check(num, i int64) int64 {\n\tvar count, divider int64 = 0, 5\n\n\tfor (i / divider) > 0 {\n\t\tcount += i / divider\n\t\tdivider *= 5\n\t}\n\n\treturn count\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tn, _ := reader.ReadString('\\n')\n\tvar num, result, flag int64\n\tfmt.Sscanf(n, \"%d\", &num)\n\tvar i int64 = 1\n\n\tfor {\n\n\t\tresult = check(num, i)\n\n\t\tif result > num {\n\t\t\tif flag == 0 {\n\t\t\t\tfmt.Print(0)\n\t\t\t}\n\t\t\tbreak\n\t\t} else if result == num {\n\n\t\t\tif flag == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\tflag = 1\n\t\t\t}\n\n\t\t\tfmt.Printf(\"%d \", i)\n\t\t}\n\n\t\ti++\n\t}\n\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "42e6ec8aa47f4123280a220c35b306fa", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "37d75e4923e68702ade23206cd584497", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.4306864064602961, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "n := 0\nfmt.Scanf(\"%d\", &n)\nfor i := 0; i <= 1e5; i++ {\n tmp := i\n c := 0\n for {\n if tmp % 5 {\n break\n }\n tmp /= 5\n c ++\n }\n if c < n {\n continue\n }\n if c == n {\n fmt.Println(\"5\")\n for j := i; j < i + 5; j++ {\n fmt.Print(j, \" \")\n }\n }\n if c > n {\n break\n }\n}", "lang": "Go", "bug_code_uid": "7ea508cb004bceb12ea9db5dbfb61e2d", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "c000006a662dfb11f1e07ed68298445f", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9784366576819407, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\tfmt.Scanf(\"%d\", &n)\n\tc := 0\n\tfor i := 0; i <= 1e5; i+=5 {\n\t\ttmp := i\n\t\tfor {\n\t\t\tif tmp%5 != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttmp /= 5\n\t\t\tc++\n\t\t}\n\t\tif c < n {\n\t\t\tcontinue\n\t\t}\n\t\tif c == n {\n\t\t\tfmt.Println(\"5\")\n\t\t\tfor j := i; j < i+5; j++ {\n\t\t\t\tfmt.Print(j, \" \")\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif c > n {\n\t\t fmt.Println(\"0\")\n\t\t\tbreak\n\t\t}\n\t}\n}", "lang": "Go", "bug_code_uid": "936ea90938140b7571558737370d74fd", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "c000006a662dfb11f1e07ed68298445f", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9973045822102425, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\tfmt.Scanf(\"%d\", &n)\n\tc := 0\n\tfor i := 5; i <= 1e5; i += 5 {\n\t\ttmp := i\n\t\tfor {\n\t\t\tif tmp%5 != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttmp /= 5\n\t\t\tc++\n\t\t}\n\t\tif c < n {\n\t\t\tcontinue\n\t\t}\n\t\tif c == n {\n\t\t\tfmt.Println(\"5\")\n\t\t\tfor j := i; j < i+5; j++ {\n\t\t\t\tfmt.Print(j, \" \")\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif c > n {\n\t\t\tfmt.Println(\"0\")\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "2688b03e15e731a0c2d0146001456df7", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "c000006a662dfb11f1e07ed68298445f", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7939524838012959, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar a int\n\tfor I(&a, \" \") == nil {\n\t\tsolve(a)\n\t}\n}\n\nfunc solve(a int) {\n\tvar in [3][3]int\n\tin[0][0] = a\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tif i != 0 || j != 0 {\n\t\t\t\to := \" \"\n\t\t\t\tif j == 2 {\n\t\t\t\t\to = \"\\n\"\n\t\t\t\t}\n\t\t\t\tI(&in[i][j], o)\n\t\t\t}\n\t\t}\n\t}\n\tvar x [3][3]int\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tx[i][j] = 1\n\t\t}\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfor in[i][j] > 0 {\n\t\t\t\tx[i][j] ^= 1\n\t\t\t\tfor ii := 0; ii < 3; ii++ {\n\t\t\t\t\tif ii != i && ii != j {\n\t\t\t\t\t\tx[ii][j] ^= 1\n\t\t\t\t\t\tx[i][ii] ^= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tin[i][j]--\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tO(x[i][j], \"\")\n\t\t}\n\t\tO(\"\", \"\\n\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "2ca004cd19ebcdcda100a1515e0eff68", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "6823db9a7ccd37120b49c0c7fc6e2e8d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9981470043236566, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar a1,a2,a3,b1,b2,b3,c1,c2,c3 int\n\tfmt.Scan(&a1,&a2,&a3)\n\tfmt.Scan(&b1,&b2,&b3)\n\tfmt.Scan(&c1,&c2,&c3)\n\tif (a1+a2+b1)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tif (a1+a2+a3+b2)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tif (a2+a3+b3)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tfmt.Println()\n\tif (a1+b1+b2+c1)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tif (a2+b1+b3+c2)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tif (a3+b2+b3+c3)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tfmt.Println()\n\tif (b1+c1+c2)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tif (b2+c1+c2+c3)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tif (b3+c2+c3)%2==0 {\n\t\tfmt.Print(\"1\")\n\t} else {fmt.Print(\"0\")}\n\tfmt.Println()\n}\n", "lang": "Go", "bug_code_uid": "0dee778754f9ca2468f4f0ef6c2639aa", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "d14cf33cb0498f3025529a80c799f68f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9619520264681555, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"bytes\"\n)\n\nconst GRID_SIZE = 3\n\ntype Grid [][]bool\n\nfunc main() {\n\tgrid := createSquareGrid(GRID_SIZE)\n\tfor i := 0; i < GRID_SIZE; i++ {\n\t\tfor j := 0; j < GRID_SIZE; j++ {\n\t\t\tvar n int\n\t\t\tfmt.Fscan(os.Stdin, &n)\n\t\t\tgrid.toggleNTimes(i, j, n)\n\t\t}\n\t}\n\tfmt.Print(grid)\n}\n\nfunc createSquareGrid(size int) Grid {\n\tgrid := make(Grid, size)\n\tfor rowIdx := range grid {\n\t\tgrid[rowIdx] = make([]bool, size)\n\t\tfor colIdx := range grid[rowIdx] {\n\t\t\tgrid[rowIdx][colIdx] = true\n\t\t}\n\t}\n\treturn grid\n}\n\nfunc (grid Grid) toggleNTimes(i, j, n int) {\n\tif n <= 0 { return }\n\ttoggle := func(i, j int) { grid[i][j] = !grid[i][j] }\n\ttoggle(i, j)\n\tn = n % 2\n\tif (n > 0) {\n\t\tif i > 0 { toggle(i-1, j) }\n\t\tif j > 0 { toggle(i, j-1) }\n\t\tif i < GRID_SIZE-1 { toggle(i+1, j) }\n\t\tif j < GRID_SIZE-1 { toggle(i, j+1) }\n\t}\n}\n\nfunc (grid Grid) String() string {\n\tvar buffer bytes.Buffer\n\tfor rowIdx := range grid {\n\t\tbuffer.WriteString(boolAsString(grid[rowIdx][0]))\n\t\tfor colIdx := 1; colIdx < len(grid[rowIdx]); colIdx++ {\n\t\t\tbuffer.WriteString(boolAsString(grid[rowIdx][colIdx]))\n\t\t}\n\t\tbuffer.WriteString(\"\\n\")\n\t}\n\treturn buffer.String()\n}\n\nfunc boolAsString(b bool) string {\n\tif b { return \"1\" }\n\treturn \"0\"\n}", "lang": "Go", "bug_code_uid": "d13419604e67cda17cbcdeed408990eb", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "d8e15e6df26400207bab549513296850", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9876712328767123, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x1, y1, x2, y2 int64\n\tfmt.Scanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2)\n\n\tvar dx, dy, num_prim_cols, num_sec_cols, len_prim_cols, len_sec_cols int64\n\tdx = x2 - x1\n\tdy = y2 - y1\n\tnum_prim_cols = dx / 2 + 1 //dx guaranteed to be divisible by 2\n\tnum_sec_cols = num_prim_cols - 1\n\tlen_prim_cols = dy / 2 + 1\n\tlen_sec_cols = 0\n//\tfmt.Printf(\"dx=\\t%d\\ndy=\\t%d\\nprim_cols=\\t%d\\nsec_cols=\\t%d\\n\", dx, dy, num_prim_cols, num_sec_cols)\n\n\tif ( dy % 2 == 0) {\n\t\tlen_sec_cols = dy / 2\n\t} else {\n\t\tlen_sec_cols = dy / 2 + 1\n\t}\n//\tfmt.Printf(\"\\nlen_prim_cols=\\t%d\\nlen_sec_cols=\\t%d\\n\", len_prim_cols, len_sec_cols)\n\t\n\tfmt.Println(\"Total cells = \", num_prim_cols * len_prim_cols + num_sec_cols * len_sec_cols)\n}\n", "lang": "Go", "bug_code_uid": "b2ea26f0f320d4e0ded947e47da93895", "src_uid": "00cffd273df24d1676acbbfd9a39630d", "apr_id": "d453b27e256cb75ecfce86afc530ad3a", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.7058823529411765, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &a)\n\tfor sumdigit(a)%4 != 0 {\n\t\ta += 4 - sumdigit(a)%4\n\t}\n\tfmt.Println(a)\n}\nfunc sumdigit(a int) int {\n\tsum := 0\n\tfor a > 0 {\n\t\tsum += a % 10\n\t\ta /= 10\n\t}\n\treturn sum\n}\n", "lang": "Go", "bug_code_uid": "408b6ff9f2a1bbc1b5ba0657929696b0", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "63689f8accef7974efdbc461bf3bddac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9607535321821036, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(a int) int {\n\tvar d, s int\n\tfor a > 0 {\n\t\td = a % 10\n\t\ts = s + d\n\t\ta = a / 10\n\t}\n\treturn s\n}\n\nfunc main() {\n\tvar a, s, x, n int\n\tfmt.Scan(&a)\n\ts = sum(a)\n\tif s%4 == 0 {\n\t\tfmt.Println(a)\n\t} else {\n\t\tx = 4 - (s % 4)\n\t\tn = a + x\n\t\tfor sum(n)%4 != 0 {\n\t\t\tn = n + x\n\t\t}\n\t\tfmt.Println(n)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "13073610ac282c97c71edd171fa87d40", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "dbfa67c1ecfe3c2090c8277d0f01378e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.995850622406639, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc chk(a int) (bool){\n\tsum :=0 ;\n\tfor; a!=0 ; a/=10{24\n\t\tsum+=a%10\n\t}\n\tif(sum%4==0){\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunc main(){\n\tvar a int\n\tfmt.Scanf(\"%d\",&a)\n\tfor ;!chk(a); a++{}\n\tfmt.Printf(\"%d\",a)\n}\n", "lang": "Go", "bug_code_uid": "af7dd3315ebe981f424016fe48039635", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "8ad416caac19b07152e6e7b60c1220e8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9915611814345991, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc check ( n int ) bool {\n\tres := 0\n\tfor n != 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn n % 4 == 0\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf ( \"%d\", &n )\n\tfor !check ( n ) {\n\t\tn++;\n\t}\n\tfmt.Println ( n )\n}", "lang": "Go", "bug_code_uid": "6b28436693b54d6bca5d8d23253a8e2b", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "9c6b3e6547c903807b3bbd17711ce0a5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9439359267734554, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\ta, b, x, y := scanInt(scanner), scanInt(scanner), scanInt(scanner), scanInt(scanner)\n\tlow, high := 1, 2*1000*1000*1000\n\tfor low != high {\n\t\tk := (low+high)/2\n\t\twriter.WriteString(fmt.Sprintf(\"low = %d, high = %d, k = %d\\n\", low, high, k))\n\t\tdiv_xy := k/(x*y)\n\t\tdiv_x, div_y := k/x - div_xy, k/y - div_xy\n\t\tdiv_neither := k - div_x - div_y - div_xy\n\t\tneed_a, need_b := a - div_y, b - div_x\n\t\tif need_a < 0 {\n\t\t\tneed_a = 0\n\t\t}\n\t\tif need_b < 0 {\n\t\t\tneed_b = 0\n\t\t}\n\t\tif need_a + need_b <= div_neither {\n\t\t\thigh = k\n\t\t} else {\n\t\t\tlow = k+1\n\t\t}\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", low))\n}\n", "lang": "Go", "bug_code_uid": "453d137662576e1a3ddd9eedab97e52a", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "24dafb8fe9f95f28d0e9e9967735ee7f", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.989937106918239, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc ReadString() string {\n\tscanner.Scan()\n\tans := scanner.Text()\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\t//writer.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tp1, p2 := ReadInt32(), ReadInt32()\n\n\tif p1 == 1 && p2 == 1 {\n\t\tPrintInts(0)\n\t\tos.Exit(0)\n\t}\n\n\tcnt := 0\n\tfor p1 > 0 && p2 > 0 {\n\t\tcnt = cnt + 1\n\t\tif p1 > p2 {\n\t\t\tp1 = p1 - 2\n\t\t\tp2 = p2 + 1\n\t\t} else {\n\t\t\tp1 = p1 + 1\n\t\t\tp2 = p2 - 2\n\t\t}\n\t}\n\n\tPrintInts(cnt)\n}\n", "lang": "Go", "bug_code_uid": "dc4485ade0f0864d8d9064113e4a6f2b", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "a1f0f192e77d6ecd8062aff95f721328", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9526431718061674, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n,h,m int\n\tfmt.Scan(&n)\n\tfmt.Scan(&h)\n\tfmt.Scan(&m)\n\tbl := make([]int,n + 1,n + 1)\n\tfor i := 1 ; i <= n ;i++{\n\t\tbl[i] = 100\n\t}\n\tvar x1,x2,x3 int\n\tfor i := 0 ; i < m ;i ++{\n\t\tfmt.Scan(&x1)\n\t\tfmt.Scan(&x2)\n\t\tfmt.Scan(&x3)\n\t\tfor i := x1; i <= x2 ; i++{\n\t\t\tbl[i] = min(bl[i],x3);\n\t\t}\n\n\t}\n\tvar ans int = 0\n\tfor i := 1 ;i <= n ;i ++{\n\t\tif(bl[i] >= 1){\n\t\t\tans += bl[i] * bl[i];\n\t\t}else{\n\t\t\tif(bl[i] == 100){\n\t\t\tans += h * h\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n\n\n}\n", "lang": "Go", "bug_code_uid": "67c23e4c7bb704a84dfa69ccdb55d584", "src_uid": "f22b6dab443f63fb8d2d288b702f20ad", "apr_id": "637970222c1ec32635c78828caf89e70", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9990662931839402, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc I(i interface{}, delim string) {\n\tfmt.Fscanf(r, \"%v\"+delim, i)\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nvar in [4]string\n\nfunc check() bool {\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif in[i][j] == 'x' {\n\t\t\t\tif strings.Contains(in[i], \"xxx\") ||\n\t\t\t\t\t(i+2 < 4 && ((in[i+1][j] == 'x' && in[i+2][j] == 'x') ||\n\t\t\t\t\t\t(j+2 < 4 && in[i+1][j+1] == 'x' && in[i+2][j+2] == 'x') ||\n\t\t\t\t\t\t(i-2 >= 0 && in[i+1][j-1] == 'x' && in[i+2][j-2] == 'x'))) {\n\t\t\t\t\tO(\"YES\", \"\\n\")\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tr = bufio.NewReader(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfor i := 0; i < 4; i++ {\n\t\tI(&in[i], \"\\n\")\n\t}\n\tif check() {\n\t\treturn\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif in[i][j] == '.' {\n\t\t\t\ta := []rune(in[i])\n\t\t\t\ta[j] = 'x'\n\t\t\t\tin[i] = string(a)\n\t\t\t\tif check() {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ta[j] = '.'\n\t\t\t\tin[i] = string(a)\n\t\t\t}\n\t\t}\n\t}\n\tO(\"NO\", \"\\n\")\n}", "lang": "Go", "bug_code_uid": "522bc8fa5fc635fc640b723b900ecf1c", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "dadacce3418b008c67a4a0452b8da0b1", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.926509186351706, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport \"fmt\"\n\nconst size = 4\nconst x = 'x'\nconst dot = '.'\n\nfunc checkVertical(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tif table[i][0] == x && table[i][1] == x && table[i][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[i][1] == x && table[i][2] == x && table[i][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkHorizontal(table [][]rune) bool {\n\tfor j := 0; j < size; j++ {\n\t\tif table[j][0] == x && table[j][1] == x && table[j][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[j][1] == x && table[j][2] == x && table[j][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkDiagonal(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tvar ii, jj int\n\n\t\t\tii = i + 2\n\t\t\tjj = j + 2\n\n\t\t\tif ii < size && jj < size && table[i][j] == x && table[i+1][j+1] == x && table[i+2][j+2] == x {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tii = i + 2\n\t\t\tjj = j - 2\n\n\t\t\tif ii < size && jj >= 0 && table[i][j] == x && table[i+1][j-1] == x && table[i+2][j-2] == x {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\ttable := make([][]rune, size)\n\n\tfor i := 0; i < size; i++ {\n\t\ttable[i] = make([]rune, size)\n\n\t\tvar row string\n\t\tfmt.Scanf(\"%s\\n\", &row)\n\n\t\tfor p, s := range row {\n\t\t\ttable[i][p] = s\n\t\t}\n\t}\n\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif table[i][j] == dot {\n\t\t\t\ttable[i][j] = x\n\t\t\t\tif checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttable[i][j] = dot\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}", "lang": "Go", "bug_code_uid": "32f107571f8c8c04d09c289079ee348a", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "ee8662da9affad5758a02ef1d9a37701", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9939718687206965, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\tvar m int\n\tI(&m, \"\\n\")\n\to := 0\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\ts := \" \"\n\t\tif i == n-1 {\n\t\t\ts = \"\\n\"\n\t\t}\n\t\tI(&t, s)\n\t\tif o+t <= m {\n\t\t\to += t\n\t\t} else {\n\t\t\ti--\n\t\t\tans++\n\t\t\to = 0\n\t\t}\n\t}\n\tO(ans, \"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "7fedf58a632b9f945f417831171e7608", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "9a3c370fbc7a540ea6162aa4336d8c1e", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9404761904761905, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "// cf435a.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// scan input\n\tn := 0 // group count\n\tm := 0 // max load of bus\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tvar groups []int = make([]int, n)\n\tfor idx := 0; idx < len(groups); idx++ {\n\t\tfmt.Scanf(\"%d\", &groups[idx])\n\t}\n\n\t// calc\n\tkilled := 0\n\ttried := 0\n\tfor killed < len(groups) {\n\t\tleft := m\n\t\tfor idx := 0; idx < len(groups) && left > 0; idx++ {\n\t\t\tif groups[idx] > 0 && left >= groups[idx] {\n\t\t\t\tleft -= groups[idx]\n\t\t\t\tgroups[idx] = 0\n\t\t\t\tkilled++\n\t\t\t}\n\t\t}\n\t\ttried++\n\t}\n\t\n\t// output\n\tfmt.Printf(\"%d\\n\", tried)\n}\n", "lang": "Go", "bug_code_uid": "7f536c7184ad2ee10a67faeb8bc02f14", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "ad4a6673b5cce97df55165476bc1e7d1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5975855130784709, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar tramp, c1, c2 string\n\tfmt.Scan(&tramp, &c1, &c2)\n\tif c1[1] == tramp[0] && c2[1] != tramp[0] {\n\t\tfmt.Println(\"YES\")\n\t} else if c1[1] != c2[1] {\n\t\tfmt.Println(\"NO\")\n\t} else if c1[0] > c2[0] {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang": "Go", "bug_code_uid": "486fb273ffa4ca14677242bbcb0c6009", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "400e0460163d31b10f8b9c9b6df6c8e1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8571428571428571, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n*2)\n\tys := make([]int, n*2)\n\tarea := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&xs[2*i], &ys[2*i], &xs[2*i+1], &ys[2*i+1])\n\t\tarea += (xs[2*i+1] - xs[2*i]) * (ys[2*i+1] - ys[2*i])\n\t}\n\tsort.Ints(xs)\n\tsort.Ints(ys)\n\tsquareArea := (xs[2*n-1] - xs[0]) * (ys[2*n-1] - ys[0])\n\tif squareArea == area {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "bd4dba587a7000b1c9997bc4b306797c", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "dce592e0af519d5e499e3226bb218e65", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8956743002544529, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n,x,y int\n fmt.Scan(&n,&x,&y)\n a := int(math.Ceil(float64(y)*float64(n)/100.0))\n fmt.Println(a-x)\n}\n", "lang": "Go", "bug_code_uid": "65ed5462f38418c1e1d879b0ed38d3d2", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "72e3597c54602c5ceb34c6754cd28604", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8009259259259259, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "// 168A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, x, y float64\n fmt.Scan(&n, &x, &y)\n fmt.Println(int(math.Ceil((n*y)/100.0 - x)))\n}\n", "lang": "Go", "bug_code_uid": "43a4dba9b6f11bd01c1b69d7647c54e0", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "e5baa6114037a8220e3e954ecadf18eb", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9885057471264368, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n adults, children := scanInt(scanner), scanInt(scanner)\n if adults == 0 {\n writer.WriteString(\"Impossible\\n\")\n } else {\n minimum, maximum := adults, adults\n if children > adults {\n minimum += children - adults\n }\n if children > 0 {\n maximum += children - 1\n }\n writer.WriteString(fmt.Sprintf(\"%d %d\\n\", minimum, maximum))\n }\n}\n", "lang": "Go", "bug_code_uid": "2d9ff4f49bdff191fcb60185c3467b5e", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "98d80aa8b8d19ca3f78ee0b16706a931", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8837209302325582, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,m int\n fmt.Scan(&n,&m)\n if n == 0 {\n fmt.Println(\"Impossible\")\n } else {\n var min,max int\n if m > n { min = n+(m-n) } else { min = n }\n if m > 0 { max = n+m-1 } else { max = n }\n fmt.Println(min,max)\n }\n}\n", "lang": "Go", "bug_code_uid": "8f9de0e8d68ad6800ba9242b73f9838d", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "9890c34c0e00f0c8ec1fd05d91d76579", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9338103756708408, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc intPow(x int64, y int64) (res int64) {\n\tres = 1\n\tfor i := int64(0); i < y; i++ {\n\t\tres *= x\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n, x, y, numx, numy, t int64\n\tfmt.Scanf(\"%d %d\\n\", &n, &x)\n\tnumx = 0\n\tfor i := int64(1); i <= n; i++ {\n\t\tfmt.Scanf(\"%d\", &t)\n\t\tnumx += t * intPow(x, (n-i))\n\t}\n\n\tfmt.Scanf(\"%d %d\\n\", &n, &y)\n\tfmt.Println(n, y)\n\treturn\n\tnumy = 0\n\tfor i := int64(1); i <= n; i++ {\n\t\tfmt.Scanf(\"%d\", &t)\n\t\tnumy += t * intPow(y, (n-i))\n\t}\n\n\tif numx == numy {\n\t\tfmt.Println(\"=\")\n\t} else if numx < numy {\n\t\tfmt.Println(\"<\")\n\t} else {\n\t\tfmt.Println(\">\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "4c0f94d776210dd254a4b20d045a864f", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "32e6606047f6935102345248d2dd97fc", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9243697478991597, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tx := calcNum(reader)\n\ty := calcNum(reader)\n\tif x < y {\n\t\tprint(\"<\")\n\t} else if x > y {\n\t\tprint(\">\")\n\t} else {\n\t\tprint(\"=\")\n\t}\n}\n\nfunc calcNum(reader *bufio.Reader) int64 {\n\tl1, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tl2, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tb, err := strconv.ParseInt(strings.Fields(l1)[1], 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdigits := strings.Fields(l2)\n\tn := int64(0)\n\tfor _, d := range digits {\n\t\tdig, err := strconv.ParseInt(d, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tn = n*b + dig\n\t}\n\treturn n\n}\n", "lang": "Go", "bug_code_uid": "bea4eed68ed0115715ad29ade046e529", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "d34ff4c4c08cff24c7c89589684eca80", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.929616724738676, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tx := calcNum(reader)\n\ty := calcNum(reader)\n\tif x < y {\n\t\tprint(\"<\")\n\t} else if x > y {\n\t\tprint(\">\")\n\t} else {\n\t\tprint(\"=\")\n\t}\n}\n\nfunc calcNum(reader *bufio.Reader) int64 {\n\tl1, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tl2, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tb, err := strconv.ParseInt(strings.Fields(l1)[1], 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdigits := strings.Fields(l2)\n\tn := int64(0)\n\tfor _, d := range digits {\n\t\tdig, err := strconv.ParseInt(d, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tn = n*b + dig\n\t}\n\treturn n\n}\n", "lang": "Go", "bug_code_uid": "b609251abc269b71fa150a97a4675338", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "d34ff4c4c08cff24c7c89589684eca80", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9840255591054313, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main;\n\nimport (\"io\"; \"bufio\"; \"os\"; \"strconv\")\n\nvar scanner *bufio.Scanner\n\nfunc nextInt() (num int64) {\n var err error\n scanner.Scan()\n num, err = strconv.ParseInt(scanner.Text(), 10, 64)\n if err != nil {\n panic(\"failed converting \"+scanner.Text())\n }\n return num\n}\n\nfunc readNum(digits, base int64) (result int64) {\n for ; digits>0; digits-- {\n result = result*base + nextInt()\n }\n return\n}\n\nfunc main() {\n var inp io.Reader = bufio.NewReader(os.Stdin)\n scanner = bufio.NewScanner(inp)\n scanner.Split(bufio.ScanWords)\n\n X := readNum(nextInt(), nextInt())\n Y := readNum(nextInt(), nextInt())\n if XY {\n println(\">\")\n } else {\n println(\"=\")\n }\n}", "lang": "Go", "bug_code_uid": "6bdbff9379d10c8320aaa98d55918234", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "ac773795424747b89f8e7af5ecb03a51", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.976, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar v [4]int\n\tfmt.Scanf(\"%d %d %d %d\", &v[0], &v[1], &v[2], &v[3])\n\tsort.Ints(v[:])\n\n\tif v[0]+v[3] == v[1]+v[2] ||\n\t\tv[0]+v[1]+v[2] == v[3] {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "dff2d9336c2adef089efda59f38bca18", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "c8975247bf3d25f27bc153d5b53f75a3", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.861812778603269, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a1,a2,a3,a4 int\n\tfmt.Scanf(\"%d%d%d%d\", &a1,&a2,&a3,&a4)\n\n\tsum := a1 + a2 + a3 + a4\n\tif sum % 2 != 0 {\n\t\tfmt.Printf(\"NO\")\n\t} else {\n\t\tif a1 + a2 == sum / 2 || a1 + a3 == sum / 2 || a1 + a4 == sum / 2 {\n\t\t\tfmt.Printf(\"YES\")\n\t\t} else {\n\t\t\tfmt.Printf(\"NO\")\n\t\t}\n\t}\n}", "lang": "Go", "bug_code_uid": "0878f4b983304d43175a7da685717eda", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "4032375ad79a65bb18fb8ae0304994a3", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7785234899328859, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a1,a2,a3,a4 int\n\tfmt.Scanf(\"%d%d%d%d\", &a1,&a2,&a3,&a4)\n\n\tsum := a1 + a2 + a3 + a4\n\tif sum % 2 != 0 {\n\t\tfmt.Printf(\"NO\")\n\t} else {\n\t\tif a1 + a2 == sum / 2 || a1 + a3 == sum / 2 || a1 + a4 == sum / 2 \n\t\t|| a1 == sum / 2 || a2 == sum / 2 || a3 == sum / 2 || a4 == sum / 2 { \n\t\t\tfmt.Printf(\"YES\")\n\t\t} else {\n\t\t\tfmt.Printf(\"NO\")\n\t\t}\n\t}\n}", "lang": "Go", "bug_code_uid": "adfd12698f633f7470d05353da85819a", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "4032375ad79a65bb18fb8ae0304994a3", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8807947019867549, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport(\n \"fmt\"\n \"os\"\n)\n\nvar print = fmt.Println\n\nfunc main(){\n var a,b,c,d int;\n\n fmt.Fscan(os.Stdin, &a,&b,&c,&d);\n\n if(a + b == c + d || a + c == d + b || a + d == b + c){\n print(\"YES\");\n }else {\n print(\"NO\");\n }\n}\n", "lang": "Go", "bug_code_uid": "d7b9e34eb50bdce0b053dbbea397ee33", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "bcb47a6acb1bf7ad885cb8c8f2e6d775", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9839357429718876, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var n, m, k int32;\n fmt.Scan(&n, &m);\n \n for n > 0 {\n k++;\n if !(k % m) {\n k++;\n }\n n--;\n }\n \n fmt.Print(k);\n}", "lang": "Go", "bug_code_uid": "4d2406b97bcec0591cdd244ed0a480cb", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "b36b629940b7f049ead0d4fd9cf42650", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9844961240310077, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var n, m, k int32;\n fmt.Scan(\"%d%d\", &n, &m);\n \n for (n > 0) {\n k++;\n if (k % m == 0) {\n k++;\n }\n n--;\n }\n \n fmt.Print(k);\n}", "lang": "Go", "bug_code_uid": "fa473b06bbd0a9191d7424f232fe0b34", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "b36b629940b7f049ead0d4fd9cf42650", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.998589562764457, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport \"fmt\"\n\nvar (\n n int32\n m int 32\n k int32\n\n)\n\nfunc in() {\n fmt.Scanf(\"%d%d\", &n, &m)\n \n}\n\nfunc out() {\n fmt.Println(k)\n}\n\nfunc run() {\n for n > 0 {\n k++\n if k % m == 0 {\n k++\n }\n n--\n }\n}\n\nfunc main() {\n in()\n run()\n out()\n}", "lang": "Go", "bug_code_uid": "72ccda21445a9b5e6a54a289f61c41a1", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "b36b629940b7f049ead0d4fd9cf42650", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.7245657568238213, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &m)\n\tres := n\n\tfor n > 0 {\n\t\tn = n / m\n\t\tres += n\n\t}\n\tfmt.Println(res)\n}", "lang": "Go", "bug_code_uid": "5d5f76a5b41606fee51fb3232a0087e1", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "2e733c4cae71b4af806c5c06b18c2aad", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.918, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar a, b float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tif a == b {\n\t\tfmt.Println(\"=\")\n\t\tos.Exit(0)\n\t}\n\tif a > b {\n\t\tvar x, y float64\n\t\tx = b\n\t\ty = a\n\t\tx = (x * math.Log(a)) / math.Log(b)\n\t\tif x > y {\n\t\t\tfmt.Println(\">\")\n\t\t} else{\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t} else {\n\t\tvar x, y float64\n\t\tx = b\n\t\ty = a\n\t\ty = (y * math.Log(b)) / math.Log(a)\n\t\tif x > y {\n\t\t\tfmt.Println(\">\")\n\t\t} else{\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t}\n}", "lang": "Go", "bug_code_uid": "9fd208000191bd188d3f25bc9f1f28c0", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "793b844d87451c0ef457b937cb040f09", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7416107382550335, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar x, y int\n\tfmt.Fscan(reader, &x, &y)\n\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t} else if x > y {\n\t\tfmt.Println(\"<\")\n\t} else if x < y {\n\t\tfmt.Println(\">\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "082a8d80dfd60ea916e0b5dc36504b4b", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "8b785acc9a1732e9f08eefc99bb6225f", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9393511988716502, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar pos [40000001]int\n\nfunc main() {\n\tvar n int64\n\tfmt.Scanf(\"%d\", &n)\n\tans := 4\n\tfor x := int64(1); x < n; x++ {\n\t\tpos[x] = int(math.Sqrt(float64(n*n - x*x)))\n\t}\n\tfor x := int64(1); x < n; x++ {\n\t\tif int(x) != pos[pos[x]] {\n\t\t\tans += 8\n\t\t} else {\n\t\t\tans += 4\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", ans)\n}\n", "lang": "Go", "bug_code_uid": "a75cc21c9dff3705adb20e601cfd37d3", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "2c91145e7a52510c3056830f3271d49a", "difficulty": null, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7319884726224783, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst SIDES int64 = 6\n\nfunc main() {\n\tvar n, total int64\n\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor i := 0; i < n; i++ {\n\t\ttotal += (i + 1) * SIDES\n\t}\n\tfmt.Println(total + 1)\n}\n", "lang": "Go", "bug_code_uid": "ea54fb5fc79a99bd02ba80569887beee", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "3e66a6f67d945bd79d6b2dcd42ea09aa", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.6505190311418685, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc count(n int64) int64 {\n\tif n < 1 {\n\t\treturn 1\n\t}\n\treturn 6*n + count(n-1)\n}\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tfmt.Println(count(n))\n}\n", "lang": "Go", "bug_code_uid": "add12131a6cc53bcb5aab3bd0704beef", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "f08d2b0663b9ed9b1715b503a9e7cb7c", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7336561743341404, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nvar n, m, k int64\n\nfunc solve(n int64) {\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tp := k - (n - k)\n\to := (k * (k + 1) / 2) + (k*(k-1))/2 - (p * (p - 1) / 2)\n\tans := k\n\tif o < m {\n\t\tans += (m - o) / n\n\t} else if o > m {\n\t\tans -= (o-m)/n + 1\n\t}\n\tO(ans, \"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "3251e049c80665f9ac62712a5917b337", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "5e6c170d256ae09d8dc8f8f608654929", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7178019461934745, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nvar n, m, k int64\n\nfunc solve(n int64) {\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tp := k - (n - k)\n\to := (k * (k + 1) / 2) + (k*(k-1))/2 - (p * (p - 1) / 2)\n\tans := k\n\tif o < m {\n\t\tfor o+n <= m {\n\t\t\to += n\n\t\t\tans++\n\t\t}\n\t} else if o > m {\n\t\tvar q int64\n\t\tfor o >= m {\n\t\t\to--\n\t\t\tif q == 0 || q == n {\n\t\t\t\tans--\n\t\t\t\tq = 0\n\t\t\t}\n\t\t\tq++\n\t\t}\n\t}\n\tO(ans, \"\\n\")\n}\n", "lang": "Go", "bug_code_uid": "9c68d9884cf73d75e4fc636775fc9c21", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "5e6c170d256ae09d8dc8f8f608654929", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9452449567723343, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tpeople := readInt()\n\tpillow := readInt()\n\tk := readInt()\n\tif people == 1 {\n\t\tfmt.Println(pillow)\n\t\treturn\n\t}\n\tpillow -= people\n\tleft := int64(k - 1)\n\tright := int64(people - k)\n\tlo := 0\n\thi := pillow\n\tbest := 0\n\tfor lo <= hi && pillow > 0 {\n\t\tmi := lo + (hi-lo)/2\n\t\trest := int64(pillow - mi)\n\t\tstep := int64(mi - 1)\n\t\tvar sum1 int64\n\t\tvar sum2 int64\n\t\tif left > 0 && step > 0 {\n\t\t\tif step < left {\n\t\t\t\tleft = step\n\t\t\t}\n\t\t\tsum1 = int64(step-left+1+step) * left / 2\n\t\t}\n\t\tif right > 0 && step > 0 {\n\t\t\tif step < right {\n\t\t\t\tright = step\n\t\t\t}\n\t\t\tsum2 = int64(step-right+1+step) * right / 2\n\t\t}\n\t\tif sum1+sum2 <= rest {\n\t\t\tlo = mi + 1\n\t\t\tif best < mi {\n\t\t\t\tbest = mi\n\t\t\t}\n\t\t} else {\n\t\t\thi = mi - 1\n\t\t}\n\t}\n\tfmt.Println(best + 1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "167040691aac90626034cd11a9049bfc", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "1f417f8761f31a59a224c300492eacce", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.997946611909651, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var m, n uint64\n fmt.Scan(&n, &m)\n if n > 32 {\n fmt.Print(m)\n return\n }\n var exp uint64 = 1\n for i:=uin64(0); i 0 && s <= m; n-- {\n\t\ts = s << 1\n\t}\n\n\treturn m % s\n}\n\nfunc main() {\n\tvar n, m uint64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tfmt.Println(result(m, n))\n}", "lang": "Go", "bug_code_uid": "5273532d36eaa94ff08eba390df33ea7", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "84c50689af2fbb71c90d550260e26040", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.575197889182058, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\trest := a - b\n\t\tif rest < 0 {\n\t\t\trest = -rest\n\t\t}\n\t\tif n/rest <= 2 {\n\t\t\tfmt.Println(\"Final!\")\n\t\t} else {\n\t\t\tcnt := 0\n\t\t\tfor rest > 0 {\n\t\t\t\trest >>= 1\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "3ad292f65d9bc6956dfb96f9981e54e9", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "da64b954fa338d34665d5ba75e75ded7", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8889624358762204, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n N := io.NextInt()\n\tA := io.NextInt()\n\tB := io.NextInt()\n\t\n\trounds := 0\n\trem := N\n\tfor rem > 1 {\n\t rounds++\n\t rem >>= 1\n\t}\n\t\n\twhich := 0\n\tfor i := uint(0); ; i++ {\n\t bitA := (A >> i) & 1\n\t bitB := (B >> i) & 1\n\t if bitA != bitB {\n\t which = int(i + 1)\n\t break\n\t }\n\t}\n\t\n\tif which == rounds {\n\t io.Println(\"Final!\")\n\t} else {\n\t io.Println(which)\n\t}\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}", "lang": "Go", "bug_code_uid": "b9001839e3f8ceb37a2b2d31f2ca98c5", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "5bee3ff23cfa0a574be760eed8904ba3", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9877300613496932, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, ans int\n\tfmt.Scanf(\"%d%d%d\", &n, &a, &b)\n\tans = (a+b)%n + n\n\tif ans <= 0 {\n\t\tans += n\n\t}\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "b583cd361ea69c81348dff1d86ac015a", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "f0bbc91cece77028b149c29b68760a22", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9814814814814815, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, ans int\n\tfmt.Scan(\"%d%d%d\", &n, &a, &b)\n\tans = (a+b)%n + n\n\tif ans <= 0 {\n\t\tans += n\n\t}\n\tfmt.Println(ans)\n}", "lang": "Go", "bug_code_uid": "990ac816d852890a2652fdefece52ba7", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "f0bbc91cece77028b149c29b68760a22", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9864864864864865, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n, a, b int64\n fmt.Scanf(\"%d%d%d\", &n, &a, &b)\n\t\n\tfmt.Printf(\"%d\\n\", (a + b + n - 1) % n + 1)\n}", "lang": "Go", "bug_code_uid": "6d65f25c361471f5c638aa0f19e258af", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "b85936b706c22799c2f7112dabd99731", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9252525252525252, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scanf(\"%d %d %d\", &n, &a, &b)\n\n\tvar ret int\n\tif b == 0 {\n\t\tret = a\n\t} else {\n\t\tif b < 0 {\n\t\t\tb = n - (-b % n)\n\t\t}\n\n\t\tret = ((b % n) + a) \n\t}\n\n\tfmt.Printf(\"%d\", ret)\n}", "lang": "Go", "bug_code_uid": "428084ea418b0a6973c9853875258647", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "a10d2de7aa8ba40d625b6401d3313307", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9047109207708779, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/913/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc min(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Solve(n int, L int64, c []int64) int64 {\n\tfor i := 1; i < n; i++ {\n\t\tif c[i] > 2*c[i-1] {\n\t\t\tc[i] = 2 * c[i-1]\n\t\t}\n\t}\n\tans := int64(math.MaxInt64)\n\tsum := int64(0)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tliters := int64(1 << i)\n\t\tif liters <= L {\n\t\t\tbottles := L / liters\n\t\t\tL -= bottles * liters\n\t\t\tsum += bottles * c[i]\n\t\t} else {\n\t\t\tans = min(ans, sum+c[i])\n\t\t}\n\t}\n\treturn min(ans, sum)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar L int64\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &L)\n\tc := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(reader, \"%d\", &c[i])\n\t}\n\tfmt.Fscanf(reader, \"\\n\")\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, L, c))\n}\n", "lang": "Go", "bug_code_uid": "1fb428c22a98104c50cbaef0e10bd783", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "fb86a22bbf2ba5cfdce87771bd77bc38", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3298116674322462, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinput := strings.TrimSpace(scanner.Text())\n\n\tvalues := make([]int, len(input))\n\tfor i, a := range input {\n\t\tvalues[i] = int(a - '0')\n\t}\n\n\tfmt.Println(makeHappy(values))\n}\n\nfunc makeHappy(values []int) int {\n\tn := 3\n\tsumA, sumB := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tsumA += values[i]\n\t\tsumB += values[n + i]\n\t}\n\n\tif sumA == sumB {\n\t\treturn 0\n\t}\n\n\tdiff := sumA - sumB\n\n\tfor i := 0; i < n; i++ {\n\t\ta := values[i] - diff\n\t\tif a > 0 && a <= 9 {\n\t\t\treturn 1\n\t\t}\n\t\ta = values[n + i] + diff\n\t\tif a > 0 && a <= 9 {\n\t\t\treturn 1\n\t\t}\n\t}\n\n\tvalsA := values[:n]\n\tvalsB := values[n:]\n\tsort.Ints(valsA)\n\tsort.Ints(valsB)\n\n\tif diff > 0 {\n\t\tdiff -= valsA[2]\n\t\tvalsA[2] = 0\n\n\t\tdiff -= 9 - valsB[0]\n\t\tif diff < 0 {\n\t\t\treturn 2\n\t\t}\n\n\t\treturn 3\n\t}\n\n\tdiff += valsB[2]\n\tvalsB[2] = 0\n\n\tdiff += 9 - valsA[0]\n\tif diff > 0 {\n\t\treturn 2\n\t}\n\n\treturn 3\n}\n", "lang": "Go", "bug_code_uid": "3c09cdb402e28a03f2821c1ce52a0f34", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "7624d54db08981f6cf4616757bc9e7a5", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7463651050080775, "equal_cnt": 36, "replace_cnt": 36, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 36, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n arr1 := make([]int, 3)\n arr2 := make([]int, 3)\n for {\n line, _, err := reader.ReadLine()\n if err != nil {\n break\n }\n sum1 := 0\n for i := 0; i < 3; i++ {\n arr1[i] = int(line[i] - '0')\n sum1 += arr1[i]\n }\n sum2 := 0\n for i := 3; i < 6; i++ {\n arr2[i-3] = int(line[i] - '0')\n sum2 += arr2[i-3]\n }\n if sum1 == sum2 {\n fmt.Printf(\"0\\n\")\n continue\n }\n if sum1 < sum2 {\n arr1, arr2 = arr2, arr1\n sum1, sum2 = sum2, sum1\n }\n delta := sum1 - sum2\n count := 0\n for {\n sort.Sort(sort.IntSlice(arr1))\n sort.Sort(sort.IntSlice(arr2))\n count++\n if arr1[2] > 9-arr2[0] {\n if arr1[2] > delta {\n break\n }\n delta -= arr1[2]\n arr1[2] = 0\n } else {\n if 9-arr2[0] > delta {\n break\n }\n delta -= (9 - arr2[0])\n arr2[0] = 9\n }\n\n }\n fmt.Printf(\"%d\\n\", count)\n\n }\n}", "lang": "Go", "bug_code_uid": "d7337c9630a2b509b71d8be2eb8b5dd3", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "ed76bfa0366b6ec2a11682671e6464d7", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9983844911147012, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tarr1 := make([]int, 3)\n\tarr2 := make([]int, 3)\n\tfor {\n\t\tline, _, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tsum1 := 0\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tarr1[i] = int(line[i] - '0')\n\t\t\tsum1 += arr1[i]\n\t\t}\n\t\tsum2 := 0\n\t\tfor i := 3; i < 6; i++ {\n\t\t\tarr2[i-3] = int(line[i] - '0')\n\t\t\tsum2 += arr2[i-3]\n\t\t}\n\t\tif sum1 == sum2 {\n\t\t\tfmt.Printf(\"0\\n\")\n\t\t\tcontinue\n\t\t}\n\t\tif sum1 < sum2 {\n\t\t\tarr1, arr2 = arr2, arr1\n\t\t\tsum1, sum2 = sum2, sum1\n\t\t}\n\t\tdelta := sum1 - sum2\n\t\tcount := 0\n\t\tfor {\n\t\t\tsort.Sort(sort.IntSlice(arr1))\n\t\t\tsort.Sort(sort.IntSlice(arr2))\n\t\t\tcount++\n\t\t\tif arr1[2] > 9-arr2[0] {\n\t\t\t\tif arr1[2] > delta {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdelta -= arr1[2]\n\t\t\t\tarr1[2] = 0\n\t\t\t} else {\n\t\t\t\tif 9-arr2[0] > delta {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdelta -= (9 - arr2[0])\n\t\t\t\tarr2[0] = 9\n\t\t\t}\n\n\t\t}\n\t\tfmt.Printf(\"%d\\n\", count)\n\n\t}\n}", "lang": "Go", "bug_code_uid": "ef4b1358c97ed01bd5e10cc10152b1fd", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "ae97ebcb386f0d21212ee36320f18a07", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9194539249146758, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "// A. Love \"A\"\n/*\nAlice has a string 𝑠. She really likes the letter \"a\".\nShe calls a string good if strictly more than half of the characters in\nthat string are \"a\"s. For example \"aaabb\", \"axaa\" are good strings,\nand \"baca\", \"awwwa\", \"\" (empty string) are not.\n\nAlice can erase some characters from her string 𝑠. She would like to know\nwhat is the longest string remaining after erasing some characters\n(possibly zero) to get a good string. It is guaranteed that the string has\nat least one \"a\" in it, so the answer always exists.\n\nInput\nThe first line contains a string 𝑠(1≤|𝑠|≤50) consisting of lowercase\nEnglish letters. It is guaranteed that there is at least one \"a\" in 𝑠.\n\nOutput\nPrint a single integer, the length of the longest good string\nthat Alice can get after erasing some characters from 𝑠.\n\nExamples\nInput\nxaxxxxa\n\nOutput\n3\n\nInput\naaabaa\n\nOutput\n6\n\nNote\nIn the first example, it's enough to erase any four of the \"x\"s.\nThe answer is 3 since that is the maximum number of characters that can remain.\n\nIn the second example, we don't need to erase any characters.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\n\tsol1146A(strings.TrimSpace(input))\n}\n\nfunc sol1146A(s string) {\n\ttotal := len(s)\n\tm := make(map[rune]int)\n\n\tfor _, v := range s {\n\t\tm[v]++\n\t}\n\n\tfor k, v := range m {\n\t\tif k != 'a' && m['a'] <= v {\n\t\t\ttotal -= v - m['a'] + 1\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n", "lang": "Go", "bug_code_uid": "b2053fa4e0ab77affecece61ba6baf25", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "2a69344d7da5e0ed3c5206e539c6448c", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8059360730593608, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tres := false\n\tvar c string\n\taa := 1234567\n\tbb := 123456\n\tcc := 1234\n\tfor i := 0; ; i++ {\n\t\tif aa*i > n || res {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; ; j++ {\n\t\t\tif (aa*i+bb*j) > n || res {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor k := 0; ; k++ {\n\t\t\t\tif (aa*i+bb*j+cc*k) > n || res {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tres = (aa*i + bb*j + cc*k) == n\n\t\t\t}\n\t\t}\n\t}\n\tif res {\n\t\tc = \"YES\"\n\t} else {\n\t\tc = \"NO\"\n\t}\n\tfmt.Println(c)\n}\n", "lang": "Go", "bug_code_uid": "a3d0cdb956953f7b1ed1a01207bbc411", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "26e2a6869fb2eeac7533572555b31635", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9980119284294234, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tin, out := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\ta, _ := in.ReadString('\\n')\n\ta = strings.Trim(a, \"\\r\\n\")\n\tn, _ := strconv.ParseInt(string(a), 10, 64)\n\tfor a := int64(0); a <= 1000; a++ {\n\t\tfor b := int64(0); b <= 1000; b++ {\n\t\t\tif c := (n - a*1234567 + b*123456) / 1234; c >= 0 && a*1234567+b*123456+c*1234 == n {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "df5e5572d3db3f4133bee0ae8d9bf972", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "7c9e7418817c917a2a5e34d22e7e42dc", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9808429118773946, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport(\n \"fmt\"\n)\n\nvar(\n n,m,a int\n)\nfunc main(){\n fmt.Scanln(&n, &m, &a)\n widthNum := m / a\n if(m % a != 0){)\n\twidthNum++\n }\t\n LengthNum := n / a\n if(n % a != 0){\n\tLengthNum++\n }\n fmt.Println(widthNum * LengthNum)\n}\n", "lang": "Go", "bug_code_uid": "5196f4a49535ba9529eea8393602e78f", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "aba7025c9a483d65f4afb7e1ed25ceb4", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8926315789473684, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var m, n, a int64;\n fmt.Scanf(\"%d\", &m)\n fmt.Scanf(\"%d\", &n)\n fmt.Scanf(\"%d\", &a)\n\n var x, y int;\n for x=m/a; x*a < m; x++ {}\n for y=n/a; y*a < n; y++ {}\n\n fmt.Println(x*y)\n}\n", "lang": "Go", "bug_code_uid": "514003ef08ab7d4f0ca7772058c9aaed", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6b4e2636474541bc3da1556580f09e98", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7907390917186109, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n flags := os.Args[1:]\n\n n, _ := strconv.Atoi(flags[0])\n m, _ := strconv.Atoi(flags[1])\n a, _ := strconv.Atoi(flags[2])\n\n var ndiva int\n var mdiva int\n\n if n % a == 0 {\n ndiva = n / a\n } else {\n ndiva = n / a + 1\n }\n\n if m % a == 0 {\n mdiva = m / a\n } else {\n mdiva = m / a + 1\n }\n\n //fmt.Println(\"ndiva: \", ndiva)\n //fmt.Println(\"mdiva: \", mdiva)\n\n fmt.Println(ndiva * mdiva)\n}\n", "lang": "Go", "bug_code_uid": "2ab0d04829ea07607cba9f30a6d9201f", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "14f399356a141b119ea976e79d0e63c7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.971736204576043, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, m , a, ndiva, mdiva float64\n\n fmt.Scanf(\"%f %f %f\", &n, &m, &a)\n\n/*\n if n % a == 0 {\n ndiva = n / a\n } else {\n ndiva = n / a + 1\n }\n\n if m % a == 0 {\n mdiva = m / a\n } else {\n mdiva = m / a + 1\n }\n*/\n\n fmt.Println(math.Ceil(n / a) * math.Ceil(m / a))\n\n //fmt.Println(ndiva * mdiva)\n}\n", "lang": "Go", "bug_code_uid": "42b2d9fefadfe22a8c3cf53116c091d4", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "14f399356a141b119ea976e79d0e63c7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9169027384324835, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"os\"\n)\n\nfunc main() {\n\tn, m, a := s.Next(), s.Next(), s.Next()\n\tn, m = n / a, m / a\n\tif n % a != 0 {\n\t\tn++\n\t}\n\tif m % a != 0 {\n\t m++\n\t}\n\ts.Println(n * m)\n\ts.Flush()\n}\n\nfunc init() {\n\ts := NewInOut(os.Stdin, os.Stdout)\n}\n\nvar (\n\ts InOut\n)\n\n// IO Lib\ntype InOut struct {\n\t*bufio.Reader\n\t*bufio.Writer\n}\n\nfunc NewInOut(r io.Reader, w io.Writer) *InOut {\n\treturn &InOut{bufio.NewReader(r), bufio.NewWriter(w)}\n}\n\n// Get Next Integer\nfunc (s *InOut) Next() (r int) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\n// Get Next Line String\nfunc (s *InOut) NextLine() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n'; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextStr() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' || b == ' ' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n' && b != ' '; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Print Strings using the suitable way to change type\nfunc (s *InOut) Print(os ...interface{}) {\n\tfor _, o := range os {\n\t\tswitch o.(type) {\n\t\tcase byte:\n\t\t\ts.WriteByte(o.(byte))\n\t\tcase string:\n\t\t\ts.WriteString(o.(string))\n\t\tcase int:\n\t\t\ts.WriteString(strconv.Itoa(o.(int)))\n\t\tcase int64:\n\t\t\ts.WriteString(strconv.FormatInt(o.(int64), 10))\n\t\tdefault:\n\t\t\ts.WriteString(fmt.Sprint(o))\n\t\t}\n\t}\n}\n\n// Print Strings using the suitable way to change type with new line\nfunc (s *InOut) Println(os ...interface{}) {\n\tfor _, o := range os {\n\t\ts.Print(o)\n\t}\n\ts.Print(\"\\n\")\n}\n\n// Print immediately with new line (for debug)\nfunc (s *InOut) PrintlnNow(o interface{}) {\n\tfmt.Println(o)\n}\n\n", "lang": "Go", "bug_code_uid": "c44e231bda1e5d063d60d98eea86d4b8", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fb15cf95758db53c8e2e4923b027b5a8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9984440986885975, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"os\"\n)\n\nfunc main() {\n\tn, m, a := s.NextInt64(), s.NextInt64(), s.NextInt64()\n\tx, y := n / a, m / a\n\tif n % a != 0 {\n\t\tx++\n\t}\n\tif m % a != 0 {\n\t\ty++\n\t}\n\ts.Println(x * y)\n\ts.Flush()\n}\n\nvar (\n\ts *InOut\n)\n\nfunc init() {\n\ts = NewInOut(os.Stdin, os.Stdout)\n}\n\ntype InOut struct {\n\t*bufio.Reader\n\t*bufio.Writer\n}\n\nfunc NewInOut(r io.Reader, w io.Writer) *InOut {\n\treturn &InOut{bufio.NewReader(r), bufio.NewWriter(w)}\n}\n\n// Get Next Integer\nfunc (s *InOut) Next() (r int) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\nfunc (s *InOut) NextInt64() (r int64) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int64(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\n// Get Next Line String\nfunc (s *InOut) NextLine() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n'; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextStr() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' || b == ' ' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n' && b != ' '; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Print Strings using the suitable way to change type\nfunc (s *InOut) Print(os ...interface{}) {\n\tfor _, o := range os {\n\t\tswitch o.(type) {\n\t\tcase byte:\n\t\t\ts.WriteByte(o.(byte))\n\t\tcase string:\n\t\t\ts.WriteString(o.(string))\n\t\tcase int:\n\t\t\ts.WriteString(strconv.Itoa(o.(int)))\n\t\tcase int64:\n\t\t\ts.WriteString(strconv.FormatInt(o.(int64), 10))\n\t\tdefault:\n\t\t\ts.WriteString(fmt.Sprint(o))\n\t\t}\n\t}\n}\n\n// Print Strings using the suitable way to change type with new line\nfunc (s *InOut) Println(os ...interface{}) {\n\tfor _, o := range os {\n\t\ts.Print(o)\n\t}\n\ts.Print(\"\\n\")\n}\n\n// Print immediately with new line (for debug)\nfunc (s *InOut) PrintlnNow(o interface{}) {\n\tfmt.Println(o)\n}\n", "lang": "Go", "bug_code_uid": "d208ec99a46f14f9a4ede69812c73c00", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fb15cf95758db53c8e2e4923b027b5a8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9853001224989791, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"io\"\n \"os\"\n \"strconv\"\n)\n\ntype Scanner struct {\n r io.Reader\n split bufio.SplitFunc\n maxTokenSize int\n token, buf []byte\n start, end int\n}\n\nfunc NewScanner(r io.Reader) *Scanner {\n return &Scanner{\n r: r,\n split: bufio.ScanWords,\n maxTokenSize: 16777216,\n buf: make([]byte, 4096),\n }\n}\n\nfunc (s *Scanner) advance(n int) bool {\n if n < 0 || n > s.end-s.start {\n return false\n }\n s.start += n\n return true\n}\n\nfunc (s *Scanner) Text() string {\n return string(s.token)\n}\n\nfunc (s *Scanner) Scan() bool {\n for {\n if s.end > s.start {\n advance, token, err := s.split(s.buf[s.start:s.end], false)\n if err != nil || !s.advance(advance) {\n return false\n }\n s.token = token\n if token != nil {\n return true\n }\n }\n if s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf)/2) {\n copy(s.buf, s.buf[s.start:s.end])\n s.end -= s.start\n s.start = 0\n }\n if s.end == len(s.buf) {\n if len(s.buf) >= s.maxTokenSize {\n return false\n }\n newSize := len(s.buf) * 2\n if newSize > s.maxTokenSize {\n newSize = s.maxTokenSize\n }\n newBuf := make([]byte, newSize)\n copy(newBuf, s.buf[s.start:s.end])\n s.buf = newBuf\n s.end -= s.start\n s.start = 0\n continue\n }\n for loop := 0; ; {\n n, _ := s.r.Read(s.buf[s.end:len(s.buf)])\n s.end += n\n if n > 0 {\n break\n }\n loop++\n if loop > 100 {\n break\n }\n }\n }\n}\n\nfunc (s *Scanner) Split(split bufio.SplitFunc) {\n s.split = split\n}\n\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\nvar sc *Scanner = NewScanner(os.Stdin)\n\nfunc next() string { sc.Scan(); return sc.Text() }\nfunc nc() byte { sc.Scan(); return sc.Text()[0] }\n\nfunc ni32() int {\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n return n\n}\n\nfunc ni64() int64 {\n sc.Scan()\n n, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return n\n}\n\nfunc pri32(i ...int) {\n for _, ii := range i {\n w.WriteString(strconv.Itoa(ii))\n sp()\n }\n}\nfunc pri64(i ...int64) {\n for _, ii := range i {\n w.WriteString(strconv.FormatInt(ii, 10))\n sp()\n }\n}\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc main() {\n n := ni64()\n if n%3 != 0 {\n pri64(n/3 + 1)\n } else {\n pri64(n / 3)\n }\n endl()\n w.Flush()\n}\n", "lang": "Go", "bug_code_uid": "4e1e36ff57cabdfd079d9eb161feb613", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "3ebc13a4ffdcb8123e4570e609eef587", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9989462592202318, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc get_weight(piece byte) int {\n reverse := false\n if piece >= 'a' && piece <= 'z' {\n reverse = true\n piece = piece - 'a' + 'A'\n }\n\n ret := 0\n switch piece {\n case 'Q':\n ret = 9\n case 'R':\n ret = 5\n case 'B':\n ret = 3\n case 'K':\n ret = 3\n case 'P':\n ret = 1\n }\n\n if reverse {\n return -ret\n }\n return ret\n}\n\nfunc main() {\n var line string\n score := 0\n for i := 0; i < 8; i++ {\n fmt.Scan(&line)\n for j := 0; j < len(line); j++ {\n if (line[j] >= 'a' && line[j] <= 'z') || (line[j] >= 'A' && line[j] <= 'Z') {\n score += get_weight(line[j])\n }\n }\n }\n\n if score == 0 {\n fmt.Println(\"Draw\")\n } else if score > 0 {\n fmt.Println(\"White\")\n } else {\n fmt.Println(\"Black\")\n }\n}\n", "lang": "Go", "bug_code_uid": "9170a57fba15b0ae45a0134583c50a91", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "9feb6b3e2748d04815631b1fcf618efa", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9147869674185464, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, m int\n\tfmt.Fscan(reader, &n, &m)\n\n\tvar vl int\n\n\tif ok := m % n; ok == 0 {\n\t\tvl = m / n\n\t} else {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tvar count int\n\tfor vl > 1 {\n\t\tif vl%3 == 0 {\n\t\t\tvl /= 3\n\t\t\tcount++\n\t\t} else if vl%2 == 0 {\n\t\t\tvl /= 2\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "6ece9e0bc97b06653a26f124e906ba06", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "8b30a7660ede688f0913375677e57766", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9773584905660377, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, h float64\n\tfmt.Scan(&r, &h)\n\th, count := h-r*math.Floor(h/r), 2*int(h/r)\n\tif h >= r*(math.Sqrt(3)+6)/4 {\n\t\tcount += 3\n\t} else if h >= r/2 {\n\t\tcount += 2\n\t} else {\n\t\tcount += 1\n\t}\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "b97803096f7e708140d0236847e01690", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "e88d5d1ff874078e6af1324df7b03115", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9724409448818898, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nfunc main() {\n var limak, bob int\n fmt.Scanf(\"%d %d\\n\", &limak, &bob)\n var res int\n for {\n if limak > bob {\n break\n }\n limak *= 3\n bob *= 2\n res++\n }\n fmt.Println(res)\n}", "lang": "Go", "bug_code_uid": "4f9a3a73fcdab0cfd239c6cd46c5d2dd", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "8e6a084c1f5513ed8edf864bb0737c9f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8641655886157826, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n\nvar (\n in *bufio.Reader\n out *bufio.Writer\n)\n\nfunc main() {\n in = bufio.NewReader(os.Stdin)\n out = bufio.NewWriter(os.Stdout)\n var b int64\n fmt.Fscanln(in, &b)\n var count int64 = 0\n for i:=int64(1);i<=b;i++ {\n if (b%i == 0) {\n count++\n }\n }\n fmt.Println(count)\n\n}\n", "lang": "Go", "bug_code_uid": "e85d8a3cf7b3d8cd21e3bc2d307d9cf3", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "81a21f799dadfa3600e5bfa9dac4ab5a", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8009049773755657, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"math\"\n)\n\nvar (\n in *bufio.Reader\n out *bufio.Writer\n)\n\nfunc main() {\n in = bufio.NewReader(os.Stdin)\n out = bufio.NewWriter(os.Stdout)\n var b int64\n fmt.Fscanln(in, &b)\n var count int64 = 0\n for i:=int64(1);i base 2\n\tfor _, d := range n {\n\t\tif d >= '1' {\n\t\t\ts += \"1\"\n\t\t} else {\n\t\t\ts += \"0\"\n\t\t}\n\t}\n\tans, _ := strconv.ParseInt(s, 2, 32)\n\tfmt.Fprintln(out, ans)\n}\n", "lang": "Go", "bug_code_uid": "3eb80cc9fe23676457094fa9ce41a8cd", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "5e27c87c6ff446f19a75ccaf683d68f4", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9969207082371054, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"unicode\"\n)\n\nvar stdReader *bufio.Reader = bufio.NewReader(os.Stdin)\n\nfunc readInt() (result int) {\n\tvar negative, started bool\nREADER_LOOP:\n\tfor {\n\t\tchar, err := stdReader.ReadByte()\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tbreak READER_LOOP\n\t\tcase char == '-':\n\t\t\tnegative = true\n\t\tcase unicode.IsDigit(rune(char)):\n\t\t\tstarted = true\n\t\t\tresult = result*10 + int(char&0xf)\n\t\tcase started:\n\t\t\tbreak READER_LOOP\n\t\t}\n\t}\n\tif negative {\n\t\tresult = -result\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := readInt()\n\n\t// dp[][0] - Vasya rested\n\t// dp[][1] - Vasya wrote contest\n\t// dp[][2] - Vasya practiced in a gym\n\tdp := make([][3]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\t// dp[i][0]\n\t\tdp[i][0] = dp[i-1][0]\n\t\tif dp[i-1][1] > dp[i][0] {\n\t\t\tdp[i][0] = dp[i-1][1]\n\t\t}\n\t\tif dp[i-1][2] > dp[i][0] {\n\t\t\tdp[i][0] = dp[i-1][2]\n\t\t}\n\n\t\tinput := readInt()\n\t\t// dp[i][1]\n\t\tif input == 1 || input == 3 {\n\t\t\tdp[i][1] = dp[i-1][0]\n\t\t\tif dp[i-1][2]+1 > dp[i][1] {\n\t\t\t\tdp[i][1] = dp[i-1][2] + 1\n\t\t\t}\n\t\t}\n\n\t\t// dp[i][2]\n\t\tif input == 2 || input == 3 {\n\t\t\tdp[i][2] = dp[i-1][0]\n\t\t\tif dp[i-1][1]+1 > dp[i][2] {\n\t\t\t\tdp[i][2] = dp[i-1][1] + 1\n\t\t\t}\n\t\t}\n\t}\n\n\tanswer := dp[n][0]\n\tif dp[n][1] > answer {\n\t\tanswer = dp[n][1]\n\t}\n\tif dp[n][2] > answer {\n\t\tanswer = dp[n][2]\n\t}\n\tfmt.Println(n - answer)\n}\n", "lang": "Go", "bug_code_uid": "3d43e15e21cff01ffc90fc8342d3a36f", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "fc87acf51d2cabc6bcdd4557a4c44ef1", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9783715012722646, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc toNum(s string) int {\n h := (int(s[0]) - int('0')) * 10 + (int(s[1]) - int('0'))\n m := (int(s[3]) - int('0')) * 10 + (int(s[4]) - int('0'))\n return h * 60 + m\n}\n\nfunc isPalindrome(n int) bool {\n h := n / 60\n m := n % 60\n\n a := fmt.Sprintf(\"%02d:%02d\", h, m)\n for i := 0; i < len(a); i++ {\n if a[i] != a[len(a) - 1 - i] {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n var s string\n for {\n _, err := fmt.Scan(&s)\n if err != nil { break }\n\n n := toNum(s)\n t := 0\n for {\n if isPalindrome(n) {\n break\n }\n t++\n n = (n + 1) % (24 * 60)\n if (t > 10) { break }\n }\n fmt.Println(t)\n }\n}\n\n", "lang": "Go", "bug_code_uid": "591fa64f052b9f61f5d6533254ab7e33", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "cf5a31a1ce4f1f34dac5c8dad9294a2e", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.556786703601108, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc isPalindrome(tt int) bool {\n\treturn tt%60%10 == tt/60/10 && tt%60/10 == tt/60%10\n}\n\nfunc main() {\n\tvar hh, mm int\n\tfor exitCode, err := fmt.Scanf(\"%d:%d\", &hh, &mm); exitCode != -1 && err == nil; {\n\t\ttt := hh*60 + mm\n\t\tfor i := 0; ; i++ {\n\t\t\tif isPalindrome(tt) {\n\t\t\t\tfmt.Printf(\"%d\\n\", i)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttt = (tt + 1) % (24 * 60)\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "427b6ebc981d09ed7665175c5fe27062", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "41511e48d3dae8fcc964bbccec954f0b", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.23963133640552994, "equal_cnt": 23, "replace_cnt": 14, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 23, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\twriter.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\t//fmt.Scanf(\"%d%d\",&n, &k)\n\tscanner.Split(bufio.ScanWords)\n\tvar row string\n\tvar length, index int\n\tvar arr [100]int\n\t_ = ReadInt32()\n\tfmt.Scanf(\"%s\", &row)\n\tfor i := 0; i < len(row); i++ {\n\t\tif row[i] == 'B' {\n\t\t\tlength++\n\t\t} else if row[i] != 'B' && length > 0 {\n\t\t\tarr[index] = length\n\t\t\tindex++\n\t\t\tlength = 0\n\t\t}\n\t}\n\tif length != 0 {\n\t\tarr[index] = length\n\t\tindex++\n\t}\n\tfmt.Println(index)\n\tfor i := 0; i < index; i++ {\n\t\tfmt.Println(arr[i], \" \")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "20f561ec18d7807743430b00a950911c", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "6ecee894277adde715ff2605891fd4f4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.24382716049382716, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 23, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\twriter.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\t//fmt.Scanf(\"%d%d\",&n, &k)\n\tscanner.Split(bufio.ScanWords)\n\tvar row string\n\tvar length, index int\n\tvar arr [100]int\n\tn := ReadInt32()\n\tfmt.Scanf(\"%s\", &row)\n\tfor i := 0; i < n; i++ {\n\t\tif row[i] == 'B' {\n\t\t\tlength++\n\t\t} else if row[i] != 'B' && length > 0 {\n\t\t\tarr[index] = length\n\t\t\tindex++\n\t\t\tlength = 0\n\t\t}\n\t}\n\tif length != 0 {\n\t\tarr[index] = length\n\t\tindex++\n\t}\n\tfmt.Println(index)\n\tfor i := 0; i < index; i++ {\n\t\tfmt.Println(arr[i], \" \")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "431bea5836ca6fa17689c009e0a5a1f6", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "6ecee894277adde715ff2605891fd4f4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9970845481049563, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n groups := make([]int, n)\n var s string\n fmt.Scan(&s)\n s += 'W'\n var lastRune rune = 'W'\n var groupCnt int\n var curGroup int\n for _, r := range s {\n if r == 'B' {\n curGroup++\n if lastRune == 'W' {\n groupCnt++\n }\n lastRune = 'B'\n } else if r == 'W' {\n if lastRune == 'B' {\n groups[groupCnt-1] = curGroup\n }\n lastRune = 'W'\n curGroup = 0\n }\n }\n fmt.Print(groupCnt, \"\\n\")\n for i:=0; i < groupCnt; i++ {\n fmt.Print(groups[i], \" \")\n }\n}", "lang": "Go", "bug_code_uid": "edbea878886f128fb36c074cb5152e2b", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "fdc4443b2c79aa6520e99cd29ba0d70d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8917748917748918, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tans := 0\n\tfor a > 1 || b > 1 {\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\ta += 1\n\t\tb -= 2\n\t\tans++\n\t}\n\tfmt.Println(ans - 1)\n}\n", "lang": "Go", "bug_code_uid": "ec1215ba658147a8bcb678bc66bf6965", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "aa87fc2d9ddc8ed6ed65b5d7f60ad615", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9617117117117117, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tcha = 2\n)\n\ntype Joystick struct {\n\tCharge int\n\tCharging bool\n}\n\nfunc main() {\n\n\tmin := 0\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinput := scanner.Text()\n\tcharges := strings.Split(input, \" \")\n\n\tv, _ := strconv.Atoi(charges[0])\n\tj1 := Joystick{v, false}\n\tv, _ = strconv.Atoi(charges[1])\n\tj2 := Joystick{v, false}\n\n\tif j1.Charge < j2.Charge {\n\t\tj1.Charging = true\n\t} else {\n\t\tj2.Charging = true\n\t}\n\n\t// fmt.Println(j1, j2)\n\n\tfor {\n\t\tif j1.Charge <= 0 || j2.Charge <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tmin++\n\t\tif j1.Charging == true {\n\t\t\tj1.Charge++\n\t\t\tj2.Charge -= 2\n\t\t} else {\n\t\t\tj2.Charge++\n\t\t\tj1.Charge -= 2\n\t\t}\n\t\tif j1.Charge < j2.Charge {\n\t\t\tj1.Charging = true\n\t\t\tj2.Charging = false\n\t\t} else {\n\t\t\tj2.Charging = true\n\t\t\tj1.Charging = false\n\t\t}\n\n\t}\n\tfmt.Println(min)\n\n}\n", "lang": "Go", "bug_code_uid": "874fdeafd2a9b083d25d98e0342bac18", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "59982e1ef469c665a9d93ba9e0f1c85d", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9978308026030369, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tcha = 2\n)\n\ntype Joystick struct {\n\tCharge int\n\tCharging bool\n}\n\nfunc main() {\n\n\tmin := 0\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinput := scanner.Text()\n\tcharges := strings.Split(input, \" \")\n\n\tv, _ := strconv.Atoi(charges[0])\n\tj1 := Joystick{v, false}\n\tv, _ = strconv.Atoi(charges[1])\n\tj2 := Joystick{v, false}\n\n\tif j1.Charge < j2.Charge {\n\t\tj1.Charging = true\n\t} else {\n\t\tj2.Charging = true\n\t}\n\n\t// fmt.Println(j1, j2)\n\n\tif j1.Charge == 1 && j2.Chrage == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tfor {\n\t\tif j1.Charge <= 0 || j2.Charge <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tmin++\n\t\tif j1.Charging == true {\n\t\t\tj1.Charge++\n\t\t\tj2.Charge -= 2\n\t\t} else {\n\t\t\tj2.Charge++\n\t\t\tj1.Charge -= 2\n\t\t}\n\t\tif j1.Charge < j2.Charge {\n\t\t\tj1.Charging = true\n\t\t\tj2.Charging = false\n\t\t} else {\n\t\t\tj2.Charging = true\n\t\t\tj1.Charging = false\n\t\t}\n\n\t}\n\tfmt.Println(min)\n\n}\n", "lang": "Go", "bug_code_uid": "d76f7ee0c4a7dab6381fc0149a24d70f", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "59982e1ef469c665a9d93ba9e0f1c85d", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.49700598802395207, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scanf(\"%d\\n%d\\n%d\", &n, &a, &b)\n\tframes := make([]int, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tif i < 4 {\n\t\t\tframes[i] = a\n\t\t} else {\n\t\t\tframes[i] = b\n\t\t}\n\t}\n\tsort.Ints(frames)\n\tcount := 0\n\tleftover := 0\n\n\tfor i := 0; i < 6; i++ {\n\t\tif leftover >= frames[i] {\n\t\t\tleftover -= frames[i]\n\t\t\tcontinue\n\t\t}\n\t\tif i > 0 {\n\t\t\tif leftover+frames[i-1]-frames[i] >= 0 {\n\t\t\t\tcount++\n\t\t\t\tleftover = n - frames[i]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tcount++\n\t\tleftover = n - frames[i]\n\t}\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "30ef09149c7ed2db987d0f6009526b51", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "9629609eb404b5c67f8b71f1f50f3335", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5107556536127965, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scanf(\"%d\", &n);\n fmt.Scanf(\"%d\", &a);\n fmt.Scanf(\"%d\", &b);\n}\n\nfunc Solve(na int32, nb int32, current int32) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var r0 int = 1000;\n var r1 int = 1000;\n var r2 int = 1000;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b);\n }\n if current < a && current < b {\n r2 = 1 + Solve(na, nb, n);\n }\n result := r0\n if r1 < result {\n result = r1\n }\n if r2 < result {\n result = r2\n }\n\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(Solve(4, 2, 0));\n}\n", "lang": "Go", "bug_code_uid": "296c569b6c6c62f09b52e022a1371544", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "2f9ae3561d075a12380a0b4bc68b8dcd", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.2773109243697479, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar k string\n\tfmt.Scan(&k)\n\tvar sum int\n\tfor i := 0; i < len(k); i++ {\n\t\ta, _ := strconv.Atoi(string(k[i]))\n\t\tsum += a\n\t}\n\tvar sub int\n\tsub = 10 - sum\n\tfmt.Println(k + strconv.Itoa(sub))\n}\n", "lang": "Go", "bug_code_uid": "b6cd5f9dcd0b7267b0d63415fbf9a7ff", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "904c2a8f07fefa17ec051d8b5a163384", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9964912280701754, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc is_perfect_like_mikey(i int) bool{\n s := 0\n for i > 0 {\n s+=(i%10)\n i=i/10\n }\n return(s==10)\n}\nfunc main() {\n mike_is_my_daddy := 0\n fmt.Scan(&mike_is_my_daddy)\n cnt := 0\n for i := 0; ; i++ {\n if(is_perfect_like_mikey(i)) {\n cnt++\n }\n if cnt == mike_is_daddy {\n fmt.Println(i)\n break\n }\n }\n}", "lang": "Go", "bug_code_uid": "8bb7e3544c4f4a8d2441421668cbbd0a", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "fe022a2b62b269b603f8b346dfb8b428", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.6153846153846154, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 17, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst s = 10\n\nfunc sumDig(n int) int {\n\ts := 0\n\tfor n != 0 {\n\t\ts += n % 10\n\t\tn /= 10\n\t}\n\treturn s\n}\n\nfunc main() {\n\tvar k int\n\tfmt.Scanf(\"%d\\n\", &k)\n\t//fmt.Printf(\"Scanned: %d\\n\", k)\n\tn := 15\n\tdp := make([][]int, n+1)\n\tfor i := 0; i <= n; i++ {\n\t\tdp[i] = make([]int, s+1)\n\t}\n\tdp[0][0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tif i == 1 {\n\t\t\tfor j := 1; j <= 9; j++ {\n\t\t\t\tdp[i-1][j] += dp[i-1][j-1]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 1; j <= 10; j++ {\n\t\t\t\tdp[i-1][j] += dp[i-1][j-1]\n\t\t\t}\n\t\t}\n\t\tif i == 1 {\n\t\t\tfor j := 1; j <= 10; j++ {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 0; j <= 10; j++ {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t}\n\t\t}\n\t\tif i == 1 {\n\t\t\tfor j := 9; j > 0; j-- {\n\t\t\t\tdp[i-1][j] -= dp[i-1][j-1]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 10; j > 0; j-- {\n\t\t\t\tdp[i-1][j] -= dp[i-1][j-1]\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Printf(\"%v\\n\", dp)\n\tvar ans int\n\ts := 10\n\tfor i := 15; i > 0; i-- {\n\t\tj := 0\n\t\tfor j = 0; j <= 9; j++ {\n\t\t\tif dp[i-1][s-j] < k {\n\t\t\t\tk -= dp[i-1][s-j]\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ts -= j\n\t\tans = j + ans*10\n\t}\n\tfmt.Println(ans)\n\t// fmt.Println(\"Hello World!\")\n}\n", "lang": "Go", "bug_code_uid": "187be24185ad3cd1a3d939752d84d068", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "8bbdb2ad4e758fb8e7caa911df0a482e", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5835866261398176, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var x int\n fmt.Scan(&x)\n x=10+x*9\n fmt.Print(x)\n}", "lang": "Go", "bug_code_uid": "86c7410957367a050982ca198d8c522c", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "dce762a3b43d74c03a0139097114a7df", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5043695380774033, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tmoves string\n\t)\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%d\\n%s\", &n, &moves)\n\n\tmoves = strings.Replace(moves, \"RU\", \"D\", -1)\n\tmoves = strings.Replace(moves, \"UR\", \"D\", -1)\n\tfmt.Println(len(moves))\n}\n", "lang": "Go", "bug_code_uid": "8dfcc1385dac7edc3a52d52caac1006d", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "087ee84511598ced8a859da0ae88226f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.42, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n int\n fmt.Scan(&n);\n var s string;\n fmt.Scan(&s);\n fmt.Println(n);\n fmt.Println(s);\n \n c:=0;\n for i:=0;i 0 {\n\t\t\tfor digits[i] > 0 {\n\t\t\t\tans = append(ans, byte(i+'0'))\n\t\t\t\tdigits[i]--\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0; i < 10; i++ {\n\t\tfor digits[i] > 0 {\n\t\t\tans = append(ans, byte(i+'0'))\n\t\t\tdigits[i]--\n\t\t}\n\t}\n\n\tif equal(ans, answer) {\n\t\tfmt.Println(\"OK\")\n\t} else {\n\t\tfmt.Println(\"WRONG_ANSWER\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "6260eae1f428957696e0095f5c824efb", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "91973c34a994474e976d1e107f058a22", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9426020408163265, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var a int\n var b int\n var c int\n fmt.Scanln(&a)\n fmt.Scanln(&b)\n\n digit := make([]int, 0, 10)\n for tmp:=a; tmp>0; {\n digit = append(digit, tmp%10)\n tmp /= 10\n }\n sort.Ints(digit)\n\n zeros := 0\n c = 0\n for _, x := range digit {\n if x == 0 {\n zeros++\n }else {\n if zeros > 0 {\n c = x\n for zeros > 0 {\n c *= 10\n zeros--\n }\n }else {\n c *= 10\n c += x\n }\n }\n }\n\n if b == c {\n fmt.Println(\"OK\")\n }else {\n fmt.Println(\"WRONG_ANSWER\")\n }\n}\n", "lang": "Go", "bug_code_uid": "4913acd86a1cc039ef8f8be15e03788e", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "be97df6e172aaa395c27d2f6bffb3240", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9844402277039849, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc Abs(x int) int {\n\tswitch {\n\tcase x < 0:\n\t\treturn -x\n\tcase x == 0:\n\t\treturn 0\n\t}\n\treturn x\n}\n\nfunc Max(x int, y int) int {\n\tif x >= y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Scan(args ...interface{}) (e error) { _, e = fmt.Fscan(in, args...); return }\nfunc Scanf(ft string, args ...interface{}) (e error) { _, e = fmt.Fscanf(in, ft, args...); return }\nfunc Scanln(args ...interface{}) (e error) { _, e = fmt.Fscanln(in, args...); return }\nfunc Print(args ...interface{}) { out.WriteString(fmt.Sprint(args...)) }\nfunc Printf(ft string, args ...interface{}) { out.WriteString(fmt.Sprintf(ft, args...)) }\nfunc Println(args ...interface{}) { out.WriteString(fmt.Sprintln(args...)) }\n\nvar (\n\tdataIn = \"data.in\"\n\tin = bufio.NewReader(os.Stdin)\n\t//in, _ = os.Open(dataIn)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nvar n int\n\nfunc bis(num int) int {\n\tl := 1\n\tr := num\n\tfor l <= r {\n\t\tmid := (l + r) >> 1\n\t\tif mid*(mid+1)/2 > num {\n\t\t\tr = mid - 1\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn r\n}\n\nfunc solve() {\n\tm := bis(n)\n\tif n == m*(m+1)/2 {\n\t\tPrintln(m)\n\t} else {\n\t\tPrintln(n - m*(m+1)/2)\n\t}\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tfor Scan(&n) != io.EOF {\n\t\tsolve()\n\t\tout.Flush()\n\t}\n\treturn\n}\n", "lang": "Go", "bug_code_uid": "815ca9410549bd0a25e7c63621f04f9e", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "9e5e8fa939399c84444e5445cf64b8f1", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9752066115702479, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc f(i int) int {\n i += 1\n for i%10 == 0 {\n i /= 10\n }\n return i\n}\n\nfunc main() {\n var N int\n fmt.Scan(&N)\n set := make(map[int]bool)\n cnt := 1\n for {\n N = f(N)\n if set[N] {\n break\n }\n set[N] = true\n cnt+=1\n }\n fmt.Println(cnt)\n}\n", "lang": "Go", "bug_code_uid": "cd27357123d321e9c563fbb0879f1c6b", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "4e5a5cf6ae4d8bc81c6fa95bf57b7634", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.4230769230769231, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\t_, _ = fmt.Scanf(\"%d\", &x)\n\n\tres := 1\n\n\tif x == 1 {\n\t\tfmt.Println(9)\n\t\treturn\n\t}\n\n\tfor x != 0 {\n\t\tx += 1\n\n\t\tfor x % 10 == 0 {\n\t\t\tx = x / 10\n\t\t}\n\n\t\tres += 1\n\t}\n\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "c7870e61b0b44802ebf57f6153ffc2dd", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "73c6d47839031569aa1b2cebefa956bc", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7301587301587301, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int64\n\tfmt.Scan(&x)\n\tm := make(map[int64]bool, 1e5)\n\tf := func(x int64) int64 {\n\t\tx++\n\t\tfor x%10 == 0 {\n\t\t\tx /= 10\n\t\t}\n\t\treturn x\n\t}\n\tm[x] = true\n\tfor {\n\t\tx = f(x)\n\t\tm[x] = true\n\t\tif x == 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(len(m))\n}\n", "lang": "Go", "bug_code_uid": "d2c107ca2f9e25b243bf752b11963859", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "396559de53376f861437ae5f432262bf", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.3861003861003861, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int32\n\ti = n\n\tvar ans int32\n\ti ++\n\tans += 2\n\tfor true{\n\t\tif(i == 10){\n\t\t\tbreak\n\t\t}\n\t\tif i % 10 == 0 {\n\t\t\tfor i % 10 == 0{\n\t\t\t\ti /= 10\n\t\t\t}\n\t\t}\n\t\ti ++\n\t\tans ++\n\t}\n\tfmt.Println(ans)\n\n\n\n\n}\n", "lang": "Go", "bug_code_uid": "08fcb7bf23919719e537a7ed3c304ee5", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "95cfe765b5aa1c6fe78c6e5d293b5d29", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9562398703403565, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool {\n cnt := 0\n for i := a; i < (a+2); i++ {\n for j := b; j < (b+2); j++ {\n if x[i][j] != x[a][b] { cnt++ }\n }\n }\n if cnt <= 1 { return true } else { return false }\n}\n\nfunc main() {\n var x [4]string\n for i := 0; i < 4; i++ {\n fmt.Scan(&x[i])\n }\n ans := false\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if check(x,i,j) {\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang": "Go", "bug_code_uid": "ef5c92c02da853afdd131c48bb8c136a", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "67b4cfc9f954e792efb792e36e236e15", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5259433962264151, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ts := make([]string, 4)\n\tfor i := range s {\n\t\tfmt.Scanln(&s[i])\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tcnt := 0\n\t\t\tif s[i][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif cnt <= 1 || cnt >= 3 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "2ed4dc88997d29ddc60b0c61ed673c74", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "479ebb0b3b0bbcdb139307cf09b16755", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5604060913705584, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar n int\nvar a []int\n\nfunc main() {\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\tfmt.Fscanf(reader, \"%d%d\\n\", &n)\n\ta = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(reader, \"%d\", &a[i])\n\t}\n\n\tans := 0\n\tfor i := 2; i <= 100; i++ {\n\t\tflag := false\n\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[j] == -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[j]%i == 0 {\n\t\t\t\ta[j] = -1\n\t\t\t\tflag = true\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "e388e4b35c7288fa5728a1926b3e42d1", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "474c66561c3195b07a9187f78ece1f47", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.12262773722627737, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport \"testing\"\n\nfunc Test_paintTheNumbers(t *testing.T) {\n\ttype args struct {\n\t\tn int\n\t\tslice []int\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twant int\n\t}{\n\t\t{\n\t\t\tname: \"TC_01\",\n\t\t\targs: args{\n\t\t\t\tn: 6,\n\t\t\t\tslice: []int{10, 2, 3, 5, 4, 2},\n\t\t\t},\n\t\t\twant: 3,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tif got := paintTheNumbers(tt.args.n, tt.args.slice); got != tt.want {\n\t\t\t\tt.Errorf(\"paintTheNumbers() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n", "lang": "Go", "bug_code_uid": "586077eb3342b88e46eb8098885d00d2", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "c32c62558d7ed2b91261a484ffb8ca81", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9735563950350783, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc main() {\n\tdefer writer.Flush()\n\tch := string(\"\")\n\tscanf(\"%s\", &ch)\n\tnum := []byte(ch)\n\ts1 := uint64(1)\n\tfor _, char := range num {\n\t\ts, _ := strconv.ParseUint(string(char), 10, 64)\n\t\ts1 *= s\n\t}\n\tfor i, char := range num {\n\t\tif char == '0' {\n\t\t\tbreak\n\t\t}\n\t\tnum1 := []byte{}\n\t\tnum1 = num\n\t\tnum1[i] = num[i] - 1\n\t\ts2 := uint64(1)\n\t\tfor j, char := range num1 {\n\t\t\tvar number uint64\n\t\t\tif j <= i {\n\t\t\t\tnumber, _ = strconv.ParseUint(string(char), 10, 64)\n\t\t\t\tif number == 0 {\n\t\t\t\t\tnumber = 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnumber = 9\n\t\t\t}\n\t\t\ts2 *= number\n\t\t}\n\t\tif s2 > s1 {\n\t\t\ts1 = s2\n\t\t}\n\t}\n\tprintf(\"%d\\n\", s1)\n\n}\n", "lang": "Go", "bug_code_uid": "acdc4514d5142b4bc75ee25d680aaca7", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "48364f91112eb5d78b9478da8b4086fb", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6314152410575428, "equal_cnt": 23, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 22, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tvar n int64\n\tfmt.Fscanf(buf, \"%d\\n\", &n)\n\n\tmat := make([]int64, 20)\n\tlen := 0\n\tfor n > 0 {\n\t\tmat[len] = n % int64(10)\n\t\tn /= 10\n\t\tlen++\n\t}\n\tfor i := len - 1; i >= 0; i-- {\n\t\tif mat[i] == 0 {\n\t\t\tfor j := i + 1; j < len; j++ {\n\t\t\t\tmat[j]--\n\t\t\t\tif mat[j] > 0 || (mat[j] == 0 && j == len-1) {\n\t\t\t\t\tfor k := j - 1; k >= 0; k-- {\n\t\t\t\t\t\tmat[k] = 9\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\t//fmt.Printf(\"%v\\n\",mat)\n\tfor i := len; i >= 0; i-- {\n\t\tif mat[i] > 0 {\n\t\t\tlen = i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\tvar le int64 = 1\n\tvar ans int64 = 1\n\tvar tmp int64 = 1\n\tfor i := 0; i < len; i++ {\n\t\tans *= mat[i]\n\t\tle *= 9\n\t}\n\t//fmt.Printf(\"-%d len=%d %v\\n\",ans,len,mat)\n\n\tfor i:=len-1;i>=0;i--{\n\t\tle/=9\n\t\tif mat[i] > 1{\n\t\t\tif tmp*(mat[i]-1)*le > ans{\n\t\t\t\tans=tmp*(mat[i]-1)*le\n\t\t\t}\n\t\t}\n\t\ttmp *= mat[i]\n\t}\n\tfmt.Printf(\"%d\\n\",ans)\n}\n", "lang": "Go", "bug_code_uid": "3329f44eb86090931afc5edcf05a25e0", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "6b3d4e09e2974a5afaed00ca3f831994", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9953007518796992, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, x := nextInt64(), nextInt64()\n\tcnt := 0\n\ti := int64(0)\n\n\tfor i = 1; i <= n && i*i < x; i++ {\n\t\tif x%i == 0 && x/i <= n {\n\t\t\tcnt += 2\n\t\t}\n\t}\n\n\tif i*i == x {\n\t\tcnt += 1\n\t}\n\n\tprintln(cnt)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang": "Go", "bug_code_uid": "7d65180f66fb84d6ce3602d5fac38f23", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "b843d3ba933657f202aad747ffd62a66", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5835866261398176, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "\n\nimport \"fmt\"\nfunc ptich(x,n int) int{\n dem := 2\n i := 2\n for ; i * i < x; i++{\n if x % i == 0 && i <= n && x / i <= n{\n dem += 2\n }\n }\n if i * i == x{\n dem++\n }\n return dem\n}\nfunc main() {\n var n, x int\n fmt.Scanf(\"%d%d\",&n,&x)\n fmt.Println(ptich(x,n))\n}", "lang": "Go", "bug_code_uid": "2261d8eb6dc6ed2dcd73292162e8762f", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "4f922891165985e93e5f62056cae7401", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9973474801061007, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main \n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a... interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\n\nfunc printf(f string, a... interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\n\nfunc main() {\n\tvar T, x, result, i, j uint64\n\tscanf(\"%d %d\\n\", &T, &x)\n\t\n\tresult = 0\n\n\tif x <= 10 {\n\t\tresult++\n\t}\n\tfor i=2; i<=T; i++ {\n\t\tif x % i == 0 {\n\t\t\tfor j=1; j<=T; j++ {\n\t\t\t\tif x == i * j {\n\t\t\t\t\tresult++\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\n\tfmt.Println(result)\n\t\n}\n\n", "lang": "Go", "bug_code_uid": "7c63aea9cad2a7b401dfa4729f8079f0", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "fe4cfd43e0c1cd73f5a0cb5efba37ff4", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9862010701210927, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []Pair) []Pair {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i].first > arr[right].first {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc sort2(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort2(arr[:left])\n\tsort2(arr[left+1:])\n\treturn arr\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 min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar n, x, r int64\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &x)\n\tfor i := int64(1); i <= int64(math.Sqrt(float64(x))); i++ {\n\t\tif x % i == 0 && x / i <= n {\n\t\t\tr += 2\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}", "lang": "Go", "bug_code_uid": "19ddc5f162f5d564f60c207cbb91a242", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "6342f2a491f6a36b9a1732aad214372f", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9987593052109182, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a,b int) int {\n\tif(a < b){\n\t\treturn a\n\t\t}\n\treturn b\n}\nfunc ab(x int) int {\n\tif(x <= -1){\n\t\tx *= -1\n\t}\n\treturn x\n}\n//a b c d e f g h j k l m n o p q r s t u v w x y z\nfunc calc(s string) (res int) {\n\n\tres += min(ab(int(s[0]) - int('A')) ,ab(int('Z') - int(s[0])) + 1)\n\tres += min(ab(int(s[1]) - int('C')),ab(int('Z') - int(s[1])) + 3)\n\tres += min(ab(int(s[2])- int('T')),min(ab(int('Z') - int(s[2])) + 20,ab(int('A') - int(s[2]))+6))\n\tres += min(ab(int(s[3])- int('G')),ab(int('Z') - int(s[3])) + 7)\n\treturn\n}\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tans := 123456789\n\tfor i := 0 ; i < n - 3;i++{\n\t\ttemp := \"\"\n\t\tfor j := i ; j <= i + 3;j++{\n\t\t\ttemp += string(s[j])\n\t\t}\n\t\tans = min(ans,calc(temp))\n\t}\n\tfmt.Print(ans)\n\t// 1\n\t//3\n\t//6\n\t//7\n\n}\n", "lang": "Go", "bug_code_uid": "b18cac489dc3791a2d0025d7fe6f5da3", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "1fd8eb7a81151423400fe09a76518bdc", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8017353579175704, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\nfunc getLine2Int() (n int) {\n\tscanf(\"%d\\n\", &n)\n\treturn\n}\nfunc getLine2Int2() (a, b int) {\n\tscanf(\"%d %d\\n\", &a, &b)\n\treturn\n}\nfunc dis(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n\n}\n\nvar debug = false\n\nfunc see(a interface{}) {\n\tif debug {\n\t\tprintf(\"DEBUG:%v\\n\", a)\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tn := getLine2Int()\n\ts := getLine()\n\tmin := 52\n\tfor i := 3; i < n; i++ {\n\t\ttmp := 13 - dis(int(s[i-3]-'A')%26, 13)\n\t\tsee(tmp)\n\t\ttmp += 13 - dis(int(s[i-2]-'C')%26, 13)\n\t\tsee(tmp)\n\t\ttmp += 13 - dis(int(s[i-1]-'T')%26, 13)\n\t\tsee(tmp)\n\t\ttmp += 13 - dis(int(s[i]-'G')%26, 13)\n\t\tsee(tmp)\n\t\tif min > tmp {\n\t\t\tmin = tmp\n\t\t}\n\t}\n\tprintf(\"%d\\n\", min)\n}\n", "lang": "Go", "bug_code_uid": "161c9832082882120dcb37a396078a1d", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "ee18598c55c3714e734dd6c0f2653b08", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.24051803885291398, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\"fmt\"\n\"bufio\"\n\"strconv\"\n\"bytes\"\n\"os\"\n)\n\nfunc solve(k, a, b int64) int64 {\n\tc := a / k + b / k\n\tfmt.Printf(\"%d %d %d\\n\", k, a, b)\n\tif k * c <= a + b && a + b <= c * (2 * k - 1) {\n\t\treturn c\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 1<<16)\n\ts, _, _ := r.ReadLine()\n\tss := bytes.SplitN(s, []byte{' '}, 3)\n\tk, _ := strconv.ParseInt(string(ss[0]), 10, 32)\n\ta, _ := strconv.ParseInt(string(ss[1]), 10, 32)\n\tb, _ := strconv.ParseInt(string(ss[2]), 10, 32)\n\tfmt.Printf(\"%d\\n\", solve(k, a, b))\n}\n", "lang": "Go", "bug_code_uid": "8ea54d039fe1cbafb7dba01164e45bd6", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "37587e517f8cb314f5ecdad7c6393a32", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9960886571056062, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc solve(k, a, b int64) int64 {\n\ta0 := a / k\n\tb0 := b / k\n\tif a - a0 * k > b0 * (k - 1) {\n\t\treturn -1\n\t}\n\tif b - b0 * k > a0 * (k - 1) {\n\t\treturn -1\n\t}\n\treturn a0 + b0\n}\n\nfunc main() {\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\tk := cin.nextInt64()\n\ta := cin.nextInt64()\n\tb := cin.nextInt64()\n\tfmt.Printf(\"%d\\n\", solve(k, a, b))\n}\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr := r*10 + (p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr := r*10 + (p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang": "Go", "bug_code_uid": "b6485b5c5a73b0fe9cc868520064cd2b", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "37587e517f8cb314f5ecdad7c6393a32", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9846153846153847, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text, \"\\r\\n\")\n\n\ttext, _ = reader.ReadString('\\n')\n\ttext = strings.TrimRight(text, \"\\r\\n\")\n\n\tyes := false\n\tif strings.Contains(text, \"0\") {\n\t\tif strings.ContainsAny(text, \"123\") {\n\t\t\tyes = true\n\t\t}\n\t} else {\n\t\tif strings.ContainsAny(text, \"123\") && strings.ContainsAny(text, \"79\") {\n\t\t\tif strings.ContainsAny(text, \"147\") && strings.ContainsAny(text, \"369\") {\n\t\t\t\tyes = true\n\t\t\t}\n\t\t}\n\t}\n\tif yes {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "e4b5256b1f8d25530f358b9cfbe1e9f7", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "d6b059bbf073654b8cc5822ef99c0c11", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9810055865921787, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc digit2pos(a int) (int, int) {\n\tif a == 0 {\n\t\treturn 3, 1\n\t}\n\ta--\n\treturn a / 3, a % 3\n}\n\nfunc legal(y, x int) bool {\n\tif y == 3 {\n\t\treturn x == 1\n\t}\n\treturn y >= 0 && y <= 3 && x >= 0 && x <= 3\n}\n\n// apply a→b like move to x\nfunc move(x, a, b int) int {\n\tay, ax := digit2pos(a)\n\tby, bx := digit2pos(b)\n\n\tpy, px := digit2pos(x)\n\n\tpy += by - ay\n\tpx += bx - ax\n\n\tif !legal(py, px) {\n\t\treturn -1\n\t}\n\tif py == 3 {\n\t\treturn 0\n\t}\n\treturn 1 + py*3 + px\n}\n\nfunc main() {\n\tn := getInt()\n\tw := getWord()\n\n\tvar cnt int\n\tfor f := 0; f <= 9; f++ {\n\t\tx := f\n\t\tfor j := 1; j < n; j++ {\n\t\t\tx = move(x, int(w[j-1]-'0'), int(w[j]-'0'))\n\t\t\tif x == -1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif x != -1 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\ntype Input struct {\n\t*bufio.Scanner\n}\n\nvar globalInput = wrapStdin()\n\nfunc wrapStdin() Input {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn Input{Scanner: sc}\n}\nfunc getInt() int {\n\tglobalInput.Scan()\n\tx, _ := strconv.Atoi(globalInput.Text())\n\treturn x\n}\nfunc getIntOk() (int, bool) {\n\tok := globalInput.Scan()\n\tx, _ := strconv.Atoi(globalInput.Text())\n\treturn x, ok\n}\nfunc getNint(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv[i] = getInt()\n\t}\n\treturn v\n}\nfunc getVint(v []int) bool {\n\tvar ok bool\n\tfor i := 0; i < len(v); i++ {\n\t\tv[i], ok = getIntOk()\n\t}\n\treturn ok\n}\nfunc getWord() string {\n\tglobalInput.Scan()\n\treturn globalInput.Text()\n}\nfunc getWordOk() (string, bool) {\n\tok := globalInput.Scan()\n\treturn globalInput.Text(), ok\n}\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 b\n\t}\n\treturn a\n}\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc minStr(a, b string) string {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc maxStr(a, b string) string {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc remin(a *int, b int) bool {\n\tif b < *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remax(a *int, b int) bool {\n\tif b > *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remin64(a *int64, b int64) bool {\n\tif b < *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remax64(a *int64, b int64) bool {\n\tif b > *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc reminStr(a *string, b string) bool {\n\tif b < *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remaxStr(a *string, b string) bool {\n\tif b > *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc abs64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\ntype (\n\tFLess func(i, j int) bool\n\tFSwap func(i, j int)\n\twrapSort struct {\n\t\tLength int\n\t\tFLess\n\t\tFSwap\n\t}\n)\n\nfunc (w *wrapSort) Len() int { return w.Length }\nfunc (w *wrapSort) Less(i, j int) bool { return w.FLess(i, j) }\nfunc (w *wrapSort) Swap(i, j int) { w.FSwap(i, j) }\nfunc wsort(length int, fless func(i, j int) bool, fswap func(i, j int)) {\n\tsort.Sort(&wrapSort{length, fless, fswap})\n}\n", "lang": "Go", "bug_code_uid": "995da0ef7d8643c3dd030b30efd34b3d", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "38a6dc725cc23f52a18eb018a7b7fb43", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9984871406959153, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tnames := []string{\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"}\n\tvar n float64\n\tfmt.Scan(&n)\n\ti := 0.0\n\tfor {\n\t\tfull := 5 * math.Pow(2.0, float64(i))\n\t\tif full > n {\n\t\t\tbreak\n\t\t}\n\t\tn -= full\n\t\ti++\n\t}\n\tfmt.Println(names[int(math.Ceil(n/math.Pow(2.0, float64(i))))-1])\n}\n", "lang": "Go", "bug_code_uid": "b52990b991d12162251e7b7387f6a76b", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "6622a954332d230a181f1862af8149f9", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.16775884665792923, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar arr []int = []int{1, 2, 3, 4, 5}\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfor i := 1; i < n; i++ {\n\t\tarr = append(arr[1:], arr[0], arr[0])\n\t}\n\tswitch arr[0] {\n\tcase 1:\n\t\tfmt.Println(\"Sheldon\")\n\tcase 2:\n\t\tfmt.Println(\"Leonard\")\n\tcase 3:\n\t\tfmt.Println(\"Penny\")\n\tcase 4:\n\t\tfmt.Println(\"Rajesh\")\n\tcase 5:\n\t\tfmt.Println(\"Howard\")\n\t}\n}", "lang": "Go", "bug_code_uid": "8e162f428459778823153f14f7d13693", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "8d099b8c0ba6c6674067ae795fd8384f", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9788135593220338, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var plus,num,current int\n current=0\n plus=1 \nfmt.Scan(&num)\nfor current= num {\nfmt.Println(\"Sheldon\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Leonard\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Penny\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Rajesh\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Howard\")\nbreak\n}\nplus++\n}\n}", "lang": "Go", "bug_code_uid": "580697c2c615fd91300ff199ea9eb2a9", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "8954287105497d0f9f7fa7cbe514866e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8389830508474576, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 18, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n names := [...]string{\"Sheldon\",\"Leonard\",\"Penny\",\"Rajesh\",\"Howard\"}\n fmt.Scan(&n)\n p := 1\n for n > (5*p) {\n n -= (5*p)\n p *= 2\n }\n fmt.Println(ans[(n-1)/p])\n}", "lang": "Go", "bug_code_uid": "0a7510d6ca0f872c6f5b28dee01627e6", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "3098625253a0022a0495630c146e1a61", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9632695292291774, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n \"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n n := getI()\n d2 := n*n\n\n result := 0\n if n > 0 {\n result += 4\n }\n if n > 1 {\n x := int(float64(n)/math.Sqrt(2))\n if (x+1)*(x+1) + x*x > d2 {\n result += 4\n }\n }\n\n x, y := n, 0\n for true {\n y++\n for x*x + y*y > d2 {\n x--\n }\n if x <= y {\n break\n }\n result += 8\n }\n\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang": "Go", "bug_code_uid": "ac492e526aace99c67c7ee66eb6790e0", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "4c9d5a6be71ba0adb7e8543a4fab373e", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.842443729903537, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "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\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tfingers := 0\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := 0; i < n && scanner.Scan(); i++ {\n\t\ta, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tfingers += a\n\t}\n\n\tfingers %= (n + 1)\n\tif fingers == 0 {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfmt.Println(1)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "df84276eaccdf0f204aade156aeb09bd", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "8849d7b8578339b8bd55cc66847d9be0", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6160337552742616, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,a int\n fmt.Scan(&n)\n total := 0\n for i := 0; i < n; i++ {\n fmt.Scan(&a)\n total += a\n }\n total--\n n++\n if total%n == 0 {\n fmt.Println(1)\n } else {\n for i := 1; i <= 5; i++ {\n if (total+i)%n != 0 {\n fmt.Println(i)\n break\n }\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "8d85c90ed9a0f82d8cffea5e1bdbeb65", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "3855be4f3ca193784072bdfde356e590", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.2884990253411306, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport\n\t\"fmt\"\n\nfunc main() {\n\t var n,ans,size,sum int\n fmt.Scanf(\"%d\",&n)\n size=n+1\n for j:=0;j bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int64\n)\n\nfunc main() {\n\tn = readInt64()\n\n\tans := 0\n\tfor {\n\t\tans++\n\t\tif IsPrime(n) {\n\t\t\tbreak\n\t\t}\n\n\t\tp := sub(n - 2)\n\t\tn -= p\n\t}\n\tfmt.Println(ans)\n}\n\n// n以下の最大の素数を返す\nfunc sub(n int64) int64 {\n\tfor i := n; i >= 2; i-- {\n\t\tif IsPrime(i) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 1\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int64) bool {\n\tvar i int64\n\n\tif n == 1 {\n\t\treturn false\n\t}\n\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\n\treturn true\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", "lang": "Go", "bug_code_uid": "feddecc73bc71a45a71cb9e4257d025e", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "ca76bd387f66abaad8c43c2236e0391a", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.87248322147651, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"io/ioutil\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\tvar path string\n\tfmt.Fscanf(reader, \"%s\\n\", &path)\n\tb := []byte(path)\n\tfor i := 0;i < len(b);i ++ {\n\t\tif i == 0 || b[i] != '/' || b[i - 1] != '/' {\n\t\t\tfmt.Printf(\"%c\", b[i])\n\t\t}\n\t}\n\n}", "lang": "Go", "bug_code_uid": "5351d51adba3aae8ed3a6d2f0a0fb792", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "76cb6dccd8ca221371d061c647a495c1", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9976525821596244, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n s := getS()\n chars := []byte{ s[0] }\n for i := 1; i < len(s); i++ {\n if s[i] != '/' || s[i-1] != '/' {\n chars = append(chars, s[i])\n }\n }\n if len(chars) > 1 && s[len(chars)-1] == '/' {\n chars = chars[:len(chars)-1]\n }\n writer.WriteString(fmt.Sprintf(\"%s\\n\", string(chars)))\n}\n", "lang": "Go", "bug_code_uid": "98bcaea3faa0b35da6834d14e57a8500", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "d659bd0ce91f65f35b2ef3dcb26a9fc9", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9005847953216374, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tpos := [201][201]int{}\n\tx, y := 100, 100\n\tpos[x][y] = 1\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tb := []byte(s)\n\n\tfor i := 0; i < len(b); i++ {\n\t\tswitch b[i] {\n\t\tcase 'L':\n\t\t\tx--\n\t\tcase 'R':\n\t\t\tx++\n\t\tcase 'U':\n\t\t\ty--\n\t\tcase 'D':\n\t\t\ty++\n\t\t}\n\t\tif pos[x][y] == 1 {\n\t\t\tfmt.Printf(\"BUG\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"OK\")\n}\n", "lang": "Go", "bug_code_uid": "65e46ee53a5f94321d5e2d49379b34b1", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "5a716ac97472d8a4bdc1d1e7bab4e364", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9813664596273292, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype position struct {\n\tx, y int\n}\n\nfunc solve() {\n\tm := readString()\n\tpos := position{0, 0}\n\tbadpos := make(map[position]bool)\n\n\tfor _, c := range m {\n\t\tif badpos[pos] {\n\t\t\tfmt.Println(\"BUG\")\n\t\t\treturn\n\t\t}\n\t\tbadpos[pos] = true\n\n\t\tup := position{pos.x, pos.y + 1}\n\t\tdown := position{pos.x, pos.y - 1}\n\t\tright := position{pos.x + 1, pos.y}\n\t\tleft := position{pos.x - 1, pos.y}\n\n\t\tswitch c {\n\t\tcase 'U':\n\t\t\tbadpos[down] = true\n\t\t\tbadpos[left] = true\n\t\t\tbadpos[right] = true\n\t\t\tpos = up\n\t\t\tbreak\n\t\tcase 'D':\n\t\t\tbadpos[up] = true\n\t\t\tbadpos[left] = true\n\t\t\tbadpos[right] = true\n\t\t\tpos = down\n\t\t\tbreak\n\t\tcase 'L':\n\t\t\tbadpos[up] = true\n\t\t\tbadpos[down] = true\n\t\t\tbadpos[right] = true\n\t\t\tpos = left\n\t\t\tbreak\n\t\tcase 'R':\n\t\t\tbadpos[up] = true\n\t\t\tbadpos[down] = true\n\t\t\tbadpos[left] = true\n\t\t\tpos = right\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(\"OK\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n", "lang": "Go", "bug_code_uid": "546fe934e74b9b948734875121d911a1", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "eb035a2952dd08b855fda9ed79510906", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9959677419354839, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "// https://codeforces.com/contest/8/problem/B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tvar str string\n\tfmt.Fscanln(input, &str)\n\n\tconst L = 100*3\n\tf := make([][]int, L)\n\tfor i := 0; i < L; i++ {\n\t\tf[i] = make([]int, L)\n\t}\n\n\tl, c := 150, 150\n\tf[l][c] = 1\n\tfor i := 0; i < len(str); i++ {\n\t\tswitch str[i] {\n\t\tcase 'L': c--\n\t\tcase 'R': c++\n\t\tcase 'D': l++\n\t\tcase 'U': l--\n\t\t} \n\n\t\tif f[l][c] > 0 {\n\t\t\tfmt.Print(\"BUG\")\n\t\t\treturn\n\t\t}\n\n\t\tf[l][c] = i + 2\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif (str[i] != 'D' && f[l - 1][c] > 0 && f[l][c] - f[l - 1][c] <= 3) || \n\t\t(str[i] != 'U' && f[l + 1][c] > 0 && f[l][c] - f[l + 1][c] <= 3) || \n\t\t(str[i] != 'R' && f[l][c - 1] > 0 && f[l][c] - f[l][c - 1] <= 3) || \n\t\t(str[i] != 'L' && f[l][c + 1] > 0 && f[l][c] - f[l][c + 1] <= 3) {\n\t\t\tfmt.Print(\"BUG\")\n\t\t\treturn\n\t\t}\n\t}\n\n\n\tfmt.Print(\"OK\")\n}\n", "lang": "Go", "bug_code_uid": "1f7a9533beceaec7b827c07cde63ee86", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "d8bd5e18bcc713cafc63c78cedb4913a", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8339602364320258, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "// https://codeforces.com/contest/8/problem/B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tvar str string\n\tfmt.Fscanln(input, &str)\n\n\tconst L = 100*3\n\tf := make([][]int, L)\n\tfor i := 0; i < L; i++ {\n\t\tf[i] = make([]int, L)\n\t}\n\n\tl, c := 150, 150\n\tf[l][c] = true\n\tfor i := 0; i < len(str); i++ {\n\t\tswitch str[i] {\n\t\tcase 'L': c--\n\t\tcase 'R': c++\n\t\tcase 'D': l++\n\t\tcase 'U': l--\n\t\t} \n\n\t\tif f[l][c] > 0 {\n\t\t\tfmt.Print(\"BUG\")\n\t\t\treturn\n\t\t}\n\n\t\tif (f[l - 1][c] > 0 && f[l - 1][c] < i - 1) || \n\t\t(f[l + 1][c] > 0 && f[l + 1][c] < i - 1) || \n\t\t(f[l][c - 1] > 0 && f[l][c - 1] < i - 1) || \n\t\t(f[l][c - 1] > 0 && f[l][c - 1] < i - 1) {\n\t\t\tfmt.Print(\"BUG\")\n\t\t\treturn\n\t\t}\n\n\t\tf[l][c] = i + 1\n\t}\n\n\n\tfmt.Print(\"OK\")\n}\n", "lang": "Go", "bug_code_uid": "3fda5301b954cca2035d055a072167d6", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "d8bd5e18bcc713cafc63c78cedb4913a", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5756302521008403, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar x string\n\tScan(&x)\n\tn := len(x)\n\tif n == 1 {\n\t\tPrint(x)\n\t\treturn\n\t}\n\tdata := []byte(x)\n\tsum := 0\n\tfor _, c := range x {\n\t\tsum += int(c - '0')\n\t}\n\tif x[1] == '9' {\n\t\tdata[1] = '8'\n\t\tx9 := strings.Repeat(\"9\", n-2)\n\t\tif newSum := int(data[0]-'0') + 8 + 9*(n-2); newSum <= sum {\n\t\t\tPrint(x)\n\t\t\treturn\n\t\t}\n\t\tPrint(string(data[0]) + \"8\" + x9)\n\t\treturn\n\t}\n\tdata[0]--\n\tx9 := strings.Repeat(\"9\", n-1)\n\tif newSum := int(data[0]-'0') + 9*(n-1); newSum <= sum {\n\t\tPrint(x)\n\t\treturn\n\t}\n\tif data[0] == '0' {\n\t\tPrint(x9)\n\t} else {\n\t\tPrint(string(data[0]) + x9)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d7cf3e858648a91a258c0c302534e725", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "df8899d7c58968f6348f181961e00b9b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9869888475836431, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int\nvar sum [60]int\nvar dp [60]int\nvar pie [60]int\n\nfunc main() {\n fmt.Scan(&n)\n for i := n; i >= 1; i-- {\n fmt.Scan(&pie[i])\n }\n for i := 1; i <= n; i++ {\n sum[i] = sum[i-1] + pie[i]\n if dp[i-1] > sum[i-1]-dp[i-1]+pie[i] {\n dp[i] = dp[i-1]\n } else {\n dp[i] = sum[i-1] - dp[i-1] + pie[i]\n }\n }\n fmt.Println(dp[n], sum[n]-dp[n])\n}", "lang": "Go", "bug_code_uid": "a328dc07e6fc7e0beffdb0b4d80fb0e3", "src_uid": "414540223db9d4cfcec6a973179a0216", "apr_id": "0f6628527a97061e3f72e0483b731d04", "difficulty": 1500, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8181818181818182, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\ntype Int int64\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n, l Int\n\tfor I(&n, &l) == nil {\n\t\tsolve(n, l)\n\t}\n}\n\nfunc solve(n, l Int) {\n\ta, aa, b, bb := make(arr, n), make(arr, n), make(arr, n), make(arr, n)\n\tfor i := Int(0); i < n; i++ {\n\t\tI(&a[i])\n\t}\n\tfor i := Int(0); i < n; i++ {\n\t\tI(&b[i])\n\t}\n\taa[0] = l - a[n-1] + a[0]\n\tbb[0] = l - b[n-1] + b[0]\n\tfor i := Int(1); i < n; i++ {\n\t\taa[i] = a[i] - a[i-1]\n\t\tbb[i] = b[i] - b[i-1]\n\t}\n\tsort.Sort(aa)\n\tsort.Sort(bb)\n\tfor i := Int(0); i < n; i++ {\n\t\tif aa[i] != bb[i] {\n\t\t\tO(\"NO\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tO(\"YES\\n\")\n}\n\ntype arr []Int\n\nfunc (a arr) Len() int { return len(a) }\nfunc (a arr) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a arr) Less(i, j int) bool { return a[i] < a[j] }\n", "lang": "Go", "bug_code_uid": "238ceae6dac7a8b00b40a3bdb2ea4f89", "src_uid": "3d931684ca11fe6141c6461e85d91d63", "apr_id": "2064741ac904fde85b2611938e87c105", "difficulty": 1300, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9984202211690363, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc cmp_slice_int(a, b []int) bool {\n\tla, lb := len(a), len(b)\n\tif la != lb {\n\t\treturn false\n\t}\n\tfor i, v := range a {\n\t\tif v != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar n, l int\n\tfmt.Scanln(&n, &l)\n\n\ta := make([]int, n, n)\n\tb := make([]int, n, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\n\tfor i := 1; i < l; i++ {\n\t\tif cmp_slice_int(a, b) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < n; j++ {\n\t\t\ta[j]++\n\t\t}\n\t\tif a[n-1] >= l {\n\t\t\ta = append(a[n-1:], a[:n-1]...)\n\t\t\ta[0] = a[0] % l\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n", "lang": "Go", "bug_code_uid": "0ad50fdf5b8b07c14883f9c4cb327830", "src_uid": "3d931684ca11fe6141c6461e85d91d63", "apr_id": "de7ef68ff90b58407cc07054d0ec6ee4", "difficulty": 1300, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.99958796868562, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// B. Internet Address\n/*\nVasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format:\n\t\t\t://.ru[/]\n\nwhere:\n\n can equal either \"http\" (without the quotes) or \"ftp\" (without the quotes),\n is a non-empty string, consisting of lowercase English letters,\n\t \tthe / part may not be present. If it is present, then is a non-empty string, consisting of lowercase English letters.\n\nIf string isn't present in the address, then the additional character \"/\" isn't written. Thus, the address has either two characters \"/\" (the ones that go before the domain), or three (an extra one in front of the context).\n\nWhen the boy came home, he found out that the address he wrote in his notebook had no punctuation marks. Vasya must have been in a lot of hurry and didn't write characters \":\", \"/\", \".\".\n\nHelp Vasya to restore the possible address of the recorded Internet resource.\n\nInput\nThe first line contains a non-empty string that Vasya wrote out in his notebook. This line consists of lowercase English letters only.\n\nIt is guaranteed that the given string contains at most 50 letters. It is guaranteed that the given string can be obtained from some correct Internet resource address, described above.\n\nOutput\nPrint a single line — the address of the Internet resource that Vasya liked. If there are several addresses that meet the problem limitations, you are allowed to print any of them.\n\nExamples\nInput\nhttpsunrux\n\nOutput\nhttp://sun.ru/x\n\nInput\nftphttprururu\n\nOutput\nftp://http.ru/ruru\n\nNote\nIn the second sample there are two more possible answers: \"ftp://httpruru.ru\" and \"ftp://httpru.ru/ru\".\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ts, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(s), \"\")\n\n\tpIndex := 3\n\turl := \"ftp://\"\n\tif arr[0] == \"h\" {\n\t\tpIndex = 4\n\t\turl = \"http://\"\n\t}\n\n\tcIndex := len(arr)\n\tfor i := pIndex + 1; i < len(arr)-1; i++ {\n\t\tif arr[i] == \"r\" && arr[i+1] == \"u\" {\n\t\t\tcIndex = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif cIndex < len(arr) {\n\t\tfmt.Printf(\"%v%v.ru/%v\", url, strings.Join(arr[pIndex:cIndex], \"\"), strings.Join(arr[cIndex+2:], \"\"))\n\t} else {\n\n\t\tfmt.Printf(\"%v%v.ru\", url, strings.Join(arr[pIndex:cIndex], \"\"))\n\t}\n}\n", "lang": "Go", "bug_code_uid": "f832cf233c010e4a0634ac43f92cc1f1", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "3624cf8b5796f439d18a511a50502938", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8056628056628057, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n n, m := getI(), getI()\n for {\n for i := 1; i <= n; i++ {\n if i > m {\n writer.WriteString(fmt.Sprintf(\"%d\\n\", m))\n return\n } \n m -= i\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "6365276252501e66cbdbad8ecb2ebbee", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "f91527a71ea8d5b0edbfc7cd637a4f2b", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6167741935483871, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int8\n\t\tk int8\n\t\ti int8\n\t)\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\tas := make([]int8, n)\n\tfor i < n{\n\t\tfmt.Scan(&as[i])\n\t\ti++\n\t}\n\tvk := as[k]\n\tif vk == 0 {\n\t\tfmt.Printf(\"0\\n\")\n\t\treturn\n\t}\n\ts := k\n\tfor _, v := range as[k:] {\n\t\tif v < vk {\n\t\t\tbreak\n\t\t}\n\t\ts ++\n\t}\n\tfmt.Printf(\"%d\\n\", s)\n}\n", "lang": "Go", "bug_code_uid": "118ecbff4d99968c2bb0041b2abf073b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c45b8a7b8c2b827ed6b4c4dc7af5415d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.89453125, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\n\tvar numberOfParticipants, rating int = 0, 0\n\t_, _ = fmt.Scan(&numberOfParticipants)\n\t_, _ = fmt.Scan(&rating)\n\n\tvar slice = make([]int, numberOfParticipants)\n\tfor i := 0; i < numberOfParticipants; i++ {\n\t\t_, _ = fmt.Scan(&slice[i])\n\t}\n\n\tif slice[0] == 0 {\n\t\tfmt.Println(0)\n\t\tos.Exit(0)\n\t}\n\n\tfor i := rating; i < len(slice); i++ {\n\t\tif slice[i] == slice[i+1] {\n\t\t\trating++\n\t\t\tcontinue\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\trating++\n\n\tfmt.Println(rating)\n\n}\n", "lang": "Go", "bug_code_uid": "2230be045493a9ae86bb80bdf60889db", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "24d385caee455fa0028597c17eff9204", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6286836935166994, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn, k, ans int\n\t\ta [102]int\n\t)\n\tfmt.Scan(&n, &k)\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tans = 0\n\tif a[k] > 0 {\n\t\tans = k\n\t}\n\n\tfor ; a[k] == a[k+1]; k++ {\n\t}\n\tif ans > 0 {\n\t\tans = k\n\t}\n\tfmt.Print(ans)\n}\n", "lang": "Go", "bug_code_uid": "703655c1647a30809251b63c33f11012", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "3f9a56e602164d432a99eb0ce57c7f30", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6987704918032787, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "// https://codeforces.com/problemset/problem/158/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar numPar, place, cutoff int\n\tfmt.Scanln(&numPar, &place)\n\tvar scores = make([]int, numPar)\n\t// read knon sized list from stdin\n\tfor i := range scores {\n\t\tfmt.Scan(&scores[i])\n\t}\n\n\tcutoff = scores[place-1]\n\n\t// even score\n\tif cutoff == 0 {\n\t\tfmt.Println(\"0\")\n\t\tos.Exit(1)\n\t}\n\n\t// at least cutoff\n\tfor i := place - 1; i < numPar; i++ {\n\t\tif scores[i] >= cutoff {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Println(i)\n\t\tos.Exit(1)\n\t}\n\n\tos.Exit(0)\n\n}\n", "lang": "Go", "bug_code_uid": "a2641e15b60dcb7bc8cc1c1107825b0a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "4c506efbb47c819d2eb031d63cb86337", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9752066115702479, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n, k int\t\n\tfmt.Scan(&n, &k)\n\tif k > n {\n\t\treturn\n\t}\t\n\n\tskor := make([]int, n)\n\tfor i:=0; i= skor[k-1] && skor[j] > 0 && skor[k] > 0 {\n\t\t\tlolos += 1\n\t\t}\n\t} \n\t\n\tfmt.Println(lolos)\n}\n", "lang": "Go", "bug_code_uid": "40563518d7b5b2167d4cda279cdaeae4", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "0b1d7379910e16b1a0c477f3e9e149fb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.37170263788968827, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, k, border int\n\n fmt.Scanf(\"%d %d\", &n, &k)\n\n ints := make([]interface{}, 50)\n vals := make([]int, len(ints))\n\n for i, _ := range ints {\n ints[i] = interface{}(&vals[i])\n }\n fmt.Scan(ints...)\n\n border := vals[k]\n num := 0\n\n if border == 0 {\n fmt.Println(0)\n } else {\n for i, _ := range vals {\n if vals[i] < border {\n num++\n }\n }\n fmt.Println(num)\n }\n\n //fmt.Println(vals)\n //fmt.Println(n, k)\n}\n", "lang": "Go", "bug_code_uid": "b613f5034a888866703a5730df0e9a47", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "6e2693816dc0758151888218b2a243f6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9386562804284323, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//第一行为参赛选手人数和第k位选手的分数\n//只要分数高于或者等于第k位选手的都可以晋级\n//测试数据已经从大到小排好序了\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar total, num, result int\n\tfmt.Scanln(&total, &num)\n\tvar array = make([]int, total+1)\n\tfor i := 1; i <= total; i++ {\n\t\tfmt.Scan(&array[i])\n\t}\n\tresult = 0\n\tif array[num] == 0 {\n\t\tfor i := 1; i <= num; i++ {\n\t\t\tif array[i] > 0 {\n\t\t\t\tresult++\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = num\n\t\tfor i := num; i <= total; i++ {\n\t\t\tif total == num {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif array[i+1] >= array[num] {\n\t\t\t\tresult++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n", "lang": "Go", "bug_code_uid": "c158877cdeae63d5aa0e4c866c0ed1bf", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "ca3bd80f086d59a1833b7ca4ea9be208", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9031657355679702, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar count, score int\n\tfmt.Scanf(\"%d %d\\n\", &count, &score)\n\tpars := make([]int, count)\n\n\tfor i := 0; i < count; i++ {\n\t\tvar num int\n\t\tfmt.Scanf(\"%d\", &num)\n\t\tpars[i] = num\n\t}\n\n\tfmt.Println(NextRound(pars, score))\n}\n\n// NextRound ...\nfunc NextRound(participants []int, index int) int {\n\tvar result int\n\tvar score = participants[index]\n\tfor _, par := range participants {\n\t\tif par >= score && par > 0 {\n\t\t\tresult++\n\t\t}\n\t}\n\treturn result\n}\n", "lang": "Go", "bug_code_uid": "e604903dba572262f7b79bb836744f0a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "375261285a97300eca4c6e72c31ad116", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9862068965517241, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport(\n \"fmt\"\n \"log\"\n)\n\nfunc main(){\n var k,n int\n fmt.Scan(&n,&k)\n if n>=k{\n s := make([]int,n)\n res := 0\n for i:=0;i=temp && temp>0 && s[i]>0{\n res++\n }\n }\n fmt.Println(res)\n }else{\n log.Fatal(\"Invalid input\")\n }\n}\n", "lang": "Go", "bug_code_uid": "10418f60f34698212682dc950d21decf", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "ab98f1576ab8ce5eb4c2a506f131bb64", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9945155393053017, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\t\n\tvar arr = make([]int, n)\n\tvar count int\n\n\tfor i:=0; i < n ; i++ {\n\t\tfmt.Scan(&arr[i])\n\t}\n\n\tfor _, value := range arr{\n\t\tif value >= arr[k] && value != 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "lang": "Go", "bug_code_uid": "dceb47bdfa5de6b04ebc3a5232418aeb", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "6404a2a2bcc7c79e6df803ecacff7727", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8144578313253013, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n\tvar n,k int\n\tfmt.Scan(&n,&k)\n\tvar a = make([]int,n)\n\tx:=0\n\tfor i:=0; i=a[k]) && (a[i]>0){\n\t\t\tx+=1\n\t\t}\n\t}\n\tfmt.Print(x)\n}", "lang": "Go", "bug_code_uid": "f4b9c9b8191ef3f1e0eb861059e188a2", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "65ebb11875c100e736dea57b725af51e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9290322580645162, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "/*package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar source string\n\tfmt.Scan(&source)\n\tsplitted := strings.Split(source, \"+\")\n\tsum := 0\n\tfor i := range splitted {\n\t\tif v, err := strconv.Atoi(splitted[i]); err == nil {\n\t\t\tsum += v\n\t\t}\n\t}\n}\n*/\n\n/*\n/*package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar source string\n\tfmt.Scan(&source)\n\tsplitted := strings.Split(source, \"+\")\n\tsum := 0\n\tfor i := range splitted {\n\t\tif v, err := strconv.Atoi(splitted[i]); err == nil {\n\t\t\tsum += v\n\t\t}\n\t}\n}\n*/\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tvar points = make([]int, n)\n\tfor i := range points {\n\t\tfmt.Scan(&points[i])\n\t}\n\tvalue := points[k-1]\n\tsort.Ints(points)\n\tvar i int\n\tif value == 0 {\n\t\tfor i = 0; value == points[i] && i < len(points); i++ {\n\t\t}\n\t} else {\n\t\tfor i = 0; points[i] != value && i < len(points); i++ {\n\n\t\t}\n\t}\n\tfmt.Println(n - i)\n}\n", "lang": "Go", "bug_code_uid": "74483d907a673bf349c01e1ac183705d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "b3bdcf05326c24a2dfb32233ccc49569", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9703196347031964, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar year int = 0\n\tfmt.Scan(&year)\n\tvar num int\n\n\tunique := map[int]int{}\n\tfor i := year + 1; i <= 9000; i++ {\n\t\tnum = i\n\t\tfor num != 0 {\n\t\t\tif _, ok := unique[num%10]; ok {\n\t\t\t\t//duplicate\n\t\t\t\tunique = map[int]int{}\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tunique[num%10] = 1\n\t\t\t}\n\t\t\tnum = num / 10\n\t\t}\n\n\t\tif len(unique) != 0 {\n\t\t\tfmt.Fprintf(os.Stdout, \"%d\", i)\n\t\t\tbreak\n\t\t}\n\t\tunique = map[int]int{}\n\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "68a40a4dece851a553cd12504ab3c8e8", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "b3027e3aa71437af34acc5d8557736a5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9946714031971581, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\n\tx := 0\n\tfmt.Scan(&x)\n\n\tfor i := x + 1; i < 9000; i++ {\n\n\t\tif i/1000 != i/100%10 && i/100%10 != i/10%10 && i/10%10 != i%10 && i/1000 != i%10 && i/1000 != i/10%10 && i/100%10 != i%10 {\n\t\t\tfmt.Println(i)\n\t\t\tos.Exit(0)\n\t\t}\n\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "f217e23db1fb5008466ea136f1e401c0", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "b18c54b75594dbd41d6493220c96dece", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9985401459854014, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Println(\"<\")\n\t\t\treturn\n\t\t}\n\t\tif y == 2 {\n\t\t\tif x == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x == 3 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x > 4 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif y == 1 {\n\t\t\tfmt.Println(\">\")\n\t\t}\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Println(\">\")\n\t\t\treturn\n\t\t}\n\t\tif x == 2 {\n\t\t\tif y == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y == 3 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y > 4 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif y == 1 {\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t}\n}\n", "lang": "Go", "bug_code_uid": "abcbc09d9f9919315a4672384b3a5159", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "314da3dd70a5b90927413e46d61cd8d5", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9300184162062615, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := readInt()\n\ty := readInt()\n\tif y == x {\n\t\tfmt.Println(\"=\")\n\t} else if y < x {\n\t\tfmt.Println(\"<\")\n\t} else {\n\t\tfmt.Println(\">\")\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang": "Go", "bug_code_uid": "341a49b8357c7ece1d4fe73e02d7f38e", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "78e203f8d9a8ba2a438a597c686e9689", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7707082833133253, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var (\n x int\n y int\n z int\n t1 int\n t2 int\n t3 int\n )\n fmt.Scanln(&x,&y,&z,&t1,&t2,&t3)\n if z == x {\n if t1*abs(y-x) < t2*abs(y-x)+t3*2 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n } else {\n if t1*abs(y-x) < t2*(z-x)+t2*(y-x)+t3*4 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n }\n}\n\nfunc abs(x int) int {\n if x < 0 {\n return -1*x\n } else {\n return x\n }\n}\n", "lang": "Go", "bug_code_uid": "d0bc97f714dfa1e00d36a383e15b0f2d", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "ff86efea1c5b34f39d37bf63522e0282", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5889724310776943, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n var (\n x int\n y int\n z int\n t1 int\n t2 int\n t3 int\n )\n fmt.Scanln(&x,&y,&z,&t1,&t2,&t3)\n if z == x {\n if t1*math.Abs(y-x) <= t2*math.Abs(y-x)+t3*2 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n } else {\n if t1*math.Abs(y-x) <= t2*math.Abs(z-x)+t2*math.Abs(y-x)+t3*3 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n }\n}\n", "lang": "Go", "bug_code_uid": "e1759f172943ff1bad90819f6276bf72", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "ff86efea1c5b34f39d37bf63522e0282", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8241379310344827, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "package main\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var x,y,z,t1,t2,t3 int\n fmt.Scan(&x,&y,&z,&t1,&t2,&t3)\n \n if math.Abs(x-y)*t1 - math.Abs(x-z)*t2 - math.Abs(x-y)*t2 < 2*t3 {\n fmt.Println(\"NO\") \n }else{\n fmt.Println(\"YES\")\n }\n}", "lang": "Go", "bug_code_uid": "0f46181ee072c651c6aba7ee44a65242", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "54da40432a603faa938e2318c26bf541", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9968944099378882, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport (\n \"fmt\"\n)\n\nfunc abs(x int) int{\n if x > 0 {\n return x\n}else{\n return -x\n}\n}\n\nfunc main(){\n var x,y,z,t1,t2,t3 int\n fmt.Scan(&x,&y,&z,&t1,&t2,&t3)\n \n if abs(x-y)*t1 - abs(x-z)*t2 - abs(x-y)*t2 < 2*t3 {\n fmt.Println(\"NO\") \n }else{\n fmt.Println(\"YES\")\n }\n}", "lang": "Go", "bug_code_uid": "12fd28f34f3e012dc77a9224c04e005c", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "54da40432a603faa938e2318c26bf541", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.49666221628838453, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n var rel int\n flag := false\n fmt.Scan(&rel)\n var ar [5]int\n for i:=0; i<5; i++ {\n fmt.Scan(&a)\n fmt.Scan(&b)\n ar[a]++\n ar[b]++\n }\n for i:=0; i<5; i++ {\n if(ar[i] == 2){\n flag = true\n }\n }\n if(flag)\n fmt.Println(\"WIN\");\n else\n fmt.Println(\"FAIL\");\n\n}\n", "lang": "Go", "bug_code_uid": "91397bbb7168b96a71d2ecfdeee81345", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "7b9ee0cacd105984d84e7ad6202ea75e", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9913544668587896, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar rel int\n\tvar a int\n\tvar b int\n\tflag := false\n\tfmt.Scan(&rel)\n\tvar ar [5]int\n\tfor i := 0; i < 5; i++ {\n\t\tfmt.Scan(&a)\n\t\tfmt.Scan(&b)\n\t\tar[a-1]++\n\t\tar[b-1]++\n\t}\n\tfor i := 0; i < 5; i++ {\n\t\tif ar[i] == 2 {\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"WIN\")\n\t} else {\n\t\tfmt.Println(\"FAIL\")\n\t}\n}\n", "lang": "Go", "bug_code_uid": "676eae002c5d47c96322af1745cce5a3", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "7b9ee0cacd105984d84e7ad6202ea75e", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9793984342810054, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "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 := make([][]int, 4)\n\tfor i := 0; i < 4; i++ {\n\t\tS[i] = sc.NextIntArray()\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tif S[i][0]+S[i][1]+S[i][2] > 0 && S[i][3] > 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tif S[0][0]+S[1][1]+S[2][2] > 0 && S[3][3] > 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tif S[0][1]+S[1][2]+S[2][0] > 0 && S[2][3] > 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tif S[0][2]+S[1][0]+S[2][1] > 0 && S[1][3] > 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\n\n\tfmt.Println(\"NO\")\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", "lang": "Go", "bug_code_uid": "4736ff731473f18e31d9487163aad463", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "1ec71df323c002179bfd9c6404613a5c", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9399293286219081, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string\n jumpval :=0 \n current := 1\n vowels := \"AEIOUY\"\n fmt.Scanf(\"%s\", &s)\n for i:=0; i < len(s); i++ {\n for j:=0; j < len(vowels); j++ {\n if vowels[j] == s[i]{\n if jumpval < current {\n jumpval = current\n }\n current = 0\n break\n }\n } \n current++\n }\n fmt.Println(jumpval)\n}\n", "lang": "Go", "bug_code_uid": "587557d7dda1c60c1d670e923474e4c6", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "bfd3338fba18979faff85fded20536da", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9971056439942113, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tletters := make(map[string]int)\n\tdistance := []int{-1}\n\tletters[\"A\"] = 1\n\tletters[\"E\"] = 1\n\tletters[\"I\"] = 1\n\tletters[\"O\"] = 1\n\tletters[\"U\"] = 1\n\tletters[\"Y\"] = 1\n\tfor index, char := range(s) {\n\t\tif _, exist := letters[string(char)]; exist {\n\t\t\tdistance = append(distance, index)\n\t\t}\n\t}\n\n\tdistance = append(distance, len(s) - 1)\n\tif len(distance) > 2 {\n\t\tans := 0\n\t\tfor index, val := range(distance) {\n\t\t\tif index == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdiff := math.Abs(float64(val - distance[index-1]))\n\t\t\tif diff > float64(ans) {\n\t\t\t\tans = int(diff)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t} else {\n\t\tfmt.Println(1 + len(s))\n\t}\n}", "lang": "Go", "bug_code_uid": "d6aa162315a7964123c76699f430c861", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "ac5bda0d6f429c5dadd37009f926fc14", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9830124575311439, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ni() int {\n sc.Scan()\n ans, _ := strconv.Atoi(sc.Text())\n return ans\n}\n\nfunc nll() int64 {\n sc.Scan()\n ans, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return ans\n}\n\nfunc next() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc pri(n int) { w.WriteString(strconv.Itoa(n)) }\nfunc prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n a, b := nll(), nll()\n s := next()\n x, y := []int64{0}, []int64{0}\n xx, yy := int64(0), int64(0)\n for i := 0; i < len(s); i++ {\n switch s[i] {\n case 'U':\n yy++\n case 'D':\n yy--\n case 'L':\n xx--\n case 'R':\n xx++\n }\n x = append(x, xx)\n y = append(y, yy)\n }\n dx, dy := x[len(x)-1], y[len(y)-1]\n if dx != 0 && dy != 0 {\n for i := 0; i < len(s); i++ {\n if (a-x[i])%dx == 0 && (b-y[i])%dy == 0 && ((a-x[i])/dx == (b-y[i])/dy) {\n w.WriteString(\"Yes\\n\")\n w.Flush()\n return\n }\n }\n } else if dy != 0 {\n for i := 0; i < len(s); i++ {\n if (b-y[i])%dy == 0 && a == x[i] {\n w.WriteString(\"Yes\\n\")\n w.Flush()\n return\n }\n }\n } else if dx != 0 {\n for i := 0; i < len(s); i++ {\n if (a-x[i])%dx == 0 && b == y[i] {\n w.WriteString(\"Yes\\n\")\n w.Flush()\n return\n }\n }\n } else {\n for i := 0; i < len(s); i++ {\n if a == x[i] && b == y[i] {\n w.WriteString(\"Yes\\n\")\n w.Flush()\n return\n }\n }\n }\n w.WriteString(\"No\\n\")\n w.Flush()\n}\n", "lang": "Go", "bug_code_uid": "f6588e8d175f340a63d17bea258d1b31", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "97510f9e23ef80295f18c5b3ff53da82", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9843260188087775, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, k int\n\tscanf(\"%d%d\\n\", &n, &k)\n\tscores := make([]int, n + 1)\n\tfor i := 1; i <= n; i += 1 {\n\t\tscanf(\"%d\", &scores[i])\n\t}\n\tif scores[k] > 0 {\n\t\tscore := scores[k]\n\t\tfor scores[k] >= score {\n\t\t\tk += 1\n\t\t}\n\t\tk -= 1\n\t} else {\n\t\tfor scores[k] <= 0 {\n\t\t\tk -= 1\n\t\t}\n\t}\n\tprintf(\"%d\\n\", k)\n}\n", "lang": "Go", "bug_code_uid": "fd6d5777b75ea925b6b98763324beefc", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9b083e7e9613cb131615a43ff5a663c8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9905123339658444, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tfmt.Scan(&n, &k)\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&arr[i])\n\t}\n\n\tc := arr[k-1]\n\ti := 0\n\tans := 0\n\tfor arr[i] >= c&&arr[i]>0 {\n\n\t\tans++\n\t\ti++\n\t}\n\tfmt.Println(ans)\n\n}\n", "lang": "Go", "bug_code_uid": "868c2b71a75b3d490f68e3505a14e835", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "85c69ce4be8d21ac3de3bc005e5e90c4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.556390977443609, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\tvar value int\n\ttotal := 0\n\tfor i:=0; i0{\n\t\t\ttotal++\n\t\t}\n\t\t\n\t}\n\n\tvar current int\n\tfmt.Scanf(\"%d\", ¤t)\n\t\n\tfor current>=value && current>0{\n\t\tfmt.Scanf(\"%d\", ¤t)\n\t\ttotal++\n\t}\n\tfmt.Println(total)\n}", "lang": "Go", "bug_code_uid": "ef5582dafa5303af18d859c01ac8ab1b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "4e0952c939909ea9c8dde8d2a4549cf3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7376237623762376, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n points := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&points[i])\n }\n answer := k - 1\n for i := k - 1; i < n; i++ {\n if points[i] == points[k] {\n answer++\n } else {\n break\n }\n }\n if points[k] > 0 {\n fmt.Println(answer)\n } else {\n fmt.Println(0)\n }\n}\n", "lang": "Go", "bug_code_uid": "c0ae89997905837b83195d4f10851f41", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "42ce20f7f44dbe33c7e07adae77d1950", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9980237154150198, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tif _, err := fmt.Scan(&n); err != nil {\n\t\tpanic(err)\n\t}\n\tif _, err := fmt.Scan(&k); err != nil {\n\t\tpanic(err)\n\t}\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tif _, err := fmt.Scan(&arr[i]); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\ttotalsum := solve(arr, k)\n\tfmt.Println(totalsum)\n}\n\nfunc solve(arr []int, k int) int {\n\tvar count int\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] > 0 && arr[i] >= arr[k] {\n\t\t\tcount = count + 1\n\t\t}\n\t}\n\treturn count\n}\n", "lang": "Go", "bug_code_uid": "e4b2199f9e9330892e35c28963ae9c6d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "f56ddcd1dfdf75ab802073fc910510a9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9980769230769231, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tnk := scanner.Text()\n\tnk_split := strings.Fields(nk)\n\tn, _ := strconv.Atoi(nk_split[0])\n\tk, _ := strconv.Atoi(nk_split[1])\n\tscanner.Scan()\n\tscores := strings.Fields(scanner.Text())\n\tkscore, _:= strconv.Atoi(scores[k])\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tiscore, _ := strconv.Atoi(scores[i])\n\t\tif iscore >= kscore && iscore > 0{\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", count)\n}", "lang": "Go", "bug_code_uid": "c0801ed8ded211b87a03e0505655bbb8", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "e3a07b8ec104ac4d484dc741f5a2eaad", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9996774193548387, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "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\"sync\"\n)\n\nfunc main() {\n\n\tcount, bechmark := scanInt(), scanInt()\n\tgivenArray := scanIntSlice(count)\n\tanswer := 0\n\n\tfor i := 0; i < count; i++{\n\t\tif givenArray[i] >= givenArray[bechmark] && givenArray[i] > 0{\n\t\t\tanswer++\n\t\t}\n\t}\n\n\tprintFmt(answer)\n\n\tclose(channelType)\n\toWg.Wait()\n}\n\n\n/*********************** I/O ***********************/\n\nvar channelType chan string\nvar in *bufio.Scanner\nvar oWg *sync.WaitGroup\nvar printFmt func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tprintFmt = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n\n\tchannelType = make(chan string, 16)\n\toWg = &sync.WaitGroup{}\n\toWg.Add(1)\n\n\twriter := bufio.NewWriter(os.Stdout)\n\tgo func() {\n\t\tdefer oWg.Done()\n\t\tdefer writer.Flush()\n\n\t\tfor line := range channelType {\n\t\t\twriter.WriteString(line + \"\\n\")\n\t\t}\n\t}()\n}\n\nfunc scanString() string {in.Scan(); return in.Text() }\nfunc scanInt() int {i, _ := strconv.Atoi(scanString()); return i}\nfunc scanInt64() int64 {i, _ := strconv.ParseInt(scanString(), 10, 64); return i}\nfunc scanStringSlice(n int) []string {s := make([]string, n); for i := 0; i < n; i++ {s[i] = scanString()}; return s}\nfunc scanIntSlice(n int) []int {arr := make([]int, n); for i := 0; i < n; i++ {arr[i] = scanInt()}; return arr}\nfunc scanInt64Slice(n int) []int64 {arr := make([]int64, n); for i := 0; i < n; i++ {arr[i] = scanInt64()}; return arr}\n\n/*********************** Utils ***********************/\n\nfunc stringEquivalent(v interface{}) string {return fmt.Sprintf(\"%v\", v)}\nfunc spaceSeperatedStringFromArray(a []int) string {sb := strings.Builder{}; sb.Grow(len(a) * 9); for i := range a {sb.WriteString(strconv.Itoa(a[i]) + \" \")}; return sb.String()}\nfunc spaceSeperatedStringFromArray64(a []int64) string {sb := strings.Builder{}; sb.Grow(len(a) * 9); for i := range a {sb.WriteString(strconv.FormatInt(a[i], 10) + \" \")}; return sb.String()}\nfunc minMaxFromArray(args ...int64) (int64, int64) {minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64); for _, v := range args {if v < minVal {minVal = v}; if v > maxVal {maxVal = v}}; return minVal, maxVal}\nfunc minElementFromArray(args ...int64) int64 { mn, _ := minMaxFromArray(args...); return mn }\nfunc maxElementFromArray(args ...int64) int64 { _, mx := minMaxFromArray(args...); return mx }\nfunc lcmCalculation(a, b int64) int64 {return a / gcdCalculation(a, b) * b}\nfunc gcdCalculation(a, b int64) int64 {if (a == 0) {return b}; return gcdCalculation(b%a, a)}\nfunc sortInt64Slice(a []int64) {sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })}\nfunc absoluteValue(x int64) int64 {if x < 0 {return -x}; return x}\nfunc min(args ...int) int { mn, _ := minMaxFinder(args...); return mn }\nfunc max(args ...int) int { _, mx := minMaxFinder(args...); return mx }\nfunc minMaxFinder(args ...int) (int, int) { minVal, maxVal := int(math.MaxInt32), int(math.MinInt32); for _, v := range args { if v < minVal { minVal = v }; if v > maxVal { maxVal = v } }; return minVal, maxVal }\n\n\n\n\n", "lang": "Go", "bug_code_uid": "35107ed2c353cc8c1628b6106e53535c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "64d953501e0dd3babfc262298e1df4f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7915309446254072, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst (\n maxn = 55\n)\n\nvar a [maxn]int\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int\n for i := 0; i < n; i++ {\n if a[i] > 0 && a[i] >= a[k-1] {\n ans++\n }\n }\n var sc = fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "e2728e2596d7b9b1c9ecaa042fc4b02b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9ea9bd0bcc779fbc580f8449fc661b1e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9555236728837877, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst (\n maxn = 55\n)\n\nvar arr = [maxn]int{}\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int\n for i := 0; i < n; i++ {\n if a[i] > 0 && a[i] >= a[k-1] {\n ans++\n }\n }\n fmt.Println(ans)\n}\n", "lang": "Go", "bug_code_uid": "77821cc2ab9ebb93b0aaefc6fb3d4ab6", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9ea9bd0bcc779fbc580f8449fc661b1e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8940092165898618, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, res int\n\tfmt.Scan(&n, &k)\n\n\titems := make([]int, n)\n\tps := make([]interface{}, n)\n\tfor i := range items {\n\t\tps[i] = &items[i]\n\t}\n\tfmt.Scan(ps...)\n\n\tif items[k] == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif items[i] >= items[k] {\n\t\t\tres++\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n", "lang": "Go", "bug_code_uid": "5c8b749a65af1155644b9ebe835f415c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "63ca01cadd6045d4f37a9e963cac6669", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9606903163950143, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tin := bufio.NewScanner(os.Stdin)\n\tin.Split(bufio.ScanWords)\n\tin.Scan()\n\tn, _ := strconv.Atoi(in.Text())\n\tin.Scan()\n\tk, _ := strconv.Atoi(in.Text())\n\tscores := []int{}\n\tpassCount := 0\n\tfor i := 0; i < n; i++ {\n\t\tin.Scan()\n\t\tscr, _ := strconv.Atoi(in.Text())\n\t\tscores = append(scores, scr)\n\t}\n\tpass := scores[n-k]\n\n\tsort.Ints(scores)\n\tfor _, val := range scores {\n\t\tif val > 0 && val >= pass {\n\t\t\tpassCount++\n\t\t}\n\t}\n\tfmt.Println(passCount)\n", "lang": "Go", "bug_code_uid": "7569a26c8e7948de9e04398be6c564a7", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "3330bbc624d6c22571a35673a291c739", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9956784788245462, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n \n var n, k, aryaCandies int\n var found bool = false\n fmt.Scanf(\"%d %d\", &n, &k)\n \n for i := 1; i <= n; i++ {\n var foundCandy int\n fmt.Scanf(\"%d\", &foundCandy)\n aryaCandies += foundCandy\n \n branCandies := int(math.Min(float64(aryaCandies), 8.0))\n k -= branCandies\n if k <= 0 {\n fmt.Println(i)\n found = true\n break\n }\n aryaCandies -= branCandies\n }\n \n if !found {\n fmt.Println(k)\n }\n}", "lang": "Go", "bug_code_uid": "eb3aa43c459ec5232aee8ecc4f02d253", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "1eca2916966d296aff8dfca6c4faa944", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9968297101449275, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "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, K := sc.NextInt(), sc.NextInt()\n\n\ta := sc.NextIntArray()\n\n\tp := 0\n\tfor i := 0; i < N; i++ {\n\t\tq := min(8, a[i]+p)\n\n\t\tK -= q\n\t\tif K <= 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\tp = a[i] - q\n\t}\n\tfmt.Println(-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\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", "lang": "Go", "bug_code_uid": "5b26ef584d6ce01205d20036fe66a8a6", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "2ac0c748bcbad36c7219d1adf8011501", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9312063808574277, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\nimport \"fmt\"\nfunc main(){\n var n,i,k,sum,c int32\n var f bool\n f=true\n fmt.Scanln(&n,&k)\n for i=1;i<=n;i++{\n var a int32\n fmt.Scanf(\"%d\",&a)\n if a>8{\n sum=sum+a-8\n c=c+8\n }else{\n\t\t\tif a+sum>8{\n \t\t sum=sum-8+a\n \t \tc=c+8\n \t\t}else{\n \tc=c+a\n \t}\n\t\t}\n if (c>=k){\n f=false\n break\n \t}\n }\n if c>=k{\n fmt.Println(i)\n }else{\n fmt.Println(-1)\n }\n}\n", "lang": "Go", "bug_code_uid": "957854d34019dbcc6ba7baa56fed04f1", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "e63d78a6dc7281cadb22f4988c57c648", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9759665621734587, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\nimport \"fmt\"\nfunc main(){\n var n,i,k,sum,c int32\n fmt.Scanln(&n,&k)\n for i=1;i<=n;i++{\n var a int32\n fmt.Scanf(\"%d\",&a)\n if a>8{\n sum=sum+a-8\n c=c+8\n }else{\n\t\t\tif a+sum>8{\n \t\t sum=sum-8+a\n \t \tc=c+8\n \t\t}else{\n \tc=c+a\n \t}\n\t\t}\n if (c>=k){\n break\n \t}\n }\n if c>=k{\n fmt.Println(i)\n }else{\n fmt.Println(-1)\n }\n}\n", "lang": "Go", "bug_code_uid": "5815eb39dcc3d8c2d6d6aa9088b56e21", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "e63d78a6dc7281cadb22f4988c57c648", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9593642766841249, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\n// var m []int\n// err = json.Unmarshal([]byte(r.FormValue(\"example\")), &m)\n\n// for i := 0; i < len(m); i++ {\n// \tfmt.Println(m[i])\n// }\n\n// sort.Slice(arr, func(i, j int) bool {\n// \treturn arr[i] > arr[j]\n// })\n\nfunc MIN(x, y int64) int64 {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc MKO(x, y int64) int64 {\n\tif x < y {\n\t\treturn 0\n\t} else {\n\t\treturn x - y + 1\n\t}\n}\n\nfunc MAX(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc LCM(x, y int) int {\n\tif x >= y {\n\t\tinitial := x\n\t\tfor i := 1; i < y+2; i++ {\n\t\t\tif initial%y == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + x\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t} else {\n\t\tinitial := y\n\t\tfor i := 1; i < x+2; i++ {\n\t\t\tif initial%x == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + y\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t}\n}\n\nfunc GCD(x, y int64) int64 {\n\tvar l, q int64\n\tl = MAX(x, y)\n\tq = MIN(x, y)\n\tvar m int64\n\tfor l*q > 0 {\n\t\ta := l % q\n\t\tb := l - a\n\t\tcc := int64(b / q)\n\t\tremain := l - cc*q\n\t\tl = MAX(remain, q)\n\t\tq = MIN(remain, q)\n\t\tif l*q == 0 {\n\t\t\tm = l + q\n\t\t\tbreak\n\t\t}\n\n\t}\n\treturn m\n\n}\n\nfunc IsItPrime(x int) bool {\n\tif x < 10 {\n\t\tif x == 2 || x == 3 || x == 5 || x == 7 {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tj := 0\n\t\tk := math.Sqrt(float64(x))\n\t\tfor m := 3; m <= int(k); {\n\t\t\tif x%m == 0 {\n\t\t\t\tj = 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm = m + 2\n\t\t}\n\t\tif j == 1 {\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n}\n\nfunc PrimeFactorization(n int) (pfs map[int]int) {\n\tpfs = make(map[int]int)\n\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tif _, ok := pfs[2]; ok {\n\t\t\tpfs[2] += 1\n\t\t} else {\n\t\t\tpfs[2] = 1\n\t\t}\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\tif _, ok := pfs[i]; ok {\n\t\t\t\tpfs[i] += 1\n\t\t\t} else {\n\t\t\t\tpfs[i] = 1\n\t\t\t}\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[n] = 1\n\t}\n\n\treturn\n}\n\nfunc NumberOfDivisors(n int) int {\n\tpfs := PrimeFactorization(n)\n\n\tnum := 1\n\tfor _, exponents := range pfs {\n\t\tnum *= (exponents + 1)\n\t}\n\n\treturn num\n}\n\nfunc LITTLE(x int) int64 {\n\tvar answer int64\n\tanswer = answer + int64((x*x*x*x-x*x)/4) + int64(x*x*(x-1)*(x-1)/8) - int64(x*(x-1)*(x+x+1)*(x+x-1)/12)\n\treturn answer\n}\n\nfunc main() {\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\n\tvar n int\n\tfmt.Fscan(input, &n)\n\tif n == 1 {\n\t\tfmt.Println(1)\n\t}\n\tif n > 1 {\n\t\tvar answer int64\n\t\tanswer = 1\n\t\tfor i := 2; i < n+1; i++ {\n\t\t\tanswer = (answer*2 + int64(NumberOfDivisors(i)) - int64(NumberOfDivisors(i-1))) % 998244353\n\n\t\t}\n\t\tfmt.Println(answer)\n\n\t}\n}\n", "lang": "Go", "bug_code_uid": "865ee7bb81eddc66872c9ed017e03acb", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "b36dc98dc03067620d92112f5d9baba4", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5006657789613849, "equal_cnt": 36, "replace_cnt": 20, "delete_cnt": 2, "insert_cnt": 14, "fix_ops_cnt": 36, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc flush() { out.Flush() }\nfunc scan(a ...interface{}) { fmt.Fscan(in, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(out, f, a...) }\nfunc assert(f bool) {\n\tif !f {\n\t\tpanic(\"gg\")\n\t}\n}\n\n// ----------------------------- TEMPLATE END ----------------------------------\n\nconst MOD = 998244353\nconst LCM16 = 720720 // lcm(1, 2, 3, ..., 16)\nconst MAXK = 17\n\nfunc add(a, b int) int {\n\treturn (a + b) % MOD\n}\n\nfunc mul(a, b int) int {\n\treturn int(int64(a) * int64(b) % MOD)\n}\n\nfunc fpow(b, e int) int {\n\tr := 1\n\tfor ; e > 0; e >>= 1 {\n\t\tif (e & 1) > 0 {\n\t\t\tr = mul(r, b)\n\t\t}\n\t\tb = mul(b, b)\n\t}\n\treturn r\n}\n\nfunc inv(a int) int {\n\treturn fpow(a, MOD-2)\n}\n\nvar dp [MAXK + 1][LCM16]int\n\nvar prob0 int\nvar prob1 int\n\nfunc calcDP(maxK int) {\n\tif maxK < 2 {\n\t\treturn\n\t}\n\tfor k := maxK; k >= 2; k-- {\n\t\tfor r := 0; r < LCM16; r++ {\n\t\t\tdp[k][r] = add(\n\t\t\t\tmul(prob0, dp[k+1][r]),\n\t\t\t\tmul(prob1, add(dp[k+1][r-r%k], r%k)),\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tdefer flush()\n\n\tvar n, a0, k, ai int\n\tvar genX, genY, genMod int64\n\tscan(&n, &a0, &genX, &genY, &k, &genMod)\n\n\tninv := inv(n)\n\tprob0 = mul(n-1, ninv)\n\tprob1 = ninv\n\n\tans := 0\n\tfor j := 1; j <= k; j++ {\n\t\tcalcDP(j - 1)\n\n\t\tai = a0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tans = add(ans, mul(prob1, add(ai, MOD-dp[2][ai%LCM16])))\n\t\t\tai = int((int64(ai)*genX + genY) % genMod)\n\t\t}\n\t}\n\n\tprintf(\"%d\\n\", mul(ans, fpow(n, k)))\n}\n", "lang": "Go", "bug_code_uid": "7efcfbe48c570cc039dd41cbb35b7c50", "src_uid": "1d45491e28d24e2b318605cd328d6ecf", "apr_id": "852880ae4595639169536df2c908c59a", "difficulty": 2800, "tags": ["dp", "probabilities", "combinatorics", "number theory", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9198080877313228, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\r\n\r\nimport (\r\n\t. \"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n\t\"regexp\"\r\n\t\"strconv\"\r\n)\r\n\r\n// github.com/EndlessCheng/codeforces-go\r\nfunc CF1618F(in io.Reader, out io.Writer) {\r\n\tvar x, y uint64\r\n\tFscan(in, &x, &y)\r\n\tif x == y {\r\n\t\tFprintln(out, \"YES\")\r\n\t\treturn\r\n\t}\r\n\ts := strconv.FormatUint(x, 2)\r\n\tt := strconv.FormatUint(y, 2)\r\n\tf := func() bool {\r\n\t\tr := regexp.MustCompile(\"^1*\" + s + \"1*$\")\r\n\t\treturn r.MatchString(t)\r\n\t}\r\n\ts += \"1\"\r\n\tif f() {\r\n\t\tFprintln(out, \"YES\")\r\n\t\treturn\r\n\t}\r\n\ts = s[:len(s)-1]\r\n\tfor s[len(s)-1] == '0' {\r\n\t\ts = s[:len(s)-1]\r\n\t}\r\n\tif f() {\r\n\t\tFprintln(out, \"YES\")\r\n\t} else {\r\n\t\tFprintln(out, \"NO\")\r\n\t}\r\n}\r\n\r\nfunc main() { CF1618F(os.Stdin, os.Stdout) }\r\n", "lang": "Go", "bug_code_uid": "d07daddafb6925a86cf20bbacff4633b", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "3c2d4ed57231b5f0fb45dfe777a6e1ed", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.8361481481481482, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\r\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\r\n\r\nfunc scan(a ...interface{}) { fmt.Fscan(reader, a...) }\r\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\r\n\r\nfunc redirectInputToFile(r *bufio.Reader, fp string) {\r\n\tf, err := os.Open(fp)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tr.Reset(f)\r\n}\r\n\r\nfunc main() {\r\n\tdefer writer.Flush()\r\n\tredirectInputToFile(reader, \"input.txt\")\r\n\r\n\tT := 1\r\n\t// scan(&T)\r\n\tfor t := 0; t < T; t++ {\r\n\t\tsolve()\r\n\t}\r\n}\r\n\r\ntype ll = int64\r\n\r\nfunc reverse(a ll) ll {\r\n\tvar b ll\r\n\tfor a > 0 {\r\n\t\tb <<= 1\r\n\t\tb |= a & 1\r\n\t\ta >>= 1\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc isSorted(s string) bool {\r\n\tfor i := 1; i < len(s); i++ {\r\n\t\tif s[i-1] > s[i] {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\treturn true\r\n}\r\n\r\nfunc tryFor(x, y ll) bool {\r\n\tsx, sy := strconv.FormatInt(x, 2), strconv.FormatInt(y, 2)\r\n\tif len(sy) < 60 {\r\n\t\tsy = strings.Repeat(\"0\", 60-len(sy)) + sy\r\n\t}\r\n\tfor i := 0; i+len(sx)-1 < len(sy); i++ {\r\n\t\tprefixSorted := isSorted(sy[:i])\r\n\t\tmiddle := sy[i : i+len(sx)]\r\n\t\tsuffix := sy[i+len(sx):]\r\n\t\tonesOnSuffix := strings.Repeat(\"1\", len(sy)-i-len(sx))\r\n\t\tif prefixSorted && middle == sx && suffix == onesOnSuffix {\r\n\t\t\treturn true\r\n\t\t}\r\n\t}\r\n\treturn false\r\n}\r\n\r\nfunc solve() {\r\n\tvar x, y ll\r\n\tscan(&x, &y)\r\n\tok := false\r\n\tfor _, i := range [...]ll{x << 1, (x << 1) | 1, reverse(x << 1), reverse((x << 1) | 1)} {\r\n\t\tok = ok || tryFor(i, y)\r\n\t}\r\n\tif !ok {\r\n\t\tprintf(\"NO\\n\")\r\n\t} else {\r\n\t\tprintf(\"YES\\n\")\r\n\t}\r\n}\r\n", "lang": "Go", "bug_code_uid": "1a81bdb532e3381244bbeaa509df95d4", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "8dd839d9ce8121147932a26ef209fee8", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.837181764357608, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\r\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\r\n\r\nfunc scan(a ...interface{}) { fmt.Fscan(reader, a...) }\r\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\r\n\r\nfunc redirectInputToFile(r *bufio.Reader, fp string) {\r\n\tf, err := os.Open(fp)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tr.Reset(f)\r\n}\r\n\r\nfunc main() {\r\n\tdefer writer.Flush()\r\n\t// redirectInputToFile(reader, \"input.txt\")\r\n\r\n\tT := 1\r\n\t// scan(&T)\r\n\tfor t := 0; t < T; t++ {\r\n\t\tsolve()\r\n\t}\r\n}\r\n\r\ntype ll = int64\r\n\r\nfunc reverse(a ll) ll {\r\n\tvar b ll\r\n\tfor a > 0 {\r\n\t\tb <<= 1\r\n\t\tb |= a & 1\r\n\t\ta >>= 1\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc isSorted(s string) bool {\r\n\tfor i := 1; i < len(s); i++ {\r\n\t\tif s[i-1] > s[i] {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\treturn true\r\n}\r\n\r\nfunc tryFor(x, y ll) bool {\r\n\tsx, sy := strconv.FormatInt(x, 2), strconv.FormatInt(y, 2)\r\n\tif len(sy) < 60 {\r\n\t\tsy = strings.Repeat(\"0\", 60-len(sy)) + sy\r\n\t}\r\n\tfor i := 0; i+len(sx)-1 < len(sy); i++ {\r\n\t\tprefixSorted := isSorted(sy[:i])\r\n\t\tmiddle := sy[i : i+len(sx)]\r\n\t\tsuffix := sy[i+len(sx):]\r\n\t\tonesOnSuffix := strings.Repeat(\"1\", len(sy)-i-len(sx))\r\n\t\tif prefixSorted && middle == sx && suffix == onesOnSuffix {\r\n\t\t\treturn true\r\n\t\t}\r\n\t}\r\n\treturn false\r\n}\r\n\r\nfunc solve() {\r\n\tvar x, y ll\r\n\tscan(&x, &y)\r\n\tok := false\r\n\tfor _, i := range [...]ll{x << 1, (x << 1) | 1, reverse(x << 1), reverse((x << 1) | 1)} {\r\n\t\tok = ok || tryFor(i, y)\r\n\t}\r\n\tif !ok {\r\n\t\tprintf(\"NO\\n\")\r\n\t} else {\r\n\t\tprintf(\"YES\\n\")\r\n\t}\r\n}\r\n", "lang": "Go", "bug_code_uid": "a1be9853212fff9b580bf179ba5dba29", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "8dd839d9ce8121147932a26ef209fee8", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7191797949487372, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t. \"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar ans int\r\n\r\nfunc DFS(n int, x int64, now int) {\r\n\tif now >= ans {\r\n\t\treturn\r\n\t}\r\n\t//println(n, x)\r\n\ta := make([]int, 10)\r\n\tm := int64(1)\r\n\tfor i := 1; i < n; i++{\r\n\t\tm *= 10\r\n\t}\r\n\tif x >= m {\r\n\t\tans = min(ans, now)\r\n\t\treturn\r\n\t}\r\n\ttx := x\r\n\tfor tx > 0 {\r\n\t\ta[tx%10] = 1\r\n\t\ttx /= 10\r\n\t}\r\n\r\n\tif a[9] == 1 {\r\n\t\tcnt := 0\r\n\t\tfor x < m {\r\n\t\t\tx *= 9\r\n\t\t\tcnt++\r\n\t\t}\r\n\t\tans = min(ans, now+cnt)\r\n\t\treturn\r\n\t}\r\n\r\n\tfor i, t := range a {\r\n\t\tif i <= 1 {\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tif t == 1 {\r\n\t\t\tDFS(n, int64(i)*x, now+1)\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc Solve() {\r\n\tn := ri()\r\n\tvar x int64\r\n\tscan(&x)\r\n\tans = 114514\r\n\tDFS(n, x, 0)\r\n\tif ans == 114514 {\r\n\t\tans = -1\r\n\t}\r\n\tprintln(ans)\r\n}\r\n\r\nfunc main() {\r\n\tT := 1 // 如果是单组样例,请讲 T := 0 改为 T := 1\r\n\tin, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\r\n\tif T == 0 {\r\n\t\tscan(&T)\r\n\t}\r\n\tfor t := 0; t < T; t++ {\r\n\t\tSolve()\r\n\t}\r\n\tout.Flush()\r\n}\r\n\r\nvar in *bufio.Reader\r\nvar out *bufio.Writer\r\n\r\n// ri 将直接读入并返回一个 int\r\nfunc ri() (x int) {\r\n\tscan(&x)\r\n\treturn x\r\n}\r\n\r\n//rs 将直接读入并返回一个 string\r\nfunc rs() (s string) {\r\n\tscan(&s)\r\n\treturn s\r\n}\r\n\r\n//scan 用法与 fmt.scan() 相似,可以传入多个变量的地址进行读入操作\r\nfunc scan(a ...interface{}) { Fscan(in, a...) }\r\n\r\n//print 用法与 fmt.print() 相似,可以传入多个变量进行输出。注意,这个函数不会换行,多个变量之间有空格\r\nfunc print(a ...interface{}) { Fprint(out, a...) }\r\n\r\n//println 用法与 fmt.println() 相似,可以传入多个变量进行输出。这个函数会换行,多个变量之间有空格\r\nfunc println(a ...interface{}) { Fprintln(out, a...) }\r\n\r\n//min 可以传入多个 int 变量,求出这些变量的最小值\r\nfunc min(a ...int) int {\r\n\tans := a[0]\r\n\tfor i := 1; i < len(a); i++ {\r\n\t\tif a[i] < ans {\r\n\t\t\tans = a[i]\r\n\t\t}\r\n\t}\r\n\treturn ans\r\n}\r\n\r\n//max 可以传入多个 int 变量,求出这些变量的最大值\r\nfunc max(a ...int) int {\r\n\tans := a[0]\r\n\tfor i := 1; i < len(a); i++ {\r\n\t\tif a[i] > ans {\r\n\t\t\tans = a[i]\r\n\t\t}\r\n\t}\r\n\treturn ans\r\n}\r\n\r\n//sum 可以传入多个 int 变量,求出这些变量的总和,并返回总和。\r\n//你可以使用 ... 运算符打散数组,使得 sum 函数可以求出数组的和。\r\nfunc sum(a ...int) int {\r\n\tans := 0\r\n\tfor _, x := range a {\r\n\t\tans += x\r\n\t}\r\n\treturn ans\r\n}\r\n", "lang": "Go", "bug_code_uid": "4e42ac8bd2f9a7890c32df6c0039a3a8", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "e4271be34cb1c191538ec80a9e9d1e8d", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9990205680705191, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t. \"fmt\"\r\n\t\"math\"\r\n\t\"os\"\r\n)\r\n\r\nvar ans int\r\n\r\ntype pair struct{ x, y int64 }\r\n\r\nfunc BFS(n int, x int64) {\r\n\tmp := make(map[int64]bool, int(1e3))\r\n\tque := make(chan pair, int(1e3))\r\n\tm := int64(math.Pow10(n - 1))\r\n\tque <- pair{x, 0}\r\n\tfor {\r\n\t\tif len(que) == 0 {\r\n\t\t\tbreak\r\n\t\t}\r\n\t\tp := <-que\r\n\t\t//println(p.x, p.y)\r\n\t\tif _, xx := mp[p.x]; xx {\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tmp[p.x] = true\r\n\t\tif p.x >= m {\r\n\t\t\tans = int(p.y)\r\n\t\t\treturn\r\n\t\t}\r\n\t\ta := make([]int, 10)\r\n\t\ttx := p.x\r\n\t\tfor tx > 0 {\r\n\t\t\ta[tx%10] = 1\r\n\t\t\ttx /= 10\r\n\t\t}\r\n\t\tfor i := 2; i < 10; i++ {\r\n\t\t\tif a[i] == 1 {\r\n\t\t\t\tque <- pair{p.x * int64(i), p.y + 1}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc Solve() {\r\n\tn := ri()\r\n\tvar x int64\r\n\tscan(&x)\r\n\tans = 114514\r\n\tBFS(n, x)\r\n\tif ans == 114514 {\r\n\t\tans = -1\r\n\t}\r\n\tprintln(ans)\r\n}\r\n\r\nfunc main() {\r\n\tT := 1 // 如果是单组样例,请讲 T := 0 改为 T := 1\r\n\tin, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\r\n\tif T == 0 {\r\n\t\tscan(&T)\r\n\t}\r\n\tfor t := 0; t < T; t++ {\r\n\t\tSolve()\r\n\t}\r\n\tout.Flush()\r\n}\r\n\r\nvar in *bufio.Reader\r\nvar out *bufio.Writer\r\n\r\n// ri 将直接读入并返回一个 int\r\nfunc ri() (x int) {\r\n\tscan(&x)\r\n\treturn x\r\n}\r\n\r\n//rs 将直接读入并返回一个 string\r\nfunc rs() (s string) {\r\n\tscan(&s)\r\n\treturn s\r\n}\r\n\r\n//scan 用法与 fmt.scan() 相似,可以传入多个变量的地址进行读入操作\r\nfunc scan(a ...interface{}) { Fscan(in, a...) }\r\n\r\n//print 用法与 fmt.print() 相似,可以传入多个变量进行输出。注意,这个函数不会换行,多个变量之间有空格\r\nfunc print(a ...interface{}) { Fprint(out, a...) }\r\n\r\n//println 用法与 fmt.println() 相似,可以传入多个变量进行输出。这个函数会换行,多个变量之间有空格\r\nfunc println(a ...interface{}) { Fprintln(out, a...) }\r\n\r\n//min 可以传入多个 int 变量,求出这些变量的最小值\r\nfunc min(a ...int) int {\r\n\tans := a[0]\r\n\tfor i := 1; i < len(a); i++ {\r\n\t\tif a[i] < ans {\r\n\t\t\tans = a[i]\r\n\t\t}\r\n\t}\r\n\treturn ans\r\n}\r\n\r\n//max 可以传入多个 int 变量,求出这些变量的最大值\r\nfunc max(a ...int) int {\r\n\tans := a[0]\r\n\tfor i := 1; i < len(a); i++ {\r\n\t\tif a[i] > ans {\r\n\t\t\tans = a[i]\r\n\t\t}\r\n\t}\r\n\treturn ans\r\n}\r\n\r\n//sum 可以传入多个 int 变量,求出这些变量的总和,并返回总和。\r\n//你可以使用 ... 运算符打散数组,使得 sum 函数可以求出数组的和。\r\nfunc sum(a ...int) int {\r\n\tans := 0\r\n\tfor _, x := range a {\r\n\t\tans += x\r\n\t}\r\n\treturn ans\r\n}\r\n", "lang": "Go", "bug_code_uid": "58d460a5e4dae4ace9636086dd865a33", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "e4271be34cb1c191538ec80a9e9d1e8d", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9714066398004222, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype IO struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc NewIO(in io.Reader, out io.Writer) *IO {\n\treturn &IO{in: bufio.NewReader(in), out: out}\n}\n\nfunc (io *IO) ReadInt() int {\n\tvar res int\n\t_, _ = fmt.Fscanf(io.in, \"%d\\n\", &res)\n\treturn res\n}\n\nfunc (io *IO) ReadPairInt() (int, int) {\n\tvar a, b int\n\t_, _ = fmt.Fscanf(io.in, \"%d %d\\n\", &a, &b)\n\treturn a, b\n}\n\nfunc (io *IO) ReadString() string {\n\tvar res string\n\t_, _ = fmt.Fscanf(io.in, \"%s\\n\", &res)\n\treturn res\n}\n\nfunc (io *IO) ReadIntSlice(n int) []int64 {\n\tvar t int64\n\tres := make([]int64, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\t_, _ = fmt.Fscanf(io.in, \"%d\", &t)\n\t\tres = append(res, t)\n\t}\n\t_, _ = fmt.Fscanf(io.in, \"\\n\")\n\treturn res\n}\n\nfunc (io *IO) Println(v ...interface{}) {\n\t_, _ = fmt.Fprintln(io.out, v...)\n}\n\nfunc (io *IO) Print(v ...interface{}) {\n\t_, _ = fmt.Fprint(io.out, v...)\n}\n\nfunc (io *IO) Printf(format string, v ...interface{}) {\n\t_, _ = fmt.Fprintf(io.out, format, v...)\n}\n\nfunc (io *IO) PrintIntSlice(s sort.IntSlice) {\n\tfor _, v := range s {\n\t\tio.Printf(\"%d \", v)\n\t}\n}\n\nfunc (io *IO) PrintlnIntSlice(s sort.IntSlice) {\n\tio.PrintIntSlice(s)\n\tio.Printf(\"\\n\")\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 int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\ntype pair struct {\n\tx, steps int64\n}\n\nfunc main() {\n\tio := NewIO(os.Stdin, os.Stdout)\n\tnm := io.ReadIntSlice(2)\n\n\tstack := make([]pair, 0)\n\tstack = append(stack, pair{x: nm[1], steps: 0})\n\tused := make(map[int64]struct{})\n\n\tmn := int64(1e9)\n\tdone := false\n\n\ts := 0\n\tfor len(stack) > 0 {\n\t\ts++\n\t\t//if s%1000000 == 0 {\n\t\t//\tfmt.Println(stack)\n\t\t//}\n\t\t//fmt.Println(len(stack), mn)\n\t\tlast := stack[len(stack)-1]\n\t\t//fmt.Println(last.x)\n\t\tstack = stack[:len(stack)-1]\n\n\t\tvar currentLen int64 = 0\n\t\tnums := make([]bool, 10)\n\n\t\tcurrentX := last.x\n\t\tfor currentX != 0 {\n\t\t\tnum := currentX % 10\n\t\t\tcurrentX /= 10\n\t\t\tcurrentLen++\n\t\t\tif !nums[num] {\n\t\t\t\tnums[num] = true\n\t\t\t}\n\t\t}\n\n\t\t//fmt.Println(nums)\n\n\t\tif currentLen == nm[0] {\n\t\t\tdone = true\n\t\t\tmn = min(mn, last.steps)\n\t\t} else {\n\t\t\tfor i := int64(9); i >= 2; i-- {\n\t\t\t\tif nums[i] {\n\t\t\t\t\tnext := last.x * i\n\t\t\t\t\t//fmt.Println(\"next\", next)\n\t\t\t\t\tif next < last.x {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif _, ok := used[next]; ok {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif last.steps >= nm[0] {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tstack = append(stack, pair{x: next, steps: last.steps + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif !done {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(mn)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "d4be8f686ccb71a0194d122c0236af92", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "3ed73127530218636fc9f0611f5e53f3", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9710339535775945, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype IO struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc NewIO(in io.Reader, out io.Writer) *IO {\n\treturn &IO{in: bufio.NewReader(in), out: out}\n}\n\nfunc (io *IO) ReadInt() int {\n\tvar res int\n\t_, _ = fmt.Fscanf(io.in, \"%d\\n\", &res)\n\treturn res\n}\n\nfunc (io *IO) ReadPairInt() (int, int) {\n\tvar a, b int\n\t_, _ = fmt.Fscanf(io.in, \"%d %d\\n\", &a, &b)\n\treturn a, b\n}\n\nfunc (io *IO) ReadString() string {\n\tvar res string\n\t_, _ = fmt.Fscanf(io.in, \"%s\\n\", &res)\n\treturn res\n}\n\nfunc (io *IO) ReadIntSlice(n int) []int64 {\n\tvar t int64\n\tres := make([]int64, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\t_, _ = fmt.Fscanf(io.in, \"%d\", &t)\n\t\tres = append(res, t)\n\t}\n\t_, _ = fmt.Fscanf(io.in, \"\\n\")\n\treturn res\n}\n\nfunc (io *IO) Println(v ...interface{}) {\n\t_, _ = fmt.Fprintln(io.out, v...)\n}\n\nfunc (io *IO) Print(v ...interface{}) {\n\t_, _ = fmt.Fprint(io.out, v...)\n}\n\nfunc (io *IO) Printf(format string, v ...interface{}) {\n\t_, _ = fmt.Fprintf(io.out, format, v...)\n}\n\nfunc (io *IO) PrintIntSlice(s sort.IntSlice) {\n\tfor _, v := range s {\n\t\tio.Printf(\"%d \", v)\n\t}\n}\n\nfunc (io *IO) PrintlnIntSlice(s sort.IntSlice) {\n\tio.PrintIntSlice(s)\n\tio.Printf(\"\\n\")\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 int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\ntype pair struct {\n\tx, steps int64\n}\n\nfunc main() {\n\tio := NewIO(os.Stdin, os.Stdout)\n\tnm := io.ReadIntSlice(2)\n\n\tstack := make([]pair, 0)\n\tstack = append(stack, pair{x: nm[1], steps: 0})\n\tused := make(map[int64]struct{})\n\n\tmn := int64(1e9)\n\tdone := false\n\n\ts := 0\n\tfor len(stack) > 0 {\n\t\ts++\n\t\t//if s%1000000 == 0 {\n\t\t//\tfmt.Println(stack)\n\t\t//}\n\t\t//fmt.Println(len(stack), mn)\n\t\tlast := stack[len(stack)-1]\n\t\t//fmt.Println(last.x)\n\t\tstack = stack[:len(stack)-1]\n\n\t\tvar currentLen int64 = 0\n\t\tnums := make([]bool, 10)\n\n\t\tcurrentX := last.x\n\t\tfor currentX != 0 {\n\t\t\tnum := currentX % 10\n\t\t\tcurrentX /= 10\n\t\t\tcurrentLen++\n\t\t\tif !nums[num] {\n\t\t\t\tnums[num] = true\n\t\t\t}\n\t\t}\n\n\t\t//fmt.Println(nums)\n\n\t\tif currentLen == nm[0] {\n\t\t\tdone = true\n\t\t\tmn = min(mn, last.steps)\n\t\t} else {\n\t\t\tfor i := int64(9); i >= 2; i-- {\n\t\t\t\tif nums[i] {\n\t\t\t\t\tnext := last.x * i\n\t\t\t\t\t//fmt.Println(\"next\", next)\n\t\t\t\t\tif next < last.x {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif _, ok := used[next]; ok {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif last.steps >= nm[0]+5 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tstack = append(stack, pair{x: next, steps: last.steps + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif !done {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(mn)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "a7266b5b23fb03cecede13d8b8bc388a", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "3ed73127530218636fc9f0611f5e53f3", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.91701244813278, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc max(a, b int) int {\n\treturn -min(-a, -b)\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b \n}\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tvar p1, t1, p2, t2, h, s int\n\tfmt.Fscan(r, &p1, &t1, &p2, &t2, &h, &s)\n\n\tdp := make([]int, h+1)\n\tfor i := range dp {\n\t\tif i == 0 { continue }\n\t\tdp[i] = min(t1 + dp[max(0, i - (p1-s))], t2 + dp[max(0, i - (p2-s))])\n\t\tfor j := 1; j <= i; j++ {\n\t\t\tif j*t1 >= t2 { dp[i] = min(dp[i], j*t1 + dp[max(0, i - j*(p1-s) - p2)]) }\n\t\t\tif j*t2 >= t1 { dp[i] = min(dp[i], j*t2 + dp[max(0, i - j*(p2-s) - p1)]) }\n\t\t}\n\t}\n\n\tfmt.Fprintln(w, dp[h])\n}\n", "lang": "Go", "bug_code_uid": "5731b34bd6c372377b692a089290cd44", "src_uid": "ca9d48e48e69b931236907a9ac262433", "apr_id": "40d4751e0f7ebd2ec0f867ed0698f694", "difficulty": 2400, "tags": ["dp", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9228070175438596, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "package main\r\nimport (\r\n\t\"bufio\"\r\n\t. \"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n\t//. \"strconv\" Itoa\r\n)\r\nfunc max(i int64, j int64) int64 {\r\n\tif (i > j) {\r\n\t\treturn i;\r\n\t} else {\r\n\t\treturn j;\r\n\t}\r\n}\r\nfunc min(i int64, j int64) int64 {\r\n\tif (i < j) {\r\n\t\treturn i;\r\n\t} else {\r\n\t\treturn j;\r\n\t}\r\n}\r\nconst (\r\n\tINF64 = int64(1e18)\r\n)\r\nfunc solve(_r io.Reader, _w io.Writer) {\r\n\tin := bufio.NewReader(_r)\r\n\tout := bufio.NewWriter(_w)\r\n\r\n\tdefer out.Flush()\r\n\r\n\tp := [2]int64{}\r\n\tt := [2]int64{}\r\n\tFscan(in, &p[0], &t[0], &p[1], &t[1])\r\n\r\n\tvar h, s int64\r\n\tFscan(in, &h, &s)\r\n\r\n\tdp := make([]int64, h+1)\r\n\tfor i := range dp {\r\n\t\tdp[i] = INF64\r\n\t}\r\n\tdp[0] = 0\r\n\tans := INF64\r\n\r\n\tfor i := int64(0); i <= h; i++ {\r\n\t\tfor j := int64(1); j <= h - i; j++ {\r\n\t\t\tfor k := 0; k < 2; k++ {\r\n\t\t\t\tni := min(h, i + j*(p[k]-s) + j*t[k]/t[k^1]*(p[k^1]-s))\r\n\t\t\t\tif ni == h {\r\n\t\t\t\t\tans = min(ans, dp[i] + j*t[k])\r\n\t\t\t\t}\r\n\t\t\t\tif j*t[k] >= t[k^1] {\r\n\t\t\t\t\tni = min(h, i + (j-1)*(p[k]-s) + (j-1)*t[k]/t[k^1]*(p[k^1]-s) + (p[0]+p[1]-s))\r\n\t\t\t\t\tdp[ni] = min(dp[ni], dp[i] + j*t[k])\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tans = min(ans, dp[h])\r\n\tFprintln(out, ans)\r\n}\r\nfunc main() { solve(os.Stdin, os.Stdout) }", "lang": "Go", "bug_code_uid": "0089023c5c72f89816beca3b87bb698d", "src_uid": "ca9d48e48e69b931236907a9ac262433", "apr_id": "bf69a789ba15c6aefcd90e2f6a1c1326", "difficulty": 2400, "tags": ["dp", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9808219178082191, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// You can edit this code!\r\n// Click here and start typing.\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n\tvar t, x int\r\n\tvar a [3]int\r\n\tvar solve bool\r\n\tfmt.Scanf(\"%d\\n\", &t)\r\n\tfor t-1 > 0 {\r\n\t\tsolve = true\r\n\t\tfmt.Scanf(\"%d\\n\", &x)\r\n\t\tfmt.Scanf(\"%d %d %d\\n\", &a[0], &a[1], &a[2])\r\n\t\tif a[0] != 1 && a[1] != 1 && a[2] != 1 {\r\n\t\t\tif a[0] == 0 || a[0] == 1 || a[a[0]-1] != 6-1-a[0] {\r\n\t\t\t\tsolve = false\r\n\t\t\t}\r\n\t\t} else if a[0] != 2 && a[1] != 2 && a[2] != 2 {\r\n\t\t\tif a[1] == 0 || a[1] == 2 || a[a[1]-1] != 6-2-a[1] {\r\n\t\t\t\tsolve = false\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif a[2] == 0 || a[2] == 3 || a[a[2]-1] != 6-3-a[2] {\r\n\t\t\t\tsolve = false\r\n\t\t\t}\r\n\t\t}\r\n\t\tif solve {\r\n\t\t\tfmt.Println(\"YES\")\r\n\t\t} else {\r\n\t\t\tfmt.Println(\"NO\")\r\n\t\t}\r\n\r\n\t}\r\n}\r\n", "lang": "Go", "bug_code_uid": "ebc4c44636402cd683a45b2b75944112", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "5a36e2d078f66c5d0d4a57badc7ed6f1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9809004092769441, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// You can edit this code!\r\n// Click here and start typing.\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n\tvar t, x int\r\n\tvar a [3]int\r\n\tvar solve bool\r\n\tfmt.Scanf(\"%d\\n\", &t)\r\n\tfor t-1 > 0 {\r\n\t\tsolve = true\r\n\t\tfmt.Scanf(\"%d\\n\", &x)\r\n\t\tfmt.Scanf(\"%d %d %d\\n\", &a[0], &a[1], &a[2])\r\n\t\tif a[0] != 1 && a[1] != 1 && a[2] != 1 {\r\n\t\t\tif a[0] == 0 || a[0] == 1 || a[a[0]-1] != 6-1-a[0] {\r\n\t\t\t\tsolve = false\r\n\t\t\t}\r\n\t\t} else if a[0] != 2 && a[1] != 2 && a[2] != 2 {\r\n\t\t\tif a[1] == 0 || a[1] == 2 || a[a[1]-1] != 6-2-a[1] {\r\n\t\t\t\tsolve = false\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif a[2] == 0 || a[2] == 3 || a[a[2]-1] != 6-3-a[2] {\r\n\t\t\t\tsolve = false\r\n\t\t\t}\r\n\t\t}\r\n\t\tif solve {\r\n\t\t\tfmt.Println(\"YES\")\r\n\t\t} else {\r\n\t\t\tfmt.Println(\"NO\")\r\n\t\t}\r\n\t\tt-=1\r\n\t}\r\n}\r\n", "lang": "Go", "bug_code_uid": "b0667aa1ae946c4f931c5ecc18f322d6", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "5a36e2d078f66c5d0d4a57badc7ed6f1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9980806142034548, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar (\r\n\treader = bufio.NewReader(os.Stdin)\r\n\tt, x int\r\n\ta []int\r\n)\r\n\r\nfunc solve(x int, a []int) string {\r\n\tif a[x-1] == 0 {\r\n\t\treturn \"NO\"\r\n\t}\r\n\tvar nextKey = a[x-1]\r\n\tif a[nextKey-1] == 0 || a[nextKey-1] == x-1 {\r\n\t\treturn \"NO\"\r\n\t}\r\n\treturn \"YES\"\r\n}\r\n\r\nfunc main() {\r\n\tfmt.Fscan(reader, &t)\r\n\tfor ; t > 0; t-- {\r\n\t\tfmt.Fscan(reader, &x)\r\n\t\ta = make([]int, 3)\r\n\t\tfor i := 0; i < 3; i++ {\r\n\t\t\tfmt.Fscan(reader, &a[i])\r\n\t\t}\r\n\t\tfmt.Println(solve(x, a))\r\n\t}\r\n}\r\n", "lang": "Go", "bug_code_uid": "4d5ba8bbdfb6959b01367d09d229ed5a", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "82d86495eaff58b69f32e7d12dcaba14", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9811616954474097, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar x int\r\n\r\nfunc main() {\r\n\tin := bufio.NewReader(os.Stdin)\r\n\tout := bufio.NewWriter(os.Stdout)\r\n\tdefer out.Flush()\r\n\tvar t int\r\n\tfmt.Fscan(in, &t)\r\n// \tfmt.Fprintln(out, t)\r\n\tfor t > 0 {\r\n\t\tvar x int\r\n\t\tfmt.Fscan(in, &x)\r\n// \t\tfmt.Fprintln(out, x)\r\n\t\tnums := make([]int, 3)\r\n\t\tfor i := 0; i < 3; i++ {\r\n\t\t\tfmt.Fscan(in, &nums[i])\r\n\t\t}\r\n\t\tmark := make([]bool, 4)\r\n\t\tfor x != 0 {\r\n\t\t\tmark[x] = true\r\n\t\t\tx := nums[x-1]\r\n\t\t\tif x == 0 {\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\t\tif mark[1] && mark[2] && mark[3] {\r\n\t\t\tfmt.Fprintln(out, \"YES\")\r\n\t\t} else {\r\n\t\t\tfmt.Fprintln(out, \"NO\")\r\n\t\t}\r\n\r\n\t\tt--\r\n\t}\r\n}\r\n", "lang": "Go", "bug_code_uid": "bbf19c4543d652b1903947662c54bb91", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "b07e63e6b9167b993bb32b08bbc239b0", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9754935330156569, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "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 (in *B) run() {\n\tT := in.nextInt()\n\tfor t := 0; t < T; t++ {\n\t\tx := float64(in.nextInt())\n\t\ta := math.Sqrt(x)\n\t\tb := math.Cbrt(x)\n\t\tc := math.Cbrt(a)\n\t\tfmt.Println(int32(a + b - c))\n\t}\n}\n\ntype B struct {\n\tsc *bufio.Reader\n\tsplit []string\n\tindex int\n\tseparator string\n}\n\nfunc (in *B) GetLine() string {\n\tline, err := in.sc.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\n\t}\n\tin.split = []string{}\n\tin.index = 0\n\treturn line\n}\n\nfunc (in *B) load() {\n\tif len(in.split) <= in.index {\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\n\t\tin.index = 0\n\t}\n}\n\nfunc (in *B) nextInt() int {\n\tin.load()\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\n\tin.index++\n\treturn val\n}\n\nfunc (in *B) nextInt64() int64 {\n\tin.load()\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\n\tin.index++\n\treturn val\n}\n\nfunc (in *B) nextString() string {\n\tin.load()\n\tval := strings.TrimSpace(in.split[in.index])\n\tin.index++\n\treturn val\n}\n\nfunc NewB(r *bufio.Reader) *B {\n\treturn &B{\n\t\tsc: r,\n\t\tsplit: []string{},\n\t\tindex: 0,\n\t\tseparator: \" \",\n\t}\n}\n\nfunc main() {\n\tfile, err := os.Open(\"input.txt\")\n\tvar F *bufio.Reader\n\tif err == nil {\n\t\tF = bufio.NewReader(file)\n\t\tos.Stdin = file\n\t} else {\n\t\tF = bufio.NewReader(os.Stdin)\n\t}\n\tdefer func(file *os.File) {\n\t\t_ = file.Close()\n\t}(file)\n\tNewB(F).run()\n}\n", "lang": "Go", "bug_code_uid": "d035a8080050ee0dd76445ca375e9423", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "c5eb39c8803e3df627a190141d63dd48", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.8455821635012386, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "package main\r\nimport( \r\n \"fmt\"\r\n \"math\"\r\n \"bufio\"\r\n \"os\"\r\n)\r\nfunc main() {\r\n\tvar t int\r\n\tvar in = bufio.NewReader(os.Stdin)\r\n\tfmt.Fscan(in,&t)\r\n\tfor i:=0;i 0 {\r\n\t\tn := readInt(reader)\r\n\t\tans := int(math.Pow(float64(n), 1.0/2)) + int(math.Pow(float64(n+1), 1.0/3)) - int(math.Pow(float64(n), 1.0/6))\r\n\t\tfmt.Fprintln(writer, ans)\r\n\r\n\t\tt--\r\n\t}\r\n\r\n\twriter.Flush()\r\n}\r\n\r\nfunc bReader(stdin *os.File) *bufio.Reader {\r\n\treturn bufio.NewReaderSize(stdin, 16*1024*1024)\r\n}\r\n\r\nfunc bWriter(stdout *os.File) *bufio.Writer {\r\n\treturn bufio.NewWriterSize(stdout, 16*1024*1024)\r\n}\r\n\r\nfunc readLine(reader *bufio.Reader) string {\r\n\tstr, _, err := reader.ReadLine()\r\n\tif err == io.EOF {\r\n\t\treturn \"\"\r\n\t}\r\n\r\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\r\n}\r\n\r\nfunc checkError(err error) {\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n}\r\n\r\nfunc readInt(reader *bufio.Reader) int {\r\n\treturn int(readInt64(reader))\r\n}\r\n\r\nfunc readInt64(reader *bufio.Reader) int64 {\r\n\tvalue, err := strconv.ParseInt(readLine(reader), 10, 64)\r\n\tcheckError(err)\r\n\r\n\treturn value\r\n}\r\n\r\nfunc readString(reader *bufio.Reader) string {\r\n\treturn readLine(reader)\r\n}\r\n\r\nfunc readArrayString(reader *bufio.Reader) []string {\r\n\treturn strings.Split(strings.TrimSpace(readLine(reader)), \" \")\r\n}\r\n\r\nfunc readArrayInt(reader *bufio.Reader) []int {\r\n\tarTemp := strings.Split(strings.TrimSpace(readLine(reader)), \" \")\r\n\tn := len(arTemp)\r\n\r\n\tvar ar []int\r\n\r\n\tfor i := 0; i < n; i++ {\r\n\t\tarItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)\r\n\t\tcheckError(err)\r\n\t\tarItem := int(arItemTemp)\r\n\t\tar = append(ar, arItem)\r\n\t}\r\n\r\n\treturn ar\r\n}\r\n\r\nfunc readArrayInt64(reader *bufio.Reader) []int64 {\r\n\tarTemp := strings.Split(strings.TrimSpace(readLine(reader)), \" \")\r\n\tn := len(arTemp)\r\n\r\n\tvar ar []int64\r\n\r\n\tfor i := 0; i < n; i++ {\r\n\t\tarItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)\r\n\t\tcheckError(err)\r\n\t\tarItem := arItemTemp\r\n\t\tar = append(ar, arItem)\r\n\t}\r\n\r\n\treturn ar\r\n}\r\n\r\nfunc readTwoInt(reader *bufio.Reader) (int, int) {\r\n\tar := readArrayInt(reader)\r\n\treturn ar[0], ar[1]\r\n}\r\n\r\nfunc readTwoInt64(reader *bufio.Reader) (int64, int64) {\r\n\tar := readArrayInt64(reader)\r\n\treturn ar[0], ar[1]\r\n}\r\n\r\nfunc readThreeInt(reader *bufio.Reader) (int, int, int) {\r\n\tar := readArrayInt(reader)\r\n\treturn ar[0], ar[1], ar[2]\r\n}\r\n\r\nfunc readThreeInt64(reader *bufio.Reader) (int64, int64, int64) {\r\n\tar := readArrayInt64(reader)\r\n\treturn ar[0], ar[1], ar[2]\r\n}\r\n\r\nfunc gcd(x int64, y int64) int64 {\r\n\tfor y > 0 {\r\n\t\tx, y = y, x % y\r\n\t}\r\n\r\n\treturn x\r\n}\r\n\r\nfunc lcm(x int64, y int64) int64 {\r\n\treturn x*y/gcd(x,y)\r\n}\r\n", "lang": "Go", "bug_code_uid": "c78911d79c1098aa89da1c0208f4ab18", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "b9a9b08750e6495a7568b1f79dfc3835", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9884995988232148, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"math\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\ntype CF1619B struct {\r\n\tsc *bufio.Reader\r\n\tsplit []string\r\n\tindex int\r\n\tseparator string\r\n}\r\n\r\nfunc (in *CF1619B) GetLine() string {\r\n\tline, err := in.sc.ReadString('\\n')\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\r\n\t}\r\n\tin.split = []string{}\r\n\tin.index = 0\r\n\treturn line\r\n}\r\nfunc (in *CF1619B) load() {\r\n\tif len(in.split) <= in.index {\r\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\r\n\t\tin.index = 0\r\n\t}\r\n}\r\n\r\nfunc (in *CF1619B) NextInt() int {\r\n\tin.load()\r\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1619B) NextInt64() int64 {\r\n\tin.load()\r\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1619B) NextString() string {\r\n\tin.load()\r\n\tval := strings.TrimSpace(in.split[in.index])\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\n/**\r\nTO SEND\r\nRun solve the problem CF1619B\r\nDate: 3/01/22\r\nUser: pepradere\r\nURL: https://codeforces.com/problemset/problem/1619/B\r\nProblem: CF1619B\r\n**/\r\nfunc (in *CF1619B) Run() {\r\n\tmapa := make(map[int]int)\r\n\tarr := make([]int, 0)\r\n\tto := int(math.Sqrt(1000000000))\r\n\tfor i := 1; i <= to; i++ {\r\n\t\tif _, ok := mapa[i*i]; !ok {\r\n\t\t\tarr = append(arr, i*i)\r\n\t\t\tmapa[i*i] = 1\r\n\t\t}\r\n\t\tif _, ok := mapa[i*i*i]; !ok {\r\n\t\t\tarr = append(arr, i*i*i)\r\n\t\t\tmapa[i*i*i] = 1\r\n\t\t}\r\n\t}\r\n\tfor t := in.NextInt(); t > 0; t-- {\r\n\t\tn := in.NextInt()\r\n\t\tcount := 0\r\n\t\tfor i := 0; i < len(arr); i++ {\r\n\t\t\tif arr[i] <= n {\r\n\t\t\t\tcount++\r\n\t\t\t}\r\n\t\t}\r\n\t\tfmt.Println(count)\r\n\t}\r\n}\r\n\r\nfunc NewCF1619B(r *bufio.Reader) *CF1619B {\r\n\treturn &CF1619B{\r\n\t\tsc: r,\r\n\t\tsplit: []string{},\r\n\t\tindex: 0,\r\n\t\tseparator: \" \",\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tNewCF1619B(bufio.NewReader(os.Stdin)).Run()\r\n}\r\n", "lang": "Go", "bug_code_uid": "1a749163270397c0ac61c2cdd64632a2", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "3693d172c36f30130b639e3cc3917339", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9846938775510204, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"bytes\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n)\r\n\r\nfunc countDominoes(n, m int) int {\r\n\tif n < 2 {\r\n\t\treturn m - 1\r\n\t}\r\n\r\n\tif m < 2 {\r\n\t\treturn n - 1\r\n\t}\r\n\r\n\treturn n * (m - 1)\r\n}\r\n\r\n// RunforDominoes ...\r\n// https://codeforces.com/problemset/problem/1725/A\r\nfunc RunforDominoes() {\r\n\tbuf := bufio.NewReader(os.Stdin)\r\n\tline, _, err := buf.ReadLine()\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t\treturn\r\n\t}\r\n\r\n\tp := bytes.IndexByte(line, ' ')\r\n\r\n\tn, _ := strconv.Atoi(string(line)[:p])\r\n\tm, _ := strconv.Atoi(string(line)[p+1:])\r\n\r\n\tfmt.Println(countDominoes(n, m))\r\n}\r\n", "lang": "Go", "bug_code_uid": "85d1719c2282d62a8daab84b415199ec", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "cdd8e253139c973ba7311a110bd5abbd", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9930915371329879, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"bytes\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n)\r\n\r\nfunc countDominoes(n, m int) int {\r\n\tif n < 2 {\r\n\t\treturn m\r\n\t}\r\n\r\n\tif m < 2 {\r\n\t\treturn n\r\n\t}\r\n\r\n\treturn n * (m - 1)\r\n}\r\n\r\n// RunforDominoes ...\r\n// https://codeforces.com/problemset/problem/1725/A\r\nfunc main() {\r\n\tbuf := bufio.NewReader(os.Stdin)\r\n\tline, _, err := buf.ReadLine()\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t\treturn\r\n\t}\r\n\r\n\tp := bytes.IndexByte(line, ' ')\r\n\r\n\tn, _ := strconv.Atoi(string(line)[:p])\r\n\tm, _ := strconv.Atoi(string(line)[p+1:])\r\n\r\n\tfmt.Println(countDominoes(n, m))\r\n}\r\n", "lang": "Go", "bug_code_uid": "afbb063ec08973fff68b7ac73bb4d769", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "cdd8e253139c973ba7311a110bd5abbd", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.41947565543071164, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"fmt\"\r\n)\r\n\r\n\r\nfunc main() {\r\n\r\n\tvar row int\r\n\tvar col int\r\n\r\n\tfmt.Scanln(&row)\r\n\tfmt.Scanln(&col)\r\n\r\n\tm := make([][]int, row)\r\n\tfor i:=0; i= 1 {\r\n\r\n\t\tfor i:=0; i= 1 {\r\n\r\n\t\tfor i:=0; i0; t--{\n\t\tvar n, k int\n\t\tfmt.Fscan(in,&n,&k)\n\t\tpow := [300005]ll{}\n\t\tpow[1]=1\n\t\tfor i:=2;i<=n;i++{\n\t\t\tpow[i] = (pow[i-1]*2)%mod\n\t\t}\n\t\tdp := [300005][2]ll{}\n\t\tvar m ll\n\t\tm=1\n\t\tdp[0][0]= m\n\t\tfor i:=1;i<=k;i++{\n\t\t\tif n%2==1{\n\t\t\t\tdp[i][0] = (dp[i-1][0] * (pow[n] + 1))%mod\n\t\t\t\tdp[i][1] = (dp[i-1][1] * pow[n] * 2)%mod\n\t\t\t}else if n%2==0{\n\t\t\t\tdp[i][0] = (dp[i-1][0] *(pow[n] -1))%mod\n\t\t\t\tdp[i][1] = (dp[i-1][0] + dp[i-1][1] * pow[n] * 2)%mod\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintf(out,\"%d\",(dp[k][0]+dp[k][1])%mod)\n\t}\n}\n", "lang": "Go", "bug_code_uid": "3325681a5ba4256c68a34e0a6efe2aee", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "c92c32e9aa2b055366f17264127bf54e", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9609561752988047, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nvar _, _, _ = main, rw, do\r\n\r\nfunc main() {\r\n\tr, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\r\n\tdefer w.Flush()\r\n\trw(r, w)\r\n}\r\n\r\nfunc rw(r io.Reader, w io.Writer) {\r\n\tvar t int\r\n\tvar n, k int\r\n\tfmt.Fscan(r, &t)\r\n\tfor ti := 0; ti < t; ti++ {\r\n\t\tfmt.Fscan(r, &n, &k)\r\n\t\tw1 := do(n, k)\r\n\t\tfmt.Fprint(w, w1)\r\n\t\tfmt.Fprintln(w)\r\n\t}\r\n}\r\n\r\nfunc do(n, k int) int64 {\r\n\tif k == 0 {\r\n\t\treturn 1\r\n\t}\r\n\ttk := getTk(n, k)\r\n\tgr, eq := getGrEq(n)\r\n\tr := gr + eq\r\n\tfor i := 2; i <= k; i++ {\r\n\t\tr = (((eq * r) % mod) + ((gr * tk[i-1]) % mod)) % mod\r\n\t}\r\n\treturn r\r\n}\r\n\r\nconst mod = 1e9 + 7\r\n\r\nfunc getTn(n int) []int64 {\r\n\ttn := make([]int64, n+1)\r\n\ttn[0] = 1\r\n\tfor i := 1; i <= n; i++ {\r\n\t\ttn[i] = (tn[i-1] * 2) % mod\r\n\t}\r\n\treturn tn\r\n}\r\n\r\nfunc getTk(n, k int) []int64 {\r\n\ttk := make([]int64, k+1)\r\n\ttk[0] = 1\r\n\ttn := getTn(n)\r\n\tfor i := 1; i <= k; i++ {\r\n\t\ttk[i] = (tk[i-1] * tn[n]) % mod\r\n\t}\r\n\tfor i := 1; i <= k; i++ {\r\n\t\ttk[i] = (tk[i] + tk[i-1]) % mod\r\n\t}\r\n\treturn tk\r\n}\r\n\r\nfunc getGrEq(n int) (int64, int64) {\r\n\tif n == 1 {\r\n\t\treturn 0, 1\r\n\t}\r\n\tif n == 2 {\r\n\t\treturn 1, 1\r\n\t}\r\n\ttn := getTn(n)\r\n\tvar gr, eq int64 = 0, tn[n-1]\r\n\tif n%2 == 0 {\r\n\t\tgr = 1\r\n\t} else {\r\n\t\teq = (eq + 1) % mod\r\n\t}\r\n\treturn gr, eq\r\n}", "lang": "Go", "bug_code_uid": "0c1b59c2555ef791309ee18efdf2abc2", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "9f10e7472e9ad6547b16266305d74750", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7874306839186691, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import(\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\tvar t int\r\n\t_, err := fmt.Scan(&t)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tfor i := 0; t > i; i++ {\r\n\t\tvar a []int\r\n\t\tfor j := 0; 2 > j ; j++ {\r\n\t\t\tvar v1 int\r\n\t\t\tvar v2 int\r\n\t\t\t_, err := fmt.Scanf(\"%d %d\", &v1, &v2)\r\n\t\t\tif err != nil {\r\n\t\t\t\tpanic(err)\r\n\t\t\t}\r\n\t\t\ta = append(a, v1, v2)\r\n\t\t}\r\n\r\n\t\tif a[0] + a[1] + a[2] + a[3] == 4 {\r\n\t\t\tfmt.Println(\"2\")\r\n\t\t} else if a[0] + a[1] + a[2] + a[3] == 0 {\r\n\t\t\tfmt.Println(\"0\")\r\n\t\t} else {\r\n\t\t\tfmt.Println(\"1\")\r\n\t\t}\r\n\t}\r\n\r\n}\r\n", "lang": "Go", "bug_code_uid": "5f2e8275709814c5a615323db4e557d3", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "7f25835125c7c6f117625447995c8a5e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"} {"similarity_score": 0.9339433800400343, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\ntype CF1701A struct {\r\n\tsc *bufio.Reader\r\n\tsplit []string\r\n\tindex int\r\n\tseparator string\r\n}\r\n\r\nfunc (in *CF1701A) GetLine() string {\r\n\tline, err := in.sc.ReadString('\\n')\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\r\n\t}\r\n\tin.split = []string{}\r\n\tin.index = 0\r\n\treturn line\r\n}\r\nfunc (in *CF1701A) load() {\r\n\tif len(in.split) <= in.index {\r\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\r\n\t\tin.index = 0\r\n\t}\r\n}\r\n\r\nfunc (in *CF1701A) NextInt() int {\r\n\tin.load()\r\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextInt64() int64 {\r\n\tin.load()\r\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextString() string {\r\n\tin.load()\r\n\tval := strings.TrimSpace(in.split[in.index])\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\n/**\r\nRun solve the problem CF1701A\r\nDate: 17/07/22\r\nUser: pepradere\r\nURL: https://codeforces.com/problemset/problem/1701/A\r\nProblem: CF1701A\r\n**/\r\nfunc (in *CF1701A) Run() {\r\n\tfor t := in.NextInt(); t > 0; t-- {\r\n\t\ta := in.NextString()+\" \"+in.NextString()\r\n\t\tb := in.NextString()+\" \"+in.NextString()\r\n\r\n\t\tans := 0\r\n\t\tif a == \"0 0\" && b == \"0 0\" {\r\n\t\t\tans = 0\r\n\t\t}else if a == \"0 1\" && b == \"0 1\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 0\" && b == \"0 1\" {\r\n\t\t\tans = 1\r\n\t\t} else if a == \"0 1\" && b == \"1 0\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 0\" && b == \"1 0\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 1\" && b == \"1 1\" {\r\n\t\t\tans = 2\r\n\t\t}\r\n\t\tfmt.Println(ans)\r\n\t}\r\n}\r\n\r\nfunc NewCF1701A(r *bufio.Reader) *CF1701A {\r\n\treturn &CF1701A{\r\n\t\tsc: r,\r\n\t\tsplit: []string{},\r\n\t\tindex: 0,\r\n\t\tseparator: \" \",\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tNewCF1701A(bufio.NewReader(os.Stdin)).Run()\r\n}\r\n", "lang": "Go", "bug_code_uid": "6bb189a0e83fb69388d50286f97ebc77", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "0784e75fb3e6ec0670af85badfcf3d34", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6981549815498155, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "/******************************************************************************\r\n\r\n Online Go Lang Compiler.\r\n Code, Compile, Run and Debug Go Lang program online.\r\nWrite your code in this editor and press \"Run\" button to execute it.\r\n\r\n*******************************************************************************/\r\n\r\n\r\npackage main\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n var testCase int;\r\n fmt.Scanf(\"%d \", &testCase);\r\n for testCase > 0 {\r\n v := 0\r\n for i:=0; i<4; i++ {\r\n var x int\r\n fmt.Scanf(\"%d \", &x)\r\n v += x\r\n }\r\n if (v == 0) {\r\n fmt.Println(0);\r\n } else if (v == 1 || v == 3) {\r\n fmt.Println(1);\r\n } else {\r\n fmt.Println(2);\r\n }\r\n testCase--;\r\n }\r\n \r\n}\r\n", "lang": "Go", "bug_code_uid": "059808ef5a2f3f8879641f1d8400b891", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "647de31a67549745ee596b90bcd3e051", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9683478260869566, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar (\r\n\twriter = bufio.NewWriter(os.Stdout)\r\n\tscanner = bufio.NewScanner(os.Stdin)\r\n)\r\n\r\nfunc init() {\r\n\tscanner.Split(bufio.ScanWords)\r\n\tscanner.Buffer(make([]byte, 4096), 1e9)\r\n}\r\n\r\nfunc printf(f string, a ...interface{}) {\r\n\tfmt.Fprintf(writer, f, a...)\r\n}\r\n\r\nfunc _int() int {\r\n\ts := _string()\r\n\ti := 0\r\n\tif s[0] == '-' {\r\n\t\tfor _, r := range s[1:] {\r\n\t\t\ti *= 10\r\n\t\t\ti -= int(r - '0')\r\n\t\t}\r\n\t\treturn i\r\n\t}\r\n\tfor _, r := range s {\r\n\t\ti *= 10\r\n\t\ti += int(r - '0')\r\n\t}\r\n\treturn i\r\n}\r\n\r\nfunc _int64() int64 {\r\n\ts := _string()\r\n\ti := int64(0)\r\n\tif s[0] == '-' {\r\n\t\tfor _, r := range s[1:] {\r\n\t\t\ti *= 10\r\n\t\t\ti -= int64(r - '0')\r\n\t\t}\r\n\t\treturn i\r\n\t}\r\n\tfor _, r := range s {\r\n\t\ti *= 10\r\n\t\ti += int64(r - '0')\r\n\t}\r\n\treturn i\r\n}\r\n\r\nfunc _string() string {\r\n\tif !scanner.Scan() {\r\n\t\tpanic(scanner.Err())\r\n\t}\r\n\treturn scanner.Text()\r\n}\r\n\r\nfunc main() {\r\n\tdefer writer.Flush()\r\n\tfor t := _int(); t > 0; t-- {\r\n\t\tn := _int()\r\n\t\tm := _int()\r\n\t\tk := _int()\r\n\t\tans := sol(n, m, k)\r\n\t\tif ans {\r\n\t\t\tprintf(\"YES\\n\")\r\n\t\t} else {\r\n\t\t\tprintf(\"NO\\n\")\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc sol(n, m, k int) bool {\r\n\tif m&1 == 0 && n&1 == 0 {\r\n\t\treturn k&1 == 0\r\n\t}\r\n\tif m&1 == 1 && n&1 == 0 {\r\n\t\tif k*2 > (m-1)*n { // cannot fit horizontally\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn k&1 == 0\r\n\t}\r\n\tif n&1 == 1 && m&1 == 0 {\r\n\t\treturn (k*2)%m == 0 && ((k*2)/m)&1 == 1\r\n\t}\r\n\t// shouldn't reach here\r\n\treturn false\r\n}\r\n", "lang": "Go", "bug_code_uid": "5512ad873fc9aa03df74637fee61819f", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "fa0ea23aa4ed528862ca2c0166326b80", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9899475524475524, "equal_cnt": 12, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 11, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t. \"fmt\"\r\n\t\"os\"\r\n\t// \"strings\"\r\n\t// \"container/heap\"\r\n\t// \"bytes\"\r\n\t// \"math\"\r\n\t// \"strconv\"\r\n)\r\n\r\nvar r = bufio.NewReader(os.Stdin)\r\nvar w = bufio.NewWriter(os.Stdout)\r\n\r\nvar n,m int\r\nvar k int\r\nvar turn int \r\nconst MOD int64 = 1e9 + 7\r\nvar s,t string\r\nfunc solve(){\r\n\tFscan(r,&n,&m,&k)\r\n\tif n%2==0 && m%2==0{\r\n\t\tif k%2==0{\r\n\t\t\tFprint(\"YES\\n\")\r\n\t\t}else{\r\n\t\t\tFprint(\"NO\\n\")\r\n\t\t}\r\n\t}else if n%2==1 && m%2==0{\r\n\t\tif (k-m/2)%2==0{\r\n\t\t\tFprint(\"YES\\n\")\r\n\t\t}else{\r\n\t\t\tFprint(\"NO\\n\")\r\n\t\t}\r\n\t}else if n%2==0 && m%2==1{\r\n\t\tif (k-n/2)%2==0{\r\n\t\t\tFprint(\"YES\\n\")\r\n\t\t}else{\r\n\t\t\tFprint(\"NO\\n\")\r\n\t\t}\r\n\t}else{\r\n\t\tFprint(\"NO\\n\")\r\n\t}\r\n\r\n\treturn\r\n}\r\n\r\nfunc main(){\r\n\tdefer w.Flush()\r\n\t// Fscan(r,&n,&m)\r\n\t// Fscan(r,&n)\r\n\tFscan(r,&turn)\r\n\t// Fscan(r,&s)\r\n\t// Fscan(r,&k)\r\n\r\n\tfor i:=0;i y {return x};return y}\r\nfunc abs(x int64) int64 {if x > 0 {return x};return -x}\r\nfunc min(x, y int64) int64 {if x < y {return x};return y}\r\nfunc memset(a []int, v int) {\r\n if len(a) == 0 {return}\r\n a[0] = v\r\n for bp := 1; bp < len(a); bp *= 2 {\r\n copy(a[bp:], a[:bp])\r\n }\r\n}\r\n\r\n/* ===========================PART 2: Heap func ============================ */\r\n// type hp struct{ sort.IntSlice }\r\n// func (h hp) Less(i, j int) bool { return h.IntSlice[i] > h.IntSlice[j] }\r\n// func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int)) }\r\n// func (h *hp) Pop() interface{} { a := h.IntSlice; v := a[len(a)-1]; h.IntSlice = a[:len(a)-1]; return v }\r\n\r\n// /* ===========================PART 3: String func ============================ */\r\n// func reverse(a []byte){\r\n// \tfor i,n :=0,len(a);i y {return x};return y}\r\nfunc abs(x int64) int64 {if x > 0 {return x};return -x}\r\nfunc min(x, y int64) int64 {if x < y {return x};return y}\r\nfunc memset(a []int, v int) {\r\n if len(a) == 0 {return}\r\n a[0] = v\r\n for bp := 1; bp < len(a); bp *= 2 {\r\n copy(a[bp:], a[:bp])\r\n }\r\n}\r\n\r\n/* ===========================PART 2: Heap func ============================ */\r\n// type hp struct{ sort.IntSlice }\r\n// func (h hp) Less(i, j int) bool { return h.IntSlice[i] > h.IntSlice[j] }\r\n// func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int)) }\r\n// func (h *hp) Pop() interface{} { a := h.IntSlice; v := a[len(a)-1]; h.IntSlice = a[:len(a)-1]; return v }\r\n\r\n// /* ===========================PART 3: String func ============================ */\r\n// func reverse(a []byte){\r\n// \tfor i,n :=0,len(a);i arr[j]\n// })\n\nfunc MIN(x, y int64) int64 {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc MKO(x, y int64) int64 {\n\tif x < y {\n\t\treturn 0\n\t} else {\n\t\treturn x - y + 1\n\t}\n}\n\nfunc MAX(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc LCM(x, y int) int {\n\tif x >= y {\n\t\tinitial := x\n\t\tfor i := 1; i < y+2; i++ {\n\t\t\tif initial%y == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + x\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t} else {\n\t\tinitial := y\n\t\tfor i := 1; i < x+2; i++ {\n\t\t\tif initial%x == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + y\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t}\n}\n\nfunc GCD(x, y int64) int64 {\n\tvar l, q int64\n\tl = MAX(x, y)\n\tq = MIN(x, y)\n\tvar m int64\n\tfor l*q > 0 {\n\t\ta := l % q\n\t\tb := l - a\n\t\tcc := int64(b / q)\n\t\tremain := l - cc*q\n\t\tl = MAX(remain, q)\n\t\tq = MIN(remain, q)\n\t\tif l*q == 0 {\n\t\t\tm = l + q\n\t\t\tbreak\n\t\t}\n\n\t}\n\treturn m\n}\n\nfunc IsItPrime(x int) bool {\n\tif x < 10 {\n\t\tif x == 2 || x == 3 || x == 5 || x == 7 {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tj := 0\n\t\tk := math.Sqrt(float64(x))\n\t\tfor m := 3; m <= int(k); {\n\t\t\tif x%m == 0 {\n\t\t\t\tj = 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm = m + 2\n\t\t}\n\t\tif j == 1 {\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n}\n\nfunc PrimeFactorization(n int) (pfs map[int]int) {\n\tpfs = make(map[int]int)\n\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tif _, ok := pfs[2]; ok {\n\t\t\tpfs[2] += 1\n\t\t} else {\n\t\t\tpfs[2] = 1\n\t\t}\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\tif _, ok := pfs[i]; ok {\n\t\t\t\tpfs[i] += 1\n\t\t\t} else {\n\t\t\t\tpfs[i] = 1\n\t\t\t}\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[n] = 1\n\t}\n\n\treturn\n}\n\nfunc NumberOfDivisors(n int) int {\n\tpfs := PrimeFactorization(n)\n\n\tnum := 1\n\tfor _, exponents := range pfs {\n\t\tnum *= (exponents + 1)\n\t}\n\n\treturn num\n}\n\nfunc KthPrime(x int) (y int) {\n\tif x == 1 {\n\t\ty = 2\n\t}\n\tif x == 2 {\n\t\ty = 3\n\t}\n\tif x > 2 {\n\t\tvar sum int = 2\n\t\tbegin := 5\n\t\tfor sum < x+1 {\n\t\t\tif IsItPrime(begin) == true {\n\t\t\t\tsum++\n\t\t\t}\n\t\t\tif sum == x {\n\t\t\t\ty = begin\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tif begin%6 == 1 {\n\t\t\t\t\tbegin = begin + 4\n\t\t\t\t} else {\n\t\t\t\t\tbegin = begin + 2\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\nfunc MODULE(x, y int) int {\n\tif x > y {\n\t\treturn x - y\n\t} else {\n\t\treturn y - x\n\t}\n}\n\nvar t int\n\nfunc main() {\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &t)\n\n\tfor o := 0; o < t; o++ {\n\t\tvar n, m, k int\n\t\tfmt.Fscan(input, &n, &m, &k)\n\n\t\tif m%2 == 0 {\n\t\t\tll := int(n*m/2) - k\n\t\t\tif ll%2 == 1 {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t} else {\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\tif k >= int(m/2) {\n\t\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\too := int(n*(m-1)/2) - k\n\t\t\tif oo%2 == 1 {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t} else {\n\t\t\t\tif k <= n*(m-1) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n}\n", "lang": "Go", "bug_code_uid": "f33f0fc8f52be5d47eb35900f978abf4", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "5652f61922f540513d08c289a6dcabce", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.5879176510293621, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"math\"\r\n\t\"os\"\r\n\t\"sort\"\r\n)\r\n\r\nvar (\r\n\tin = bufio.NewReader(os.Stdin)\r\n\tdp []int64\r\n)\r\n\r\nfunc main() {\r\n\tvar test int = 1\r\n\t//fmt.Fscan(in, &test)\r\n\tfor i := 0; i < test; i++ {\r\n\t\tsolve()\r\n\t}\r\n\r\n}\r\n\r\nfunc init() {\r\n\tdp = make([]int64, 50)\r\n}\r\n\r\nfunc solve() {\r\n\tvar n, internalm int64\r\n\tfmt.Fscan(in, &n)\r\n\tfmt.Fscan(in, &internalm)\r\n\tsolve2(n, 0)\r\n\tfmt.Println(dp[n] % internalm)\r\n\r\n}\r\n\r\nfunc solve2(n int64, tempCount int64) int64 {\r\n\tif n < 1 {\r\n\t\treturn 0\r\n\t}\r\n\tif n == 1 {\r\n\t\treturn 1\r\n\t}\r\n\tif dp[n] != 0 {\r\n\t\treturn dp[n]\r\n\t}\r\n\tvar currentAns int64\r\n\tfor i := 1; i < int(n); i++ {\r\n\t\tcurrentAns += solve2(n-int64(i), tempCount+1)\r\n\t}\r\n\tfor i := 2; i <= int(n); i++ {\r\n\t\tcurrentAns += solve2(int64(math.Floor(float64(n/int64(i)))), tempCount+1)\r\n\t}\r\n\tdp[n] = currentAns\r\n\treturn currentAns\r\n}\r\n\r\n//x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-TEMPLATE_STARTING-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-\r\n\r\ntype pair struct {\r\n\ta int64\r\n\tb int64\r\n}\r\n\r\nfunc sortPair(pairs []pair) {\r\n\tsort.Slice(pairs, func(i, j int) bool {\r\n\t\treturn pairs[i].a < pairs[j].a\r\n\t})\r\n}\r\nfunc min(a int64, b int64) int64 {\r\n\tif a < b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc printArray(arr []int) {\r\n\tfor i := 1; i < len(arr); i++ {\r\n\t\tfmt.Print(arr[i], \" \")\r\n\t}\r\n\tfmt.Println()\r\n}\r\n\r\ntype runeSort []rune\r\n\r\nfunc (r runeSort) Len() int { return len(r) }\r\nfunc (r runeSort) Swap(i, j int) { r[i], r[j] = r[j], r[i] }\r\nfunc (r runeSort) Less(i, j int) bool { return r[i] < r[j] }\r\n", "lang": "Go", "bug_code_uid": "b3c002ed609abcbe9dda2cd49ef8ead6", "src_uid": "a524aa54e83fd0223489a19531bf0e79", "apr_id": "72704a1063fb0a97f9ac6e0f65faa3fa", "difficulty": 1700, "tags": ["dp", "number theory", "data structures", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.5876010781671159, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"math\"\r\n\t\"os\"\r\n\t\"sort\"\r\n)\r\n\r\nvar (\r\n\tin = bufio.NewReader(os.Stdin)\r\n\tdp []int64\r\n)\r\n\r\nfunc main() {\r\n\tvar test int = 1\r\n\t//fmt.Fscan(in, &test)\r\n\tfor i := 0; i < test; i++ {\r\n\t\tsolve()\r\n\t}\r\n\r\n}\r\n\r\nfunc init() {\r\n\tdp = make([]int64, 1000000)\r\n}\r\n\r\nfunc solve() {\r\n\tvar n, internalm int64\r\n\tfmt.Fscan(in, &n)\r\n\tfmt.Fscan(in, &internalm)\r\n\tsolve2(n, 0)\r\n\tfmt.Println(dp[n] % internalm)\r\n\r\n}\r\n\r\nfunc solve2(n int64, tempCount int64) int64 {\r\n\tif n < 1 {\r\n\t\treturn 0\r\n\t}\r\n\tif n == 1 {\r\n\t\treturn 1\r\n\t}\r\n\tif dp[n] != 0 {\r\n\t\treturn dp[n]\r\n\t}\r\n\tvar currentAns int64\r\n\tfor i := 1; i < int(n); i++ {\r\n\t\tcurrentAns += solve2(n-int64(i), tempCount+1)\r\n\t}\r\n\tfor i := 2; i <= int(n); i++ {\r\n\t\tcurrentAns += solve2(int64(math.Floor(float64(n/int64(i)))), tempCount+1)\r\n\t}\r\n\tdp[n] = currentAns\r\n\treturn currentAns\r\n}\r\n\r\n//x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-TEMPLATE_STARTING-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-\r\n\r\ntype pair struct {\r\n\ta int64\r\n\tb int64\r\n}\r\n\r\nfunc sortPair(pairs []pair) {\r\n\tsort.Slice(pairs, func(i, j int) bool {\r\n\t\treturn pairs[i].a < pairs[j].a\r\n\t})\r\n}\r\nfunc min(a int64, b int64) int64 {\r\n\tif a < b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc printArray(arr []int) {\r\n\tfor i := 1; i < len(arr); i++ {\r\n\t\tfmt.Print(arr[i], \" \")\r\n\t}\r\n\tfmt.Println()\r\n}\r\n\r\ntype runeSort []rune\r\n\r\nfunc (r runeSort) Len() int { return len(r) }\r\nfunc (r runeSort) Swap(i, j int) { r[i], r[j] = r[j], r[i] }\r\nfunc (r runeSort) Less(i, j int) bool { return r[i] < r[j] }\r\n", "lang": "Go", "bug_code_uid": "f3c80113fafb99f798f07b6e9a5ffe1d", "src_uid": "a524aa54e83fd0223489a19531bf0e79", "apr_id": "72704a1063fb0a97f9ac6e0f65faa3fa", "difficulty": 1700, "tags": ["dp", "number theory", "data structures", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.6593557230980124, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nvar _, _, _ = main, rw, do\r\n\r\nfunc main() {\r\n\tr, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\r\n\tdefer w.Flush()\r\n\trw(r, w)\r\n}\r\n\r\nfunc rw(r io.Reader, w io.Writer) {\r\n\tvar n int\r\n\tvar m int64\r\n\tfmt.Fscan(r, &n, &m)\r\n\tw1 := do(n, m)\r\n\tfmt.Fprintln(w, w1)\r\n}\r\n\r\nfunc do(n int, m int64) int64 {\r\n\td := make([]int64, n+1)\r\n\td[n] = 1\r\n\tfor i := n; i >= 1; i-- {\r\n\t\tfor j := 1; j < i; j++ {\r\n\t\t\td[i-j] = (d[i-j] + d[i]) % m\r\n\t\t}\r\n\t\tfor j := n; j >= 2; j-- {\r\n\t\t\td[i/j] = (d[i/j] + d[i]) % m\r\n\t\t}\r\n\t}\r\n\treturn d[1]\r\n}\r\n", "lang": "Go", "bug_code_uid": "dfd809e8c7e2f1f7b8eab178b2ffd6ed", "src_uid": "a524aa54e83fd0223489a19531bf0e79", "apr_id": "a1b5469c70dcee96b99ca776ef7873a5", "difficulty": 1700, "tags": ["dp", "number theory", "data structures", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9885771190908559, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\nvar wrtr = bufio.NewWriterSize(os.Stdout, 10_000_000)\nvar rdr = bufio.NewScanner(os.Stdin)\nfunc gs() string { rdr.Scan(); return rdr.Text() }\nfunc gi() int { i,e := strconv.Atoi(gs()); if e != nil {panic(e)}; return i }\nfunc gis(n int) []int { res := make([]int,n); for i:=0;i b { return a }; return b }\nfunc min(a,b int) int { if a > b { return b }; return a }\nfunc maxarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }\nfunc minarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }\nfunc sumarr(a []int) int { ans := 0; for _,aa := range(a) { ans += aa }; return ans }\nfunc zeroarr(a []int) { for i:=0; i 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }\nfunc powint(a,e int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }\nfunc gcd(a,b int) int { for b != 0 { t:=b; b=a%b; a=t }; return a }\nfunc gcdExtended(a,b int) (int,int,int) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended(b%a,a); return gcd, y1-(b/a)*x1,x1 }\nfunc modinv(a,m int) (int,bool) { g,x,_ := gcdExtended(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true }\nfunc vecintstring(a []int) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.Itoa(a) }; return strings.Join(astr,\" \") }\nfunc makefact(n int,mod int) ([]int,[]int) {\n\tfact,factinv := make([]int,n+1),make([]int,n+1)\n\tfact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * i % mod }\n\tfactinv[n] = powmod(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * (i+1) % mod }\n\treturn fact,factinv\n}\n\nfunc ia64(m int) []int64 { return make([]int64,m) }\nfunc iai64(m int,v int64) []int64 { a := make([]int64,m); for i:=0;i b { return a }; return b }\nfunc min64(a,b int64) int64 { if a > b { return b }; return a }\nfunc maxarr64(a []int64) int64 { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }\nfunc minarr64(a []int64) int64 { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }\nfunc sumarr64(a []int64) int64 { ans := int64(0); for _,aa := range(a) { ans += aa }; return ans }\nfunc zeroarr64(a []int64) { for i:=0; i 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }\nfunc powint64(a,e int64) int64 { res, m := int64(1), a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }\nfunc gcd64(a,b int64) int64 { for b != 0 { t:=b; b=a%b; a=t }; return a }\nfunc gcdExtended64(a,b int64) (int64,int64,int64) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended64(b%a,a); return gcd, y1-(b/a)*x1,x1 }\nfunc modinv64(a,m int64) (int64,bool) { g,x,_ := gcdExtended64(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true }\nfunc vecint64string(a []int64) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.FormatInt(a,10) }; return strings.Join(astr,\" \") }\nfunc makefact64(n int,mod int64) ([]int64,[]int64) {\n\tfact,factinv := make([]int64,n+1),make([]int64,n+1)\n\tfact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * int64(i) % mod }\n\tfactinv[n] = powmod64(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * int64(i+1) % mod }\n\treturn fact,factinv\n}\nfunc main() {\n\t//f1, _ := os.Create(\"cpu.prof\"); pprof.StartCPUProfile(f1); defer pprof.StopCPUProfile()\n\tdefer wrtr.Flush()\n\tinfn := \"\"; if infn == \"\" && len(os.Args) > 1 {\tinfn = os.Args[1] }\n\tif infn != \"\" {\tf, e := os.Open(infn); if e != nil { panic(e) }; rdr = bufio.NewScanner(f) }\n\trdr.Split(bufio.ScanWords); rdr.Buffer(make([]byte,1024),1_000_000_000)\n\t// PROGRAM STARTS HERE\n\tS := gbs()\n\toc := 0; fo := -1; for i,c := range S { if c == '1' { oc++; if fo == -1 { fo = i } } }\n\tif oc == 0 { fmt.Println(-1); return }\n\tif oc == 1 { fmt.Printf(\"%v %v\\n\",fo+1,fo+2); return }\n\n\t// Flip the string around and put position 0/1 on the right and and look for the smallest two positions \n\tp := int64(0); for _,c := range S { p = p << 1; if c == '1' { p |= 1 } }\n\t// Consider p as a polynomial P(x) over GF(2)\n\t// We are looking to find a polynomial x^k+1 = P(x)Q(x) for some polynomial Q(x)\n\t// ** Q(x) represents the places in the string where we start our xor, and x^k+1 represents the two ones that are left over.\n\t// We want to find the smallest k such that x^k+1 == P(x)*Q(x) for some Q(x) --> x^k+1 ~ 0 (mod P(x)) --> x^k ~ -1 (mod P(x)) --> x^k ~ 1 (mod P(x))\n\t// If the polynomial has terms up to x^34, then we have up to 2^34 polynomial remainders to consider before we get a repeat\n\t// We use \"baby step giant step\" as sort of a \"meet in the middle\" algorithm\n\t// -- We first try up through 1<<20 looking for a repeat\n\t// -- If we don't find one, then we consider x^k = x^(aB-c) where B = 1<<20. Note in this case, x^k ~ 1 (mod P(x)) is equivalent to \n\t// -- x^(aB) ~ x^c (mod P(x)), so we just calculate x^B, x^(2B), x^(3B) and look for a match in the x^c hash\n\n\t\n\tdoPolyMul := func(a,b,p,z int64) int64 {\n\t\tres := int64(0)\n\t\tfor b > 0 {\n\t\t\tif b & 1 == 1 { res ^= a }\n\t\t\ta <<= 1\n\t\t\tif a > z { a ^= p }\n\t\t\tb >>= 1 \n\t\t}\n\t\treturn res\n\t}\n\n\t// Do the baby steps first\n\tz := int64(1); for 2*z <= p { z *= 2 } // \n\tbaby := make(map[int64]int)\n\tm := int64(1); baby[m] = 0; good := true; ans := int64(-1)\n\n\t// Baby step portion\n\tfor i:=1;i<=1<<20;i++ {\n\t\tm <<= 1; if m >= z { m ^= p }\n\t\tif m == 0 { good = false; break } // don't think this can happen, but checking just in case\n\t\tif m == 1 { ans = int64(i); break }\n\t\tbaby[m] = i\n\t}\n\tif !good { fmt.Println(-1); return }\n\tif ans == -1 {\n\t\t// Giant step portion\n\t\txx := m\n\t\ta := 1\n\t\tfor {\n\t\t\tm = doPolyMul(m,xx,p,z); a++\n\t\t\tif m == 0 { good = false; break } // don't think this can happen, but checking just in case\n\t\t\tv,ok := baby[m]\n\t\t\tif ok { ans = int64(a)*int64(1<<20)-int64(v); break }\n\t\t}\n\t}\n\tif !good { fmt.Println(-1); return }\n\tfmt.Printf(\"%v %v\\n\",fo+1,int64(fo+1)+ans)\n}\n\n", "lang": "Go", "bug_code_uid": "8ab709e016c3d098b35eb8333bbcd710", "src_uid": "6bf798edef30db7d0ce2130e40084e6b", "apr_id": "b70433d9a8bca0e5167b5eb179ae1370", "difficulty": 2900, "tags": ["meet-in-the-middle", "matrices", "number theory", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.9827357237715804, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc start() {\n\ts := sstring()\n\tn := len(s)\n\tif n == 1 {\n\t\tif s[0] == '0' || s[0] == '_' || s[0] == 'X' {\n\t\t\twlstring(\"1\")\n\t\t\treturn\n\t\t} else {\n\t\t\twlstring(\"0\")\n\t\t\treturn\n\t\t}\n\t}\n\tif s[0] == '0' {\n\t\twlstring(\"0\")\n\t\treturn\n\t}\n\thasX := 0\n\tfor _, v := range s {\n\t\tif v == 'X' {\n\t\t\thasX = 1\n\t\t\tbreak\n\t\t}\n\t}\n\tltemps := []string{\"00\", \"25\", \"50\", \"75\"}\n\tending := s[n-2 : n]\n\trTot := 0\n\tfor _, temp := range ltemps {\n\t\ttempOk, xVal := true, byte('a')\n\t\tfor i := range ending {\n\t\t\tc := ending[i]\n\t\t\tif c == '_' {\n\t\t\t} else if c == 'X' {\n\t\t\t\tif xVal != 'a' && xVal != temp[i] {\n\t\t\t\t\ttempOk = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\txVal = temp[i]\n\t\t\t} else {\n\t\t\t\tif c != temp[i] {\n\t\t\t\t\ttempOk = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//\n\t\tif tempOk {\n\t\t\tif s[0] == 'X' && xVal == '0' {\n\t\t\t} else {\n\t\t\t\tr := func() int {\n\t\t\t\t\tif n == 2 {\n\t\t\t\t\t\treturn 1\n\t\t\t\t\t} else if s[0] == '_' {\n\t\t\t\t\t\treturn 9\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 1\n\t\t\t\t\t}\n\t\t\t\t}()\n\t\t\t\tfor i := 1; i < n-2; i++ {\n\t\t\t\t\tif s[i] == '_' {\n\t\t\t\t\t\tr *= 10\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trX := 1\n\t\t\t\tif hasX == 1 && xVal == 'a' {\n\t\t\t\t\trX = 10\n\t\t\t\t\tif s[0] == 'X' {\n\t\t\t\t\t\trX = 9\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trTot += r * rX\n\t\t\t}\n\t\t}\n\t}\n\twlint(rTot)\n}\n\nfunc main() {\n\tstart()\n\t// flush\n\twriter.Flush()\n}\n\n// utils\nfunc max(a int, b int) int {\n\tif b > a {\n\t\treturn b\n\t}\n\treturn a\n}\n\n// io utils\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc wstring(s string) {\n\twriter.WriteString(s)\n}\nfunc wrune(r rune) {\n\twriter.WriteRune(r)\n}\nfunc wint(i int) {\n\twstring(strconv.Itoa(i))\n}\nfunc wlstring(s string) {\n\twriter.WriteString(s)\n\twrune('\\n')\n}\nfunc wlrune(r rune) {\n\twriter.WriteRune(r)\n\twrune('\\n')\n}\nfunc wlint(i int) {\n\twstring(strconv.Itoa(i))\n\twrune('\\n')\n}\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 4096), 1e9)\n}\n\nfunc printls(in []int) {\n\tfor _, v := range in {\n\t\twint(v)\n\t\twrune(' ')\n\t}\n\twlstring(\"\")\n}\n\nfunc sint() int {\n\ti, err := strconv.Atoi(sstring())\n\tif err != nil {\n\t\tpanic(\"sint: Error\")\n\t}\n\treturn i\n}\n\nfunc sints(n int) []int {\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = sint()\n\t}\n\treturn a\n}\n\nfunc sstring() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n", "lang": "Go", "bug_code_uid": "2f9ccc97c329d9a0514bc7998374d994", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "5a9a0ec89c58493ffcfe96bb5830f586", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.3131115459882583, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "package main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n\tcnt, _ := fmt.Scan()\r\n\tfor i := 0; i < cnt; i++ {\r\n\t\tk, _ := fmt.Scan()\r\n\t\tfmt.Println(playoff(k))\r\n\t}\r\n}\r\nfunc playoff(k int) int {\r\n\tn := 1\r\n\tfor i := 1; i <= k; i++ {\r\n\t\tn = n * 2\r\n\t}\r\n\treturn n - 1\r\n}\r\n", "lang": "Go", "bug_code_uid": "9a5bd46bf18482e92354e845b7437981", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "d1a49806e070c222f33305a6ffb0ff46", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.9908972691807543, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package main\r\nimport( \r\n \"fmt\"\r\n \"bufio\"\r\n \"os\"\r\n \"math\"\r\n)\r\ntype coords struct{\r\n\trow int\r\n\tcolumn int\r\n}\r\nfunc main() {\r\n\tin:= bufio.NewReader(os.Stdin)\r\n\tout:= bufio.NewWriter(os.Stdout)\r\n\tdefer out.Flush()\r\n\tvar t int\r\n\tfmt.Fscan(in,&t)\r\n\tfor i:=0;i 0 {\r\n\t\tn := float64(readInt(reader))\r\n\t\tfmt.Println(math.Pow(2, n) - 1)\r\n\t\tt--\r\n\t}\r\n}\r\n\r\n// Thanks to user: gealbermorales for the valuable guidance with processing input using Go\r\n// Functions are published at https://codeforces.com/blog/entry/94245\r\n\r\nfunc readInt(in *bufio.Reader) int {\r\n\tnStr, _ := in.ReadString('\\n')\r\n\tnStr = strings.ReplaceAll(nStr, \"\\r\", \"\")\r\n\tnStr = strings.ReplaceAll(nStr, \"\\n\", \"\")\r\n\tn, _ := strconv.Atoi(nStr)\r\n\treturn n\r\n}\r\n\r\nfunc readLineNumbs(in *bufio.Reader) []string {\r\n\tline, _ := in.ReadString('\\n')\r\n\tline = strings.ReplaceAll(line, \"\\r\", \"\")\r\n\tline = strings.ReplaceAll(line, \"\\n\", \"\")\r\n\tnumbs := strings.Split(line, \" \")\r\n\treturn numbs\r\n}\r\n\r\nfunc debug(name string, a interface{}) {\r\n\tfmt.Printf(\"\\n%s = %v \\n\", name, a)\r\n}\r\n", "lang": "Go", "bug_code_uid": "f988941a011ee0b47e2931f34a77b0ac", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "47f7e2d57c957801fac126f83580866d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.46241674595623217, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nfunc memoizedCNK(memosize int) func(int, int) int {\r\n\tmemo := make(map[int]map[int]int)\r\n\tfor i := 0; i <= memosize; i++ {\r\n\t\tmemo[i] = make(map[int]int)\r\n\t}\r\n\tvar cnk func(int, int) int\r\n\tcnk = func(n, k int) int {\r\n\t\tif k < 0 || k > n {\r\n\t\t\treturn 0\r\n\t\t}\r\n\t\tif n == 0 || k == 0 || k == n {\r\n\t\t\treturn 1\r\n\t\t}\r\n\t\tval, ok := memo[n][k]\r\n\t\tif !ok {\r\n\t\t\tval = cnk(n-1, k-1) + cnk(n-1, k)\r\n\t\t\tmemo[n][k] = val\r\n\t\t}\r\n\t\treturn val\r\n\t}\r\n\treturn cnk\r\n}\r\n\r\nfunc CNK(n, k int) int {\r\n\tif k < 0 || k > n {\r\n\t\treturn 0\r\n\t}\r\n\tif n == 0 || k == 0 || k == n {\r\n\t\treturn 1\r\n\t}\r\n\r\n\treturn CNK(n-1, k-1) + CNK(n-1, k)\r\n\r\n}\r\n\r\nfunc Solve(reader io.Reader, writer io.Writer) {\r\n\tvar n, k int\r\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &k)\r\n\tcnk := memoizedCNK(n)\r\n\tsum := 0\r\n\tfor ; k >= 0; k-- {\r\n\t\tsum += cnk(n, k) % 1000000007\r\n\t}\r\n\tfmt.Fprintln(writer, sum)\r\n\r\n}\r\n\r\nfunc main() {\r\n\t// f, err := os.Open(\"data.txt\")\r\n\t// if err != nil {\r\n\t// \tos.Exit(1)\r\n\t// }\r\n\t// defer f.Close()\r\n\r\n\t// reader := bufio.NewReader(f)\r\n\treader := bufio.NewReader(os.Stdin)\r\n\twriter := bufio.NewWriter(os.Stdout)\r\n\tSolve(reader, writer)\r\n\twriter.Flush()\r\n\r\n}\r\n", "lang": "Go", "bug_code_uid": "9a7cfba7ca60d4df776e47b7b01d74e7", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "beab8d49e19923feb7560bd9d5ca93c9", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.7270940800786048, "equal_cnt": 31, "replace_cnt": 15, "delete_cnt": 8, "insert_cnt": 7, "fix_ops_cnt": 30, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Mod = 998244353\n\nfunc main() {\n\tdefer _w.Flush()\n\tn, x := ReadInt(), ReadInt()\n\n\tvar dp [501][501]int64\n\tdp[n][int64(0)] = int64(1)\n\tfor i := n; i >= int64(2); i-- {\n\t\tfor j := int64(0); j < x; j++ {\n\t\t\tnj := Min(x, j+i-int64(1))\n\t\t\tfor k := int64(0); k <= n; k++ {\n\t\t\t\tdp[k][nj] += dp[i][j] * ModCombination(i, k) * ModPow(nj-j, i-k)\n\t\t\t\tdp[k][nj] %= Mod\n\t\t\t}\n\t\t}\n\t}\n\tans := int64(0)\n\tfor j := int64(0); j <= x; j++ {\n\t\tans += dp[int64(0)][j]\n\t\tans %= Mod\n\t}\n\tprintln(((ans % Mod) + Mod) % Mod)\n}\n\nfunc ModCombination(n, k int64) (ret int64) {\n\tif n < k {\n\t\treturn int64(0)\n\t}\n\tfor ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {\n\t\tret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod\n\t}\n\treturn\n}\n\nconst MAX = 5e6\n\nvar fac, finv, inv [MAX + 1]int64\n\nfunc init() {\n\tfac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)\n\tfor i := int64(2); i <= MAX; i++ {\n\t\tfac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod\n\t\tfinv[i] = finv[i-int64(1)] * inv[i] % Mod\n\t}\n}\n\nfunc ModPow(a, b int64) (x int64) {\n\tfor x = int64(1); b > int64(0); b >>= int64(1) {\n\t\tif b&int64(1) == int64(1) {\n\t\t\tx = x * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t}\n\treturn\n}\n\nfunc Max(a, b int64) int64 { AMax(&a, b); return a }\nfunc Min(a, b int64) int64 { AMin(&a, b); return a }\nfunc AMax(p *int64, x int64) {\n\tif *p < x {\n\t\t*p = x\n\t}\n}\nfunc AMin(p *int64, x int64) {\n\tif *p > x {\n\t\t*p = x\n\t}\n}\nfunc Maxs(xs ...int64) int64 {\n\tfor _, x := range xs[int64(1):] {\n\t\tAMax(&xs[int64(0)], x)\n\t}\n\treturn xs[int64(0)]\n}\nfunc Mins(xs ...int64) int64 {\n\tfor _, x := range xs[int64(1):] {\n\t\tAMin(&xs[int64(0)], x)\n\t}\n\treturn xs[int64(0)]\n}\nfunc AMaxs(p *int64, xs ...int64) { AMax(p, Maxs(xs...)) }\nfunc AMins(p *int64, xs ...int64) { AMin(p, Mins(xs...)) }\n\nvar _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc ReadString() (s string) { fmt.Fscan(_r, &s); return }\nfunc ReadInt() (i int64) { fmt.Fscan(_r, &i); return }\nfunc ReadInts(n int64) (a []int64) {\n\tfor ; n > int64(0); n-- {\n\t\ta = append(a, ReadInt())\n\t}\n\treturn\n}\nfunc print(a ...interface{}) { fmt.Fprint(_w, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(_w, a...) }\nfunc prints(s []int64) { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }\n", "lang": "Go", "bug_code_uid": "be8c9c47098b5adb8426b0c89bb31014", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "2576dbf4e3d7c3bd4dd17b4d492fb3ed", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.987929993964997, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Mod = 998244353\n\nfunc main() {\n\tdefer _w.Flush()\n\tn, x := int64(ReadInt()), int64(ReadInt())\n\n\tvar dp [501][501]int64\n\tdp[n][0] = 1\n\tfor i := int64(n); i >= 2; i-- {\n\t\tfor j := int64(0); j < x; j++ {\n\t\t\tnj := Min(x, j+i-1)\n\t\t\tpow := int64(1)\n\t\t\tfor k := i; k >= 0; k-- {\n\t\t\t\tdp[k][nj] += dp[i][j] * ModCombination(i, k) % Mod * pow\n\t\t\t\tdp[k][nj] %= Mod\n\t\t\t\tpow = pow * (nj - j) % Mod\n\t\t\t}\n\t\t}\n\t}\n\tans := int64(0)\n\tfor j := int64(0); j <= x; j++ {\n\t\tans += dp[0][j]\n\t\tans %= Mod\n\t}\n\tprintln(((ans % Mod) + Mod) % Mod)\n}\n\nfunc ModCombination(n, k int64) (ret int64) {\n\tif n < k {\n\t\treturn int64(0)\n\t}\n\tfor ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {\n\t\tret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod\n\t}\n\treturn\n}\n\nconst MAX = 500\n\nvar fac, finv, inv [MAX + 1]int64\n\nfunc init() {\n\tfac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)\n\tfor i := int64(2); i <= MAX; i++ {\n\t\tfac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod\n\t\tfinv[i] = finv[i-int64(1)] * inv[i] % Mod\n\t}\n}\n\nfunc Min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc ReadString() (s string) { fmt.Fscan(_r, &s); return }\nfunc ReadInt() (i int) { fmt.Fscan(_r, &i); return }\nfunc print(a ...interface{}) { fmt.Fprint(_w, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(_w, a...) }\nfunc prints(s []int64) { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }\n", "lang": "Go", "bug_code_uid": "31969bbb02f21a018f192fb067a10a67", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "2576dbf4e3d7c3bd4dd17b4d492fb3ed", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Go"} {"similarity_score": 0.7514285714285714, "equal_cnt": 38, "replace_cnt": 21, "delete_cnt": 13, "insert_cnt": 3, "fix_ops_cnt": 37, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Mod = 998244353\n\nfunc main() {\n\tdefer _w.Flush()\n\tsolve()\n}\nfunc solve() {\n\tn, x := ReadInt(), ReadInt()\n\tvar dp [501][501]int64\n\tfor i := int64(2); i <= n; i++ {\n\t\tjj := Min(x, i-int64(1))\n\t\tfor j := int64(1); j <= jj; j++ {\n\t\t\t// dp[i][j] = j^i - (j-1)^i\n\t\t\tdp[i][j] = ModPow(j, i) - ModPow(j-int64(1), i)\n\t\t\tdp[i][j] %= Mod\n\t\t}\n\t}\n\n\tfor i := int64(2); i <= n; i++ {\n\t\tfor j := int64(1); j <= x; j++ {\n\t\t\tfor k := int64(0); k <= n-i; k++ {\n\t\t\t\tdp[i+k][j+i+k-int64(1)] += dp[i][j] * ModPow(i+k-int64(1), k) % Mod * ModCombination(i+k, k)\n\t\t\t\tdp[i+k][j+i+k-int64(1)] %= Mod\n\t\t\t}\n\t\t}\n\t}\n\n\tans := int64(0)\n\tfor j := int64(1); j <= x; j++ {\n\t\tans += dp[n][j]\n\t\tans %= Mod\n\t}\n\tprintln(((ans % Mod) + Mod) % Mod)\n}\n\nfunc ModCombination(n, k int64) (ret int64) {\n\tif n < k {\n\t\treturn int64(0)\n\t}\n\tfor ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {\n\t\tret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod\n\t}\n\treturn\n}\n\nconst MAX = 5e6\n\nvar fac, finv, inv [MAX + 1]int64\n\nfunc init() {\n\tfac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)\n\tfor i := int64(2); i <= MAX; i++ {\n\t\tfac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod\n\t\tfinv[i] = finv[i-int64(1)] * inv[i] % Mod\n\t}\n}\n\nfunc Max(a, b int64) int64 { AMax(&a, b); return a }\nfunc Min(a, b int64) int64 { AMin(&a, b); return a }\nfunc AMax(p *int64, x int64) {\n\tif *p < x {\n\t\t*p = x\n\t}\n}\nfunc AMin(p *int64, x int64) {\n\tif *p > x {\n\t\t*p = x\n\t}\n}\n\nfunc ModPow(a, b int64) (x int64) {\n\tfor x = int64(1); b > int64(0); b >>= int64(1) {\n\t\tif b&int64(1) == int64(1) {\n\t\t\tx = x * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t}\n\treturn\n}\n\nvar _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc ReadString() (s string) { fmt.Fscan(_r, &s); return }\nfunc ReadInt() (i int64) { fmt.Fscan(_r, &i); return }\nfunc ReadInts(n int64) (a []int64) {\n\tfor ; n > int64(0); n-- {\n\t\ta = append(a, ReadInt())\n\t}\n\treturn\n}\nfunc print(a ...interface{}) { fmt.Fprint(_w, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(_w, a...) }\nfunc prints(s []int64) { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }\n", "lang": "Go", "bug_code_uid": "e5b2343eeb72db498bc812ac6a70ee78", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "2576dbf4e3d7c3bd4dd17b4d492fb3ed", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Go"} {"similarity_score": 0.8884160756501182, "equal_cnt": 26, "replace_cnt": 8, "delete_cnt": 16, "insert_cnt": 1, "fix_ops_cnt": 25, "bug_source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst Mod = 998244353\n\nfunc main() {\n\tdefer _w.Flush()\n\tsolve()\n}\nfunc solve() {\n\tn, x := ReadInt(), ReadInt()\n\n\tvar pow [501][501]int64\n\tfor i := int64(0); i < 501; i++ {\n\t\tpow[i][0] = 1\n\t\tfor j := int64(0); j < 500; j++ {\n\t\t\tpow[i][j+1] = pow[i][j] * i % Mod\n\t\t}\n\t}\n\n\tvar dp [501][501]int64\n\tfor i := int64(2); i <= n; i++ {\n\t\tjj := Min(x, i-1)\n\t\tfor j := int64(1); j <= jj; j++ {\n\t\t\t// dp[i][j] = j^i - (j-1)^i\n\t\t\tdp[i][j] = pow[j][i] - pow[j-1][i]\n\t\t\tdp[i][j] %= Mod\n\t\t}\n\t}\n\n\tfor i := int64(2); i <= n; i++ {\n\t\tfor j := int64(1); j <= x; j++ {\n\t\t\tif dp[i][j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := int64(0); k <= n-i; k++ {\n\t\t\t\tnj := j + i + k - 1\n\t\t\t\tif nj > x {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdp[i+k][nj] += dp[i][j] * pow[i+k-1][k] % Mod * ModCombination(i+k, k)\n\t\t\t\tdp[i+k][nj] %= Mod\n\t\t\t}\n\t\t}\n\t}\n\n\tans := int64(0)\n\tfor j := int64(1); j <= x; j++ {\n\t\tans += dp[n][j]\n\t\tans %= Mod\n\t}\n\tprintln(((ans % Mod) + Mod) % Mod)\n}\n\nfunc ModCombination(n, k int64) (ret int64) {\n\tif n < k {\n\t\treturn int64(0)\n\t}\n\tfor ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {\n\t\tret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod\n\t}\n\treturn\n}\n\nconst MAX = 500\n\nvar fac, finv, inv [MAX + 1]int64\n\nfunc init() {\n\tfac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)\n\tfor i := int64(2); i <= MAX; i++ {\n\t\tfac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod\n\t\tfinv[i] = finv[i-int64(1)] * inv[i] % Mod\n\t}\n}\n\nfunc Max(a, b int64) int64 { AMax(&a, b); return a }\nfunc Min(a, b int64) int64 { AMin(&a, b); return a }\nfunc AMax(p *int64, x int64) {\n\tif *p < x {\n\t\t*p = x\n\t}\n}\nfunc AMin(p *int64, x int64) {\n\tif *p > x {\n\t\t*p = x\n\t}\n}\n\nvar _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc ReadString() (s string) { fmt.Fscan(_r, &s); return }\nfunc ReadInt() (i int64) { fmt.Fscan(_r, &i); return }\nfunc ReadInts(n int64) (a []int64) {\n\tfor ; n > int64(0); n-- {\n\t\ta = append(a, ReadInt())\n\t}\n\treturn\n}\nfunc print(a ...interface{}) { fmt.Fprint(_w, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(_w, a...) }\nfunc prints(s []int64) { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }\n", "lang": "Go", "bug_code_uid": "0c673fe7fbf854bbe242c739923004c7", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "2576dbf4e3d7c3bd4dd17b4d492fb3ed", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Go"}