{"similarity_score": 0.9447236180904522, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\nimport java.io.InputStream\nimport java.util.*\n\nprivate class AScanner internal constructor(inputStream: InputStream = System.`in`) {\n internal val br = BufferedReader(InputStreamReader(inputStream))\n internal var st = StringTokenizer(\"\")\n\n internal fun hasNext(): Boolean {\n while (!st.hasMoreTokens())\n st = StringTokenizer(br.readLine() ?: return false)\n return true\n }\n\n internal operator fun next() =\n if (hasNext()) st.nextToken()!!\n else throw RuntimeException(\"No tokens\")\n\n internal fun nextInt() = next().toInt()\n\n internal fun nextLong() = next().toLong()\n\n internal fun nextLine() =\n if (hasNext()) st.nextToken(\"\\n\")\n else throw RuntimeException(\"No tokens\")\n\n internal fun nextIntArray(n: Int) = IntArray(n, { nextInt() })\n\n internal fun nextLongArray(n: Int) = LongArray(n, { nextLong() })\n}\n\nfun main(args: Array) {\n val sc = AScanner()\n val n = sc.nextInt()\n val m = sc.nextInt()\n val a = sc.nextIntArray(n)\n val b = sc.nextIntArray(m)\n val ab = a.intersect(b.asIterable())\n if (ab.isEmpty()) {\n val amin = a.min()\n val bmin = b.min()\n println(\"$amin$bmin\")\n } else {\n val x = ab.min()\n println(\"$x\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "fbdcaaa403ea4f8ccda6b9bec3148ac3", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "c1bd0097635c877fe745e737a8b259f8", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9319727891156463, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import java.io.File\nimport java.io.InputStream\nimport java.util.*\n\nfun solve(inp: InputReader) {\n var (x1, y1, x2, y2) = inp.nextLine().split(\" \").map(String::toInt)\n val (a, b) = inp.nextLine().split(\" \").map(String::toInt)\n x2 -= x1\n y2 -= y1\n if (x2 % (2 * a) == 0 && y2 % (2 * b) == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}\n\n\nfun main(args: Array) = solve(initIO(\"Mine\" in args))\n\nfun initIO(isLocal: Boolean) = when (isLocal) {\n true -> InputReader(File(\"input.txt\").inputStream())\n false -> InputReader(System.`in`)\n}\n\nclass InputReader(inputStream: InputStream) {\n val reader = inputStream.bufferedReader()\n var tokenizer = StringTokenizer(\"\")\n\n fun nextLine(): String = when {\n tokenizer.hasMoreTokens() -> tokenizer.nextToken(\"\")!!\n else -> reader.readLine()!!\n }\n\n fun nextWord(): String {\n while (!tokenizer.hasMoreTokens()) {\n tokenizer = StringTokenizer(nextLine())\n }\n return tokenizer.nextToken()!!\n }\n\n fun nextInt() = nextWord().toInt()\n\n fun nextLong() = nextWord().toLong()\n}\n\n", "lang": "Kotlin", "bug_code_uid": "4607d3e1a4b668def58f336fc0eaa926", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "066240b0499095f7daf5e94d1eaad394", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.979858464888405, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 8, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\ndata class Vector(val x: Int, val y: Int){\n\n fun sum(that: Vector): Vector =\n Vector(x + that.x, y + that.y)\n\n fun mult(n: Int): Vector =\n Vector(x * n, y * n)\n\n fun isProportional(that: Vector): Boolean =\n x % that.x == 0 && y % that.y == 0\n\n}\n\nfun main(args: Array) {\n val br = BufferedReader(InputStreamReader(System.`in`))\n val vectors = br.readLine().split(\" \").map { it.toInt() }\n val displacement = br.readLine().split(\" \").map { it.toInt() }\n\n val v = Vector(vectors[0], vectors[1])\n val t = Vector(vectors[2], vectors[3])\n val u = Vector(displacement[0], displacement[1])\n val vt = v.sum(t.mult(-1))\n val w = Vector(vt.x/u.x, vt.y/u.y)\n\n if (vt.isProportional(u) && w.x % 2 == w.y % 2){\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "737eaea8247a96827f2822e8e7fa0102", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "97ae0c0eba55b4affb40c6b564060fa9", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8435923309788093, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "/**\n * Created by denis on 18.06.17.\n */\nfun main(args: Array){\n val (x1, y1, x2, y2) = readLine()!!.split(' ').map(String::toInt)\n val (x, y) = readLine()!!.split(' ').map(String::toInt)\n val x_r:Int\n x_r = x1 + x\n val x_l: Int = x1 - x\n val y_r: Int = y1 + y\n val y_l: Int = y1 - y\n\n if ((((x2-x1) % x ==0) && ((y2-y1) % 2*y == 0)) || (((x2-x1) % 2*x ==0) && ((y2-y1) % y == 0))) print(\"YES\")\n else print(\"NO\")\n\n }\n\n\n\n\n", "lang": "Kotlin", "bug_code_uid": "c325b98d77fe835d5acbd857438fb503", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "98126905885211c888adebbf546f3d63", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.967391304347826, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "fun main(args: Array) {\n\tval input = readLine()!!.toInt()\n\tprintln(getVariants(input))\n}\n\nfun getWinner(input: Int): String {\n\treturn if (input % 2 == 0) \"Mahmoud\" else \"Ehab\"\n}", "lang": "Kotlin", "bug_code_uid": "1b3c229a510a79b7252e4384f05fa5e2", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "dfc1dcd44fec0030fa56afe726073fd5", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.20666666666666667, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "import kotlin.math.*\nfun main(arg: Array){\n\tval (hours, mins) = readLine().toString().split(\" \").map {x -> x.toInt()}\n\tval (H, delta, cost, N) = readLine().toString().split(\" \").map {x -> x.toDouble()}\n\tval currMins = hours * 60 + mins\n\tval deltaMins = 1200 - currMins\n\tif (deltaMins <= 0){\n\t\tprintln(buyNow(H, cost, N))\n\t}else{\n\t\tval resSale = buyNow(H + (deltaMins * delta), cost.toDouble() * 0.8, N)\n\t\tval resNow = buyNow(H, cost.toDouble(), N)\n\t\tval res = if(resSale < resNow) resSale else resNow\n\t\tprintln(res)\n\t}\n}\n\nfun buyNow(H: Double, cost: Double, N: Double): Double{\n\tval bulkiDef: Double = H / N\n\tvar bulki: Int = if (abs(bulkiDef - bulkiDef.toInt()) > 0.00001) ceil(bulkiDef).toInt() else bulkiDef.toInt()\n\treturn (bulki * cost).toDouble()\n}", "lang": "Kotlin", "bug_code_uid": "6a4c7d8b091c5aa2b2b999b9b4fe0b2e", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "ac2dc4be2d05d709722ae9aadce585e1", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9970149253731343, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main(){\n var n : String? = readLine()\n var e : Int = 0\n if(n != null){\n e = n.toInt()\n }\n if(e % 2 == 0) print(\"Mahmod\") else print(\"Ehab\")\n}\n", "lang": "Kotlin", "bug_code_uid": "2668177cf4f06f689bed6ba72e55035c", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "fac422eab953290980bed9b7d35bad41", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9995985547972702, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/* template start */\n// input\nprivate fun readString() = readLine()!!\nprivate fun readStrings() = readString().split(\" \")\nprivate fun readInt() = readString().toInt()\nprivate fun readDigits() = readString().map { it - '0' }\nprivate fun readInts() = readStrings().map { it.toInt() }\nprivate fun readLongs() = readStrings().map { it.toLong() }\n\n// output\nprivate fun T.print(map: (T) -> String = { it.toString() }) = println(map(this))\nprivate fun Iterable.print(sep: String? = null, map: ((T) -> String)? = null) = asSequence().print(sep, map)\nprivate fun Array.print(sep: String? = null, map: ((T) -> String)? = null) = asSequence().print(sep, map)\nprivate fun IntArray.print(sep: String? = null, map: ((Int) -> String)? = null) = asSequence().print(sep, map)\nprivate fun Sequence.print(sep: String? = null, map: ((T) -> String)? = null) =\n println(joinToString(sep ?: \"\", transform = map ?: { it.toString() }))\n\n// others\nprivate val Int.isEven: Boolean get() = this % 2 == 0\nprivate val Int.isOdd: Boolean get() = !this.isEven\nprivate fun queries(block: (Int) -> Unit) = repeat(readInt(), block)\n\n/* template end */\n\nfun main() {\n val n = readInt()\n if (n.isEven) println(\"Mahmound\")\n else println(\"Ehab\")\n}", "lang": "Kotlin", "bug_code_uid": "e9b2da64882f5d3b4ce467e3610cfb2e", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "43e26c358eb1d18016ba0c3ccd9dab41", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.5429326972933735, "equal_cnt": 25, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 17, "fix_ops_cnt": 24, "bug_source_code": "@file:Suppress(\"NOTHING_TO_INLINE\", \"EXPERIMENTAL_FEATURE_WARNING\", \"OVERRIDE_BY_INLINE\")\n@file:OptIn(ExperimentalStdlibApi::class)\n\nimport java.io.PrintWriter\nimport java.util.TreeMap\nimport java.util.TreeSet\nimport kotlin.math.*\nimport kotlin.random.Random\nimport kotlin.collections.sort as _sort\nimport kotlin.collections.sortDescending as _sortDescending\nimport kotlin.io.println as iprintln\n\n\n/** @author Spheniscine */\nfun main() { _writer.solve(); _writer.flush() }\nfun PrintWriter.solve() {\n// val startTime = System.nanoTime()\n\n val numCases = 1//readInt()\n case@ for(case in 1..numCases) {\n// print(\"Case #$case: \")\n\n object {\n val n = readInt()\n val m = readInt()\n val q = readInt()\n\n val P = readIntArray(n)\n val Q = IntArray(n+1)\n init {\n for(i in 0 until n) Q[P[i]] = i\n }\n\n val A = IntArray(m)\n val B = IntArray(m) {\n A[it] = readInt() - 1\n readInt() - 1\n }\n\n val T = IntArray(q)\n val X = IntArray(q) {\n T[it] = readInt()\n readInt() - 1\n }\n\n val edgeRemoved = BooleanArray(m)\n\n init {\n for (i in 0 until q) {\n if (T[i] == 2) edgeRemoved[X[i]] = true\n }\n }\n\n val C = Array(n) { i -> TreeSet().also { it.add(P[i]) } }\n val par = IntArray(n) { it }\n\n val hist = IntList()\n fun merge(ei: Int): Int {\n var u = par[A[ei]]\n var v = par[B[ei]]\n\n if(u == v) return -1\n\n if(C[u].size < C[v].size) u = v.also { v = u }\n for(x in C[v]) {\n par[Q[x]] = u\n C[u].add(x)\n }\n\n return v\n }\n\n init {\n for(i in 0 until m) if(!edgeRemoved[i]) merge(i)\n for(i in q-1 downTo 0) if(T[i] == 2) {\n hist.add(merge(X[i]))\n }\n\n for(i in 0 until q) {\n val x = X[i]\n when(T[i]) {\n 1 -> {\n val ans = C[par[x]].pollLast() ?: 0\n println(ans)\n }\n 2 -> {\n val v = hist.pop()\n if(v != -1) {\n val u = par[v]\n\n C[v].firstOrNull()?.let {\n var w = it\n while(true) {\n if(!C[u].remove(w)) C[v].remove(w)\n par[Q[w]] = v\n w = C[v].higher(w) ?: break\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n// iprintln(\"Time: ${(System.nanoTime() - startTime) / 1000000} ms\")\n}\n\nclass IntList(initialCapacity: Int = 12) {\n private var _arr = IntArray(initialCapacity)\n private val capacity get() = _arr.size\n var size = 0\n private set\n inline val lastIndex get() = size - 1\n inline val indices get() = 0 until size\n\n constructor(copyFrom: IntArray): this(copyFrom.size) { copyFrom.copyInto(_arr); size = copyFrom.size }\n constructor(copyFrom: Collection): this(copyFrom.size) { _arr = copyFrom.toIntArray(); size = copyFrom.size }\n\n fun contentEquals(other: IntList): Boolean {\n return this === other || size == other.size && indices.all { this[it] == other[it] }\n }\n\n private fun grow(minCapacity: Int = 8) {\n val newCapacity = maxOf(minCapacity, capacity + (capacity shr 1))\n _arr = _arr.copyOf(newCapacity)\n }\n\n fun ensureCapacity(minCapacity: Int) { if(capacity < minCapacity) grow(minCapacity) }\n\n operator fun get(index: Int): Int {\n require(index in 0 until size)\n return _arr[index]\n }\n\n operator fun set(index: Int, value: Int) {\n require(index in 0 until size)\n _arr[index] = value\n }\n\n fun add(value: Int) {\n if(size == capacity) grow()\n _arr[size++] = value\n }\n\n fun addAll(list: IntList) {\n ensureCapacity(size + list.size)\n list._arr.copyInto(_arr, size, 0, list.size)\n size += list.size\n }\n\n fun add(index: Int, element: Int) {\n if(size == capacity) grow()\n _arr.copyInto(_arr, index + 1, index, size)\n size++\n set(index, element)\n }\n\n fun clear() { size = 0 }\n\n fun removeAt(index: Int): Int {\n val e = get(index)\n _arr.copyInto(_arr, index, index + 1, size)\n size--\n return e\n }\n\n fun indexOf(e: Int): Int {\n for(i in 0 until size) if(this[i] == e) return i\n return -1\n }\n\n fun remove(e: Int): Boolean {\n val i = indexOf(e)\n if(i == -1) return false\n removeAt(i)\n return true\n }\n\n operator fun iterator() = object: IntIterator() {\n private var pos = 0\n override fun hasNext() = pos < size\n override fun nextInt() = get(pos++)\n }\n\n inline fun isEmpty() = size == 0\n inline fun isNotEmpty() = size != 0\n\n fun pop() = _arr[--size]\n\n fun popToSize(s: Int) {\n require(s >= 0)\n if(s < size) size = s\n }\n\n fun swap(i: Int, j: Int) { val t = this[i]; this[i] = this[j]; this[j] = t }\n fun reverse() {\n for(i in 0 until size / 2) swap(i, lastIndex - i)\n }\n\n fun shuffle(rnd: Random = random) { for(i in lastIndex downTo 1) swap(i, rnd.nextInt(i+1)) }\n fun sort() { shuffle(); _arr._sort(0, size) }\n fun sortDescending() { sort(); reverse() }\n\n fun joinToString(separator: CharSequence) = if(size == 0) \"\" else let {\n buildString {\n append(it[0])\n for (i in 1 until size) {\n append(separator).append(it[i])\n }\n }\n }\n\n override fun toString() = \"[\" + joinToString(\", \") + \"]\"\n\n fun toIntArray() = _arr.copyOf(size)\n fun toList() = List(size, ::get)\n\n inline fun first() = get(0)\n inline fun last() = get(lastIndex)\n}\n\ninline fun IntList(size: Int, init: (Int) -> Int) = IntList(size).apply {\n for(i in 0 until size) { add(init(i)) }\n}\ninline fun IntArray.toIntList() = IntList(this)\ninline fun Collection.toIntList() = IntList(this)\ninline fun intListOf(vararg values: Int) = IntList(values)\n\nfun IntList.max() = (1 until size).fold(this[0]) { acc, i -> max(acc, this[i]) }\nfun IntList.min() = (1 until size).fold(this[0]) { acc, i -> min(acc, this[i]) }\nfun IntList.getOrNull(i: Int) = if(i in indices) get(i) else null\ninline fun IntList.count(predicate: (Int) -> Boolean) = indices.count { predicate(this[it]) }\nfun IntList.copyOf() = IntList(size, ::get)\n\n/** IO */\n//const val PATH = \"src/main/resources/\"\n//@JvmField val INPUT = File(PATH + \"input.txt\").inputStream()\n//@JvmField val OUTPUT = File(PATH + \"output.txt\").outputStream()\n@JvmField val INPUT = System.`in`\n@JvmField val OUTPUT = System.out\n\nconst val _BUFFER_SIZE = 1 shl 16\n@JvmField val _buffer = ByteArray(_BUFFER_SIZE)\n@JvmField var _bufferPt = 0\n@JvmField var _bytesRead = 0\n\ntailrec fun readChar(): Char {\n if(_bufferPt == _bytesRead) {\n _bufferPt = 0\n _bytesRead = INPUT.read(_buffer, 0, _BUFFER_SIZE)\n }\n return if(_bytesRead < 0) Char.MIN_VALUE\n else {\n val c = _buffer[_bufferPt++].toChar()\n if (c == '\\r') readChar()\n else c\n }\n}\n\n/** @param skipNext Whether to skip the next character (usually whitespace), defaults to true */\nfun readCharArray(n: Int, skipNext: Boolean = true): CharArray {\n val res = CharArray(n) { readChar() }\n if(skipNext) readChar()\n return res\n}\n\nfun readLine(): String? {\n var c = readChar()\n return if(c == Char.MIN_VALUE) null\n else buildString {\n while(c != '\\n' && c != Char.MIN_VALUE) {\n append(c)\n c = readChar()\n }\n }\n}\nfun readLn() = readLine()!!\n\nfun read() = buildString {\n var c = readChar()\n while(c <= ' ') {\n if(c == Char.MIN_VALUE) return@buildString\n c = readChar()\n }\n do {\n append(c)\n c = readChar()\n } while(c > ' ')\n}\nfun readInt() = read().toInt()\nfun readDouble() = read().toDouble()\nfun readLong() = read().toLong()\nfun readStrings(n: Int) = List(n) { read() }\nfun readLines(n: Int) = List(n) { readLn() }\nfun readInts(n: Int) = List(n) { read().toInt() }\nfun readIntArray(n: Int) = IntArray(n) { read().toInt() }\nfun readDoubles(n: Int) = List(n) { read().toDouble() }\nfun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }\nfun readLongs(n: Int) = List(n) { read().toLong() }\nfun readLongArray(n: Int) = LongArray(n) { read().toLong() }\n\n@JvmField val _writer = PrintWriter(OUTPUT, false)\n\n/** sort overrides to avoid quicksort attacks */\n\n@JvmField var _random: Random? = null\nval random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }\n\nfun IntArray.sort() { shuffle(random); _sort() }\nfun IntArray.sortDescending() { shuffle(random); _sortDescending() }\n\nfun LongArray.sort() { shuffle(random); _sort() }\nfun LongArray.sortDescending() { shuffle(random); _sortDescending() }\n\nfun DoubleArray.sort() { shuffle(random); _sort() }\nfun DoubleArray.sortDescending() { shuffle(random); _sortDescending() }\n\ninline fun CharArray.sort() { _sort() }\ninline fun CharArray.sortDescending() { _sortDescending() }\n\ninline fun > Array.sort() = _sort()\ninline fun > Array.sortDescending() = _sortDescending()\ninline fun > MutableList.sort() = _sort()\ninline fun > MutableList.sortDescending() = _sortDescending()\n\n// import preserving junk function\n@Suppress(\"NonAsciiCharacters\") fun \u96ea\u82b1\u98c4\u98c4\u5317\u98a8\u562f\u562f\u5929\u5730\u4e00\u7247\u84bc\u832b() { iprintln(max(1, 2)) }\n\n// max/min Kotlin 1.6 -> 1.4 shim\nfun IntArray.max() = maxOf { it }\nfun IntArray.min() = minOf { it }\nfun LongArray.max() = maxOf { it }\nfun LongArray.min() = minOf { it }\nfun CharArray.max() = maxOf { it }\nfun CharArray.min() = minOf { it }\nfun > Iterable.max() = maxOf { it }\nfun > Iterable.min() = minOf { it }\nfun > Sequence.max() = maxOf { it }\nfun > Sequence.min() = minOf { it }", "lang": "Kotlin", "bug_code_uid": "f84ab8405df55783401d103bd140bcab", "src_uid": "ad014bde729222db14f38caa521e4167", "apr_id": "d6d47e3d0c80a0a80178467a5e53811c", "difficulty": 2600, "tags": ["dsu", "data structures", "implementation", "graphs", "trees"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8720446155054591, "equal_cnt": 281, "replace_cnt": 70, "delete_cnt": 209, "insert_cnt": 2, "fix_ops_cnt": 281, "bug_source_code": "import java.io.*\nimport java.util.*\nimport java.util.function.BiFunction\nimport kotlin.collections.ArrayList\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\nobject Main {\n @Throws(Exception::class)\n @JvmStatic\n fun main(args: Array) {\n val thread = Thread(null, TaskAdapter(), \"\", 1 shl 28)\n thread.start()\n thread.join()\n }\n\n internal class TaskAdapter : Runnable {\n override fun run() {\n val startTime = System.currentTimeMillis()\n val inputStream = System.`in`\n val outputStream: OutputStream = System.out\n val `in` = FastReader(inputStream)\n val out = Output(outputStream)\n val solver = DGraphAndQueries()\n solver.solve(1, `in`, out)\n out.close()\n System.err.println((System.currentTimeMillis() - startTime).toString() + \"ms\")\n }\n }\n\n internal class DGraphAndQueries {\n lateinit var arr: IntArray\n lateinit var parent: IntArray\n lateinit var tin: IntArray\n lateinit var tout: IntArray\n var n = 0\n var ind = 0\n var clock = 0\n lateinit var visited: BitSet\n lateinit var tour: Array>\n lateinit var graph: Array>\n fun find(u: Int): Int {\n return if (parent[u] == u) u else find(parent[u]).also { parent[u] = it }\n }\n\n fun merge(p: Pair) {\n val u = find(p.a)\n val v = find(p.b)\n if (u == v) {\n return\n }\n val next = ind++\n parent[v] = next\n parent[u] = parent[v]\n graph[next] = ArrayList(Arrays.asList(u, v))\n }\n\n fun dfs(u: Int) {\n tour[clock] = Pair(arr[u], clock++.also { tin[u] = it })\n if (u >= n) {\n for (v in graph[u]) {\n dfs(v)\n }\n }\n tout[u] = clock - 1\n }\n\n fun solve(kase: Int, `in`: InputReader, pw: Output) {\n n = `in`.nextInt()\n val m = `in`.nextInt()\n val q = `in`.nextInt()\n arr = IntArray(n + q)\n Arrays.fill(arr, -1)\n parent = IntArray(n + q)\n graph = Array(n + q) { ArrayList() }\n ind = n\n for (i in 0 until n) {\n arr[i] = `in`.nextInt()\n }\n for (i in 0 until n + q) {\n parent[i] = i\n }\n val edges: Array> = Array(m) { Pair(0, 0) }\n for (i in 0 until m) {\n edges[i] = Pair(`in`.nextInt() - 1, `in`.nextInt() - 1)\n }\n val marked = BitSet(m)\n val queries = Array(q) { IntArray(2) }\n for (i in 0 until q) {\n queries[i] = intArrayOf(`in`.nextInt(), `in`.nextInt() - 1)\n if (queries[i][0] == 2) {\n marked.set(queries[i][1])\n }\n }\n for (i in 0 until m) {\n if (!marked[i]) {\n merge(edges[i])\n }\n }\n for (i in q - 1 downTo 0) {\n if (queries[i][0] == 2) {\n merge(edges[queries[i][1]])\n } else {\n queries[i][1] = find(queries[i][1])\n }\n }\n Utilities.Debug.dbg(ind)\n Utilities.Debug.dbg(*graph)\n tour = Array(ind) { Pair(0, 0) }\n tin = IntArray(ind)\n tout = IntArray(ind)\n visited = BitSet(ind)\n clock = 0\n for (i in 0 until n) {\n val u = find(i)\n if (!visited!![u]) {\n dfs(u)\n visited!!.set(u)\n }\n }\n Utilities.Debug.dbg(*tour)\n val st = TPointSegmentTree(tour, BiFunction { t, u -> if (t.a>=u.a) t else u })\n for (query in queries) {\n if (query[0] == 1) {\n val u = query[1]\n val v = st.query(tin[u], tout[u])!!\n Utilities.Debug.dbg(u, v)\n pw.println(v.a)\n st[v.b] = Pair(0, v.b)\n }\n }\n }\n }\n\n internal class TPointSegmentTree(arr: Array, operation: BiFunction) {\n var n: Int\n var ind = 0\n var ql = 0\n var qr = 0\n var arr: Array\n var value: Array\n var operation: BiFunction\n private fun build(o: Int, l: Int, r: Int) {\n if (l == r) {\n value[o] = arr[l]\n return\n }\n val lc = o shl 1\n val rc = lc or 1\n val mid = l + r shr 1\n build(lc, l, mid)\n build(rc, mid + 1, r)\n value[o] = value[lc]?.let { value[rc]?.let { it1 -> operation.apply(it, it1) } }\n }\n\n private operator fun set(o: Int, l: Int, r: Int) {\n if (l == r) {\n value[o] = arr[l]\n return\n }\n val lc = o shl 1\n val rc = lc or 1\n val mid = l + r shr 1\n if (ind <= mid) {\n set(lc, l, mid)\n } else {\n set(rc, mid + 1, r)\n }\n value[o] = value[lc]?.let { value[rc]?.let { it1 -> operation.apply(it, it1) } }\n }\n\n operator fun set(ind: Int, `val`: T) {\n this.ind = ind\n arr[ind] = `val`\n set(1, 0, n - 1)\n }\n\n private fun query(o: Int, l: Int, r: Int): T? {\n if (ql <= l && qr >= r) {\n return value[o]\n }\n val lc = o shl 1\n val rc = lc or 1\n val mid = l + r shr 1\n var ret: T? = null\n if (ql <= mid) {\n ret = query(lc, l, mid)\n }\n if (qr > mid) {\n ret = if (ret == null) {\n query(rc, mid + 1, r)\n } else {\n query(rc, mid + 1, r)?.let { operation.apply(ret!!, it) }\n }\n }\n return ret\n }\n\n fun query(l: Int, r: Int): T? {\n ql = l\n qr = r\n return query(1, 0, n - 1)\n }\n\n init {\n n = arr.size\n this.arr = arr\n value = arrayOfNulls(n shl 2) as Array\n this.operation = operation\n build(1, 0, n - 1)\n }\n }\n\n internal class Utilities {\n object Debug {\n val LOCAL = System.getProperty(\"ONLINE_JUDGE\") == null\n private fun ts(t: T?): String {\n return if (t == null) {\n \"null\"\n } else try {\n ts(t as Iterable<*>)\n } catch (e: ClassCastException) {\n if (t is IntArray) {\n val s = Arrays.toString(t as IntArray?)\n return \"{\" + s.substring(1, s.length - 1) + \"}\"\n } else if (t is LongArray) {\n val s = Arrays.toString(t as LongArray?)\n return \"{\" + s.substring(1, s.length - 1) + \"}\"\n } else if (t is CharArray) {\n val s = Arrays.toString(t as CharArray?)\n return \"{\" + s.substring(1, s.length - 1) + \"}\"\n } else if (t is DoubleArray) {\n val s = Arrays.toString(t as DoubleArray?)\n return \"{\" + s.substring(1, s.length - 1) + \"}\"\n } else if (t is BooleanArray) {\n val s = Arrays.toString(t as BooleanArray?)\n return \"{\" + s.substring(1, s.length - 1) + \"}\"\n }\n try {\n ts(t as Array)\n } catch (e1: ClassCastException) {\n t.toString()\n }\n }\n }\n\n private fun ts(arr: Array): String {\n val ret = StringBuilder()\n ret.append(\"{\")\n var first = true\n for (t in arr) {\n if (!first) {\n ret.append(\", \")\n }\n first = false\n ret.append(ts(t))\n }\n ret.append(\"}\")\n return ret.toString()\n }\n\n private fun ts(iter: Iterable): String {\n val ret = StringBuilder()\n ret.append(\"{\")\n var first = true\n for (t in iter) {\n if (!first) {\n ret.append(\", \")\n }\n first = false\n ret.append(ts(t))\n }\n ret.append(\"}\")\n return ret.toString()\n }\n\n fun dbg(vararg o: Any?) {\n if (LOCAL) {\n System.err.print(\"Line #\" + Thread.currentThread().stackTrace[2].lineNumber + \": [\")\n for (i in 0 until o.size) {\n if (i != 0) {\n System.err.print(\", \")\n }\n System.err.print(ts(o[i]))\n }\n System.err.println(\"]\")\n }\n }\n }\n }\n\n internal class Output @JvmOverloads constructor(os: OutputStream?, var BUFFER_SIZE: Int = 1 shl 16) : Closeable, Flushable {\n var sb: StringBuilder\n var os: OutputStream\n var lineSeparator: String\n fun println(i: Int) {\n println(i.toString())\n }\n\n fun println(s: String?) {\n sb.append(s)\n println()\n }\n\n fun println() {\n sb.append(lineSeparator)\n }\n\n private fun flushToBuffer() {\n try {\n os.write(sb.toString().toByteArray())\n } catch (e: IOException) {\n e.printStackTrace()\n }\n sb = StringBuilder(BUFFER_SIZE)\n }\n\n override fun flush() {\n try {\n flushToBuffer()\n os.flush()\n } catch (e: IOException) {\n e.printStackTrace()\n }\n }\n\n override fun close() {\n flush()\n try {\n os.close()\n } catch (e: IOException) {\n e.printStackTrace()\n }\n }\n\n init {\n sb = StringBuilder(BUFFER_SIZE)\n this.os = BufferedOutputStream(os, 1 shl 17)\n lineSeparator = System.lineSeparator()\n }\n }\n\n internal interface InputReader {\n fun nextInt(): Int\n }\n\n internal class Pair(var a: T1, var b: T2) : Comparable> {\n constructor(p: Pair) : this(p.a, p.b) {}\n\n override fun toString(): String {\n return a.toString() + \" \" + b\n }\n\n override fun hashCode(): Int {\n return Objects.hash(a, b)\n }\n\n override fun equals(o: Any?): Boolean {\n if (o is Pair<*, *>) {\n val p = o\n return a == p.a && b == p.b\n }\n return false\n }\n\n override fun compareTo(p: Pair): Int {\n val cmp = (a as Comparable).compareTo(p.a)\n return if (cmp == 0) {\n (b as Comparable).compareTo(p.b)\n } else cmp\n }\n }\n\n internal class FastReader(`is`: InputStream?) : InputReader {\n private val BUFFER_SIZE = 1 shl 16\n private val din: DataInputStream\n private val buffer: ByteArray\n private var bufferPointer: Int\n private var bytesRead: Int\n override fun nextInt(): Int {\n var ret = 0\n var c = skipToDigit()\n val neg = c == '-'.toByte()\n if (neg) {\n c = read()\n }\n do {\n ret = ret * 10 + c - '0'.toInt()\n } while (read().also { c = it } >= '0'.toByte() && c <= '9'.toByte())\n return if (neg) {\n -ret\n } else ret\n }\n\n private fun isDigit(b: Byte): Boolean {\n return b >= '0'.toByte() && b <= '9'.toByte()\n }\n\n private fun skipToDigit(): Byte {\n var ret: Byte\n while (!isDigit(read().also { ret = it }) && ret != '-'.toByte());\n return ret\n }\n\n private fun fillBuffer() {\n try {\n bytesRead = din.read(buffer, 0.also { bufferPointer = it }, BUFFER_SIZE)\n } catch (e: IOException) {\n e.printStackTrace()\n throw InputMismatchException()\n }\n if (bytesRead == -1) {\n buffer[0] = -1\n }\n }\n\n private fun read(): Byte {\n if (bytesRead == -1) {\n throw InputMismatchException()\n } else if (bufferPointer == bytesRead) {\n fillBuffer()\n }\n return buffer[bufferPointer++]\n }\n\n init {\n din = DataInputStream(`is`)\n buffer = ByteArray(BUFFER_SIZE)\n bytesRead = 0\n bufferPointer = bytesRead\n }\n }\n}", "lang": "Kotlin", "bug_code_uid": "e737e962f3d230995e31478e7d234376", "src_uid": "ad014bde729222db14f38caa521e4167", "apr_id": "2a666dbcf6d6f015c00ce09b8ee39b43", "difficulty": 2600, "tags": ["dsu", "data structures", "implementation", "graphs", "trees"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8805280528052806, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "import java.io.BufferedReader\nimport java.io.FileReader\nimport java.io.InputStreamReader\n\nval ONLINE = System.getProperty(\"ONLINE_JUDGE\") != null\nval inp = BufferedReader(if (ONLINE) InputStreamReader(System.`in`) else FileReader(\"in.txt\"))\n\ninline fun readTokens() = inp.readLine()!!.split(' ')\ninline fun readInt() = inp.readLine()!!.toInt()\ninline fun readInt2() = readTokens().map { it.toInt() }.let { it[0] to it[1] }\ninline fun readLine() = inp.readLine()!!\n\nfun main(args: Array) {\n val (_, k) = readInt2()\n val s = readLine()\n val a = IntArray('z' - 'a') { 0 }\n s.forEach { a[it - 'a']++ }\n val r = a.max() ?: 0\n println(if (k <= r) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "3b8f464893bdc50793753819e2b3dd4c", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "9da5fc59570a6763936be65f2a2b443c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8818481848184818, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "import java.io.BufferedReader\nimport java.io.FileReader\nimport java.io.InputStreamReader\n\nval ONLINE = System.getProperty(\"ONLINE_JUDGE\") != null\nval inp = BufferedReader(if (ONLINE) InputStreamReader(System.`in`) else FileReader(\"in.txt\"))\n\ninline fun readTokens() = inp.readLine()!!.split(' ')\ninline fun readInt() = inp.readLine()!!.toInt()\ninline fun readInt2() = readTokens().map { it.toInt() }.let { it[0] to it[1] }\ninline fun readLine() = inp.readLine()!!\n\nfun main(args: Array) {\n val (n, k) = readInt2()\n val s = readLine()\n val a = IntArray('z' - 'a') { 0 }\n s.forEach { a[it - 'a']++ }\n val r = a.max() ?: 0\n println(if (k <= r) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "efb30128345d26a4a397611592573363", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "9da5fc59570a6763936be65f2a2b443c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9042904290429042, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "import java.io.BufferedReader\nimport java.io.FileReader\nimport java.io.InputStreamReader\n\nval ONLINE = System.getProperty(\"ONLINE_JUDGE\") != null\nval inp = BufferedReader(if (ONLINE) InputStreamReader(System.`in`) else FileReader(\"in.txt\"))\n\ninline fun readTokens() = inp.readLine()!!.split(' ')\ninline fun readInt() = inp.readLine()!!.toInt()\ninline fun readInt2() = readTokens().map { it.toInt() }.let { it[0] to it[1] }\ninline fun readLine() = inp.readLine()!!\n\nfun main(args: Array) {\n val (n, k) = readInt2()\n val s = readLine()\n val a = IntArray('z' - 'a') { 0 }\n s.forEach { a[it - 'a']++ }\n val r = a.max() ?: 0\n println(if (k >= r) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "033eb641a7b48b710c253db5faf5321b", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "9da5fc59570a6763936be65f2a2b443c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.5813148788927336, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "package main\n\nimport java.util.Scanner\n\nfun main(args: Array) {\n val input = Scanner(System.`in`)\n input.nextInt()\n val k = input.nextInt()\n\n val baloons = readLine()\n\n val groups = baloons?.groupBy { it }\n val m = groups?.values?.map { it.size }?.max() ?: 0\n\n println(if (k >= m) \"YES\" else \"NO\");\n}\n", "lang": "Kotlin", "bug_code_uid": "c6570238d4b190918ecbd5b62f3b45dc", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "cb23f668cbb2500998a30413b937dd63", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.5968028419182948, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "import java.util.Scanner\n\nfun main(args: Array) {\n val input = Scanner(System.`in`)\n input.nextInt()\n val k = input.nextInt()\n\n val baloons = readLine()\n\n val groups = baloons?.groupBy { it }\n val m = groups?.values?.map { it.size }?.max() ?: 0\n println(if (k >= m) \"YES\" else \"NO\");\n}\n", "lang": "Kotlin", "bug_code_uid": "5aa7cfac5137b4e74f58f854d8b0c1aa", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "cb23f668cbb2500998a30413b937dd63", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.7664884135472371, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import java.util.Scanner\n\nfun main(args: Array) {\n val input = Scanner(System.`in`)\n input.nextInt()\n val k = input.nextInt()\n\n val baloons = readLine()!!\n\n val groups = baloons.groupBy { it }\n val m = groups.values.map { it.size }.max() ?: 0\n println(if (k >= m) \"YES\" else \"NO\");\n}\n", "lang": "Kotlin", "bug_code_uid": "d66afd615f1b8a702295dccfe68bc28b", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "cb23f668cbb2500998a30413b937dd63", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.2393252503953611, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "import java.util.*\n\nval scanner = Scanner(System.`in`)\n\nfun readInt(): Int = scanner.nextInt()\n\nfun readString(): String = scanner.next()\n\nfun maximize(number: String, swaps: Int): String = StringBuilder(number).apply {\n val length = number.length\n swapLoop@ for (swap in 1..swaps) {\n for (i in 0 until length - 1) {\n if (this[i] < this[i + 1]) {\n val char = get(i)\n deleteCharAt(i)\n insert(i + 1, char)\n continue@swapLoop\n }\n }\n }\n}.toString()\n\nfun main() = maximize(readString(), readInt()).run(::println)", "lang": "Kotlin", "bug_code_uid": "fa00f2992ece9bb813e6ae47d9f5c8ab", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "24f8a58e64acc7bed171cb0f1909b1c6", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9724957555178269, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import java.io.BufferedReader\nimport java.io.IOException\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.lang.Math.pow\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.log\nimport kotlin.math.log2\nimport kotlin.math.min\n\nfun main(args: Array)\n = Thread { run() }.start()\n\nfun run() {\n val scanner = Scanner(System.`in`)\n val n = scanner.nextInt()\n if (n % 2 == 1)\n println((n + 1) / 2)\n else\n println(n + 1)\n}\n\nclass Scanner(s: InputStream) {\n var st: StringTokenizer? = null\n var br: BufferedReader = BufferedReader(InputStreamReader(s))\n @Throws(IOException::class)\n operator fun next(): String {\n while (st == null || !st!!.hasMoreTokens())\n st = StringTokenizer(br.readLine())\n return st!!.nextToken()\n }\n @Throws(IOException::class)\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n @Throws(IOException::class)\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n @Throws(IOException::class)\n fun nextLine(): String {\n return br.readLine()\n }\n @Throws(IOException::class)\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n @Throws(IOException::class)\n fun ready(): Boolean {\n return br.ready()\n }\n}\n//class Pair(val a: Int, val b: Int)\n//class Triple(val a: Int, val b: Int, val c: Int)", "lang": "Kotlin", "bug_code_uid": "932ce7ce78f6f94e8543b663cb86ad9a", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "b835dd7e342f81e79ec372ce7a75ac7b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9860875466576179, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.IOException\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.lang.Math.pow\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.log\nimport kotlin.math.log2\nimport kotlin.math.min\n\nfun main(args: Array)\n = Thread { run() }.start()\n\nfun run() {\n val scanner = Scanner(System.`in`)\n val n = scanner.nextLong()\n if (n % 2 == 1L)\n println((n + 1) / 2)\n else\n println(n + 1)\n}\n\nclass Scanner(s: InputStream) {\n var st: StringTokenizer? = null\n var br: BufferedReader = BufferedReader(InputStreamReader(s))\n @Throws(IOException::class)\n operator fun next(): String {\n while (st == null || !st!!.hasMoreTokens())\n st = StringTokenizer(br.readLine())\n return st!!.nextToken()\n }\n @Throws(IOException::class)\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n @Throws(IOException::class)\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n @Throws(IOException::class)\n fun nextLine(): String {\n return br.readLine()\n }\n @Throws(IOException::class)\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n @Throws(IOException::class)\n fun ready(): Boolean {\n return br.ready()\n }\n}\n//class Pair(val a: Int, val b: Int)\n//class Triple(val a: Int, val b: Int, val c: Int)", "lang": "Kotlin", "bug_code_uid": "3678c309c34184d1250907df67adaaea", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "b835dd7e342f81e79ec372ce7a75ac7b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9632829373650108, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\nimport java.math.*\n\n\nfun main(args: Array)\n{\n var sc=Scanner(System.`in`)\n var n=sc.nextLong()\n if(n==0L)\n {\n println(\"0\");\n }\n n++;\n if(n%2==0L)n/=2\n println(n);\n}\n", "lang": "Kotlin", "bug_code_uid": "c693b8e609b7f20c724ac5855acad9c3", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "9911792403558d6f96ec4248e9f4ca10", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.983201581027668, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.*\nimport java.util.*\n\nconst val INPUT_FILE_NAME = \"input\"\nconst val OUTPUT_FILE_NAME = \"output\"\n\nfun main(args: Array) {\n solve(System.`in`, System.out)\n// solve(FileInputStream(\"$INPUT_FILE_NAME.txt\"), FileOutputStream(\"$OUTPUT_FILE_NAME.txt\"))\n}\n\nval MAX_N = (1e6 + 10).toInt()\nval INF = (1e9 + 7).toInt()\nval MOD = (1e9 + 7).toInt()\n\nfun solve(input: InputStream, output: OutputStream) {\n val reader = InputReader(BufferedInputStream(input))\n val writer = PrintWriter(BufferedOutputStream(output))\n\n solve(reader, writer)\n writer.close()\n}\n\nfun solve(reader: InputReader, writer: PrintWriter) {\n val n = reader.nextLong()\n if (n % 2 == 0L) {\n writer.println(n + 1)\n } else {\n writer.println((n + 1) / 2)\n }\n}\n\nfun gcd(a: Int, b: Int): Int {\n return if (b == 0) a else gcd(b, a % b)\n}\n\nclass InputReader(stream: InputStream) {\n private val reader = BufferedReader(InputStreamReader(stream), 32768)\n private var tokenizer: StringTokenizer? = null\n\n operator fun next(): String {\n while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n try {\n tokenizer = StringTokenizer(reader.readLine())\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n }\n return tokenizer!!.nextToken()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n fun nextArrayInt(count: Int): IntArray {\n return nextArrayInt(0, count)\n }\n\n fun nextArrayInt(start: Int, count: Int): IntArray {\n val a = IntArray(start + count)\n for (i in start until start + count) {\n a[i] = nextInt()\n }\n return a\n }\n\n fun nextArrayLong(count: Int): LongArray {\n val a = LongArray(count)\n for (i in 0 until count) {\n a[i] = nextLong()\n }\n return a\n }\n}", "lang": "Kotlin", "bug_code_uid": "b0adeaad06bc675f77e7ba0c4f050813", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "31aaf8d2c7d222cb95c79dcd4d7bf165", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8866995073891626, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array){\n val n: Long = readLine()?.toLong() ?: 0\n val pieces = n+1\n if (pieces%2 == 0L)\n println(pieces/2)\n else\n println(pieces)\n}", "lang": "Kotlin", "bug_code_uid": "44e3569c90f8eaa9e7725342e6f7c278", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "4a74a1a98cf1945318f13dbea3a0f166", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9940828402366864, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val numPeople = readLine()!!.toLong() + 1\n if (numPeople == 0L) return print(0)\n print(if (numPeople and 1 == 0L) numPeople / 2 else numPeople)\n}", "lang": "Kotlin", "bug_code_uid": "1eee8c56758874995cf4f88118f03c57", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "7de610d27487acd855992de0b786eda3", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8237986270022883, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "fun main(args : Array) {\n var n = 0\n n = readLine()!!.toInt() + 1\n when {\n n % 2 == 0 -> print(n/2)\n n == 1 -> print(0)\n else -> print(n)\n }\n}", "lang": "Kotlin", "bug_code_uid": "72c982f979ee4bb22a2babb88a63cf79", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "ab6c5e2d717908c11cf049b30c4b5211", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.5396825396825397, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "fun main(args : Array) {\n var n = 0\n n = readLine()!!.toInt() + 1\n if (n % 2 == 0)\n print(n/2)\n else\n if (n == 1)\n print(0)\n print(n)\n}", "lang": "Kotlin", "bug_code_uid": "e3be0a844f8b69b4f780712ba23d067f", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "ab6c5e2d717908c11cf049b30c4b5211", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9827298050139276, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.IOException\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.max\nimport kotlin.math.sqrt\n\nfun main(args : Array) {\n Thread { run() }.start()\n}\n\n\nfun run() {\n val scanner = Scanner(System.`in`)\n val n = scanner.nextInt()\n val arr = IntArray(n) { if (scanner.nextInt() == 0) 1 else -1 }\n val q = arr.count { it == -1 }\n var actMax = q\n var emaxx = q\n for (i in 0 until n) {\n actMax = max(actMax + arr[i], q)\n emaxx = max(actMax, emaxx)\n }\n println(emaxx)\n}\n\n\nclass Scanner(s: InputStream) {\n var st: StringTokenizer? = null\n var br: BufferedReader = BufferedReader(InputStreamReader(s))\n @Throws(IOException::class)\n operator fun next(): String {\n while (st == null || !st!!.hasMoreTokens())\n st = StringTokenizer(br.readLine())\n return st!!.nextToken()\n }\n @Throws(IOException::class)\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n @Throws(IOException::class)\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n @Throws(IOException::class)\n fun nextLine(): String {\n return br.readLine()\n }\n @Throws(IOException::class)\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n @Throws(IOException::class)\n fun ready(): Boolean {\n return br.ready()\n }\n}\nfun IntArray.print() {\n println(Arrays.toString(this))\n}\nfun Array.print() {\n for (i in this)\n i.print()\n}\nfun LongArray.print() {\n println(Arrays.toString(this))\n}\nfun Array.print() {\n for (i in this)\n i.print()\n}", "lang": "Kotlin", "bug_code_uid": "54c0fb055378a8f8e7052b193e427054", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "8d909b16faca749345ab109319b28700", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7147270854788877, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n val r = System.`in`.bufferedReader()\n val s = StringBuilder()\n val n = r.readLine()!!.toInt()\n val l = r.readLine()!!.split(\" \").map { it.toInt() }\n val dp = MutableList(n) { MutableList(n) { 0 } }\n for (i in 0..n-1){\n dp[i][i] = l.sum() - if (l[i]==0) 1 else 0\n }\n for (i in 0..n-1){\n for (j in i+1..n-1){\n dp[i][j] = dp[i][j-1] + if (l[j]==0) 1 else 0\n }\n }\n //println(dp)\n println(dp.flatten().max())\n}", "lang": "Kotlin", "bug_code_uid": "38e3ee0119555fcbb5662c8abc2a9067", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "bebbf238c696d73cc3f7daf889887dc7", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9999483711084723, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.io.*\nimport java.math.BigDecimal\nimport java.math.BigInteger\nimport java.util.StringTokenizer\nimport java.util.Stack\nimport java.util.TreeMap\n\nobject programkt {\n interface Scanner {\n fun changeInputStream(inputStream: InputStream)\n fun nextInt(): Int\n fun nextLong(): Long\n fun nextDouble(): Double\n fun nextChar(): Char\n fun nextString(): String\n fun nextLine(): String\n fun nextBigInteger(): BigInteger\n fun nextBigDecimal(): BigDecimal\n }\n\n abstract class Task {\n //KT Extensions\n fun > min(a: T, b: T) = if (a > b) b else a\n fun > max(a: T, b: T) = if (a < b) b else a\n fun abs(a: Int) = if (a > 0) a else -(a)\n fun abs(a: Long) = if (a > 0) a else -(a)\n fun abs(a: Float) = if (a > 0) a else -(a)\n fun abs(a: Double) = if (a > 0) a else -(a)\n operator fun Iterable.invoke(function: (it: T) -> Unit) { this.forEach(function) }\n private fun String.prefix(pi: Array): Array {\n pi[0] = 0\n (1 until this.length) {\n var j = pi[it - 1]\n while (j > 0 && this[it] != this[j]) {\n j = pi[j - 1]\n }\n if(this[it] == this[j]) {\n j++\n }\n pi[it] = j\n }\n return pi\n }\n private fun String.kmpFind(pattern: String): Int {\n val m = pattern.length\n val dfa = Array(256) { IntArray(m) }\n dfa[pattern[0].toInt()][0] = 1\n var x = 0\n var j = 1\n while (j < m) {\n for (c in 0 until 256) {\n dfa[c][j] = dfa[c][x] // Copy mismatch cases.\n }\n dfa[pattern[j].toInt()][j] = j + 1 // Set match case.\n x = dfa[pattern[j].toInt()][x] // Update restart state.\n j++\n }\n\n val n = this.length\n var i: Int = 0\n j = 0\n while (i < n && j < m) {\n j = dfa[this[i].toInt()][j]\n i++\n }\n if (j == m) return i - m // found\n return n // not found\n }\n fun fuckExceptions(invoker: () -> Unit) = try { invoker.invoke() } catch (_: Throwable) {}\n\n enum class EdgeType {\n DIRECTED,\n UNDIRECTED\n }\n data class Vertex>(\n val data: T\n ) {\n override fun toString(): String = \"V:$data\"\n }\n data class Edge>(\n var source: Vertex,\n var destination: Vertex,\n val weight: Double?\n )\n interface Graphable> {\n fun createVertex(data: T): Vertex\n fun add(type: EdgeType, source: Vertex, destination: Vertex, weight: Double? = 0.0)\n fun weight(source: Vertex, destination: Vertex): Double?\n fun edges(source: Vertex): MutableList>?\n }\n class AdjacencyList>: Graphable {\n var adjacencyMap: MutableMap, MutableList>> = mutableMapOf()\n\n private fun addDirectedEdge(source: Vertex, destination: Vertex, weight: Double?) {\n adjacencyMap[source]?.add(Edge(source = source, destination = destination, weight = weight))\n }\n\n private fun addUndirectedEdge(source: Vertex, destination: Vertex, weight: Double?) {\n addDirectedEdge(source, destination, weight)\n addDirectedEdge(destination, source, weight)\n }\n\n override fun createVertex(data: T): Vertex {\n val vertex = Vertex(data = data)\n adjacencyMap[vertex] ?: run {\n adjacencyMap[vertex] = mutableListOf()\n }\n return vertex\n }\n\n override fun add(type: EdgeType, source: Vertex, destination: Vertex, weight: Double?) = when(type) {\n EdgeType.DIRECTED -> addDirectedEdge(source, destination, weight)\n EdgeType.UNDIRECTED -> addUndirectedEdge(source, destination, weight)\n }\n\n override fun weight(source: Vertex, destination: Vertex): Double? {\n adjacencyMap[source]?.forEach {\n if(it.destination == destination) return it.weight\n }\n return null\n }\n\n override fun edges(source: Vertex): MutableList>? = adjacencyMap[source]\n\n override fun toString(): String {\n var result = \"\"\n for ((vertex, edges) in adjacencyMap) {\n var edgeString = \"\"\n for ((index, edge) in edges.withIndex()) {\n edgeString += if (index != edges.count() - 1) \"${edge.destination}, \"\n else \"${edge.destination}\"\n }\n result += \"$vertex ---> [ $edgeString ] \\n\"\n }\n return result\n }\n\n fun depthFirstSearch(start: Vertex, end: Vertex): Stack> {\n val visited: HashSet> = hashSetOf()\n val stack: Stack> = Stack()\n stack.push(start)\n visited.add(start)\n\n var currentVertex = stack.peek()\n loop@while (currentVertex != null && currentVertex != end) {\n val neighbors = edges(currentVertex)\n if(neighbors != null && neighbors.count() > 0) {\n for(edge in neighbors) {\n if(!visited.contains(edge.destination)) {\n visited.add(edge.destination)\n stack.push(edge.destination)\n currentVertex = stack.peek()\n continue@loop\n }\n }\n } else {\n stack.pop()\n currentVertex = stack.peek()\n continue\n }\n\n stack.pop()\n currentVertex = stack.peek()\n }\n\n return stack\n }\n\n fun breadthFirstSearch() {\n\n }\n\n fun floydWarshallAlgorythm(): Pair, Array> {\n val nVertices = this.adjacencyMap.size\n\n val weights = Array(nVertices) { Array(nVertices-1) { 0.0 } }\n this.adjacencyMap\n .asSequence()\n .map { it.value }\n .withIndex()\n .forEach { (index, weightsOfVertex) ->\n weightsOfVertex.asSequence()\n .withIndex()\n .forEach { (weightIndex, weight) ->\n weights[index][weightIndex] = weight.weight!!\n }\n }\n\n val dist = Array(nVertices) { DoubleArray(nVertices) { Double.POSITIVE_INFINITY } }\n for (w in weights) dist[(w[0] - 1).toInt()][(w[1] - 1).toInt()] = w[2]\n val next = Array(nVertices) { IntArray(nVertices) }\n for (i in 0 until next.size) {\n for (j in 0 until next.size) {\n if (i != j) next[i][j] = j + 1\n }\n }\n for (k in 0 until nVertices) {\n for (i in 0 until nVertices) {\n for (j in 0 until nVertices) {\n if (dist[i][k] + dist[k][j] < dist[i][j]) {\n dist[i][j] = dist[i][k] + dist[k][j]\n next[i][j] = next[i][k]\n }\n }\n }\n }\n return dist to next\n }\n }\n\n fun > TreeMap>.toAdjacencyList(type: EdgeType): AdjacencyList {\n val list = AdjacencyList()\n\n this.keys.forEach { list.createVertex(it) }\n this.entries\n .asSequence()\n .withIndex()\n .forEach { (x, edge) ->\n val vertex = list.createVertex(edge.key)\n edge.value\n .asSequence()\n .withIndex()\n .forEach { (y, weight) ->\n if(weight != .0 && y != x)\n list.add(type, vertex, list.createVertex(this.keys.elementAt(y)), weight)\n }\n }\n return list\n }\n\n open class Point, Y: Comparable>(open var x: X, open var y: Y) {\n operator fun component1() = x\n operator fun component2() = y\n override fun equals(other: Any?): Boolean = when {\n other == null -> false\n other !is Point<*, *> -> false\n other.x != this.x -> false\n other.y != this.y -> false\n else -> true\n }\n }\n\n class IntPoint(override var x: Int, override var y: Int): Point(x, y) {\n operator fun plus(point: IntPoint) = IntPoint(this.x + point.x, this.y + point.y)\n operator fun minus(point: IntPoint) = IntPoint(this.x - point.x, this.y - point.y)\n operator fun div(point: IntPoint) = IntPoint(this.x / point.x, this.y / point.y)\n operator fun times(point: IntPoint) = IntPoint(this.x * point.x, this.y * point.y)\n\n operator fun plus(coefficient: Int) = IntPoint(this.x + coefficient, this.y + coefficient)\n operator fun minus(coefficient: Int) = IntPoint(this.x - coefficient, this.y - coefficient)\n operator fun div(coefficient: Int) = IntPoint(this.x / coefficient, this.y / coefficient)\n operator fun times(coefficient: Int) = IntPoint(this.x * coefficient, this.y * coefficient)\n\n fun distanceTo(point: IntPoint) = Math.sqrt(((this.x - point.x) * (this.x - point.x) + (this.y-point.y) * (this.y - point.y)).toDouble())\n }\n class LongPoint(override var x: Long, override var y: Long): Point(x, y) {\n constructor(x: Int, y: Int): this(x.toLong(), y.toLong())\n\n operator fun plus(point: LongPoint) = LongPoint(this.x + point.x, this.y + point.y)\n operator fun minus(point: LongPoint) = LongPoint(this.x - point.x, this.y - point.y)\n operator fun div(point: LongPoint) = LongPoint(this.x / point.x, this.y / point.y)\n operator fun times(point: LongPoint) = LongPoint(this.x * point.x, this.y * point.y)\n\n operator fun plus(coefficient: Long) = LongPoint(this.x + coefficient, this.y + coefficient)\n operator fun plus(coefficient: Int) = LongPoint(this.x + coefficient, this.y + coefficient)\n operator fun minus(coefficient: Long) = LongPoint(this.x - coefficient, this.y - coefficient)\n operator fun minus(coefficient: Int) = LongPoint(this.x - coefficient, this.y - coefficient)\n operator fun div(coefficient: Long) = LongPoint(this.x / coefficient, this.y / coefficient)\n operator fun div(coefficient: Int) = LongPoint(this.x / coefficient, this.y / coefficient)\n operator fun times(coefficient: Long) = LongPoint(this.x * coefficient, this.y * coefficient)\n operator fun times(coefficient: Int) = LongPoint(this.x * coefficient, this.y * coefficient)\n\n fun distanceTo(point: LongPoint) = Math.sqrt(((this.x - point.x) * (this.x - point.x) + (this.y-point.y) * (this.y - point.y)).toDouble())\n }\n open class DoublePoint(override var x: Double, override var y: Double): Point(x, y) {\n constructor(x: Int, y: Int): this(x.toDouble(), y.toDouble())\n constructor(x: Long, y: Long): this(x.toDouble(), y.toDouble())\n\n operator fun plus(point: DoublePoint) = DoublePoint(this.x + point.x, this.y + point.y)\n operator fun minus(point: DoublePoint) = DoublePoint(this.x - point.x, this.y - point.y)\n operator fun div(point: DoublePoint) = DoublePoint(this.x / point.x, this.y / point.y)\n operator fun times(point: DoublePoint) = DoublePoint(this.x * point.x, this.y * point.y)\n\n operator fun plus(coefficient: Double) = DoublePoint(this.x + coefficient, this.y + coefficient)\n operator fun plus(coefficient: Long) = DoublePoint(this.x + coefficient, this.y + coefficient)\n operator fun plus(coefficient: Int) = DoublePoint(this.x + coefficient, this.y + coefficient)\n operator fun minus(coefficient: Double) = DoublePoint(this.x - coefficient, this.y - coefficient)\n operator fun minus(coefficient: Long) = DoublePoint(this.x - coefficient, this.y - coefficient)\n operator fun minus(coefficient: Int) = DoublePoint(this.x - coefficient, this.y - coefficient)\n operator fun div(coefficient: Double) = DoublePoint(this.x / coefficient, this.y / coefficient)\n operator fun div(coefficient: Long) = DoublePoint(this.x / coefficient, this.y / coefficient)\n operator fun div(coefficient: Int) = DoublePoint(this.x / coefficient, this.y / coefficient)\n operator fun times(coefficient: Double) = DoublePoint(this.x * coefficient, this.y * coefficient)\n operator fun times(coefficient: Long) = DoublePoint(this.x * coefficient, this.y * coefficient)\n operator fun times(coefficient: Int) = DoublePoint(this.x * coefficient, this.y * coefficient)\n\n fun distanceTo(point: DoublePoint) = Math.sqrt(((this.x - point.x) * (this.x - point.x) + (this.y-point.y) * (this.y - point.y)))\n fun polarAngle(): Double {\n val minPolarAngle = Math.atan2(y, x)\n return if(minPolarAngle < 0) minPolarAngle + 2 * Math.PI else minPolarAngle\n }\n }\n class Vector(x: Double, y: Double): DoublePoint(x, y) {\n constructor(x: Int, y: Int): this(x.toDouble(), y.toDouble())\n constructor(x: Long, y: Long): this(x.toDouble(), y.toDouble())\n\n fun length() = Math.sqrt(x*x + y*y)\n fun angleTo(vector: Vector): Double {\n val temp = this * vector\n return Math.acos((temp.x + temp.y) / this.length() / vector.length())\n }\n }\n //End KT Extensions\n\n abstract fun solve(scanner: Scanner, printer: PrintWriter)\n }\n\n class FastScanner: Scanner {\n var inputStream: InputStream? = null\n override fun changeInputStream(inputStream: InputStream) {\n this.inputStream = inputStream\n this.bufferedReader = BufferedReader(InputStreamReader(inputStream))\n }\n\n private lateinit var bufferedReader: BufferedReader\n private var stringTokenizer: StringTokenizer? = null\n\n private fun nextToken(): String? {\n while (stringTokenizer == null || !stringTokenizer!!.hasMoreTokens())\n stringTokenizer = StringTokenizer(bufferedReader.readLine() ?: return null)\n return stringTokenizer!!.nextToken()\n }\n\n override fun nextInt() = nextToken()!!.toInt()\n override fun nextLong() = nextToken()!!.toLong()\n override fun nextDouble() = nextToken()!!.toDouble()\n override fun nextChar() = bufferedReader.read().toChar()\n override fun nextString() = nextToken()!!\n override fun nextLine() = bufferedReader.readLine()!!\n override fun nextBigInteger() = BigInteger(nextToken()!!)\n override fun nextBigDecimal() = BigDecimal(nextToken()!!)\n }\n\n class TaskBuilder {\n private var task: Task? = null\n private var inputStream: InputStream? = null\n private var outputStream: OutputStream? = null\n private var scanner: Scanner? = null\n\n fun useInputSource(inputStream: InputStream): TaskBuilder {\n this.inputStream = inputStream\n return this\n }\n\n fun useOutputSource(outputStream: OutputStream): TaskBuilder {\n this.outputStream = outputStream\n return this\n }\n\n fun useInputFile(inputFileName: String): TaskBuilder {\n this.inputStream = FileInputStream(File(inputFileName))\n return this\n }\n\n fun useOutputFile(outputFileName: String): TaskBuilder {\n this.outputStream = FileOutputStream(File(outputFileName))\n return this\n }\n\n fun useScanner(scanner: Scanner): TaskBuilder {\n this.scanner = scanner\n return this\n }\n\n\n fun solveTask(task: Task): TaskBuilder {\n this.task = task\n return this\n }\n\n fun run() {\n when {\n task == null -> throw NullPointerException(\"Task cannot be null!\")\n inputStream == null -> throw NullPointerException(\"Input cannot be null!\")\n outputStream == null -> throw NullPointerException(\"Output cannot be null!\")\n scanner == null -> throw NullPointerException(\"Scanner cannot be null!\")\n }\n scanner!!.changeInputStream(inputStream!!)\n val printer = PrintWriter(outputStream)\n TaskRunnable(task!!, scanner!!, printer).run()\n\n inputStream!!.close()\n printer.close()\n }\n\n class TaskRunnable(\n private val task: Task,\n private val scanner: Scanner,\n private val printer: PrintWriter\n ) {\n fun run() {\n task.solve(scanner, printer)\n }\n }\n }\n\n @JvmStatic\n fun main(args: Array) = TaskBuilder()\n// .useInputSource(BufferedInputStream(FileInputStream(\"area1.in\")))\n// .useOutputSource(BufferedOutputStream(FileOutputStream(\"area1.out\")))\n .useInputSource(System.`in`)\n .useOutputSource(System.out)\n .useScanner(FastScanner())\n .solveTask(TaskA())\n .run()\n\n class TaskA: Task() {\n override fun solve(scanner: Scanner, printer: PrintWriter) {\n val length = scanner.nextInt()\n val numbers = Array(length) { scanner.nextInt() }\n\n var maxOnesCount = -1\n\n (0 until length) { i ->\n (0 until length) { j ->\n var currentCountOfOnes = 0\n (0 until length) {\n currentCountOfOnes += if((it in (i..j) && 1 - numbers[it] == 1) || (it !in (i..j) && numbers[it] == 1)) 1 else 0 }\n maxOnesCount = max(maxOnesCount, currentCountOfOnes)\n }\n }\n\n printer.println(maxOnesCount)\n }\n\n }\n\n}\n", "lang": "Kotlin", "bug_code_uid": "9d6025381e999307e601885890f0eb70", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "354a9d601d6a9700499b6e43418eb53b", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.1056985294117647, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "//package tasks\n\nimport kotlin.math.*\n\nfun deltaCount(array: CharArray, left: Int, right: Int, initCount: Int): Int {\n if (initCount == right - left + 1) {\n var count = initCount\n if (right < array.size - 1) count++\n if (left > 0) count++\n return count\n } else {\n var leftCount = initCount\n var i = left\n while (i < array.size && array[i] == '0') {\n i++\n leftCount--\n }\n while (i < array.size && array[i] == '1') {\n i++\n leftCount++\n }\n val leftMin = deltaCount(array, i, right, leftCount)\n\n var rightCount = initCount\n var j = right\n while (j >= 0 && array[j] == '0') {\n j--\n rightCount--\n }\n while (j >= 0 && array[j] == '1') {\n j--\n rightCount++\n }\n val rightMin = deltaCount(array, left, j, rightCount)\n\n return max(leftMin, rightMin)\n }\n}\n\nfun main() {\n readLine()\n val array = readLine()!!.replace(\" \", \"\").toCharArray()\n val initDelta = array.run { size - 2 * count { it == '1' } }\n println(deltaCount(array, 0, array.size-1, initDelta))\n}", "lang": "Kotlin", "bug_code_uid": "67943d36f57544e73d44510546d48508", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "b3cdc0ad4f819b9740b181a6d1db52d4", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.937192118226601, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\nimport kotlin.math.max\n\nfun main(args: Array) {\n val br = BufferedReader(InputStreamReader(System.`in`))\n val n = br.readLine().toInt()\n val a = br.readLine().split(\" \").filter { x -> x != \"\"}.map { it.toInt() }\n\n val gains = Array(n){x -> 0}\n var initialOnes = 0\n\n for (ai in a){\n if (ai == 1) initialOnes++\n }\n\n\n for (i in 0 until n){\n if (a[i] == 0) gains[i] = 1\n else gains[i] = -1\n }\n\n println(initialOnes + maxSubarray(gains))\n\n}\n\nfun maxSubarray(gains: Array): Int{\n var maxSum = 0\n var currSum = 0\n\n for (g in gains){\n currSum = max(currSum + g, 0)\n maxSum = max(currSum, maxSum)\n }\n\n return maxSum\n}", "lang": "Kotlin", "bug_code_uid": "41bc564e8bd1bfb144f0b8d417ca1189", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "a190a575c8e73a00db77e24efeac2737", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7378104875804968, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n cf()\n}\n\nprivate fun cf() = with(Scanner(System.`in`)) {\n val n = nextInt()\n val a = IntArray(n) { nextInt() }\n println(run(a))\n}\n\nprivate fun run(a: IntArray): Int {\n val gainAfterFlip = IntArray(a.size) { i -> if (a[i] == 1) -1 else +1 }\n\n var gain = 0\n var gain_ = 0\n for (e in gainAfterFlip) {\n if (gain_ < 0) gain_ = 0\n gain_ += e\n\n if (gain_ > gain) gain = gain_\n }\n\n val s = a.sum() + gain\n\n return s\n}\n", "lang": "Kotlin", "bug_code_uid": "401c9a5e2bcb9f5ae136a9217e19dfa0", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "05912d13ead5e6e307ae04d459e46eb5", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9320197044334976, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main()\n{\n val read = Scanner(System.`in`)\n var n = read.nextInt();\n\n var coins = Array(n){0};\n var ones = 0\n for(i in 0 .. n-1)\n {\n var number = read.nextInt();\n ones += if(number == 1)1 else 0\n coins[i] = if(number == 1) -1 else 1\n }\n\n var sum = 0\n var max = Integer.MIN_VALUE\n for( i in 0 .. n-1)\n {\n sum += coins[i]\n if(sum < 0) sum = 0\n max = Math.max(max , sum)\n }\n\n print(max + ones)\n\n\n\n\n\n}", "lang": "Kotlin", "bug_code_uid": "f1a99a38830a914ced503b60abeb13d7", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "0b0ee440194d95a26af295dbdf1aa038", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.6221374045801527, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import java.math.RoundingMode\nimport java.text.DecimalFormat\nimport java.util.*\nimport kotlin.collections.ArrayList\n\nimport kotlin.collections.HashMap\n\n\n\nfun main() {\n\n\n\n var n=Integer.parseInt(readLine()!!)\n var a:MutableList = readLine()!!.split(' ').map(String::toInt).toMutableList();\n\n var one=0\n\n for (i in a){\n if (i==1)++one\n }\n var max=one\n for (i in 0..(a.size-1)){\n var cur=0\n for (k in (i..a.size-1)) {\n cur = 0\n for (l in 0..a.size - 1) {\n if ((l >= i && l <= k)) {\n if (a[l] == 0) ++cur\n } else if (a[l] == 1) ++cur\n }\n max = Math.max(max, cur)\n\n\n }\n }\n println(max)\n\n}\n\n\n\n", "lang": "Kotlin", "bug_code_uid": "75d407e18131edef83a32d1547145f8a", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "dc734efe31e316870d3ab06a53ca4731", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9814569536423841, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.math.RoundingMode\nimport java.text.DecimalFormat\nimport java.util.*\nimport kotlin.collections.ArrayList\n\nimport kotlin.collections.HashMap\n\n\n\nfun main() {\n\n\n\n var n=Integer.parseInt(readLine()!!)\n var a:MutableList = readLine()!!.split(' ').map(String::toInt).toMutableList();\n\n var one=0\n\n \n \n for (i in 0..(a.size-1)){\n var cur=0\n for (k in (i..a.size-1)) {\n cur = 0\n for (l in 0..a.size - 1) {\n if ((l >= i && l <= k)) {\n if (a[l] == 0) ++cur\n } else if (a[l] == 1) ++cur\n }\n max = Math.max(max, cur)\n\n\n }\n }\n println(max)\n\n}\n\n\n\n", "lang": "Kotlin", "bug_code_uid": "17687a5cd6290b2ad759160110e37737", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "dc734efe31e316870d3ab06a53ca4731", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.937112488928255, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n val n = readLine()!!.toInt()\n val a = readLine()!!.split(\" \").map(String::toInt)\n var l = 0\n var bestL = 0\n var bestR = -1\n var best = 0\n var sum = 0\n for (i in 0 until n) {\n sum += if (a[i] == 0) 1 else -1\n if (sum >= best) {\n bestL = l\n bestR = i\n best = sum\n }\n if (sum < 0) {\n l = i + 1\n sum = 0\n }\n }\n val result = a.mapIndexed { index, x -> if (index >= bestL && index <= bestR) 1 - x else x}.sum()\n println(result)\n}", "lang": "Kotlin", "bug_code_uid": "5223bfae64d32d57ae44e042310cbbc9", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "29643e655393d22b86a9643a5cbababd", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9280205655526992, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.lang.Integer.max\n\nfun main(args: Array) {\n val n = readLine()!!.toInt()\n val t = readLine()!!.split(\" \").map(String::toInt)\n val s = t.sum()\n var m = 0\n for (i in 0..n - 1) {\n var c = 0\n for (j in i..n - 1) {\n c += if (t[j] == 0) 1 else -1\n m = max(m, c)\n }\n }\n\n print(s + m)\n}", "lang": "Kotlin", "bug_code_uid": "7a99bda949ad25548ec63e135e215a80", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "369e5d977bbf6a8f659cfbb43bb3e36b", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9946638207043756, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.abs\n\nfun main(){\n val scanner = Scanner(System.`in`)\n var n = scanner.nextInt()\n var array = ArrayList()\n for(i in 0 until n){\n array.add(scanner.nextInt())\n }\n var maxZeros =0\n var maxOnes =0\n for(i in 0 until n){\n for(j in i until n){\n var subArray = array.subList(i,j+1)\n var zeros = 0\n var ones =0\n for(k in 0 until subArray.size){\n if(subArray[k] == 0) zeros++\n else ones++\n }\n if(abs(zeros-ones)>abs(maxZeros-maxOnes) && zeros>0){\n maxZeros=zeros\n maxOnes=ones\n }\n }\n }\n var ones=0\n var zeros=0\n for(i in array){\n if(i == 0) zeros++\n else ones++\n }\n if(maxZeros == 0) println(ones-maxOnes+maxZeros -1)\n else println(ones-maxOnes+maxZeros)\n}", "lang": "Kotlin", "bug_code_uid": "900be283d7724a12287e7484fa985fde", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "0698b56fed3d43550d6884a79bfbef6c", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9967614249730119, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.io.InputStream\n\nconst val CODE_0 = '0'.toByte()\nconst val CODE_1 = '9'.toByte()\n\nclass Main {\n companion object {\n @JvmStatic\n fun main(args: Array) = with(FastScanner(System.`in`)) {\n val n = nextInt()\n val a = IntArray(n + 1)\n for (i in 1..n) a[i] = nextInt()\n\n val p = IntArray(n + 1)\n for (i in 1..n) p[i] = p[i - 1] + if (a[i] == 1) 1 else 0\n\n var m = 0\n val all = p[n] - p[0]\n for (i in 1 until n) for (j in i..n) {\n val cut = p[j] - p[i - 1]\n val x = all - cut + (j - i + 1) - cut\n if (x > m) m = x\n }\n println(m)\n }\n }\n\n\n // -----------------------------------------------------------------------------------------------------------------\n\n private class FastScanner(private val iss: InputStream = System.`in`) {\n fun nextInt(): Int { // todo negative\n var v = 0\n var begin = false\n while (true) {\n val c = iss.read()\n if (c in CODE_0..CODE_1) {\n begin = true\n v *= 10\n v += c - CODE_0\n } else if (begin) {\n return v\n }\n }\n }\n }\n}\n\nfun main(args: Array) = Main.main(args)", "lang": "Kotlin", "bug_code_uid": "fb13a045b9ca5e155016bc2a56aef0a8", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "ea49dd2d0e3a3908a37d19fdd7455087", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7280334728033473, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package codeforces\n\nfun main(args: Array) {\n println(if (readLine()!!.toInt() % 4 == 0) \"YES\" else \"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "8116eb985aeda80ef71fc0897e7368d4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f50051e56b8ec1662c1ee326067c8f97", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7945205479452054, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun main(args: Array) {\n println(if (readLine()!!.toInt() % 4 == 0) \"YES\" else \"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "861761cf4886a9e490fa4021a9b75c66", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f50051e56b8ec1662c1ee326067c8f97", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9535864978902954, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import java.util.Scanner\n\nfun main(args: Array) {\n\n \n val reader = Scanner(System.`in`)\n \n var integer:Int = reader.nextInt()\n if(integer%2 == 0){\n print(\"Yes\")\n }\n else{\n print(\"No\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "666b9fef0bab86409c95a51bb98065eb", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "1e10b02c73d6d62399df92717a9c6bf4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9950248756218906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val a = readLine()!!toInt()\n println(if (a % 2 == 0 && a > 3) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "e026b44fefa6a7f0c396c40ed136aafc", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7ae59fea2884ca351bb5e99e1e4b79a9", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9430051813471503, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val a = readLine()!!.toInt()\n println(if (a % 4 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "e74f5242998c0cbeb940d5876e975599", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7ae59fea2884ca351bb5e99e1e4b79a9", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9017341040462428, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\n\nfun main(args: Array) {\n val scanner = Scanner(System.`in`)\n val a = scanner.nextInt()\n if((a%2)%2 ==0 && a % 2 == 0 && 1<=a && a<=100){\n print(\"YES\")\n }else{\n print(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "e8a0e199fd37878231832c1729a0ffa1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "460670b5507199b48625295a1ed21834", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8708133971291866, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "import kotlin.random.Random\n\nfun main()\n{\n var w: Int;\n\n\n w = readLine()!!.toInt()\n\n if (((w - 2) % 2 == 0) && w >= 1 && w <= 100) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n\n\n}\n\n", "lang": "Kotlin", "bug_code_uid": "a9a7d74697191aa6461fbc4b1df1569e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a490ecac62dbb65a79b2843ff3bf0198", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9289340101522843, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "fun main()\n{\n var w: Int;\n\n do {\n w = readLine()!!.toInt()\n\n if (w % 2 == 0 && w > 2) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n }while(w != -1)\n}\n\n", "lang": "Kotlin", "bug_code_uid": "f5a4fbf9ade59533e2e7ac7644d01f91", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a490ecac62dbb65a79b2843ff3bf0198", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.2523489932885906, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "fun main(args: Array) {\n val w = args[0].toInt()\n\n if (w % 2 == 0) {\n println(\"YES\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "576069f4e08d9381ad8530662e5b1cce", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "af8c5c6ee3a3ab7a3b0b2bd6b40801ab", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.3756345177664975, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "val scanner = Scanner(System.`in`)\n val w = scanner.nextInt()\n if (w in 1..100) {\n if (w % 2 == 0) {\n println(\"YES\")\n }\n }", "lang": "Kotlin", "bug_code_uid": "64f39639fa0eea972ec009f2bdde2c52", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "af8c5c6ee3a3ab7a3b0b2bd6b40801ab", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9633848657445078, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n val scanner = Scanner(System.`in`)\n val w = scanner.nextInt()\n if (w in 1..100) {\n if (w % 2 == 0) {\n if ((w / 2) % 2 == 0) {\n println(\"YES\")\n } else {\n val p = (w / 2) + 1\n val v = (w / 2) - 1\n\n if (p == 1) return println(\"NO\")\n\n if ((p % 2 == 0) && (v % 2 == 0)) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n }\n } else println(\"NO\")\n }\n}\n\n", "lang": "Kotlin", "bug_code_uid": "f2d3df5e573d5086338091692e973495", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "af8c5c6ee3a3ab7a3b0b2bd6b40801ab", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7353951890034365, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "fun main(args: Array) {\n\n\tvar a = readLine()!!.toInt()\n\tif(a % 2 == 0) print (\"YES\") else print (\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "b5a5b59d809c5de44ab62608856b8714", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0bafb830489575008d4fe2eb63b09936", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9391304347826087, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n\tvar n = readLine()!!.toInt() // read integer from the input\n println(resultMap[canDivide(n)]) // print answer to the output\n}\n\nval resultMap = mutableMapOf(true to \"YES\", false to \"NO\")\n\nfun canDivide(weight: Int): Boolean {\n\treturn weight % 2 == 0 && (weight / 2) % 2 == 0 \n}", "lang": "Kotlin", "bug_code_uid": "b2662d8263e5c448ac311d7c8d012c48", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f92e5a00fa539712dfa9852bb14a3d9b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.993103448275862, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val v = Integer.valueOf(readLine().orEmpty())\n if (v == 1 && v == 2) {\n println(\"NO\")\n return\n }\n if (v % 2 != 0) {\n println(\"NO\")\n return\n }\n if((v - 2) % 2 != 0){\n println(\"NO\")\n return\n }\n println (\"YES\")\n}\n", "lang": "Kotlin", "bug_code_uid": "c85709df40d12cb0e805a2fa80525371", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e23648825a6440caf712fd0d4695181a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9876543209876543, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main(args: Array) {\n val scan = java.util.Scanner(System.`in`)\n var ch = scan.nextInt()\n if(ch == 0 || ch == 2) {\n print(\"NO\")\n }\n if(ch % 2 != 0) {\n print(\"NO\")\n }\n else\n print(\"YES\")\n}", "lang": "Kotlin", "bug_code_uid": "aa788cad53b29a2ca562d499053430c8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "aca3bf56ac781487faa20f44616c53f1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9930555555555556, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n\n var num:Int= readLine()!!.toInt();\n\n if(num%2==0&&num>1){\n println(\"YES\");\n }else{\n println(\"NO\");\n }\n}", "lang": "Kotlin", "bug_code_uid": "3ec5d06e2338b956b1febec9dba5e10c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0c678969350995840e977e30e0e46102", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8844621513944223, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "import java.util.Scanner\n\nfun main() {\n println(if (Scanner(System.`in`).nextInt() % 2 == 0) \"YES\" else \"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "6d19ed07b352006df279d8d4b2c4c779", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c9d8f19211b752392d85224f37cea870", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.953125, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "package codeforces\n\nfun main(args: Array) {\n val weight: Int = readLine()!!.toInt()\n if (weight > 2 && weight % 2 == 0) {\n print(\"YES\")\n }\n else {\n print(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "34c1c1d9750f9796dfb6ba43bcfbe9ac", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "41b694d720f5a9db49cc52d556451131", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.7761194029850746, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "class Watermelon {\n\tpublic fun(args: Array) {\n\t\tval w = readLine().toInt()\n\n\t\tif(w>=4) println(\"YES\")\n\t\telse println(\"NO\")\n\t} \t\n}", "lang": "Kotlin", "bug_code_uid": "d1c06ecbd54e03ccda1afcc24d738865", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "369a05dadfaa9ed4838e593e97b0a15d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9311740890688259, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\nfun main(args: Array) {\n\tval w = readLine()?.toInt() ?: 0\n\tif(w>=4) println(\"YES\")\n\telse println(\"NO\")\n} \t\n", "lang": "Kotlin", "bug_code_uid": "2eb40bf54617d7467752adec1ef569c9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "369a05dadfaa9ed4838e593e97b0a15d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8762541806020067, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "package dev.tsuki.cf\n\nfun main(){\n val input = readLine()!!.toInt()\n if(input%4==0){\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "3933497e91e11fce76035ff188d416db", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b16df730f4da9c2beb9d20c8e63d98bd", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9627118644067797, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "fun main(){\n val input = readLine()!!.toInt()\n if(input%2==0 && (input/2)%2==0){\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "71008937eae188497b0bb48ded90cbf3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b16df730f4da9c2beb9d20c8e63d98bd", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9970326409495549, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array){\n var a : Int = readLine()!!.toInt()\n val b=if(a%2==0 && a>=2) {\n println(\"YES\")\n }else\n {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "a2df78c9f7fab8c71da3943d468da058", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a8bdc6da6421e762282c26cf36d7e9e9", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9411764705882353, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "fun main() {\n val it = readLine()!!.toInt() / 2\n print(if (it > 1 && it % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "7edc92ebba3aeaa13784c3acfc507240", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c753843867d5a21f45719808532a2e98", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8979591836734694, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n print(\"enter number \")\n var n :Int = readLine()!!.toInt()\n println(if (n != 2 && (n % 2) == 0)\n \"YES\"\n else\n \"NO\"\n )\n}\n", "lang": "Kotlin", "bug_code_uid": "4ec7ca615c129f00594d716651c9c6de", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "05bcc9daef59dfcc4e201bd59b0a986d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8843537414965986, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n print(\"enter number \")\n var n :Int = readLine()!!.toInt()\n return (if (n != 2 && (n % 2) == 0)\n \"YES\"\n else\n \"NO\"\n )\n}\n", "lang": "Kotlin", "bug_code_uid": "6e690ab11abfe0a01640fe5f425c1e4f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "05bcc9daef59dfcc4e201bd59b0a986d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9948717948717949, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.Scanner\nfun main(args: Array){\n var numr=Scanner(System.`in`)\n var num:Int=numr.nextInt()\n if(num>1 && num%2==0){\n print(\"YES\")\n }\n else print(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "4315bba573e36a91dc45ff1963c0da4f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "09fdc37ca4a31d8b2bac454f86816b05", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6639344262295082, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "fun main( vararg args: String) {\n\tprint(if(Math.pow(2.0, readLine()!!.toDouble()) - Math.pow(2.0, 4.0) < 0) \"NO\" else \"YES\")\n}\n", "lang": "Kotlin", "bug_code_uid": "564446dfe5ce6b0df6d73c37532989df", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "915c500286aef30d42c1dd8b2b4c6402", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7534883720930232, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "fun main( vararg args: String) {\n\tprint(if ((readLine()!!.toInt() - 4 % 2 == 0)) \"NO\" else \"YES\")\n}\n", "lang": "Kotlin", "bug_code_uid": "dbab77d26eb2dfcc1206c24a85c59358", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "915c500286aef30d42c1dd8b2b4c6402", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.926530612244898, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import java.lang.Integer.parseInt\n\nfun main(args: Array) {\n val w = parseInt(args[0])\n\n val dividable = when {\n w <= 3 -> false\n w.rem(2) != 0 -> false\n else -> true\n }\n\n println(if (dividable) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "2040621e667993093b4988b157d8da12", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "84ab93252931f8ffe8ccf2262e9655d8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9821882951653944, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main() {\n val scanner = Scanner(System.`in`)\n val w = scanner.nextInt()\n\n if (w / 2 % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "7a78d07d91dfa12e0fc05053f20ff63a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3b8b8549dcf6d154ee79f341c3b016dd", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9976580796252927, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main() = with(Scanner(System.`in`)) {\n val weight = nextInt()\n val result = if(weight >= 2 && weight % 2 == 0 ) {\n \"YES\"\n } else {\n \"NO\"\n }\n println(\"$result\")\n}", "lang": "Kotlin", "bug_code_uid": "576f4b84fb302a2555ff633b7d4aae78", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5a072d783ffbdf8888d25c8183a407a8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9999399543653177, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.io.*\nimport java.util.*\nimport kotlin.Comparator\n\n\nclass Solution : Runnable {\n override fun run() {\n solve()\n }\n\n fun start() {\n Thread(null, Solution(), \"whatever\", (1 shl 27).toLong()).start()\n }\n}\n\nfun main(args: Array) {\n Solution().start()\n}\n\n\nclass IO {\n companion object {\n\n private val reader: InputReader\n private val writer: OutputWriter\n\n init {\n if (System.getProperty(\"ONLINE_JUDGE\") == null) {\n reader = InputReader(FileInputStream(\"/Users/300041735/competitiveProgramming/src/codeforces/in.txt\"))\n writer = OutputWriter(FileOutputStream(\"/Users/300041735/competitiveProgramming/src/codeforces/out.txt\"))\n } else {\n reader = InputReader(System.`in`)\n writer = OutputWriter(System.`out`)\n }\n }\n\n private fun readMultipleInts(count: Int): List {\n val map = mutableListOf()\n repeat(count) {\n map.add(reader.readInt())\n }\n return map\n }\n\n fun readInt() = reader.readInt()\n fun readLong() = reader.readLong()\n fun readTwoInts() = readMultipleInts(2)\n fun readThreeInts() = readMultipleInts(3)\n fun readFourInts() = readMultipleInts(4)\n fun readFiveInts() = readMultipleInts(5)\n fun readSixInts() = readMultipleInts(6)\n fun readString() = reader.readString()\n fun readTree(n: Int): MutableMap> {\n val graph = mutableMapOf>()\n repeat(n - 1) {\n val u = reader.readInt()\n val v = reader.readInt()\n if (!graph.containsKey(u)) graph[u] = mutableListOf()\n graph[u]!!.add(v)\n }\n return graph\n }\n\n fun readIntArray(n: Int): IntArray {\n return IntArray(n) { readInt() }\n }\n\n fun readLongArray(n: Int): Array {\n return Array(n) { readLong() }\n }\n\n fun write(obj: Any) {\n writer.printLine(obj)\n }\n\n fun flushOutput() {\n writer.flush()\n }\n\n fun closeOutput() {\n writer.close()\n }\n }\n}\n\n\nclass MATH {\n companion object {\n\n val mod = 998244353\n var ispre = false\n\n val factMod = Array(300002) { 1 }\n\n fun pre() {\n for (i in 2 until 300001) {\n factMod[i] = ((factMod[i - 1] * i.toLong()) % MATH.mod).toInt()\n }\n }\n\n fun gcd(a: Int, b: Int): Int {\n if (b == 0)\n return a\n return gcd(b, a % b)\n }\n\n fun gcd(a: Long, b: Long): Long {\n if (b == 0L)\n return a\n return gcd(b, a % b)\n }\n\n fun inverseMod(a: Int): Int {\n return powMod(a, mod - 2)\n }\n\n fun powMod(a: Int, b: Int): Int {\n //calculate a to the power b mod m\n if (b == 0) return 1\n return if (b % 2 == 1) {\n prodMod(a, powMod(a, b - 1))\n } else {\n val p = powMod(a, b / 2)\n prodMod(p, p)\n }\n }\n\n fun ncr(n: Int, r: Int): Int {\n if (!ispre) pre(); ispre = true\n return ((factMod[n].toLong() * inverseMod(((factMod[r].toLong() * factMod[n - r]) % mod).toInt())) % mod).toInt()\n }\n\n fun prodMod(val1: Int, val2: Int): Int {\n return ((val1.toLong() * val2) % mod).toInt()\n }\n\n }\n}\n\nfun solve() {\n\n val n = IO.readInt()\n if (n%2 == 0){\n IO.write(\"white\")\n IO.write(\"1 2\")\n }else{\n IO.write(\"Black\")\n }\n\n IO.flushOutput()\n IO.closeOutput()\n}\n\n\nclass SuffixArray(val input : String){\n //time complexity is n(log(n))^2\n\n fun sa() : IntArray{\n val n = input.length\n var cur = IntArray(n) { i -> input[i] -'a' } //will store the current sort order\n for (i in 1 until 20){\n val newCur = IntArray(n) { 0 }\n val newlist = mutableListOf>()\n for (j in 0 until n) {\n newlist.add(Triple(j, cur[j], if ( j+ power(2, i) < n) cur[j + power(2, i)] else -1))\n }\n newlist.sortWith(comparator())\n //after sorting\n for (j in 0 until n){\n newCur[newlist[j].first] = if (j > 0 && newlist[j].second == newlist[j - 1].second && newlist[j].third == newlist[j - 1].third) newCur[newlist[j - 1].first] else j\n }\n cur = newCur\n\n }\n return cur\n }\n\n internal class comparator : Comparator>{\n override fun compare(o1: Triple?, o2: Triple?): Int {\n if (o1!!.second != o2!!.second){\n return o1.second.compareTo(o2.second)\n }else{\n //both are equal what to do now\n return o1.third.compareTo(o2.third)\n }\n }\n }\n\n\n}\n\n\n\nclass Primes{\n val limit = 1000\n val composites = IntArray(limit + 1) { 0 }\n val factors= IntArray(limit + 1) { 0 }\n val preFactors = IntArray(limit + 1) { 0 }\n val primes = mutableListOf()\n\n init {\n sieve()\n calcFactors()\n }\n\n fun sieve(){\n for (i in 2 until limit + 1){\n if (composites[i] == 0){\n primes.add(i)\n var cur = 1\n while (cur*i <= limit){\n composites[cur*i] = i\n cur++\n }\n }\n }\n }\n\n fun calcFactors(){\n for (i in 2 until limit + 1){\n var num = i\n while (num != 1){\n factors[i]++\n num /= composites[num]\n }\n }\n for (i in 2 until limit + 1){\n preFactors[i]= preFactors[i - 1] + factors[i]\n }\n }\n}\n\n\n\nfun isBitSet(num: Int, i: Int): Boolean {\n return (num.and(1.shl(i)) > 0)\n}\n\nfun power(i: Int, j: Int): Int {\n if (j == 0) return 1\n return i * power(i, j - 1)\n}\n\nclass MinSegmentTree(\n input: Array\n) {\n private val tree: Array\n private val lazy: Array\n\n constructor(size: Int) : this(Array(size) { Int.MAX_VALUE })\n\n init {\n val size = nextPowerOfTwo(input.size)\n tree = Array(2 * size) { Int.MAX_VALUE }\n lazy = Array(2 * size) { Int.MAX_VALUE }\n for (i in 0 until input.size) {\n tree[i + size] = input[i]\n }\n for (i in (size - 1) downTo 1) {\n tree[i] = Math.min(tree[leftChild(i)], tree[rightChild(i)])\n }\n }\n\n private fun updateTree(lowerRange: Int, upperRange: Int, lowerBound: Int, upperBound: Int, index: Int, value: Int) {\n updateLazyNode(index, lowerBound, upperBound, lazy[index])\n if (noOverlap(lowerRange, upperRange, lowerBound, upperBound)) return\n else if (completeOverlap(lowerRange, upperRange, lowerBound, upperBound)) updateLazyNode(index, lowerBound, upperBound, value)\n else {\n updateTree(lowerRange, upperRange, lowerBound, midIndex(lowerBound, upperBound), leftChild(index), value)\n updateTree(lowerRange, upperRange, midIndex(lowerBound, upperBound) + 1, upperBound, rightChild(index), value)\n tree[index] = Math.min(tree[leftChild(index)], tree[rightChild(index)])\n }\n }\n\n private fun queryTree(lowerRange: Int, upperRange: Int, lowerBound: Int, upperBound: Int, index: Int): Int {\n updateLazyNode(index, lowerBound, upperBound, lazy[index])\n if (noOverlap(lowerRange, upperRange, lowerBound, upperBound)) return Int.MAX_VALUE\n else if (completeOverlap(lowerRange, upperRange, lowerBound, upperBound)) return tree[index]\n else {\n return Math.min(queryTree(lowerRange, upperRange, lowerBound, midIndex(lowerBound, upperBound), leftChild(index)),\n queryTree(lowerRange, upperRange, midIndex(lowerBound, upperBound) + 1, upperBound, rightChild(index)))\n }\n }\n\n private fun updateLazyNode(index: Int, lowerBound: Int, upperBound: Int, delta: Int) {\n tree[index] += delta\n if (lowerBound != upperBound) {\n lazy[leftChild(index)] += delta\n lazy[rightChild(index)] += delta\n }\n lazy[index] = 0\n }\n\n fun getElements(N: Int): List {\n return tree.copyOfRange(tree.size / 2, tree.size / 2 + N).asList()\n }\n\n fun update(lowerRange: Int, upperRange: Int, value: Int) {\n updateTree(lowerRange, upperRange, 1, lazy.size / 2, 1, value)\n }\n\n fun query(lowerRange: Int, upperRange: Int): Int {\n return queryTree(lowerRange, upperRange, 1, lazy.size / 2, 1)\n }\n\n private fun noOverlap(l: Int, u: Int, lb: Int, ub: Int): Boolean = (lb > u || ub < l)\n\n private fun completeOverlap(l: Int, u: Int, lb: Int, ub: Int): Boolean = (lb >= l && ub <= u)\n\n\n private fun nextPowerOfTwo(num: Int): Int {\n var exponent = 2\n while (true) {\n if (exponent >= num) {\n return exponent\n }\n exponent *= 2\n }\n }\n\n private fun midIndex(l: Int, r: Int) = (l + r) / 2\n private fun parent(i: Int) = i / 2\n private fun leftChild(i: Int) = 2 * i\n private fun rightChild(i: Int) = 2 * i + 1\n\n}\n\nclass InputReader(private val stream: InputStream) {\n private val buf = ByteArray(1024)\n private var curChar: Int = 0\n private var numChars: Int = 0\n private val filter: SpaceCharFilter? = null\n\n fun read(): Int {\n if (numChars == -1)\n throw InputMismatchException()\n if (curChar >= numChars) {\n curChar = 0\n try {\n numChars = stream.read(buf)\n } catch (e: IOException) {\n throw InputMismatchException()\n }\n\n if (numChars <= 0)\n return -1\n }\n return buf[curChar++].toInt()\n }\n\n fun readInt(): Int {\n var c = read()\n while (isSpaceChar(c))\n c = read()\n var sgn = 1\n if (c == '-'.toInt()) {\n sgn = -1\n c = read()\n }\n var res = 0\n do {\n if (c < '0'.toInt() || c > '9'.toInt())\n throw InputMismatchException()\n res *= 10\n res += c - '0'.toInt()\n c = read()\n } while (!isSpaceChar(c))\n return res * sgn\n }\n\n fun readLong(): Long {\n var c = read()\n while (isSpaceChar(c)) {\n c = read()\n }\n var sgn: Long = 1\n if (c == '-'.toInt()) {\n sgn = -1\n c = read()\n }\n var number: Long = 0\n do {\n number *= 10L\n number += (c - '0'.toInt()).toLong()\n c = read()\n } while (!isSpaceChar(c))\n return number * sgn\n }\n\n fun readString(): String {\n var c = read()\n while (isSpaceChar(c))\n c = read()\n val res = StringBuilder()\n do {\n res.appendCodePoint(c)\n c = read()\n } while (!isSpaceChar(c))\n return res.toString()\n }\n\n fun isSpaceChar(c: Int): Boolean {\n return filter?.isSpaceChar(c)\n ?: (c == ' '.toInt() || c == '\\n'.toInt() || c == '\\r'.toInt() || c == '\\t'.toInt() || c == -1)\n }\n\n operator fun next(): String {\n return readString()\n }\n\n interface SpaceCharFilter {\n fun isSpaceChar(ch: Int): Boolean\n }\n}\n\nclass OutputWriter {\n private val writer: PrintWriter\n\n constructor(outputStream: OutputStream) {\n writer = PrintWriter(BufferedWriter(OutputStreamWriter(outputStream)))\n }\n\n constructor(writer: Writer) {\n this.writer = PrintWriter(writer)\n }\n\n fun print(vararg objects: Any) {\n for (i in objects.indices) {\n if (i != 0)\n writer.print(' ')\n writer.print(objects[i])\n }\n }\n\n fun printLine(vararg objects: Any) {\n print(*objects)\n writer.println()\n }\n\n fun close() {\n writer.close()\n }\n\n fun flush() {\n writer.flush()\n }\n\n}\n\nclass DinitzMaxFlowSolver(val n: Int, val s: Int, val t: Int, val graph: MutableMap>, val edgeMap: MutableMap, Edge>) {\n\n private val level = IntArray(n + 1) { -1 } //storing levels of each vertex in level graph\n var maxFlow = 0L\n\n init {\n solve()\n }\n\n fun solve() {\n val next = IntArray(n + 1) { 0 }\n while (bfs()) {\n Arrays.fill(next, 0)\n var flow = 0L\n do {\n maxFlow += flow\n flow = dfs(s, next, Long.MAX_VALUE)\n } while (flow != 0L)\n }\n }\n\n private fun dfs(at: Int, next: IntArray, flow: Long): Long {\n if (at == t) return flow\n var size = 0\n if (graph.containsKey(at)) size = graph[at]!!.size\n while (next[at] < size) {\n val edge = graph[at]!!.get(next[at])\n if (edge.remainingCapacity() > 0 && level[edge.to] == level[at] + 1) {\n val bottleNeck = dfs(edge.to, next, Math.min(flow, edge.remainingCapacity()))\n if (bottleNeck > 0) {\n edgeMap[Pair(edge.from, edge.to)]!!.flow += bottleNeck\n edgeMap[Pair(edge.to, edge.from)]!!.flow -= bottleNeck\n return bottleNeck\n }\n }\n next[at]++\n }\n return 0\n }\n\n private fun bfs(): Boolean {\n Arrays.fill(level, -1)\n val curLevel = ArrayDeque()\n curLevel.add(s)\n level[s] = 0\n\n while (curLevel.isNotEmpty()) {\n val top = curLevel.poll()\n if (graph.containsKey(top)) {\n graph[top]!!.forEach {\n if (it.remainingCapacity() > 0 && level[it.to] == -1) {\n level[it.to] = level[top] + 1\n curLevel.offer(it.to)\n }\n }\n }\n }\n return level[t] != -1\n }\n\n\n}\n\nclass Edge(val from: Int, val to: Int, val capacity: Long) {\n var flow = 0L\n fun remainingCapacity(): Long {\n return capacity - flow\n }\n}\n\n\nclass ConnectedComponents(val g : Graph, val price : IntArray){\n\n private val visited = HashSet()\n private val stack = Stack()\n private val revertedGraph = revertGraph()\n private val component = mutableListOf()\n var ways= 1L\n var min = 0L\n val mod = 1000000007\n\n init {\n getConnectedComponents()\n }\n\n\n fun getConnectedComponents() {\n g.vertices.forEach {\n if (!visited.contains(it)){\n visited.add(it)\n dfs(it)\n }\n }\n\n visited.clear()\n while (stack.isNotEmpty()){\n val node = stack.pop()\n if (!visited.contains(node)){\n visited.add(node)\n dfs2(node)\n var take = Int.MAX_VALUE\n for (i in 0 until component.size){\n if (price[component[i] - 1] < take){\n take = price[component[i] - 1]\n }\n }\n min+= take\n ways= (ways*component.filter { price[it - 1] == take }.count())%mod\n component.clear()\n }\n }\n }\n\n fun dfs(node : Int){\n if (g.edges.containsKey(node)){\n g.edges[node]!!.forEach {\n if (!visited.contains(it)){\n visited.add(it)\n dfs(it)\n }\n }\n }\n stack.push(node)\n }\n\n fun dfs2(node : Int){\n component.add(node)\n if (revertedGraph.edges.containsKey(node)){\n revertedGraph.edges[node]!!.forEach {\n if (!visited.contains(it)){\n visited.add(it)\n dfs2(it)\n }\n }\n }\n }\n\n fun revertGraph() : Graph {\n val newEdges= mutableMapOf>()\n g.edges.forEach {\n val u = it.key\n val vs = it.value\n vs.forEach { v ->\n if (!newEdges.containsKey(v)){\n newEdges[v]= mutableListOf()\n }\n newEdges[v]!!.add(u)\n }\n }\n return Graph(g.vertices, newEdges)\n }\n}\n\ndata class Graph(val vertices: MutableList, val edges : MutableMap>)\n", "lang": "Kotlin", "bug_code_uid": "52c229b6fb0cd520b5c7b889a487ee63", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "0bbcfe0708469315c45d81ca90265bd4", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5667311411992263, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\nimport kotlin.math.sqrt\n\nfun main() {\n val br = BufferedReader(InputStreamReader(System.`in`))\n val (n, k) = br.readLine().split(\" \").map { it.toLong() }\n val total = k*(k - 1)/2 + 1\n if (total < n){\n println(-1)\n } else {\n val surplus = (1 + sqrt(1 + 8*(total - n - 1.0)).toLong())/2\n println(k - surplus - 1)\n }\n}", "lang": "Kotlin", "bug_code_uid": "5f8f99d056d0dc95b576dfdd82313e1b", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "ddeb68224e4484cd7c3155e8595c639d", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7935483870967742, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "/**\n * Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools\n */\n\nfun main() {\n\tvar (n, x, pos) = readInts()\n\tvar (lower, higher) = x-1 to n-x\n\tval arr = LongArray(n) { it+1L }\n\tvar left = 0\n\tvar right = arr.size\n\tvar res = 1L\n\twhile (left < right) {\n\t\tval middle = (left + right) / 2\n\t\tif (arr[middle] < pos+1) {\n\t\t\tleft = middle + 1\n\t\t\tres *= lower--\n\t\t}\n\t\telse if(arr[middle] > pos+1) {\n\t\t\tright = middle\n\t\t\tres *= higher--\n\t\t}\n\t\telse break\n\t\tres %= (1_000_000_000+7)\n\t}\n\tfor (i in 1..lower+higher) {\n\t\tres *= i\n\t\tres %= (1_000_000_000+7)\n\t}\n\tprintln(res)\n}\n\nfun readInts() = readLine()!!.split(' ').map { it.toInt() }\n", "lang": "Kotlin", "bug_code_uid": "d7c2fc035512e347d7aabe5c7b9041a0", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "80a9659279d0a8989422faafe736e478", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9333333333333333, "equal_cnt": 24, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 11, "fix_ops_cnt": 23, "bug_source_code": "import java.util.*\nimport kotlin.math.*\n@JvmField val INPUT = System.`in`\n@JvmField val OUTPUT = System.out\n\n@JvmField val _reader = INPUT.bufferedReader()\nfun readLine(): String? = _reader.readLine()\nfun readLn() = _reader.readLine()!!\n@JvmField var _tokenizer: StringTokenizer = StringTokenizer(\"\")\nfun read(): String {\n while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return \"\", \" \")\n return _tokenizer.nextToken()\n}\nfun readInt() = read().toInt()\nfun readDouble() = read().toDouble()\nfun readLong() = read().toLong()\nfun readStrings(n: Int) = List(n) { read() }\nfun readLines(n: Int) = List(n) { readLn() }\nfun readInts(n: Int) = List(n) { read().toInt() }\nfun readIntArray(n: Int) = IntArray(n) { read().toInt() }\nfun readDoubles(n: Int) = List(n) { read().toDouble() }\nfun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }\nfun readLongs(n: Int) = List(n) { read().toLong() }\nfun readLongArray(n: Int) = LongArray(n) { read().toLong() }\nfun gcd(a: Int, b: Int) : Int = if (b == 0) a else gcd(b,a%b)\nfun gcd(a: Long, b: Long) : Long = if (b == 0L) a else gcd(b,a%b)\nfun Boolean.toInt() = if (this) 1 else 0\nval INF = 0x3f3f3f3f\nval MOD = 1000000007\n\nfun mpow(x: Long, c: Int): Long {\n var res = 1L\n var a = x\n var b = c\n while(b > 0) {\n if(b % 2 == 1)\n res = res * a % MOD\n a = a * a % MOD\n b /= 2\n }\n return res\n}\nfun inv(x: Long): Long = mpow(x, MOD-2)\n\nfun main() {\n var (n, x, p) = readInts(3)\n var fac = Array(n + 1, {1})\n for(i in 1..n)\n fac[i] = fac[i - 1] * i % MOD\n var tot = n - 1\n var sm = x - 1\n var (l, r) = listOf(0, n)\n while(l < r) {\n var m = (l + r) / 2\n if(m == p)\n break\n if(m < p) {\n sm--\n l = m + 1\n }\n else\n r = m\n tot--\n }\n println(fac[n-1] * fac[tot] % MOD * inv(fac[sm]) % MOD * inv(fac[tot - sm]) % MOD)\n}\n", "lang": "Kotlin", "bug_code_uid": "849404b49e4df6fc5c735a81da47b806", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "67811d47151565f798b9843cdc80036c", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9967105263157895, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\nimport kotlin.math.*\n@JvmField val INPUT = System.`in`\n@JvmField val OUTPUT = System.out\n\n@JvmField val _reader = INPUT.bufferedReader()\nfun readLine(): String? = _reader.readLine()\nfun readLn() = _reader.readLine()!!\n@JvmField var _tokenizer: StringTokenizer = StringTokenizer(\"\")\nfun read(): String {\n while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return \"\", \" \")\n return _tokenizer.nextToken()\n}\nfun readInt() = read().toInt()\nfun readDouble() = read().toDouble()\nfun readLong() = read().toLong()\nfun readStrings(n: Int) = List(n) { read() }\nfun readLines(n: Int) = List(n) { readLn() }\nfun readInts(n: Int) = List(n) { read().toInt() }\nfun readIntArray(n: Int) = IntArray(n) { read().toInt() }\nfun readDoubles(n: Int) = List(n) { read().toDouble() }\nfun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }\nfun readLongs(n: Int) = List(n) { read().toLong() }\nfun readLongArray(n: Int) = LongArray(n) { read().toLong() }\nfun gcd(a: Int, b: Int) : Int = if (b == 0) a else gcd(b,a%b)\nfun gcd(a: Long, b: Long) : Long = if (b == 0L) a else gcd(b,a%b)\nfun Boolean.toInt() = if (this) 1 else 0\nval INF = 0x3f3f3f3f\nval MOD = (1e9+7).toLong()\n\nfun mpow(x: Long, c: Long): Long {\n var res = 1L\n var a = x\n var b = c\n while(b > 0) {\n if(b % 2 == 1L)\n res = res * a % MOD\n a = a * a % MOD\n b /= 2\n }\n return res\n}\nfun inv(x: Long): Long = mpow(x, MOD-2)\n\nfun main() {\n var (n, x, p) = readInts(3)\n var fac = Array(n + 1) { 1 }\n for(i in 1..n)\n fac[i] = fac[i - 1] * i % MOD\n var tot = n - 1\n var sm = x - 1\n var (l, r) = listOf(0, n)\n while(l < r) {\n var m = (l + r) / 2\n //println(m)\n if(m <= p) {\n if(m < p)\n sm--\n l = m + 1\n }\n else\n r = m\n if(m != p)\n tot--\n }\n //println(\"$sm ${tot - sm}\")\n if(sm < 0)\n println(\"0\")\n else\n println(fac[x - 1] * fac[n - x] % MOD * fac[tot] % MOD * inv(fac[sm]) % MOD * inv(fac[tot - sm]) % MOD)\n}\n", "lang": "Kotlin", "bug_code_uid": "5e4cfd7a439a0a32ee0405d4f00ecd88", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "67811d47151565f798b9843cdc80036c", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.4963350785340314, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "fun main(args: Array)\n{\n var pos: String = \"fedabc\"\n val size: Int = 5\n var s: Int = 0\n\n var read = readLine()!!\n var c = read.last()\n var n = read.dropLast(1).toInt()\n\n for(i in 0..size)\n if (c == pos[i]) s = i + 1\n\n if (n % 2 == 0)\n print(((n - 1) / 4) * 16 + s + 7)\n else\n print(((n - 1) / 4) * 16 + s)\n}\n\nfun String.toInts() = split(' ').map { it.toInt() }\nfun String.toLongs() = split(' ').map { it.toLong() }", "lang": "Kotlin", "bug_code_uid": "5854524ea38377938ad83afa7526a53c", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "dc7915c76df875bf1d63c9faf9d898af", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8228882833787466, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "fun fibInv(n: Long): Int {\n if(n < 3) {\n return 1;\n }\n\n var i = 1;\n val fib = IntArray(100, { 0 })\n\n fib[0] = 1\n fib[1] = 2\n\n while(n >= fib[i]) {\n i++\n fib[i] = fib[i - 1] + fib[i - 2];\n }\n\n return i - 1;\n}\n\nfun main(args: Array) {\n val n = readLine()?.toLong() ?: 0\n\n println(fibInv(n));\n}", "lang": "Kotlin", "bug_code_uid": "14c93dda7863f891428ae47205874a9f", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "8ce90f6998f687cc5b78578504a61461", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9618528610354223, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun fibInv(n: Long): Int {\n if(n < 3) {\n return 1;\n }\n\n var i = 1;\n val fib = ArrayList(2)\n\n fib.add(1);\n fib.add(2);\n\n while(n >= fib[i]) {\n i++\n fib.add(fib[i - 1] + fib[i - 2]);\n }\n\n return i - 1;\n}\n\nfun main(args: Array) {\n val n = readLine()?.toLong() ?: 0\n\n println(fibInv(n));\n}", "lang": "Kotlin", "bug_code_uid": "09fe2c8dc6d00c3d25f33699f833a022", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "8ce90f6998f687cc5b78578504a61461", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8459051724137931, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import java.io.BufferedReader\nimport java.io.File\nimport java.io.PrintWriter\n\nfun main(args: Array) {\n val onlineJudge = System.getProperty(\"ONLINE_JUDGE\") == \"true\"\n val input = if (onlineJudge) System.`in`.bufferedReader() else File(\"input.txt\").bufferedReader()\n val output = if (onlineJudge) PrintWriter(System.out.writer(), true) else PrintWriter(File(\"output.txt\"))\n\n solve(input, output)\n\n output.flush()\n output.close()\n}\n\nprivate fun String.words() = split(\" \")\n\nprivate fun String.toInts() = split(\" \").map { it.toInt() }\nprivate fun String.toLongs() = split(\" \").map { it.toLong() }\n\nprivate fun solve(input: BufferedReader, output: PrintWriter) {\n val (n) = input.readLine().toLongs()\n for (i in 1..n + 1) {\n if (1.toLong().shl(i.toInt()) >= n) {\n output.println(i)\n return\n }\n }\n}", "lang": "Kotlin", "bug_code_uid": "0a07a7c4d5676c102b2507ce4a4ca975", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "a94f58df29f8334611ea7064fdbfc5ba", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7965860597439545, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun main() {\n fun readLongs() = readLine()!!.split(\" \").map(String::toLong)\n\n infix fun Long.maxMin(b: Long): Pair {\n return if (this >= b) this to b else b to this\n }\n\n fun gcd(a: Long, b: Long): Long {\n var (max, min) = a maxMin b\n while (min != 0L) {\n val newMin = max % min\n max = min\n min = newMin\n }\n return max\n }\n\n fun mcm(a: Long, b: Long): Long {\n return a * b / gcd(a, b)\n }\n val (x, y, a, b) = readLongs()\n val m = mcm(x, y)\n var option = m\n var sol = 0L\n while (option <= b) {\n if (option >= a) sol++\n option += m\n }\n print(sol)\n}", "lang": "Kotlin", "bug_code_uid": "f3ba5dbe5a8591e1e591c93a15a71810", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "c27cbd95efcb7ee5aafd9da6296a2a7c", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.22029488291413704, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "fun main() {\n fun readLongs() = readLine()!!.split(\" \").map(String::toLong)\n\n val (x, y, a, b) = readLongs()\n val (max, min) = if (x >= y) x to y else y to x\n if (min == 1L) {\n print(b - a + 1)\n return\n }\n var value = max * (a / max) + if (a % max == 0L) 0L else max\n var sol = 0L\n while (value <= b) {\n if (value % min == 0L)\n sol++\n value += max\n }\n print(sol)\n}", "lang": "Kotlin", "bug_code_uid": "03bba56fb99b2a0ad80afb1c69f8ba25", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "c27cbd95efcb7ee5aafd9da6296a2a7c", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.779333655239015, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "\nimport java.util.*\n\nfun main(args: Array) {\n val scanner = Scanner(System.`in`)\n scanner.nextLine()\n\n val ns: List = scanner.nextLine().split(\" \").map { it.toInt() }\n val ms: List = scanner.nextLine().split(\" \").map { it.toInt() }\n\n val nMin: Int = ns.min()!!\n val mMin: Int = ms.min()!!\n if (nMin == mMin) {\n println(nMin)\n System.exit(0)\n }\n val minOfBothConcat = when {\n nMin < mMin -> \"$nMin$mMin\"\n else -> \"$mMin$nMin\"\n }.toInt()\n\n if (ms.contains(nMin)) {\n if (minOfBothConcat > nMin) {\n println(nMin)\n System.exit(0)\n }\n }\n\n if (ns.contains(mMin)) {\n if (minOfBothConcat > mMin) {\n println(mMin)\n System.exit(0)\n }\n }\n println(minOfBothConcat)\n}", "lang": "Kotlin", "bug_code_uid": "8430092df35cca09000b4b430219948a", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "c17b91af29e7c60197cf7d04b02f7137", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.39862542955326463, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "import java.util.*\n\nfun main() {\n var n = readLine()!!.split(' ').map { it.toInt() }\n var distance = readLine()!!.split(' ').map { it.toInt() }\n var stations = readLine()!!.split(' ').map { it.toInt() }\n\n var ans1 = distance.min()!!\n var ans2 = stations.min()!!\n\n if (ans1 == ans2) {\n println(ans1)\n } else {\n var str = \"\"\n if (ans1 > ans2) {\n str+=ans2.toString()\n str+=ans1.toString()\n }else{\n str+=ans1.toString()\n str+=ans2.toString()\n }\n println(str)\n }\n\n\n}\n", "lang": "Kotlin", "bug_code_uid": "2ed568b1540e382b0f6e7de2915a3abc", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "7beda9af3b926471907d50e248b90bb9", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6230677764565993, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "import java.math.BigInteger\nfun main(args: Array)\n{\n var ins:String\n var fact:BigInteger = BigInteger.valueOf(1)\n var sum:BigInteger = BigInteger.valueOf(0)\n var m:BigInteger = BigInteger.valueOf(2)\n var bb:BigInteger\n\n var nn:Int\n ins = readLine()!!\n nn = ins.toInt()\n fact = ins.toBigInteger()\n\n for(i in 1..nn)\n {\n bb = i.toBigInteger()\n fact = fact.multiply(bb)\n sum = sum.add(m.multiply(fact))\n }\n sum = sum.divide(m)\n println(sum)\n\n}", "lang": "Kotlin", "bug_code_uid": "a3c96e7bd14955b2501844fe8d034a66", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "f25947c93fd765f9e4b260b5b55b0936", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8249258160237388, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "fun main(args: Array) {\n var p = readLine()!!.split(' ').map(String::toInt)\n p = p.sorted()\n if (p[1] - p[0] == p[2] - p[1]){\n print((p[2] - p[1]) * 2)\n }\n}", "lang": "Kotlin", "bug_code_uid": "f54696120cb20d495efecd0196063f03", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "f707a4a8f3b36b69f94c5173ab19100e", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8949416342412452, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nfun main() {\n var arr = readLine()!!.split(' ').map { it.toInt() }.toIntArray().sorted()\n println(arr[1])\n\n}", "lang": "Kotlin", "bug_code_uid": "7dba305a647dcfe8c7b401e84baa7a08", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "036eccd21359f3aada1858831e241b85", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.4005167958656331, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "/**\n * Created by Mego on 5/29/2017.\n */\nfun main(args: Array) {\n val input = readLine()!!.split(\" \")\n var x1 = input[0].toInt()\n var x2 = input[1].toInt()\n var x3 = input[2].toInt()\n\n val mid = (input.sorted())[1].toInt()\n val numberOfSteps = (Math.abs(mid - x1) + Math.abs(mid - x2) + Math.abs(mid - x3))\n println(numberOfSteps)\n}\n", "lang": "Kotlin", "bug_code_uid": "7c94e7f7329d9f76b123c83cd8b18e3b", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "e56b46872828ac70d2e0771e366b54f8", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9951338199513382, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "/**\n * Created by Mego on 5/29/2017.\n */\nfun main(args: Array) {\n val input = readLine()!!.split(\" \")\n var inputInt = ArrayList()\n\n for (i in 0..input.size - 1) {\n inputInt.add(input[i].toInt())\n }\n val mid = (inputInt.sorted())[1]\n val numberOfSteps = (Math.abs(mid - inputInt[0]) + Math.abs(mid - inputInt[1]) + Math.abs(mid - inputInt[2]))\n println(numberOfSteps)\n}\n", "lang": "Kotlin", "bug_code_uid": "50f84d4ae72ebfa8869375725777c7c8", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "e56b46872828ac70d2e0771e366b54f8", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6255924170616114, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import kotlin.math.abs\nimport kotlin.math.min\n\nfun main() {\n fun readInts() = readLine()!!.split(\" \").map(String::toInt)\n\n val xs = readInts().sorted()\n val middle = (xs[2] + xs[0]) / 2\n print(min(xs.map { abs(middle - it) }.sum(), xs.map { abs(middle + 1 - it) }.sum()))\n}", "lang": "Kotlin", "bug_code_uid": "db7524b293b2d09aa6d0182ff5772a14", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "2949b3d86ca4e25e02d5945e8d73d0bc", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.41595441595441596, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "fun main() {\n val e = Array(3){readLine()!!.toInt()}\n e.sort()\n print(e[1] - e[0] + e[2] - e[1])\n}\n", "lang": "Kotlin", "bug_code_uid": "5429542ab5021cc6dafa0a98499daa5c", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "eb120b844294bc955914e45bc04ec928", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9042769857433809, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val inputs = readLine()!!.split(\" \").map(Integer::parseInt)\n val a = inputs[0]\n val b = inputs[1]\n\n val unmatched = min(a, b)\n val matched = abs(a - b) / 2\n\n println(\"$unmatched $matched\")\n}", "lang": "Kotlin", "bug_code_uid": "c4bfae82cc9a384f83f2192d38a5e589", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "6aa873de2c5f3b1feaf350680099aa70", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9236111111111112, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "/**\n * Created by Mego on 5/29/2017.\n */\n\nfun main(args: Array) {\n val input = readLine()!!.split(\" \")\n var a: Int = input[0].toInt()\n var b: Int = input[1].toInt()\n\n var maxDays: Int = 0\n var numberOfDays: Int = 0\n\n if (a < b) {\n maxDays = a\n numberOfDays = (b-a)/2\n } else {\n maxDays = b\n numberOfDays = (a-b)/2\n }\n\n println(\"$maxDays,$numberOfDays\")\n}\n", "lang": "Kotlin", "bug_code_uid": "187f20bf67ee239ce039dfec0e7cb41d", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "7d9b812a566d36471123907f13839483", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5714285714285714, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "fun main() {\n fun readInts() = readLine()!!.split(\" \").map(String::toInt)\n\n val minimum = readInts().min()!!\n var sol = 1\n val visited = mutableSetOf()\n for (candidate in 2..minimum) {\n if (candidate !in visited) {\n sol *= candidate\n var toRemove = candidate\n while (toRemove <= minimum) {\n visited.add(toRemove)\n toRemove += candidate\n }\n }\n }\n print(sol)\n}", "lang": "Kotlin", "bug_code_uid": "45a0f58d8430c1c98f26c08d20a4e010", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "87580f203a8ac04825dbb6caa55f4b92", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.5533834586466165, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "fun main() {\n fun readInts() = readLine()!!.split(\" \").map(String::toInt)\n\n val maximum = readInts().max()!!\n var sol = 1\n val visited = mutableSetOf()\n for (candidate in 2..maximum) {\n if (candidate !in visited) {\n sol *= candidate\n var toRemove = candidate\n while (toRemove <= maximum) {\n visited.add(toRemove)\n toRemove += candidate\n }\n }\n }\n print(sol)\n}", "lang": "Kotlin", "bug_code_uid": "5224a021dd355d2e5f62e0b91879ade1", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "87580f203a8ac04825dbb6caa55f4b92", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.6852367688022284, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "fun main() {\n println(Regex(\"xxx+\").findAll(string).fold(0) { total, matchResult -> total + matchResult.value.length - 2})\n}\n", "lang": "Kotlin", "bug_code_uid": "0cf2cbf8ea689201fc479367fcd89bdc", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "abc60f5eec195480c465db3b2b42a808", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9284064665127021, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n val str: String = readLine() ?: \"\"\n println(Regex(\"xxx+\")\n .findAll(str)\n .fold(0) { total, matchResult ->\n total + matchResult.value.length - 2\n })\n}", "lang": "Kotlin", "bug_code_uid": "6bf085971ee03fbccadb72069425fb43", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "abc60f5eec195480c465db3b2b42a808", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.780650542118432, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "fun readString() = readLine()!!\nfun readStrings() = readString().split(\" \")\nfun readInt() = readString().toInt()\nfun readInts() = readStrings().map { it.toInt() }\nfun readLong() = readString().toLong()\nfun readLongs() = readStrings().map { it.toLong() }\nfun readDouble() = readString().toDouble()\nfun readDoubles() = readStrings().map { it.toDouble() }\n\nfun main() {\n val n = readInt()\n val string = StringBuffer(readString())\n var i = 0\n val regex = Regex(\"x{3}\")\n while(regex.containsMatchIn(string.toString())) {\n string.deleteCharAt(string.indexOf(\"x\"))\n i++\n }\n print(i)\n}", "lang": "Kotlin", "bug_code_uid": "472d70020d8019677482025b05ae144c", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "74491e5e9f465aca3a7420d87a308ba8", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8376327769347496, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import kotlin.math.max\n\n/* http://codeforces.com/problemset/problem/978/B */\n\nfun main() {\n readLine() // skip first line\n val string = readLine()!!\n val maxForbiddenSequence = string.split(regex = Regex(\"[^x]\"))\n .filter { it.isNotBlank() }\n .maxBy { it.length }!!\n println(max(0,maxForbiddenSequence.length - 3 + 1))\n}", "lang": "Kotlin", "bug_code_uid": "d2b6406e3c627a61caefaaf78d518cb4", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "7a1cc3175cec24ab38a79dd199ba8711", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9880597014925373, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "fun main(args : Array){\n val n : Int = readLine()!!.toInt()\n val str = readLine()!!.toCharArray()\n var p = 0\n var sum = 0\n for (y in str){\n if (y == 'x'){\n p++;\n }else{\n if(p >= 3){\n sum += p-2\n }\n p = 0\n }\n }\n print(sum)\n}", "lang": "Kotlin", "bug_code_uid": "c51cb740449e82ef9abf89960eab64a7", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "b790d5957dfd719c629d6374828b5e13", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.803088803088803, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "fun filename(filename: String) : Int {\n var xCount = 0\n var states = arrayOf(false, false, false)\n for (c in filename) {\n if (c == 'x') {\n if (!states[0]) {\n states[0] = true\n } else if (!states[1]) {\n states[1] = true\n } else if (!states[2]) {\n states[2] = true\n } else {\n xCount++\n }\n } else {\n states = arrayOf(false, false, false)\n }\n }\n return xCount\n}\n\nfun main(args: Array) {\n readLine()!!.toInt()\n val name = readLine()!!\n println(filename(name))\n}", "lang": "Kotlin", "bug_code_uid": "14e6c1ccb0c25c71e9c2121ce76f6f7e", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "06544a9aa4270ca1f1b66e89721efa26", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8490990990990991, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "fun main(args: Array){\n val n = readLine()!!.toInt()\n val s = readLine()!!\n val forbidden = \"xxx\"\n var c = 1\n var ans = 0\n if(s.contains(forbidden)) {\n for(i in 1..(n-1)) {\n if(s[i-1] == s[i] && s[i] == 'x'){\n c++\n if(c >= 3)\n ans++\n }\n else\n c = 0\n }\n println(ans)\n }\n else\n println(0)\n}", "lang": "Kotlin", "bug_code_uid": "966a6c4d4f91b7fcb1ac7d34c6cdf307", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "41c0328327e2a5b2e4a24be560c0c6b2", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8292441140024783, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.util.*\nimport kotlin.math.abs\nimport kotlin.math.max\nimport kotlin.math.min\n\nval MOD = 1_000_000_007L\n\nfun lowerBound(A: LongArray, s: Int, x: Long): Int {\n var l = s - 1\n var h = A.size\n while(h - l > 1) {\n val m = (h + l) / 2\n if (A[m] >= x) h = m\n else l = m\n }\n return h\n}\nclass Solver(stream: InputStream, private val out: java.io.PrintWriter) {\n fun solve() {\n val N = ni()\n var K = nl() - 1\n val INF = 1e18.toLong() + 10\n val dp = LongArray(N + 10){-1}\n fun partitionNum(n: Int): Long {\n if (n == 0) return 1L\n if (dp[n] != -1L) return dp[n]\n var sum = 1L\n for (i in 1 until n) {\n sum += partitionNum(i)\n if (sum >= INF) sum = INF\n }\n dp[n] = sum\n debug{\"partitionNum($n)=$sum\"}\n return sum\n }\n\n val part = mutableListOf()\n var n = N\n while(n > 0) {\n val nums = LongArray(n + 1)\n for (i in 1 .. n) {\n nums[i] = partitionNum(n - i)\n }\n for (i in 1 .. n) {\n nums[i] += nums[i - 1]\n if (nums[i] >= INF) nums[i] = INF\n }\n\n debug(nums)\n val num = lowerBound(nums, 0, K + 1)\n debug{\"K:$K num:$num\"}\n part += num\n n -= num\n K -= nums[num - 1]\n }\n\n debug{part.joinToString(\" \")}\n val ans = mutableListOf()\n var l = 0\n for (p in part) {\n for (i in l + p downTo l + 1) {\n ans.add(i)\n }\n l += p\n }\n\n out.println(ans.joinToString(\" \"))\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n private val isDebug = try {\n // \u306a\u3093\u304b\u672c\u756a\u3067\u30a8\u30e9\u30fc\u3067\u308b\n System.getenv(\"MY_DEBUG\") != null\n } catch (t: Throwable) {\n false\n }\n\n private var tokenizer: StringTokenizer? = null\n private val reader = BufferedReader(InputStreamReader(stream), 32768)\n private fun next(): String {\n while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n tokenizer = StringTokenizer(reader.readLine())\n }\n return tokenizer!!.nextToken()\n }\n\n private fun ni() = next().toInt()\n private fun nl() = next().toLong()\n private fun ns() = next()\n private fun na(n: Int, offset: Int = 0): IntArray {\n return map(n) { ni() + offset }\n }\n private fun nal(n: Int, offset: Int = 0): LongArray {\n val res = LongArray(n)\n for (i in 0 until n) {\n res[i] = nl() + offset\n }\n return res\n }\n\n private fun na2(n: Int, offset: Int = 0): Array {\n val a = Array(2){IntArray(n)}\n for (i in 0 until n) {\n for (e in a) {\n e[i] = ni() + offset\n }\n }\n return a\n }\n\n private inline fun map(n: Int, f: (Int) -> Int): IntArray {\n val res = IntArray(n)\n for (i in 0 until n) {\n res[i] = f(i)\n }\n return res\n }\n\n private inline fun debug(msg: () -> String) {\n if (isDebug) System.err.println(msg())\n }\n\n private fun debug(a: LongArray) {\n debug { a.joinToString(\" \") }\n }\n\n private fun debug(a: IntArray) {\n debug { a.joinToString(\" \") }\n }\n\n private fun debug(a: BooleanArray) {\n debug { a.map { if (it) 1 else 0 }.joinToString(\"\") }\n }\n\n private fun debugDim(A: Array) {\n if (isDebug) {\n for (a in A) {\n debug(a)\n }\n }\n }\n private fun debugDim(A: Array) {\n if (isDebug) {\n for (a in A) {\n debug(a)\n }\n }\n }\n\n /**\n * \u52dd\u624b\u306bimport\u6d88\u3055\u308c\u308b\u306e\u3092\u9632\u304e\u305f\u3044\n */\n private fun hoge() {\n min(1, 2)\n max(1, 2)\n abs(-10)\n }\n}\n\nfun main() {\n val out = java.io.PrintWriter(System.out)\n Solver(System.`in`, out).solve()\n out.flush()\n}", "lang": "Kotlin", "bug_code_uid": "a977a0e7ed53b76b06fa5fbbcc5e7c95", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "f21a2836872ce167754b5e378e144120", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6915584415584416, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n fun readInts() = readLine()!!.split(\" \").map(String::toInt)\n\n val numBalls = readLine()!!.toInt()\n val sizes = readInts().sorted()\n for (pos in 0 until numBalls - 2)\n if (sizes[pos] + 1 == sizes[pos + 1] && sizes[pos] + 2 == sizes[pos + 2]) return print(\"YES\")\n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "1f548b1caede9b0effd3dcff2ca4ec4f", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "5ba383a3fb1ac6551c0322196b076387", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6729857819905213, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n fun readInts() = readLine()!!.split(\" \").map(String::toInt)\n\n val numBalls = readLine()!!.toInt()\n val sizes = readInts().toSet().toList().sorted()\n for (pos in 0 until numBalls - 2)\n if (sizes[pos] + 1 == sizes[pos + 1] && sizes[pos] + 2 == sizes[pos + 2]) return print(\"YES\")\n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "8c37fddd5a9212cf381ae6b11dd26849", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "5ba383a3fb1ac6551c0322196b076387", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9824253075571178, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "import java.util.*\n\nfun main(){\n val sc = Scanner(System.`in`)\n var n = sc.nextLine()\n var k = n.toCharArray()\n var count = 0\n for(i in n.indices){\n if(count ==0 && n[i] =='h' ){\n count++\n }\n if(count ==1 && n[i] =='e' ){\n count++\n }\n if(count ==2 && n[i] =='l' ){\n count++\n }\n if(count ==3 && n[i] =='l' ){\n count++\n }\n if(count ==4 && n[i] =='o' ){\n count++\n }\n\n }\n if(count==5) print(\"YES\") else print(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "28e6466b2c314ccebbfc61fc3495cf5e", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "9000ce5d4e1af7040f77740678a3ee71", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.10242587601078167, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "import java.util.Scanner;\n \npublic class CF58A {\n public static void main(String[] args) {\n Scanner cin = new Scanner(System.in);\n String f = \"hello\";\n String s = cin.nextLine();\n int nowp = 0;\n for(int i = 0; i < s.length(); i++){\n if(s.charAt(i)==f.charAt(nowp))\n nowp ++;\n if(nowp == f.length()) break;\n }\n if(nowp == f.length()){\n System.out.println(\"YES\");\n } else {\n System.out.println(\"NO\");\n }\n }\n}", "lang": "Kotlin", "bug_code_uid": "8cf47221a4e08486d12065b834aba424", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "9000ce5d4e1af7040f77740678a3ee71", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "fun main() {\n var str = readStr()!!\n var const = \"hello\"\n var ans = \"\"\n var flag = false\n for (i in str) {\n if (const.contains(i)) {\n if (!ans.contains(i)) {\n ans += i\n } else if (i == 'l' && !flag) {\n ans += i\n flag = true\n }\n }\n }\n if (ans == const) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}\n\n\nprivate fun readInts(): List = readLine()!!.split(' ').map { it.toInt() }\nprivate fun readLongs(): List = readLine()!!.split(' ').map { it.toLong() }\nprivate fun readInt(): Int = readLine()!!.toInt()\nprivate fun readLong(): Long = readLine()!!.toLong()\nprivate fun readStr(): String? = readLine()!!", "lang": "Kotlin", "bug_code_uid": "0da400d9b39835da2e7f4f4375fb5a82", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "545261eaa955f59579fdff855be55d85", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5189873417721519, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import java.util.*\n\nfun main(args: Array){\n val scan = Scanner(System.`in`)\n val s = scan.next().toLowerCase().toCharArray()\n var lcount = 0\n\n for (i in 1 until s.size){\n if (s[i] == 'l') lcount++\n if (s[i-1] == s[i]) s[i-1] = 0.toChar()\n }\n if (s.toString().contains(\"helo\") and (lcount >= 2)) print(\"YES\")\n else print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "37891f8e7fdb5e4e7344ff6c30253a05", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "9d86d331223ac8d06e1906b7ff2df497", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9929245283018868, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val input = readLine()!!\n var ans: String = \"\"\n var len: Int = 0\n var l: Int = 0\n for (i in input) {\n if (len == 0) {\n if (i == 'h') {\n ans += i\n len++\n }\n } else {\n if (ans[len - 1] == 'h' && i == 'e') {\n ans += i\n len++\n } else if (ans[len - 1] == 'e' && i == 'l') {\n ans += i\n l++\n len++\n } else if (ans[len-1] == 'l' && (l < 2 && i == 'l')) {\n ans += i\n l++\n len++\n } else if (ans[len - 1] == 'l' && i == 'o') {\n ans += i\n len++\n break\n }\n }\n }\n ans = if (ans.equals(\"hello\")) \"YES\" else \"NO\"\n print(ans)\n}\n", "lang": "Kotlin", "bug_code_uid": "1bbea793449977d33355cb7d81475c7f", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "893c7ab6ebbfbb397d0963733b39895a", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.991304347826087, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "fun main() {\n val s = readLine()!!\n val k =s.length\n var count = 0\n for (i in 0..k -1 ){\n if (s[i].toString() != \"h\"){\n for (j in i+1..k - 1){\n if (s[j].toString() != \"e\"){\n for (x in j+1..k - 1){\n if (s[x].toString() == \"l\") count ++\n if (count == 2){\n for (y in x+1..k-1){\n if (s[y].toString() == \"o\"){\n println(\"YES\")\n return\n }\n }\n } \n }\n }\n }\n }\n }\n println(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "09db84a57300022d62a78e1d00295c29", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "0e938dc937464d8d18721b377dc77d64", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.830122591943958, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n val word = readLine()!!\n val hello = listOf(\"h\",\"e\",\"l\",\"l\",\"o\")\n var index = 0\n word.forEach { \n if(it.equals(hello[index])) {\n index++\n }\n }\n println(if(index >= 5) \"YES\" else \"NO\")\n }", "lang": "Kotlin", "bug_code_uid": "3ea75f51a8238e2fc9d0cc72bed429cd", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "1525497d5c99bef0aeed13b5f53b49a2", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9222614840989399, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n val word = \"ahhellllloou\"\n val hello = listOf('h','e','l','l','o')\n var index = 0\n word.forEach {\n if(it == hello[index]) {\n index++\n }\n }\n println(if(index > 4) \"YES\" else \"NO\")\n }", "lang": "Kotlin", "bug_code_uid": "6bdeee087c1c6e26f6ccdffec69757e3", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "1525497d5c99bef0aeed13b5f53b49a2", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9848101265822785, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "fun main(args: Array) {\n\n val input: String = readLine()!!\n val hello = \"hello\"\n var currIndex = 0\n \n for (i in 0 until input.length) {\n\n if (input[i] == hello[currIndex]){\n currIndex++\n }\n\n if (currIndex == hello.length - 1)\n break\n\n }\n\n if (currIndex == hello.length - 1)\n println(\"YES\")\n else\n println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "55306534dd08a3eef6c51bf1657923ea", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "628cf85ed6e9dde7deaa8feb3612c402", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8181818181818182, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "import java.util.*\n\nprivate val scan = Scanner(System.`in`)\n\nfun main(args: Array) {\n println(scan.next().contains(\"hello\"))\n}\n", "lang": "Kotlin", "bug_code_uid": "a6d67d1f8329f98848b45a1a83f6297d", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "941950fb3c230aab998a2b65d361ea67", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.839622641509434, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\nfun main(args: Array) {\n val reader = BufferedReader(InputStreamReader(System.`in`))\n val regex = Regex(\"[h]{1,}[e]{1,}[l]{2,}[o]{1,}\")\n val contains = reader.readLine().contains(regex)\n println(if (contains) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "5ce30539bca9384e7872d5f391626fa9", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "ec3d8810b03eb643c16401b637baa2c4", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.4328899637243047, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import java.lang.StringBuilder\n\nfun main() {\n val hello = \"hello\"\n val str = readLine().toString()\n val sb = StringBuilder()\n for (i in str) {\n if (i == 'h')\n sb.insert(0, i)\n if (i == 'e')\n sb.insert(1, i)\n if (i == 'l')\n sb.insert(2, i)\n if (i == 'l')\n sb.insert(3, i)\n if (i == 'o')\n sb.insert(4, i)\n }\n if (sb.toString().contains(hello))\n println(\"YES\")\n else println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "9b0793e9f5b348e663fe16b5ce229746", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "839eae62e8fa7e75ac02581d26d02f99", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9896907216494846, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n print(if (\".*h.*e.*ll.*o.*\".toRegex().matches(readLine()!!)) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "53b43ee308adb3eff006f35ded830d04", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "8470a6678a32a7f02f95da57eff16b52", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9817893903404592, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main() {\n var scanner = Scanner(System.`in`)\n var s:String = scanner.next()\n var result = false;\n var lastChars = \"\"\n var lastChar = 'a'\n for(i in 0 until s.length){\n if(s[i] == 'h' && lastChars == \"\") lastChars += 'h'\n else if(s[i] == 'e' && lastChars == \"h\") lastChars+= 'e';\n else if(s[i] == 'l' && lastChars == \"he\") lastChars+= 'l';\n else if(s[i] == 'l' && lastChars == \"hel\") lastChars+= 'l';\n else if(s[i] == 'o' && lastChars == \"hell\") lastChars+= 'o';\n }\n if(lastChars.contains(\"hello\")) println(\"YES\")\n else println(\"NO\")\n println(lastChars)\n}\n", "lang": "Kotlin", "bug_code_uid": "224844363455ddfc0b7c8367d684179f", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "c6f5fb4d50a2c87ce94133db32963770", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9997483010319658, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.*\nimport java.lang.Math.max\nimport java.util.*\n\n\nfun main() {\n Solver()\n}\n\nclass Solver {\n private val io = KotlinIo(System.`in`, System.`out`)\n\n init {\n val n = io.getLong()\n val m = io.getLong()\n val modNumbers = mutableListOf()\n for (i in 0 until n) {\n modNumbers.add(io.getLong())\n }\n val meetInTheMiddle = MeetInTheMiddle(modNumbers, m)\n io.println(meetInTheMiddle.getLargestModuloSum())\n io.close()\n }\n}\n\nclass MeetInTheMiddle(private val numbers: List, private val moduloValue: Long) {\n\n private val firstModuloSumList = mutableListOf()\n private val secondModuloSumList = mutableListOf()\n\n fun getLargestModuloSum(): Long {\n val modNumbers = numbers.map { it.rem(moduloValue) }\n if (modNumbers.size == 1) {\n return modNumbers.first()\n }\n val firstList = modNumbers.subList(0, modNumbers.size / 2)\n val secondList = modNumbers.subList(modNumbers.size / 2, modNumbers.size)\n\n bruteForceModuloSums(0, firstList, firstModuloSumList, firstList.first())\n bruteForceModuloSums(0, firstList, firstModuloSumList, 0L)\n bruteForceModuloSums(0, secondList, secondModuloSumList, secondList.first())\n bruteForceModuloSums(0, secondList, secondModuloSumList, 0L)\n\n return maxModuloSumBetweenList()\n }\n\n private fun maxModuloSumBetweenList(): Long {\n val firstModuloSumSet = TreeSet(firstModuloSumList)\n val secondModuloSumSet = TreeSet(secondModuloSumList)\n var maxSum = (firstModuloSumSet.last()).coerceAtLeast(secondModuloSumSet.last())\n\n firstModuloSumSet.forEach {\n val gap: Long = moduloValue.minus(it)\n val floorValue = secondModuloSumSet.floor(gap)\n if (floorValue != null) {\n maxSum = maxSum.coerceAtLeast((it + floorValue).rem(moduloValue))\n }\n }\n return maxSum\n }\n\n private fun bruteForceModuloSums(index: Int, modNumbers: List, moduloSumList: MutableList, sum: Long) {\n if (index == modNumbers.size - 1) {\n moduloSumList.add(sum.rem(moduloValue))\n return\n }\n bruteForceModuloSums(index + 1, modNumbers, moduloSumList, sum + modNumbers[index + 1])\n bruteForceModuloSums(index + 1, modNumbers, moduloSumList, sum)\n }\n}\n\n\n/**\n * IO class with exposing various input operations. Kotlin Translation of\n * [Kattio.java](https://github.com/Kattis/kattio/blob/master/Kattio.java)\n */\nclass KotlinIo(private val input: InputStream, private val outPut: OutputStream) :\n PrintWriter(BufferedOutputStream(outPut)) {\n\n private var reader: BufferedReader = BufferedReader(InputStreamReader(input))\n private var line: String? = null\n private var tokenizer: StringTokenizer? = null\n private var token: String? = null\n\n fun hasMoreTokens() = peekToken() != null\n\n fun getInt() = nextToken()!!.toInt()\n\n fun getDouble() = nextToken()!!.toDouble()\n\n fun getLong() = nextToken()!!.toLong()\n\n fun getWord() = nextToken()\n\n fun getLine(): String? {\n try {\n return reader.readLine()\n } catch (e: IOException) {\n e.printStackTrace()\n }\n return null\n }\n\n private fun peekToken(): String? {\n if (token == null) {\n try {\n while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n line = reader.readLine()\n if (line == null) {\n return null\n }\n tokenizer = StringTokenizer(line)\n }\n token = tokenizer!!.nextToken()\n } catch (e: IOException) {\n e.printStackTrace()\n }\n }\n return token\n }\n\n private fun nextToken(): String? {\n val ans = peekToken()\n token = null\n return ans\n }\n}", "lang": "Kotlin", "bug_code_uid": "101138c69042c51fc83ccd4ab084c06e", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "af22cabb221e075bc4e29f477d13ca2e", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7945120049890864, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import java.util.*\n\nprivate fun readLn() = readLine()!! // string line\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\nprivate fun readLong() = readLn().toLong() // single long\nprivate fun readLongs() = readStrings().map { it.toLong() } // list of longs\nprivate fun readDouble() = readLn().toDouble() // single Double\nprivate fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles\n\nfun solve(){\n var (n, m) = readInts()\n var arr = readInts()\n var n1 = n / 2; var n2 = n - n1\n\n var ans = 0\n var left = TreeSet()\n var right = TreeSet()\n for (mask in 0 until (1 shl n1)) {\n var sum = 0\n for (i in 0 until n1) {\n if ((mask and (1 shl i)) == (1 shl i)) sum = (sum + arr[i])%m\n }\n left.add(sum)\n ans = Math.max(ans, sum)\n }\n\n for (mask in 0 until (1 shl n2)) {\n var sum = 0\n for (i in 0 until n2) {\n if ((mask and (1 shl i)) == (1 shl i)) sum = (sum + arr[i + n1])%m\n }\n right.add(sum)\n ans = Math.max(sum, ans)\n }\n\n for (x in left) {\n var req = m - 1 - x\n var it = right.lower(req)\n if (it != null) {\n ans = Math.max(ans, (it + x)%m)\n }\n it = right.lower(req + m)\n if (it != null) {\n ans = Math.max(ans, (it + x)%m)\n }\n }\n\n println(ans)\n}\n\nfun main(){\n var t = 1\n// t = readInt()\n for(i in 1..t) {\n solve()\n }\n}", "lang": "Kotlin", "bug_code_uid": "72bdcbbc69d03438f340f6f06a569cac", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "e4c71ca16b0002d4eba0f169415b5b99", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8819425062796539, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.util.StringTokenizer\n\nfun main(args: Array) {\n val sc = FastScanner(System.`in`)\n\n val n = sc.nextInt()\n val m = sc.nextInt()\n\n val vs = Array(n + 1) { i -> Vertex(i) }\n\n repeat(m) {\n val u = vs[sc.nextInt()]\n val v = vs[sc.nextInt()]\n u.edge.add(v)\n v.edge.add(u)\n }\n\n solve(n, vs, mutableListOf())\n println(max)\n}\n\n\nvar max = -1\n\nfun solve(n: Int, vs: Array, marked: MutableList) {\n if (marked.size == n) {\n val res: Int = check(n, vs, marked) ?: -1\n max = maxOf(max, res)\n return\n }\n\n for (j in 1..6) {\n marked.add(j)\n solve(n, vs, marked)\n marked.removeAt(marked.lastIndex)\n }\n}\n\nfun check(n:Int, vs: Array, marked: MutableList): Int? {\n val used = mutableSetOf>()\n for(x in 1..n){\n val v = vs[x]\n for(u in v.edge){\n if(v.n >= u.n) continue\n if(used.contains(marked[v.n - 1] to marked[u.n - 1])) return null\n used.add(marked[v.n - 1] to marked[u.n -1])\n }\n }\n return used.size\n}\n\n\ndata class Vertex(val n: Int) {\n val edge = mutableListOf()\n}\n\n\nclass FastScanner(s: InputStream) {\n private var st = StringTokenizer(\"\")\n private val br = BufferedReader(InputStreamReader(s))\n\n fun next(): String {\n while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())\n\n return st.nextToken()\n }\n\n fun nextInt() = next().toInt()\n fun nextLong() = next().toLong()\n fun nextLine() = br.readLine()\n fun nextDouble() = next().toDouble()\n fun ready() = br.ready()\n}\n\n\n", "lang": "Kotlin", "bug_code_uid": "3751b97ca614f5bc6becaa7014115f3a", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "186879e5f9077ed588372761dcadcb81", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8157248157248157, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n Thread({ solve() }).start()\n}\n\nfun solve() {\n var (n, m, a, b) = readLine()!!.split(\" \").map { it.toInt() }\n println(if (b < m * a) (n / m * b) + (n % m * a) else n * a)\n}\n\n", "lang": "Kotlin", "bug_code_uid": "5424523c5f56ac4971b07989fc1402f1", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "837444f31469df0a027e5b4997a3aaa8", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9108910891089109, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "fun main(args: Array) {\n var (n, m, a, b) = readInts()\n var res = 0\n while (n - m > 0) {\n n -= m\n res += minOf(a * m, b)\n }\n print(res + a * n)\n}\n\nprivate fun readInt() = readLine()!!.toInt()\n\nprivate fun readInts() = readLine()!!.split(\" \").map { it.toInt() }", "lang": "Kotlin", "bug_code_uid": "891659cd548e11c17581a4b7dcc48830", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "fc8e1eb006218a68a7547fee4c5a49c4", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9461426491994177, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import java.util.Scanner\nimport kotlin.math.min\n\nfun main(){\n val sc=Scanner(System.`in`)\n val (n,m,a,b) = readLine()!!.split(' ').map{it.toInt()}\n if(a) {\n val (n, m, a, b) = readLine()!!.split(' ').map { it.toInt() }\n println(n / m * b + minOf(b, n.rem(m) * a))\n}", "lang": "Kotlin", "bug_code_uid": "232c32cc6cb2244ddcdc323b6f306ada", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "123e24d88c0603b36e8d9979e807edff", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9946686976389947, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import kotlin.math.min\n\nprivate fun readLn() = readLine()!! // string line\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readLong() = readLn().toLong() // single long\nprivate fun readDouble() = readLn().toDouble() // single double\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\nprivate fun readLongs() = readStrings().map { it.toLong() } // list of longs\nprivate fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles\n\n\nfun main(args: Array) {\n var (n,m,a,b)=readInts()\n println(n/m*min(b,a*m)+(n%m)*a)\n}", "lang": "Kotlin", "bug_code_uid": "46c917c4366909266f1dff17a23309b3", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "8f822306f06e5197bed32e74c07b4762", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9256594724220624, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "fun main(args: Array) {\n val (n, m, a, b) = readLine()!!.split(' ').map { it.toInt() }\n\n if (m * a <= b){\n println(a * n)\n }else{\n println(n / m * b + (n-n/m*m)*a)\n }\n}", "lang": "Kotlin", "bug_code_uid": "63bad84cf3f2bb9ff1eee1be6b352b8f", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "44410804adce7de1b15783235a997884", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9571428571428572, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array) {\n val (n, m, ticketPrice, subscriptionPrice) = \"10 3 5 100\".split(' ').map { it.toInt() }\n val answer = minOf(((n - 1) / m + 1) * subscriptionPrice, n / m * subscriptionPrice + n % m * ticketPrice)\n println(minOf(answer, n * ticketPrice))\n}", "lang": "Kotlin", "bug_code_uid": "f4c95afbb49ee150e64d4035bbf77ad3", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "d44522d9916fd1a043f04427f4b06238", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6799336650082919, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "fun main() {\n val (ridesPlanned, coveredBySpecial, costNormal, costSpecial) = readLine()!!.split(\" \").map { it.toShort() }\n println(ridesPlanned / coveredBySpecial * costSpecial + ridesPlanned % coveredBySpecial * costNormal)\n}", "lang": "Kotlin", "bug_code_uid": "64d01a447058bdfee47a866a5a8ce70d", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "0cfada48601d10da4b35cc434d7053e1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.889661164205039, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "import java.util.*\n\nfun main(){\n var scanner = Scanner(System.`in`)\n var n = scanner.nextInt()\n var m = scanner.nextInt()\n var a = scanner.nextInt()\n var b = scanner.nextInt()\n var sum:Int = 0\n if(b >= a*m){\n println(a*n)\n }\n else if(n==m) println(m*b)\n else if(b<=a){\n while(n>0){\n sum+=b\n n-=m\n }\n println(sum)\n }\n else {\n while(n>0){\n sum+= b\n n-=m\n }\n println(sum)\n }\n}", "lang": "Kotlin", "bug_code_uid": "92f3648fecec78a4f738a1081abafe5a", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "0398c325b07e33d3a1284187c901a38c", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9518072289156626, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main(args: Array)\n{\n\tvar(n,m,a,b)=readLine()!!.split(' ').map{it.toInt()}\n\tvar s1=((n/m)*b)+((n%m)*a)\n\tvar s2= (n/m+1)*b\n\tprintln(minOf(s1,s2))\t\n}", "lang": "Kotlin", "bug_code_uid": "f4f552e2670c3ab6de729496b9470521", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "25e84b7dba794bd20350d2c2cb897fed", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9716748768472906, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 12, "bug_source_code": "import java.io.PrintWriter\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.collections.HashMap\nimport kotlin.math.*\n\nval n = 0\nval m = 0\nfun valid(i: Int, j: Int): Boolean {\n return i in 0 until n && j in 0 until m\n}\n\nfun sumRow(arr: IntArray): Int {\n var sum = 0\n for (element in arr) sum += element\n return sum\n}\n\nfun sumCol(twoDArr: Array, colNumber: Int): Int {\n var sum = 0\n for (element in twoDArr) {\n sum += element[colNumber]\n }\n return sum\n}\n\n@JvmField\nval INPUT = System.`in`\n@JvmField\nval OUTPUT = System.out\n\n@JvmField\nval _reader = INPUT.bufferedReader()\n\nfun readLine(): String? = _reader.readLine()!!\nfun readLn() = _reader.readLine()!!\n@JvmField\nvar _tokenizer: StringTokenizer = StringTokenizer(\"\")\n\nfun read(): String {\n while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return \"\", \" \")\n return _tokenizer.nextToken()\n}\n\nfun readInt() = read().toInt()\nfun readDouble() = read().toDouble()\nfun readLong() = read().toLong()\nfun readStrings(n: Int) = List(n) { read() }\nfun readLines(n: Int) = List(n) { readLn() }\nfun readInts(n: Int) = List(n) { read().toInt() }\nfun readIntArray(n: Int) = IntArray(n) { read().toInt() }\nfun readDoubles(n: Int) = List(n) { read().toDouble() }\nfun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }\nfun readLongs(n: Int) = List(n) { read().toLong() }\nfun readLongArray(n: Int) = LongArray(n) { read().toLong() }.toMutableList().toLongArray()\n\n@JvmField\nval _writer = PrintWriter(OUTPUT, false)\n\ninline fun output(block: PrintWriter.() -> Unit) {\n _writer.apply(block).flush()\n}\n\nfun printArr(arr: IntArray, start: Int, end: Int) {\n for (i in start..end) {\n print(\"${arr[i]} \")\n }\n println()\n}\n\nfun printArr(arr: LongArray, start: Int, end: Int) {\n for (i in start..end) {\n print(\"${arr[i]} \")\n }\n println()\n}\n\nfun main() {\n\n val (n, m, a, b) = readDoubles(4)\n if (b/m > a) println((a * n).toInt())\n else {\n when {\n n.toInt() % m.toInt() == 0 -> println(((n.toInt() / m.toInt()) * b).roundToInt())\n n.toInt() / m.toInt() == 0 -> println((minOf((n * a), (m.toInt() / b.toInt()) * n)).roundToInt())\n else -> println((((n.toInt() / m.toInt()) * b) + minOf((n.toInt() % m.toInt()) * a, b)).roundToInt())\n }\n }\n //TODO(\"KYS\")\n\n}\n\n\n\n", "lang": "Kotlin", "bug_code_uid": "00713c4103945f0bda3bff6c727dca4f", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "282c02dc40ccb379b27e8786aa06ae2b", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9952830188679245, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import java.io.PrintWriter\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.collections.HashMap\nimport kotlin.math.*\n\nval n = 0\nval m = 0\nfun valid(i: Int, j: Int): Boolean {\n return i in 0 until n && j in 0 until m\n}\n\nfun sumRow(arr: IntArray): Int {\n var sum = 0\n for (element in arr) sum += element\n return sum\n}\n\nfun sumCol(twoDArr: Array, colNumber: Int): Int {\n var sum = 0\n for (element in twoDArr) {\n sum += element[colNumber]\n }\n return sum\n}\n\n@JvmField\nval INPUT = System.`in`\n@JvmField\nval OUTPUT = System.out\n\n@JvmField\nval _reader = INPUT.bufferedReader()\n\nfun readLine(): String? = _reader.readLine()!!\nfun readLn() = _reader.readLine()!!\n@JvmField\nvar _tokenizer: StringTokenizer = StringTokenizer(\"\")\n\nfun read(): String {\n while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return \"\", \" \")\n return _tokenizer.nextToken()\n}\n\nfun readInt() = read().toInt()\nfun readDouble() = read().toDouble()\nfun readLong() = read().toLong()\nfun readStrings(n: Int) = List(n) { read() }\nfun readLines(n: Int) = List(n) { readLn() }\nfun readInts(n: Int) = List(n) { read().toInt() }\nfun readIntArray(n: Int) = IntArray(n) { read().toInt() }\nfun readDoubles(n: Int) = List(n) { read().toDouble() }\nfun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }\nfun readLongs(n: Int) = List(n) { read().toLong() }\nfun readLongArray(n: Int) = LongArray(n) { read().toLong() }.toMutableList().toLongArray()\n\n@JvmField\nval _writer = PrintWriter(OUTPUT, false)\n\ninline fun output(block: PrintWriter.() -> Unit) {\n _writer.apply(block).flush()\n}\n\nfun printArr(arr: IntArray, start: Int, end: Int) {\n for (i in start..end) {\n print(\"${arr[i]} \")\n }\n println()\n}\n\nfun printArr(arr: LongArray, start: Int, end: Int) {\n for (i in start..end) {\n print(\"${arr[i]} \")\n }\n println()\n}\n\nfun main() {\n\n val (n, m, a, b) = readInts(4)\n when {\n\n b/m > a -> println((a * n))\n else -> {\n when {\n n % m == 0 -> println((n / m) * b)\n n / m == 0 -> println((minOf((n * a), if((b/ m) * n!=0)(b/ m) * n else b)))\n else -> println((((n / m) * b) + minOf((n % m) * a, b)))\n }\n }\n }\n //TODO(\"KYS\")\n\n}\n\n\n\n", "lang": "Kotlin", "bug_code_uid": "c4ed0fb43000fbeeec824e9d5cc441b3", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "282c02dc40ccb379b27e8786aa06ae2b", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9992509363295881, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import kotlin.math.min\n\n/* template start */\n// input\nprivate fun readString() = readLine()!!\nprivate fun readStrings() = readString().split(\" \")\nprivate fun readInt() = readString().toInt()\nprivate fun readDigits() = readString().map { it - '0' }\nprivate fun readInts() = readStrings().map { it.toInt() }\nprivate fun readLongs() = readStrings().map { it.toLong() }\n\n// output\nprivate fun T.print(map: (T) -> String = { it.toString() }) = println(map(this))\nprivate fun Iterable.print(sep: String? = null, map: ((T) -> String)? = null) = asSequence().print(sep, map)\nprivate fun Array.print(sep: String? = null, map: ((T) -> String)? = null) = asSequence().print(sep, map)\nprivate fun IntArray.print(sep: String? = null, map: ((Int) -> String)? = null) = asSequence().print(sep, map)\nprivate fun Sequence.print(sep: String? = null, map: ((T) -> String)? = null) =\n println(joinToString(sep ?: \"\", transform = map ?: { it.toString() }))\n\n// others\nprivate val Int.isEven: Boolean get() = this % 2 == 0\nprivate val Int.isOdd: Boolean get() = !this.isEven\nprivate fun queries(block: (Int) -> Unit) = repeat(readInt(), block)\n\n/* template end */\n\nfun main() {\n val (n, m, a, b) = readInts()\n if (m * a < b) {\n println(n * a)\n } else println(min(((n / m) * b + (n % m) * a), ((n / m) + 1)) * b)\n}", "lang": "Kotlin", "bug_code_uid": "a42e33b28a1f58c8aff933ba38383b98", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "b935e483006f56e8ec802f771e5afd0b", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8410596026490066, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n val scn = Scanner(System.`in`)\n System.out.print(if (scn.nextInt() % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "78943a24e973ed4526ab400a69571914", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7fc386a10ea8fb44c8d54913b48d4f06", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5662100456621004, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "val w: Int = readLine()!!.toInt()\nprintln(if (w % 2 == 0) \"YES\" else \"NO\")", "lang": "Kotlin", "bug_code_uid": "72b56fe1e009236e191fdc6048732006", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ebd14765ff688ef359e73a4d33952259", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9060402684563759, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main(args: Array) = with(Scanner(System.`in`)) {\n val w: Int = nextInt()\n println(if (w % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "59316f58b7c7c0779de8ce16dd5adb24", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ebd14765ff688ef359e73a4d33952259", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9192982456140351, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "val scan = java.util.Scanner(System.`in`)\nfun main(){\n val kg = scan.nextInt()\n if(kg % 2 == 0) print(\"YES\")\n else print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "04173401dfc292c4962828a0f0710ebc", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0b5f9e9552bb0869b2f6435ad6bbd9dd", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8946459412780656, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "private fun readLn() = readLine()!! // string line\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readLong() = readLn().toLong() // single long\nprivate fun readDouble() = readLn().toDouble() // single double\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\nprivate fun readLongs() = readStrings().map { it.toLong() } // list of longs\nprivate fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles\n\n/**\n * @author egaeus\n * @mail sebegaeusprogram@gmail.com\n * @veredict Not sended\n * @url \n * @category ?\n * @date 22/05/2020\n **/\n\nfun main() {\n var N = readInt()\n println(if (N % 2 == 0) \"YES\" else \"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "93bf1ddb2a1716e1fc13760748d2e95d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9acd5c229c842a91e8ba34c436ffc2a8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7883211678832117, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "fun main(args:Array) = new Scanner(System.`\u00ecn`).use { \n if (it.nextInt() % 2 == 0) 'YES' else 'NO' }.let(::println)", "lang": "Kotlin", "bug_code_uid": "d202e5cd0bfa015f599df9c641a9a1dd", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7122de420786e532b19bd49367498b5d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8945454545454545, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "fun main(args:Array) = java.util.Scanner(System.`in`).use { if (it.nextInt() % 2 == 0) \"YES\" else \"NO\" }.let(::println)", "lang": "Kotlin", "bug_code_uid": "32172f047999237330dd2ba329352580", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7122de420786e532b19bd49367498b5d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9885057471264368, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\nfun main(args: Array) {var reader = Scanner(System.`in`)\n var n:Int = reader.nextInt()\n if (n%2==0||n!=2) print(\"YES\")\n else print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "6c1dff133bfd219ccc7d720b40c51564", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a131db20a18988e47f362b6bc786c15c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.09795918367346938, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "fun(w){\n return w\n}", "lang": "Kotlin", "bug_code_uid": "d14d23fc6faf8e0a248c7887427993f0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2ec009f191c669aa657d115ff18b30de", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.08178438661710037, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun divide(w:Int): String {\n return \"Yes\"\n}", "lang": "Kotlin", "bug_code_uid": "9e199878013402ed74dfb24ae4ca8d15", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2ec009f191c669aa657d115ff18b30de", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9794050343249427, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main(){\n val scan = Scanner(System.`in`)\n val n = scan.nextLine().trim().toInt()\n \n if ((n - 2) % 2 == 0)\n print(\"YES\")\n else\n print(\"NO\")\n \n}", "lang": "Kotlin", "bug_code_uid": "05e71e79fd948b7959635ef703618bde", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2ec009f191c669aa657d115ff18b30de", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9809782608695652, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\nfun main(args: Array) {\n val input = BufferedReader(InputStreamReader(System.`in`))\n val weight = input.readLine()[0].toInt()\n println(isWatermelonDividedByEvenParts(weight))\n}\n\nfun isWatermelonDividedByEvenParts(weight: Int) = if (weight != 2 && weight % 2 == 0) \"YES\" else \"NO\"\n", "lang": "Kotlin", "bug_code_uid": "8469e9056a425450db2d68a500da9787", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "d2008933089aeaedf9012cd6103b6ecc", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.956268221574344, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array) {\n val weight = readLine()!!.toInt()\n if(weight % 2 == 0){\n println(\"YES\")\n }\n else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "45903d4b9b55e78b6de54dba6bd315e1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "121103a7fbe86e53891547b0ce0476b3", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9497816593886463, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main(){\n val sc = Scanner(System.`in`)\n val n = sc.nextInt()\n\n var ret = false\n for(x in 2..n){\n if(x%2==0){\n val num = n-x\n println(\"$x $num\")\n if(num != 0) {\n if (num % 2 == 0 && num != 0) {\n ret = true\n break\n }\n }\n }\n }\n if(ret) {\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "e8ce094cda015be4ba86a6802f5847b1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "301bed47c02effee8864d4ab8bce757e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.821301775147929, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "fun number(n : Int){\n var ret = false\n for(x in 2..n){\n if(x%2==0){\n val num = n-x\n println(\"$x $num\")\n if(num != 0) {\n if (num % 2 == 0 && num != 0) {\n ret = true\n break\n }\n }\n }\n }\n if(ret) {\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "7be87da6ddc76d59571e22eddcd1a65c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "301bed47c02effee8864d4ab8bce757e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9285714285714286, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "/**\n * Created by Mayokun Adeniyi on 18/05/2020\n */\n\nfun main(){\n val check = readLine()!!.toInt()\n if (check == 2) println(\"NO\")\n if (check % 2 == 0) println(\"YES\") else println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "34e9f02d78f4f2196aa9b3d1a7faf044", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "038cad64a5e3ff39d6e494ae943c3010", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9050279329608939, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "fun main(args:Array) {\n\n\n print(\"enter number : \")\n val w = readLine()!!.toInt()\n if (w % 2 == 0 && w > 2){\n println(\"trouv\u00e9\")\n\n }else{\n println(\"NON\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "d4dbdd63e7730b799bed5699e4e7aa56", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2503d0b6e9e0da8e64dfd0d98351dc9d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8417910447761194, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "fun main() {\n\n\n print(\"enter number : \")\n var w = readLine()!!.toInt()\n if (w % 2 == 0 && w > 2){\n println(\"OUI\")\n\n }else{\n println(\"NON\")\n }", "lang": "Kotlin", "bug_code_uid": "8cda9da565d7f5716c204a0b77d6b463", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2503d0b6e9e0da8e64dfd0d98351dc9d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9951219512195122, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main(args: Array) = with(Scanner(System.`in`)) {\n val w = nextInt()\n if ((w > 2) && (w and 1 == 0)) {\n println(\"YES)\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "b984a19cb71090d7f99629629d96ed03", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cc4b14b8eedea9ae830c400ef544f440", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.3160493827160494, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "\nfun main(args: Array) {\n var n = readLine().toInt()\n \n if(n%2 == 0 && n != 2)\n print(\"YES\")\n else\n print(\"NO\")\n \n}", "lang": "Kotlin", "bug_code_uid": "a29396c65c472648173bfa3591151a41", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "fc33b037410bfc8e85f4c1ceb6f5ac7b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8543307086614174, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\nfun main() {\n val br = BufferedReader(InputStreamReader(System.`in`))\n val w = br.readLine().toInt()\n println(if (w % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "482f181a7613df27ac966b39d3deba6e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e0db647dc565ca30a962c5ac3366ebb3", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7634408602150538, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "fun isDividable(weight: Int) : Boolean = (weight % 2 == 0)\n\nval weight = readLine()\n\nif (weight != null) {\n val weightInt = Int(weight)\n if (weightInt != null) {\n val result = if (isDividable(weight = weightInt)) \"YES\" else \"NO\"\n print(result)\n }\n}", "lang": "Kotlin", "bug_code_uid": "acd4aed5e765e28d9a06cd0c77acff13", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a63d8680a1500b1ac870e40bcd61e675", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9965156794425087, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun isDividable(weight: Int) : Boolean = (weight > 0 && weight % 2 == 0)\n \nfun main() {\n val weight = readLine()\n if (weight != null) {\n val weightInt = weight.toInt()\n val result = if (isDividable(weight = weightInt)) \"YES\" else \"NO\"\n print(result)\n }\n}", "lang": "Kotlin", "bug_code_uid": "f46c60092f01a9454cd2a6c083e4a0f3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a63d8680a1500b1ac870e40bcd61e675", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8166969147005445, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "import java.io.InputStreamReader\n\n\nfun main(args: Array) {\n val scanner = java.util.Scanner(InputStreamReader(System.`in`))\n val w = scanner.nextInt()\n if(w%2==0 || w==2){\n println(\"YES\")\n }\n else{println(\"NO\")}\n\n\n\n \n\n\n}", "lang": "Kotlin", "bug_code_uid": "5da61101fe8e02d52a1813a7f0c3efe6", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2f64a05f82169464bcc5441c421e10a2", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9696969696969697, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//package problem4A\n\nfun canDivideWatermelon(weight: Int) =\n (weight - 2) % 2 == 0\n\nfun main() {\n val input = readLine()!!.toInt()\n val result = canDivideWatermelon(input)\n println(if (result) \"YES\" else \"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "e00db740be15dcedddb2a23d53126ca7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3979d7d40b916f579ce2d70a991adab7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9922480620155039, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main(){\n val a = readLine()!!.toInt()\n if((a-2)%2==0&&a>4){\n print(\"Yes\")\n }else{\n print(\"No\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "ba99d1ee496cdd8a5de0b8b38abd0427", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7b0274f99a396fe65c98fc5e6684129a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6854460093896714, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun main() {\n println(\n if (readLine()!!.toInt() % 4 == 0) \"YES\" else \"NO\"\n )\n}", "lang": "Kotlin", "bug_code_uid": "d9978e762a09028303de97dab57e277a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f42c6b582295d0ec24ed7a6969fe275c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9917355371900827, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val nul = readLine()!!.toInt()\n println(\n if (num > 2 && num % 2 == 0) \"YES\" else \"NO\"\n )\n}", "lang": "Kotlin", "bug_code_uid": "b33903f3199fdd830fe36e2fabd1de15", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f42c6b582295d0ec24ed7a6969fe275c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.3784786641929499, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "fun main() {\n val num = readLine()!!.toInt()\n if (num % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "11bd008a5395d081f4645daaecb3a233", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ebd3e367ac46172328e673fc2f73a784", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9816272965879265, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.Scanner\n\nfun main(args: Array) {\n val scan = Scanner(System.`in`)\n val a = scan.nextInt()\n if (a % 2 ==0)\n{\n println(\"YES\")\n}\nelse\n{\n println(\"NO\")\n}\n}", "lang": "Kotlin", "bug_code_uid": "82260c38c6fabc59e6311ba3b70da398", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "91811e640616e72ffb37c6a114e14c76", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9957446808510638, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n \nfun main(args: Array) {\n val sc = Scanner(System.`in`)\n val scan = Scanner(System.`in`)\n val n = scan.nextInt()\n if (n % 2==0 && n!=1) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "3fee756c6d9dff297af19e301a5bd1e4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "91811e640616e72ffb37c6a114e14c76", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7948717948717948, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "fun main(args: Array) {\n\n val a = readLine()!!.toInt()\n if ( a % 2 == 0 ) {\n println(\"YES\")\n }\n else {\n println(\"NO\")\n }\n\n}\n\n\n", "lang": "Kotlin", "bug_code_uid": "27e36011014fbf0d0bc9eb273cb7e9f1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "df690a646e69e87037c2b6f719f3196d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9382047812359043, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "import java.io.BufferedReader\nimport java.io.IOException\nimport java.io.InputStreamReader\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.*\nfun main() {\n val fs = CodeForces.FastReader()\n var n = fs.nextInt()\n var ans =0\n var a = ArrayList()\n for (i in 1..n) {\n for (j in 1..n) {\n for (k in 1..n) {\n var sum = i+j+k\n var max = max(max(i,j),k)\n var min = min(min(i,j),k)\n if(i xor j xor k == 0 && sum - max > max && sum - max - 2*min < max && !a.contains(i+j+k)){\n ans++\n a.add(i+j+k)\n }\n }\n }\n }\n println(ans)\n}\n\nclass CodeForces {\n internal class FastReader {\n private var br: BufferedReader = BufferedReader(InputStreamReader(System.`in`))\n private var st: StringTokenizer? = null\n\n operator fun next(): String {\n while (st == null || !st!!.hasMoreElements()) {\n try {\n st = StringTokenizer(br.readLine())\n } catch (e: IOException) {\n e.printStackTrace()\n }\n\n }\n return st!!.nextToken()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n\n fun nextLine(): String {\n var str = \"\"\n try {\n str = br.readLine()\n } catch (e: IOException) {\n e.printStackTrace()\n }\n return str\n }\n\n fun readIntArray(n: Int): IntArray {\n val a = IntArray(n)\n for (i in 0 until n) a[i] = nextInt()\n return a\n }\n\n fun readLongArray(n: Int): LongArray {\n val a = LongArray(n)\n for (i in 0 until n) a[i] = nextLong()\n return a\n }\n\n fun readDoubleArray(n: Int): DoubleArray {\n val a = DoubleArray(n)\n for (i in 0 until n) a[i] = nextDouble()\n return a\n }\n }\n}\n", "lang": "Kotlin", "bug_code_uid": "2cdfb50bf41bd5d7c608097073f5d4ec", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "ba5c1e2f3698a4c55f2c09efb82991aa", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9296094459582198, "equal_cnt": 17, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 8, "fix_ops_cnt": 16, "bug_source_code": "import java.io.BufferedReader\nimport java.io.IOException\nimport java.io.InputStreamReader\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.*\nfun main() {\n val fs = CodeForces.FastReader()\n var n = fs.nextInt()\n var ans =0\n var a = ArrayList()\n for (i in 1..n) {\n for (j in i..n) {\n var k = i xor j\n var sum = i+j+k\n var max = max(max(i,j),k)\n var min = min(min(i,j),k)\n if(k in 1..n && sum - max > max && sum - max - 2*min < max && !a.contains(i+j+k)){\n ans++\n a.add(i+j+k)\n break;\n }\n }\n }\n println(ans)\n}\n\nclass CodeForces {\n internal class FastReader {\n private var br: BufferedReader = BufferedReader(InputStreamReader(System.`in`))\n private var st: StringTokenizer? = null\n\n operator fun next(): String {\n while (st == null || !st!!.hasMoreElements()) {\n try {\n st = StringTokenizer(br.readLine())\n } catch (e: IOException) {\n e.printStackTrace()\n }\n\n }\n return st!!.nextToken()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n\n fun nextLine(): String {\n var str = \"\"\n try {\n str = br.readLine()\n } catch (e: IOException) {\n e.printStackTrace()\n }\n return str\n }\n\n fun readIntArray(n: Int): IntArray {\n val a = IntArray(n)\n for (i in 0 until n) a[i] = nextInt()\n return a\n }\n\n fun readLongArray(n: Int): LongArray {\n val a = LongArray(n)\n for (i in 0 until n) a[i] = nextLong()\n return a\n }\n\n fun readDoubleArray(n: Int): DoubleArray {\n val a = DoubleArray(n)\n for (i in 0 until n) a[i] = nextDouble()\n return a\n }\n }\n}\n", "lang": "Kotlin", "bug_code_uid": "249a2c82f8f8dcdbb974100356a7cd15", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "ba5c1e2f3698a4c55f2c09efb82991aa", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9964028776978417, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val r = System.`in`.bufferedReader()\n val s = StringBuilder()\n val n = r.readLine()!!.toInt()\n var (a, b, c) = r.readLine()!!.split(\" \").map { it.toInt() }.sorted()\n var ans = 0\n while (a+b<=c){\n a++\n ans++\n }\n println(ans)\n}", "lang": "Kotlin", "bug_code_uid": "d926829d27d4040ddef1bf0dca261564", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "7df2cef473e1b5af01d45fe48d39f140", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.954337899543379, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array) {\n val (a, b, max) = Scanner(System.`in`).use {\n listOf(it.nextInt(), it.nextInt(), it.nextInt()).sorted()\n }\n\n println(if (max >= a + b) max - a - b + 1 else 0)\n}", "lang": "Kotlin", "bug_code_uid": "38a101ce431af91334be864285bed3a8", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "7e25760ff90221be9642a145ad08e9ad", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.31216361679224974, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "/**\n *\n */\n\nfun main(args: Array) {\n val stdin_args = readLine()!!.split(\" \").map { it.toInt() }\n val totalTrips = stdin_args[0]\n val seasonTicketSize = stdin_args[1]\n val oneTripCost = stdin_args[2]\n val seasonTicketCost = stdin_args[3]\n\n if(seasonTicketCost.toDouble() / seasonTicketSize.toDouble() > 1){\n val totalSeasonTickets = totalTrips / seasonTicketSize;\n val totalOneTripTickets = totalTrips % seasonTicketSize;\n println(totalSeasonTickets * seasonTicketCost + totalOneTripTickets * oneTripCost);\n } else {\n println(totalTrips * oneTripCost)\n }\n}", "lang": "Kotlin", "bug_code_uid": "e90991c7e522ce6ca5a567e95bf56f69", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "1d3a41e951e1a728e2a053b817fe6ad8", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9957264957264957, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import kotlin.math.min\n\nfun main(args: Array) {\n\n val (n, m, np, mp) = readLine()!!.split(' ').map(String::toInt)\n println(if ((n * np) <= mp) n * np else min((((n / m) * mp) + ((n % m) * np)), (((n / m) * mp) + mp)))\n\n}", "lang": "Kotlin", "bug_code_uid": "0e25e4520f2c6ed2f1964cab7807205a", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "977a8ae1804e9dd6447c48a84629d84c", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8728546409807355, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "import java.io.PrintWriter\nimport kotlin.math.*\n\nfun main() {\n io.apply {\n\n val n = int\n val multiride = int\n val cost1 = int\n val costmulty = int\n\n val costBy1 = cost1 * n\n val costBy2 = costmulty * (n / multiride) + cost1 * (n % multiride)\n cout .. min(costBy1, costBy2) .. nl\n\n\n }.cout.flush()\n}\n\n// @formatter:off\nprivate val io = object {\n private val `in` = System.`in`\n private fun ll(): Long {\n var x: Int; var q = false; var n = 0L; do x = `in`.read() while (x < 33); if (x == 45) { q = true; x = `in`.read() }\n do { n = n * 10 - x + 48; x = `in`.read() } while (x > 32); return if (q) n else -n\n }\n val int get() = ll().toInt(); val long get() = ll()\n fun ints(n: Int = int): IntArray { return IntArray(n) { int } }\n fun ints1(n: Int = int): IntArray { return IntArray(n) { int - 1 } }\n val cout = PrintWriter(System.out); val nl = \"\\n\"\n operator fun PrintWriter.rangeTo(a: Int): PrintWriter { print(a); print(\" \"); return this }\n operator fun PrintWriter.rangeTo(a: Long): PrintWriter { print(a); print(\" \"); return this }\n operator fun PrintWriter.rangeTo(a: IntArray): PrintWriter { a.forEach { print(it); print(\" \") }; return this }\n operator fun PrintWriter.rangeTo(a: String): PrintWriter { write(a); return this }\n} // @formatter:on\n\n/* ----------- */\n\n", "lang": "Kotlin", "bug_code_uid": "d15cf82828b9accb966530a0d2e96f61", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "b2dab777d9fd07426b359aad1f8bb00a", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9944050727340544, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.io.PrintWriter\nimport java.lang.StringBuilder\nimport java.util.*\n\nfun PrintWriter.solve(sc: FastScanner) {\n val n = sc.nextInt()\n val m = sc.nextInt()\n val adj = Array(n) { mutableSetOf() }\n for (i in 0 until m) {\n val u = sc.nextInt() - 1\n val v = sc.nextInt() - 1\n adj[u].add(v)\n adj[v].add(u)\n }\n if (n <= 6) {\n println(m)\n } else {\n var max = 0\n for (i in 0 until n) {\n for (j in adj[i]) {\n val count = m - adj[i].intersect(adj[j]).count()\n max = Math.max(max, count)\n }\n }\n println(max)\n }\n}\n\nfun main(args: Array) {\n val writer = PrintWriter(System.out, false)\n writer.solve(FastScanner(System.`in`))\n writer.flush()\n}\n\nclass FastScanner(s: InputStream) {\n private var st = StringTokenizer(\"\")\n private val br = BufferedReader(InputStreamReader(s))\n\n fun next(): String {\n while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())\n\n return st.nextToken()\n }\n\n fun nextInt() = next().toInt()\n fun nextLong() = next().toLong()\n fun nextLine() = br.readLine()\n fun nextDouble() = next().toDouble()\n fun ready() = br.ready()\n}\n", "lang": "Kotlin", "bug_code_uid": "7dfe03f8821cb80d2d60d3edc32a4e58", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "bb7df0e7279795e4da9d436ec9138123", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.3080568720379147, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "fun main(args: Array) {\n var w:Int = null\n divideWatermelon(w)\n}\n\nfun divideWatermelon(w:Int):String{\n var res:String = \"NO\"\n if(w % 2 == 0){\n res = \"YES\"\n }\n return res\n}", "lang": "Kotlin", "bug_code_uid": "308bb1fdddbeecfa8f4edc1b0cd7acf0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "42c2e20ce0420ce71f62775ee64a4b45", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.703030303030303, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "import java.util.*\n \nfun main(args: Array) {\n var w: Int\n val sc = Scanner(System.`in`)\n \n w = sc.nextInt()\n \n print(divideWatermelon(w))\n}\n \nfun divideWatermelon(w:Int):String{\n if(w % 2 == 0){\n return \"YES\"\n }else{\n return \"NO\"\n }\n}", "lang": "Kotlin", "bug_code_uid": "bfa5e3e9f7e3e07723eb483f50b4e7bb", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "42c2e20ce0420ce71f62775ee64a4b45", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9714285714285714, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n val w = readLine()?.toInt()\n w?.let {\n if ((w / 2) % 2 == 0) {\n print(\"YES\")\n } else {\n print(\"NO\")\n }\n }\n}", "lang": "Kotlin", "bug_code_uid": "b0f6b25d7c5a5628791205d14e9ef888", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "336d56449e9e6b9a5cedec171853ab7e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8481262327416174, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "/* package whatever; // don't place package name! */\n\nimport java.util.Scanner\n\nfun main() {\n val reader = Scanner(System.`in`)\n var integer:Int = reader.nextInt()\n if(integer %2==0){\n println(\"YSE\")\n }else{\n println(\"NO\")\n }\n \n}", "lang": "Kotlin", "bug_code_uid": "2276d2ed8bcc2607ef7075f16dd3e254", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "10eeaf672a3cc1880e8a54109fa52df3", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.770764119601329, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "Zimport java.util.Scanner\n\nfun main() {\n // Creates an instance which takes input from standard input (keyboard)\n val reader = Scanner(System.`in`)\n // nextInt() reads the next integer from the keyboard\n var integer:Int = reader.nextInt()\n if(integer %2==0 && integer !=2){\n println(\"YES\")\n }else{\n println(\"No\")\n }\n \n}", "lang": "Kotlin", "bug_code_uid": "65cb8f8f24cb0febf96493cafcfdb71e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "10eeaf672a3cc1880e8a54109fa52df3", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8033126293995859, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "fun checker(weight: Int): String {\n val w = weight / 2.0;\n return if (w % 2.0 == 0.0)\n \"YES\"\n else\n \"NO\"\n}\n\nfun main(args: Array) {\n val cases: Int = readLine()!!.toInt()\n println(checker(cases))\n}", "lang": "Kotlin", "bug_code_uid": "ecbbcd43fd06ac25b58a371d28fe3e6d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cd20aaa2236d603c0539332d21834763", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9849462365591398, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun checker(weight: Int): String =\n when {\n weight == 2 -> \"No\"\n weight % 2 == 0 -> \"YES\"\n else -> \"NO\"\n }\n\nfun main(args: Array) {\n val cases: Int = readLine()!!.toInt()\n checker(cases)\n}", "lang": "Kotlin", "bug_code_uid": "eb64ab62351a0f207b60805b19b0183a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cd20aaa2236d603c0539332d21834763", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9430379746835443, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array){\n val s = readLine()!!\n\n if (s.toInt() % 2 == 0){\n print(\"YES\")\n } else {\n print(\"NO\");\n }\n\n}", "lang": "Kotlin", "bug_code_uid": "84c94353fbe1678250583be84a3165df", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "83ea99fadedb6df050c3977b3ad6b42c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7637130801687764, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": " \n\nfun main() { \n \n val scan = Scanner(System.`in`)\n\n val w = scan.nextLine().trim().toInt()\n \n if(w < 1 || w > 100) {\n println(\"NO\")\n }\n if (w.mod(2)==0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "a041e741fc4f0b78b6977f569980b20f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f90355c50abd78cd0fb3c2e2e7900dc0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9797752808988764, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() { \n \n \n val w:Int = readLine()!!.toInt() \n if(w < 1 || w == 2 || w > 100) {\n println(\"NO\")\n }\n if (w.rem(2)==0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n \n \n}", "lang": "Kotlin", "bug_code_uid": "ffd174e920e5db16f35707c181ca2797", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f90355c50abd78cd0fb3c2e2e7900dc0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9761904761904762, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n val sc = Scanner(System.`in`)\n val a = sc.nextInt()\n println(if (a % 2 != 0 && a > 3) \"NO\" else \"YES\")\n}\n\n", "lang": "Kotlin", "bug_code_uid": "fad014664c5234346a6b6487bf6fe438", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c243359e972b2764920c58840d232150", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7804878048780488, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "import java.utils.*\n\nfun main(args: Array){\n val scan = Scanner(System.`in`)\n if((scan.nextInt % 2) == 0) print(\"yes\")\n}", "lang": "Kotlin", "bug_code_uid": "30ce37b2be6dd22abd0b7f9da4ea73cf", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6da12661549fac16ebab785626282e40", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8685714285714285, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import java.util.*\n\nfun main(args: Array){\n val scan = Scanner(System.`in`)\n if((scan.nextInt() % 2) == 0) print(\"YES\")\n else print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "1f9abccf425cc71c57f01391abd4dfc8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6da12661549fac16ebab785626282e40", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7715736040609137, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "val n = readLine()!!.toInt();\n\nif (n%2 == 0) {\n print(\"YES\")\n} else {\n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "48468fbcb51b979e680bb19e90e8f198", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f9354a0ca9817d7cf4c74690b69dfb08", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9560975609756097, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val n = readLine()!!.toInt();\n\n if (n%2 == 0) print(\"YES\") else print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "893ba3c022e0a2b4e41b2eebb2bec48a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f9354a0ca9817d7cf4c74690b69dfb08", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.6381322957198443, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "fun main(args: Array) {\n \n println(if (args[0].toInt() % 2 == 0) \"YES\" else \"NO\") \n}", "lang": "Kotlin", "bug_code_uid": "240f29b669a477295d830113e3583678", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "43000b64a637754ce2584fe480d7d219", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9936708860759493, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\nfun main(args: Array) = with(Scanner(System.`in`)) {\n val x = nextInt\n println( if (x % 2 == 0 && x != 2) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "d07002d60885b9bc814d9ab1023edc1b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "43000b64a637754ce2584fe480d7d219", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8639455782312925, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import java.util.*\nfun main(args: Array) = with(Scanner(System.`in`)) {\n println( if (nextInt() % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "afcbc77f3bfc0aa40c8c99db1e3683ee", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "43000b64a637754ce2584fe480d7d219", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.7492260061919505, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun watermelons(melons: Int){\n if (melons % 2 == 0){\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "444ea89f404041fc225d18b3cb982687", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2b306f8d42cb5d0c12b0447f155fd8b4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9641025641025641, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun watermelons(melons: Int){\n if (melons % 2 == 0){\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}\n\nfun main(){\n val a = readLine()!!.toInt()\n watermelons(a)\n}", "lang": "Kotlin", "bug_code_uid": "96ba4e0e1173e7cf8ef15439d9c81e88", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2b306f8d42cb5d0c12b0447f155fd8b4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8717948717948718, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "import java.util.Scanner\nfun main(args: Array) {\n val reader = Scanner(System.`in`)\n var w:Int = reader.nextInt();\n when(w % 2 ) {\n 0->print(\"YES\")\n else->print(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "d0b5a7ae997a306b50807028fcf8771b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "00bd12bfcf3223b46c44c6b23ab4f028", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9948717948717949, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val n = readLine()!!.toInt()\n\n for (i in 2 until n step 2) {\n if (n - i % 2 == 0) {\n println(\"YES\")\n return\n }\n }\n\n println(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "51485924e27fddb0e26274c93e1db69c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2dadcf504866729f0cc4016217b0b337", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7173489278752436, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "/**\n * https://codeforces.com/problemset/problem/4/A\n *\n *\n */\n\nfun main(args: Array) {\n val input = args[0]\n val n = input.toInt()\n if (n % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "ed5dea8031c13c74fb7be37b5542bd77", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2bff294e6158ebcf1bc0f4b677bba10b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9818181818181818, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/**\n * https://codeforces.com/problemset/problem/4/A\n *\n *\n */\n\nfun main(args: Array) {\n var n = 0\n val input = readLine()\n input?.let {\n n = it.toInt()\n }\n if (n % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "b6c6bc24a08d87080e20d07a97230476", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2bff294e6158ebcf1bc0f4b677bba10b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8294573643410853, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "fun main(){\n var w:Integer\n if(w % 2 == 0 ){\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "3e8d5dc0f7378ef89c29f9731cd297e9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7d929ce974f8c1d25252de203c03ebfc", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8110236220472441, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun main(){\n var w = 5\n if(w % 2 == 0 ){\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "70417a1ea6d2ae52e8dfc6bd3d6083ac", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7d929ce974f8c1d25252de203c03ebfc", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9723756906077348, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "private fun readInt() = readLn().toInt()\nfun main() {\n var wegiht = readInt();\n if(wegiht != 2 || wegiht % 2 == 0) \n println(\"YES\");\n else \n println(\"NO\");\n}", "lang": "Kotlin", "bug_code_uid": "9cc19f1606348deac440ebed001f5ea0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9a14909bf71f2149eb71e34ce8891a8c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9578544061302682, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "fun main() = readInt().let { println((it > 2 && it % 2 == 0) ? \"YES\" : \"NO\") }\n\nprivate fun readInt() = readLine()?.toInt() ?: 0", "lang": "Kotlin", "bug_code_uid": "c750ef7c2f8be553106d8b32b029537c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "76f04b96c01e91a227764596ce6b783b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8770949720670391, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "//package com.tramsun.codeforces\n\nimport java.util.*\n\nval scan = Scanner(System.`in`)\n\nfun main(args: Array) {\n\n val w = scan.nextInt()\n\n println(if(w%2 ==0) \"YES\" else \"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "5f5b507586f2a8cc7e811b607f77915d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "1e5da4aaefc8db61431774e659421b75", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9876948318293683, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\nfun odd(num: Int): Boolean {\n return num % 2 == 0\n}\n\nfun solution(weight: Int): Boolean {\n var firstWeight: Int = 0\n var secondWeight: Int = weight\n for (w in 0 until weight) {\n firstWeight++\n secondWeight--\n if (odd(firstWeight) && odd(secondWeight)) {\n return true\n }\n }\n return false\n}\n\nfun main(args: Array) {\n val reader = BufferedReader(InputStreamReader(System.`in`))\n val weight: Int = reader.readLine().toInt()\n println(if (solution(weight)) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "982e52cb482a294017b87242c5bdfef3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "05f960a0940c4a82a7cd6dff8ee0372b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9673826571201273, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\nfun odd(num: Int): Boolean {\n return num % 2 == 0\n}\n\nfun solution(weight: Int): Boolean {\n var firstWeight: Int = 0\n var secondWeight: Int = weight\n for (w: Int in 1 until weight) {\n firstWeight++\n secondWeight--\n if (odd(firstWeight) && odd(secondWeight)) {\n return true\n }\n }\n return false\n}\n\nfun main(args: Array) {\n val reader = BufferedReader(InputStreamReader(System.`in`))\n while (true) {\n val weight: Int = reader.readLine().toInt()\n println(if (solution(weight)) \"YES\" else \"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "d8921e7a1e19f49b7b188d13805e659c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "05f960a0940c4a82a7cd6dff8ee0372b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9743589743589743, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val weight = readLine()!!.toInt()\n println(if (weight % 2 == 0 || weight == 2) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "3cb4fe577ab5b380e8341f516af5769e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a32c9a34f98e9ede037b47ef6b052619", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9453551912568307, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\nfun main(args: Array) {\n\tval line = readLine()!!\n\tval weight = line.toInt()\n\tval isEvenWeight = weight % 2 == 0 && weight > 2\n\tif () println(\"YES\") else println(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "f8a5c0fb22ed0786e0f2b2d572d88a02", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "89e34e778e5b24bc233968e9d0f684d0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.6755852842809364, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "\nfun main(args: Array) {\n\tval x = args[0]\n\tif (x.toInt() % 2 == 0) println(\"YES\") else println(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "0521d31b15a9b0b85042262017a99650", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "89e34e778e5b24bc233968e9d0f684d0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8905472636815921, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "\nfun main(args: Array) {\n\tval line = readLine()!!\n\tval weight = line.toInt()\n\tval isEvenParts = (2 until weight).filter { weight % it == 0 }.size >= 2\n\tif (isEvenParts) println(\"YES\") else println(\"NO\")\n}\n", "lang": "Kotlin", "bug_code_uid": "a854161665c6f0976e1a396bf41f5bb8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "89e34e778e5b24bc233968e9d0f684d0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.6066066066066066, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "fun main(args: Array) {\n if (args.size > 0) {\n val kg = args[0].toInt()\n val answer = if (kg % 2 == 0) \"YES\" else \"NO\"\n print(answer) \n }\n \n}", "lang": "Kotlin", "bug_code_uid": "abc522f4b44020699df808682ba42c15", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a389c4b73908664e4d3c1e3217f1aea9", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.7373737373737373, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "fun main(args: Array) {\n\tval i = args[0].toInt()\n println(if (i % 4 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "b136a582190fc5f4126a9e0a8edbaaaf", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e35bb3302a23f693efb3826d16bd0c4a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8604651162790697, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n\tval i = readInt()!!\n\tprintln(if (i % 4 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "8a102dae736b67c58aa20216433ed147", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e35bb3302a23f693efb3826d16bd0c4a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9502762430939227, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n\tval i = readLine()!!.toInt()\n\tprintln(if (i % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "2a1fece67de922b66783f5186565ce78", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e35bb3302a23f693efb3826d16bd0c4a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7274190663566447, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\nimport java.util.NoSuchElementException\nimport java.io.IOException\nimport java.io.PrintWriter\nimport java.math.BigInteger\nimport java.util.PriorityQueue\nimport java.util.Arrays\nimport java.util.ArrayList\n\n\nvar sc = FastScanner()\nvar pw = PrintWriter(System.out)\n\nfun main(args: Array) {\n var _X = sc.nextLong()\n var _Y = sc.nextLong()\n var _L = sc.nextLong()\n var _R = sc.nextLong()\n\n var X = BigInteger(_X.toString())\n var Y = BigInteger(_Y.toString())\n var L = BigInteger(_L.toString())\n var R = BigInteger(_R.toString())\n\n var set:MutableSet = mutableSetOf()\n var XX = BigInteger(\"1\")\n for(a in 0..64) {\n if(R < XX) break\n var YY = BigInteger(\"1\")\n for(b in 0..64) {\n if(R < XX) break\n if(L <= XX + YY && XX + YY <= R) {\n var x = (XX + YY).toLong()\n set.add(x)\n }\n YY *= Y\n }\n XX *= X\n }\n\n set = set.toSortedSet()\n var ans = 0L\n var pre = -1L\n for(i in set.sorted()) {\n if(0 <= pre) ans = Math.max(ans, i - pre - 1)\n pre = i\n }\n ans = Math.max(ans, set.first() - _L)\n ans = Math.max(ans, _R - set.last())\n println(ans)\n}\n\n\n\n\n\n\n\n\n\ninternal class MinCostFlow(var N: Int// \u9802\u70b9\u6570\n) {\n val INF = 1 shl 29\n var graph: ArrayList>\n\n init {\n this.graph = ArrayList>()\n for (i in 0..N - 1) {\n graph.add(ArrayList())\n }\n }\n\n fun addEdge(from: Int, to: Int, cap: Int, cost: Int) {\n graph[from].add(Edge(to, cap, cost, graph[to].size))\n graph[to].add(Edge(from, 0, -cost, graph[from].size - 1))\n }\n\n fun minCostFlow(start: Int, goal: Int, flow: Int): Int {\n var flow = flow\n val prevNode = IntArray(N)\n val prevEdge = IntArray(N)\n val potential = IntArray(N)// \u30dd\u30c6\u30f3\u30b7\u30e3\u30eb\uff08\u65e2\u306b\u304b\u304b\u3063\u305f\u30b3\u30b9\u30c8\uff09\n var totalCost = 0\n while (flow > 0) {\n val dist = IntArray(N)\n Arrays.fill(dist, INF)\n dist[start] = 0\n\n val priorityQueue = PriorityQueue()\n priorityQueue.offer(Node(0, start))\n while (!priorityQueue.isEmpty()) {\n // \u30ad\u30e5\u30fc\u304b\u30891\u756a\u8ddd\u96e2\u306e\u8fd1\u3044\u30ce\u30fc\u30c9\u3092\u53d6\u308a\u51fa\u3059\n val node = priorityQueue.poll()\n val v = node.id\n if (dist[v] < node.dist) {\n // \u66ab\u5b9a\u306e\u6700\u77ed\u8ddd\u96e2\u3088\u308a\u3082\u9060\u304b\u3063\u305f\u3089\u30b9\u30eb\u30fc\n continue\n }\n\n for (i in 0..graph[v].size - 1) {\n val e = graph[v][i]\n\n if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + potential[v] - potential[e.to]) {\n dist[e.to] = dist[v] + e.cost + potential[v] - potential[e.to]\n priorityQueue.add(Node(dist[e.to], e.to))\n\n // \u76f4\u524d\u306e\u7d4c\u8def\u3092\u8a18\u61b6\u3057\u3066\u304a\u304f\n prevNode[e.to] = v\n prevEdge[e.to] = i\n }\n }\n }\n\n // \u305d\u3082\u305d\u3082\u30b4\u30fc\u30eb\u307e\u3067\u8fbf\u308a\u3064\u3051\u306a\u3044\u5834\u5408\u306f\u3069\u3046\u3057\u3088\u3046\u3082\u306a\u3044\n if (dist[goal] == INF) {\n return -1\n }\n\n // \u4eca\u56de\u304b\u304b\u3063\u305f\u30b3\u30b9\u30c8\u3092\u30e1\u30e2\u3057\u3066\u304a\u304f\n for (v in 0..N - 1) {\n potential[v] += dist[v]\n }\n\n // start\u304b\u3089goal\u307e\u3067\u6d41\u305b\u308b\u3060\u3051\u6d41\u3059\n var minFlow = flow\n run {\n var now = goal\n while (now != start) {\n minFlow = Math.min(minFlow, graph[prevNode[now]][prevEdge[now]].cap)\n now = prevNode[now]\n }\n }\n flow -= minFlow\n totalCost += minFlow * potential[goal]\n\n var now = goal\n while (now != start) {\n val edge = graph[prevNode[now]][prevEdge[now]]\n edge.cap -= minFlow\n graph[now][edge.rev].cap += minFlow\n now = prevNode[now]\n }\n }\n return totalCost\n }\n\n internal inner class Node(var dist: Int, var id: Int) : Comparable {\n\n override fun compareTo(o: Node): Int {\n return this.dist - o.dist\n }\n }\n\n internal inner class Edge(var to: Int, var cap: Int, var cost: Int, var rev: Int)\n}\n\n\n\n\n\n\n\nclass FastScanner {\n private val `in` = System.`in`\n private val buffer = ByteArray(1024)\n private var ptr = 0\n private var bufferLength = 0\n\n private fun hasNextByte(): Boolean {\n if (ptr < bufferLength) {\n return true\n } else {\n ptr = 0\n try {\n bufferLength = `in`.read(buffer)\n } catch (e: IOException) {\n e.printStackTrace()\n }\n\n if (bufferLength <= 0) {\n return false\n }\n }\n return true\n }\n\n private fun readByte(): Int {\n if (hasNextByte())\n return buffer[ptr++].toInt()\n else\n return -1\n }\n\n private fun isPrintableChar(c: Int): Boolean {\n return 33 <= c && c <= 126\n }\n\n private fun skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr].toInt())) ptr++\n }\n\n internal operator fun hasNext(): Boolean {\n skipUnprintable()\n return hasNextByte()\n }\n\n operator fun next(): String {\n if (!hasNext()) throw NoSuchElementException()\n val sb = StringBuilder()\n var b = readByte()\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b)\n b = readByte()\n }\n return sb.toString()\n }\n\n internal fun nextLong(): Long {\n if (!hasNext()) throw NoSuchElementException()\n var n: Long = 0\n var minus = false\n var b = readByte()\n if (b == '-'.toInt()) {\n minus = true\n b = readByte()\n }\n if (b < '0'.toInt() || '9'.toInt() < b) {\n throw NumberFormatException()\n }\n while (true) {\n if ('0'.toInt() <= b && b <= '9'.toInt()) {\n n *= 10\n n += (b - '0'.toInt()).toLong()\n } else if (b == -1 || !isPrintableChar(b)) {\n return if (minus) -n else n\n } else {\n throw NumberFormatException()\n }\n b = readByte()\n }\n }\n\n internal fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n\n internal fun nextDoubleArray(n: Int): DoubleArray {\n val array = DoubleArray(n)\n for (i in 0..n - 1) {\n array[i] = nextDouble()\n }\n return array\n }\n\n internal fun nextDoubleMap(n: Int, m: Int): Array {\n val map = arrayOfNulls(n)\n for (i in 0..n - 1) {\n map[i] = nextDoubleArray(m)\n }\n return map\n }\n\n fun nextInt(): Int {\n return nextLong().toInt()\n }\n\n fun nextIntArray(n: Int): IntArray {\n val array = IntArray(n)\n for (i in 0..n - 1) {\n array[i] = nextInt()\n }\n return array\n }\n}", "lang": "Kotlin", "bug_code_uid": "53a332eb6e137e0ad39fc200db17b790", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "97520dcc7ca13d900c08906f0ea9f256", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9960536700868192, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val r = System.`in`.bufferedReader()\n val s = StringBuilder()\n val l = r.readLine()!!.toInt()\n //val time = r.readLine()!!.split(\" \").map { it.toInt() }.sorted()\n val str = r.readLine()!!.split(\"\").filter { it.length > 0 }.map {\n when (it) {\n \"0\" -> \"\"\n \"1\" ->\"\"\n \"2\" -> \"2\"\n \"3\" -> \"3\"\n \"4\" -> \"322\"\n \"5\" -> \"5\"\n \"6\" -> \"35\"\n \"7\" -> \"7\"\n \"8\" -> \"2227\"\n else -> \"9\"\n }\n }.joinToString(\"\").split(\"\").filter { it.length>0 }.sortedDescending()\n println(str.joinToString(\"\"))\n}", "lang": "Kotlin", "bug_code_uid": "9ff7463c5c94a15859c0b5fd37f29bfb", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "553076ab87ba771284d2c8a077aaa82f", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9591666666666666, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "import java.io.PrintWriter\nimport java.util.StringTokenizer\n\nfun main() {\n\n val map = mapOf('2' to intArrayOf(2),\n '3' to intArrayOf(3),\n '4' to intArrayOf(3,2,2),\n '5' to intArrayOf(5),\n '6' to intArrayOf(5,3,3,2,2),\n '7' to intArrayOf(7,5,3,3,2,2),\n '8' to intArrayOf(7,5,3,3,2,2,2,2,2),\n '9' to intArrayOf(7,5,3,3,3,3,2,2,2))\n\n fun PrintWriter.solve(){\n val n = nextInt()\n var s = next()\n\n var ans = mutableListOf()\n for (c in s){\n if (c in map){\n for (i in map[c]!!)ans.add(i)\n }\n }\n\n ans.sortDescending()\n ans.forEach { print(it)}\n\n }\n\n\n writer.solve()\n writer.flush()\n\n\n}\n\n\nprivate val reader = System.`in`.bufferedReader()\nprivate val writer = PrintWriter(System.out, false)\n\nprivate var tokenizer: StringTokenizer = StringTokenizer(\"\")\n\nprivate fun next(): String {\n while (tokenizer.hasMoreTokens().not()) tokenizer = StringTokenizer(reader.readLine())\n return tokenizer.nextToken()\n}\n\nprivate fun nextInt() = next().toInt()\nprivate fun nextLong() = next().toLong()\nprivate fun nextDouble() = next().toDouble()\nprivate fun nextLine() = reader.readLine()\n\n", "lang": "Kotlin", "bug_code_uid": "4cf1e9cc2b5f84610c7b891ea0a1527f", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "7ea9cdd7458a4f8b757ff332df951827", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.6611706512778236, "equal_cnt": 26, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 16, "fix_ops_cnt": 25, "bug_source_code": "// 7/30/2020 3:10 PM\n\n//package p515\n\nprivate fun readLn() = readLine()!! // string line\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\n\nfun main() {\n readInt()\n val n = readInt().toLong()\n printMaxInteger(n)\n}\n\nfun printMaxInteger(n: Long) {\n var num = n\n val allFactors = mutableListOf()\n while (num > 0) {\n allFactors.addAll(getFactors(num % 10))\n num /= 10\n }\n\n allFactors.sorted().reversed().forEach{ print(it) }\n println()\n}\n\nfun getFactors(n: Long) : List {\n val result = mutableListOf()\n var num = n\n for (div in 2..n) {\n if (num < 2)\n break\n while (num % div == 0L) {\n num /= div\n result.add(div)\n }\n }\n return result\n}", "lang": "Kotlin", "bug_code_uid": "b660039fa210f861f692d30f4160bbe5", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "5cf4d6658d0dc2e95545ffd47d10d3c6", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.6760858189429618, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import java.lang.StringBuilder\n\nprivate fun trim(s: String, base: Char): String {\n val sb = StringBuilder()\n var lastBase = -1\n for (i in 0..s.length) {\n if (i < s.length && s[i] != base)\n continue\n\n if (lastBase < i - 1) {\n val segBase = base + 1\n val seg = trim(s.substring(lastBase + 1, i), segBase)\n if (lastBase == -1 && i == s.length)\n sb.append(seg)\n else {\n val first = seg.indexOfFirst { it != segBase }\n if (first >= 0) {\n val last = seg.indexOfLast { it != segBase }\n sb.append(seg.substring(first, last + 1))\n }\n }\n }\n\n if (i == s.length)\n break\n\n sb.append(base)\n lastBase = i\n }\n\n return sb.toString()\n}\n\nfun main() {\n readLine()\n val s = readLine()!!\n val st = trim(s, s.min()!!)\n println(s.length - st.length)\n}\n", "lang": "Kotlin", "bug_code_uid": "c56ea8c432e3b68ee0f161a061604aa2", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "c9664e582fe040d9414ac315a6cf2c06", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9895035460992908, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "import java.lang.Exception\nimport java.lang.StringBuilder\nimport java.sql.SQLDataException\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.collections.HashMap\nimport kotlin.collections.HashSet\nimport kotlin.math.ceil\nimport kotlin.math.floor\nimport kotlin.math.max\nimport kotlin.math.pow\n\nfun main(args:Array)\n{\n val scanner=Scanner(System.`in`)\n val num=scanner.nextInt()\n var str=scanner.next()\n //str:ab\n if (str.length==1)\n {\n println(0)\n }\n else\n {\n for (i in 0 until num-1)\n {\n var maxi=0\n var canRemove=false\n for (j in str.indices)\n {\n if (j==0)\n {\n if (str[j]-str[j+1]==1&&str[j]>=str[maxi])\n {\n maxi=j\n canRemove=true\n }\n }\n else if(j==str.length-1)\n {\n if (str[j]-str[j-1]==1&&str[j]>=str[maxi])\n {\n maxi=j\n canRemove=true\n }\n }\n else\n {\n if (str[j]-str[j-1]==1||str[j]-str[j+1]==1)\n {\n if (str[j]>=str[maxi])\n {\n maxi=j\n canRemove=true\n }\n }\n }\n }\n if (!canRemove)\n {\n break\n }\n str=str.substring(0,maxi)+str.substring(maxi+1,str.length)\n }\n println(num-str.length)\n }\n\n\n\n //bacabcab\n //cbdbcdbc\n\n}", "lang": "Kotlin", "bug_code_uid": "32b0d6059588521e5d481f8c0f645f29", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "087cb538364aaae58b8dd21176302e32", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7577464788732394, "equal_cnt": 21, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 18, "fix_ops_cnt": 20, "bug_source_code": "import java.util.*\n\n\nfun main() {\n val scan = Scanner(System.`in`)\n\n val n = scan.nextInt()\n scan.nextLine()\n val sb = StringBuilder(scan.nextLine())\n\n solve(sb)\n\n println(n -sb.length)\n}\n\nfun solve(sb: java.lang.StringBuilder) {\n for (c in 'z' downTo 'b') {\n for (i in sb.indices) {\n if(sb[i] == c) {\n if(i > 0 && sb[i-1] == c-1 || i < sb.length && sb[i+1] == c-1) {\n sb.deleteCharAt(i)\n return solve(sb)\n }\n }\n }\n }\n}\n\n\n", "lang": "Kotlin", "bug_code_uid": "74d4a02c3dcac1d9072583f0a4f4c272", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "3d08a2299c6e6d052b61f48195b59c81", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8795013850415513, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "\n\nfun main() {\n readLn()\n val s = readLn()\n val t = s.reduceAdj()\n println(s.length - t.length)\n}\n\ntailrec fun String.reduceAdj(): String =\n when (val improved = removeAdj()) {\n this -> this\n else -> improved.reduceAdj()\n }\n\nfun String.removeAdj(): String = this\n .filterIndexed { i, c -> i == 0 || this[i - 1] != c.prev() }\n .filterIndexed { i, c -> i + 1 == length || c.prev() != this[i + 1] }\n\nfun Char.prev() =\n when (this) {\n 'a' -> '#'\n in 'b'..'z' -> this - 1\n else -> error(\"Unexpected char '$this'\")\n }\n\nfun readLn(): String = readLine() ?: error(\"EOF\")\n", "lang": "Kotlin", "bug_code_uid": "00baa70303fd7eaaeea08386b58bd9ba", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "e35b22f88ed1dfe0d0f218932f09cbb8", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9797517962116263, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n readLine()\n var sS : String = readLine()!!\n var iResult = 0\n for (cToDelete in 'z' downTo 'b') {\n val cPrev = (cToDelete.toInt()-1).toChar()\n var i = 0\n while ((i <= sS.length-1) && (1 < sS.length)) {\n var bToDelete = false\n if (sS[i] == cToDelete) {\n bToDelete = when (i) {\n 0 -> (sS[i+1] == cPrev)\n sS.length-1 -> (sS[i-1] == cPrev)\n else -> (sS[i-1] == cPrev) || (sS[i+1] == cPrev)\n }\n }\n if (bToDelete) {\n sS = sS.removeRange(i,i+1)\n iResult++\n } else {\n i++\n }\n }\n }\n println(iResult)\n}\n", "lang": "Kotlin", "bug_code_uid": "58a7b1711e53f3430699b04b36b34c18", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "d234b85f6eb8c3ec5d0cb37101c24866", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.949166004765687, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main() {\n readLine()\n val listo = LinkedList(readLine()!!.toList())\n val original = listo.size\n for (chara in 'z' downTo 'b') {\n val iterator = listo.listIterator()\n while (iterator.hasNext()) {\n //println(listo)\n if (iterator.next() == chara) {\n iterator.previous()\n if (iterator.hasPrevious()) {\n if (iterator.previous() == chara - 1) {\n iterator.next()\n iterator.next()\n iterator.remove()\n continue\n }\n iterator.next()\n iterator.next()\n } else {\n iterator.next()\n }\n if (iterator.hasNext()) {\n if (iterator.next() == chara - 1) {\n iterator.previous()\n iterator.previous()\n iterator.remove()\n continue\n }\n iterator.previous()\n }\n }\n }\n }\n println(original - listo.size)\n}", "lang": "Kotlin", "bug_code_uid": "1074925d191e9d4750f1d33b536e5290", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "7eccf8e56058e0506bbd93cf4657a879", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8277119416590701, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "fun main() {\n val n = readLine()!!.toInt()\n var a = readLine()!!.toCharArray().map { it.toInt() }\n while ( true ) {\n var x = IntArray( n )\n a.zipWithNext().forEachIndexed { i, (u, v) -> \n if ( u == v + 1 ) x[ i ] = 1\n if ( u == v ) x[ i + 1 ] = x[ i ]\n if ( u + 1 == v ) x[ i + 1 ] = 1\n }\n (a.size-2 downTo 0).forEach { if ( a[ it ] == a[ it + 1 ] && x[ it + 1 ] == 1 ) x[ it ] = 1 }\n if ( x.sum() == 0 ) {\n println( n - a.size )\n break\n }\n a = a.filterIndexed { i, _ -> x[ i ] == 0 }\n }\n}", "lang": "Kotlin", "bug_code_uid": "7faa15a904a686f4cad5b904d4941a03", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "a87b539b48ff072e1d21e5585a65a9af", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.986449864498645, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.util.StringTokenizer\n\nfun main(args: Array) {\n val sc = FastScanner(System.`in`)\n\n val n = sc.nextInt()\n val com = sc.next()\n\n var x = 0\n var y = 0\n for (c in com) {\n when (c) {\n 'U' -> y += 1\n 'D' -> y -= 1\n 'L' -> x -= 1\n 'R' -> x += 1\n }\n }\n\n println(n - x - y)\n\n}\n\n\nclass FastScanner(s: InputStream) {\n private var st = StringTokenizer(\"\")\n private val br = BufferedReader(InputStreamReader(s))\n\n fun next(): String {\n while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())\n\n return st.nextToken()\n }\n\n fun nextInt() = next().toInt()\n fun nextLong() = next().toLong()\n fun nextLine() = br.readLine()\n fun nextDouble() = next().toDouble()\n fun ready() = br.ready()\n}", "lang": "Kotlin", "bug_code_uid": "64608c394d0c382c292f5d0933dcc06f", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "6bca3c1c9b303ab92ad88d922a51da53", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.31610219845513965, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 17, "bug_source_code": "fun main(args: Array) {\n val n = readLine()!!.toInt()\n val steps = readLine()!!\n var stepCount = 0\n for (j in 0..(n - 1)) {\n var x = 0\n var y = 0\n for (i in j..(n - 1)) {\n when (steps[i]) {\n 'L' -> x--\n 'R' -> x++\n 'U' -> y++\n 'D' -> y--\n }\n if (x == 0 && y == 0) if (i + 1 > stepCount) stepCount = i + 1\n }\n }\n println(stepCount)\n\n}\n", "lang": "Kotlin", "bug_code_uid": "1b57451eba0187113a3df89a1ae5085c", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "c3e8263ee23af3c91321e81aae68d300", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9931972789115646, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main(args: Array) =\n\twith(readline()!!.toInt()) {\n\t\tif(this==2) print(\"NO\") else\n\t\tif(this % 2 == 0) print(\"YES\")\n\t\telse print(\"NO\")\n\t}", "lang": "Kotlin", "bug_code_uid": "f7980e00e55161cb19f83a8ef9a8f061", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7a46e7b590b20a37dac3df9ff09f85fc", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5163934426229508, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "fun main(args: Array) {\n val w = readLine()!!.toInt()\n if(w%2==0){\n print(\"TRUE\")\n }\n else\n print(\"FALSE\")\n}\n", "lang": "Kotlin", "bug_code_uid": "9a621bf9d7675e33416dc09f51ddf3a9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f7ef6462ff6be7115566d59ae51a1519", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9696969696969697, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main (args: Array) : Unit\n{\n val sc:Scanner = Scanner(System.`in`)\n var weight = sc.nextInt()\n\n if(weight % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "b615d548bae08162e68adb1f40fdedbb", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "4790af2beab52da4f06c37d619a4f91c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9824046920821115, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.lang.Exception\nimport java.util.*\n\nfun main(args: Array){\n val scanner = Scanner(System.`in`);\n val number = scanner.nextLine();\n try {\n var int = number.toIntOrNull();\n if (int != null) {\n println(if ((int % 2) == 0) \"YES\" else \"NO\")\n }\n } catch (e: Exception){\n };\n}", "lang": "Kotlin", "bug_code_uid": "59492105492444801b8595111cce57d2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "231b4054e94fa18b21fee1004bb8e893", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9096774193548387, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main(args: Array) = with(Scanner(System.`in`)) {\n val n = nextInt()\n if (n%2==0) println(\"YES\");\n else println(\"NO\");\n}\n", "lang": "Kotlin", "bug_code_uid": "f253b21bb222673cf2a992dbd88693f0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "92b03e98def97a8fa19f27d670746dc7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9757575757575757, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main(args: Array) = with(Scanner(System.`in`)) {\n val n = nextInt()\n if (n%2==0) println(\"YES\");\n else println(\"NO\");\n}\n", "lang": "Kotlin", "bug_code_uid": "91c0d9d3beb732e9094e33d2483a0bb3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "92b03e98def97a8fa19f27d670746dc7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9270833333333334, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n val kg = readLine()!!.toInt()\n println(if (kg%4==0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "c112d4e6118e8183aeeb320ae1732242", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6631ede6a73a2db1f619f725b69525a8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8859060402684564, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val sc = Scanner(System.`in`)\n\n var x:Int = readLine()!!.toInt()\n\n if (x%2 == 0 && x > 2)\n println (\"YES\")\n else println (\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "60aa0244eef89564c0202841e2e59379", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "d72f453cfb4d8d0d3f3943b2d6b5b01b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.5, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun main() {\n val w = readLine()!!.toInt()\n if(w % 4 == 0)\n println(\"Yes\")\n else\n println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "c541a24bb0c32303b5f13d375ad533ae", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7eba446401547779f59f06d164f9b5ad", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9539951573849879, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "val w = readLine()!!.toInt()\n if (w % 2 != 0) {\n println(\"NO\")\n } else {\n if (w / 2 >= 2) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n }", "lang": "Kotlin", "bug_code_uid": "785c8b99ddf09652b1ab411eb9f43ea2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7eba446401547779f59f06d164f9b5ad", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9565217391304348, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n var a =readLine()!!.toInt()\n\n if (a%2 == 0){\n println(\"YES\")\n }else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "8de45682e16caa93e36fb5c18aa24c43", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f9c8892ad056f600a234ddc71c0eac05", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9581151832460733, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "package codeforces.com.tasks.task4A\n\nfun main() {\n val weight = readLine()!!.toInt()\n val lastBit = weight shr 32 and 1\n if (lastBit == 0) println(\"YES\") else println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "931446d412cc62273bbb4e2cfad09692", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "20a2515aed156fb9a071fe7f7248bad5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9635416666666666, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//package codeforces.com.tasks.task4A\n\nfun main() {\n val weight = readLine()!!.toInt()\n val lastBit = weight shr 32 and 1\n if (lastBit == 0) println(\"YES\") else println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "8c5c2366ee41625d77881c56f3c5df0e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "20a2515aed156fb9a071fe7f7248bad5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8918918918918919, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\n\nfun main(args: Array) {\n val br = BufferedReader(InputStreamReader(System.`in`))\n\n val points = br.readLine().split(\" \").map(String::toInt)\n\n val middlePoint = points.sum() / 3\n\n val answer = points.map { Math.abs(it - middlePoint) }.sum()\n\n println(answer)\n}\n", "lang": "Kotlin", "bug_code_uid": "bd56e1bdca69e2023636564f513447f9", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "93d9d12d33664d98410b2db6ec6864b9", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7972027972027972, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "import java.util.*\n\nconst val mod = 1000000007\n\nfun main() {\n val s = Scanner(System.`in`)\n val x = s.nextLong()\n val n = s.nextLong()\n\n var ans = 1L\n val primes = getPrimes(x)\n primes.forEach {\n var itt = it\n var cnt = 0L\n while (true) {\n cnt += n / itt\n if (itt <= n / it) // \u5982\u679c\u76f4\u63a5itt*=it\u518d\u5224\u65aditt<=n\u4f1a\u7206Long\n itt *= it\n else\n break\n }\n ans = ans * fpow(it, cnt) % mod\n }\n print(ans)\n}\n\nfun getPrimes(x: Long): Set {\n val primes = HashSet()\n\n var xx = x\n for (it in 2..x) {\n var has = false\n while (xx % it == 0L) {\n xx /= it\n has = true\n }\n if (has)\n primes.add(it)\n }\n return primes\n}\n\nfun fpow(x: Long, n: Long): Long {\n if (n == 0L)\n return 1\n var ans = 1L\n var xx = x % mod\n var nn = n\n while (nn > 1) {\n if (nn % 2 == 1L)\n ans = ans * xx % mod\n nn /= 2\n xx = xx * xx % mod\n }\n return ans * xx % mod\n}", "lang": "Kotlin", "bug_code_uid": "fd770150f6ec1a83c0b547fce5eebade", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "ca8f11698dc3711a0a31e679c5c967fc", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.979253112033195, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "import java.util.*\nimport kotlin.math.sqrt\n\nconst val mod = 1000000007L\n\nfun main() {\n val s = Scanner(System.`in`)\n val x = s.nextLong()\n val n = s.nextLong()\n\n var ans = 1L\n val primes = getPrimes(x)\n primes.forEach {\n var itt = it\n var cnt = 0L\n while (true) {\n cnt += n / itt\n if (itt <= n / it) // \u5982\u679c\u76f4\u63a5itt*=it\u518d\u5224\u65aditt<=n\u4f1a\u7206Long\n itt *= it\n else\n break\n }\n ans = ans * fpow(it, cnt) % mod\n }\n print(ans)\n}\n\nfun getPrimes(x: Long): Set {\n val primes = MutableList(0) { 0L }\n\n val sqrtx = sqrt(x.toDouble()).toLong()\n var xx = x\n var i = 2L\n while (xx in 2..sqrtx + 10) {\n if (xx % i == 0L)\n primes.add(i)\n while (xx % i == 0L)\n xx /= i\n i++\n }\n if (xx > 1)\n primes.add(xx)\n\n return primes.toSet()\n}\nfun fpow(x: Long, n: Long, m: Long = mod): Long {\n if (n == 0L)\n return 1\n var ans = 1L\n var xx = x % mod\n var nn = n\n while (nn > 1) {\n if (nn % 2 == 1L)\n ans = ans * xx % mod\n nn /= 2\n xx = xx * xx % mod\n }\n return ans * xx % mod\n}", "lang": "Kotlin", "bug_code_uid": "5ff825c635991a1a74227cc4e5202080", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "ca8f11698dc3711a0a31e679c5c967fc", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9023423423423423, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStream\nimport java.io.InputStreamReader\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.math.sqrt\n\n\nfun main() {\n val sc = Scanner.sysIn\n\n val x = sc.nextInt()\n val n = sc.nextLong()\n\n val primes = ArrayList()\n\n fun isPrime(k: Int): Boolean {\n if (k == 1) return false\n if (k == 2 || k == 3) return true\n for (i in 2..sqrt(k.toDouble()).toInt() + 1) {\n if (k % i == 0) {\n return false\n }\n }\n return true\n\n }\n\n for (i in 2..sqrt(x.toDouble()).toInt() + 1) {\n if (x % i == 0) {\n if (isPrime(i))\n primes += i\n if (isPrime(x / i))\n primes += x / i\n }\n }\n if (isPrime(x)) primes += x\n\n //primes.forEach { println(it) }\n\n val mod = 1000000007\n fun power(x: Long, p: Long): Long = when {\n p == 0L -> 1\n p == 1L -> x % mod\n p % 2 == 0L -> {\n val cur = power(x, p / 2)\n (cur * cur) % mod\n }\n else -> (power(x, p - 1) * x) % mod\n }\n\n var ans = 1L\n\n for (p in primes) {\n var curP = p.toLong()\n while (n / curP > 0) {\n //println(curP)\n ans = (ans * power(p.toLong(), n / curP)) % mod\n if ((curP * p) / p != curP) break\n curP *= p\n }\n }\n\n println(ans)\n}\n\nclass Scanner(s: InputStream) {\n var st: StringTokenizer? = null\n val br: BufferedReader = BufferedReader(InputStreamReader(s))\n\n operator fun next(): String {\n while (st == null || !st!!.hasMoreTokens())\n st = StringTokenizer(br.readLine())\n return st!!.nextToken()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n fun nextLine(): String {\n return br.readLine()\n }\n\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n\n companion object {\n val sysIn = Scanner(System.`in`)\n }\n\n}\n\nval rnd = Random()\nfun IntArray.sort() {\n val n = this.size\n for (i in 0 until n - 1) {\n val randomPos = i + rnd.nextInt(n - i - 1) + 1\n this[i] = this[i] xor this[randomPos]\n this[randomPos] = this[randomPos] xor this[i]\n this[i] = this[i] xor this[randomPos]\n }\n Arrays.sort(this)\n}\n\nfun LongArray.sort() {\n val n = this.size\n for (i in 0 until n - 1) {\n val randomPos = i + rnd.nextInt(n - i - 1) + 1\n this[i] = this[i] xor this[randomPos]\n this[randomPos] = this[randomPos] xor this[i]\n this[i] = this[i] xor this[randomPos]\n }\n Arrays.sort(this)\n}", "lang": "Kotlin", "bug_code_uid": "c9bace1db9e39b4dffb872b13619876f", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "5fbf64b3ab2432c80d3554b8df48cacf", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9613302397525135, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n val (x, n) = readLongs()\n val primes = primes(x.toInt())\n var result = 1L\n for (prime in primes) {\n var num = n\n var count = 0L\n while (num >= prime) {\n count += num / prime\n num /= prime\n }\n result = (result * pow(prime.toLong(), count)) % 1000000007\n }\n println(result)\n}\n\nfun primes(x: Int): IntArray {\n var num = x\n val result = mutableListOf()\n for (i in 2..x) {\n if (num % i == 0) {\n result.add(i)\n num /= i\n while (num % i == 0) {\n num /= i\n }\n }\n }\n return result.toIntArray()\n}\n\nfun pow(x: Long, n: Long): Long {\n var num = x\n var count = n\n var result = 1L\n while (count > 0) {\n if (count and 1L == 1L) {\n result = (result * num) % 1000000007\n }\n num = (num * num) % 1000000007\n count = count shr 1\n }\n return result\n}\n\nprivate fun readString() = readLine()!!\n\nprivate fun readInt() = readString().toInt()\n\nprivate fun readInts() = readString().split(\" \").map { it.toInt() }\n\nprivate fun readLong() = readString().toLong()\n\nprivate fun readLongs() = readString().split(\" \").map { it.toLong() }\n", "lang": "Kotlin", "bug_code_uid": "35083783695dd2a6c391180eca273c91", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "f74834e28d45368a4561ef8bbd4dc18d", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9675324675324676, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/*\n1. O(n) - count all identical nucleos subsequences lengths and record them by incrementing ith (length of subsequence)\n integer in an array of length 100 of map of nucleos\n2. go from top and increment number of inserts by 1 for each even length until max length is only uneven\n */\n\nprivate const val maxDnaLength = 101\n\nfun main() {\n val dna = readLine()!!\n var currentSequenceLength = 1\n var currentNucleo = dna[0]\n var inserts = 0\n for (i in 1 until dna.length) {\n if (dna[i] != currentNucleo) {\n if (currentSequenceLength % 2 == 0) inserts++\n currentSequenceLength = 1\n currentNucleo = dna[i]\n } else {\n currentSequenceLength++\n }\n }\n println(inserts)\n}", "lang": "Kotlin", "bug_code_uid": "4f6358b8d7f38fe0e4da6f9b0d49fc8d", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "24387d0b0e763540802526b56c086563", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9642346208869814, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\nfun main(args:Array){\n val obj=Scanner(System.`in`)\n val dna=obj.next()\n var status='z'\n var count=1\n var ins=0\n for(c in dna){\n if(c!=status) {\n if(count%2==0)\n ++ins\n count=0\n status=c\n }\n ++count\n }\n println(ins)\n}", "lang": "Kotlin", "bug_code_uid": "78db24a8b768c91535bc960c3dffcbfe", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "035e6cfef7e52765572b0449fdb337c9", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9456066945606695, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\nfun main(args:Array)\n{\n\n var counter = 1\n var insert = 0\n var c = 0.toChar()\n val input = readLine()\n\n input?.forEach {\n if( it == c ) {\n counter++\n }\n else {\n if( counter % 2 == 0 ) insert++\n counter = 1\n c = it\n }\n }\n\n println(insert)\n}\n", "lang": "Kotlin", "bug_code_uid": "72c91c84cba86c006985ea6bfbc510b9", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "7acb28cebad264c02dc07180c0919e4b", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9968573224387178, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "/*\nfun getInt() = readLine()!!.toInt()\nfun getInts() = readLine()!!.split(\" \").map { it.toInt() }\nfun getLong() = readLine()!!.toLong()\nfun getLongs() = readLine()!!.split(\" \").map{ it.toLong()}\nfun getWord() = readLine()!!\nfun getWords() = readLine()!!.split(\" \")\n\n */\n\nfun main()\n{\n var nb_moves = getInt()\n var ball_at = getInt()\n var answer = -1\n nb_moves %= 6\n var balls = intArrayOf(0,0,0)\n balls[ball_at] = 1\n for (i in nb_moves downTo 1)\n {\n if ( i % 2 == 0)\n {\n val curr = balls[2]\n balls[2] = balls[1]\n balls[1] = curr\n }\n else\n {\n val curr = balls[1]\n balls[1] = balls[0]\n balls[0] = curr\n }\n }\n answer = balls.indexOf(1)\n println(answer)\n}", "lang": "Kotlin", "bug_code_uid": "72c42ee988e4cbf64b519be253814a4c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "39eb8eedbce4ce099301994d08680b8b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.998914223669924, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//package codeforces.round401.a\n\nimport java.io.*\nimport java.util.*\n\nfun main(args: Array) {\n val inputStream = System.`in`\n val outputStream = System.out\n val `in` = FastScanner(inputStream)\n val out = PrintWriter(outputStream)\n solve(`in`, out)\n out.close()\n}\n\nprivate fun solve(scanner : FastScanner, out: PrintWriter) {\n val n = scanner.nextLong()\n val x = scanner.nextInt()\n\n val expected = when(x) {\n 0 -> Triple(1, 0, 0)\n 1 -> Triple(0, 1, 0)\n 2 -> Triple(0, 0, 1)\n else -> throw IllegalArgumentException()\n }\n listOf(Triple(1, 0, 0), Triple(0, 1, 0), Triple(0, 0, 1)).forEach {\n val res = simulate(it, n)\n if (res == expected) {\n val pos = it.toList().indexOf(1)\n out.print(pos)\n return\n }\n }\n}\n\nprivate fun simulate(initial: Triple, n: Long): Triple {\n var state = initial\n for (i in 1..n) {\n if (i % 2 == 1L) {\n val temp = state.first\n state = state.copy(first = state.second, second = temp)\n } else {\n val temp = state.third\n state = state.copy(third = state.second, second = temp)\n }\n }\n return state\n}\n\n\nprivate class FastScanner(`in`: InputStream) {\n private var reader: BufferedReader? = null\n private var tokenizer: StringTokenizer? = null\n\n init {\n reader = BufferedReader(InputStreamReader(`in`))\n tokenizer = null\n }\n\n operator fun next(): String {\n if (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n try {\n tokenizer = StringTokenizer(reader!!.readLine())\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n }\n return tokenizer!!.nextToken()\n }\n\n fun nextLine(): String {\n if (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n try {\n return reader!!.readLine()\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n }\n\n return tokenizer!!.nextToken(\"\\n\")\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n}\n\n\n", "lang": "Kotlin", "bug_code_uid": "36e28e910aa030b13d494ada15d3bf21", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "093fbe406705c5c374f98b3e699b2340", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.4035674470457079, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "\nfun main(args : Array) {\n\n val word = readLine()!!\n var list: MutableList = mutableListOf()\n var list1: MutableList = mutableListOf('h','e','l','l','o')\n\n for (char in word) { list.add(char) }\n var i = 0\n if(list[i]=='h' && list[i+1]=='h'){\n while(list[i+1]=='h'){\n list.removeAt(i+1)\n }\n i++\n }\n else{\n i++\n }\n if(list[i]=='e' && list[i+1]=='e'){\n while(list[i+1]=='e'){\n list.removeAt(i+1)\n }\n i++\n }\n else{\n i++\n }\n if(list[i]=='l' && list[i+1]=='l' && list[i+2]=='l'){\n while(list[i+2]=='l'){\n list.removeAt(i+2)\n }\n i++\n }\n else{\n i++\n }\n if(list[i]=='0' && list[i+1]=='0'){\n while(list[i+1]=='0'){\n list.removeAt(i+1)\n }\n }\n if(list.size>=5){\n var r = 0\n for(k in 0..4){\n if(list[k]==list1[k]){\n r++\n }\n }\n if(r==5){\n println(\"YES\")\n }\n else{\n println(\"NO\")\n }\n }\n else{\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "308d79cc8e879e2ac26216cac4d0f9e6", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "a6ece5f164cae8af988809ef6e86611e", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9455645161290323, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\nfun main(args : Array) {\n\n val word = readLine()!!\n var list: MutableList = mutableListOf()\n var list1: MutableList = mutableListOf('h', 'e', 'l', 'l', 'o')\n\n for (char in word) {\n list.add(char)\n }\n var pos = 0\n for (i in 0..list.size-1) {\n if (list1[pos] == list[i]) {\n ++pos\n }\n }\n if(pos == 5){\n println(\"YES\")\n }\n else{\n println(\"NO\")\n }\n}\n", "lang": "Kotlin", "bug_code_uid": "d7eacc214f72388d9a5376b001d838aa", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "a6ece5f164cae8af988809ef6e86611e", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9955555555555555, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n var scan = Scanner(System.`in`)\n\n var hello = \"hello\".toCharArray()\n var index = 0\n var s = scan.nextLine()\n for(i in 0 until s.length) {\n if(hello[index] == s[i]) {\n index++\n if(index == hello.size-1) {\n break;\n }\n }\n }\n\n if(index == hello.size-1) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "1bf3412756a594b670b3afa63872a1b4", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "5606a2bcb1be49904434c9f33b557933", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.7057728119180633, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "\nfun main(args: Array){\n\n fun greeting(char : String = \"h\" , str : String){\n if (!str.contains(char)) print(\"NO\")\n else{\n when(char){\n \"h\" -> greeting(\"e\", str.substringAfter(char))\n \"e\" -> greeting(\"ll\", str.substringAfter(char))\n \"ll\" -> greeting(\"o\", str.substringAfter(char))\n \"o\" -> print(\"YES\")\n }\n }\n }\n readLine()?.toLowerCase()?.let {greeting(str = it)}\n}", "lang": "Kotlin", "bug_code_uid": "755c7d7829fb4c99a9828dbd38d3c0c5", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "e28aacfc9d3f99e20b50f94c8b619f1c", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9943589743589744, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.PrintWriter\nimport java.lang.StringBuilder\nimport kotlin.math.*\n\nfun main() {\n io.apply {\n\n val s = str()\n var ix = -1\n var ok = true\n for (i in 0 .. 4) {\n ix = s.indexOf(\"hello\"[i], ix + 1)\n if (ix == -1) {\n cout .. \"NO\" .. nl\n ok = false\n }\n }\n if (ok)\n cout .. \"YES\" .. nl\n\n }.cout.flush()\n}\n\n// @formatter:off\nprivate val io = object {\n private val `in` = System.`in`\n private fun ll(): Long {\n var x: Int; var q = false; var n = 0L; do x = `in`.read() while (x < 33); if (x == 45) { q = true; x = `in`.read() }\n do { n = n * 10 - x + 48; x = `in`.read() } while (x > 32); return if (q) n else -n\n }\n val int get() = ll().toInt(); val long get() = ll()\n fun ints(n: Int = int): IntArray { return IntArray(n) { int } }\n fun ints1(n: Int = int): IntArray { return IntArray(n) { int - 1 } }\n val cout = PrintWriter(System.out); val nl = \"\\n\"\n private var buf = CharArray(32)\n private var bufSize = 32\n fun str(expect: Int = 32): String {\n var ix = 0\n var x: Int\n if (bufSize < expect)\n buf = CharArray(expect)\n do x = `in`.read() while (x < 33)\n do {\n if (ix == bufSize) { bufSize *= 2; buf = buf.copyOf(bufSize) }\n buf[ix++] = x.toChar()\n x = `in`.read()\n } while (x > 32)\n return java.lang.String.copyValueOf(buf, 0, ix)\n }\n operator fun PrintWriter.rangeTo(a: Int): PrintWriter { print(a); print(\" \"); return this }\n operator fun PrintWriter.rangeTo(a: Long): PrintWriter { print(a); print(\" \"); return this }\n operator fun PrintWriter.rangeTo(a: IntArray): PrintWriter { a.forEach { print(it); print(\" \") }; return this }\n operator fun PrintWriter.rangeTo(a: String): PrintWriter { write(a); return this }\n} // @formatter:on\n\n/* ----------- */\n\n", "lang": "Kotlin", "bug_code_uid": "bd187c51e46e067909f04a0b1eacbda3", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "fa454bc9f636fe23b9f0326c2cb908c6", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9296187683284457, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n val s: Scanner = Scanner(System.`in`)\n val str: String = s.next()\n val hello: String = \"hello\"\n var cur: Int = 0\n for (c in hello) {\n cur = str.indexOf(c, cur + 1)\n if (cur == -1) {\n break;\n }\n }\n print(if (cur == -1) \"NO\" else \"YES\")\n}", "lang": "Kotlin", "bug_code_uid": "2074b3a7b6b571d29e09f14101c8586e", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "9d1ef2610c7cc16538edc15293b7bcf5", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5775798069784707, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "fun main(args: Array) {\n\n var temp = \"\"\n\n readLine()!!.toString()\n .forEach {\n if (it == 'h' && temp.indexOf(\"h\") != 0) {\n temp += it\n }\n if (it == 'e' && temp.indexOf(\"e\") != 1) {\n temp += it\n }\n if (it == 'l' && !temp.contains(\"ll\") && (temp.indexOf(\"l\") != 2 || temp.indexOf(\"l\") != 3)) {\n temp += it\n }\n if (it == 'o' && temp.indexOf(\"o\") != 4) {\n temp += it\n }\n }\n print(if (temp.equals(\"hello\")) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "93d8ccb824687e3f92c9cacd5f60f3ac", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "68bc17fb9287108018cf02b115d69283", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9771398192450824, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main(args : Array) {\n var s = readLine()!!\n var found = false\n for (n in 1..s.length-5) {\n if (s.substring(n - 1, n) == \"h\") {\n for (i in n..s.length - 4) {\n if (s.substring(i - 1, i) == \"e\") {\n for (j in i..s.length - 3) {\n if (s.substring(j, j + 1) == \"l\") {\n for (k in (j + 1)..(s.length - 2)) {\n if (s.substring(k, k + 1) == \"l\")\n for (m in (k+1)..(s.length-1)) {\n if (s.substring(m,m+1) == \"o\")\n found = true\n }\n }\n }\n }\n }\n }\n }\n }\n if (found)\n println(\"YES\")\n else\n println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "47f1fd22671692dae2e02b29097fa05c", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "c5c16af2d90cc48f1b3013f186d6a38f", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9796954314720813, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.Scanner\n\nfun main() {\n val scanner = Scanner(System.`in`)\n var input = scanner.nextLine()\n var hello = \"hello\"\n var counter = 0\n for (i in 0..input.length-1){\n if (input[i]==hello[counter]){\n counter++\n }\n if (counter==5) {\n break\n }\n }\n println(counter)\n if (counter==5) println(\"YES\")\n else println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "9d1d59da45fb3891dce8a5a5d68bd96a", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "ac4e7215e3956c1af014129b837ab917", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.956661316211878, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\nimport java.util.*\n\nfun main() {\n val br = BufferedReader(InputStreamReader(System.`in`))\n val s = br.readLine()\n println(saidHello(s))\n\n}\n\nfun saidHello (s: String): String{\n val hello = Stack()\n var countL = 0\n var i = 0\n\n while (i < s.length && !(hello.size == 5)){\n val c = s[i]\n if (c == 'h' && hello.isEmpty()){\n hello.push(c)\n } else if (c == 'e' && hello.peek() == 'h'){\n hello.push(c)\n } else if (c == 'l'){\n val lastChar = hello.peek()\n if (lastChar == 'e' || (lastChar == 'l' && countL < 2)) {\n hello.push(c)\n countL ++\n }\n } else if (c == 'o' && hello.peek() == 'l'){\n hello.push(c)\n }\n i++\n }\n\n return if (hello.size == 5) \"YES\" else \"NO\"\n}", "lang": "Kotlin", "bug_code_uid": "800380b58e1f28f86a26fefa6cb2c16c", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "ed483c52d7554d8b40ed05ff01977f37", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9922480620155039, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.InputStreamReader\nimport java.util.*\n\nfun main() {\n val br = BufferedReader(InputStreamReader(System.`in`))\n val s = br.readLine()\n println(saidHello(s))\n\n}\n\nfun saidHello (s: String): String{\n val hello = Stack()\n var countL = 0\n var i = 0\n\n while (i < s.length && !(hello.size == 5)){\n val c = s[i]\n if (c == 'h' && hello.isEmpty()){\n hello.push(c)\n } else if (hello.isNotEmpty() && c == 'e' && hello.peek() == 'h'){\n hello.push(c)\n } else if (hello.isNotEmpty() && c == 'l'){\n val lastChar = hello.peek()\n if (lastChar == 'e' || (lastChar == 'l' && countL < 2)) {\n hello.push(c)\n countL ++\n }\n } else if (hello.isNotEmpty() && c == 'o' && hello.peek() == 'l'){\n hello.push(c)\n }\n i++\n }\n\n return if (hello.size == 5) \"YES\" else \"NO\"\n}", "lang": "Kotlin", "bug_code_uid": "c1062b31ea8052b6c33bc80d239829b5", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "ed483c52d7554d8b40ed05ff01977f37", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9889064976228209, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "fun main (args:Array){\n //hello\n var line = readLine()!!\n var hPosition = line.indexOf('h')\n if(hPosition > -1) {\n var word1 = line.subSequence(hPosition, line.length)\n var ePosition = word1.indexOf('e')\n if(ePosition > -1){\n var word2 = word1.subSequence(ePosition, word1.length)\n var lPosition1 = word2.indexOf('l')\n if(lPosition1 > -1){\n var word3 = word2.subSequence(lPosition1, word2.length)\n var lPosition2 = word3.indexOf('l')\n if(ePosition > -1){\n var word4 = word3.subSequence(lPosition2, word3.length)\n var oPosition = word4.indexOf('o')\n if(oPosition > -1){\n println(\"YES\")\n }else println(\"NO\")\n }else println(\"NO\")\n }else println(\"NO\")\n }else println(\"NO\")\n }else println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "2f5619c8042e14de9d956a610a4162f6", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "299313d3cf0d104e7e92374431f3851a", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.4447592067988669, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "import java.util.*\n\nfun main()\n{\n var scanner = Scanner(System.`in`)\n var str = scanner.next()\n str = str.toLowerCase()\n var result = \"\"\n var current = ' '\n for(i in 0 until str.length)\n {\n if(current == str[i])\n continue\n else if(str[i] == 'l' && i != str.length-1 && str[i+1] == 'l') {\n result += \"ll\"\n current ='l'\n }\n else\n {\n result += str[i]\n current = str[i]\n }\n }\n println(result)\n if(result.contains(\"hello\" , true))\n println(\"YES\")\n else\n println(\"NO\")\n}\n\n\n", "lang": "Kotlin", "bug_code_uid": "cf54e1d020c5366ef3fdf9d104c155b3", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "eb0f2f154e0d768e9507ec517dea756b", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9803536345776032, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "fun main(args:Array)\n{\n\n var t=readLine()!!\n var switch=0\n var counter=0\n var counter1=0\n var flag=false\n var f=false\nfor(i in t) {\n if(i=='S')\n {\n f=true\n }\n if(i=='F'&&f)\n {\n f=false\n counter++;\n }\n}\n f=false\n for(i in t) {\n if(i=='F')\n {\n f=true\n }\n if(i=='S'&&f)\n {\n f=false\n counter1++;\n }\n }\n \n println(if(counter>counter1) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "b1b667dff29bd5ba27dc450d6defe3da", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "e820059d0e450882ac977efea885b258", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9699248120300752, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val nightCount = Integer.parseInt(readLine()!!)\n val cities = readLine()!!\n var sf = 0\n var fs = 0\n for(i in 0 until nightCount - 1) {\n val flight = cities.substring(i, i + 2)\n println(flight)\n when (flight) {\n \"SF\" -> sf++\n \"FS\" -> fs++\n }\n }\n\n if (sf > fs) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "a33247b1c7d59be35c04e0b1cc703364", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "b1ba2db0569a8193ccd5584fc7da66fb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.4182735861265692, "equal_cnt": 33, "replace_cnt": 21, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 32, "bug_source_code": "import java.io.PrintWriter\nimport kotlin.math.sqrt\n\nprivate val reader = System.`in`.bufferedReader()\nprivate fun readLn() = reader.readLine()!! // string line\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readLong() = readLn().toLong()\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\nprivate fun readLongs() = readStrings().map { it.toLong() }\nprivate val writer = PrintWriter(System.out.bufferedWriter())\nprivate fun write(any: Any) = writer.print(any)\nprivate fun writeLn(any: Any) = writer.println(any)\nprivate fun flush() = writer.flush()\n\nprivate fun factors(n: Long): List {\n val ret = mutableListOf()\n val limit = sqrt(n.toDouble()).toInt()\n for (i in 1..limit) {\n if (n % i == 0L) {\n ret.add(i.toLong())\n if (i.toLong() * i != n) {\n ret.add(n / i)\n }\n }\n }\n ret.sort()\n return ret\n}\n\nfun main() {\n run {\n val (n, k) = readLongs()\n val factors = factors(n)\n// for (factor in factors) {\n// debug(factor)\n// }\n val cache = mutableMapOf, Map>()\n\n fun solve(n: Long, k: Int): Map {\n if (k == 0) {\n return mapOf(n to 1L)\n }\n if (cache.containsKey(n to k)) {\n return cache[n to k] ?: error(\"wtf\")\n }\n val ret = mutableMapOf()\n var cnt = 0\n for (factor in factors) {\n if (factor > n) {\n break\n }\n if (n % factor != 0L) {\n continue\n }\n cnt++\n val ret1 = solve(n / factor, k - 1)\n for (entry in ret1) {\n ret.compute(entry.key) { _, v ->\n v?.addMod(entry.value) ?: entry.value\n }\n }\n }\n// debug(\"$n has $cnt factors\")\n\n for (entry in ret) {\n ret.compute(entry.key) { _, v ->\n v?.divMod(cnt.toLong()) ?: error(\"wtf\")\n }\n }\n\n cache[n to k] = ret\n return ret\n }\n\n val final = solve(n, k.toInt())\n var ans = 0L\n for (x in final) {\n// debug(\"${x.key} ${x.value}\")\n ans = ans.addMod(x.key.mulMod(x.value))\n// debug(ans)\n }\n writeLn(ans)\n }\n flush()\n}\n\nprivate fun Pair.fractionPlus(other: Pair): Pair {\n return first * other.second + other.first * second to second * other.second\n}\n\nprivate fun invMod0(a: Long, m: Long): Long {\n val ans = extGcd(a, m)\n return if (ans[0] == 1L) (ans[1] + m) % m else -1\n}\n\nprivate fun extGcd(a: Long, m: Long): LongArray {\n return if (m == 0L) {\n longArrayOf(a, 1, 0)\n } else {\n val ans = extGcd(m, a % m)\n val tmp = ans[1]\n ans[1] = ans[2]\n ans[2] = tmp\n ans[2] -= ans[1] * (a / m)\n ans\n }\n}\n\nprivate const val MODULO = (1e9 + 7).toLong()\nprivate fun Long.addMod(other: Long): Long {\n var ret = this + other\n while (ret >= MODULO) {\n ret -= MODULO\n }\n while (ret < 0) {\n ret += MODULO\n }\n return ret\n}\n\nprivate fun Long.subMod(other: Long) = addMod(-other)\nprivate fun Long.mulMod(other: Long) = this % MODULO * other % MODULO\nprivate fun Long.invMod() = invMod0(this, MODULO)\nprivate fun Long.divMod(other: Long) = mulMod(other.invMod())\n\nprivate fun debug(any: Any) {\n System.err.println(any)\n}\n", "lang": "Kotlin", "bug_code_uid": "c14f21636a4114e8b28aa77300a99e37", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "9de92adb6f8a2c7421fb598ed1b47613", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9967353088900051, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.PrintWriter\nimport kotlin.math.log\nimport kotlin.math.sqrt\n\nprivate val reader = System.`in`.bufferedReader()\nprivate fun readLn() = reader.readLine()!! // string line\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readLong() = readLn().toLong()\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\nprivate fun readLongs() = readStrings().map { it.toLong() }\nprivate val writer = PrintWriter(System.out.bufferedWriter())\nprivate fun write(any: Any) = writer.print(any)\nprivate fun writeLn(any: Any) = writer.println(any)\nprivate fun flush() = writer.flush()\n\nfun main() {\n Thread(null, {\n val (n, kTmp) = readLongs()\n val k = kTmp.toInt()\n debug(\"k=$k\")\n\n val t = System.nanoTime()\n\n val primeFactors = mutableListOf>() // (prime, exp)\n run {\n val limit = sqrt(n.toDouble()).toInt()\n var nn = n\n for (i in 2..limit) {\n if (nn % i == 0L) {\n var cnt = 0\n while (nn % i == 0L) {\n cnt++\n nn /= i\n }\n primeFactors.add(i.toLong() to cnt)\n }\n }\n if (nn > 1) {\n primeFactors.add(nn to 1)\n }\n for (primeFactor in primeFactors) {\n debug(primeFactor)\n }\n }\n\n val invs = LongArray(log(1e15, 2.0).toInt() + 1)\n for (i in invs.indices) {\n invs[i] = i.toLong().invMod2()\n }\n\n var ans = 1L\n\n fun solve(p: Long, e: Int): Long {\n val props = Array(k + 1) { LongArray(e + 1) { 0 } }\n val ev = Array(k + 1) { LongArray(e + 1) { 0 } }\n for (i in 0..e) {\n props[0][i] = 1\n ev[0][i] = p.powerMod(i)\n }\n for (kk in 1..k) {\n for (i in 0..e) {\n for (j in 0..i) {\n props[kk][i] = props[kk][i].addMod(props[kk - 1][j])\n ev[kk][i] = ev[kk][i].addMod(ev[kk - 1][j])\n }\n props[kk][i] = props[kk][i].mulMod(invs[i + 1])\n ev[kk][i] = ev[kk][i].mulMod(invs[i + 1])\n }\n }\n return ev[k][e]\n }\n\n for ((p, exp) in primeFactors) {\n ans = ans.mulMod(solve(p, exp))\n }\n\n writeLn(ans)\n\n debug(\"time: ${(System.nanoTime() - t) / 1e9}\")\n }, \"cool\", 1 shl 28).apply {\n start()\n join()\n }\n flush()\n}\n\nprivate fun invMod0(a: Long, m: Long): Long {\n val ans = extGcd(a, m)\n return if (ans[0] == 1L) (ans[1] + m) % m else -1\n}\n\nprivate fun extGcd(a: Long, m: Long): LongArray {\n return if (m == 0L) {\n longArrayOf(a, 1, 0)\n } else {\n val ans = extGcd(m, a % m)\n val tmp = ans[1]\n ans[1] = ans[2]\n ans[2] = tmp\n ans[2] -= ans[1] * (a / m)\n ans\n }\n}\n\nprivate fun Long.sqr() = this * this\n\nprivate const val MODULO = (1e9 + 7).toLong()\nprivate fun Long.addMod(other: Long): Long {\n var ret = this + other\n while (ret >= MODULO) {\n ret -= MODULO\n }\n while (ret < 0) {\n ret += MODULO\n }\n return ret\n}\n\nprivate fun Long.subMod(other: Long) = addMod(-other)\nprivate fun Long.mulMod(other: Long) = this % MODULO * (other % MODULO) % MODULO\nprivate fun Long.invMod() = invMod0(this, MODULO)\nprivate fun Long.invMod2() = powerMod(MODULO - 2)\nprivate fun Long.divMod(other: Long) = mulMod(other.invMod2())\nprivate fun Long.powerMod(exp: Int) = powerMod(exp.toLong())\nprivate fun Long.powerMod(exp: Long): Long = when {\n exp == 0L -> 1\n exp % 2 == 0L -> powerMod(exp / 2).sqr() % MODULO\n else -> powerMod(exp - 1).mulMod(this)\n}\n\nprivate fun debug(any: Any) {\n System.err.println(any)\n}\n", "lang": "Kotlin", "bug_code_uid": "03a5460642fbd19f7ee7d49ccfe0b79d", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "9de92adb6f8a2c7421fb598ed1b47613", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9866858582223822, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const val MOD = 1_000_000_007\n\nfun main(args: Array) {\n var (n, k) = readLine()!!.split(' ').map(String::toLong)\n\n var result = 1\n var d = 2L\n while (d * d <= n) {\n var deg = 0\n while (n % d == 0L) {\n n /= d\n ++deg\n }\n result = mult(result, f(d, deg, k.toInt()))\n ++d\n }\n if (n > 1) {\n result = mult(result, f(n, 1, k.toInt()))\n }\n println(result)\n}\n\nfun f(_p: Long, deg: Int, k: Int): Int {\n val dp = Array(k + 1) { IntArray(deg + 1) }\n dp[0][deg] = 1\n val inverses = IntArray(deg + 2) { inverse(it) }\n for (step in 1..k) {\n for (d in 0..deg) {\n for (nd in d..deg) {\n dp[step][d] = add(dp[step][d], mult(dp[step - 1][nd], inverses[nd + 1]))\n }\n }\n }\n var result = 0\n var pi = 1\n val p = (_p % MOD).toInt()\n for (i in 0..deg) {\n result = add(result, mult(dp[k][i], pi))\n pi = mult(pi, p)\n }\n return result\n}\n\nfun inverse(n: Int) = binPow(n, MOD - 2)\n\nfun binPow(x: Int, n: Int): Int {\n return when {\n n == 0 -> 1\n n % 2 == 1 -> mult(x, binPow(x, n - 1))\n else -> {\n val half = binPow(x, n / 2)\n mult(half, half)\n }\n }\n}\n\nfun add(a: Int, b: Int) = (a + b) % MOD\n\nfun mult(a: Int, b: Int) = ((a.toLong() * b) % MOD).toInt()", "lang": "Kotlin", "bug_code_uid": "b71b1929c13fc8f253892e55e8fd904a", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "5160f9411e41a978b6450b2d2f52f6f8", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9781771501925546, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import kotlin.math.pow\nimport kotlin.math.sqrt\n\nfun main() {\n val r = System.`in`.bufferedReader()\n val s = StringBuilder()\n //val len = r.readLine()!!.toInt()\n val (radius, x, y, x1, y1) = r.readLine()!!.split(\" \").map { it.toDouble() }\n val dis = sqrt((x-x1).pow(2)+(y-y1).pow(2))\n val ans = (dis/(2*radius)).toInt() + if (dis%radius!=0.0) 1 else 0\n println(ans)\n}", "lang": "Kotlin", "bug_code_uid": "3129700907f9a80a06f960dac61d1a56", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "18f131ba6aa35232eccb453bd5538e03", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9659090909090909, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import kotlin.math.ceil\nimport kotlin.math.sqrt\n\nfun main() {\n fun readInt() = readLine()!!.toInt()\n fun readLong() = readLine()!!.toLong()\n fun readInts() = readLine()!!.split(\" \").map(String::toInt)\n fun readLongs() = readLine()!!.split(\" \").map(String::toLong)\n\n val (r, x, y, x2, y2) = readInts()\n val d = sqrt(((x - x2) * (x - x2) + (y - y2) * (y - y2)).toDouble())\n print(ceil(d / (r * 2)).toLong())\n}", "lang": "Kotlin", "bug_code_uid": "733c10fdd4d738fb9940114762cef688", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "7852edecfb1ab85916875c95158b2358", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9834061135371179, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// 8/5/2020 7:05 AM\n/*\nhttps://codeforces.com/problemset/problem/507/B\n */\n//package p507\n\nimport kotlin.math.ceil\nimport kotlin.math.sqrt\n\nprivate fun readLn() = readLine()!! // string line\nprivate fun readInt() = readLn().toInt() // single int\nprivate fun readStrings() = readLn().split(\" \") // list of strings\nprivate fun readInts() = readStrings().map { it.toInt() } // list of ints\n\nfun main() {\n val (r, x, y, x2, y2) = readInts()\n val distanceTo = sqrt(((x-x2)*(x-x2) + (y-y2)*(y-y2)).toDouble())\n\n println( ceil((distanceTo) / (2*r)).toInt() )\n\n}", "lang": "Kotlin", "bug_code_uid": "277714f5b11da42cf1188ad4a26d8857", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "c634040554272af4c58b12f493d65f97", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.6834381551362684, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "fun main() {\n var n = readLine()!!.toInt()\n var list = readLine()!!.split(' ').map { it.toInt() }\n for (i in list) {\n if (i % 2 == 1) {\n println(\"YES\")\n return\n }\n }\n println(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "afaa714a5cc19455f0adb323c936e9a7", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "27a5b461ebf9f1fe326dd3fef5e1a618", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9920886075949367, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.io.BufferedReader\nimport java.io.FileReader\nimport java.io.InputStreamReader\n\nval ONLINE = System.getProperty(\"ONLINE_JUDGE\") != null\nval inp = BufferedReader(if (ONLINE) InputStreamReader(System.`in`) else FileReader(\"in.txt\"))\n\ninline fun readTokens() = inp.readLine()!!.split(' ')\ninline fun readInts() = readTokens().map { it.toInt() }\ninline fun readInt() = inp.readLine()!!.toInt()\ninline fun readLine() = inp.readLine()!!\n\nfun main(args: Array) {\n val n=readInt()\n val a=readInts().toIntArray()\n if((a[0]%2==1)&&(a[n-1]%2==1)){\n println(\"Yes\")\n }else{\n println(\"No\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "4d5d1a626207c5e85731271a8d893c24", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "d6cdc0a1f9efafaa5ca382f3c30384d8", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9752501316482359, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n val r = readInt()\n\n val ans = run {\n if(r % 2 == 0) return@run \"NO\"\n val y = (r - 3) / 2\n if(y <= 0) \"NO\" else \"1 $y\"\n }.also { println(it) }\n}\n\nfun readLn() = readLine()!!\nfun readInt() = readLn().toInt()\nfun readDouble() = readLn().toDouble()\nfun readLong() = readLn().toLong()\nfun readStrings() = readLn().split(' ')\nfun readInts() = readStrings().map { it.toInt() }\nfun readDoubles() = readStrings().map { it.toDouble() }\nfun readLongs() = readStrings().map { it.toLong() }\n\nclass Output {\n private val sb = StringBuilder()\n fun print(o: Any?) { sb.append(o) }\n fun println() { sb.append('\\n') }\n fun println(o: Any?) { sb.append(o).append('\\n') }\n @JvmName(\"_print\") fun Any?.print() = print(this)\n @JvmName(\"_println\") fun Any?.println() = println(this)\n fun nowPrint() { kotlin.io.print(sb) }\n}\ninline fun output(block: Output.()->Unit)\n { Output().apply(block).nowPrint() }\n", "lang": "Kotlin", "bug_code_uid": "16d172e90e0fef19ea5ac4f8bb710074", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "1747e917bf46d3d3253aa17d4c16adea", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9827586206896551, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "fun main(){\n val r = readLine()!!.toInt()\n\n var x = 1\n while (true){\n val y = (r-x*x-x-1)\n if (y<0){\n println(\"NO\")\n break\n }\n if (y%(2*x)==0){\n println(\"$x ${y/(2*x)}\")\n break\n }\n\n x++\n }\n}", "lang": "Kotlin", "bug_code_uid": "76036b54304a447ef35b9e16f7f1146d", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "84f860728a15096541ed762604dd0ee0", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9845094664371773, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "fun main(){\n val r = readLine()!!.toInt()\n\n var x = 1\n while (true){\n val y = (r-x*x-x-1)\n if (y<=0){\n println(\"NO\")\n break\n }\n if (y%(2*x)==0){\n println(\"$x ${y/(2*x)}\")\n break\n }\n\n x++\n }\n}", "lang": "Kotlin", "bug_code_uid": "3c5eab7bfe55defb56b046a76872ae29", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "84f860728a15096541ed762604dd0ee0", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9972124140494332, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import java.io.*\nimport java.util.*\nimport kotlin.collections.ArrayList\nimport kotlin.collections.HashSet\n\nfun main() {\n solve(System.`in`, System.out)\n}\n\nfun solve(input: InputStream, output: OutputStream) {\n val reader = Reader(input) //Reader(FileInputStream(File(\"portals.in\")))\n val writer = PrintWriter(BufferedOutputStream(output)) //PrintWriter(FileOutputStream(File(\"output.txt\")))\n\n solve(reader, writer)\n writer.close()\n}\n\nfun solve(ir : Reader, pw : PrintWriter) {\n\n val n = ir.nextInt()\n val a = IntArray(n)\n var total: Long = 0\n\n repeat(n) {\n a[it] = ir.nextInt()\n }\n\n Arrays.sort(a)\n\n total += a[n - 1]\n\n for (i in (n - 2) downTo 0) {\n if (a[i] >= a[i + 1])\n a[i] = a[i + 1] - 1\n total += a[i]\n }\n\n pw.print(total)\n\n}\n\nprivate fun sort(array: IntArray, barray: IntArray, low: Int, high: Int) {\n\n var i = low\n var j = high\n val x = array[low + (high - low) / 2]\n\n do {\n while (array[i] < x) ++i\n while (array[j] > x) --j\n if (i <= j) {\n val tmp = array[i]\n array[i] = array[j]\n array[j] = tmp\n\n val pmt = barray[i]\n barray[i] = barray[j]\n barray[j] = pmt\n\n i++\n j--\n }\n } while (i <= j)\n\n if (low < j) sort(array, barray, low, j)\n if (i < high) sort(array, barray, i, high)\n\n}\n\nclass Reader(stream: InputStream) {\n private val reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)\n private var tokenizer: StringTokenizer? = null\n\n init {\n tokenizer = null\n }\n\n operator fun next(): String {\n while (tokenizer == null || !tokenizer!!.hasMoreTokens())\n try {\n tokenizer = StringTokenizer(reader.readLine())\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n return tokenizer!!.nextToken()\n }\n\n fun nextLine(): String? {\n val fullLine: String\n while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n try {\n fullLine = reader.readLine()\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n return fullLine\n }\n return null\n }\n\n fun toArray(): Array {\n return nextLine()!!.split(\" \".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n}", "lang": "Kotlin", "bug_code_uid": "03dc33578293768d4acb9ffb02a75427", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "9c2183ba197dfddf989711ae47cdb31e", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9957627118644068, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.io.*\nimport java.util.*\n\nfun main() {\n solve(System.`in`, System.out)\n}\n\nfun solve(input: InputStream, output: OutputStream) {\n val reader = InputReader(BufferedInputStream(input))\n val writer = PrintWriter(BufferedOutputStream(output))\n\n solve(reader, writer)\n writer.close()\n}\n\nfun solve(ir : InputReader, pw : PrintWriter) {\n\n val r1 : Int = ir.nextInt()\n val c1 : Int = ir.nextInt()\n val r2 : Int = ir.nextInt()\n val c2 : Int = ir.nextInt()\n val dis1 : Int = Math.abs(r1 - r2)\n val dis2 : Int = Math.abs(c1 - c2)\n val rest : Int = Math.abs(dis1 - dis2)\n\n if (r1 != r2 && c1 != c2)\n pw.print(\"2 \")\n else if (r1 != r2 || c1 != c2)\n pw.print(\"1 \")\n else\n pw.print(\"0 \")\n\n if (dis1 % 2 == dis2 % 2) {\n when {\n dis1 != dis2 -> pw.print(\"2 \")\n dis1 == dis2 -> pw.print(\"1 \")\n else -> pw.print(\"0 \")\n }\n } else\n pw.print(\"0 \")\n\n if (dis1 >= dis2)\n pw.print(\"${dis2 + rest}\")\n else\n pw.print(\"${dis1 + rest}\")\n\n pw.print(rest)\n\n}\n\nclass InputReader(stream: InputStream) {\n private val reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)\n private var tokenizer: StringTokenizer? = null\n\n init {\n tokenizer = null\n }\n\n operator fun next(): String {\n while (tokenizer == null || !tokenizer!!.hasMoreTokens())\n try {\n tokenizer = StringTokenizer(reader.readLine())\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n return tokenizer!!.nextToken()\n }\n\n fun nextLine(): String? {\n val fullLine: String\n while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {\n try {\n fullLine = reader.readLine()\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n return fullLine\n }\n return null\n }\n\n fun toArray(): Array {\n return nextLine()!!.split(\" \".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n fun nextDouble(): Double {\n return java.lang.Double.parseDouble(next())\n }\n\n fun nextLong(): Long {\n return java.lang.Long.parseLong(next())\n }\n\n}", "lang": "Kotlin", "bug_code_uid": "39d04f7b80b23a303d6ffe4db2bc9307", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "9f7dbd6b246ac5113a09e7c7991df016", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9995289684408856, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import kotlin.math.max\n\nfun main(args: Array) {\n var (n, k, x) = readLine()!!.split(\" \").map(String::toInt)\n val arr = readLine()!!.split(\" \").map(String::toInt).toIntArray()\n if(n == 1) {\n println(0)\n return\n }\n var i = 0\n\n var maxCount = 0\n while (i < n){\n if(arr[i] == x && arr[i+1] == x) {\n var count = 2\n var l = 1\n var r = 1\n while (i-l>0 && i+r+1 < n) {\n if(arr[i-l] == arr[i+r+1]) {\n if(i-l-1 >= 0) {\n if(i+r+2 < n) {\n if(arr[i-l] == arr[i-l-1] && arr[i+r+1] == arr[i+r+2]) {\n count+=4\n l+=2\n r+=2\n } else if(arr[i-l] == arr[i-l-1]) {\n count+=3\n l+=2\n r++\n } else if(arr[i+r+1] == arr[i+r+2]) {\n count+=3\n l++\n r+=2\n } else {\n break\n }\n } else {\n if(arr[i-l] == arr[i-l-1]) {\n count+=3\n l+=2\n r++\n } else {\n break\n }\n }\n } else {\n if(i+r+2 < n) {\n if(arr[i+r+1] == arr[i+r+2]) {\n count+=3\n l++\n r+=2\n }\n } else {\n break\n }\n }\n } else {\n break\n }\n }\n if (maxCount < count) maxCount = count\n i++\n }\n i++\n }\n println(maxCount)\n}", "lang": "Kotlin", "bug_code_uid": "3a15489b1938526aa737038af31dda08", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "fbcbc871cb6016d629abd7693dac6148", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9302558956347216, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "import kotlin.math.max\n\nfun main(args: Array) {\n var (n, k, x) = readLine()!!.split(\" \").map(String::toInt)\n val arr = readLine()!!.split(\" \").map(String::toInt).toIntArray()\n if(n == 1) {\n println(0)\n return\n }\n var i = 0\n\n var maxCount = 0\n while (i < n){\n if(arr[i] == x && arr[i+1] == x) {\n var count = 2\n var l = 1\n var r = 1\n while (i-l>0 && i+r+1 < n) {\n if(arr[i-l] == arr[i+r+1]) {\n if(i-l-1 >= 0) {\n if(i+r+2 < n) {\n if(arr[i-l] == arr[i-l-1] && arr[i+r+1] == arr[i+r+2]) {\n count+=4\n l-=2\n r+=2\n } else if(arr[i-l] == arr[i-l-1]) {\n count+=3\n l-=2\n r++\n } else if(arr[i+r+1] == arr[i+r+2]) {\n count+=3\n l--\n r+=2\n }\n } else {\n if(arr[i-l] == arr[i-l-1]) {\n count+=3\n l-=2\n r++\n }\n }\n } else {\n if(i+r+2 < n) {\n if(arr[i+r+1] == arr[i+r+2]) {\n count+=3\n l--\n r+=2\n }\n }\n }\n }\n }\n if (maxCount < count) maxCount = count\n i++\n }\n i++\n }\n println(maxCount)\n}", "lang": "Kotlin", "bug_code_uid": "3de5523112ca9ccec8529023cd78ac8a", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "fbcbc871cb6016d629abd7693dac6148", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9962317475270843, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import kotlin.math.max\n\nfun main(args: Array) {\n var (n, k, x) = readLine()!!.split(\" \").map(String::toInt)\n val arr = readLine()!!.split(\" \").map(String::toInt).toIntArray()\n if(n == 1) {\n println(0)\n return\n }\n var i = 0\n\n var maxCount = 0\n while (i < n){\n if(arr[i] == x && arr[i+1] == x) {\n var count = 2\n var l = 1\n var r = 1\n while (i-l>0 && i+r+1 < n) {\n if(arr[i-l] == arr[i+r+1]) {\n if(i-l-1 >= 0) {\n if(i+r+2 < n) {\n if(arr[i-l] == arr[i-l-1] && arr[i+r+1] == arr[i+r+2]) {\n count+=4\n l-=2\n r+=2\n } else if(arr[i-l] == arr[i-l-1]) {\n count+=3\n l-=2\n r++\n } else if(arr[i+r+1] == arr[i+r+2]) {\n count+=3\n l--\n r+=2\n } else {\n break\n }\n } else {\n if(arr[i-l] == arr[i-l-1]) {\n count+=3\n l-=2\n r++\n } else {\n break\n }\n }\n } else {\n if(i+r+2 < n) {\n if(arr[i+r+1] == arr[i+r+2]) {\n count+=3\n l--\n r+=2\n }\n } else {\n break\n }\n }\n } else {\n break\n }\n }\n if (maxCount < count) maxCount = count\n i++\n }\n i++\n }\n println(maxCount)\n}", "lang": "Kotlin", "bug_code_uid": "8c1ab31a82ea68af5bceab08647c579d", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "fbcbc871cb6016d629abd7693dac6148", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9420849420849421, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val w = readLine()!!.toInt()\n\n print(if(w % 2 == 0) {\n \"YES\"\n } else {\n \"NO\"\n })\n}", "lang": "Kotlin", "bug_code_uid": "864489994a33c6100ea37b424d43f62f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2f5cd210d6d9940776d517da9a69754f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9611510791366906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val weight = readLine()!!.toInt()\n println(if (solution(weight)) \"YES\" else \"NO\")\n}\n\nfun solution(weight: Int): Boolean {\n for (piece in 2..weight step 2) {\n val secondPiece = weight - piece\n if (secondPiece > 0 && secondPiece % 2 == 0) {\n println(piece)\n return true\n }\n }\n return false\n}", "lang": "Kotlin", "bug_code_uid": "39f63d030d25f0dfbd813bdcde3af8a9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "959f274e4581238ea570a77db49207c4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.7270375161707633, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "package x_4a_watermelon\n\n/**\n * @author Alexander Bolgov on 28.12.2019.\n */\nfun main() {\n val weight = readLine()!!.toInt()\n println(if (solution(weight)) \"YES\" else \"NO\")\n}\n\nfun solution(weight: Int): Boolean {\n //if (weight < 4) return false\n for (piece in 2..weight step 2) {\n if (weight - piece > 0 && (weight - piece) % 2 == 0) {\n println(piece)\n return true\n }\n }\n return false\n}", "lang": "Kotlin", "bug_code_uid": "321d0d232a027f9e42d896241e77a777", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "959f274e4581238ea570a77db49207c4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8587570621468926, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n print(if (readLine()!!.toInt() % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "e4e7f0efb16910edb719ba051ef5dda1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b7f3e354e831027a4e6b41ec3be79c56", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9977272727272727, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "fun main(){\n val weight = readLine()!!.split(' ').first().toInt()\n\n if(1 <= weight && weight <= 100){\n if(weight == 1){\n print(\"NO\")\n }\n for (num in 2 .. weight/2){\n if(num % 2 == 0 && (weight - num) % 2 == 0){\n print(\"YES\")\n break\n }\n\n if(num >= weight/2){\n print(\"NO\")\n break\n }\n }\n }\n}", "lang": "Kotlin", "bug_code_uid": "f772449dcbe23230eba4949809aaa25a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "fc36c9ccbb4dcf3d2d9e7315e8998027", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9743589743589743, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val m = readLine()!!.toInt()\n print(mapOf(true to \"YES\", false to \"NO\")[m % 2 == 0 || m == 2])\n}\n", "lang": "Kotlin", "bug_code_uid": "0de247e99a1a609702cd5d1f7ad19172", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7f1c9e4f801810626adfdbea48d9659d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9771428571428571, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main () {\n val input = Scanner(System.`in`)\n var w = input.nextInt()\n if (w%2==0){\n println(\"Yes\")}else{\n println(\"No\")}\n}\n\n", "lang": "Kotlin", "bug_code_uid": "b65e891037745658d6d3b1d2fd5702d2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "51e80abca9a04d2eedec96d961183329", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9347826086956522, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "fun main() {\n val w = readLine()!!.first()\n if (w % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "3980af631dc098250111019a0c8386c9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b96f5ad6195bf2982360701bcfb0392f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9438943894389439, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "fun main() {\n val w = readLine()!!.first().toInt()\n if (w % 2 == 0 && w > 2) {\n println(\"YES\")\n \n } else {\n println(\"NO\")\n }\n}", "lang": "Kotlin", "bug_code_uid": "a5db40f2b451572caba88daa2a4e0764", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b96f5ad6195bf2982360701bcfb0392f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8608247422680413, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import java.util.*\n\nfun main() {\n val reader = Scanner(System.`in`)\n var integer:Int = reader.nextInt()\n integer = if(integer > 100) 100 else integer;\n println(if(integer % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "1266fd11a9c008aa56f2a4d7f4385326", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9e3bc4c3cb34d149143d174d3c0db957", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9264005858659832, "equal_cnt": 40, "replace_cnt": 1, "delete_cnt": 38, "insert_cnt": 1, "fix_ops_cnt": 40, "bug_source_code": "import java.io.*\nimport java.util.*\n\n\nobject Main {\n\n @JvmStatic\n fun main(args: Array) {\n val inputStream = System.`in`\n val outputStream = System.out\n val input = InputReader(inputStream)\n val output = PrintWriter(outputStream)\n val solver = Task()\n solver.solve(input, output)\n output.close()\n }\n\n class Task {\n\n private val minWeight = 1\n private val maxWeight = 100\n\n fun solve(input: InputReader, output: PrintWriter) {\n val weight = input.nextInt()\n\n if (weight < minWeight || weight > maxWeight) {\n output.print(\"NO\")\n } else {\n output.print(if (weight % 2 == 0) \"YES\" else \"NO\")\n }\n }\n }\n\n\n class InputReader(stream: InputStream) {\n private var reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)\n private var tokenizer: StringTokenizer? = null\n\n\n operator fun next(): String {\n while (tokenizer == null || tokenizer?.hasMoreTokens()?.not() == true) {\n try {\n tokenizer = StringTokenizer(reader.readLine())\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n }\n return tokenizer!!.nextToken()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n }\n}\n\n", "lang": "Kotlin", "bug_code_uid": "6282f23748fec5e798994266795f598e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "dca18ed371d691b7bd537af7b26a6810", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9933202357563851, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import java.io.*\nimport java.util.*\n\n\nfun main(args: Array) {\n val inputStream = System.`in`\n val outputStream = System.out\n val input = InputReader(inputStream)\n val output = PrintWriter(outputStream)\n val solver = Task()\n solver.solve(input, output)\n output.close()\n}\n\nclass Task {\n\n private val minWeight = 1\n private val maxWeight = 100\n\n fun solve(input: InputReader, output: PrintWriter) {\n val weight = input.nextInt()\n\n if (weight < minWeight || weight > maxWeight) {\n output.print(\"NO\")\n } else {\n output.print(if (weight % 2 == 0) \"YES\" else \"NO\")\n }\n }\n}\n\n\nclass InputReader(stream: InputStream) {\n private var reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)\n private var tokenizer: StringTokenizer? = null\n\n\n operator fun next(): String {\n while (tokenizer == null || tokenizer?.hasMoreTokens()?.not() == true) {\n try {\n tokenizer = StringTokenizer(reader.readLine())\n } catch (e: IOException) {\n throw RuntimeException(e)\n }\n\n }\n return tokenizer!!.nextToken()\n }\n\n fun nextInt(): Int {\n return Integer.parseInt(next())\n }\n\n}", "lang": "Kotlin", "bug_code_uid": "2b2e5d815716a7ab9198bfabf388a1ad", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "dca18ed371d691b7bd537af7b26a6810", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.6952789699570815, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "fun main() {\n val v = readLine()!!.toInt()\n return if (v % 2 != 0) {\n \"NO\"\n } else {\n \"YES\"\n }\n}", "lang": "Kotlin", "bug_code_uid": "edce05c21a177c891c7fc55f0ca7fe9f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "65694e7caacc145434e331f0d45ea61a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.8484848484848485, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n if (readLine()!!.toInt() % 2 != 0) println(\"NO\") else println(\"YES\")\n}", "lang": "Kotlin", "bug_code_uid": "743617f0d5066c70e576d24c3ffe3474", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "65694e7caacc145434e331f0d45ea61a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.5346062052505967, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 9, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "fun main(args: Array) {\n while (true) {\n print(\"Enter an integer or 0 to finish : \")\n val n = readLine()!!.toInt()\n when {\n n == 0 -> return\n n % 2 == 0 -> println(\"YES\")\n else -> println(\"NO\")\n }\n }\n}\n", "lang": "Kotlin", "bug_code_uid": "2fa8e50c86adba54ed3078a274f71e17", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f903076566945cfc163a72093df91989", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.9848484848484849, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": " fun main(){\n var N: Int = readLine()!!.toInt()\n if (N%2==0 && n!=2) println(\"YES\")\n else println(\"NO\")\n }\n\n", "lang": "Kotlin", "bug_code_uid": "b660812e0dec9e1c6cd4e7f07b99dfed", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f903076566945cfc163a72093df91989", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9510086455331412, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import java.util.Scanner;\n\nvoid main(){\n var sc = Scanner(System.`in`)\n var a = sc.nextInt()\n if(a % 2 == 0)\n print(\"YES\")\n else\n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "67340e65cfbe1643d49a2d696cf48a59", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "69b36d0b19d5a04964474f31b2052c37", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9740634005763689, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.Scanner;\n \nfun main(){\n var sc = Scanner(System.`in`)\n var a = sc.nextInt()\n if(a % 2 == 0)\n print(\"YES\")\n else\n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "7e3df45a31ae2cbe33a24e6a92fcca86", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "69b36d0b19d5a04964474f31b2052c37", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.5391304347826087, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "fun count(kilo: Int) :Boolean{\n return kilo%2==0 && (kilo/2)%2==0\n}", "lang": "Kotlin", "bug_code_uid": "39bb74fe872ea571fdad6dccf56fd0ef", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0d46a3fda9eb2fd91abc21271bacb116", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Kotlin"} {"similarity_score": 0.8285714285714286, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "fun main() {\n print(count(readLine()!!.toInt()))\n}\n\nfun count(kilo: Int) :Boolean{\n return kilo%2==0 && kilo!=2\n}\n", "lang": "Kotlin", "bug_code_uid": "7422d91f8bfa48d5328eb6ac4c6d194d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0d46a3fda9eb2fd91abc21271bacb116", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9855630413859481, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n\n val sc = Scanner(System.`in`)\n while (sc.hasNextInt()) {\n if (canDivide(sc.nextInt())) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n }\n}\n\nfun canDivide(value: Int): Boolean {\n if (value % 2 == 0) {\n var half = value / 2\n if (half % 2 == 0) {\n return true\n } else {\n half += 1\n return half % 2 == 0\n }\n } else {\n return false\n }\n}", "lang": "Kotlin", "bug_code_uid": "faf334de508afa64981f26feaf5b69b4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e492f6683b4490fff5142692f4b6d729", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.2960812772133527, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "fun main(args: Array) {\n\n val number = args.get(0).toInt()\n if (number % 2 == 0) {\n println(\"YES\")\n } else {\n println(\"NO\")\n }\n\n}", "lang": "Kotlin", "bug_code_uid": "724b7e0175776788d7171d8c765244fa", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e492f6683b4490fff5142692f4b6d729", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9288135593220339, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "fun main(args:Array){\n var w:Int = readLine()!!.toInt()\n if((w%2) == 1)\n print(\"NO\")\n else\n print(\"YES\")\n}\n ", "lang": "Kotlin", "bug_code_uid": "c5cc41c0a1bfd149a095e1eacdc636e4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3c8f49db8da96f1850032b7775fda415", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.9215686274509803, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "fun main(args:Array){\n var w:Int = readLine()!!.toInt()\n if((w%2 && w/2 > 1) == 1)\n print(\"NO\")\n else\n print(\"YES\")\n}\n ", "lang": "Kotlin", "bug_code_uid": "d92bb9fbc6bf53bc5443917b39d0cd93", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3c8f49db8da96f1850032b7775fda415", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.4978540772532189, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "fun main(args: Array) {\n\n if (args[0].toInt() % 2 == 0) println(\"YES\") else println(\"YES\")\n\n}", "lang": "Kotlin", "bug_code_uid": "409a6e76747e7d49044c33b439112d39", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2c39ff28b87d612e530e94d59025eb78", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.7889908256880734, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "fun main() {\n\n if (readLine()!!.toInt() % 2 == 0) println(\"YES\") else println(\"NO\")\n\n}", "lang": "Kotlin", "bug_code_uid": "48835d8dd6a9bd91245977e527ced608", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2c39ff28b87d612e530e94d59025eb78", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.7706422018348624, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "import java.util.*\n\nfun checkWatermelon() {\n val input = Scanner(System.in)\n val weight = input.nextInt()\n\n if (weight % 2 == 0) \n print(\"YES\")\n else \n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "ddaebf36361813c639deacdb4e62bde6", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b4b06ba03acc5027456ec35a81464fbe", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.8073394495412844, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 11, "bug_source_code": "import java.util.*\n\nfun checkWatermelon() {\n val input = Scanner(System.`in`)\n val weight = input.nextInt()\n\n if (weight % 2 == 0)\n print(\"YES\")\n else\n print(\"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "16d6999666aa4dc2f418ceaa6f8aca01", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b4b06ba03acc5027456ec35a81464fbe", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9705882352941176, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\n fun main(args: Array) {\n val input = Scanner(System.`in`)\n val weight = input.nextInt()\n\n if (weight % 2 == 0)\n print(\"YES\")\n else\n print(\"NO\")\n }", "lang": "Kotlin", "bug_code_uid": "6935883e1a36c3a15f0f4dcbd8f0a8dd", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b4b06ba03acc5027456ec35a81464fbe", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9900497512437811, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import java.util.Scanner\n\nfun main(args: Array) {\n\n val input1 = Scanner(System.`in`)\n val n: Int = input1.nextInt()\n\nif (n%2!==0 && n<=2) {\n print(\"NO\")\n} else {\n print(\"YES\")\n}\n\n}", "lang": "Kotlin", "bug_code_uid": "f172bcc55b835cbc77cbed346bea629f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "aceaf65de26f988d0f48d59c55631c44", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"} {"similarity_score": 0.970873786407767, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import java.util.*\n\nfun main(args: Array) {\n val a = Scanner(System.`in`).nextInt()\n System.out.print(if (a % 2 == 0) \"YES\" else \"NO\")\n}", "lang": "Kotlin", "bug_code_uid": "c9eff79f9701a954f20bd80e178f24ae", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e313fb7434396f79a9d246f9b17b717f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.995475113122172, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "fun main() {\n val r = System.`in`.bufferedReader()\n val s = StringBuilder()\n val a = r.readLine()!!.toInt()\n val b = r.readLine()!!.toInt()\n val c = r.readLine()!!.toInt()\n println(minOf(a, b/2, c/4))\n}", "lang": "Kotlin", "bug_code_uid": "8026aba74644bfc527e1db392ae98916", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "f8132ecc8be4237ba5c5b7f58c679e3e", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Kotlin"} {"similarity_score": 0.9860417653704581, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import java.io.*\nimport java.math.BigDecimal\nimport java.math.BigInteger\nimport java.util.*\n\n\nobject programkt {\n interface Scanner {\n fun changeInputStream(inputStream: InputStream)\n fun nextInt(): Int\n fun nextLong(): Long\n fun nextDouble(): Double\n fun nextChar(): Char\n fun nextString(): String\n fun nextLine(): String\n fun nextBigInteger(): BigInteger\n fun nextBigDecimal(): BigDecimal\n }\n\n abstract class Task {\n //KT Extensions\n fun > min(a: T, b: T) = if (a > b) b else a\n fun > max(a: T, b: T) = if (a < b) b else a\n fun abs(a: Int) = if (a > 0) a else -(a)\n fun abs(a: Long) = if (a > 0) a else -(a)\n fun abs(a: Float) = if (a > 0) a else -(a)\n fun abs(a: Double) = if (a > 0) a else -(a)\n operator fun Iterable.invoke(function: (it: T) -> Unit) { this.forEach(function) }\n private fun String.prefix(pi: Array): Array {\n pi[0] = 0\n (1 until this.length) {\n var j = pi[it - 1]\n while (j > 0 && this[it] != this[j]) {\n j = pi[j - 1]\n }\n if(this[it] == this[j]) {\n j++\n }\n pi[it] = j\n }\n return pi\n }\n private fun String.kmpFind(pattern: String): Int {\n val m = pattern.length\n val dfa = Array(256) { IntArray(m) }\n dfa[pattern[0].toInt()][0] = 1\n var x = 0\n var j = 1\n while (j < m) {\n for (c in 0 until 256) {\n dfa[c][j] = dfa[c][x] // Copy mismatch cases.\n }\n dfa[pattern[j].toInt()][j] = j + 1 // Set match case.\n x = dfa[pattern[j].toInt()][x] // Update restart state.\n j++\n }\n\n val n = this.length\n var i: Int = 0\n j = 0\n while (i < n && j < m) {\n j = dfa[this[i].toInt()][j]\n i++\n }\n if (j == m) return i - m // found\n return n // not found\n }\n fun fuckExceptions(invoker: () -> Unit) = try { invoker.invoke() } catch (_: Throwable) {}\n\n enum class EdgeType {\n DIRECTED,\n UNDIRECTED\n }\n data class Vertex>(\n val data: T\n ) {\n override fun toString(): String = \"V:$data\"\n }\n data class Edge>(\n var source: Vertex,\n var destination: Vertex,\n val weight: Double?\n )\n interface Graphable> {\n fun createVertex(data: T): Vertex\n fun add(type: EdgeType, source: Vertex, destination: Vertex, weight: Double? = 0.0)\n fun weight(source: Vertex, destination: Vertex): Double?\n fun edges(source: Vertex): MutableList>?\n }\n class AdjacencyList>: Graphable {\n var adjacencyMap: MutableMap, MutableList>> = mutableMapOf()\n\n private fun addDirectedEdge(source: Vertex, destination: Vertex, weight: Double?) {\n adjacencyMap[source]?.add(Edge(source = source, destination = destination, weight = weight))\n }\n\n private fun addUndirectedEdge(source: Vertex, destination: Vertex, weight: Double?) {\n addDirectedEdge(source, destination, weight)\n addDirectedEdge(destination, source, weight)\n }\n\n override fun createVertex(data: T): Vertex {\n val vertex = Vertex(data = data)\n adjacencyMap[vertex] ?: run {\n adjacencyMap[vertex] = mutableListOf()\n }\n return vertex\n }\n\n override fun add(type: EdgeType, source: Vertex, destination: Vertex, weight: Double?) = when(type) {\n EdgeType.DIRECTED -> addDirectedEdge(source, destination, weight)\n EdgeType.UNDIRECTED -> addUndirectedEdge(source, destination, weight)\n }\n\n override fun weight(source: Vertex, destination: Vertex): Double? {\n adjacencyMap[source]?.forEach {\n if(it.destination == destination) return it.weight\n }\n return null\n }\n\n override fun edges(source: Vertex): MutableList>? = adjacencyMap[source]\n\n override fun toString(): String {\n var result = \"\"\n for ((vertex, edges) in adjacencyMap) {\n var edgeString = \"\"\n for ((index, edge) in edges.withIndex()) {\n edgeString += if (index != edges.count() - 1) \"${edge.destination}, \"\n else \"${edge.destination}\"\n }\n result += \"$vertex ---> [ $edgeString ] \\n\"\n }\n return result\n }\n\n fun depthFirstSearch(start: Vertex, end: Vertex): Stack> {\n val visited: HashSet> = hashSetOf()\n val stack: Stack> = Stack()\n stack.push(start)\n visited.add(start)\n\n var currentVertex = stack.peek()\n loop@while (currentVertex != null && currentVertex != end) {\n val neighbors = edges(currentVertex)\n if(neighbors != null && neighbors.count() > 0) {\n for(edge in neighbors) {\n if(!visited.contains(edge.destination)) {\n visited.add(edge.destination)\n stack.push(edge.destination)\n currentVertex = stack.peek()\n continue@loop\n }\n }\n } else {\n stack.pop()\n currentVertex = stack.peek()\n continue\n }\n\n stack.pop()\n currentVertex = stack.peek()\n }\n\n return stack\n }\n\n fun breadthFirstSearch() {\n\n }\n\n fun floydWarshallAlgorythm(): Pair, Array> {\n val nVertices = this.adjacencyMap.size\n\n val weights = Array(nVertices) { Array(nVertices-1) { 0.0 } }\n this.adjacencyMap\n .asSequence()\n .map { it.value }\n .withIndex()\n .forEach { (index, weightsOfVertex) ->\n weightsOfVertex.asSequence()\n .withIndex()\n .forEach { (weightIndex, weight) ->\n weights[index][weightIndex] = weight.weight!!\n }\n }\n\n val dist = Array(nVertices) { DoubleArray(nVertices) { Double.POSITIVE_INFINITY } }\n for (w in weights) dist[(w[0] - 1).toInt()][(w[1] - 1).toInt()] = w[2]\n val next = Array(nVertices) { IntArray(nVertices) }\n for (i in 0 until next.size) {\n for (j in 0 until next.size) {\n if (i != j) next[i][j] = j + 1\n }\n }\n for (k in 0 until nVertices) {\n for (i in 0 until nVertices) {\n for (j in 0 until nVertices) {\n if (dist[i][k] + dist[k][j] < dist[i][j]) {\n dist[i][j] = dist[i][k] + dist[k][j]\n next[i][j] = next[i][k]\n }\n }\n }\n }\n return dist to next\n }\n }\n\n fun > TreeMap>.toAdjacencyList(type: EdgeType): AdjacencyList {\n val list = AdjacencyList()\n\n this.keys.forEach { list.createVertex(it) }\n this.entries\n .asSequence()\n .withIndex()\n .forEach { (x, edge) ->\n val vertex = list.createVertex(edge.key)\n edge.value\n .asSequence()\n .withIndex()\n .forEach { (y, weight) ->\n if(weight != .0 && y != x)\n list.add(type, vertex, list.createVertex(this.keys.elementAt(y)), weight)\n }\n }\n return list\n }\n //End KT Extensions\n\n abstract fun solve(scanner: Scanner, printer: PrintWriter)\n }\n\n class FastScanner: Scanner {\n var inputStream: InputStream? = null\n override fun changeInputStream(inputStream: InputStream) {\n this.inputStream = inputStream\n this.bufferedReader = BufferedReader(InputStreamReader(inputStream))\n }\n\n private lateinit var bufferedReader: BufferedReader\n private var stringTokenizer: StringTokenizer? = null\n\n private fun nextToken(): String? {\n while (stringTokenizer == null || !stringTokenizer!!.hasMoreTokens())\n stringTokenizer = StringTokenizer(bufferedReader.readLine() ?: return null)\n return stringTokenizer!!.nextToken()\n }\n\n override fun nextInt() = nextToken()!!.toInt()\n override fun nextLong() = nextToken()!!.toLong()\n override fun nextDouble() = nextToken()!!.toDouble()\n override fun nextChar() = bufferedReader.read().toChar()\n override fun nextString() = nextToken()!!\n override fun nextLine() = bufferedReader.readLine()!!\n override fun nextBigInteger() = BigInteger(nextToken()!!)\n override fun nextBigDecimal() = BigDecimal(nextToken()!!)\n }\n\n class TaskBuilder {\n private var task: Task? = null\n private var inputStream: InputStream? = null\n private var outputStream: OutputStream? = null\n private var scanner: Scanner? = null\n\n fun useInputSource(inputStream: InputStream): TaskBuilder {\n this.inputStream = inputStream\n return this\n }\n\n fun useOutputSource(outputStream: OutputStream): TaskBuilder {\n this.outputStream = outputStream\n return this\n }\n\n fun useInputFile(inputFileName: String): TaskBuilder {\n this.inputStream = FileInputStream(File(inputFileName))\n return this\n }\n\n fun useOutputFile(outputFileName: String): TaskBuilder {\n this.outputStream = FileOutputStream(File(outputFileName))\n return this\n }\n\n fun useScanner(scanner: Scanner): TaskBuilder {\n this.scanner = scanner\n return this\n }\n\n\n fun solveTask(task: Task): TaskBuilder {\n this.task = task\n return this\n }\n\n fun run() {\n when {\n task == null -> throw NullPointerException(\"Task cannot be null!\")\n inputStream == null -> throw NullPointerException(\"Input cannot be null!\")\n outputStream == null -> throw NullPointerException(\"Output cannot be null!\")\n scanner == null -> throw NullPointerException(\"Scanner cannot be null!\")\n }\n scanner!!.changeInputStream(inputStream!!)\n val printer = PrintWriter(outputStream)\n TaskRunnable(task!!, scanner!!, printer).run()\n\n inputStream!!.close()\n printer.close()\n }\n\n class TaskRunnable(\n private val task: Task,\n private val scanner: Scanner,\n private val printer: PrintWriter\n ) {\n fun run() {\n task.solve(scanner, printer)\n }\n }\n }\n\n @JvmStatic\n fun main(args: Array) = TaskBuilder()\n .useInputSource(System.`in`)\n .useOutputSource(System.out)\n .useScanner(FastScanner())\n .solveTask(TaskA())\n .run()\n\n\n class TaskA: Task() {\n override fun solve(scanner: Scanner, printer: PrintWriter) {\n val (firstValency, secondValency, thirdValency) = scanner.nextLine()\n .split(\" \")\n .map { it.toLong() }\n val averageValency = (firstValency + secondValency + thirdValency) / 2\n val countOfConnectionsFirst = averageValency - thirdValency\n val countOfConnectionsSecond = averageValency - firstValency\n val countOfConnectionsThird = averageValency - secondValency\n\n when {\n (firstValency + secondValency + thirdValency) / 2 % 1 != 0L -> { printer.println(\"Impossible\"); return }\n countOfConnectionsFirst < 0 -> { printer.println(\"Impossible\"); return }\n countOfConnectionsSecond < 0 -> { printer.println(\"Impossible\"); return }\n countOfConnectionsThird < 0 -> { printer.println(\"Impossible\"); return }\n else -> printer.println(\"$countOfConnectionsFirst $countOfConnectionsSecond $countOfConnectionsThird\")\n }\n }\n\n }\n}\n", "lang": "Kotlin", "bug_code_uid": "c983f2446dc65355e6b62db0d844a9ef", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "64c15e842e19de0625f7e467ecedbe88", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Kotlin"}