{"similarity_score": 0.13714285714285715, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "def run\n h, n = $stdin.gets.split.map(&:to_i)\n answer = solve(h, n, 0, true)\n puts answer\nend\n\ndef solve(h, n, sum, is_move_left)\n return sum if h == 0\n\n left_all_nodes = (2 ** h) - 1\n left_leaf_nodes = 2 ** (h - 1)\n\n if n > left_leaf_nodes && is_move_left == true\n solve(h - 1, n - left_leaf_nodes, sum + left_all_nodes + 1, true)\n else\n solve(h - 1, n, sum + 1, !is_move_left)\n end\nend\n\nrun if $0 == __FILE__\n", "lang": "Ruby", "bug_code_uid": "49d79f0882da5cd97e487b4fff92fcfd", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "4b32ab60057b57c08dbc1415db383c40", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9923954372623575, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "k, n = gets.chomp.split.map{|i| i.to_i}\nm, ans, offset, flag = 2 ** k, 0, 0, false\nwhile m != 1\n m /= 2\n if flag ^ (offset + m >= n)\n ans += 1\n flag != flag\n offset += m unless flag\n else\n ans += 2 * m\n offset += m unless flag\n end\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "a24935335303f0edf2b082f2edca5f81", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "dd94fafb051dcc529fdd5da5e56f60c7", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9685534591194969, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\nm = gets.chomp.to_i\na = []\n\nn.times.each do |_|\n\ta << gets.chomp.to_i\nend\n\nputs \"#{(((a.reduce(&:+) + m) * 1.0)/n).ceil} #{a.max + m}\"", "lang": "Ruby", "bug_code_uid": "419337d7bf3c9283efc77b4f723ec38f", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "433bcd9e2621f7e8f4684d00b74b2e57", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9683698296836983, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\nm = gets.to_i\n\nmaxa = 0\nsuma = 0\n\nn.times do \n ai = gets.to_i\n maxa = ai if ai > maxa\n suma += ai\nend\n\nmink = ((suma + m).to_f / n).ceil\nmaxk = maxa + m\n\nputs \"#{mink} #{maxk}\"\n", "lang": "Ruby", "bug_code_uid": "7e0b88115844fb17f19d752a042af6aa", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "3379b357c76fa7871067e75116665ebe", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5047770700636943, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "def matches(a,b,dx,dy,ft,gt)\n if dx == 0\n return false unless a - ft == 0\n end\n\n if dy == 0\n return false unless b - gt == 0\n end \n return true if dx == 0 and dy == 0\n\n if dx != 0\n l1 = (a - ft) % dx\n l3 = ((a - ft)/dx > 0)\n x5 = (a - ft)/dx\n else\n l1 = (a - gf == 0)\n l3 = l3\n x5 = 0\n end\n\n if dy != 0\n l2 = (b - gt) % dy\n l4 = ((b - gt)/dy > 0)\n x6 = (b - gt)/dy\n else\n l2 = (b - gt == 0)\n l4 = l4\n x6 = 0\n end\n return (l1 and l2 and l3 and l4 and (x5 == x6))\nend\n\ndef pair(x)\n return [0,1] if x == \"U\"\n return [0,-1] if x == \"D\"\n return [-1,0] if x == \"L\"\n return [1,0] if x == \"R\"\n return [0,0]\nend\n\ndef build(mov)\n moves = [[0,0]]\n mov.split(//).each_with_index do |x| \n p = pair(x)\n moves << [moves.last[0] + p[0], moves.last[1] + p[1]]\n end\n {:dx => moves.last[0] - 0, :dy => moves.last[1] - 0, :moves => moves}\nend\n\ndef run(mov,a,b)\n f = build(mov)\n dx = f[:dx]\n dy = f[:dy]\n f[:moves].each do |x|\n return \"Yes\" if matches(a,b,dx,dy,x[0],x[1]) \n end\n return \"No\"\nend\n\npairs = []\nSTDIN.read.split(\"\\n\").each_with_index do |line,i|\n pairs = line.split(\" \") if i % 3 == 0\n puts run(line,pairs[0].to_i,pairs[1].to_i) if i % 3 == 1\nend", "lang": "Ruby", "bug_code_uid": "26579b10441dafcbf2f894b8878fcf76", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "af3fa63d3fd010c2ff0a66d9010cf9ec", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8306451612903226, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n,m=gets.split(' ')\nk=n\ndays=0\nwhile k>0\n days+=1\n k=k-1\n if days % m == 0\n k=k+1\n end\nend\nputs days", "lang": "Ruby", "bug_code_uid": "0755fb0bb3fe03d57b236d3582917cd2", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "46bfd8144ae911c60aa967cd4d973757", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n,m=gets.split.map(&:to_i)\n\nx=(m*n)/(m-1)\nif (x==n+x/m)\n puts x\nelse\n puts x-1\nend", "lang": "Ruby", "bug_code_uid": "88ca871d0b4ae8ba7d490fa668b3d3b2", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "29efe657c760d883d49f1ea19116bbd5", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9873239436619718, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nd = []\nn.times do |i|\n d.push(gets.split.map(&:to_i))\nend\nfoo = []\n1.upto((1 << n)-1) do |i|\n hoge = []\n n.times do |j|\n if (i & (1 << j)) > 0\n hoge.push(j)\n end\n end\n hoge.permutation.to_a.each do |arr|\n (6 ** arr.size).times do |j|\n tmp = 0\n arr.size.times do |k|\n idx = j % 6\n j /= 6\n tmp *= 10\n tmp += d[arr[k]][idx]\n end\n foo.push(tmp)\n end\n end\nend\nfoo.uniq!.sort!\nif foo[0] == 0\n foo.shift\nend\nans = 0\nidx = 0\nloop {\n if foo[idx] == ans + 1\n ans += 1\n idx += 1\n else\n break\n end\n }\nputs ans", "lang": "Ruby", "bug_code_uid": "ed45bb0755cebf07f4701d0c1dbad509", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "fb481eb958e00908926b2b6cb0e89a2c", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9553805774278216, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\ndef pos(n)\n bbt = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\n i = 1\n while n > 5*i\n n -= 5*i\n i*= 2\n end\n return bbt[-(-n / i) - 1] \nend\n\nn = gets.split.map &:to_i;\np pos(n)", "lang": "Ruby", "bug_code_uid": "8b852f1032736028b9dcedc32da54923", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "d5faa7be00814c595c7c699e92c68bb6", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.4629156010230179, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "#n = 10010\nn = gets.to_i\n\n#1 => Sheldon\n#5 => Howard\n#10 => Penny\n#534 => Rajesh\n#1802 => Penny\n#5033 => Howard\n#10010 => Howard\n\n\nline = ['Sheldon', 'Leonard', 'Penny', 'Rajesh', 'Howard']\n\nres = nil\ni = 1\n#puts i\nk = n\n#puts k\nif n > 5\n i_n = 5\n until i_n <= n\n i += 1\n i_n += (2**i)*5\n end\n new_line = line.map{|a| [a]*(i + 1)}.flatten\n #puts new_line\n #puts n, i_n\n k = n - i_n\n k.times do\n res = current = new_line.shift\n 2.times {new_line.push current}\n end\nelse\n res = line[k - 1]\nend\n\nputs res\n", "lang": "Ruby", "bug_code_uid": "505249a737d89bb70230bd813bc1dc94", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "f0614c5c701e89321687d44bff25dcb7", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9933333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = Integer(gets)\nm = -1\nfor i in 1..n\n if n > (2**(i-1) -1) * 5 && n <= (2**i -1) * 5\n m = i\n end\nend\n\nc = 2**(m - 1) - 1\nif n > c * 5 && n <= c * 5 + 2**(m - 1)\n puts \"Sheldon\"\nelsif \n n > c * 5 + 2**(m-1) && n <= c * 5 + 2*2**(m-1)\n puts \"Leonard\"\nelsif n > c * 5 + 2*2**(m-1) && n <= c * 5 + 3*2**(m-1)\n puts \"Penny\"\nelsif n > c * 5 + 3*2**(m-1) && n <= c * 5 + 4*2**(m-1)\n puts \"Rajesh\"\nelse\n puts \"Howard\"\nend", "lang": "Ruby", "bug_code_uid": "1c2e20f2be90c880769976cfecf36769", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "0560d9adc59536773238114764c15f37", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.985792349726776, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = Integer(gets)\nm = -1\nfor i in 1..100\n if n > (2**(i-1) -1) * 5 && n <= (2**i -1) * 5\n m = i\n end\nend\n\nc = 2**(m - 1) - 1\nif n > c * 5 && n <= c * 5 + 2**(m - 1)\n puts \"Sheldon\"\nelsif \n n > c * 5 + 2**(m-1) && n <= c * 5 + 2*2**(m-1)\n puts \"Leonard\"\nelsif n > c * 5 + 2*2**(m-1) && n <= c * 5 + 3*2**(m-1)\n puts \"Penny\"\nelsif n > c * 5 + 3*2**(m-1) && n <= c * 5 + 4*2**(m-1)\n puts \"Rajesh\"\nelse\n puts \"Howard\"\nend\nputs log(10)", "lang": "Ruby", "bug_code_uid": "d4740effa3137b2e64cba1ba60731aba", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "0560d9adc59536773238114764c15f37", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6761133603238867, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "def f(n)\n\ts = \"01234\"\n\tfor i in (1...n)\n\t\ts = s[1..-1] + s[0] * 2\n\tend\n\t\n\treturn s[0]\nend\n\ncase f(gets.to_i).to_i\n\twhen 0\n\t\tputs \"Sheldon\"\n\twhen 1\n\t\tputs \"Leonard\"\n\twhen 2\n\t\tputs \"Penny\"\n\twhen 3\n\t\tputs \"Rajesh\"\n\twhen 4\n\t\tputs \"Howard\"\nend", "lang": "Ruby", "bug_code_uid": "95451b899ef4f11676dd3173b3a78b76", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "9c8b861d7647d520eeb8452e85208275", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.47317073170731705, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "m = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\nn = gets.to_i\nx = \"\"; rate = 1\nwhile x.size <= n do\n 5.times do |i|\n x += i.to_s * rate\n end\n rate *= 2\nend\nputs m[x[n-1].to_i]\n", "lang": "Ruby", "bug_code_uid": "1477bde9b37bd842ad7fb90839a7d6a9", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "e9d801581a68a18c80b8530677d85af2", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.37339055793991416, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "m = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\nn = gets.to_i\nnum = 5\ncount = 0\ni = 0\nwhile true\n i += 1\n break if i >= n\n if count+1 == num\n count = 0\n num *= 2\n else\n count += 1\n end\nend\nputs m[count / (num/5)]", "lang": "Ruby", "bug_code_uid": "2d1075517d3c767c72ac9bce7ee3643b", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "e9d801581a68a18c80b8530677d85af2", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4543761638733706, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "n = gets.to_i\na = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\nz = []\nt = 1\nc = 0\nloop do\n\t5.times do |i|\n\t\tt.times do\n\t\t\tz.push a[i]\n\t\t\tc += 1\n\t\tend\n\tend\n\tt *= 2\n\tbreak if c >= n\nend\nputs z[n-1]\n", "lang": "Ruby", "bug_code_uid": "fe459fffc5cccd02116269990c4fb719", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "0ce8e84e4703492be649c8567edd9321", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4668304668304668, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a = gets.to_i\nnames = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\ni = 1\nwhile i < a\n\tnames.push(names.first)\n\tnames.push(names.first)\n\tnames.shift\n\ti += 1\nend\n\nputs names.first", "lang": "Ruby", "bug_code_uid": "a454a09d8369ea35c555ba404e7e8a8d", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "719de75a05d593da575b4a375683d42e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9766454352441614, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\n\nif (n <= 5)\n puts [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"][n - 1]\nelse\n i = 5\n while n >= i do\n n -= i\n i = i << 1\n end\nend\nputs [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"][(n/(i/5))]\n", "lang": "Ruby", "bug_code_uid": "cc6789fc8dafab47c667dadfb9b0aa74", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "028e1d29f6e296ec2c6bf307cbdf11c7", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9941860465116279, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "class Integer\n def divisers\n n=self\n res = []\n res << 1\n i=1\n while i*i <= n\n if n%i==0\n res << i\n res << n/i if i*i!=n\n end\n i+=1\n end\n res.sort!\n end\nend\n\ndef solve n,m,k\n ds = n.divisers\n if n-1+m-1= t\n num += 1\n end\n end\n p num\nend\n", "lang": "Ruby", "bug_code_uid": "e9549ac7270c28eae559a3f42643f1c5", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9a0930b0e9f0a0672920d49276e90342", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.35294117647058826, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "n = gets.split(' ')\narray = gets.split(' ')\ncountof = 0\narray.each do \n |i| \n if ((i.to_i > 0) && (i.to_i > array[n[1].to_i]))\n countof += 1\n end\nend\nputs countof", "lang": "Ruby", "bug_code_uid": "a263119a8b7c42b6bbfcf1495632f279", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "43f4154fa1c7592746780291db01ff7d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6912928759894459, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 13, "bug_source_code": "n = gets.to_i\nk = gets.to_i\na = Array.new(n)\n\ni = 0\nwhile i < n do\n a[i] = gets.to_i\n i += 1\nend\n\ni = 0\nans = 0\nwhile i < n do\n if a[i] >= a[k - 1] && a[i] > 0\n ans += 1\n end\n i += 1\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "32e333dcbd298840db165181bf6d13fa", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "198e3b3e0f89d2f028d43381271a9940", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9823529411764705, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "temp = gets.split\nn = temp[0].to_i\nk = temp[1].to_i\ntemp = gets.split\ntemp.sort!{|x, y| y.to_i <=> x.to_i}\nt = temp[k-1].to_i\nputs temp {|x| x.to_i >= t && x.to_i > 0}", "lang": "Ruby", "bug_code_uid": "7992d723f45061a60e9c3372c6711a1d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "429f78074004d20ce045e7e6a822935a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9936305732484076, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "_, k = gets.split(\" \").map(&:to_i)\narr = gets.split(\" \").map(&:to_i)\n\narr = arr.select { |n| n >= arr[k] }\narr = arr.reject { |n| n <= 0 }\n\nputs arr.length\n", "lang": "Ruby", "bug_code_uid": "53b5f1356436d5310450d87b177722bf", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "366bb497bac41cd2e54650f99d36c28b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9750479846449136, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "input1 = gets.chomp\ninput2 = gets.chomp\n\nint_input1 = input1.split(\" \").map(&:to_i)\nint_input2 = input2.split(\" \").map(&:to_i)\n\nnum = int_input2[int_input1[1]]\ncount = 0\nint_input2.each do |i|\n if i >= num && i>0\n count= count+1\n end\nend\n\nputs count\n", "lang": "Ruby", "bug_code_uid": "1b148d5f9bdeb20254d5522f2adba50d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "7735264670c92d46012f3a22e1815608", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9913544668587896, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "conf = gets.split(' ').collect &:to_i\nvars = gets.split(' ').collect &:to_i\nk = vars[conf[1]]\n\nk = 1 if k < 1\nresult = vars.select{|v|\n true if v >= k\n}\nputs result.size\n", "lang": "Ruby", "bug_code_uid": "15207bd757bdb9d181f9c2f958b92fc0", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "398b02c0f19a2d2196463ff505e52238", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9527027027027027, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.split.map {|n| n.to_i}\na = gets.split.map {|n| n.to_i}\n\ngoal = a[k - 1]\ni = 0\nwhile a[i] >= goal && a[i] > 0\n i += 1\nend\n\nputs i", "lang": "Ruby", "bug_code_uid": "fa3332ca5b0bdbeac21ca274f1d5b4ff", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "015c172918c758efe0aaf8cdf1f619fe", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9941520467836257, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.chomp.split(' ').map(&:to_i)\na = gets.chomp.split(' ').map(&:to_i)\na_k = a[k]\n\ncount = 0\na.each do |a_i|\n count += 1 if a_i > 0 && a_i >= a_k\nend\nputs count\n", "lang": "Ruby", "bug_code_uid": "53063ac542be58e7b5c299168626c6e5", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2edb926c36d344d8f19c94acd7fb44f2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9894736842105263, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n, k = gets.split.map(&:to_i)\narr = gets.split.map(&:to_i)\n\n# binary search\n# puts (0...n).bsearch { |i| arr[i] < arr[k] && arr[i]}\n\narr.select! { |i| i >= arr[k] && i > 0}\n\nputs arr.size\n\n\n", "lang": "Ruby", "bug_code_uid": "7449dc07a00e3d2a57feae2b9ba61a24", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "520d5f8a730076a9c787c2ca7f647a21", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.99, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "numbers = gets.chomp.split(' ').map(&:to_i)\nseries = gets.chomp.split(' ').map(&:to_i)\n\ncount = 0\nseries.each do |number|\n count += 1 if number > 0 && number >= series[numbers.last]\nend\nputs count\n", "lang": "Ruby", "bug_code_uid": "4fbd1eecbc5edaaa2a58f24a28584018", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "29d904840b4dbd263692372a554cebdf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7135416666666666, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n,limit = gets.chomp().split(\" \")\npass = 0\nlimit = limit.to_i\nscore = gets.chomp.split(\" \")\nscore.each { |x|\n if x.to_1 >= limit\n pass = pass+1\n end\n}\nputs pass\n", "lang": "Ruby", "bug_code_uid": "d91b8340f6eaba03d3a3f26238b4ebb3", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9484bec37b293cfb74b46634008f666e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.49056603773584906, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "k = gets.split[1].to_i\nscores = gets.split.map{|e| e.to_i }\n\nt = scores[k]\nt = 1 if t == 0\n\nputs scores.count{|e| e >= t}\n\n", "lang": "Ruby", "bug_code_uid": "d92b0d44a87a5660f6ec84e2d7b0c0d4", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "da77a57d635bd7a4f28664b784b62ba5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9700085689802913, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def ptstr(x, y, h)\n\tp = x.to_s + \" \" + y.to_s\n\tif h.key?(p)\n\t\th[p] += 1\n\telse\n\t\th[p] = 1\n\tend\nend\n\nret = true\nar = Array.new(4)\nh = Hash.new\nxlcnt = 0\nylcnt = 0\nfor i in 0..3\n\ta = gets.chomp.split(/ /).map!{|x| x.to_i}\n\ta.each{|x| ret = false if x < 0 }\n\tret = false if a[0] == a[2] && a[1] == a[3]\n\t\n\tif a[0] == a[2]\n\t\txlcnt += 1 \n\telsif a[1] == a[3]\n\t\tylcnt += 1 \n\telse\n\t\tret = false\n\tend\n\tptstr(a[0],a[1], h)\n\tptstr(a[2],a[3], h)\n\tar[i] = a\nend\n\nret = false if xlcnt != 2 || ylcnt != 2 \nret = false if h.count != 4\nh.each{|key, val| ret = false if val != 2 }\n\nif ret\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "dab431ab3e542dad98ecc51c8b8c27fd", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "48dab7a8e4c3bb6b93925fe9fae0ce10", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9691252144082333, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def ptstr(x, y, h)\n\tp = x.to_s + \" \" + y.to_s\n\tif h.key?(p)\n\t\th[p] += 1\n\telse\n\t\th[p] = 1\n\tend\nend\n\nret = true\nar = Array.new(4)\nh = Hash.new\nxlcnt = 0\nylcnt = 0\nfor i in 0..3\n\ta = gets.chomp.split(/ /).map!{|x| x.to_i}\n\ta.each{|x| ret = false if x < 0 }\n\tret = false if a[0] == a[2] && a[1] == a[3]\n\t\n\tif a[0] == a[2]\n\t\txlcnt += 1 \n\telif a[1] == a[3]\n\t\tylcnt += 1 \n\telse\n\t\tret = false\n\tend\n\tptstr(a[0],a[1], h)\n\tptstr(a[2],a[3], h)\n\tar[i] = a\nend\n\nret = false if xlcnt != 2 || ylcnt != 2 \nret = false if h.count != 4\nh.each{|key, val| ret = false if val != 2 }\n\nif ret\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "334b4f30c4ee4dff93c3ae7d6687acba", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "48dab7a8e4c3bb6b93925fe9fae0ce10", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9823255813953489, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def same(pos, p)\n 4.times do | i |\n if pos[i] == p then return i end\n if pos[i] == (p[2..3] + p[0..1]) then return i end\n end\n return -1\nend\ndef solve(pos , xmin, xmax, ymin, ymax)\n ans = Array.new\n ans[0] = same(pos, [xmin, ymin, xmin, ymax])\n ans[1] = same(pos, [xmin, ymin, xmax, ymin])\n ans[2] = same(pos, [xmin, ymax, xmax, ymax])\n ans[3] = same(pos, [xmax, ymin, xmax, ymax])\n# p ans\n ans.sort!\n 4.times do |i|\n if ans[i] != i then return false end\n end\n return true\nend\nxmin = 1000000000\nymin = 1000000000\nxmax = 0\nymax = 0\npos = Array.new\n4.times do \n data = gets.split.map(&:to_i)\n pos.push(data)\n if xmin > data[0] then xmin = data[0] end\n if xmin > data[2] then xmin = data[2] end\n if xmax < data[0] then xmax = data[0] end\n if xmax < data[2] then xmax = data[2] end\n if ymin > data[1] then ymin = data[1] end\n if ymin > data[3] then ymin = data[3] end\n if ymax < data[1] then ymax = data[1] end\n if ymax < data[3] then ymax = data[3] end\nend\n\nif solve(pos, xmin, xmax, ymin, ymax) then\n puts \"YES\"\nelse\n puts \"NO\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "790405920f693d9398173c1d21d855a0", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "83b950fc90dc0351367b7ee2947fcbd3", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9758713136729222, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def solve?\n rec = []\n hen,shu = 0,0\n xx,yy = [],[]\n 4.times{\n x1,y1,x2,y2 = gets.split.map(&:to_i)\n if x1 == x2 then\n shu += 1\n xx << x1\n end\n if y1 == y2 then\n hen += 1\n yy << y1\n end\n rec << [x1,y1,x2,y2]\n }\n return false if shu != 2 || hen != 2\n 4.times do |i|\n return false if rec[i][0] == rec[i][2] &&\\\n (![rec[i][1],rec[i][3]].include?(yy[0]) ||\\\n ![rec[i][1],rec[i][3]].include?(yy[1]))\n return false if rec[i][1] == rec[i][3] &&\\\n (![rec[i][0],rec[i][2]].include?(xx[0]) ||\\\n ![rec[i][0],rec[i][2]].include?(xx[1]))\n end\n return true\nend\n\nputs solve? ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "56d78ea99063ef1e2055365aab1431d9", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "eb9816aeaa29dafa15135e3d666dc41e", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9855769230769231, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x,y=gets.split.map(&:to_i)\nif x > 0 and y > 0\n puts \"0 #{x+y} #{x+y} 0\"\nelsif x > 0 and y < 0\n puts \"0 #{x-y} #{x-y} 0\"\nelsif y > 0\n puts \"#{-(y-x)} 0 0 #{y-x}\"\nelse\n puts \"#{x+y} 0 0 #{x+y}\"\nend\n", "lang": "Ruby", "bug_code_uid": "716e1b4bdb6f80cd23157f540f5528c9", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "80b569a8bccd31f1dacaf82b48d69a75", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.06227106227106227, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "$n = gets.to_i - 1\n$a = gets.split.map(&:to_i)\n$nodes = []\n\ndef explode(lv, dir, x, y)\n return if lv > $n\n case dir\n when 'U'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n x1 -= 1\n y1 += 1\n x2 += 1\n y2 += 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'UL', x1, y1)\n explode(lv + 1, 'UR', x2, y2)\n\n when 'R'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n x1 += 1\n y1 += 1\n x2 += 1\n y2 -= 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'UR', x1, y1)\n explode(lv + 1, 'DR', x2, y2)\n\n when 'D'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n x1 -= 1\n y1 -= 1\n x2 += 1\n y2 -= 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'DL', x1, y1)\n explode(lv + 1, 'DR', x2, y2)\n\n when 'L'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n x1 -= 1\n y1 += 1\n x2 -= 1\n y2 -= 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'UL', x1, y1)\n explode(lv + 1, 'DL', x2, y2)\n\n when 'UR'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n y1 += 1\n x2 += 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'U', x1, y1)\n explode(lv + 1, 'R', x2, y2)\n\n when 'UL'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n y1 += 1\n x2 -= 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'U', x1, y1)\n explode(lv + 1, 'L', x2, y2)\n\n when 'DR'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n y1 -= 1\n x2 += 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'D', x1, y1)\n explode(lv + 1, 'R', x2, y2)\n\n when 'DL'\n x1, x2 = x, x\n y1, y2 = y, y\n $a[lv].times do\n y1 -= 1\n x2 -= 1\n $nodes.push([x1, y1])\n $nodes.push([x2, y2])\n end\n explode(lv + 1, 'D', x1, y1)\n explode(lv + 1, 'L', x2, y2)\n\n end\nend\n\nx, y = 0, 0\n$a[0].times do\n y += 1\n $nodes.push([x, y])\nend\nexplode(1, 'U', x, y)\n\np $nodes.uniq.size\n", "lang": "Ruby", "bug_code_uid": "c84762821ef2d9420d70d888fbc740fb", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "d04cb20a5dff6cabe6fb5ca2e1c9271c", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.21291696238466998, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "$n = gets.to_i - 1\n$a = gets.split.map(&:to_i)\ns = $a.inject(:+)\n$map = Array.new(s * 2){Array.new(s * 2)}\n\ndef explode(lv, dir, x, y)\n return if lv > $n \n # p \"#{lv} #{dir} #{x} #{y}\"\n dir_to = [(dir + 1) % 8, (dir - 1) % 8]\n dir_to.each do |d|\n x1, y1 = x, y\n $a[lv].times do |i|\n x1 -= 1 if d > 4 && d != 0\n x1 += 1 if d < 4 && d != 0\n y1 -= 1 if d < 6 && d > 2\n y1 += 1 if d > 6 || d < 2\n $map[x1][y1] = [lv, d, i] if i != $a[lv] - 1\n end\n if $map[x1][y1].nil? || $map[x1][y1] != [lv, d, $a[lv] - 1]\n $map[x1][y1] = [lv, d, $a[lv] - 1]\n explode(lv + 1, d, x1, y1)\n end\n end\n # p $map.inject(0){|sum, x| sum + x.count{|x| !x.nil?}}\nend\n\nx, y = s - 1, s\n$a[0].times do |i|\n y += 1\n $map[x][y] = [0, 0, i]\nend\nexplode(1, 0, x, y)\n\np $map.inject(0){|sum, x| sum + x.count{|x| !x.nil?}}\n", "lang": "Ruby", "bug_code_uid": "e32d6dd79b13c9c1d2d97041d8793ecf", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "d04cb20a5dff6cabe6fb5ca2e1c9271c", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.16884008236101578, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "$n = gets.to_i - 1\n$a = gets.split.map(&:to_i)\ns = $a.inject(:+)\n$map = Array.new(s * 2){Array.new(s * 2, nil)}\n$dir_from = {\n 'U' => ['UR', 'UL'],\n 'L' => ['UL', 'DL'],\n 'D' => ['DR', 'DL'],\n 'R' => ['UR', 'DR'],\n 'UR' => ['U', 'R'],\n 'UL' => ['U', 'L'],\n 'DR' => ['D', 'R'],\n 'DL' => ['D', 'L']\n}\n\ndef explode(lv, dir, x, y)\n return if lv > $n\n $dir_from[dir].each do |d|\n x1, y1 = x, y\n $a[lv].times do |i|\n x1 -= 1 if d.include?('L')\n x1 += 1 if d.include?('R')\n y1 += 1 if d.include?('U')\n y1 -= 1 if d.include?('D')\n $map[x1][y1] = [lv, d] unless i + 1 == $a[lv]\n end\n if $map[x1][y1].nil? || $map[x1][y1] != [lv, d]\n $map[x1][y1] = [lv, d]\n explode(lv + 1, d, x1, y1)\n end\n end\nend\n\nx, y = s - 1, s\n$a[0].times do\n y += 1\n $map[x][y] = [1, 'U']\nend\nexplode(1, 'U', x, y)\n\np $map.inject(0){|s, x| s + x.count{|x| !x.nil?}}\n", "lang": "Ruby", "bug_code_uid": "163e2c5cd64a259dd953b2d0741a1845", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "d04cb20a5dff6cabe6fb5ca2e1c9271c", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9882352941176471, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets\narr=gets.split.map(&:to_i)\nstack=[]\nans=0\narr.each do |i|\n if stack.size>=2&&stack[-1]<=stack[-2]&&stack[-1]<=i\n if(stack[-2]=2&&stack[-1]<=stack[-2]&&stack[-1]<=i\n ans+=[stack[-2],i].min\n stack.pop\n end\n stack.push i\nend\nstack.sort!\nstack.each do |i|\n ans+=i\nend\np ans-stack[-1]-stack[-2]", "lang": "Ruby", "bug_code_uid": "9b728d4ca8e12f5ad6c3c005abce83f4", "src_uid": "e7e0f9069166fe992abe6f0e19caa6a1", "apr_id": "f9584a7311687bcf4ec326a9d93eade8", "difficulty": 2500, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.95, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "N=gets.to_i\np (3**(3*n)-7**n)%1000000007", "lang": "Ruby", "bug_code_uid": "e4e8ad13b5288b593a6aa4caf61ad1a3", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "474f94a3de588b57725c8e7f03f38e51", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9768753525098702, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.strip.to_i\na = gets.strip.split.map(&:to_i)\nans = \"YES\"\ni = 0\nvisited = Array.new(3, false)\nwhile i < n - 1\n prev = a[i]\n i += 1\n curr = a[i]\n if prev < curr\n if !visited[0]\n visited[0] = true\n else\n if visited[1] || visited[2]\n ans = \"NO\"\n break\n end\n end\n elsif prev == curr\n visited[0] = true if !visited[0]\n if !visited[1]\n visited[1] = true\n else\n if !visited[0] || visited[2]\n ans = \"NO\"\n break\n end\n end\n else\n visited[1] = true if !visited[1]\n if !visited[2]\n visited[2] = true\n else\n if !visited[0] || !visited[1]\n ans = \"NO\"\n break\n end\n end\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "85cf16312d401fe8c0a3c6c9268a26f2", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "a7a7847f826cfba106d51d2d20eb61b5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8514851485148515, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\n\nn, m, i, j, a, b = gets.split.map(&:to_i)\nbest = nil\n[[1,m], [n,1], [n,m], [1,1]].each do |corner|\n dx = (i - corner[0]).abs\n dy = (j - corner[1]).abs\n if dx % a == 0 and dy % b == 0\n tx = dx / a\n ty = dy / b\n if tx % 2 == ty % 2\n turn = [tx, ty].max\n if best.nil? or turn < best\n best = turn\n end\n end\n end\nend\n\nif best\n puts best\nelse\n puts \"Poor Inna and pony!\"\nend\n", "lang": "Ruby", "bug_code_uid": "69b1a60f9916fe43f3d63969f8845b88", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "4535cb39740da86b32b4ea7aa6f2310e", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.0945179584120983, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a=gets.chomp.split('')\ns=0\nlen=a.length\nfor i in 0..len-1\n\tif a[i]=='^'\n\t\tbreak\n\tend\nend\nfor j in 0..len-1\n\tif a[j]!='='\n\t\ts+=a[j].to_i*(i-j)\n\tend\nend\nputs s>0? \"left\" : s==0? \"balance\" : \"right\"\n", "lang": "Ruby", "bug_code_uid": "908aecb9a4a90d1e3ac7b80e69b44d6b", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "7e39d54a7f019d927e68d06c398e748c", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9405405405405406, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "n,m,i,j,a,b = gets.split(\" \").map(&:to_i)\ncorners = [[n,1],[1,m],[n,m],[1,1]]\nres = [] \n# puts \"#{corners}\"\ncorners.each do |c|\n\tdist_a,dist_b = (i - c[0]).abs, (j - c[1]).abs\n\tif (dist_a % a) == 0 && (dist_b % b) == 0\n\t\tturn_a = dist_a / a\n\t\tturn_b = dist_b / b\n\t\tif (turn_a == turn_b) || ((turn_b - turn_a).abs % 2 == 0)\n\t\t\tif turn_a != turn_b\n\t\t\t\tif turn_a < turn_b\n\t\t\t\t\tnext if i + a > n\n\t\t\t\telse\n\t\t\t\t\tnext if j + b > m\n\t\t\t\tend\n\t\t\tend\n\t\t\tres << [turn_a,turn_b].max\n\t\tend\n\tend\nend\n\nif res.empty?\n\tputs \"Poor Inna and pony!\"\nelse\n\tputs res.min\nend\n\n# 2,2\n# 4,4\n# 6,6\n# 4,8\n\n# dist_a = 2\n# dist_b = 6\n\n# turn_a = 1\n# turn_b = 3\n\n\n# 1,3\n# 1,1\n\n# dist_a = 0\n# dist_b = 2\n# turn_a = 0\n# turn_b = 1\n", "lang": "Ruby", "bug_code_uid": "1afb03c200573df9e91f73a9248c83f7", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "ceee557530b5baf64daaee7b3a3f5152", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9857142857142858, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "(a,b,c) = gets.split.map(&:to_i)\nresult = ((a-b)*c)/b\nputs result.ceil", "lang": "Ruby", "bug_code_uid": "d4d6a7b49f8937d6d7879886795a9dbc", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "b9af18ed28cd357bc818d1a48b71425b", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7936507936507936, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "(a,b,c) = gets.split.map(&:to_i)\nputs (((a-b)*c)/b).celi", "lang": "Ruby", "bug_code_uid": "e4cbd6b7b2afb9aa3148bf742c29d131", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "b9af18ed28cd357bc818d1a48b71425b", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9431578947368421, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a, b = gets.split.map &:to_i\ns = []\nwhile b > a do\n\ts << b\n\tif b % 2 == 0 then\n\t\tb /= 2\n\telsif b % 10 == 1 then \n\t\tb /= 10\n\tend\nend\nif b == a then\n\ts << b\n\tputs 'YES'\n\tputs (s.reverse.map &:to_s) * ' '\nelsif \n\tputs 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "0bc68e392fe12d50797166b0350d789d", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "ba748176e671cf68d90356571745c075", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9713114754098361, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b = gets.split.map &:to_i\ns = []\nwhile b > a do\n\ts << b\n\tif b % 2 == 0 then\n\t\tb /= 2\n\telsif b % 10 == 1 then \n\t\tb /= 10\n\tend\nend\nif b == a then\n\ts << b\n\tputs 'YES'\n\tputs s.size\n\tputs (s.reverse.map &:to_s) * ' '\nelsif \n\tputs 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "52563d71c4fbb602c920dab2bfff7a16", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "ba748176e671cf68d90356571745c075", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9576271186440678, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "i=gets.chomp;n=i.scan(/[^0]/).sort;s=n.shift;s+=(n+i.scan('0')).sort.join;puts gets.chomp==s ?'OK':'WRONG_ANSWER'", "lang": "Ruby", "bug_code_uid": "9f3fe95d631a94bab2030b500951adfe", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "611be922de4d9416d96139e9b0dfbce5", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9970845481049563, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = gets.chomp\nb = gets.chomp\ncnt = Array.new\n10.times do |i|\n cnt[i] = a.count(i.to_s)\n# p cnt[i]\nend\nn = 1\nfor i in 1..9 do\n if cnt[i] > 0 then \n n = i\n break\n end\nend\nans = n.to_s\ncnt[n] -= 1\n10.times do |i|\n if cnt[i] > 0 then\n cnt[i].times do ans += i.to_s end\n end\nend\n#p b\n#p ans\nputs b == ans ? \"OK\" : \"WRONG_ANSWER\"\n\n\n\n", "lang": "Ruby", "bug_code_uid": "9f064dfdd0bb4fa325306222d949ba62", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "e3c90f26986e6eb07e7055c09b45ec83", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9790979097909791, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def main\n\tn=gets.chomp.to_s;\n\tanss=gets.chomp.to_s;\n\tans=anss.to_i;\n\tar=[]\n\tfor i in 0...(n.length)\n\t\tar << n[i].chr\n\tend\n\tar=ar.map {|i| i.to_i}\n\tar=ar.sort\n\ti=0;\n\twhile ar[i]==0\n\t\ti+=1;\n\tend\n\tif ar[0]==0\n\t\tar[0]=ar[i];\n\t\tar[i]=0;\n\tend\n\tca=ar.join(\"\").to_i;\n\tif n==\"0\" and ans==0\n\t\tputs \"OK\"\n\telsif anss[0].chr==\"0\"\n\t\tputs \"WRONG_ANSWER\"\n\telsif ans==0\n\t\tputs \"WRONG_ANSWER\"\n\telsif ca==ans\n\t\tputs \"OK\"\n\telse\n\t\tputs \"WRONG_ANSWER\"\n\tend\nend\n\nmain\n", "lang": "Ruby", "bug_code_uid": "f84c88de2ab836064d185db9a80220e0", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "15fcf46978e008d0abda1d5822004902", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9194499017681729, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "count=0\na = gets().chomp().split(\"\").each {|x| (x=='0') ? count+=1 : x.to_i }\na.sort!{|x,y| x<=>y};str=\"\"+a[count].to_s;a.delete(a[count])\na.each {|x| str+=x.to_s}\nb=gets().chomp()\n#p a,\" \",b\nif(str==b)\n print 'OK'\n else print 'WRONG_ANSWER'\nend", "lang": "Ruby", "bug_code_uid": "607b64104325487a354581deb492d8f3", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "80f3b9d0ad8ce041302666327d9a5b0d", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9883720930232558, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby\n\nclass Task1\n attr_accessor :phases, :n, :result\n\n def initialize()\n @n = 0\n @phases = []\n @result = []\n end\n\n def getData()\n tmp = []\n $stdin.each { |x| (x!=\"\\n\") ? tmp.push(x.chomp.split.map { |y| y.to_i }) : nil }\n @n = tmp[0][0]\n @phases = tmp[1]\n end\n\n def getFileData()\n tmp = []\n file = File.new(\"test.txt\",\"r\")\n file.each { |x| (x!=\"\\n\") ? tmp.push(x.chomp.split.map { |y| y.to_i }) : nil }\n file.close\n @n = tmp[0][0]\n @phases = tmp[1]\n end\n\n def getResult()\n if @phases[@n-1]==0\n puts \"UP\"\n elsif @phases[@n-1]==15\n puts \"DOWN\"\n elsif @n==1\n puts -1\n elsif @phases[@n-1]==14 && @phases[@n-2]==15\n puts \"DOWN\"\n elsif @phases[@n-1]>@phases[@n-2]\n puts \"UP\"\n elsif \n puts \"DOWN\"\n end\n\n end\n\n # def putsResult()\n # puts @result.join(' ')\n # end\n\n def run()\n # getData\n getFileData\n getResult\n # putsResult\n end\n\nend\nif __FILE__ == $0\n pc = Task1.new\n pc.run\nend\n", "lang": "Ruby", "bug_code_uid": "69328e22dde7e3fc8cb1dd21f9844566", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "ad941d8badcf632a522cfb1fb250cb15", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9964028776978417, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\na=gets.split(\" \").map(&:tp_i)\nif n==1 then\n\tif a[0]==15\n\t\tputs \"DOWN\"\n\telsif a[0]==0\n\t\tputs \"UP\"\n\telse\n\t\tputs \"-1\"\n\tend\nelse\n\tif a[-2]>a[-1]\n\t\tif a[-1]==0\n\t\t\tputs \"UP\"\n\t\telse\n\t\t\tputs \"DOWN\"\n\t\tend\n\telse\n\t\tif a[-1]==15\n\t\t\tputs \"DOWN\"\n\t\telse\n\t\t\tputs \"UP\"\n\t\tend\n\tend\nend", "lang": "Ruby", "bug_code_uid": "6c048cbeaa3b1957d77c9aad7c082df7", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "ebaf5fca872dff8ac6e474ce3b1ba678", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.99079754601227, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "f = []\nf << gets\nf << gets\nf << gets\nf.map! {|x| x.split('')}\nnx, nz, n = 0, 0, 0\nxw, zw = false, false\nf.each do |x|\n xw ||= x[0] == 'X' && x[1] == 'X' && x[2] == 'X'\n zw ||= x[0] == '0' && x[1] == '0' && x[2] == '0'\n x.each do |y|\n nx += 1 if y == 'X'\n nz += 1 if y == '0'\n n += 1 if y == 'X' or y == '0'\n end\nend\nf.transpose.each do |x|\n xw ||= x[0] == 'X' && x[1] == 'X' && x[2] == 'X'\n zw ||= x[0] == '0' && x[1] == '0' && x[2] == '0'\nend\nxw ||= f[0][0] == 'X' && f[1][1] == 'X' && f[2][2] == 'X' \nxw ||= f[2][0] == 'X' && f[1][1] == 'X' && f[0][2] == 'X'\nzw ||= f[0][0] == '0' && f[1][1] == '0' && f[2][2] == '0' \nzw ||= f[2][0] == '0' && f[1][1] == '0' && f[0][2] == '0'\nif nz > nx || nx - nz > 1 || xw && zw || xw && nx == nz\n puts \"illegal\"\nelsif xw\n puts \"the first player won\"\nelsif zw\n puts \"the second player won\"\nelsif n == 9\n puts \"draw\"\nelsif nx - nz == 1\n puts \"second\"\nelsif\n puts \"first\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "e1a818710da222fa7477100f101360f8", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "6dff1a5efc1d25688cce7cf1c5e09019", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2974266906044285, "equal_cnt": 29, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 15, "fix_ops_cnt": 29, "bug_source_code": "# CodeForces 3C MegaShow 2017.2.12\n\n$arr = [[]]\nfirst_x = second_0 = 0\n$first_x_win = $second_0_win = 0\n\n\nfor i in 0..2\n $arr[i] = gets\nend\n\nfor i in 0..2\n for j in 0..2\n if $arr[i][j] == 'X'\n first_x += 1\n elsif $arr[i][j] == '0'\n second_0 += 1\n end\n end\nend\n\ndef check_win\n for i in 0..2\n if $arr[i][0] != '.' and $arr[i][0] == $arr[i][1] and $arr[i][0] == $arr[i][2]\n if $arr[i][0] == 'X'\n $first_x_win += 1\n else\n $second_0_win += 1\n end\n end\n end\n for i in 0..2\n if $arr[0][i] != '.' and $arr[0][i] == $arr[1][i] and $arr[0][i] == $arr[2][i]\n if $arr[0][i] == 'X'\n $first_x_win += 1\n else\n $second_0_win += 1\n end\n end\n end\n if $arr[0][0] != '.' and $arr[0][0] == $arr[1][1] and $arr[0][0] == $arr[2][2]\n if $arr[0][0] == 'X'\n $first_x_win += 1\n else\n $second_0_win += 1\n end\n end\n if $arr[0][2] != '.' and $arr[0][2] == $arr[1][1] and $arr[0][2] == $arr[2][0]\n if $arr[0][2] == 'X'\n $first_x_win += 1\n else\n $second_0_win += 1\n end\n end\nend\n\ncheck_win\n\nif $first_x_win > 1 or $second_0_win > 1 or ($first_x_win == 1 and $second_0_win == 1) or\n first_x - second_0 > 1 or first_x < second_0\n print \"illegal\\n\"\nelsif $first_x_win == 1 and $second_0_win == 0\n print \"the first player won\\n\"\nelsif $first_x_win == 0 and $second_0_win == 1\n print \"the second player won\\n\"\nelsif first_x + second_0 == 9\n print \"draw\\n\"\nelsif first_x == second_0\n print \"first\\n\"\nelsif first_x - second_0 == 1\n print \"second\\n\"\nend\n", "lang": "Ruby", "bug_code_uid": "9dd3c84831d209bface3e3ade3947df5", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "e0a9ab40391ce46a17ff84430466825f", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8695652173913043, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "(gets.to_i*1.5).to_i", "lang": "Ruby", "bug_code_uid": "fc4ce2684e9eb2b7b2bd960404ed4efb", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "6bcdf252e41f6364498971b60ba136af", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nputs n * 2 < 6 ? n * 2 - 1 : n * 2 - 2\n\n", "lang": "Ruby", "bug_code_uid": "48a14ed3c6ce8922d0521608d422fb30", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "dcf23feb33f2af4fb3e6c5805659768b", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9644670050761421, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b, c = gets.split(\" \").map { |s| s.to_i }\nx1 = 0\nfor x2 in 0..10000\n\tx1_a = c - b * x2\n\tz = x1_a + x2 *b\n\tif x1_a % a == 0\n\t\tputs \"YES\"\n\t\tf = true\n\t\tbreak\n\tend\nend\nunless f\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "bbc09b063232862374490ed7970f4402", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "41cc7746035aa8c8ad7930d14f758d87", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.648578811369509, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "@a, @b, c = STDIN.read.split(' ').map(&:to_i)\n\n@cache = {}\n\ndef is_ok(cc)\n @cache[cc] ||= begin\n if cc == 0\n true\n elsif cc < 0\n false\n elsif @a.even? && @b.even? && cc.odd?\n false\n else\n is_ok(cc - @a) || is_ok(cc - @b)\n end\n end\nend\n\nputs(is_ok(c) ? 'Yes' : 'No')\n", "lang": "Ruby", "bug_code_uid": "9aeb5844420c88c9db82719c354c38ac", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "5501a429344e637e2d9cf827839ac0dd", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8398058252427184, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "@a, @b, c = STDIN.read.split(' ').map(&:to_i)\n\n@cache = {}\n\ndef is_ok(cc)\n return @cache[cc] unless @cache[cc].nil?\n @cache[cc] = begin\n if cc == 0\n true\n elsif (cc < 0) || (@a.even? && @b.even? && cc.odd?) || (cc < @a && cc < @b)\n false\n else\n is_ok(cc - @a) || is_ok(cc - @b)\n end\n end\nend\n\nputs(is_ok(c) ? 'Yes' : 'No')\n", "lang": "Ruby", "bug_code_uid": "82a0b4d31674fa3ada3747930a1c950c", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "5501a429344e637e2d9cf827839ac0dd", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.53125, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "ebony = ARGV[0].to_i\nivory = ARGV[1].to_i\nshield = ARGV[2].to_i\n\nfor i in 0..shield / ebony\n\tfor j in 0..shield / ivory\n\t\tif i * ebony + j * ivory == shield\n\t\t\tputs \"Yes\"\n\t\t\texit\n\t\tend\n\tend\nend\n\nputs \"No\"", "lang": "Ruby", "bug_code_uid": "dc5901d4c44502e4b5871e3a8321014a", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "92f75e6037309ac19eade29c4251064d", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8881789137380192, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "def maybe(nmk)\n\tif nmk[1] >= nmk[0] || nmk[2] >= nmk[0]\n\t\treturn \"Yes\"\n\telse\n\t\treturn \"No\"\n\tend\nend\n\nnmk = gets.chomp.gsub(\" \", \"\")\nputs(maybe(nmk))", "lang": "Ruby", "bug_code_uid": "9f3408641116a32c25698f57c036d1df", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "ab8d33c26beacfecbd269d3d95b7e428", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8819875776397516, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n, m, k = gets.chomp.split(\" \").map(&:to_i)\nputs n < m || n < k ? \"No\" : \"Yes\"\n\n", "lang": "Ruby", "bug_code_uid": "7fa480e25630943bd2bd1ac1f63f8bb4", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "0a29ac552f19a725e4f6534447b5883e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9979716024340771, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, v = gets.split.map(&:to_i)\nans = fuel = 0\n(1..n).each do |i|\n if fuel == 0\n fuel = n >= v ? v : n - 1\n ans += fuel * i\n next\n end\n if n - i >= v\n fuel += 1\n ans += i\n end\n fuel -= 1\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "c689fedd9fd6547d0e835898d202fe86", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "bc3fda7b307e69380a92c368fc2c5d3c", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9444444444444444, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,v = gets.split.map(&:to_i)\nans = v\n(n-v-1).times do |i|\n ans += i+2\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "36342f7fd9e21d9a3c71b845cd96c09a", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "304e324f91db02e0ace51edec7327cd8", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.45870307167235497, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "def run target, left, right, result\n median = [left[0] + right[0], left[1] + right[1]]\n\n if fract_compare(median, target) == 0\n if median[0] != target[0]\n puts \"Impossible\"\n return false\n end\n puts string_compress result\n return true\n end\n\n if median[0] > target[0] || median[1] > target[1]\n puts \"Impossible\"\n return false\n end\n\n if fract_compare(median, target) > 0\n result << 'B'\n right[0] = median[0]\n right[1] = median[1]\n else\n result << 'A'\n left[0] = median[0]\n left[1] = median[1]\n end\n\n run target, left, right, result\nend\n\ndef fract_compare a, b\n return a[0] * b[1] - a[1] * b[0]\nend\n\ndef string_compress s\n current_total = 0\n prev = \"\"\n size = s.size\n result = []\n s.each_with_index do |cur, i|\n if prev == cur\n current_total += 1\n else\n if prev != \"\"\n result << current_total\n result << prev\n end\n current_total = 1\n prev = cur\n end\n if i == (size - 1)\n result << current_total\n result << prev\n end\n end\n return result.join\nend\n\ntarget = gets.chomp.split(\" \").map{ |i| i.to_i }\nleft = [0, 1]\nright = [1, 0]\nresult = []\nrun target, left, right, result\n", "lang": "Ruby", "bug_code_uid": "20dd09f5fc9bf8f11e5069ce22a3cfb8", "src_uid": "6a9ec3b23bd462353d985e0c0f2f7671", "apr_id": "100d77f30a4fe00acd13db875d526cb6", "difficulty": 2400, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.999712395743457, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def run target, left, right, result\n if target[0] == 1\n print (target[1] - 1), 'B'\n puts\n return true\n end\n if target[1] == 1\n print (target[0] - 1), 'A'\n puts\n return true\n end\n if target[0].gcd(target[1]) > 1\n puts \"Imposible\"\n return false\n end\n if (target[0] - target[1]).abs == 1\n result = []\n num = target[0] > target[1] ? target[1] : target[0]\n char = target[0] > target[1] ? 'B' : 'A'\n print 1, (char == 'A' ? 'B' : 'A')\n if num > 1\n print (num - 1), char\n end\n puts\n return true\n end\n while true\n median = [left[0] + right[0], left[1] + right[1]]\n\n if fract_compare(median, target) == 0\n if median[0] != target[0]\n puts \"Impossible\"\n return false\n end\n puts string_compress result\n return true\n end\n\n if median[0] > target[0] || median[1] > target[1]\n puts \"Impossible\"\n return false\n end\n\n if fract_compare(median, target) > 0\n result << 'B'\n right[0] = median[0]\n right[1] = median[1]\n else\n result << 'A'\n left[0] = median[0]\n left[1] = median[1]\n end\n end\nend\n\ndef fract_compare a, b\n return a[0] * b[1] - a[1] * b[0]\nend\n\ndef string_compress s\n current_total = 0\n prev = \"\"\n size = s.size\n result = []\n s.each_with_index do |cur, i|\n if prev == cur\n current_total += 1\n else\n if prev != \"\"\n result << current_total\n result << prev\n end\n current_total = 1\n prev = cur\n end\n if i == (size - 1)\n result << current_total\n result << prev\n end\n end\n return result.join\nend\n\ntarget = gets.chomp.split(\" \").map{ |i| i.to_i }\nleft = [0, 1]\nright = [1, 0]\nresult = []\nrun target, left, right, result\n", "lang": "Ruby", "bug_code_uid": "5f625e3b62d80b55fc490e7862df576f", "src_uid": "6a9ec3b23bd462353d985e0c0f2f7671", "apr_id": "100d77f30a4fe00acd13db875d526cb6", "difficulty": 2400, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9767578699617535, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def run target, left, right, result\n if target[0] == 1\n print (target[1] - 1), 'B'\n puts\n return true\n end\n if target[1] == 1\n print (target[0] - 1), 'A'\n puts\n return true\n end\n if (target[0] - target[1]).abs == 1\n result = []\n num = target[0] > target[1] ? target[1] : target[0]\n char = target[0] > target[1] ? 'B' : 'A'\n print 1, (char == 'A' ? 'B' : 'A')\n if num > 1\n print (num - 1), char\n end\n puts\n return true\n end\n while true\n median = [left[0] + right[0], left[1] + right[1]]\n\n if fract_compare(median, target) == 0\n if median[0] != target[0]\n puts \"Impossible\"\n return false\n end\n puts string_compress result\n return true\n end\n\n if median[0] > target[0] || median[1] > target[1]\n puts \"Impossible\"\n return false\n end\n\n if fract_compare(median, target) > 0\n result << 'B'\n right[0] = median[0]\n right[1] = median[1]\n else\n result << 'A'\n left[0] = median[0]\n left[1] = median[1]\n end\n end\nend\n\ndef fract_compare a, b\n return a[0] * b[1] - a[1] * b[0]\nend\n\ndef string_compress s\n current_total = 0\n prev = \"\"\n size = s.size\n result = []\n s.each_with_index do |cur, i|\n if prev == cur\n current_total += 1\n else\n if prev != \"\"\n result << current_total\n result << prev\n end\n current_total = 1\n prev = cur\n end\n if i == (size - 1)\n result << current_total\n result << prev\n end\n end\n return result.join\nend\n\ntarget = gets.chomp.split(\" \").map{ |i| i.to_i }\nleft = [0, 1]\nright = [1, 0]\nresult = []\nrun target, left, right, result\n", "lang": "Ruby", "bug_code_uid": "554cbcf553a6271c7b964d859a507ca4", "src_uid": "6a9ec3b23bd462353d985e0c0f2f7671", "apr_id": "100d77f30a4fe00acd13db875d526cb6", "difficulty": 2400, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.011346670647954613, "equal_cnt": 22, "replace_cnt": 19, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 23, "bug_source_code": "// Problem site: http://codeforces.com/contest/585/problem/C\n#include \n#include \n#include \n#define INPUT_MAX_LENGTH 16\n\nint max(int a, int b);\nvoid string_compress(char *string);\nint fract_compare(char *a[2], char *b[2]);\nchar *big_sum(char *a, char *b);\nchar *big_multiply(char *a, char *b);\nint big_compare(char *a, char *b);\nchar *string_reverse(char *a);\nchar *string_append_zero(char *a, int total);\nvoid try(char *left[2], char *right[2], char *targets[2], char *result);\n\nint main() {\n char *targets[2];\n targets[0] = malloc(INPUT_MAX_LENGTH * sizeof(char));\n targets[1] = malloc(INPUT_MAX_LENGTH * sizeof(char));\n\n scanf(\"%s\", targets[0]);\n scanf(\"%s\", targets[1]);\n\n char *left[2];\n left[0] = malloc(INPUT_MAX_LENGTH * sizeof(char));\n left[1] = malloc(INPUT_MAX_LENGTH * sizeof(char));\n strcpy(left[0], \"0\");\n strcpy(left[1], \"1\");\n\n char *right[2];\n right[0] = malloc(INPUT_MAX_LENGTH * sizeof(char));\n right[1] = malloc(INPUT_MAX_LENGTH * sizeof(char));\n strcpy(right[0], \"1\");\n strcpy(right[1], \"0\");\n\n char *result = malloc(max(strlen(targets[0]), strlen(targets[1])) * sizeof(char));\n strcpy(result, \"\");\n\n try(left, right, targets, result);\n\n return 0;\n}\n\nchar *big_sum(char *a, char *b) {\n int length_a = strlen(a), length_b = strlen(b);\n int i = 0, over = 0, result_length = 0;\n char *result = malloc((length_a + length_b) * sizeof(char));\n\n while (i < length_a || i < length_b) {\n int current_a = 0, current_b = 0;\n if (i < length_a) {\n current_a = a[length_a - 1 - i] - '0';\n }\n if (i < length_b) {\n current_b = b[length_b - 1 - i] - '0';\n }\n int current = current_a + current_b + over;\n over = current / 10;\n current = current % 10;\n result[result_length] = current + '0';\n result_length++;\n i++;\n }\n if (over > 0) {\n result[result_length] = over + '0';\n result_length++;\n }\n result[result_length] = '\\0';\n\n return string_reverse(result);\n}\n\nchar *big_multiply(char *a, char *b) {\n int length_a = strlen(a), length_b = strlen(b);\n int i;\n char *total = \"0\";\n for (i = 0; i < length_b; i++) {\n // Multiply a with b[length_b - 1 - i]\n int current_b = b[length_b - 1 - i] - '0';\n int j, over = 0, sum_length = 0;\n char *sum = malloc((length_a + 1) * sizeof(char));\n for (j = 0; j < length_a; j++) {\n int current_a = a[length_a - 1 - j] - '0';\n int current = current_a * current_b + over;\n over = current / 10;\n current = current % 10;\n sum[sum_length] = current + '0';\n sum_length++;\n }\n if (over > 0) {\n sum[sum_length] = over + '0';\n sum_length++;\n }\n sum[sum_length] = '\\0';\n sum = string_reverse(sum);\n sum = string_append_zero(sum, i);\n total = big_sum(total, sum);\n }\n return total;\n}\n\nint big_compare(char *a, char *b) {\n if (strlen(a) == strlen(b)) {\n return strcmp(a, b);\n }\n return (strlen(a) > strlen(b)) ? 1 : -1;\n}\n\nchar *string_append_zero(char *a, int total) {\n int length_a = strlen(a);\n char *result = malloc((length_a + total) * sizeof(char));\n int i;\n for (i = 0; i < length_a; i++) {\n result[i] = a[i];\n }\n for (; i < length_a + total; i++) {\n result[i] = '0';\n }\n return result;\n}\n\nchar *string_reverse(char *a) {\n int length = strlen(a);\n int middle = length / 2;\n int i;\n char temp;\n\n for (i = 0; i < middle; i++) {\n temp = a[i];\n a[i] = a[length - 1 - i];\n a[length - 1 - i] = temp;\n }\n\n return a;\n}\n\nvoid try(char *left[2], char *right[2], char *targets[2], char *result) {\n while (1) {\n char *sum[2] = {big_sum(left[0], right[0]), big_sum(left[1], right[1])};\n\n if (fract_compare(sum, targets) == 0) {\n if (big_compare(sum[0], targets[0]) != 0) {\n printf(\"Impossible\\n\");\n } else {\n string_compress(result);\n }\n\n return;\n }\n\n if (big_compare(sum[0], targets[0]) > 0 || big_compare(sum[1], targets[1]) > 0) {\n printf(\"Impossible\\n\");\n\n return;\n }\n\n long long length = strlen(result);\n if (fract_compare(sum, targets) > 0) {\n result[length] = 'B';\n result[length + 1] = '\\0';\n strcpy(right[0], sum[0]);\n strcpy(right[1], sum[1]);\n } else {\n result[length] = 'A';\n result[length + 1] = '\\0';\n strcpy(left[0], sum[0]);\n strcpy(left[1], sum[1]);\n }\n result[length + 1] = '\\0';\n }\n}\n\nint max(int a, int b) {\n return (a > b) ? a : b;\n}\n\nvoid string_compress(char *string) {\n long long length = strlen(string);\n long long i, current_total = 1;\n char prev = string[0], current;\n for (i = 1; i < length; i++) {\n current = string[i];\n if (current == prev) {\n current_total++;\n } else {\n printf(\"%llu%c\", current_total, prev);\n prev = current;\n current_total = 1;\n }\n }\n printf(\"%llu%c\", current_total, prev);\n printf(\"\\n\");\n}\n\nint fract_compare(char *a[2], char *b[2]) {\n return big_compare(big_multiply(a[0], b[1]), big_multiply(a[1], b[0]));\n}\n", "lang": "Ruby", "bug_code_uid": "ac4463d20df5f7a05c08900bd4b90c09", "src_uid": "6a9ec3b23bd462353d985e0c0f2f7671", "apr_id": "100d77f30a4fe00acd13db875d526cb6", "difficulty": 2400, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7222222222222222, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "require 'bigdecimal'\na = BigDecimal(gets).to_s('f')\n\nputs (a%1 == 0? a.to_i : a)", "lang": "Ruby", "bug_code_uid": "fddef5c97aec806f695e46bb7c756fda", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "b26b5dff4c632bd099cbb8293025e8b1", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8608247422680413, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "input = gets\noutput = \"\"\ne_index = input.index(\"e\")\nd_index = input.index(\".\")\nfactor = input[(e_index + 1)..-1].to_i\noutput = input[0..(e_index-1)]\noutput[d_index] = \"\"\nfactor.times do |i|\n unless output[d_index + i]\n output[d_index + i] = \"0\"\n end\nend\noutput.insert(d_index + factor, \".\") if (d_index + factor) < output.length\nputs output\n", "lang": "Ruby", "bug_code_uid": "2386f98b09e8d4e9377197189ac08d6d", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "a4a25444d6ad6c8f164505195347611b", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.02269861286254729, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "require \"byebug\"\ninput = gets\noutput = \"\"\ne_index = input.index(\"e\")\nd_index = input.index(\".\")\nfactor = input[(e_index + 1)..-1].to_i\noutput = input[0..(e_index-1)]\noutput[d_index] = \"\"\nfactor.times do |i|\n unless output[d_index + i]\n output[d_index + i] = \"0\"\n end\nend\noutput.insert(d_index + factor, \".\") if (d_index + factor) < output.length\nputs output\n", "lang": "Ruby", "bug_code_uid": "e536cfa8fff93de14a37df3f75a40ac0", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "a4a25444d6ad6c8f164505195347611b", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7741522712731925, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "Matcher = /(?\\d{1})\\.(?\\d+)e(?\\d+)/\ndef solve(string)\n res = Matcher.match(string)\n i = res[:int].split(\"\")\n f = res[:float].split(\"\")\n e = res[:exp].to_i\n buf1 = i + f.take(e)\n buf2 = f.drop(e)\n if(buf2.empty?)\n buf4 = buf1.drop_while{|x| x == \"0\"}\n if(e > f.length)\n buf3 = (0..(e-f.length - 1)).map{ \"0\" }\n \"#{buf4.join(\"\")}#{buf3.join(\"\")}\"\n else\n \"#{buf4.join(\"\")}\"\n end\n else\n buf4 = buf1.drop_while{|x| x == \"0\"}\n if(buf4.empty?)\n \"0.#{buf2.join(\"\")}\"\n else\n \"#{buf4.join(\"\")}.#{buf2.join(\"\")}\"\n end\n end\nend\n\ns = gets\n# s = \"0.01392e2\"\nputs solve(s)\n", "lang": "Ruby", "bug_code_uid": "a4a526f487ec1009aaba73a028948e04", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "0ba0df56a23bc54224a1567ca2444bd8", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8649386084583902, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\na = gets.split.map(&:to_i)\n\nans = 0\n(n-1).times do |i|\n t = [a[i],a[i+1]]\n if t == [3,2] || t == [2,3] || t[0] == t[1] || (i >= 1 && (a[i-1]+t) == [3,1,2])\n ans = -1\n break\n elsif t == [1,2] || t == [2,1]\n ans += 3\n elsif t == [1,3] || t == [3,1]\n ans += 4\n end\nend\nputs ans == -1 ? \"Infinite\" : \"Finite\"\nputs ans if ans >= 0\n\n", "lang": "Ruby", "bug_code_uid": "c0c1eaf1b76ed17a75663b9bb27978ea", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "a0cfbe402fad18c7a48b9cc0dfe35d85", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8062283737024222, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\na = gets.split.map &:to_i\nl = a[0]\nans = 0\n(1...n).each do |i|\n if l == a[i]\n ans = -1\n break\n end\n case l\n when 1 # circle\n case a[i]\n when 2 # triangle\n ans += 3\n when 3 # square\n ans += 4\n end\n when 2 # triangle\n case a[i]\n when 1 # circle \n ans += 3\n when 3 # square\n ans = -1\n break\n end\n when 3 # square\n case a[i]\n when 1 # circle \n ans += 4\n when 2 # triangle\n ans = -1\n break\n end\n end\n l = a[i]\nend\nif ans < 0\n puts \"Infinite\"\nelse\n puts \"Finite\"\n puts ans\nend\n", "lang": "Ruby", "bug_code_uid": "46be913c9c32fcbf150cff386185449c", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "4021df1f03fb9b251f6da9ade09395ed", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9662337662337662, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nhodnoty = \"6789TJQKA\"\ntrumf = gets.chop.to_s\n//puts trumf\ncards = gets.chop\n//puts cards\nc1h = cards[0].chr\nc1b = cards[1].chr\nc2h = cards[3].chr\nc2b = cards[4].chr\nif c1b == c2b\n\tthen\n\t\tif hodnoty.index(c1h) > hodnoty.index(c2h)\n\t\t\tthen\n\t\t\t\tputs \"YES\"\n\t\t\telse\n\t\t\t\tputs \"NO\"\n\t\t\tend\n\tend\nif c1b != c2b\n\tthen\n\t\tif c1b == trumf\n\t\t\tthen\n\t\t\t\tputs \"YES\"\n\t\t\telse\n\t\t\t\tputs \"NO\"\n\t\t\tend\n\tend\n", "lang": "Ruby", "bug_code_uid": "b5457d2f6fd3bae937f2c7abeb33fb38", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "851dad1d1c1e25b7a79613e60499e1a1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9282178217821783, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "ranks = [\"6\", \"7\", \"8\", \"9\", \"T\", \"J\", \"Q\", \"K\", \"A\"]\ntrump = $stdin.readline.chop\ncards = $stdin.readline.chop.split(' ')\na = cards[0]; b = cards[1]\n\nif cards[0][1] == trump and cards[1][1] != trump then\n puts \"YES\"\n exit\nend\n\nif cards[1][1] == trump and cards[0][1] != trump then\n puts \"NO\"\n exit\nend\n\nif ranks.index(cards[0][0]) > ranks.index(cards[1][0]) then\n puts \"YES\"\n exit\nend\n\nputs \"NO\"", "lang": "Ruby", "bug_code_uid": "a5e45970fd96d4a38409e182f1f127e7", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "45e719f10edc758a468fb406ce902c67", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9938271604938271, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "r = %w[6 7 8 9 T J Q K A]\n\nt = gets.chomp\nf, s = gets.chomp.split\nputs((f[1] == s[1] && r.index(f[0]) > r.index(s[0]) || (f[1] == t && s[2] != t)) ? 'YES' : 'NO')", "lang": "Ruby", "bug_code_uid": "ce4f7b83ec475777d48636e99d393a9d", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "f558a63482406de7686e8561294ee638", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5585585585585585, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/env ruby\n\ntramp = gets.chomp\nfirst, second = *gets.chomp.split(/ /)\n\narr = %[6 7 8 9 T J Q K A]\n\nif first[1] == tramp\n puts \"YES\"\nelsif arr.index(first[0]) > arr.index(second[0])\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "252d3efd39933fd4412cfaa775478220", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "636b8c80e11faf5e3c0d8715308e30dd", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9941690962099126, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def is_able?(n)\n xc = n / $x\n yc = n / $y\n bc = n / $x.lcm($y)\n a_left = [$a - yc - bc, 0].max\n b_left = [$b - xc - bc, 0].max\n a_left + b_left <= n - xc - yc + bc\nend\n\ndef magic(l, r)\n return l if l == r\n m = (l + r) / 2\n is_able?(m) ? magic(l, m) : magic(m + 1, r)\nend\n\n$a, $b, $x, $y = gets.split.map(&:to_i)\np magic(0, 1e10.to_i)\n", "lang": "Ruby", "bug_code_uid": "144c5717b321b078b187cff0d3e7f2e3", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "651c87f54dcf63dfb04c5e1d62ec7b6c", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.09353507565337002, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "cnt1, cnt2, x, y = gets.chomp.split.map(&:to_i)\na = []\nb = []\nfor i in 1...1000000000\n if i % x != 0 && i % y != 0\n da = cnt1 - a.size\n db = cnt2 - b.size\n if da > db\n a << i\n else\n b << i\n end\n elsif i % x != 0 && a.size < cnt1\n a << i\n elsif i % y != 0 && b.size < cnt2\n b << i\n end\n ans = i\n break if a.size == cnt1 && b.size == cnt2\nend\np ans\n", "lang": "Ruby", "bug_code_uid": "cf34f66f8b04ab0e29cee8e0c6c1eb22", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "651c87f54dcf63dfb04c5e1d62ec7b6c", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7916666666666666, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=gets.chomp.to_i\ns=gets.chomp\n\nputs '1'+'0'*s.count('0')", "lang": "Ruby", "bug_code_uid": "2f628335ef36ad4074610f891118f521", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "203b700d6db0442e409993a9e86b3802", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8049792531120332, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,m,k=gets.split.map(&:to_i)\nans=0\nMOD=1000000007\nif k==1 || k>n then\n ans=1\n n.times{ ans=(ans*m)%MOD}\n p ans\nelsif k % 2==0 then\n p m\nelsif k % 2==1\n p m*m\nend\n", "lang": "Ruby", "bug_code_uid": "3cec42c697b6c26b42fd68d6c28f8501", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "981c6e1775ca708c7b59936c4d317973", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9430051813471503, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "Mod = (10**9)+7\n\ndef solve n,m,k \n if n == k\n ans = 1\n for i in 0 ... ((n+1)/2)\n ans = ans * m\n ans = ans%Mod\n end\n ans\n elsif k == 1 || n < k\n ans = 1\n for i in 0 ... n\n ans = ans * m\n ans = ans % Mod\n end\n ans\n else\n m\n end\nend\n\nwhile line = gets\n a = line.split\n puts solve(a[0].to_i,a[1].to_i,a[2].to_i)\nend\n", "lang": "Ruby", "bug_code_uid": "aa9999e5a1242b3d451ebff6a9c6b744", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "e4e53c4f287d17bf30265de003833631", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9863013698630136, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,x,*a=$<.read.split.map &:to_i\nb=[*0...x]-a\np b.size+(a.include?(n)?1:0)", "lang": "Ruby", "bug_code_uid": "a33588251b59bcfd81617757efd6a8c2", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "e54281ddc09de3df7469b313fefe679a", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8869309838472834, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a, q = gets.split.map(&:to_i)\n\nset = [[]]\nset << gets.split.map(&:to_i) if set[0].size != a\nset.flatten!\nset.sort!\n\ncounter = 0\ntest = 0\nif set.include? q\n for i in set[0]...q\n counter += 1 unless set.include? i\n end\n counter += 1\nelse\n set << q\n set.sort!\n for i in set[0]...q\n counter += 1 unless set.include? i\n end\nend\n\nputs counter", "lang": "Ruby", "bug_code_uid": "78882dfa4801ae4b0683456ca3b56586", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "018d870b258d208d0a2cf94f88504738", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9725274725274725, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "\ufeff# codeforce#122(Div2.A)\nn, k = gets.chomp.split(\" \").map{|e| e.to_i}\n\nn.downto(0) do |i|\n if (i * 2 + 5 * (n - i)) >= k and (i * 2 + 3 * (n - i)) <= k\n puts i\n break\n end\nend", "lang": "Ruby", "bug_code_uid": "f0155fb480c2a5751ff5a5af49ddcc8e", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "4fde29fe56c8cfa3354f9cefcfcba672", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8863636363636364, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n,k = gets.split.map(&:to_i)\nputs 3*n-k", "lang": "Ruby", "bug_code_uid": "d9b6101828cb3a7f2259113b67ded120", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "3176d1ac434cc6f81e87248a48e404b6", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.865979381443299, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, k = gets.split.map(&:to_i)\nputs max*3(n-k, 0)", "lang": "Ruby", "bug_code_uid": "e264a58886fb57d62891ccf28c43c136", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "3176d1ac434cc6f81e87248a48e404b6", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8865979381443299, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n, k = gets.split.map(&:to_i)\nputs max(3*n-k, 0)", "lang": "Ruby", "bug_code_uid": "5aaadbdc8d9b4ac18805d0b21e3d0966", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "3176d1ac434cc6f81e87248a48e404b6", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.96875, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k,*a=$<.read.split.map &:to_i\np [0,(k*2-1)*n-a.reduce(:+)*2]", "lang": "Ruby", "bug_code_uid": "0d95c247cd4e70320df8b509985a6290", "src_uid": "f22267bf3fad0bf342ecf4c27ad3a900", "apr_id": "e6d1af4091008b694a95692babf342c0", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2443653618030842, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = gets.split\nx = n[0].to_i\ny = n[1].to_i\n\nloop{\n c = 0\n h = 0\n \n loop{\n break if x == 0 || c == 200\n c += 100\n x -= 1\n }\n \n loop{\n break if y == 0 || c == 220\n c += 10\n y -= 1 \n }\n\n if c != 220\n puts \"Hanako\"\n break\n end\n \n loop{\n break if x == 0 || h == 200\n h += 100\n x -= 1\n }\n \n loop{\n break if y == 0 || h == 220\n h += 10\n y -= 1\n \n }\n \n if h != 220\n puts \"Ciel\"\n break\n end\n\n}\n\n", "lang": "Ruby", "bug_code_uid": "26ef73ba7fdb5d5e0d83a60ea249581d", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "b350d39807003b0edf96cdaf23d92a76", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.24378698224852072, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "cn = gets.split\nx = n[0].to_i\ny = n[1].to_i\n\nloop{\n c = 0\n h = 0\n \n loop{\n break if x == 0 || c == 200\n c += 100\n x -= 1\n }\n \n loop{\n break if y == 0 || c == 220\n c += 10\n y -= 1 \n }\n\n if c != 220\n puts \"Hanako\"\n break\n end\n \n loop{\n break if y == 0 || h == 220\n h += 10\n y -= 1\n }\n\n loop{\n break if x == 0 || h == 200\n h += 100\n x -= 1\n }\n \n \n \n if h != 220\n puts \"Ciel\"\n break\n end\n\n}\n\n", "lang": "Ruby", "bug_code_uid": "8a8eaef4b7423c30740cd0a33d799f78", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "b350d39807003b0edf96cdaf23d92a76", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9760306807286673, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#=================================\nif ARGV.include?(\"ONLINE_JUDGE\")\n\t$stdin = File.open(ARGV[0], \"r\")\n\tARGV.delete(\"ONLINE_JUDGE\")\nend\n#=================================\n\nn, m=gets.split.map(&:to_i)\nn*=100\nm*=10\n\nloop{\n\tif n-200>=0 && m-20>=0\n\t\tn-=200;\tm-=20\n\telsif n-100>=0 && m-120>=0\n\t\tn-=100; m-=120\n\telsif m-220>=0\n\t\tm-=220\n\telse\n\t\tputs \"Hanako\"\n\t\texit\n\tend\n\t\n\tif m-220>=0\n\t\tm-=220\n\telsif n-100>=0 && m-120>=0\n\t\tn-=100; m-=120\n\telsif n-200>=0 && m-20>=0\n\t\tn-=200; m-=20\n\telsif n-220>=0\n\t\tn-=220\n\telse\n\t\tputs \"Ciel\"\n\t\texit\n\tend\n}\n", "lang": "Ruby", "bug_code_uid": "ecd87799a28b977b7f424ae71fdc3d2e", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "28c3727ad1b3d50d78629b1d9bb1887c", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7078464106844741, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "m=[0,0,0]\nm[0],m[1],m[2],k=gets.split.map(&:to_i)\nans=[1,1,1]\nt=0\ntk=k*3\nloop {\n break unless k>0\n break unless tk>t\n\n k-=1 if ans[t%3]0\n break unless tk>t\n if ans[t%3]4 then break end\n t+=1\n}\np ans[0]*ans[1]*ans[2]\n", "lang": "Ruby", "bug_code_uid": "f89e2cff9fbdfd070ea0362e28bd2808", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "a8ab73ce4030e7795a18f65f5713d536", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8867924528301887, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def f(v, a, b)\n v<0\n f v,a+1,b*10+4 if a<10\n f v,a+1,b*10+7 if a<10\nend\nk,r,a,b = [],0,gets.split.collect{|x| x.to_i }\nf(k,0,0)\nk.sort!\n0.upto(k.length) do |i|\n if a<=b && a<=k[i]\n r+=([b,k[i]].min-a+1)*k[i]\n a=k[i]+1\n end\nend\nputs r", "lang": "Ruby", "bug_code_uid": "dcc7bdac15c6639f7b221d79a8370a96", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "83da012c0a1f1b97e241c03cc9704977", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9867986798679867, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.split.map{ |i| i.to_i }\n$a = []\ndef doit(n) \n\treturn if n.to_s.size == 9\n\t($a << n) if n > 0 \n\tdoit(n * 10 + 4)\n\tdoit(n * 10 + 7)\nend\ndoit(0)\nc, r = n - 1, 0\n$a = $a.sort\n$a.each { |i|\n\tif i >= n\n\t\tif i < m\n\t\t\tr += (i - c) * i\n\t\telse\n\t\t\tr += (m - c) * i\n\t\t\tbreak\n\t\tend\n\t\tc = i\n\tend\n}\nputs r\n", "lang": "Ruby", "bug_code_uid": "a8170a986913c0c54c77b0cfa77616bc", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "a9e026682b291016f55c776d38b05c23", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9713375796178344, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def pow(x, y)\n md = 1000000007;\n if y == 0 \n 1\n else\n t = pow(x, y/2);\n t = (t * t) % md;\n if y % 2 == 1 then (x * t) % md else t end\n end\nend\n\nmd = 1000000007;\nn, k = gets.split.map(& :to_i)\n\n\nif k == 1 \n ans = 0;\nelse\n ans = ((pow(k, k - 2) * k)% md * pow(n - k, n - k)) % md\nend\n\np ans\n", "lang": "Ruby", "bug_code_uid": "5a799349d146f163ceed45ca51e67a51", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "857fe72986a96a755efca64a3356a096", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9799426934097422, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i;\nwhile n > 0\n\tif n >= 5\n\t\tn -= 5;\n\telsif n >= 4\n\t\tn -= 4;\n\telsif n >= 3\n\t\tn -= 3;\n\telsif n >= 2\n\t\tn -= 2;\n\telse\t\n\t\tn -= 1;\n\tend;\n\tc += 1;\nend;\nprint c, \"\\n\";", "lang": "Ruby", "bug_code_uid": "523a6a164f9c5f99d98c37f3eb7798f5", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "e29eca3d3de2f8041170ce39d3bf441c", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.30783242258652094, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "input = STDIN.read\n\ninput =~ /^(\\d+) (\\d+) (\\d+) (\\d+)/\na, b, m, r0 = $1.to_i, $2.to_i, $3.to_i, $4.to_i\n\n$values = Array.new\n\ndef get_next_value(a, b, m, r)\n (a * r + b) % m\nend\n\n$values << get_next_value(a, b, m, r0)\n\nresult = 0\n\nwhile true\n next_value = get_next_value a, b, m, $values.last\n found_index = $values.find_index next_value\n unless found_index.nil?\n result = $values.length - found_index\n break\n end\n $values << next_value\nend\n\nputs result\n", "lang": "Ruby", "bug_code_uid": "734e5023929d7b3febe2248a6aa3c89a", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "67c0cc4e042a2054ec16352f38676dce", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.823076923076923, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "line = $stdin.gets.strip.split(/\\s+/)\na = line[0].to_i\nb = line[1].to_i\nm = line[2].to_i\nr0 = line[3].to_i\nr = (a*r0+b)%m\nwhile r <= m\n r = a*r + b\nend\nr = r % m\nrr = r\ni = 0\nloop do\n i += 1\n rr = (a*rr + b) % m\n if rr == r\n puts i\n exit 0\n end\nend\n", "lang": "Ruby", "bug_code_uid": "16a28e9c2a2c76946ad32a7298d64da0", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "ba81c110df27d15c3f2df268f8ffcc37", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4217687074829932, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "t = gets.split.collect{|x| x.to_i}\na,b,m,r0 = t[0], t[1], t[2], t[3]\n\nt = [r0]\n\nwhile true \n\tr0 = (a*r0+b)%m\n\n\ti = t.find_index(r0) \n\tif i != nil\n\t\tputs (t.size - i)\n\t\tbreak\n\tend\n\tt << r0\nend", "lang": "Ruby", "bug_code_uid": "5b2bcb39e27062ec78ae1abd8f74c111", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "29366274f270fabdcf28271442fda71e", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9673469387755103, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "a = Complex(gets.split.map{ |x| Integer(x) })\nb = Complex(gets.split.map{ |x| Integer(x) })\nc = Complex(gets.split.map{ |x| Integer(x) })\n\ncase(((c-a)/(b-a)).polar[1] <=> 0)\nwhen -1\n\tputs 'RIGHT'\nwhen 0\n\tputs 'STRAIGHT'\nwhen 1\n\tputs 'LEFT'\nend\n", "lang": "Ruby", "bug_code_uid": "1a3901e6f0040e1d3269116e547298ac", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "8aeeb954dfc857696f6758e4630eb046", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.973630831643002, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = Complex(*gets.split.map{ |x| Integer(x) })\nb = Complex(*gets.split.map{ |x| Integer(x) })\nc = Complex(*gets.split.map{ |x| Integer(x) })\n\ncase(((c-a)/(b-a)).polar[1] <=> 0)\nwhen -1\n\tputs 'RIGHT'\nwhen 0\n\tputs 'STRAIGHT'\nwhen 1\n\tputs 'LEFT'\nend\n", "lang": "Ruby", "bug_code_uid": "e13e878955216850608fc6e1552b067a", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "8aeeb954dfc857696f6758e4630eb046", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9778869778869779, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "xa, ya = gets.split.map &:to_i\nxb, yb = gets.split.map &:to_i\nxc, yc = gets.split.map &:to_i\n\n\ns = (xb - xa) * (yc - ya) - (yb - ya) * (xc - xa)\nputs s==0 ? \"TOWARDS\" :\n s > 0 ? \"LEFT\" :\n \"RIGTH\"\n", "lang": "Ruby", "bug_code_uid": "f2ba4e484d3bf2d6535a34ff4f5e13c9", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "d4542c86ccdb3764af1a69d7deac597b", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.907103825136612, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "c,v0,v1,a,n=gets.split.map &:to_i\nv=v0\ni=0\nwhile n>0\nn-=v\ni+=1\nv=v[v+a,v1].min\nend\np i", "lang": "Ruby", "bug_code_uid": "ca625574a12ac6cd2da3385df425314d", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "11cfcb2eccfbff2bbf1803ffb17956ce", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9120879120879121, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "c,v0,v1,a,n=gets.split.map &:to_i\nv=v0\ni=0\nwhile n>0\nn-=v\ni+=1\nv=[v+a,v1].min\nend\np i", "lang": "Ruby", "bug_code_uid": "fd6d75dca43adfbb2b17cf39f4c3a5c9", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "11cfcb2eccfbff2bbf1803ffb17956ce", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9661399548532731, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "c, v0, v1 , a, l = gets.strip.split(' ').map(&:to_i)\n\ncnt = 0\ni = 0\ntotal = 0\nwhile true\n break if cnt >= c\n if i == 0\n x = 0\n else \n x = l\n end\n cnt += [(v0 + (i * a) - x), v1].min\n i += 1\nend\n\nputs i\n", "lang": "Ruby", "bug_code_uid": "447c5c18790113d3bae1bada1db61f90", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "49c045fad0f19af96ab3ec609e10d939", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.3815789473684211, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "puts gets.to_s.gsub(/\\/+/,'/')", "lang": "Ruby", "bug_code_uid": "dfbb47f24ef5f3ea948bacb04ec4cb6a", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "25acbdde2328f6f3c9e70765ec3cada5", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9921259842519685, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "puts \"/\"+gets.strip.split(\"/\").reject!{|str| str== \"\"}.join(\"/\")", "lang": "Ruby", "bug_code_uid": "178f8e78ce150cf4d3a6682b50e13d35", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "6301a8aa8aeff3e748420d406c1c073c", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.25287356321839083, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "path = gets\nwhile /\\/\\// =~ path\n path.sub! '/', '/'\nend\nif path.length > 1 and path[-1] == '/'\n path = path[0..-2]\nend\nputs path\n", "lang": "Ruby", "bug_code_uid": "5ff71b22369a17e10a83c6e9e371c2e3", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "8c92aa04ee30deea36265435357ba753", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.25190839694656486, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "path = gets\nwhile /\\/\\// =~ path\n path.sub! '//', '/'\nend\nif path.length > 1 and path[-1] == '/'\n path = path[0..-2]\nend\nputs path\n", "lang": "Ruby", "bug_code_uid": "b45c51a6ef790889f6f9586dd4f8e918", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "8c92aa04ee30deea36265435357ba753", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9945945945945946, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "(1+gets.to_i).upto(10000)) { |i| if i.to_s.split(//).uniq.length == 4; puts i; break; end; }\n", "lang": "Ruby", "bug_code_uid": "5cb507a7c615c492a2c734140122117c", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "c8bf0d06533e78c6626db87d2b46e1b1", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.1724137931034483, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "$_=<>;\nwhile (1){\n$_++;\n/(.)(.)(.)(.)/;\n$1-$2?($2-$3?($3-$4?($1-$4?($1-$3?($2-$4?(last):()):()):()):()):()):();\n}\nprint", "lang": "Ruby", "bug_code_uid": "6f6e789a3f3f585a1a0ab32c8ae00031", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "54725cfc0bd53bdec5bc1e6e507237d3", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8854166666666666, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nar = (1...n).to_a\nputs n + ar.reverse.zip(ar).map{|x,y| x*y}.inject(:+)", "lang": "Ruby", "bug_code_uid": "fae3e5bbcdbe4375a9bef7e690b30bdf", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "094b1774c4cf513968a2cddd3f16d570", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8949416342412452, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "k = readline.chomp.to_i\nn = 34\nkr = (k > 4 ? k - 4 : 0)\n\nseats = [\n (k > 0 ? 1 : 0) + (kr / 3.0).ceil,\n (k > 1 ? 1 : 0) + ((kr - 1) / 3.0).ceil,\n (k > 2 ? 1 : 0),\n (k > 3 ? 1 : 0) + ((kr - 3) / 3.0).ceil\n].map {|i| i >= 0 ? i : 0}\n\ndef pr(n, a)\n ('O' * a + '#' * (n - a)).split('').join('.')\nend\n\nputs '+------------------------+'\nputs \"|#{pr(11, seats[0])}.|D|)\"\nputs \"|#{pr(11, seats[1])}.|.|\"\nputs \"|#{pr(1, seats[2])}#{'.' * 23}|\"\nputs \"|#{pr(11, seats[3])}.|.|)\"\nputs '+------------------------+'\n", "lang": "Ruby", "bug_code_uid": "4f2301456585c81a0610457d58206c36", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "16ee55c625672adba1d4acdfa603b6cf", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6289180990899899, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "k = readline.chomp.to_i\nn = 34\nkr = k - 4\n\nseats = [\n (k > 0 ? 1 : 0) + (kr / 3.0).ceil,\n (k > 1 ? 1 : 0) + ((kr - 1) / 3.0).ceil,\n (k > 2 ? 1 : 0),\n (k > 3 ? 1 : 0) + ((kr - 3) / 3.0).ceil\n]\n\ndef pr(n, a)\n ('O' * a + '#' * (n - a)).split('').join('.')\nend\n\nputs '+------------------------+'\nputs \"|#{pr(11, seats[0])}.|D|)\"\nputs \"|#{pr(11, seats[1])}.|.|\"\nputs \"|#{pr(1, seats[2])}#{'.' * 23}|\"\nputs \"|#{pr(11, seats[3])}.|.|)\"\nputs '+------------------------+'\n", "lang": "Ruby", "bug_code_uid": "355f37b7270df65172a9093b64d3a211", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "16ee55c625672adba1d4acdfa603b6cf", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9985734664764622, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "k = gets.to_i\na = [\"|\"]\nb = [\"|\"]\nd = [\"|\"]\nif k >= 3\n c = \"|O.......................|\"\nelse\n c = \"|........................|\"\nend\nan = bn = dn = 0\nif k == 1\n an = 1\nelsif k == 2 || k == 3\n an = bn = 1\nelsif k >= 4\n an = ((k - 1) / 3.0).ceil\n if (k - 1) % 3 == 0\n bn = dn = an\n elsif (k - 1) % 3 == 1\n bn = dn = an - 1\n elsif (k - 1) % 3 == 2\n bn = an\n dn = an - 1\n end\nend\nrow = [a, b, d]\nrown = [an, bn, dn]\nfor i in 0...rown.size\n rown[i].times do\n row[i].push \"O.\"\n end\n (11 - rown[i]).times do\n row[i].push \"#.\"\n end\nend\na.push \"|D|)\"\nb.push \"|.|\"\nd.push \"|.|)\"\nputs \"+------------------------+\", a.join(\"\"), b.join(\"\"), c, d.join(\"\"), \"+------------------------+\"\n", "lang": "Ruby", "bug_code_uid": "5196ead7caaf7b2208d56b2a1d074587", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "30fe31b9d887e0f5fef9c8f9c7f54ed4", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9978813559322034, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def print_row(z, r, s, p, q, n = 11)\n puts p + ('0' + r) * z + s * (n - z) + q\nend\n\nk = gets.to_i\na = Array.new(4, 0)\n\nif k > 2\n a[3] = 1\n k -= 1\nend\n\na[0] = a[1] = a[2] = k / 3\n(0...k % 3).each do |i|\n a[i] += 1\nend\n\nprint_row(0, '', '--', '+', '--+')\nprint_row(a[0], '.', '#.', '|', '|D|)')\nprint_row(a[1], '.', '#.', '|', '|.|')\nprint_row(a[3], '.', '#.', '|', '......................|', 1)\nprint_row(a[2], '.', '#.', '|', '|.|)')\nprint_row(0, '', '--', '+', '--+')", "lang": "Ruby", "bug_code_uid": "c1b4dd2fa68fa1143e6035b9ebb259d4", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "cf7cba87d2008466188ed0e85a4c3853", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9957627118644068, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x,y,m=gets.split.map(&:to_i)\nx,y = y,x if x > y\nres = 0\nif x < 0 and y > 0 and m > 0\n t = (-x+y-1)/y\n x += t*y\n res += t\nend\ncnt=0\nwhile y < m\n x,y = y,x+y\n cnt+=1;\n break if cnt > 100\nend\nputs cnt > 100 ? -1 : res+cnt", "lang": "Ruby", "bug_code_uid": "b7cfa10014559e0b21fc100e2595564f", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "d6deb43aa7171af4ba04dcc37d763416", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9299820466786356, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "x, y, m = gets.split.map(&:to_i)\n\nif x <= 0 and y <= 0\n if [x,y].max < m\n puts -1\n else\n puts 0\n end\n\n exit\nend\n\nres = 0\n\nx = [x,y].min\ny = [x,y].max\n\nif x < 0\n res = (x/y).abs\n x += res * y\nend\n\nwhile y < m\n res += 1\n\n x, y = y, x+y\nend\n\nputs res\n\n", "lang": "Ruby", "bug_code_uid": "ba3a8812fca3018ed8b14ac83ec69d7b", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "21cddb052b0b796a856eaa74ea75c71d", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9861111111111112, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k,x,*a=$<.read.split.map &:to_i\nk=n if k>n\np a[0...-k].reduce(:+)+k*x", "lang": "Ruby", "bug_code_uid": "5523c28b3e1843dd5701d17e38f571b7", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "cf83551ef7262801c2cbb7472626ed72", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8355555555555556, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n, k, x = gets.split.map &:to_i\na = gets.split.map &:to_i\nputs (a[0...n-k].inject &:+) + k * x", "lang": "Ruby", "bug_code_uid": "5a18e327420a4d7cfcd5c564633852ec", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "76396e25dd01bc6c760eee6d93e5af43", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7454545454545455, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "print 19\nexit\na,b = *gets.split.map( &:to_i)\n\nprint a + b\n", "lang": "Ruby", "bug_code_uid": "f549ccc3ca5493e1b1b508412210ed22", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "8d72973290cbe939581937d8264aa554", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9572649572649573, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a,b = STDIN.readline.split.map{ |x| x.to_i }\nprint (a+b)%1000", "lang": "Ruby", "bug_code_uid": "a199ec3004b0a3d93547100e4989519e", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "9084b391ca7964856e516958cb9d0097", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.09090909090909091, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "p -1", "lang": "Ruby", "bug_code_uid": "dae9564aeed4b1bf94bc2b7479caa25b", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "86a37d64f089a9c944c6ec58f86528c1", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b = gets.split.map { |x| Integer x}", "lang": "Ruby", "bug_code_uid": "25c1601b752460b8e2bae1fe75471a8e", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "f0e269438ec47ffe11713733e8173465", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9610894941634242, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def is_prime( n )\n\t\n\treturn false if n % 2 == 0 && n != 2\n\n\tdiv = 3\n\twhile( div * div <= n )\n\t\treturn false if n % div == 0\n\t\tdiv += 2\n\tend\n\n\treturn true;\nend\n\nn = gets.chomp.to_i\n\nif is_prime( n )\n\tputs 1\nelsif n % 2 == 0\n\tputs 2\nelse\n\tputs 3\nend\n", "lang": "Ruby", "bug_code_uid": "021843c8e13511019e8108bf9e3e88d6", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "7274a130e2bdaa8ecd25dd339ea926a9", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9246575342465754, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "MOD = 998_244_353\n\ndef edge(v, u)\n\tcv = cu = 1\n\tres = 1\n\t[u, v].min.times do |i|\n\t\tcv = cv * (v - i)\n\t\tcv %= MOD\n\t\tcu = cu * (u - i) / (i + 1)\n\t\tcu %= MOD\n\t\tres += (cu * cv) % MOD\n\t\tres %= MOD\n\tend\n\tres\nend\n\na, b, c = gets.split.map{|x| x.to_i}\n\np (edge(a, b) * edge(b, c) * edge(a, c)).modulo(MOD)", "lang": "Ruby", "bug_code_uid": "8723a199ac8d279c416f405b645f5358", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "97bbf674fff7525cdaed044a2150b09f", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9965156794425087, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "MOD = 998_244_353\n\ndef edge(v, u)\n\tcv = cu = 1\n\tres = 1\n\t[u, v].min.times do |i|\n\t\tcv = cv * (v - i)\n\t\tcu = cu * (u - i) / (i + 1)\n\t\tres += (cu * % MOD * cv % MOD) % MOD\n\t\tres %= MOD\n\tend\n\tres\nend\n\na, b, c = gets.split.map{|x| x.to_i}\n\np (edge(a, b) * edge(b, c) * edge(a, c)).modulo(MOD)", "lang": "Ruby", "bug_code_uid": "5bb581762d65e7dd17485edff54aaa3e", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "97bbf674fff7525cdaed044a2150b09f", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9021739130434783, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a,b,c=gets.split.map &:to_i\nr=[a,b].min\na-=r\nb-=r\nr*=2\na+=b\nr+=[a,c].min\na-=r\nc-=r\np r+c/2*2", "lang": "Ruby", "bug_code_uid": "5374e41e60bf292a748a56658991cb4c", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "807e22394b16a9f56fee404e80489bda", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9863945578231292, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l,r,a=gets.split.collect!{|t|t.to_i}\nttl=(l+r+a)\nres=0\nif lr+a\n ttl=(r+a)*2\n end\nend\nputs ttl", "lang": "Ruby", "bug_code_uid": "bc580da2ec26a24a01b9056970b27a63", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "ec9896aa597ed39d3e3808c053813f6e", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6566265060240963, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "l, r, a = gets.split.map(&:to_i);\nx = [l, r].max;\ny = [l, r].min;\n\nif x <= a\n a = a/2 * 2;\n a += y * 2;\n puts (a);\nelse\n puts ((y+a)*2) if a <= (x-y)\n puts (x*2) if a > (x-y)\nend", "lang": "Ruby", "bug_code_uid": "b7bd1a972a44065c568c76e127646795", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "2a3482a4728f5567b5353d39ab55038b", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.855072463768116, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "l, r, a = gets.split.map(&:to_i)\nx = [(l - r).abs, a].min\nl += x if l < r\nr += x if l > r\na -= x\nputs 2 * (l + a / 2)\n", "lang": "Ruby", "bug_code_uid": "59e0316c3aed0431819c40d975e305c2", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "5e349d38367f163d4fa4858434a069bb", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6625766871165644, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "# http://codeforces.com/problemset/problem/41/A\n\ninput1 = gets.chomp\ninput2 = gets.chomp\n\nif input1 == input2\n puts \"NO\"\nelse\n if input1 == input2.reverse\n puts \"YES\"\n else\n puts \"NO\"\n end\nend", "lang": "Ruby", "bug_code_uid": "8c9c56ed8d709a728756dc3fc7238579", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "c5feec89f2c633e7ed6c0fb91de82fee", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9019607843137255, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "puts gets.chomp == gets.chomp.reverse ? :NO : :YES\n", "lang": "Ruby", "bug_code_uid": "e32512009ed204396b37227a2f040f5c", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "4b3b644b976cdbf8cec198eba725b34a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8470588235294118, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "$><= q**p\n puts \">\"\nelsif p**q <= q**p \n puts \"<\"\nend ", "lang": "Ruby", "bug_code_uid": "9341fb6cd60fdd637fe78584e0281b5e", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "c59c2e6cab08653ef4e74eec53d4c664", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8338557993730408, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x,y = gets.split ' '\nx = x.to_f\ny = y.to_f\nif x == y\n puts '='\nelsif y/x < Math.log10(y)/Math.log10(x)\n puts '<'\nelse\n puts '>'\nend", "lang": "Ruby", "bug_code_uid": "6f45e8710b693b38724a66bf590a477e", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "01ae81e0c6ab7e4c6545508a2b45e506", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6801007556675063, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "\n\ninput = STDIN.gets.chomp.split(\" \")\n\nx = input[0].to_i\ny = input[1].to_i\n\nif(x**y == y**x)\n\tputs \"=\"\n\nelsif(x**y < y**x)\n\tputs \"<\"\nelsif(x**y > y**x)\n\tputs \">\"\nend", "lang": "Ruby", "bug_code_uid": "b0e411bbb66c19975f55188237174221", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "4ac394b0dde0206da9b3a3a8ea2f58ae", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.686084142394822, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "a, b = gets.split.map(&:to_i)\naBiggerThanB = a > b\nwhile a != 0 && b != 0\n a -= 2*b if a >= 2*b\n b -= 2*a if b >= 2*a\n break if (a < 2*b && b < 2*a)\nend\nputs [a, b].join(\" \")", "lang": "Ruby", "bug_code_uid": "0a0cd75e917a38adc72ea2fd1a2c253c", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "fe63acf9f7224b70b97d53a1ecac56e0", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.987012987012987, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nT=[\n\t'O-|-OOOO',\n\t'O-|O-OOO',\n\t'O-|OO-OO',\n\t'O-|OOO-O',\n\t'O-|OOOO-',\n\t'-O|-OOOO',\n\t'-O|O-OOO',\n\t'-O|OO-OO',\n\t'-O|OOO-O',\n\t'-O|OOOO-',\n]\ngets.chomp.reverse.chars{|e|puts T[e]}", "lang": "Ruby", "bug_code_uid": "8ca82bc4edd75f650ef768d65927bd33", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "bbc785a418967de8b247c48747103199", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8853333333333333, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "a=gets.chomp.split(\"\")\n0.upto(a.length-1) {|i| a[i]=a[i].to_i}\na.reverse!\na.each do |i|\nif i>=5\np=1\nq=0\nelse \np=0\nq=1\nend\nans=(\"o\"*(1-i/5))+\"-\"+(\"o\"*(i/5))+\"|\"+(\"o\"*(i%5))+\"-\"+(\"o\"*(4-(i%5)))\nputs ans\n\nend", "lang": "Ruby", "bug_code_uid": "8e6d5a3332a10734513d9f2598d7fc9a", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "e2662a33ae84d957c0e119d11ab41fac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9760479041916168, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "gets.chomp.split('').map { |x| x.to_i }.reverse.each { |x|\n left = x < 5 ? '0-' : '-0'\n m = x % 5\n right = '0' * m + '-' + '0' * (4 - m)\n puts left + '|' + right\n}", "lang": "Ruby", "bug_code_uid": "9960dfa9e32b90cabec9750de0e4fc09", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "6b167f943385611a7d85d270d61962dd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9927641099855282, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#f = File.open('test1.txt', 'r')\na = {\n '0' => 'O-|-OOOO',\n '1' => 'O-|O-OOO',\n '2' => 'O-|OO-OO',\n '3' => 'O-|OOO-O',\n '4' => 'O-|OOOO-',\n '5' => '-O|-OOOO',\n '6' => '-O|O-OOO',\n '7' => '-O|OO-OO',\n '8' => '-O|OOO-O',\n '9'=> '-O|OOOO-'\n}\nwhile(s = f.gets)\n s.chomp.reverse.chars.each do |ch|\n p a[ch]\n end\nend", "lang": "Ruby", "bug_code_uid": "23840b0ccc21684842592527ce31e824", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "a3210f7369d8a1a7e33d571610b528e7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.49391304347826087, "equal_cnt": 28, "replace_cnt": 13, "delete_cnt": 11, "insert_cnt": 4, "fix_ops_cnt": 28, "bug_source_code": "n = gets.chomp.to_i\nminutes = gets.split.map(&:to_i)\nresult = 0\nif minutes[0] > 15\n result = 15\nelse\n (0..minutes.size).each do |index|\n if minutes[index] - minutes[index-1] > 15\n result = minutes[index-1] + 15\n break\n end\n #brek if minutes[i] - minutes[i-1] > 15\n\n end\n result = minutes.last + 15 if result == 0\n result = 90 if result > 90\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "0eb1dbaec8db44ca9d9f5369606f0cc8", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "40bec3e545865403f0fdd8bb2df7a829", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9893617021276596, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,k,*a=$<.read.split.map &:to_i\ns=c=0\np (1..n).find{|i|s+=a[i-1];x=[s,8].min;s-=x;k>=c+=x}||-1", "lang": "Ruby", "bug_code_uid": "3d2aed5206f1f26ead111552ba428df3", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "cc91d7225a455efccb89f42af1d395a0", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9563318777292577, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.strip.split.map(&:to_i)\na = gets.strip.split.map(&:to_i)\nans = curr = 0\nn.times do |i|\n curr += a[i]\n given = [curr, 8].min\n curr -= given\n k -= given\n ans += 1\nend\nans = -1 if k > 0\nputs ans\n", "lang": "Ruby", "bug_code_uid": "471d1a2c386acf6772dd905e2ae1c42a", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "1af9d29a1b2d95f5d653bd19b19f4f03", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9937888198757764, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "N, K = gets.split.map &:to_i\nA = gets.split.map &:to_i\nc = 0\nN.times do |i|\n c += A[i]\n K -= [c, 8].min\n c -= [c, 8].min\n (p i + 1; exit) if k <= 0\nend\np -1\n", "lang": "Ruby", "bug_code_uid": "9699fe8ef375dbd9ab2f59e15e18cf2b", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "99067a9bb02f2824ca56a7cfd4d68ff6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6372881355932203, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "def calc(n, k, arr)\n\ttotal = 0\n\tcount = 0\n\tarr.each do |x|\n\t\tif x <= 8\n\t\t\ttotal += x\n\t\telse\n\t\t\ttotal += 8\n\t\tend\n\t\tcount += 1\n\tend\n\tif total >= k\n\t\treturn count\n\telse\n\t\treturn -1\n\tend\nend\nn, k = gets.chomp.split(\" \").map(&:to_i)\narr = gets.chomp.split(\" \").map(&:to_i)\nputs calc(n, k, arr)", "lang": "Ruby", "bug_code_uid": "46ff01fc1ff19adc2820d3a909885e15", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "2874a9f8fbe6d1bc87ba2a61ec19a90f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9635036496350365, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n,d=gets.split.map &:to_i\nmas=gets.split.map &:to_i\nc= (mas.length-1)*10\nf=mas.inject(:+)\nif c+f >= d\n puts -1\n exit\nelse\n puts (d-f)/5\nend", "lang": "Ruby", "bug_code_uid": "4ace71591ef92977eb65181b0acb9711", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "8b96fa666422c16c28151f046c3e5419", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9969418960244648, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, d = gets.split.map &:to_i\nt = gets.split.map &:to_i\nfree_time = d - (t.size - 1) * 10 - t.inject(:+)\nputs free_time > 0 ? (t.size - 1) * 2 + free_time / 5 : -1\n", "lang": "Ruby", "bug_code_uid": "8ed052d3d5d34cf138d3afcd6137b8db", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "70688ffebae6d36b3656fdbe89e22c61", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.979047619047619, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "nd = gets.chomp\nnd = nd.split\nn = nd[0].to_i\nd = nd[1].to_i\nsongs = gets.chomp\nsongs = songs.split\n\nsong_sum = 0\nfor i in (0..songs.size-1)\n\tsong_sum += songs[i].to_i\nend\nif d <= 20 || ((songs.size - 1) * 10) + song_sum > d\n\tprint -1\nelse\n\tprint (d - song_sum) / 5\nend", "lang": "Ruby", "bug_code_uid": "e728fa2f84bbf69904ea93e8121d843d", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "d37771e232d57c0f06e1bc3a7d9ed9fd", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9023255813953488, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n,d=gets.split.map(&:to_i)\na=gets.split.map(&:to_i).reduce(&:+)+(n-1)*10\n#p a\nif a>d\n p -1\nelse\n p (d-a)/5\nend", "lang": "Ruby", "bug_code_uid": "8550bd6e7aea290363d87f4fcddd9af4", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "360ebc1d5575d8abbd316b2a64e17013", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8870636550308009, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "# Utility\ndef factorial(n)\n (1..n).inject(:*) || 1\nend\n\n# Input\nn, m, k = *(gets.split.map { |i| i.to_i })\n\n# Processing\nf = factorial(n - 1) / factorial(n - 1 - k)\ng = m * (m - 1)**k\n\nresult = f * g % 998244353\n\n# Output\nputs result\n", "lang": "Ruby", "bug_code_uid": "c20150486e07b3d8013573a134346464", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "cc4cfba1833002f638b73a8bb9a0904b", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9285714285714286, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p 2-gets.to_i", "lang": "Ruby", "bug_code_uid": "faf3aa29c0aa26f467dfb889c0b565a9", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "apr_id": "5f707b295c81caf56d48de53e51d3323", "difficulty": 1200, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.912, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n, l, r, x = gets.split.collect{|i| i.to_i}\nc = gets.split.collect{|i| i.to_i}.sort\nans = 0\n(2..n).each do |i|\n c.combination(i).each do |cc|\n sum = cc.inject{|sum,ccc| sum+=ccc}\n if sum > r\n break\n elsif sum >= l and cc[-1]-cc[0] >= x\n ans += 1\n end\n end \nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "bfbabf14f5b624278bd5b5c58e8f23ad", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d", "apr_id": "804be9e9ec0941c01d1a92735c4b5e61", "difficulty": 1400, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7897271268057785, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "x,y,n = gets.split(' ').map{ |e| e.to_i }\nif y > n\n\tz = x.to_f / y\n\t(1..n).each do |i|\n\t\taa = (i+0.5) * x / y\n\t\tdiff = (aa / i - z).abs\n\t\tif (!min_diff || min_diff > diff)\n\t\t\tmin_diff = diff\n\t\t\ta = aa\n\t\t\tb = i\n\t\tend\n\t\tif min_diff == 0\n\t\t\tbreak\n\t\tend\n\tend\nelse\n\ta = x\n b = y\nend\n\nputs \"#{a}/#{b}\"\n\n\n", "lang": "Ruby", "bug_code_uid": "49d850278fc548232c048a01fc85daa3", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "d79ce95e99c2f813a6e8507e7b9191ef", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9818181818181818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x,y,n = gets.split(' ').map{ |e| e.to_i }\na = x\nb = y\nif y > n\n\tz = x.to_f / y\n\tmin_diff = nil\n\t(1..n).each do |i|\n\t\taa = -((-i.to_f * x / y - 0.5).floor) - 1\n\t\tdiff = (aa.to_f / i - z).abs\n\t\tif (!min_diff || min_diff > diff)\n\t\t\tmin_diff = diff\n\t\t\ta = aa\n\t\t\tb = i\n\t\tend\n\t\tif min_diff == 0\n\t\t\tbreak\n\t\tend\n\tend\n\t\t\nend\n\nputs \"#{a}/#{b}\"\n\n\n", "lang": "Ruby", "bug_code_uid": "b3f51341527fb1be4baddb63a2c4269d", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "d79ce95e99c2f813a6e8507e7b9191ef", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8422664624808576, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x, y, n = gets.split(' ').collect!{|i| i.to_i}\n\n\nk = x.to_f/y\n# p k\na = 0\nb = 0\nmin = 100000\n\n(1..n).each do |i|\n\tj = (k*i).round.to_i\n\tcur = (k - j/i.to_f).abs\n\t# p j if j == 38236\n\t# p i if j == 38236\n\t# p j/i.to_f if j == 38236\n\tif cur < min\n\t\ta = j\n\t\tb = i\n\t\tmin = cur\n\tend\n\nend\n\nprint a, \"/\", b\n", "lang": "Ruby", "bug_code_uid": "dec7b28428b9bfeab784b643399b11a7", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "eda1be380612c910d62dc01dd3ac6d6c", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.5314533622559653, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "x,y,n = gets.split(\" \").map(&:to_i)\nif y <= n\n\tputs \"#{x}/#{y}\"\nelse\n\tmin_diff = n\n\tgiven_div = x/y.to_f\n\tval1 = nil\n\tval2 = nil\n\t(0..(n)).each do |a|\n\t\tn.downto(0) do |b|\n\t\t\tdiv = (a/b.to_f)\n\t\t\t# puts \"a #{a} b #{b} #{div} #{min_diff}\"\n\t\t\tif (given_div - div).abs < min_diff\n\t\t\t\tval1 = a\n\t\t\t\tval2 = b\n\t\t\t\tmin_diff = (given_div - div).abs\n\t\t\tend\n\t\tend \n\tend\n\tputs \"#{val1}/#{val2}\"\nend", "lang": "Ruby", "bug_code_uid": "6241175e4231e11e532bc00c13ae86fb", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "bedf47694d5640723c95271dfed799aa", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8771929824561403, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n, m, k = gets.strip.split.map(&:to_i)\npos = k.odd? ? \"L\" : \"R\"\ncol_sum = m * 2\nmod = k % col_sum\nmod += 1 if k.odd?\ndesk = (mod / 2).ceil\ndesk = m if mod == 0\nlane = (k + mod) / col_sum\nputs \"#{lane} #{desk} #{pos}\"\n", "lang": "Ruby", "bug_code_uid": "800d4c7421185ee83959cb38ceb04453", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "10a0e716b55ee03f5e28009c0fc82091", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9555555555555556, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, m, x = gets.split.map(&:to_i)\nx-=1\nputs \"#{x/6 + 1} #{(x/2)%3+1} #{(x%2==0)?'L':'R'}\"", "lang": "Ruby", "bug_code_uid": "063ed78c15ccc990ef9284f8c25f8dc1", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "8aaaaba8bd0aad67073e49bdb9ce3816", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9343832020997376, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = gets\nres = 0\nchanged = false\ni = 0\nwhile i < s.size \n if s[i] == 'V' && s[i+1] == 'K'\n i += 2\n res += 1\n next\n end\n if changed\n i += 1\n next\n end\n if s[i] == 'K' && s[i+1] == 'K' ||\n s[i] == 'V' && s[i+1] == 'V' && (s[i+2] == 'V' || s[i+2] == nil)\n res += 1\n i += 2\n changed = true\n next\n end\n i += 1\nend\n\nputs res\n", "lang": "Ruby", "bug_code_uid": "c7c2488d20e618ca0df5a4b3e2026257", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "58048d47ca329a70a4ced9a7f21c5f75", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8842105263157894, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "str1 = gets().chomp\nstr1_count = str1.scan(/VK/).size\nif (str1.scan(/VVV/||/KKK/).size > 0) || (str1[0,2]=='KK') || (str1[-2,str1.size]=='VV')\n str1_count += 1\nend\np str1_count", "lang": "Ruby", "bug_code_uid": "d9a37f899c5a5619a718d0daad41f45a", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "c9862e622ffec19d222344b75795457d", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7210884353741497, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "str1 = gets().chomp\nstr1_count = str1.scan(/VK/).size\nif (str1_count != 0 && str1.scan(/VVV/||/KKK/).size > 0) || (str1_count == 0 && str1.scan(/VV/||/KK/).size > 0) || (str[0,2]=='KK' || str[0,2]=='VV')\n str1_count += 1\nend\np str1_count", "lang": "Ruby", "bug_code_uid": "8d3d0a0dc37c2b9cfdecc9134e18bfaa", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "c9862e622ffec19d222344b75795457d", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8270676691729323, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "s = gets\nputs (s.length - s.gsub('VK','').sub('KV','').length) / 2", "lang": "Ruby", "bug_code_uid": "50e474ba954c86bc47afadaace69ef71", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "604ad8cfe884e753f1b9df07f09269d2", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9603841536614646, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "intended = STDIN.readline.strip\nreceived = STDIN.readline.strip\ntarget = intended.count('+') - intended.count('-')\norigin = received.count('+') - received.count('-')\nsteps = received.count('?')\nlocation = { origin => 1.0 }\nsteps.times do\n\tnext_location = Hash.new(0.0)\n\tlocation.each do |x, p|\n\t\tnext_location[x-1] += p/2\n\t\tnext_location[x+1] += p/2\n\tend\n\tlocation = next_location\nend\nputs location[target]\n", "lang": "Ruby", "bug_code_uid": "e9116339aeb563a953eb223816b4b004", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "d89738dafe6dd84792ba578dc52e5773", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.693069306930693, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "s=gets.chomp\nputs s%s.count('o')>0?:No: :Yes", "lang": "Ruby", "bug_code_uid": "cf5d637ee481c5c3b7557b628b8e5a5b", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "02b0584d511be5a2ab14a5dfb565db18", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9649122807017544, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s=gets.chomp\nc=s.count(?o)\nputs c>0||s.size%c>0?:No: :Yes", "lang": "Ruby", "bug_code_uid": "875f408b43a10d57ffeef379edc6646a", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "02b0584d511be5a2ab14a5dfb565db18", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9243986254295533, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "PEARL = 'o'\nLINK = '-'\n\nnecklace = STDIN.gets.chomp\n\n\ndef adjustable?(necklace)\n pearl_count = necklace.count(PEARL)\n if pearl_count == 1\n true\n else\n link_count = necklace.count(LINK)\n link_count % pearl_count == 0\n end\nend\n\nif adjustable?(necklace)\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "680554a96e86f3a464810ad281aecd2b", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "2aa518a1609b17130d6f5aff34738fe5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.879045996592845, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "PEARL = 'o'\nLINK = '-'\n\nnecklace = STDIN.gets.chomp\n\ndef adjustable?(necklace)\n pearl_count = necklace.count(PEARL)\n if pearl_count == 1\n true\n else\n link_count = necklace.count(LINK)\n link_count % (pearl_count - 1) == 0\n end\nend\n\nif adjustable?(necklace)\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "86eb93ecd2578d120b8b77ceeb566a49", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "2aa518a1609b17130d6f5aff34738fe5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.29239766081871343, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\nsum, sign = 0, false\nn.times do |t|\n\tsign ? sum += (t+1) : sum -= (t+1)\n\tsign = !sign\nend\nputs sum", "lang": "Ruby", "bug_code_uid": "ca36df60c56c06217cac96764725ca8d", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "cd7d64badfbe18ba89cc339f8e6088f4", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.45454545454545453, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "n = gets.to_i\np = Array.new(n)\n\nsum = 0\nfor i in 1..n\n if i%2 == 0\n p[i] = i\n else\n p[i] = -i\n end\n sum = sum + p[i]\nend\nputs sum\n", "lang": "Ruby", "bug_code_uid": "f5fa07e6338b420536d217b36936debf", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "5a724b1bff325603753a8165f9aebea7", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.32390745501285345, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "n = gets.chop.to_i \ni = 1 \ncount = 0\nsum = 0 \nwhile i<=n do \n if count==0 \n sum = sum-i \n count =1 \n elsif count ==1 \n sum+= i \n count =0\n \n end \n i+=1 \nend \nputs sum ", "lang": "Ruby", "bug_code_uid": "a1911d4e01324d279772efeace809a07", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "29291427c7ab4faf197fd5ac002d0fe9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5180722891566265, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "n = gets.to_i\nsum = 0\n(1..n).step(1) do |x|\n sum += (-1) ** x * x\nend\nputs sum\n", "lang": "Ruby", "bug_code_uid": "b3b10122ed4a44244473dd33351387d2", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "6ffb70043e14b2c2af79d8cb42ad5166", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.63, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "input = gets.chomp\nn = input.to_i\nf = 0\n(1..n).each do |i|\n f += ((-1) ** i) * i\nend\nputs f\n", "lang": "Ruby", "bug_code_uid": "b1334218b221fcbd10dd31eaf812d332", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "f5b6fe94d9c90faa9fa246efedd8b194", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.46368715083798884, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n = gets.chomp.to_i\n\ni = 1\ncount = 0\nwhile i <= n\n\tif i%2 == 0\n\t\tcount += i\n\telse\n\t\tcount-= i\n\tend\n\ti += 1\nend\n\nputs count", "lang": "Ruby", "bug_code_uid": "b468ff1150795a9bebd0bd4861ad6812", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "3e792a26920b7a297728afa68e4ec8ba", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.586046511627907, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#!/usr/bin/ruby\n\nn = gets.chomp.to_i\n\nsum = 0\n(1..n).each do |i|\n i *= -1 if i % 2 != 0\n sum += i\nend\nputs sum\n", "lang": "Ruby", "bug_code_uid": "cb4c6e5a921e15c9a482be482d87bf28", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "6d2beceb5c5b5103c7b49f0fb76ccb03", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6694560669456067, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#puts \"Enter any number\\n\"\nn = gets.to_i\ns = 0\nfor i in 1..n do\n if i%2 == 0\n s += i\n else\n s -= i\n end\nend\nputs s", "lang": "Ruby", "bug_code_uid": "594ee15d70b3bd1cf2fe91ffc3d99c7c", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "f01443bca9c9194840b30beea4ed5e34", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.719626168224299, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n=gets.strip.chomp.to_i\ndef func(n)\n s=0\n for i in 1..n\n s+=((-1)**i)*i\n end\n s\nend\nputs func(n)", "lang": "Ruby", "bug_code_uid": "7f4d24006d32ccc1d1f461aa41d93e51", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "2f0877213403c796ec84ed22ff17bf5d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.358974358974359, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "res = 0\ninputNum = gets.chomp.to_i\nfor i in 1..inputNum.to_i\n res = res + (((-1) ** i)*i)\nend\nprint res", "lang": "Ruby", "bug_code_uid": "70b850b5c81121cf0e9d9ab57c3e373e", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "e98f3f8558e641671c20219becdcaeed", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "lengths = gets.chomp!.split(/[ ]+/)\nmax = 0\nfor i in (0..3) do\n sticks = []\n for j in (0..3) do\n if j != i then sticks << lengths[j] end\n end\n sticks.sort!\n max = sticks[0].to_i + sticks[1].to_i - sticks[2].to_i\n if max > 0 then\n puts \"TRIANGLE\" \n break\n end\nend\nif max == 0 then\n puts \"SEGMENT\"\n break\nelsif max < 0 then\n puts \"IMPOSSIBLE\"\n break\nend\n", "lang": "Ruby", "bug_code_uid": "5c5d91caf14bed97b480879ec7347742", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "24e0eceb4942cec3a6e393a8959d2c4f", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5967976710334789, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/evn ruby\n\ndef radians_to_degrees(radians)\n\tradians * 180.0 / Math::PI\nend\n\ndef calc_area(a, b, c)\n\tp = (a + b + c) * 0.5\n\targument = p * (p - a) * (p - b) * (p - c)\n\tunless argument < 0\n\t\tMath::sqrt(argument)\n\telse\n\t\t-1\n\tend\nend\n\ninput = gets.to_s.split(' ')\n\na = input[0].to_i\nb = input[1].to_i\nc = input[2].to_i\nd = input[3].to_i\n\nif calc_area(a, b, c) >= 0\n\tif calc_area(a, b, c) > 0\n\t\tputs \"TRIANGLE\"\n\telse\n\t\tputs \"SEGMENT\"\n\tend\nelsif calc_area(a, b, d) >= 0\n\tif calc_area(a, b, d) > 0\n\t\tputs \"TRIANGLE\"\n\telse\n\t\tputs \"SEGMENT\"\n\tend\nelsif calc_area(a, c, d) >= 0\n\tif calc_area(a, c, d) > 0\n\t\tputs \"TRIANGLE\"\n\telse\n\t\tputs \"SEGMENT\"\n\tend\nelsif calc_area(b, c, d) >= 0\n\tif calc_area(b, c, d) > 0\n\t\tputs \"TRIANGLE\"\n\telse\n\t\tputs \"SEGMENT\"\n\tend\nelse\n\tputs \"IMPOSSIBLE\"\nend\n", "lang": "Ruby", "bug_code_uid": "23a61b9d76b34f6ab2905ef4750aa5ed", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "dc9601954589a4e329bc15e7b9b878ee", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.1889763779527559, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "\nsize=gets.split.map(&:to_i)\nd=gets.to_i\nans=0\nsize[0].times{|x|\n size[1].times{|y|\n if (x+y)%2==1 then\n next\n end\n dd=[x+1,y+1,size[0]-x,size[1]-y].min\n if dd==d then\n ans+=1\n end\n }\n}\nputs ans\n\n", "lang": "Ruby", "bug_code_uid": "590b42429da214737b7314c9ce3b7c3b", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "9c3be2a2a38a422c143c627d583b38a9", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8816793893129771, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\n\nsfriends = gets.chomp\nsfingers = gets.chomp\n\nfriends = sfriends.to_i\nfingers = sfingers.split(\" \").map{|x| x.to_i}\ntotalFingers = fingers.reduce{|a,b| a+b}\n\n(1..5).each do |x|\n\tif (((totalFingers + x)) % (friends+1)) != 1 then\n\t\tputs x\n\t\tbreak\n\tend\t\nend\n", "lang": "Ruby", "bug_code_uid": "8e4b14d4828d866a1a9b75701427e5f3", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "637958b057e38701fdc90a535196318a", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6894586894586895, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "class Count\n def initialize\n @friend = $stdin.gets.chomp.to_i\n @fingers = $stdin.gets.chomp.split(' ').map(&:to_i)\n @total = @friend + 1\n @sum = @fingers.inject(:+)\n end\n\n def calc\n 1.upto(5) do |n|\n d = n + @sum \n while d % @total != 1\n return n\n end\n end\n end\nend\n\nc = Count.new\nputs c.calc", "lang": "Ruby", "bug_code_uid": "6b9d6bca451bb0c8dee8adc45307fe00", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "f45ce339dd333e11f5acefe8f4db29a7", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9602446483180428, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = gets.chomp.to_i + 1\ntotal = 0\ngets.chomp.split(' ').each { |t| total += t.to_i }\n\nways = 0\n\n5.times do |i|\n\tways += 1 if (i+2) % n != 0\nend\n\nputs ways\n\n\n \n", "lang": "Ruby", "bug_code_uid": "ebfa5c97fbd25ff39e98264b1b8024dc", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "3f5fce2e82cce17a7ef3320757df75a7", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9355932203389831, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp.to_i\nt = STDIN.readlines.map { |x| x.chomp.to_i }.reduce(:+)\nputs Array(1..5).reduce(0) { |s, x| s + ((t + x) % (n + 1) != 1 ? 1 : 0)}\n", "lang": "Ruby", "bug_code_uid": "8e4d4010187dfeed65f82930094b3626", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "0b9ddbc2d55df2bafa80cbaa1f6d062d", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6041237113402061, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "def isinside(ax, ay)\n half = $a/2.0\n return false if ax - half >= $x || ax + half <= $x\n return false if ay - half >= $y || ay + half <= $y\n return true\nend\n$a,$x,$y = gets.chomp.split(/ /).map!{|x| x.to_i}\nret = -1\nret = 1 if isinside(0, $a*(0.5))\nret = 2 if isinside(0, $a*(1.5))\nret = 3 if isinside(-$a*(0.5), $a*(2.5))\nret = 4 if isinside( $a*(0.5), $a*(2.5))\nret = 5 if isinside(0, $a*(3.5))\nret = 6 if isinside(-$a*(0.5), $a*(4.5))\nret = 7 if isinside( $a*(0.5), $a*(4.5))\nputs ret.to_s\n", "lang": "Ruby", "bug_code_uid": "254cf328595096fe85877508445cffff", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "f07ade225bbfdeb4ef33abd8e2d53789", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9910554561717353, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\n\na,x,y = $stdin.readline.split().collect {|x| x.to_i}\np [a,x,y]\n\nrow = y / a\n\nif y % a == 0\n\tputs -1\n\texit 0\nend\n\ndef cells_in_row(n)\n\treturn 1 if n == 0\n\treturn 1 if n % 2 == 1\n\treturn 2\nend\n\ndef first_cell_in_row(n)\n\treturn 1 if n == 0\n\treturn (n+1)/2*3 - 1 if n % 2 == 1\n\treturn n/2*3\nend\n\ncase cells_in_row(row)\nwhen 1\n\tif x < a.to_f/2 && x > -a.to_f/2\n\t\tputs first_cell_in_row(row)\n\telse\n\t\tputs -1\n\tend\nwhen 2\n\tif x < 0 && x > -a\n\t\tputs first_cell_in_row(row)\n\telsif x > 0 && x < a\n\t\tputs first_cell_in_row(row)+1\n\telse\n\t\tputs -1\n\tend\nend\n", "lang": "Ruby", "bug_code_uid": "61c1a7a0bb071734c12f9989ab86e9df", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "f4b73f2890706807b70ecbb84a21341b", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.47516679021497404, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "puts \"Enter first day\"\na = gets.chomp\nputs \"Enter second day\"\nb = gets.chomp\n\n\nif a == \"monday\"\n\tn1 = 1\nend\nif (a == \"tuesday\")\n\tn1 = 2\nend\nif (a == \"wednesday\")\n\tn1 = 3\nend\nif (a == \"thursday\")\n\tn1 = 4\nend\nif (a == \"friday\")\n\tn1 = 5\nend\nif (a == \"saturday\")\n\tn1 = 6\nend\nif (a == \"sunday\")\n\tn1 = 7\nend\n\nif (b == \"monday\")\n\tn2 = 1\nend\nif b == \"tuesday\"\n\tn2 = 2\nend\nif (b == \"wednesday\")\n\tn2 = 3\nend\nif (b == \"thursday\")\n\tn2 = 4\nend\nif (b == \"friday\")\n\tn2 = 5\nend\nif (b == \"saturday\")\n\tn2 = 6\nend\nif (b == \"sunday\")\n\tn2 = 7\nend\n\ndif = n2 - n1\n\nif (dif < 0)\nf = dif + 7\nelse \nf = dif \nend\n\nif (f == 3)\n\tputs \"YES\"\nelsif (f == 0)\n\tputs \"YES\"\nelsif (f == 2)\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n\nputs \"Enter third day\"\na = gets.chomp\nputs \"Enter fourth day\"\nb = gets.chomp\n\nif a == \"monday\"\n\tn1 = 1\nend\nif (a == \"tuesday\")\n\tn1 = 2\nend\nif (a == \"wednesday\")\n\tn1 = 3\nend\nif (a == \"thursday\")\n\tn1 = 4\nend\nif (a == \"friday\")\n\tn1 = 5\nend\nif (a == \"saturday\")\n\tn1 = 6\nend\nif (a == \"sunday\")\n\tn1 = 7\nend\n\nif (b == \"monday\")\n\tn2 = 1\nend\nif b == \"tuesday\"\n\tn2 = 2\nend\nif (b == \"wednesday\")\n\tn2 = 3\nend\nif (b == \"thursday\")\n\tn2 = 4\nend\nif (b == \"friday\")\n\tn2 = 5\nend\nif (b == \"saturday\")\n\tn2 = 6\nend\nif (b == \"sunday\")\n\tn2 = 7\nend\n\ndif = n2 - n1\n\nif (dif < 0)\nf = dif + 7\nelse \nf = dif \nend\n\nif (f == 0)\n\tputs \"YES\"\nelsif (f == 2)\n\tputs \"YES\"\nelsif (f == 3)\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n\nputs \"Enter fifth day\"\na = gets.chomp\nputs \"Enter sixth day\"\nb = gets.chomp\n\nif a == \"monday\"\n\tn1 = 1\nend\nif (a == \"tuesday\")\n\tn1 = 2\nend\nif (a == \"wednesday\")\n\tn1 = 3\nend\nif (a == \"thursday\")\n\tn1 = 4\nend\nif (a == \"friday\")\n\tn1 = 5\nend\nif (a == \"saturday\")\n\tn1 = 6\nend\nif (a == \"sunday\")\n\tn1 = 7\nend\n\nif (b == \"monday\")\n\tn2 = 1\nend\nif b == \"tuesday\"\n\tn2 = 2\nend\nif (b == \"wednesday\")\n\tn2 = 3\nend\nif (b == \"thursday\")\n\tn2 = 4\nend\nif (b == \"friday\")\n\tn2 = 5\nend\nif (b == \"saturday\")\n\tn2 = 6\nend\nif (b == \"sunday\")\n\tn2 = 7\nend\n\ndif = n2 - n1\n\nif (dif < 0)\nf = dif + 7\nelse \nf = dif \nend\n\nif (f == 0)\n\tputs \"YES\"\nelsif (f == 2)\n\tputs \"YES\"\nelsif (f == 3)\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "d168f8e636b51b44c5ae9e9deae413c7", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "24456631854d58c293d12727d5048c18", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8996212121212122, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "class Matrix2x2\n attr_accessor :a, :b, :c, :d\n def initialize(a=0,b=0,c=0,d=0)\n @a = a\n @b = b\n @c = c\n @d = d\n end\nend\n\ndef mult(x, y)\n z = Matrix2x2.new\n z.a = x.a*y.a + x.b*y.c\n z.b = x.a*y.b + x.b*y.d\n z.c = x.c*y.a + x.d*y.c\n z.d = x.c*y.b + x.d*y.d\n z\nend\n\ndef expt(a, p)\n if p == 1\n a.clone\n elsif p % 2 == 1\n t = expt(a, p-1)\n mult(a, t)\n else\n t = expt(a, p/2)\n mult(t, t)\n end\nend\n\nn = gets.to_i\na = Matrix2x2.new(0, 3, 1, 2)\nan = expt(a, n)\nputs an.a\n", "lang": "Ruby", "bug_code_uid": "3c6c7f8369f79e8c8f503f0a5f1bbd06", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "17110d9a4b21ae3361999e69d7e177bc", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.08502415458937199, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "mod=1000000007\n na=gets.chomp.to_i\n dp=[[],[]]\n \n dp[0][0]=1\n dp[0][1]=0\n dp[0][2]=0\n dp[0][3]=0\n dp[1][0]=0\n dp[1][1]=0\n dp[1][2]=0\n dp[1][3]=0\n \n d=0\n d1=1\n i=1\n while i<=na\n dp[d1][0] = (dp[d][1] + dp[d][2] + dp[d][3]) % mod;\n dp[d1][1] = (dp[d][0] + dp[d][2] + dp[d][3]) % mod;\n dp[d1][2] = (dp[d][1] + dp[d][0] + dp[d][3]) % mod;\n dp[d1][3] = (dp[d][1] + dp[d][2] + dp[d][0]) % mod;\n tmp=d1\n d1=d\n d=tmp\n \n i+=1\n end\n puts dp[d][0]", "lang": "Ruby", "bug_code_uid": "68e63e74572d1cd457dc7455d4bd3a73", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "99fdedaaa1a1566c971be5a4d9858507", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3796711509715994, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": " na=gets.chomp.to_i\n i=2\n x=0\n while i<=na\n if (i%2)\n x=(x+1)*3\n else\n x=(x-1)*3 \n end\n x= x % 1000000007\n i+=1\n end\n puts x", "lang": "Ruby", "bug_code_uid": "eb9624cfc7a57f1c045b0df41bc23fc9", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "99fdedaaa1a1566c971be5a4d9858507", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5796875, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "tx, ty = gets.strip.split(\" \").collect{|v| v.to_i}\ns = []\nidx = 0\ndx = dy = 0\ngets.strip.split(\"\").collect do |c|\n s[idx] = [1, 0] if c == 'R'\n s[idx] = [-1, 0] if c == 'L'\n s[idx] = [0, 1] if c == 'U'\n s[idx] = [0, -1] if c == 'D'\n dx += s[idx][0]\n dy += s[idx][1]\n idx += 1\nend\n\nif tx == 0 and ty == 0 then\n puts \"Yes\"\n exit\nend\n\nif dx == 0 and dy == 0 and (tx != 0 or ty != 0) then\n puts \"No\"\n exit\nend\n\nx = y = 0\ns.size.times do |i|\n x += s[i][0]\n y += s[i][1]\n k = 10**10\n k = (tx - x) / dx if dx != 0\n k = [k, (ty - y) / dy].min if dy != 0\n k = 0 if k < 0\n if k * dx + x == tx and k * dy + y == ty then\n puts \"Yes\"\n exit\n end\nend\n\nputs \"No\"", "lang": "Ruby", "bug_code_uid": "491e747e10995d9e4c66c4a827679f0f", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "e2123f029fba269cb190101a975e9891", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7980295566502463, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "a, b = gets.split.map(&:to_i)\ns = gets.chop\n\nif a < 0\n a = -a\n s.tr! 'LR', 'RL'\nend\n\nif b < 0\n b = -b\n s.tr! 'UD', 'DU'\nend\n\nminx = maxx = miny = maxy = x = y = 0\n\ndef step(x, y, c)\n if c == 'U' then\n y += 1\n elsif c == 'D' then\n y -= 1\n elsif c == 'R' then\n x += 1\n elsif c == 'L' then\n x -= 1\n end\n [x, y]\nend\n\ns = \"0#{s}\"\ns.each_char do |c|\n x, y = step x, y, c\n maxx = x if x > maxx\n minx = x if x < minx\n maxy = y if y > maxy\n miny = y if y < miny\n if x == a and y == b\n puts 'Yes'\n exit\n end\nend\n\ndx = x\ndy = y\n\nif dx < 0 or dy < 0 or (dx == 0 and dy == 0)\n puts 'No'\n exit\nend\n\nstartx = a - maxx - 1\nendx = a - minx + 1\nstarty = b - maxy - 1\nendy = b - miny + 1\n\niter = 0\niter = startx / dx if dx > 0\niter = [iter, starty / dy].min if dy > 0\n\nx = iter * dx\ny = iter * dy\n\nbegin\n s.each_char do |c|\n x, y = step x, y, c\n if x == a and y == b\n puts 'Yes'\n exit\n end\n end\nend while x <= endx and y <= endy\n\nputs 'No'\n\n\n", "lang": "Ruby", "bug_code_uid": "9fd50ff0ee283f1412e80ef793a3af58", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "acbcff17c0e870b38bf356078e0f6838", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9807162534435262, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "foo = 0\nbar = 0\nbaz = 0\nquz = 0\ntux = gets.to_i\nwhile tux!=0\npur =gets.to_i\nfoo = foo + pur\nbar = bar + 1\n#if bar*baz==foo*quz\n baz = foo\n quz = bar\n#end\ntux -=1\nend\n\nputs baz*1.0/quz", "lang": "Ruby", "bug_code_uid": "e688870454412957308e74ea40149aa6", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "3ca93c09341c3b75e33e0109fd4fb17c", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6533864541832669, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "nlines = gets.to_i\n\nsum = 0\nnlines.times do\n sum = sum + gets.to_i\nend\n\nputs sum.to_f / nlines", "lang": "Ruby", "bug_code_uid": "224ff670c2b0c41a522998eca9b0effd", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "19c3970d9c1e6375b3e4b5e925fa8627", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.12643678160919541, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "i=gets.to_i", "lang": "Ruby", "bug_code_uid": "088863c8b16eb790e24fb7869f4d8784", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "905654462fcff5f73e400d7932676935", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9725158562367865, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "$n = gets.to_i\n\n$counter = 0\n$len = Math.log10($n).to_i + 1\n\ndef solve(num, depth)\n\tif depth == $len\n\t\t$counter += 1 if num < $n\n\t\treturn\n\tend\n\n\t[0, 1].each do |i|\n\t\tsolve(num*10 + i, depth+1)\n\tend\nend\n\nsolve(0, 0)\n\nputs $counter\n", "lang": "Ruby", "bug_code_uid": "6d0b18d69f7afa68df8a3329db88e628", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "aee45f5006bceaa73b7b9e307978c727", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2808988764044944, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n = gets.to_i\nres = 0\n(1..n).each do |i|\n s = i.to_s\n res += 1 if s=~/^[01]+\\Z/\nend\nputs res\n", "lang": "Ruby", "bug_code_uid": "852f5a5815d7454b67c1a4691f0e4aec", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "56a539cb2abd8cacbced15e45397a73d", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.20418848167539266, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "def findIfOne(n,str1,str2)\n for i in 0..n.length-1\n if ((n[i]!=str1) && (n[i]!=str2))\n return false\n end\n end\n return true\nend\nn=gets.chomp\nn=Integer(n)\ncount=0\nstr1=0.to_s\nstr2=1.to_s\nfor i in 1..n\n flag=findIfOne(i.to_s,str1,str2)\n if (flag==true)\n count+=1\n end\nend\nputs(count)\n", "lang": "Ruby", "bug_code_uid": "20ad494afc0fc78649f574039235991d", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "e3e98797d2c2ce51ed9dc2b8f57c891b", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9714285714285714, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "$n = 0\n$res = 0\ndef go(x)\n if x <= $n then\n $res += 1\n go(10 * x + 0)\n go(10 * x + 1)\n end\nend\n$n = gets.slice.to_i\ngo(1)\np $res\n", "lang": "Ruby", "bug_code_uid": "7d3b2f5246bec428d639574ba75e9986", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "891876da3fd11e43a6bbbfa15a691cc4", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.935251798561151, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n,k=gets.split.map &:to_i\nk=240-k\np (1..n).find{|i|i*(i+1)/2>k}-1", "lang": "Ruby", "bug_code_uid": "c9087c9079a332f295d5cbb6c4412f39", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "6dfe4f31a237a5d196044b3a94ebe708", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.99644128113879, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.split.map(&:to_i)\n\nrem = 240 - k\n\nans = 0\n(1..n).each do |i|\n rem -= i * 5\n if rem <= 0\n break\n end\n ans += 1\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "447811866bd4a680a6826d3a3068a3b3", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "cdd879a22df30ad69069b9c323a4eaca", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7873303167420814, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "total_time = 4 * 60\nn, k = gets.strip.split.map(&:to_i)\ntotal_time -= k\ntime = 5\nans = 0\n(1..n).each do |i|\n curr_time = 5 * i\n ans += 1\n break if time + curr_time > total_time\n time += curr_time\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "6e9929cc7535c8d46c3696c9b2b17c9e", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "e69640e84d1d7bed89bf8472648e8007", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9956709956709957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.split.map(&:to_i)\nc = 0\nt = 60 * 4 - k\nwhile t > (c + 1) * 5 && c < n\n c += 1\n t -= c * 5\nend\nputs c\n", "lang": "Ruby", "bug_code_uid": "e6f107f79e6dcd015d6148bef9e99787", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "de9cd919cd540545e9bce897273bd110", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "def gao(s)\n\ts.each do |x|\n\t\tprint x\n\t\tif x == 'H' or x == 'Q' or x == '9'\n\t\t\t\"YES\"\n\t\tend\n\tend\n\t\"NO\"\nend\n\nputs gao(gets)", "lang": "Ruby", "bug_code_uid": "871d78f6987520b3961ed4caebbf5f23", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "aee50b03b4af42bd550d250ebbe64e52", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6926829268292682, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "x = raw_input()\nn = \"NO\"\nfor i in x:\n\tif i=='H' or i== 'Q' or i== '9' or i== '+':\n\t\tn = \"YES\"\nprint n", "lang": "Ruby", "bug_code_uid": "2c491184d2aed6d5e0e73a435590b87c", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "e9f3913169262fbcb9c878aa5a2bd8b4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7888888888888889, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n = gets.to_i\n\na = n / 2\nb = n - a\n\nif n.even?\n\ta -= 1\n\tb += 1\nend\n\nprintf \"%d %d\", a, b", "lang": "Ruby", "bug_code_uid": "a06d607d47e99b82be4dc4ced92f3ab6", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "f84ff3d09efd185b1b91e650ff3cf8ff", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8779979144942649, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.strip.to_i\n\ndenominator = n - 1\nnumerator = 1.0\nmax = 0\nmax_numerator = 0\nmax_denominator = 0\nwhile (numerator < denominator) \n if (numerator % denominator != 0 && numerator/denominator > max && denominator % numerator != 0)\n max = numerator/denominator\n max_numerator = numerator\n max_denominator = denominator\n end\n numerator += 1\n denominator -= 1\nend\nputs \"#{max_numerator.to_i} #{max_denominator.to_i}\"", "lang": "Ruby", "bug_code_uid": "3fea1ad3e19c3b75d5cac218b44008ec", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "f8666939d173790203e97c004aa6cf24", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.45454545454545453, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\nputs \"#{1} #{n-1}\"", "lang": "Ruby", "bug_code_uid": "703a14f44c992522fa883c6b78f70be4", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "74fc11f61c0fe9fefbdf25159ac6cd01", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9494949494949495, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "def func(x)\n y = x+(x-1)\n return y\nend\n\nn = gets.to_i\n\nresult = n\ni = n-1\nwhile i > 0 do\n result += func(i)\n i -= 1\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "cc5c4b314e3220bda59819f58447a64d", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "bb66ad8ea5465341c863a92f873e77e0", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9090909090909091, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nputs (1...n).map { |x| (n - x) * x }.reduce(:+) + n", "lang": "Ruby", "bug_code_uid": "ad8eb6ee24d58954aa5cb85337019175", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "e99c155c93e81794abd5e305e7a37a84", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4262295081967213, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n = gets.to_i\ni = 1\nans = 0\nfor i in 1..n: \n ans = ans + (i * (n-i)) \nend\nputs ans+n\n", "lang": "Ruby", "bug_code_uid": "cc516c734a2ff320b5a9ba1e10ae7a3b", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "c6a83670e79a52d99869766ef36a4cc8", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8329177057356608, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "require 'prime'\nn = gets.to_i\nif n%2 == 0\n if n == 2\n print 1\n else\n print 2\n end\nelse\n a = Prime.prime?(n)\n if(a)\n print 1\n else\n print 3\n end\nend\n", "lang": "Ruby", "bug_code_uid": "53772ef2b16f2b51e2a0d35f1b2d6315", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "aa819779742c4ced476f3eb5b38a4c4f", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9090909090909091, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp\np (n-2)**2", "lang": "Ruby", "bug_code_uid": "0355de3ae5cfc14004e6e74cc20c43ef", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "81d0511815d0e2ef1b14b041106be615", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9936305732484076, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.split.map(&:to_i)\nminv = [n - 2 * m, 0].max\nng = 0\nok = n\nwhile ok - ng > 1\n mid = (ng + ok) / 2\n if mid * (mid - 1) >= 2 * m\n ok = mid\n else\n ng = mid\n end\nend\nmaxv = n - ok\nputs \"#{minv} #{maxv}\"", "lang": "Ruby", "bug_code_uid": "8ca8d3d70aeadce1b49f40b75484a099", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "c8da0db64d94967c9bebbd45289c6bcb", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9927007299270073, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\n\nn, m = gets.chomp.split.map{|e| e.to_i}\n\nmatches = []\nm.times do\n a, b = gets.chomp.split.map{|e| e.to_i}\n matches.push [a, b]\nend\n\nmatches.sort! {|l, r|\n r[1] <=> l[1]\n}\n\nrest = n\ncur_box = 0\nacc = 0\nwhile (true)\n break if cur_box > m\n if (matches[cur_box][0] <= rest)\n acc += matches[cur_box][0] * matches[cur_box][1]\n rest -= matches[cur_box][0]\n cur_box += 1\n next\n else\n acc += matches[cur_box][1] * rest\n break\n end\nend\nputs acc", "lang": "Ruby", "bug_code_uid": "a47dcc15c1bf33bff9cd0921afabdd85", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "fbcee2f723671e138f18ae5673c19990", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9895833333333334, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\n\nn, m = gets.chomp.split.map{|e| e.to_i}\n\nmatches = []\nm.times do\n a, b = gets.chomp.split.map{|e| e.to_i}\n matches.push [a, b]\nend\n\nmatches.sort! {|l, r|\n r[1] <=> l[1]\n}\n\nrest = n\ncur_box = 0\nacc = 0\nwhile (true)\n break if cur_box > =m\n if (matches[cur_box][0] <= rest)\n acc += matches[cur_box][0] * matches[cur_box][1]\n rest -= matches[cur_box][0]\n cur_box += 1\n next\n else\n acc += matches[cur_box][1] * rest\n break\n end\nend\nputs acc", "lang": "Ruby", "bug_code_uid": "c307f5ed8ac568553d904fd2e93838c3", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "fbcee2f723671e138f18ae5673c19990", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9961685823754789, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "z=0;n,m=gets.split.map &:to_i;m.times.to_a.map{gets.split.map(&:to_i).reverse}.sort.reverse.each{|x,y|t=[n,y].min;n-=t;z+=x*t;}p z", "lang": "Ruby", "bug_code_uid": "0c8463c04b13f633075d952022f2affe", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "8b0963b9a9e25bd081227e61479fa07b", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.26153846153846155, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n,m=gets().chomp().split(' ').map(&:to_i) ;h=Hash.new\nm.times { a,b=gets().chomp().split(' ').map(&:to_i); h[a]=b; }\n(h=h.sort_by {|_key, value| value}).reverse! ;count=0\nh.each do |key, value|\n count+=(key>n)?((n)*value):(key*value) ;n-=key ;break if (n<=0)\nend\np count", "lang": "Ruby", "bug_code_uid": "dd4df3afcbf7536c2f206afc4cca2d58", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "eda4406b433a949010826e1545d11735", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.972972972972973, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "require 'date'\nputs -(Date.parse(gets.gsub(':','-')) - Date.parse(gets.gsub(':','-'))).to_i", "lang": "Ruby", "bug_code_uid": "7806b0e870e331f8ab60d19c97e96e1c", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "62889b646e12f2a8cd83879dec22b575", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9831932773109243, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "require \"date\"\n\nm = Date.new(*gets.split(\":\").map(&:to_i))\nn = Date.new(*gets.split(\":\").map(&:to_i))\n\np (n - m).to_i", "lang": "Ruby", "bug_code_uid": "a31bdf5d876dd25a3a83993f3cea6185", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "ea408743dbfc34a85362117f76184f12", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9868766404199475, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "require \"date\"\n\nss1 = gets.split(\":\").map{|s| s.to_i}\nss2 = gets.split(\":\").map{|s| s.to_i}\nd1 = Date.new(ss1[0],ss1[1],ss1[2])\nd2 = Date.new(ss2[0],ss2[1],ss2[2])\nsa = d2 - d1\nputs sa.abs", "lang": "Ruby", "bug_code_uid": "2f103ab718e218da620cd8deeff08100", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "7560004c436e9a0f172b366b2c1bd0c5", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.08903781713738632, "equal_cnt": 40, "replace_cnt": 21, "delete_cnt": 16, "insert_cnt": 4, "fix_ops_cnt": 41, "bug_source_code": "import java.util.Calendar;\nimport java.util.GregorianCalendar;\nimport java.util.Scanner;\n\npublic class B {\n\tpublic static void main(String[] args) {\n\t\tdoIt2();\n\t}\n\tstatic void doIt(){\n\t\tCalendar gc1, gc2;\n\t\tint fyear, fmonth, fday, tyear, tmonth, tday;\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.next();\n\t\tString[] ss = s.split(\":\");\n\t\tfyear = Integer.parseInt(ss[0]);\n\t\tfmonth = Integer.parseInt(ss[1]);\n\t\tfday = Integer.parseInt(ss[2]);\n\t\ts = sc.next();\n\t\tss = s.split(\":\");\n\t\ttyear = Integer.parseInt(ss[0]);\n\t\ttmonth = Integer.parseInt(ss[1]);\n\t\ttday = Integer.parseInt(ss[2]);\n\t\tCalendar calBefore = Calendar.getInstance();\n\t\tCalendar calAfter = Calendar.getInstance();\n\n//\t\t// 2011.06.01\n//\t\tcalBefore.set(1996, Calendar.MARCH, 9, 0, 0, 0);\n//\n//\t\t// 2011.06.30\n//\t\tcalAfter.set(1991, Calendar.NOVEMBER, 12, 0, 0, 0);\n\t\t// 2011.06.01\n\t\t\t\tcalBefore.set(1900, Calendar.FEBRUARY, 1, 0, 0, 0);\n\n\t\t\t\t// 2011.06.30\n\t\tcalAfter.set(2038, Calendar.DECEMBER, 31, 0, 0, 0);\n\t\t// 2\u3064\u306e\u65e5\u4ed8\u306e\u5dee\u3092\u6c42\u3081\u308b(\u30df\u30ea\u79d2)\n\t\tlong result = Math.abs(calAfter.getTime().getTime() - calBefore.getTime().getTime());\n\t\tresult /= 1000 * 60 * 60 * 24;\n\n\t\tSystem.out.println(result);\n\t}\n\tstatic void doIt2(){\n\t\tGregorianCalendar gc1, gc2;\n\t\tint fyear, fmonth, fday, tyear, tmonth, tday;\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.next();\n\t\tString[] ss = s.split(\":\");\n\t\tfyear = Integer.parseInt(ss[0]);\n\t\tfmonth = Integer.parseInt(ss[1]);\n\t\tfday = Integer.parseInt(ss[2]);\n\t\ts = sc.next();\n\t\tss = s.split(\":\");\n\t\ttyear = Integer.parseInt(ss[0]);\n\t\ttmonth = Integer.parseInt(ss[1]);\n\t\ttday = Integer.parseInt(ss[2]);\n\t\tgc1 = new GregorianCalendar(fyear-1, fmonth, fday);\n\t\tgc2 = new GregorianCalendar(tyear-1, tmonth, tday);\n\t\tlong result = Math.abs(gc1.getTimeInMillis() - gc2.getTimeInMillis());\n\t\tlong div = 24 * 60 * 60 * 1000;\n\t\tresult /= div + ((0 < result % div)? 1 : 0);\n\t\tSystem.out.println(result);\n\t}\n}\n", "lang": "Ruby", "bug_code_uid": "cfc8d919abecc33c3458b7f70e04cdeb", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "7560004c436e9a0f172b366b2c1bd0c5", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9984496124031008, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l,r = gets.split(' ').map(&:to_i)\n\ndef f(v, a, b)\n if (a < 10)\n v << b if b > 0\n f(v, a+1, b*10+4)\n f(v, a+1, b*10+7)\n end\nend\n\nv = []\nf(v, 0, 0)\nv.sort!\n\nres = 0\nprev = l-1\nv.each do |x|\n if x >= l && x <= r || prev < r && x >= r\n res += ([r,x].min - prev)*x\n# p x-prev\n prev = x\n end\nend\n\nputs res\n", "lang": "Ruby", "bug_code_uid": "44402603bdaae8fe783789151cdd6360", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "1f5fb30ca23a2330a338106e122cf04a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9896373056994818, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def C(n, k)\n\tres = 1\n\tfor i in 1...n + 1\n\t\tres = res * i\n\tend\n\tfor i in 1...k + 1\n\t\tres = res / i\n\tend\n\tfor i in 1...n - k + 1\n\t\tres = res / i\n\tend\n\treturn res\nend\n\nn, m, t = gets.split.map(& :to_i)\n\ncn = Array.new(33, 0)\ncm = Array.new(33, 0)\n\nfor i in 4...n + 1\n\tcn[i] = C(n, i)\nend\nfor i in 1...m + 1\n\tcm[i] = C(m, i)\nend\nans = 0;\nfor i in 4...t\n\tans += cn[i] * cm[t-i]\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "38e4923ff802665b43b9a5c3a68cd686", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "718badce7f707d8b8a448107782d14ff", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8804071246819338, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n, m, t = gets.split.collect{|i| i.to_i}\nans = 0\nb = 4\nwhile b <= n and t-b >= 1 and t-b <= m\n ans += Array.new(n).combination(b).size * Array.new(m).combination(t-b).size\n b += 1\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "5eacb8b88f66df6b43069ac7ce9a7c94", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "2832d48efbb01c5319b96acf48d185d7", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.24579560155239327, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "begin\nn = gets.chomp.to_i\nm = gets.chomp.to_i\nt = gets.chomp.to_i\n\ndef fak(i)\n i > 1 ? i*fak(i - 1) : 1\nend\n\nr = 0\n(4..t-1).each do |i|\n next if (i > n or t-i > m)\n r += (fak(n) / fak(i) / fak(n-i)) * (fak(m) / fak(t-i) / fak(m-t+i))\nend\n\nputs r\nend", "lang": "Ruby", "bug_code_uid": "fe7c830cbc47920e72105a983f992afd", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "e92e8a19503ad88ca804c026da888358", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9287469287469288, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a = gets.chomp.split(\" \").map{|i| i.to_i}\nresult = 0\n\nGT = []\nGT[1] =1\n\n(2..30).each do |i|\n GT[i] = GT[i-1]*i\nend\n\ndef tohop k,n\n kq = GT[n]/(GT[k]*GT[n-k])\n return kq\nend\n\ndef min a,b\n kq = a\n if b < a\n kq = b\n end\n return kq\nend\n\nc = min a[1],(a[2]-4)\n\n(1..c).each do |i|\n m = tohop i,a[1]\n n = tohop a[2]-i,a[0]\n result += m*n\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "bdcb24e76e164acd3e7fd16ed750e33a", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "05a6190e8644d40955198f65896facc9", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6333333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#\u53ef\u4ee5\u770b\u51fa\u6765\uff0c\u8fd9\u4e2a\u4f5c\u8005\u559c\u6b22\u7b80\u6d01\uff01\n#\u8fd9\u91cc\u7684&\u4ee3\u8868map\u4e2d\u7684\u5143\u7d20\uff01\n#c\u662f\u65b9\u7816\u7684\u5927\u5c0f\n#a\uff0cb\u5206\u522b\u662f\u5e7f\u573a\u7684\u957f\u548c\u5bbd\uff01\n#\u8fd9\u91cc\u52a0\u8d1f\u53f7\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff0c\u4e3a\u4e86\u8ba9\u4ed6\u4eba\u770b\u4e0d\u61c2\uff1f\na_add=0\nif a%c!=0\n\ta_add+=1\nend\nb_add=0\nif b%c!=0\n\tb_add+=1\nend\n\na,b,c=gets.split.map &:to_i;p (a/c+a_add)*(b/c+b_add)\n", "lang": "Ruby", "bug_code_uid": "75e314c78d7da6ee1dd7e75edec5ba61", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "875458ada3f935c87f101a14b9adfcd5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.012699713232281851, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \n \n\n \n\n\n\n \n\n\t\n\n \n \n\t\n\t\n \n\t\t\t\n\n\n\t\n \n \n\t\n \t \n", "lang": "Ruby", "bug_code_uid": "4b13f27c1d11abefb0e2a5259fc78f93", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "392dfa21dfe1a8421cce44ff81b139bc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.014329580348004094, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n\t\n \t\n \n \t \t\n \n\n\t\t \n \n\n \n \t\t\n\n\n\n \n \n\t\t\n", "lang": "Ruby", "bug_code_uid": "1408251b56fa7b044f588958f647b7bc", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "392dfa21dfe1a8421cce44ff81b139bc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.01187308085977482, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n\t \t \n\n\n\t\n\n \n\t\n\n\n\n \n\t\t\n\t \t\t\t\n \n\t \t \n\t\n\t\t\n\n", "lang": "Ruby", "bug_code_uid": "fa92e958b5c92f4c62fea8c866154f18", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "392dfa21dfe1a8421cce44ff81b139bc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.011858515640973216, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \t \n\n \n\n \n\t\n\t\t\n \n\t\t\n\t\n \t \t\n\t\n\n\n \t\t \n\t\t \t ", "lang": "Ruby", "bug_code_uid": "90b7ca2231bca552f53448ca263e9f43", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "392dfa21dfe1a8421cce44ff81b139bc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.017188459177409455, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \t\n\n\n \n\n \n\t\n\n\n\n\n\t\t \n \t\n \t\n\t\n \n \n \n\n\n\t \n \n", "lang": "Ruby", "bug_code_uid": "5a9a3f0c529e2c0571ac8e2fa04ae789", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "392dfa21dfe1a8421cce44ff81b139bc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9403319874383131, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "# 1A. Theater Square\n# ======================================\n# time limit per test: 2 seconds\n# memory limit per test: 64 megabytes\n# input: standard input\n# output: standard output\n# ======================================\n# Theatre Square in the capital city of Berland has a rectangular shape with the\n# size n\u2009x\u2009m meters. On the occasion of the city's anniversary, a decision was\n# taken to pave the Square with square granite flagstones. Each flagstone is of\n# the size a\u2009x\u2009a.\n#\n# What is the least number of flagstones needed to pave the Square? It's allowed\n# to cover the surface larger than the Theatre Square, but the Square has to be\n# covered. It's not allowed to break the flagstones. The sides of flagstones\n# should be parallel to the sides of the Square.\n#\n# Input\n# The input contains three positive integer numbers in the first line: n, m and\n# a (1 <= n, m,\u2009a\u2009<= 10^9).\n#\n# Output\n# Write the needed number of flagstones.\n# ======================================\nn= gets.chomp.to_i\nm= gets.chomp.to_i\na= gets.chomp.to_i\n\nr= (m / a.to_f).ceil * (n / a.to_f).ceil\n\nputs r\n", "lang": "Ruby", "bug_code_uid": "910d50c04dc9ec3397dcce39dff711fb", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e465ec983d5d86b56fea95c3b8bb0605", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7983870967741935, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/ruby\n\nn = gets.to_i\nm = gets.to_i\na = gets.to_i\n\ncount_n = 0;\ncount_m = 0;\nif n % a == 0\n count_n = n / a;\nelse\n count_n = n / a + 1\nend\n\nif m % a == 0\n count_m = m / a\nelse\n count_m = m / a + 1\nend\nans = count_n + count_m\nputs ans\n", "lang": "Ruby", "bug_code_uid": "cad461256da928b7f2e08b0e111692c9", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "a77851cd109fba1a8d03f1810362bedd", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8571428571428571, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "m, n, a = gets.chomp.split(' ')\nx = (m*1.0/a).ceil\ny = (n*1.0/a).ceil\nputs x*y", "lang": "Ruby", "bug_code_uid": "9dfd18027e6568f24b2a4c00f08ae237", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "155bc26c5e26e52e283bef1b6f018cac", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.993006993006993, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m,a = gets.split(' ').map(&:to_i)\nw = n+a-1)/a\nh = (m+a-1)/a\nputs w*h", "lang": "Ruby", "bug_code_uid": "dc3b4eec9adfda83b1519e3786f987ea", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "63a58294f9f702ccdf1e06f4c5bdbc4d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.011473058799426348, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\t \n\t \t\n\n\t\n\n\n\n \t\n \n\n\t\n \n\n \n\n\n \n \n\n\n\t\n\n\n \n\n", "lang": "Ruby", "bug_code_uid": "ca0ceddf1c7fee40307fcd572ff95934", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6476dcca9b91042f68cb5df178863c6b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.736, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a, b, c = gets.split.map(&:to_i)\n\nsquare = a * b\n\nflagstone = c * c\nd = flagstone / 2\n\nminimi = square/d\n\np minimi\n\n", "lang": "Ruby", "bug_code_uid": "1b8687ea698902106bdc7c263d36620d", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "20c014d5ea6d00aeb9c328aa961737f0", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.27983539094650206, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "x, y, z, k = gets.chomp.split.map{|s| s.to_i}\n\na = [x, y, z]\nans = 0\nk.times do |i|\n cut = false\n a.each_with_index do |n, i|\n if n > 1\n a[i] -= i\n ans += 1\n cut = true\n break\n end\n end\n break unless cut\nend\n\nputs 2 ** ans\n", "lang": "Ruby", "bug_code_uid": "5153f3292f996a12403a58dbd322c841", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "b7894cbce3ae4fe703cd77d0bcc70b00", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.17511520737327188, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "x, y, z, k = gets.chomp.split.map{|s| s.to_i}\n\na = { :x => x, :y => y, :z => z}\ncut_num = { :x => 0, :y => 0, :z => 0}\nr = { :x => 1, :y => 1, :z => 1}\n\nk.times do |i|\n cut = false\n cut_num.sort_by{|n| n.last}.each do |n|\n i = n[0]\n if a[i] > 1\n r[i] += 1\n cut_num[i] += 1\n a[i] -= 1\n cut = true\n break\n end\n end\n break unless cut\nend\n\nans = 1\nr.each_value{|i| ans *= i}\nputs ans\n", "lang": "Ruby", "bug_code_uid": "abfb2d7d7a6cbff069b90522d6337510", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "b7894cbce3ae4fe703cd77d0bcc70b00", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9945945945945946, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=gets.comp.to_i\na=a-10\nif a<=0 || a>=12\nputs \"0\"\nelsif a==10\nputs \"15\"\nelse \nputs \"4\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "fca7693ff566cb3c39fa0e8c9551e8cf", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "93761ee4e9c72a09d98bed5dfad015bf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9793103448275862, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nuc = \"1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\".split(' ')\nnum = gets.chop.to_i\n#puts num.to_s\nways = 0;\nfor i in 0..uc.count-1\n\tif num - 10 == uc[i].to_i\n\t\tways = ways+1\n\tend\nend\nputs ways\t\n\n", "lang": "Ruby", "bug_code_uid": "61b1b13c4d47e44d4e4d616a11a278eb", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "0c5af819dd44cc0bc3b5d4b00e558dab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9183098591549296, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\ndef blackjack\n c = { }\n 1.upto(11) { |i| c[i] = 4 }\n c[10] = 15\n\n goal = gets.to_i\n if goal-10 < 1\n puts 0\n else\n puts c[goal-10]\n end\nend\n\n\nblackjack", "lang": "Ruby", "bug_code_uid": "57c34759ff65291e081837c8d3c09bcb", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "a7a89156fe2c08f5fed40205d73a8b60", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8642857142857143, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/env ruby\n\ndef solve n\n return 0 if n < 11\n diff = n - 10\n if 1 < diff and diff < 10\n return 4\n end\n if diff == 1\n return 4\n end\n if diff >= 10\n return 4*3+3\n end\nend\n\n#n = STDIN.gets.split.map {|i| i.to_i }\n\nputs solve(STDIN.gets.to_i)\n", "lang": "Ruby", "bug_code_uid": "0562bdacada208b84c4aa72643abfbf0", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "0fb7d58b55f4984b4d56aace3aaf58f7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9444444444444444, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a,b=$<.map &:to_i;p (a-b).abs**2/4", "lang": "Ruby", "bug_code_uid": "0d99cda170a642e9cefe2c2153f9a3ea", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "2f60d2e9500670923c5c4dab24dd56e5", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9714285714285714, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = gets.chomp.downcase\nx = ''\na.each {|c| x+='.'+c if c!=\"a\" && c!=\"o\" && c!=\"y\" && c!=\"e\" && c!=\"u\" && c!=\"i\"}\nputs x\nx", "lang": "Ruby", "bug_code_uid": "5ab869a58539c535772490a8e0dd2b83", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "ec9befedabc7137f007c8df18312d8b4", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9183673469387755, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "str = gets.strip\nstr.downcase!\nputs str.gsub!(/[aeouiAEOUI]/, \"\").gsub!(/./){|char| \".#{char}\"}", "lang": "Ruby", "bug_code_uid": "dac439295f8b7f48fbc41d091c729f08", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "b7e9d8d9d6d45196aa2f6cbbc5f3059e", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9934640522875817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets.strip.gsub!(/[aoyeui]/i, '').downcase.each_char{|c| print \".#{c}\"}\nputs\n", "lang": "Ruby", "bug_code_uid": "4583845c68b7bda3218f6cec97138333", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "fb9f3893ff69c5d2a6e458daa3e8db84", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.46153846153846156, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\n\na = gets.split.map(&:to_i)\n\nres = a.first\n\na.each do |x| \n b = res < x ? x % res : res % x\n if 0 == b\n b = [res, x].min\n end\n res = b\nend\n\nputs res * n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "cb8559deb706e16ff582a5bfa32e7def", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "04242a25c34a95797adfc1aee6a2ebf6", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.49025069637883006, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "n = gets.to_i\n\nnumbers = gets.split.map(&:to_i)\n\nwhile(numbers.uniq.count != 1) do\n\tnumbers.sort!.reverse!\n\tnumbers.each_with_index do |n, i|\n\t\tnumbers[i] = (numbers[i] - numbers[i + 1]) if numbers[i + 1]\n\tend\nend\n\nputs numbers.sum", "lang": "Ruby", "bug_code_uid": "7e895730333d353dda44c73dc0042dcd", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "4cfc0a440afacf2e54246d58e4b9207f", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.48501362397820164, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "n = gets.to_i\n\nnumbers = gets.split.map(&:to_i)\n\nwhile(numbers.uniq.count != 1) do\n\tnumbers.sort!.reverse!\n\tnumbers.each_with_index do |n, i|\n\t\tnumbers[i] = (numbers[i] - numbers[i + 1]) if numbers[i + 1]\n\tend\nend\n\nputs numbers.inject(&:+)", "lang": "Ruby", "bug_code_uid": "623c4d85c019e6edf0f86006ebdc366d", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "4cfc0a440afacf2e54246d58e4b9207f", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6066666666666667, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "n = gets.to_i\ns = gets.split.map(&:to_i).sort\nloop do\n s[n - 1] -= s[n - 2]\n s.sort!\n break if s.count(s[0]) == n\nend\nputs s[0] * n\n", "lang": "Ruby", "bug_code_uid": "d3c3463ccccbef97b34dbc89d0ea89d2", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "9b216cc4ad7ef743687288206252f75f", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9615384615384616, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nn=gets.to_i-1\np gets.index('0')||n", "lang": "Ruby", "bug_code_uid": "b32c492debe1637a9b9a3732211d3dc5", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "3c7213c08237072b23bcf976191c51e2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6854838709677419, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "gets\na = gets.chomp\nb = (a.reverse.to_i(2) + 1).to_s(2).reverse[0...a.size]\nputs b.count(\"0\") + a.size - b.size", "lang": "Ruby", "bug_code_uid": "f7786c007f4acc68f7fa17eec03b0d86", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "8d8ecd1d925bc63ef8c7aa7e24d11fe6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5898617511520737, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "gets\na = gets.chomp\nputs (a.reverse.to_i(2) + 1).to_s(2)[-a.size..-1].count(\"0\")", "lang": "Ruby", "bug_code_uid": "0fa0e4685b2913fcd5d529c43d31064d", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "8d8ecd1d925bc63ef8c7aa7e24d11fe6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9180327868852459, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "gets\nputs gets.[/1+0?|/].length", "lang": "Ruby", "bug_code_uid": "ac82fe582daf053fee8d8b32a8647189", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "b973f8b5ecd383301f5abcdaa5a6d83a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9903660886319846, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\n\na = gets.split.map(&:to_i)\nb = []\n\nwhile (0 < a.size)\n current = a.shift\n flag = false\n for i in (0..(b.size-1)) do\n if (b[i] <= current)\n b[i]+=1\n flag = true\n break\n end\n end\n b << 1 unless flag\nend\nputs b.size\n\n\n\n", "lang": "Ruby", "bug_code_uid": "4bced9f890bd7733a931f395206e48e0", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "4bbec670978a5185511ccbb99570a76a", "difficulty": 1400, "tags": ["dp", "greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8901303538175046, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "s = gets.chomp\nc = s.chars.to_a\nr = \"\"\ni = j = 0\nm = \"\"\nn = \"z\"\nloop do\n m = c.max\n break if m < n\n n = m\n i = c.index m\n j = c.rindex m\n break if j - i <= 1\n r += m\n c = c[(i+1)..(j-1)]\nend\nputs r + (i == j ? m : m + m) + r.reverse\n", "lang": "Ruby", "bug_code_uid": "c5809a6fb08613df0f1f76786ed50379", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "51b8be226aa4c28aa0811eba53b53402", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9523809523809523, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "puts gets.delete\"^\"+s.chars.max", "lang": "Ruby", "bug_code_uid": "674ffc4ffd2bd33908fafd93eeb6384e", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "51b8be226aa4c28aa0811eba53b53402", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.0908130939809926, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 11, "insert_cnt": 0, "fix_ops_cnt": 21, "bug_source_code": "import sys\nimport math\nimport itertools\n \nif __name__ == '__main__':\n points = []\n\n s = [int(i) for i in raw_input().rstrip().split(\" \")]\n x1 = s[0]\n y1 = s[1]\n x2 = s[2]\n y2 = s[3]\n\n min_x = min([x1, x2])\n max_x = max([x1, x2])\n min_y = min([y1, y2])\n max_y = max([y1, y2])\n\n for x in range(min_x, max_x + 1):\n points.append((min_y, x))\n points.append((max_y, x))\n \n for y in range(min_y, max_y + 1):\n points.append((y, min_x))\n points.append((y, max_x))\n\n points = list(set(points))\n\n n = int(raw_input().rstrip())\n\n while n > 0:\n s = [float(i) for i in raw_input().rstrip().split(\" \")]\n x = s[0]\n y = s[1]\n r = s[2]\n\n tmp = []\n for p in points:\n if math.sqrt((float(p[0]) - y) ** 2 + (float(p[1]) - x) ** 2) > r:\n tmp.append(p)\n points = tmp\n \n n -= 1\n\n print len(points)\n\n\n \n \n \n", "lang": "Ruby", "bug_code_uid": "dcacab88beb8051a2040334341932eb4", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "baa0299d8498fb1291b3d4781c4b9f28", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9824561403508771, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\ufeff# codeforce#127(Div2.A)\ns = gets.chomp.split(\"\")\nmax = s.max\n\np max * s.count(max)\n", "lang": "Ruby", "bug_code_uid": "84e2b0d9a6d50bba5ff62ce63fadc4e6", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "baa0299d8498fb1291b3d4781c4b9f28", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.97265625, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "N, M = gets.split.map(&:to_i)\nast = gets.split.map(&:to_i)\nbst = gets.split.map(&:to_i)\nas, bs = [], []\nN.times do |i|\n as[i] = ast.shift(2)\nend\nM.times do |i|\n bs[i] = bst.shift(2)\nend\n\nacand = []\nas.each do |a|\n cand = []\n bs.each do |b|\n ab = a & b\n if ab.length == 1\n cand.push(ab[0])\n end\n end\n if cand.length > 1\n puts -1\n exit\n else\n acand.concat(cand)\n end\nend\n\nbs.each do |b|\n cand = []\n as.each do |a|\n ab = a & b\n if ab.length == 1\n cand.push(ab[0])\n end\n end\n if cand.length > 1\n puts -1\n exit\n end\nend\n\nif acand.length == 1\n puts acand[0]\nelsif acand.length > 1\n puts 0\nelse\n puts -1\nend", "lang": "Ruby", "bug_code_uid": "3e082c2cd362089cf12c46a5f4ae9fc6", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "9900732a4e28508b84d9f2035cecd926", "difficulty": 1900, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.884990253411306, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nn, m = gets.split(' ').map {|x| x.to_i}\narr_true = Array.new(n, 0)\narr = Array.new\narr = gets.split(' ').map {|x| x.to_i}\nfor i in 0..m-1\n\tfor j in arr[i]..n\n\t\tif (arr_true[j-1] == 0)\n\t\t\tarr_true[j-1] = arr[i]\n\t\tend\n\tend\nend\n\np arr_true", "lang": "Ruby", "bug_code_uid": "0249454c9ae3781c41282d80ff50dd6a", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "a9ad1d2b8eae6d4c8d6904c0fb1fc959", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9679715302491103, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,m=gets.split.map &:to_i\ns=gets.chomp\nc=i=0\nwhile c'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']\n\ndef inpf() a=gets.chomp.split(\" \").map(&:to_f)end\n\ndef inps() a=gets.chomp.split(\" \")end\n\ndef copy(a) Marshal.load(Marshal.dump(a)) end\n\ndef kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end\n\ndef na(n,d=0) Array.new(n,d)end\n\ndef na2(n,m,d=0) Array.new(n){Array.new(m,d)}end\n\ndef na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end\n\ndef inp() a=gets.chomp.split(\" \").map(&:to_i)end\n\ndef r_up(a, b) (a+b-1)/b end\n\ndef sum(a) a.inject(:+) end\n\nrequire 'prime'\n\nn = inp[0]\nt = inp\nt = t.sort.reverse\nh = {}\nans = 0\nt.each do |d|\n ((t.min)..100).each do |i|\n if(d%i == 0)\n h[i] = true\n break\n end\n end\nend\n\np ((h.to_a.size))\n", "lang": "Ruby", "bug_code_uid": "7e8a55a6d35c108beba34b3c2c1e54e3", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "4cf761cba4d7ec9a86d79dfbd8ecddad", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9642857142857143, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\nr=1\nk=2\nloop{\n\tx=(2**k-1)*(2**~-k)\n\tbreak if nn\n\ts+=i*(i+1)/2\n}\np i", "lang": "Ruby", "bug_code_uid": "d5dcc28d1bd9cef0d3f8287e0eddcfd6", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "05ee08a87439d56ec4042c79cac841ac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9891304347826086, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nn=gets.to_i\ns=0\ni=0\nloop{\n\tbreak if s+i*(i+1)/2>n\n\ts+=i*(i+1)/2\n\ti+=1\n}\np i", "lang": "Ruby", "bug_code_uid": "2480bdbae0380ce756ad4dbe64b9e98c", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "05ee08a87439d56ec4042c79cac841ac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.807843137254902, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "n = gets.to_i\nans = 1\nsum = 0\nwhile (sum + ans * (ans + 1) / 2 <= n)\n\tans+=1\n\tsum+=ans * (ans + 1) / 2\nend\nputs (ans - 1)\n", "lang": "Ruby", "bug_code_uid": "a8292aef9f19d15a3a733b933e9b518f", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "c64d7daba56e0357e0f6ff8ccb5265b8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6940298507462687, "equal_cnt": 16, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "a = ARGV[0].to_i\n\nif a == 0\n\tputs 0\nelse\n\tres = a \n\ti = 1\n\twhile res > 0\n\t\tj = i + 1\n\t\tsn = j * (j - 1) / 2\n\n\t\tk = j + 1\n\t\tsn_next = k * (k - 1) / 2 \n\t\tres -= sn\n\n\t\tif (res < sn_next)\n\t\t\tputs i\n\t\t\tbreak\n\t\tend\n\t\ti += 1\n\tend\nend", "lang": "Ruby", "bug_code_uid": "bcc651f479aad20c2e755003d2034c3b", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "7e77ba0eb9a408eeec435e35b4e65037", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6788273615635179, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "board = gets.split(' ')\nboard_a = board.first.to_i\nboard_b = board.last.to_i\np1 = gets.split(' ')\np2 = gets.split(' ')\np1.map!{|x| x.to_i}\np2.map!{|x| x.to_i}\npossible = false\np1.each do |dim1|\n p2.each do |dim2|\n if (dim1+dim2) <= board_a\n l1 = p1.reject{|a| a == dim1}.first\n l2 = p2.reject{|a| a == dim2}.first\n possible = true if [l1, l2].max <= board_b\n end\n if (dim1+dim2) <= board_b\n l1 = p1.reject{|a| a == dim1}.first\n l2 = p2.reject{|a| a == dim2}.first\n possible = true if [l1, l2].max <= board_a\n end\n end\nend\nif possible \n puts 'YES'\nelse\n puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "6e7bd652a9954c4446c56ae739e3f2bd", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "3015157b5ba20d958e30b87bcb861cff", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8114035087719298, "equal_cnt": 13, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 13, "bug_source_code": "k = gets.chomp.to_i\nall = gets.chomp.to_i\ncount = 0\ntmp = k\nwhile tmp <= all\n if tmp == all\n PUTS \"YES\"\n puts count\n exit\n end\n tmp = tmp * k\n count += 1\nend\nputs \"NO\"", "lang": "Ruby", "bug_code_uid": "53fa9017fa20c645ade69b3222a11e57", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "bb62e6d0fde9395180a425413a396816", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.22327790973871733, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "k = gets.to_i\nl = gets.to_i\nif l % k == 0\n a = 0\n while l != k\n l /= k\n a += 1\n end\n puts 'YES'\n puts a\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "382002bd8011b1b4d160da41f20bcfea", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "955155814b54be85fc4aa9dbe86281c1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9522058823529411, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "require 'prime'\nk = gets.to_i\nl = gets.to_i\na = k.prime_division\nb = l.prime_division\nans = true\nt = b[0][1] / a[0][1]\na.size.times do |i|\n ans = false if a[i][0] != b[i][0] || b[i][1] != a[i][1] * t || a.size != b.size\nend\nputs ans ? \"YES\\n#{t - 1}\" : 'NO'\n", "lang": "Ruby", "bug_code_uid": "2ec092c67a9f70b9892380c1a01df728", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "955155814b54be85fc4aa9dbe86281c1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8866995073891626, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets\ns,c = n.length,0\nn = n.to_i\n(1...s).each{ |i| c += i*(9*10**(i-1)) }\np c+(n-(10**(s-1)-1))*s", "lang": "Ruby", "bug_code_uid": "8f4307851f1764dd15114ce18381b9a8", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "c883fa23cec2ecdec65ae650a0eb3c98", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8840970350404312, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "a=gets.chomp.to_i\nb=gets.chomp.split(\" \")\n0.upto(11) {|i| b[i]=b[i].to_i}\nb.sort!\nb.reverse!\ni=0\nans=0\nloop do \nbreak if a<=0\na-=b[i]\ni+=1\nans+=1\nend\nputs \"#{ans}\"", "lang": "Ruby", "bug_code_uid": "1ef8e5b61184819ed14382e34cd013fa", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "7ae5176793cd33a62f442960193c35f4", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9568106312292359, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = gets.split.map(&:to_i)\n\na.sort!.reverse!\n\ni = -1\ns = 0\nwhile s < n and i = minimum_value.to_i\n \tputs count\n \tbreak\n end\n\tsum += array[count]\n\tcount += 1\nend\nif count == 13\n puts '-1'\nend \n", "lang": "Ruby", "bug_code_uid": "160571f69a63fbf3d621b17eef04cc87", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "cbd969fe779a6e38a83f9c75ec163ce1", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8602150537634409, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "k = gets.to_i\nd = gets.split.map(&:to_i).sort\ncount = 0\nwhile k>0\n x = d.pop()\n k -= x\n count += 1\nend\np count\n", "lang": "Ruby", "bug_code_uid": "e8ba2619522746de19fce28bf691e82b", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "a7a09164df1bb74563ba6250056a2f30", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8778625954198473, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "k = gets.to_i\na = gets.split(' ').map(&:to_i).sort.reverse\n\ns = 0\nwhile s < k\n s += a.shift\nend\n\nputs 12 - a.size\n", "lang": "Ruby", "bug_code_uid": "735b2b9c3e1198cea2d63a65f2948738", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "021ca1045c0dcde5cf796962476a416c", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8681541582150102, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "targetCenti = gets.chomp.to_i\ngrow = gets.chomp.split(' ').map {|item| item.to_i}\ngrow.sort! {|a,b| b <=> a}\nans, index = 0, 0\n\nuntil targetCenti <= 0\n\ttargetCenti -= grow[index]\n\tindex += 1\n\tans += 1\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "b41ea5f4ef143db82fde879e6d2262ac", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "7918a333e2464a09bc069bc7bf8649c9", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6078431372549019, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split.map &:to_i\na.permutation.each do |p|\n if p[0] + p[1] == p[2] + p[3]\n puts 'YES'\n exit\n end\nend\nputs 'NO'\n", "lang": "Ruby", "bug_code_uid": "fb8cca1cddc2fced1d7b1a0fe9ba1586", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "178ba58f2d7a7357a068b1e2d232da33", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9743589743589743, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,k=gets.split.map(&:to_i)\np (n+k-1)/k*k", "lang": "Ruby", "bug_code_uid": "d19c5a5efadf76a61058e5004f1fc8ed", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "841774d54907fdf6349ac6dafb427c2e", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7088607594936709, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n, k = gets.strip.split.map(&:to_i)\nmod = n % k\nremainder = mod\nremainder = n / k if mod != 0\nans = n + remainder\nans += k if remainder == 0\nputs ans\n", "lang": "Ruby", "bug_code_uid": "50d8e262104146a7d55f03aa76393690", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "f64133dc3cac2aeb439063290def3fa9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9417989417989417, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,m=gets.split.map{|e| e.to_i}\nans=1\nn=n%10\na=n\nwhile n>m\n\tans+=1\n\tn=(n+a)%10\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "073e5d25b06a68f0102e4c5dd2f7695e", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "1e5e67f6e068071cb4691d23fd5606aa", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8226950354609929, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "k,r=gets.split.map &:to_i\n(1..10).each{|i|(p i;exit)if k*i%10%r<1}", "lang": "Ruby", "bug_code_uid": "faef49b45549642d0737e780d5e77835", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "9c7f27b2af5287e0983dcc702b0a9698", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9753694581280788, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x,y = gets.chomp.split.map(&:to_i)\nr = 1\nwhile((x*c)%10 != y && (x*c)%10 != 0)\n r = r + 1\nend\nputs r", "lang": "Ruby", "bug_code_uid": "4332f4e79f19b7c4315fc65fa4ff28bf", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "01a6c738592a0fbf858195883e255cf6", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2781065088757396, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "n, k = gets.strip.split(' ').map(&:to_i)\ns = gets.strip\nj = -1\n0.upto(s.length - 1) do |i|\n if s[i] == 'G'\n j = i\n break\n end\nend\n\ni1 = j\ni2 = j\nfound = false\nwhile(1)\n i1 -= k\n i2 += k\n if i1 >= 0\n if s[i1] == 'T'\n found = true\n break\n elsif s[i1] == '#'\n i1 = -1\n end\n end\n if i2 < s.length\n if s[i2] == 'T'\n found = true\n break\n end\n if s[i2] == '#'\n i2 = s.length\n end\n end\n if i1 < 0 && i2 >= s.length\n break\n end\nend\n\nprintf(\"%s\\n\", found ? \"YES\" : \"NO\")\n", "lang": "Ruby", "bug_code_uid": "bc2ca7c70822ca0472dfa04fa333cd11", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "2e749a65902784e5e363413c31f15ad2", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.26865671641791045, "equal_cnt": 2, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a = 1\nputs a", "lang": "Ruby", "bug_code_uid": "f6484defe98cd4e693a8fa5c934eec34", "src_uid": "e52bc741bb72bb8e79cf392b2d15354f", "apr_id": "24b89e44482d9ae63a189a51acae3300", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8523206751054853, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n = gets.to_i - 1\ns = gets.chomp\nmax = 0\nfor i in 0..n / 2\n\tmax = s[s[0..i] * 2] != nil ? i : max\nend\nputs n - max + 1", "lang": "Ruby", "bug_code_uid": "7dfbb7f8323d2d2164f37f19206a70bf", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "2df868a8f95276792c0437522083842b", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8938053097345132, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s1, s2 = gets.split\nlen = [s1.size, s2.size].max\ns1 = s1.rjust(len, \"0\")\ns2 = s2.rjust(len, \"0\")\np s1.to_i + s2.reverse.to_i\n", "lang": "Ruby", "bug_code_uid": "2a15b60098a2eafbd71637f7db5be216", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "e7087356e000fd28ec6474479fd7db2b", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7445255474452555, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,m = gets.chomp.split(/ /).map!{|x| x.to_i}\nputs 1\n", "lang": "Ruby", "bug_code_uid": "6df5ff16d3783d1a4eec22eb46e1a66e", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "01010fc734bbf96ae924c9c68321fc49", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9536082474226805, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "include Math\n\ndef calculate(s1, s2, s3)\n a = sqrt(s1*s3/s2)\n b = sqrt(s1*s2/s3)\n c = sqrt(s2*s3/s1)\n\n puts 4*(a+b+c)\nend\n\nn,m,p = gets.chomp.split(/\\s/).map(&:to_i)\ncalculate(n,m,p)", "lang": "Ruby", "bug_code_uid": "c7562dd64e479d83ebf71576aa8a6650", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "117e8e7dd1cb8d9f1709d22f6a79d944", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.99055330634278, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "=begin\n(define (hoge a b c)\n (sqrt (/ (* a c) b)))\n\n(let ((a (read))\n (b (read))\n (c (read)))\n (print (* 4 (+ (hoge a b c)\n (hoge b c a)\n (hoge c a b)))))\n\n=end\n\ndef hoge(a, b, c)\n return Math.sqrt(a * c / b)\nend\n\na, b, c = $stdin.readline.split.map {|x| x.to_i }\n\nputs(4 * (hoge(a, b, c) + hoge(b, c, a) + hoge(c, a, b)))", "lang": "Ruby", "bug_code_uid": "adda94a7c6b40cf1ea0df8b5230a8b1b", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "fb4abd9ea8e605fb8aa51426cdc96689", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9608938547486033, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = gets.split.map(&:to_i)\nv = Math.sqrt(a[0]*a[1]*a[2])\nputs (v/a[0]+v/a[1]+v/a[2])*4", "lang": "Ruby", "bug_code_uid": "a90ec76ba5ad42d4f9ced379d9cafc4c", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "a56708a681deefa825def4f59f1a11b7", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9612015018773467, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "y = 3.times.map{gets.split.map(&:to_i)}.inject(&:concat)\n(1..9).each do |a|\n (1..9).each do |b|\n (1..9).each do |c|\n (1..9).each do |d|\n x = [a + b, c + d, a + c, b + d, a + d, b + c]\n if x == y\n puts \"#{a} #{b}\\n#{c} #{d}\"\n exit\n end\n end\n end\n end\nend\np -1\n", "lang": "Ruby", "bug_code_uid": "6fe046a6c91182ebff905aa5f0a1d7e3", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "1a9333fa4811db3082319303e24ae263", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9898477157360406, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "r1,r2=gets.chomp.split.map(&:to_i)\nc1,c2=gets.chomp.split.map(&:to_i)\nd1,d2=gets.chomp.split.map(&:to_i)\na,b,c,d=0,0,0,0\nfor i in 0..9\n\tfor j in 0..9\n\t\tfor k in 0..9\n\t\t\tfor l in 0..9\n\t\t\t\tif i!=j && i!=k && i!=l && j!=k && j!=l && k!=l && i+j==r1 && k+l==r2 && i+l==d1 && j+k==d2 && i+k==c1 && j+l==c2\n\t\t\t\t\tputs \"#{i} #{j}\"\n\t\t\t\t\tputs \"#{k} #{l}\"\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend\nputs \"-1\"", "lang": "Ruby", "bug_code_uid": "6c42d4b1bfef331d4bd57c6f14c8313f", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "42afb0ab429b5b396a3ab20790ee00eb", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7204301075268817, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "ar = []\n3.times do \n ar << gets.split.map(&:to_i)\nend\n\nf = false\nans = []\n\n1.upto 20 do |a|\n 1.upto 20 do |b|\n next if a + b != ar[0][0]\n 1.upto 20 do |c|\n next if a + c != ar[1][0]\n next if b + c != ar[2][1]\n 1.upto 20 do |d|\n next if a + d != ar[2][0]\n next if b + d != ar[1][1]\n next if c + d != ar[0][1]\n f = true\n ans = [a, b, c, d]\n break\n end\n end\n end\nend\n\n\nif f && ans.uniq.size == 4\n print ans[0] , \" \" , ans[1], \"\\n\"\n print ans[2] , \" \" , ans[3], \"\\n\"\nelse\n puts -1\nend\n\n", "lang": "Ruby", "bug_code_uid": "1dff7fa2f7fcc3db5bbf57302d63a220", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "2eea396d1ba899ed10f9c517ac81a299", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.986784140969163, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "r1, r2 = gets.split(\" \").map(&:to_i)\nc1, c2 = gets.split(\" \").map(&:to_i)\nd1, d2 = gets.split(\" \").map(&:to_i)\n\nfor a11 in 1..10\n for a12 in 1..10\n for a21 in 1..10\n for a22 in 1..10\n if [a11, a12, a21, a22].uniq.length == 4 &&\n a11+a12 == r1 && a21+a22 == r2 &&\n a11+a21 == c1 && a12+a22 == c2 &&\n a11+a22 == d1 && a12+a21 == d2\n puts [a11, a12].join(\" \"), [a21, a22].join(\" \")\n exit\n end\n end\n end\n end\nend\np -1\n", "lang": "Ruby", "bug_code_uid": "f0e8cd539de724c11810588737722a9d", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "fc4d7f9cb58be76ee1755ac2efc2809b", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4280701754385965, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "str_arr = gets.chomp\nl, m, r = 0, 1, 2\nresult = 0\n\nwhile l <= str_arr.length - 3\n while m <= str_arr.length - 2\n while r <= str_arr.length - 1\n if str_arr[l] + str_arr[m] + str_arr[r] == \"QAQ\"\n result += 1\n r += 1\n end\n while str_arr[r] != 'Q' and r <= str_arr.length - 1\n r += 1\n end\n end\n m += 1\n while str_arr[m] != 'A' and m <= str_arr.length - 2\n m += 1\n end\n r = m + 1\n end\n l += 1 \n while str_arr[l] != 'Q' and l <= str_arr.length - 3\n l += 1\n end\n m = l + 1\n r = m + 1\nend\n\nprint result\n\n\n", "lang": "Ruby", "bug_code_uid": "969f53e8f4293a5fe72117ce75fe14ae", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "30aa04adcf5204a1801cae113d5ba731", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.909410729991205, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "str_arr = gets.chomp\nl, m, r = 0, 1, 2\nresult = 0\n\nwhile l <= str_arr.length - 3\n while str_arr[l] != 'Q' and l < str_arr.length - 3\n l += 1\n end\n\n while m <= str_arr.length - 2\n while str_arr[m] != 'A' and m < str_arr.length - 2\n m += 1\n end\n\n while r <= str_arr.length - 1\n while str_arr[r] != 'Q' and r < str_arr.length - 1\n r += 1\n end\n if str_arr[l] + str_arr[m] + str_arr[r] == \"QAQ\"\n result += 1\n end\n r += 1\n end\n m += 1\n r = m + 1\n end\n l += 1 \n m = l + 1\n r = m + 1\nend\n\nprint result\n\n\n", "lang": "Ruby", "bug_code_uid": "f991a9f17c8b5b3115befb13d864591f", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "30aa04adcf5204a1801cae113d5ba731", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8778280542986425, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "\n na=gets.chomp\n i1=na.index(\"Q\")\n i2=na.index(\"A\",i1+1)\n i3=na.index(\"Q\",i1+1)\n num=0\n while i1!=nil\n while i2!=nil\n while i3!=nil\n num+=1\n \n i3=na.index(\"Q\",i3+1)\n end\n i2=na.index(\"A\",i2+1)\n if(i2!=nil)\n i3=na.index(\"Q\",i2+1)\nend\n end\n i1=na.index(\"Q\",i1+1)\n if(i1!=nil)\n i2=na.index(\"A\",i1+1)\nend\n if(i2!=nil)\n i3=na.index(\"Q\",i2+1)\nend\n end\n puts num", "lang": "Ruby", "bug_code_uid": "40cb321f6282227049db15df5dbe21a6", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "cc703500d666fa438147ee4b9c383d38", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8953229398663697, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "na=gets.chomp\n i1=na.index(\"Q\")\n i2=na.index(\"A\",i1+1)\n i3=na.index(\"Q\",i2+1)\n num=0\n while i1!=nil\n while i2!=nil\n while i3!=nil&&i2 0 do\n # puts rem if @dbg\n if rem >= k\n eaten += k\n rem -= k\n else\n eaten += rem\n rem = 0\n end\n # puts rem if @d1\n rem -= (0.1 * rem).floor\n # puts rem if @d1\n # puts eaten if @d1\n # puts \"eod\" if @d1\n end\n eaten\nend\n\nlo = 1\nhi = n\nk = (lo + hi)/2\nwhile lo+1 < hi do\n k = (lo + hi) >> 1\n # puts \"#{lo}:#{k}:#{hi}\"\n if get_eaten(n, k) >= atleast_half\n hi = k\n else\n lo = k\n end\nend\n# while lo <= hi do\n# k = (lo + hi)/2\n# # puts \"#{lo}:#{k}:#{hi}\"\n# if get_eaten(n, k) >= (n/2.0).ceil\n# hi = k-1\n# else\n# lo = k+1\n# end\n# end\n# puts k\n# puts \"...\"\nmk = [1, k-1000].max\n(mk).upto(k+1000).each do |ki|\n # puts ki\n # @dbg = true\n if get_eaten(n, ki) >= atleast_half\n # puts get_eaten(n, ki)\n puts ki\n break\n end\nend\n# puts k\n\n# # puts \"---\"\n# 1.upto(n).each do |ki|\n# if get_eaten(n, ki) >= (n/2.0).ceil\n# # @d1 = true\n# # puts get_eaten(n, ki)\n# puts ki\n# break\n# end\n# end\n", "lang": "Ruby", "bug_code_uid": "f461e18cc4d403c815dc38fa34976950", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "61bc9140f60eb67a37de6f87334238b0", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9782608695652174, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "pokemons=['vaporeon', 'jolteon', 'flareon', 'espeon',\n 'umbreon', 'leafeon', 'glaceon', 'sylveon']\ngets \nname=gets.strip\nputs pokemons.select{|x| x =~ /#{name}/}[0]\n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "b2b9793ac4fd7e9d226f3ac00126c9fc", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "cbe96bc783e42ff7797f98d55d235950", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.848297213622291, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = gets.split.map(&:to_i)\nif a[2] == 0 and a[3] != 0\n puts \"Ron\"\nelse\n puts(a[0]*a[2]*a[4] < a[1]*a[3]*a[5] ? \"Ron\" : \"Hermione\")\nend\n", "lang": "Ruby", "bug_code_uid": "64aa6c66299d3bc1c35660f768604d71", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "924a4e1a91efb45d7dfc624674e12f9c", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8974854932301741, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, b, c, d, e, f = gets.split.map {|n| n.to_f }\nconv_ratio = (a/b)*(c/d)*(e/f)\n\nif d == 0\n puts \"Hermione\"\nelsif c == 0\n puts \"Ron\"\nelsif b == 0 or f == 0\n puts \"Hermione\"\nelsif conv_ratio < 1\n puts \"Ron\"\nelse\n puts \"Hermione\"\nend", "lang": "Ruby", "bug_code_uid": "359bea81bd083b44cb9f6f7a9ef3ab14", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "b9122789240d2b162747d3c4528a477a", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8469601677148847, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a, b, c, d, e, f = gets.split(' ').map{|s| s.to_i}\nab, cd, ef = [[a, b], [c, d], [e, f]].map{|aa, bb|bb/aa.to_f}\ng = ab*cd*ef\nm = [cd.infinite?, ab.infinite?&&!cd.nan?, ef.infinite?&&!ab.nan?&&!cd.nan?]\nputs (m.any?||g>1.0) ? 'Ron' : 'Hermione'\n", "lang": "Ruby", "bug_code_uid": "1ddd07a13309feb5f446279d1752a8b6", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "d640b9d7f1dfc41dacecfa0be20bc116", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9605263157894737, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/ruby\ns=gets.chomp\nk=gets.to_i\nl=s.size\nm=l+k\nm=m-m%2\nif k>=l\n\tp m\nelse\n\tma=0\n\tl.times{|i|\n\t\t1.step(l-i){|j|\n\t\t\tif 2*(i+j)>ma && i.step(i+j-1).all?{|k|(o+j>=l&&o+j (n - k) ? n - k : (k - 1) * 2 + k\nputs \"#{min} #{max}\"", "lang": "Ruby", "bug_code_uid": "c75720132f8628ea7d4d1e86b89b0488", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "c99ad01a18fd3d2995afe95fb3967539", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9662162162162162, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k = gets.split.map &:to_i\n\n\nif n == k\n puts \"0 0\"\nelse\n if k*3 < n\n puts \"1 #{k*2}\"\n else\n puts \"1 #{n-k}\"\n end\nend", "lang": "Ruby", "bug_code_uid": "f3dbd402fcf5204bf9f1923ab08c7008", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "3bc7510fd0b38cf976e42e94881d2803", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9906890130353817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=gets.split.map(&:to_i)\nif n == k\n puts \"0 0\"\nelse\n if n % 3 == 0\n if k > n / 3\n k -= n / 3\n ans = n / 3 * 2 - k\n else\n ans = 2 * k\n end\n elsif n % 3 == 1\n if k > n / 3\n k -= n / 3\n ans = n / 3 * 2 - k + 1\n else\n ans = 2 * k\n end\n else \n if k > n / 3\n k -= n / 3 + 1\n ans = n / 3 * 2 + 1 - k\n else\n ans = 2 * k\n end \n end\n puts \"1 #{ans}\"\nend", "lang": "Ruby", "bug_code_uid": "9889bcd9ca60dbd0ed6fb79527f3c621", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "da49da565fecd5cc41b742e6539ffa19", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9815950920245399, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets\nb=$_.each_char.max.to_i+1\nx,y=split.map{|i|i.to_i(b)}\np (x+y).to_s(b).size\n", "lang": "Ruby", "bug_code_uid": "029ec75e942596edf1299799bd164c71", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "6f7f9779aa1932268374390d60c6366b", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7326732673267327, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "x, y, *rest = STDIN.read.split(\" \")\n\nputs (2..16).inject { |acc, b| [acc, (x.to_i(b) + y.to_i(b)).to_s(b).length].max }\n", "lang": "Ruby", "bug_code_uid": "fec4343a68f8725057c73ad32f9dbc96", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "4f4dbce0c0390ccf513bc1671dc6d946", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9629629629629629, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "p gets.split.map{|_|_.to_i($_.bytes.max-47)}.inject(:+).to_s.size", "lang": "Ruby", "bug_code_uid": "11dd8adc5be8f50f2f53618fc303969a", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "c37cda53108cc8360df43b213ccb8502", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6098654708520179, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "require 'date'\na, b = 2.times.map{gets.split('.').map(&:to_i).reverse}\na[0] += 1800\nputs b.permutation.map{|c|\n\tc[0] += 1818\n\tbegin\n\t\tDate.new(*a) >= Date.new(*c)\n\trescue ArgumentError\n\t\tnil\n\tend\n}.any? ? :YES : :NO\n", "lang": "Ruby", "bug_code_uid": "ceff4eb3a8ec8acdb4263f29ab585b68", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "c2a5266f5867e5398861a3fc3e2fa580", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8423507462686567, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a = gets.split(\".\").map!{|t| t.to_i}\nb = gets.split(\".\").map!{|t| t.to_i}\ndates = []\nd = Date.new(a[2]+2000,a[1],a[0])\ndef valid y,m,d\n return Date.valid_date?(y,m,d)\n\nend\ndates << Date.new(b[0]+2000,b[1],b[2]) if valid(b[0]+2000,b[1],b[2])\ndates << Date.new(b[0]+2000,b[2],b[1]) if valid(b[0]+2000,b[2],b[1])\ndates << Date.new(b[1]+2000,b[0],b[2]) if valid(b[1]+2000,b[0],b[2])\ndates << Date.new(b[1]+2000,b[2],b[0]) if valid(b[1]+2000,b[2],b[0])\ndates << Date.new(b[2]+2000,b[0],b[1]) if valid(b[2]+2000,b[0],b[1])\ndates << Date.new(b[2]+2000,b[1],b[0]) if valid(b[2]+2000,b[1],b[0])\n(0...dates.size).each do |i|\n 18.times do |t|\n if dates[i].leap?\n dates[i] += 366\n else\n dates[i] += 365\n end\n end\nend\nfl = false\n(0...dates.size).each do |i|\n if(dates[i] <= d)\n puts \"YES\"\n fl = true\n break\n end\nend\nif(!fl)\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "43961a1d6e9c2c104b478a34357ea655", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "1e0fd9cee4acedca44603c7748206c53", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8498609823911029, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "require 'date'\na = gets.split(\".\").map!{|t| t.to_i}\nb = gets.split(\".\").map!{|t| t.to_i}\ndates = []\nd = Date.new(a[2]+2000,a[1],a[0])\ndef valid y,m,d\n return Date.valid_date?(y,m,d)\n\nend\ndates << Date.new(b[0]+2000,b[1],b[2]) if valid(b[0]+2000,b[1],b[2])\ndates << Date.new(b[0]+2000,b[2],b[1]) if valid(b[0]+2000,b[2],b[1])\ndates << Date.new(b[1]+2000,b[0],b[2]) if valid(b[1]+2000,b[0],b[2])\ndates << Date.new(b[1]+2000,b[2],b[0]) if valid(b[1]+2000,b[2],b[0])\ndates << Date.new(b[2]+2000,b[0],b[1]) if valid(b[2]+2000,b[0],b[1])\ndates << Date.new(b[2]+2000,b[1],b[0]) if valid(b[2]+2000,b[1],b[0])\n(0...dates.size).each do |i|\n 18.times do |t|\n if dates[i].leap?\n dates[i] += 366\n else\n dates[i] += 365\n end\n end\nend\nfl = false\n(0...dates.size).each do |i|\n if(dates[i] <= d)\n puts \"YES\"\n fl = true\n break\n end\nend\nif(!fl)\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "59cc43e349bb8352a0adc640dd59abb1", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "1e0fd9cee4acedca44603c7748206c53", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8074798130046749, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "require 'date'\n\ndef check_age(today, birthday)\n if today[2] - birthday[2] < 18\n return false\n end\n if today[1] == 2 && today[0] == 29\n today[0] = 28\n end\n if birthday[1] == 2 && birthday[0] == 29\n birthday[0] = 28\n end\n begin\n DateTime.new(today[2], today[1], today[0], 0, 0, 0)\n DateTime.new(today[2], birthday[1], birthday[0], 0, 0, 0)\n rescue ArgumentError\n return false\n end\n if today[2] - birthday[2] > 18\n return true\n end\n if today[2] - birthday[2] == 18\n DateTime.new(today[2], today[1], today[0], 0, 0, 0) - DateTime.new(today[2], birthday[1], birthday[0], 0, 0, 0) >= 0\n end\nend\n\ntoday = gets.strip.split('.').map { |val| val.to_i }\nd2, m2, y2 = gets.strip.split('.').map { |val| val.to_i }\n\ntoday[2] += 2000\n\nanswer = 'NO'\n\nanswer = 'YES' if check_age today, [d2, m2, y2 + 2000]\nanswer = 'YES' if check_age today, [d2, y2, m2 + 2000]\nanswer = 'YES' if check_age today, [m2, d2, y2 + 2000]\nanswer = 'YES' if check_age today, [m2, y2, d2 + 2000]\nanswer = 'YES' if check_age today, [y2, m2, d2 + 2000]\nanswer = 'YES' if check_age today, [y2, d2, m2 + 2000]\n\nputs answer\nexit 0\n", "lang": "Ruby", "bug_code_uid": "c9fa90b8a30874f7f17de648850ecfb5", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "41a1a5be303cc4b5857b3322447ababe", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9881154499151104, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "route = gets.chomp\nvisited = {[0, 0] => 1}\nx, y = 0, 0\nbug = false\nvalue = 1\n\nroute.each_char do |direction|\n\tcase direction\n\twhen \"R\" then x += 1\n\twhen \"L\" then x -= 1\n\twhen \"U\" then y += 1\n\twhen \"D\" then y -= 1\n\tend\n\n\t(bug = true and break) if visited[[x, y]] && visited[[x, y]] > 0\n\t\n\tvalue += 1\n\t(-1..1).each do |i|\n\t\t(-1..1).each do |j|\n\t\t\tnext unless i ** 2 + j ** 2 == 1\n\t\t\tif visited[[x + i, y + j]] && visited[[x + i, y + j]] > 0\n\t\t\t\tbug = true if visited[[x + i, y + j]] != value - 1\n\t\t\tend\n\t\tend\n\tend\n\tvisited[[x + a, y + b]] = value\nend\n\nif bug then\n\tputs \"BUG\"\nelse\n\tputs \"OK\"\nend", "lang": "Ruby", "bug_code_uid": "23f6827ca3ac58772064e019aef3cd16", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "c24eac686bd8e14656309a420ef81d6f", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3408900083963056, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "p = gets.strip\nx = 0\ny = 0\ni = 0\nwhile i < p.length\n case p[i]\n when ?L then x-=1\n when ?R then x+=1\n when ?U then y-=1\n when ?D then y+=1\n end\n i += 1\nend\n\nif (x == 0 and y.abs == 1) ||\n (y == 0 and x.abs == 1)\n if p.length > 1\n puts \"BUG\"\n else\n puts \"OK\"\n end\nelse\n if x == 0 && y == 0\n puts \"BUG\"\n else\n puts \"OK\"\n end\nend", "lang": "Ruby", "bug_code_uid": "1d246148c80b9e0040cb18a065f79116", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "e19fab287cfcbe038c145f58eadcd5a0", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9881710646041856, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp!\n\nmas = Hash.new()\nfor i in -101..101\n mas[i] = Hash.new()\n for j in -101..101\n mas[i][j] = 999999;\n end\nend\n\nstep = 0\nx,y = 0,0\nmas[x][y] = 0\ns.chars { |c|\n mas[x+1][y] = [mas[x+1][y],mas[x][y] + 1].min\n mas[x-1][y] = [mas[x-1][y],mas[x][y] + 1].min\n mas[x][y-1] = [mas[x][y-1],mas[x][y] + 1].min\n mas[x][y+1] = [mas[x][y+1],mas[x][y] + 1].min\n\n case c\n when \"R\"\n x += 1\n when \"L\"\n x -= 1\n when \"U\"\n y += 1\n when \"D\"\n y -= 1\n end\n\n if mas[x][y] < step + 1\n puts \"BUG\"\n exit\n end\n}\n\nputs \"OK\"", "lang": "Ruby", "bug_code_uid": "a3dde1010781c3ce78084d1ffd16ecfd", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "b5c809013e22528bd91142ae03c40623", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8671963677639046, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "s = gets.chomp.split(//)\nc = [0,0]\nh = {c.dup => 1}\ns.each do |x|\n p = c.dup\n c[0] += 1 if x == 'R'\n c[0] -= 1 if x == 'L'\n c[1] += 1 if x == 'U'\n c[1] -= 1 if x == 'D'\n near = [ [c[0]+1,c[1]],\n [c[0]-1,c[1]],\n [c[0],c[1]+1],\n [c[0],c[1]-1]\n ]\n near.delete p\n if h[c] or (near.reduce() { |x,y| h[x] or h[y] })\n puts \"BUG\"\n exit 0\n else\n h[c.dup] = 1\n end\nend\nputs \"OK\"\nexit 0\n", "lang": "Ruby", "bug_code_uid": "f8e1c010e927e9f9a5980c3b8b516ce2", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "2231aa2f9718491067f6b5ba322afda4", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9597806215722121, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def solve(a, b, s)\n dx = dy = 0\n dp = [[0, 0]]\n s.split(\"\").each do |ch| \n dx += 1 if ch == 'R'\n dx -= 1 if ch == 'L'\n dy += 1 if ch == 'U'\n dy -= 1 if ch == 'D'\n dp << [dx, dy]\n end\n\n dx, dy = dp[-1]\n dp.each do |cur|\n x = a - cur[0]\n y = b - cur[1]\n chk = 0\n mul = x / dy if dy != 0\n mul = y / dy if dy != 0\n next if mul < 0\n return true if dx * mul == x && dy * mul == y\n end\n return false\nend\n\n\na, b = gets.split.map { |i| i.to_i }\ns = gets.chomp\n\nif solve(a, b, s)\n puts \"Yes\"\nelse\n puts \"No\"\nend", "lang": "Ruby", "bug_code_uid": "d8cfe399425b77477b2343a6cb6724cf", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "d9aeef89f6f84d9f106340c04729e142", "difficulty": 1700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9491525423728814, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a,b,c,d,e=gets.split.map &:to_i\na=[a,c].max\nb=[b,d].min\np b-a+1-(a<=e&&e<=b ? 1 : 0)", "lang": "Ruby", "bug_code_uid": "0437e708a23bb41094d33a6a86388e9d", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "70b19b0b830d33b790091533494f8033", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.997979797979798, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = gets.strip.split(\" \").map(&:to_i)\nl1 = input[0]\nr1 = input[1]\nl2 = input[2]\nr2 = input[3]\nk = input[4]\n\na = [l1,l2].max\nb = [r1,r2].min\n\nif b > a\n c = b - a + 1\n if k >= a and k <= b\n puts c-1\n else\n puts c\n end\nelse\n puts 0\nend", "lang": "Ruby", "bug_code_uid": "632ae0e3e68538ff2df5322e245f51bb", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "2a1633415f19a53cae1ed3f57f45a79a", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.632258064516129, "equal_cnt": 20, "replace_cnt": 14, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "l1, r1, l2, r2, k = gets.chomp.split(' ').map(&:to_i)\n\nrange = (l1..r1).to_a & (l2..r2).to_a\nres = range.length \n\nres = res - 1 if range.include? k\n\np res", "lang": "Ruby", "bug_code_uid": "2a74069fe5f2a2609f128957f5435772", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "cdf0782ab196ff57a93f5af83cfccf08", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6467236467236467, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "smin, smax, fmin, fmax, p = gets.chomp.split(' ').map(&:to_i)\n\nans = 0\nif smin <= fmin\n\tans = smax - fmin + 1\n\tif p >= fmin && p <= smax\n\t\tans -= 1\n\tend\nelse\n\tans = fmax - smin + 1\n\tif p >= smin && p <= fmax\n\t\tans -= 1\n\tend\nend\n\nans = 0 if ans < 0\nputs ans", "lang": "Ruby", "bug_code_uid": "09977d1e38239784cb75eb4bc3689821", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "e8e64f5b7d4737c30e7eb40e47c9e0bb", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9714285714285714, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a,b,c,d,e,f = gets.split.map(&:to_i)\nputs (a+b+c)*(a+b+c)-a*a-b*b-e*e\n", "lang": "Ruby", "bug_code_uid": "f1c49073cd448e08a91298e98af1d66b", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "27ca68cfb6a3ac2eae54d17b1cc3cc2b", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8690958164642375, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def main()\n\tgf=gets.chomp.split(\" \")\n\tgf=gf.map{|i| i.to_i}\n\tgl=gf[0]\n\tgr=gf[1]\n\tbf=gets.chomp.split(\" \")\n\tbf=bf.map{|i| i.to_i}\n\tbl=bf[0]\n\tbr=bf[1]\n\tif checkcomfort(gl,br) || checkcomfort(gr,bl)\n\t\tputs \"YES\"\n\telse\n\t\tputs \"NO\"\n\tend\nend\ndef checkcomfort(g,b)\n\tif b>=g-1 && g>=b-2\n\t\treturn true;\n\tend\n\treturn false;\nend\t\nmain()", "lang": "Ruby", "bug_code_uid": "2aa97ec4e4a556691dffc24d58ade9f7", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "3da605814534dd75b94bb567b4a975db", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9846938775510204, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "num = [ 6 , 2 , 5 , 5 , 4 , 5 , 6 , 3 , 7 , 6 ]\n\na, b = gets.split(' ').map(&:to_i)\nsum = 0\nfor i in a..b do\n aux = a\n while aux > 0 do\n sum += num[ aux%10 ]\n aux /= 10\n end\nend\nputs res\n", "lang": "Ruby", "bug_code_uid": "8df6fb767f049019837df28803c8383a", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "0e8429bf5ba871e9295eeed6911fe124", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.965034965034965, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#! usr/bin/env ruby\nn,k=gets.split.map &:to_i\na = Array.new\na = gets.split(\" \").map &:to_i\na.sort\ni=0\n\ncount = 0\nwhile i= a[k] and a[i]>0\n count+=1\n end\ni+=1\nend\np count\n", "lang": "Ruby", "bug_code_uid": "a8ed47470602d2cccc04844cc6d9d08e", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "10a42a947378900d84c4396084d024e1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.24622030237580994, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "x = gets.chomp.split\ny = gets.chomp.split\n\nindex = x[1].to_i\ncutoff = y[index]\n\ncount = 0\nuntil y[index] < cutoff\n index += 1\n count += 1\nend\n\nputs (count + x[1].to_i)", "lang": "Ruby", "bug_code_uid": "d5c4e738e866a7c0f5438df7368ab930", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "f76c5014c4a4bec093b4bc09f4717ea0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9895833333333334, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.chomp.split.map! { |e| e.to_i }\n\nnumbers = gets.chomp.split.map! { |e| e.to_i }\nkth = numbers[k]\n\nnext_round = numbers.select { |e| e > 0 and e >= kth }.size\nputs \"#{next_round}\"", "lang": "Ruby", "bug_code_uid": "9139e42a45da26b22ce07b2f80ce2e7f", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "8b680e518130aee0cfe95870c07a9e7f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.42507645259938837, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "nk = gets.chomp.split(\" \").map { |x| x.to_i}\na = gets.chomp.split(\" \").map { |x| x.to_i}\nn = nk[0]\nk = nk[1]\n\nscore = a[k]\nc = 0\n\nif (score == 0)\n puts \"0\"\n exit\nend\n\ncurrent = a[0]\n\nwhile current >= score do\n c++\n current = a[c]\nend\nputs c ", "lang": "Ruby", "bug_code_uid": "0b121136b95516ea69e4c8e6649a121b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "fc53f29a0a39af03649bef78cbc670ef", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6334310850439883, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "nk = gets.chomp.split(\" \").map { |x| x.to_i}\na = gets.chomp.split(\" \").map { |x| x.to_i}\nn = nk[0]\nk = nk[1]\n\nscore = a[k]\nc = k\n\nif (score == 0)\n puts \"0\"\n exit\nend\n\ncurrent = a[c]\n\nwhile current >= score do\n c += 1\n current = a[c]\n if c >= n\n break\n end\nend\nputs c \n", "lang": "Ruby", "bug_code_uid": "0452572df873cf8315e583132df48bb3", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "fc53f29a0a39af03649bef78cbc670ef", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.987012987012987, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "res = 0\n\nl = STDIN.read.split(\"\\n\")\n\n(n, k) = l[0].split(\" \").map(&:to_i)\n\nif n != 0\n num = l[1].split(\" \").map(&:to_i)\n\n for i in 0..(n-1)\n if num[i] >= num[k] && num[i] > 0\n res = res + 1\n end\n end\nend\n\nputs res", "lang": "Ruby", "bug_code_uid": "8135f4bd672bc8570cf853dd58bbc40d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "529f415992556ffef636dda60a856ead", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9882352941176471, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s1 = gets.chomp\np1 = s1.split(' ')\nn=p1[0].to_i-1\nk=p1[1].to_i\ns2 = gets.chomp\np = s2.split(' ')\nball = p[k-1].to_i\nk=0\nfor i in 0..n\n if (p[i].to_i>=ball and p[i]>0) \n k=k+1\n end\n end\nputs k \n", "lang": "Ruby", "bug_code_uid": "5175023b25799993a8a1c93f1aeab224", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "87af956b2b791b1405bcb4e7199a982c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.630188679245283, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/ruby\n\nn, k = gets.chomp.split(\" \").map(&:to_i)\n\na = Array.new\n\ni = 0\na = gets.chomp.split(\" \").map(&:to_i)\n\nind = a[k]\ni = 0\ncount = 0\n\na.each do |j|\n if (j >= a[k] && j != 0)\n count += 1\n end\nend\n\nputs count\n", "lang": "Ruby", "bug_code_uid": "9848b4c79e5818090f3c203f7046a3ff", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "cc944d233dd48c7e0d5d97f07fdd2e5b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8387096774193549, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "\nn, k = gets.chomp.split(\" \").map(&:to_i)\na = gets.chomp.split(\" \").map(&:to_i)\n\nscore = a[k]\nif score > 0\n puts a.select{ |x| x >= score }.size\nelse\n puts '0'\nend", "lang": "Ruby", "bug_code_uid": "12da09e55b78496dd201f84ad23b3365", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "fe35f4a69b793c712974cb6bc60845e2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8249566724436742, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#Progressing to the next round\nn1,k1=gets.chomp.split(\" \")\nn=Integer(n1)\nk=Integer(k1)\na=gets.chomp.split(\" \")\ntemp=Integer(a[k-1])\nif temp<=0\n\twhile Integer(a[k])>=0 && k>0\n\t\tk=k-1\n\tend\n\tprint k\nelse\n\tcount=k\n\twhile a[k-1]==a[count]\n\t\tcount=count+1\n\tend\n\tprint count\nend", "lang": "Ruby", "bug_code_uid": "9394ac60e6e8eb652c8e70aa085ee27f", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "0dc5fd99535c276a9d5c23f651548b90", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.863905325443787, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "input = gets\n\nconds, points = input.split(\"\\n\")\n\nconds = conds.split(\" \")\nn = conds[0].to_i\nk = conds[1].to_i\n\npoints = points.split(\" \").map{|x| x.to_i}\n\nthreshold = [1, points.sort.reverse[k-1]].max\nwinners = points.filter{|x| x >= threshold}.length\nputs winners", "lang": "Ruby", "bug_code_uid": "e65b1b879d7424a7bf4a8f2cf8a425e5", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "699d0b7f5426755f175d0e14e0938432", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9958333333333333, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = gets().chomp.split(\" \").map(&:to_i)\npontuacao = gets().chomp.split(\" \").map(&:to_i)\n\nn = input[0]\nk = input[1]\n\ncontador = 0\n\npontuacao.each do |x|\n if (x >= pontuacao[k] && x > 0)\n contador+=1\n end\nend\n\nputs contador\n", "lang": "Ruby", "bug_code_uid": "e82c53a96e7fb69ee65be6a6738f8133", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "f285643bf49aebdae47a4d91d27ceb3d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.19141914191419143, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a, b = gets.split.map(&:to_i)\nnumbers = gets.split.map(&:to_i)\n\nc = number[0..5]\n\nputs c\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "e941de4250fbc7399e6a20a10a9e6a5f", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "99fe9b33ad0fb265edb3ff12f3f8dc4b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9916666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.chomp.split.map(&:to_i)\na = gets.chomp.split.map(&:to_i)\n\na.delete_if{|e| e < a[m]}.delete(0)\nputs a.length", "lang": "Ruby", "bug_code_uid": "1c229af69c145c3d97d97d4963203de9", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "80839ed0587da2a4c17c8267c4b97e48", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8605927552140505, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/env ruby\n# n, k = %w(8 5).map(&:to_i)\n# points = %w(10 9 8 7 7 7 5 5).map(&:to_i)\nn, k =gets.chomp.split(\" \").map(&:to_i)\npoints = gets.chomp.split(\" \").map(&:to_i)\n\nans = 0\n\nmin_points= points[k-1]\nif min_points > 0\n ans = k\n (k..n).each do |x|\n break if points[x] < min_points\n ans += 1\n end\nelse\n points.each do |x|\n break if x == 0\n ans += 1\n end\n\nend\n\n\nputs ans", "lang": "Ruby", "bug_code_uid": "805222b5cfac0eeefa40dfefb3f09ac5", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c03942898677a8949c17ac3038d1cf58", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7697368421052632, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, k = gets.split(' ').map(&:to_i)\nscores = gets.split(' ').map(&:to_i)\n\nscores = scores.select { |a| a>0 }\ngrouped_scores = scores.group_by{|item| item}\ngrouped_peoples = grouped_scores.values.map(&:length)\n\ntotal = 0\nbegin\n total += grouped_peoples.shift\nend while total < k\n\nputs total", "lang": "Ruby", "bug_code_uid": "3eb0993764add4fff23b6aa1b33b3c82", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "da427e56019f3ff261bdb04fe0064c92", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.706766917293233, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,k=gets.split.map(&:to_i)\na=gets.split.map(&:to_i)\nhoge=n\nk.times do |i|\n tmp = a[i] / 4\n if hoge >= tmp\n hoge -= tmp\n a[i] %= 4\n else\n a[i] -= hoge * 4\n hoge = 0\n end\n if hoge == 0\n break\n end\nend\nlim = 2 * n + hoge\nlim2 = hoge\nk.times do |i|\n tmp = (a[i] + 1) / 2\n if lim >= tmp\n lim -= tmp\n a[i] %= 2\n else\n a[i] -= 2 * lim\n lim2 -= a[i]\n a[i] = 0\n end \nend\nk.times do |i|\n lim2 -= a[i]\nend\nputs lim2 >= 0 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "025d93de9c40e4ca8f6a0204037148e6", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "e87eb25e733c55f81212a71aeb38ae79", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.22337662337662337, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "def func(n,i)\n s = \"\"\n while n>=1 do\n s += (n % i).to_s\n n /= i\n end\n s = s.reverse\n res = s.to_i\n return res\nend\n\nn = gets.to_i\ni = 2\nsum = 0\nwhile i 0 do\n total = total + (x % i)\n x = x/i\n end \n\n i = i+1\nend \n\nputs \"#{total}/#{inp-2}\"", "lang": "Ruby", "bug_code_uid": "021d17f2f9bf413b7716c216a25f805f", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "96f44f65e9424c1401c8b224ee20fb68", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7671232876712328, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "puts gets.gsub(/WUB/, '').join(' ')", "lang": "Ruby", "bug_code_uid": "be74ba0ca56c7299a9567fe36296e59f", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "2f13f2ab5c6808e68c60b83c635a8455", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9855072463768116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "puts gets.gsub!(/(WUB)+/,\" \").strip", "lang": "Ruby", "bug_code_uid": "cb8ff6bb8b61aad9fe45fa7dc5fa4ede", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "f0d738f152a23d5140247112e97003c2", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.14775725593667546, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#=================================\nrequire 'prime'\ninclude Math\n\nif ARGV.include?(\"ONLINE_JUDGE\")\n\t$stdin = File.open(\"./input.txt\", \"r\")\n\tARGV.delete(\"ONLINE_JUDGE\")\nend\n#=================================\n\nn=gets.to_i\ndif=n-n/2\nwhile n>1\n\tprint \"#{n} \"\n\tn-=dif\nend\nputs 1\n", "lang": "Ruby", "bug_code_uid": "e8bced17ed5a8b573d11d67ac3e7a7e8", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "3ccd6ca4727fdce6c86ef4e938ed6e16", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2346368715083799, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#=================================\nrequire 'prime'\ninclude Math\n\nif ARGV.include?(\"ONLINE_JUDGE\")\n\t$stdin = File.open(\"./input.txt\", \"r\")\n\tARGV.delete(\"ONLINE_JUDGE\")\nend\n#=================================\n\nn=gets.to_i\ndp=Array.new(n+1, false)\n\ndp[n]=true\n(n-1).downto(1){|i|\n\t(i+1).upto(n){|j|\n\t\tif dp[j]\n\t\t\tif j%i==0\n\t\t\t\tdp[i]=true\t\t\t\t\n\t\t\tend\n\t\t\t\n\t\t\tbreak\n\t\tend\n\t}\n}\n\nn.downto(1){|index|\n\tif dp[index]\n\t\tprint \"#{index} \"\n\tend\n}\n", "lang": "Ruby", "bug_code_uid": "f4216c0c33095c25275ae373bc4ef70c", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "3ccd6ca4727fdce6c86ef4e938ed6e16", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8109965635738832, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "mball,vball=0,0\na,b,c,d=gets.to_i,gets.to_i,gets.to_i,gets.to_i\n3*a/10.0>a-(a/250.0)*c ? mball=3*a/10.0 : mball=a-(a/250.0)*c\n\n3*b/10.0>b-(b/250.0)*d ? vball=3*b/10.0 : vball=b-(b/250.0)*d\n\nif mball>vball\n puts 'Misha'\nelsif vball>mball\n puts 'Vasya'\nelse\n puts 'Tie'\nend\n", "lang": "Ruby", "bug_code_uid": "7852ce8cc62360613c9adf6e8ef47379", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "2f3750a31baea305c6debe8efd17c55e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9663299663299664, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "mball,vball=0,0\ns=gets.to_s\ns1=s.split(' ')\na=s1[0]\nb=s1[1]\nc=s1[2]\nd=s1[3]\n3*a/10.0>a-(a/250.0)*c ? mball=3*a/10.0 : mball=a-(a/250.0)*c\n\n3*b/10.0>b-(b/250.0)*d ? vball=3*b/10.0 : vball=b-(b/250.0)*d\n\nif mball>vball\n puts 'Misha'\nelsif vball>mball\n puts 'Vasya'\nelse\n puts 'Tie'\nend\n", "lang": "Ruby", "bug_code_uid": "35b435fd03024e37a29cc4f2b16ae687", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "2f3750a31baea305c6debe8efd17c55e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7126948775055679, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a=gets.to_i\nb=gets.to_i\nc=gets.to_i\nd=gets.to_i\nmisha=[3*a/10,a-(a*c/250)].max\nvasya=[3*b/10,b-(b*d/250)].max\n\nif misha>vasya\n puts \"Misha\"\nelsif vasya>misha\n puts \"Vasya\"\nelse\n puts \"Tie\"\nend", "lang": "Ruby", "bug_code_uid": "ba603650fefdd3c3be28530f154660ff", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "e1eb9697a9de5ddcb7b7a1fcffa3b9e2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2560899437851343, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "def search(idx, num, ss)\n\twk = num + $s[idx].to_i\n\tif idx == $s.length-1\n\t\tret = 0\n\t\tif wk % 2 == 0\n\t\t\t$same = 1 if ss + (wk/2).to_s == $s\n\t\t\tret = 1\n\t\telse\n\t\t\t$same = 1 if ss + (wk/2).to_s == $s\n\t\t\t$same = 1 if ss + (wk/2+1).to_s == $s\n\t\t\tret = 2\n\t\tend\n\t\treturn ret\n\tend\n\tif wk % 2 == 0\n\t\tnn = wk / 2\n\t\tif $ar[idx][nn] == nil\n\t\t\t$ar[idx][nn] = search(idx+1, nn, ss + nn.to_s)\n\t\tend\n\t\treturn $ar[idx][nn]\n\telse\n\t\tnn = wk / 2\n\t\tif $ar[idx][nn] == nil\n\t\t\t$ar[idx][nn] = search(idx+1, nn, ss + nn.to_s)\n\t\tend\n\t\tif $ar[idx][nn+1] == nil\n\t\t\t$ar[idx][nn+1] = search(idx+1, nn+1, ss + (nn+1).to_s)\n\t\tend\n\t\treturn $ar[idx][nn]+$ar[idx][nn+1]\n\tend\nend\n\n$same = 0\n$s = gets.chomp\n$ar = Array.new($s.length).map!{|x| Array.new($s.length)}\nret = 0\nfor i in 0..9\n\tret += search(1,i,i.to_s)\nend\nputs ret-$same\n", "lang": "Ruby", "bug_code_uid": "bde5b9ee8a64e8f737af6d2c2f67b781", "src_uid": "2dd8bb6e8182278d037aa3a59ca3517b", "apr_id": "0ed9c165570c8d91ca76b2c6c6dfc241", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.30121951219512194, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "def search(idx, num, ss)\n\twk = num + $s[idx].to_i\n\tif idx == $s.length-1\n\t\tret = 0\n\t\tif wk % 2 == 0\n\t\t\t$same = 1 if ss + (wk/2).to_s == $s\n\t\t\tret = 1\n\t\telse\n\t\t\t$same = 1 if ss + (wk/2).to_s == $s\n\t\t\t$same = 1 if ss + (wk/2+1).to_s == $s\n\t\t\tret = 2\n\t\tend\n\t\treturn ret\n\tend\n\tif wk % 2 == 0\n\t\tnn = wk / 2\n\t\tif $ar[idx][nn] == nil\n\t\t\t$ar[idx][nn] = search(idx+1, nn, ss + nn.to_s)\n\t\tend\n\t\treturn $ar[idx][nn]\n\telse\n\t\tnn = wk / 2\n\t\tif $ar[idx][nn] == nil\n\t\t\t$ar[idx][nn] = search(idx+1, nn, ss + nn.to_s)\n\t\tend\n\t\tif $ar[idx][nn+1] == nil\n\t\t\t$ar[idx][nn+1] = search(idx+1, nn+1, ss + (nn+1).to_s)\n\t\tend\n\t\treturn $ar[idx][nn]+$ar[idx][nn+1]\n\tend\nend\n\n$same = 0\n$s = gets.chomp\n$ar = Array.new($s.length).map!{|x| Array.new($s.length)}\nif $s.length == 1\n\tputs 9\nelse\n\tret = 0\n\tfor i in 0..9\n\t\tret += search(1,i,i.to_s)\n\tend\n\tputs ret-$same\nend", "lang": "Ruby", "bug_code_uid": "19d9c4fc924471de04e11d155686b631", "src_uid": "2dd8bb6e8182278d037aa3a59ca3517b", "apr_id": "0ed9c165570c8d91ca76b2c6c6dfc241", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.998272884283247, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\ninclude Math\n\nINF = 0x3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f\n\nn, v = gets.split().map(&:to_i)\ncost = gets.split().map(&:to_i)\n\nbest = []\nbest[0] = INF\nres = INF\nfor i in 1..n\n\tbest[i] = [2*best[i-1], cost[i-1]].min\n\tif 2**(i-1) > v\n\t\tres = [res, best[i]].min\n\tend\nend\nfor i in n+1..70\n\tbest[i] = 2*best[i-1]\n\tif 2**(i-1) > v\n\t\tres = [res, best[i]].min\n\tend\nend\n\nans = INF\nvv = v\nwhile (vv & -vv) != vv\n\ttemp = 0\n\tj = 0\n\tv = vv\n\twhile v > 0\n\t\tj += 1\n\t\tif v % 2 == 1\n\t\t\ttemp += best[j]\n\t\tend\n\t\tv /= 2\n\tend\n\tans = [ans, temp].min\n\tvv += vv & -vv\nend\n\nputs [res, ans].min\n", "lang": "Ruby", "bug_code_uid": "82f9ff5462b5e22a7e571feb3a85b3f3", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "3459a67ae3ca17fb17ca994dd25e562b", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4536082474226804, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chompt.to_i\n\n\n\n", "lang": "Ruby", "bug_code_uid": "691a59b31009c794a4ecafc8dd05fe60", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "5c30d895a0357362432e94f542e46b2e", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8765432098765432, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp!.to_i\n\nputs (n < 2 ? 0 : (n.even? ? (2 ** (n / 2)) : (2 ** ((n - 1)/2))))\n", "lang": "Ruby", "bug_code_uid": "a6f827f19ad2010b17519b0d224d1e1d", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "5c30d895a0357362432e94f542e46b2e", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.36363636363636365, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "p gets.to_i/2*2\n", "lang": "Ruby", "bug_code_uid": "aa7e96af402b8f7549edbb5d197ed945", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "843ea11ea63ceef96c4f8e0c4ec860b5", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6344086021505376, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "inp = gets.chomp\nif inp.lenth.odd?\n p 'CHAT WITH HER!'\nelse\n p 'IGNORE HIM!'\nend", "lang": "Ruby", "bug_code_uid": "b4fe589b2811d3008d4cabefd18a278c", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "9af5108aa250a2f926d35685f9bfaefd", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9192546583850931, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "puts ['CHAT WITH HER!','IGNORE HIM!'][gets.strip.to_a.unique.join('').length%2]", "lang": "Ruby", "bug_code_uid": "87982efa944b9fb86efc1ea8f62437e4", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "b870af0599010a66842e3abf38888edc", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9940828402366864, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets.split(//).uniq!\nputs (s.length % 2 == 1) ? \"CHAT WITH HER!\" : \"IGNORE HIM!\"", "lang": "Ruby", "bug_code_uid": "17b6f984a5d10c1467afe2deb069ff28", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "d11a60c78e74c69eae498c78f4b957f1", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9833333333333333, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "year = {\n January: 1,\n February: 2,\n March: 3,\n April: 4,\n May: 5,\n June: 6,\n July: 7,\n August: 8,\n September: 9,\n October: 10,\n November: 11,\n December: 12\n}\n\nmonth = gets.chomp\nk = gets.to_i\nactual = year[month.to_sym]\nputs actual\nrelease = (actual+k) % 12\nif release == 0\n puts \"December\"\nelse\n puts year.key(release)\nend", "lang": "Ruby", "bug_code_uid": "a0b5ed4bfed28c35cb68a3dafcb48461", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "ec7835981bd41b8c949abf70dfaa191f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9803921568627451, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "puts Time.gm(1,((1..12).map{|_|Time.gm(1,_).strftime\"%B\n\"}.index(gets)+gets.to_i+1)%12).strftime(\"%B\")", "lang": "Ruby", "bug_code_uid": "9276e944647e94c74528300ac26af734", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "e63f38bc20c48f2ae5788976209f36e2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9572649572649573, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "gets;p gets.split.map{|e|e.chars.count{|f|f==f.upper}}.max", "lang": "Ruby", "bug_code_uid": "f28e8f25009ae6dea6c63663f86b64f7", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "apr_id": "62c6f9af4c97f71e10ab9f6d4ddd9d6c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9073170731707317, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "words = gets.chomp.split(\" \")\n\nwords.map{|w| w.each_char.count{|c| ('A'..'Z').cover?(c)}}.max", "lang": "Ruby", "bug_code_uid": "ad80e49e43dd095dea3b9656789568ee", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "apr_id": "f6b9f0aaa964e867f60c2a790ca27890", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9932735426008968, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = [2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583]\n\ndef pow(x)\n return 1 if x == 0\n return 2 if x == 1\n t = pow(x / 2);\n t *= t\n t *= 2 if x % 2 == 1\n return t % 1000000007\nend\nn = gets.to_i - 1\np pow(a[n] - 1)\n", "lang": "Ruby", "bug_code_uid": "b84af9dc79b7caba2d7a7ac96953e213", "src_uid": "c2cbc35012c6ff7ab0d6899e6015e4e7", "apr_id": "4e7addfbf2aa3a20b8e90de0acfcdafe", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9656419529837251, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def cmmdc a,b\n return a if a==b\n return cmmdc([a,b].min,(a-b).abs)\nend\n\nn,m,x,y,a,b = gets.chomp.split(\" \").collect {|x| x.to_i}\n\ncmm = cmmdc(a,b)\na /= cmm\nb /= cmm\n\np = n/a\nq = m/b\n\nmin = [p,q].min\n\np = min * a\nq = min * b\n\n\ndelta_center_x = p/2.0\ndelta_center_y = q/2.0\n\nc1x = delta_center_x\nc1y = delta_center_y\n\nc2x = n - delta_center_x\nc2y = m - delta_center_y\n\n\nrx = 0\nry = 0\n\n\n\nif xc2y\n rx = c1x\n ry = c2y\nend\n\nif x>c2x and yc2x and y>c2y\n rx = c2x\n ry = c2y\nend\n\nif x>=c1x and x<=c2x and y=c1x and x<=c2x and y>c2y\n ry = c2y\n if (c1x-x).ceil == (c1x-x).floor\n rx = x\n else\n rx = x - 0.5\n end\nend\n\nif y>=c1y and y<=c2y and x=c1y and y<=c2y and x>c2x\n rx = c2x\n if (c1y-y).ceil == (c1y-y).floor\n ry = c1y\n else\n ry = y - 0.5\n end\nend\n\nif y>=c1y and y<=c2y and x>=c1x and x<=c2x\n if (c1x-x).ceil == (c1x-x).floor\n rx = x\n else\n rx = x - 0.5\n end\n if (c1y-y).ceil == (c1y-y).floor\n ry = y\n else\n ry = y - 0.5\n end\nend\n\nputs [rx-delta_center_x,ry-delta_center_y,rx+delta_center_x,ry+delta_center_y].map {|x| x.to_i}.join(' ')\n", "lang": "Ruby", "bug_code_uid": "78c9a0829079d5777ba30fee3ff623df", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "e8176215bdedf3385d79feb473a426df", "difficulty": 1700, "tags": ["math", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9666908037653874, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "def cmmdc a,b\n return a if a==b\n return cmmdc([a,b].min,(a-b).abs)\nend\n\nn,m,x,y,a,b = gets.chomp.split(\" \").collect {|x| x.to_i}\n\ncmm = cmmdc(a,b)\na /= cmm\nb /= cmm\n\np = n/a\nq = m/b\n\nmin = [p,q].min\n\np = min * a\nq = min * b\n\n\ndelta_center_x = p/2.0\ndelta_center_y = q/2.0\n\nc1x = delta_center_x\nc1y = delta_center_y\n\nc2x = n - delta_center_x\nc2y = m - delta_center_y\n\n\nrx = 0\nry = 0\n\n\nif xc2y\n rx = c1x\n ry = c2y\nend\n\nif x>c2x and yc2x and y>c2y\n rx = c2x\n ry = c2y\nend\n\nif x>=c1x and x<=c2x and y=c1x and x<=c2x and y>c2y\n ry = c2y\n if (c1x-x).ceil == (c1x-x).floor\n rx = x\n else\n rx = x - 0.5\n end\nend\n\nif y>=c1y and y<=c2y and x=c1y and y<=c2y and x>c2x\n rx = c2x\n if (c1y-y).ceil == (c1y-y).floor\n ry = y\n else\n ry = y - 0.5\n end\nend\n\nif y>=c1y and y<=c2y and x>=c1x and x<=c2x\n if (c1x-x).ceil == (c1x-x).floor\n rx = x\n else\n rx = x - 0.5\n end\n if (c1y-y).ceil == (c1y-y).floor\n ry = y\n else\n ry = y - 0.5\n end\nend\n\nputs [rx-delta_center_x,ry-delta_center_y,rx+delta_center_x,ry+delta_center_y].map {|x| x.to_i}.join(' ')\n", "lang": "Ruby", "bug_code_uid": "2d22570dc6e2715e844fe267c760605d", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "e8176215bdedf3385d79feb473a426df", "difficulty": 1700, "tags": ["math", "ternary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6685236768802229, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a, b = gets.split.map(&:to_i)\nif a == b \n puts 'infinity'\nelse\n ans = 0\n for i in 1..a\n ans+= 1 if a%i == b\n end\n puts ans\nend", "lang": "Ruby", "bug_code_uid": "c455d99a3987e7029ff67c224aa6ed17", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "8cbe1392117f12ec450f83647df56f14", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8713692946058091, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "a, b = gets.split.map(&:to_i)\nif a == b \n puts 'infinity'\nelsif ab\n ans+= 1 if (a-b)%i == 0 && (a-b)/i>b\n end\n ans+=1 if (a-b)==i**2 && i>b\n puts ans\nend", "lang": "Ruby", "bug_code_uid": "d26da19c63b1261d76524b3579c00f98", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "8cbe1392117f12ec450f83647df56f14", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9763779527559056, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "# https://codeforces.com/problemset/problem/339/A\n\nsum = gets.chomp.split(\" \").to_i\nsum.sort!\n\nans = \"\"\nsum.each do |n|\n ans << \"#{n}+\"\nend\nans = ans.slice(0, ans.length - 1)\n\nputs ans", "lang": "Ruby", "bug_code_uid": "305b73e76c0663c6524591393d8f6ce9", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "671dc5308eaa451df3836784f4871fce", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9555555555555556, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def sort(s)\n s.split('+').sort!.join('+')\nend\n\n# f = File.new('test1.txt', 'r')\nwhile s = f.gets\n puts sort s.chomp\nend\n# f.close", "lang": "Ruby", "bug_code_uid": "ac908bb6fce2597e08fdf2818c675bc6", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "7b14d32a8989671c2d007fb265cfd9f0", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.49417249417249415, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "Teams = {\"BERLAND\" => 0}\ndef teamn(name)\n if Teams[name].nil?\n Teams[name]=Teams.size\n end\n Teams[name]\nend\ngame = [1,0,0,0]\npoint = [3,0,0,0]\ndiff = [0,0,0,0]\nearn = [0,0,0,0]\n5.times do |i|\n input = gets.split(\" \")\n teama = teamn(input[0])\n teamb = teamn(input[1])\n score = input[2].split(\":\").map{|x| x.to_i}\n if score[0]>score[1]\n point[teama] += 3\n elsif score[0]==score[1]\n point[teama] += 1\n point[teamb] += 1\n else\n point[teamb] += 3\n end\n game[teama] += 1\n game[teamb] += 1\n diff[teama] += score[0] - score[1]\n diff[teamb] += score[1] - score[0]\n earn[teama] += score[0]\n earn[teamb] += score[1]\nend\nopponent = game.index(2)\nuprank = 0\nmindiff = []\n1.upto(3) do |i|\n uprank += 1 if point[i] > point[0]\n mindiff << (diff[i]-diff[0]) if point[i] == point[0] and i != opponent\n mindiff << (diff[i]-diff[0])/2 if point[i] == point[0] and i == opponent\nend\nif uprank >= 2\n puts \"IMPOSSIBLE\"\nelse\n mindiff = mindiff.sort.reverse\n mindiff = mindiff[1-uprank]\n diff[0] += mindiff\n diff[opponent] -= mindiff\n minearn = []\n 1.upto(3) do |i|\n uprank += 1 if point[i] == point[0] and diff[i] > diff[0]\n minearn << i if point[i] == point[0] and diff[i] == diff[0]\n end\n minearn = minearn.sort.reverse\n minearn = minearn[1-uprank]\n minearn = mindiff if (minearn < mindiff)\n puts minearn.to_s + \":\" + (minearn-mindiff).to_s\nend\n", "lang": "Ruby", "bug_code_uid": "3557654472d444e6ae6e02a8e4587c25", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "d9126e0c48c36e267d307810614cfa94", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9974979149291076, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "Teams = [\"BERLAND\"]\ndef teamn(name)\n Teams << name if Teams.index(name).nil?\n Teams.index(name)\nend\ngame = [1,0,0,0]\npoint = [3,0,0,0]\ndiff = [0,0,0,0]\nearn = [0,0,0,0]\n5.times do |i|\n input = gets.split(\" \")\n teama = teamn(input[0])\n teamb = teamn(input[1])\n score = input[2].split(\":\").map{|x| x.to_i}\n if score[0]>score[1]\n point[teama] += 3\n elsif score[0]==score[1]\n point[teama] += 1\n point[teamb] += 1\n else\n point[teamb] += 3\n end\n game[teama] += 1\n game[teamb] += 1\n diff[teama] += score[0] - score[1]\n diff[teamb] += score[1] - score[0]\n earn[teama] += score[0]\n earn[teamb] += score[1]\nend\nopponent = game.index(2)\nfound = false\nfi = nil\nfj = nil\n1.upto(50) do |i|\n diff[0] += i\n diff[opponent] -= i\n i.upto(50) do |j|\n earn[0] += j\n earn[opponent] += j-i\n rank = (0..3).sort{|a,b| (point[a]<=>point[b])*8+(diff[a]<=>diff[b])*4+(earn[a]<=>earn[b])*2+(Teams[a]<=>Teams[b])}.index(0)\n if rank > 1\n found = true\n fj = j\n break\n end\n earn[0] -= j\n earn[opponent] -= j-1\n end\n if found\n fi = i\n break\n end\n diff[0] -= i\n diff[opponent] += i\nend\nif found\n puts fi.to_s+\":\"+(fj-fi).to_s\nelse\n puts \"IMPOSSIBLE\"\nend\n", "lang": "Ruby", "bug_code_uid": "01ff63788bf1aee44ffdeac2043fe619", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "d9126e0c48c36e267d307810614cfa94", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9863842662632375, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "$n,$k=gets.split.map(&:to_i)\n\ndef line(v)\n\tret=v\n\tm=$k\n\t30.times{\n\t\tret+=v/m\n\t\tm*=$k\n\t}\n\tret\nend\n\ndef bin_search(l,r)\n\treturn -1 if l>r\n\tif l==r\n\t\treturn line(l)==-1 ? -1 : l\n\tend\n\tm=(l+r)/2\n\tlines=line(m)\n\tif lines<$n\n\t\treturn bin_search(m+1,r)\n\telse\n\t\tbs=bin_search(l,m-1)\n\t\treturn bs==-1 ? m : bs\n\tend\nend\n\np bin_search(1,10**9)", "lang": "Ruby", "bug_code_uid": "9b6940d480a906559a1eee2a9dfb9857", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "b9af71a15834f0f511f255353d1d647d", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9947643979057592, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#! ruby\n# Try Codeforces Round 326 div2\n# author: Leonardone @ NEETSDKASU\n\nn = gets.to_i\n\nroot = (n ** 0.5).floor\n\nf = [true] * (root + 1)\n\nlovely = n\n\n2.upto(root) do |i|\n next if !f[i]\n if lovely % i == 0\n ii = i * i\n while lovely % ii == 0\n lovely = lovely.div ii\n end\n if lovely % i != 0\n lovely *= i\n end\n end\n j = 2\n while j * i <= n\n f[j * i] = false\n j += 1\n end\nend\n\nputs lovely", "lang": "Ruby", "bug_code_uid": "5907ab770ec03fb8cd78b4eb99bbe59a", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "ffc5831cee0e5f10b44832a80b0125c7", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.28421052631578947, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n=gets.chomp.to_i\n\nb=1\nif n!=1\n\ti=2\n\twhile i<=n\n\t\tif n%i==0\n\t\t\tb*=i\n\t\t\twhile n%i==0\n\t\t\t\tn/=i\n\t\t\tend\n\t\telse\n\t\t\ti+=1\n\t\tend\n\tend\nend\n\nputs b", "lang": "Ruby", "bug_code_uid": "12167b40a102e12bde3b728adb92a527", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "a76c8070714799246e3df9707d331a9b", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9359605911330049, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "require 'prime'\n\nn = gets.to_i\nk = n\nq=(Math.sqrt n).floor\nf = Array.new(q+1, true)\nprime = Array.new\nresult = 1\n(2..q).each do |i|\n if i > k\n break\n end\n if Prime.prime?(i)\n if k % i == 0\n result *= i\n while (k % i ==0)\n k /= i\n end\n end\n end\nend\nif k != 1\n result *= k\nend\n\n\nputs result", "lang": "Ruby", "bug_code_uid": "dd2cf6c972d1721514a23ae2a22ba286", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "e1288628e1c8832e7b206c120d17b359", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.30248306997742663, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n = gets.chomp.to_i\n\nps = [2]\n\nfor q in 3..(n**0.5).floor\n isp = true\n ps.each do |p|\n if q % p == 0\n isp = false\n break\n end\n end\n ps << q if isp\nend\n\nans = 1\nwhile 1 < n\n ps.each do |p|\n ans *= p if n % p == 0\n while n % p == 0\n n /= p\n end\n end\n if ps[-1] < n\n ans *= n\n n = 1\n end\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "a196f9d7da46004ff2390a4ba8ce6a17", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "e1986fd46476d7fe59df4a11107dd39b", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7914691943127962, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "readline\na = readline.split.map(&:to_i)\n\nsum = 0\na.each_cons(2) do |x,y|\n if x+y == 5\n print \"Infinite\\n\"\n exit\n else\n sum += x+y\n end\nend\n\nprint \"Finite\\n#{sum}\"\n", "lang": "Ruby", "bug_code_uid": "751d0af11a36aebace94b62429d8c634", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "58511b5b8d00d47fdc7e3e9304b25c7a", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9959514170040485, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = readline.to_i\na = readline.split.map(&:to_i)\n\nsum = 0\na.each_cons(2) do |x,y|\n if x+y == 5\n print \"Infinite\\n\"\n exit\n else\n sum += x+y\n end\nend\n\na.each_cons(3) { |x,_,z| if x==3 and y==2 then sum -= 1 end }\n\nprint \"Finite\\n#{sum}\"\n", "lang": "Ruby", "bug_code_uid": "0b01acca14501b4ce7c1eb2533f27090", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "58511b5b8d00d47fdc7e3e9304b25c7a", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9916666666666667, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nn,m=gets.split.map(&:to_i)\nr=0\nx=0\ngets.split.map(&:to_i).each{|e|\n\tif x=x then\n\t\t\tm1-=x\n\t\telse\n\t\t\txs.push(x)\n\t\t\tbreak\n\t\tend\n\tend\n\tans+=1\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "0a989e799eee38903248f98da20125b2", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "1e9d79d873149ce943b548b8030775dc", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5661375661375662, "equal_cnt": 26, "replace_cnt": 12, "delete_cnt": 10, "insert_cnt": 5, "fix_ops_cnt": 27, "bug_source_code": "mn=gets().chomp\nmn=mn.split(\" \")\nn=mn[0].to_i\nm=mn[1].to_i\nline=gets().chomp\nline=line.split(\" \")\nsum=0\nfor i in 0...n\n sum+=line[i].to_i\nend\nif sum%m==0\n puts (sum/n)\nelse\n puts (sum/n)+1\nend\n", "lang": "Ruby", "bug_code_uid": "369eeeacfe9debb80b697916d9bd51c8", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "200666a0b240a950d0f89f251e8bb826", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.967741935483871, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts Math.log2(gets.to_i).ceil", "lang": "Ruby", "bug_code_uid": "655a584de6aab1aa30a2003315f5f1af", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "fd72ecbf3e21bf6e1b5891920830ad7b", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9230769230769231, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets.chomp.to_i.to_s(2).length", "lang": "Ruby", "bug_code_uid": "c3cb474ef042f4e6d3c333b572d58ba0", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "f12340a27cb728ca7ffe672df9921878", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2857142857142857, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "print Math.floor(i / 2) + 1", "lang": "Ruby", "bug_code_uid": "bed6af4af0084045c540e120a4c64b8b", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "689d4610cc66500a0b256fd62b5587d0", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9369369369369369, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b=gets.split.map &:to_i;puts (a-b).abs<2?:YES: :NO", "lang": "Ruby", "bug_code_uid": "af9dad02d1b7b6188672206b429876e1", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "7da10123bca5820cc2af3896e8b0e213", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9307692307692308, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "TEST_MODE = ARGV[0] == 't'\n\ndef evaluate(actual, expected); actual == expected ? \"OK\" : \"**NG**\"; end\ndef tests(); yield if TEST_MODE; end\ndef to_array(val); val.kind_of?(Array) ? val : [val]; end\ndef parse_int_array(str); str.split(\" \").collect{|s| s.to_i}; end\ndef p(*arg); puts \"DEBUG: \" + arg.to_s if TEST_MODE; end\n\ndef t(input, expected_output)\n input = to_array(input)\n expected_output = to_array(expected_output)\n output = []\n solve(input, output)\n puts \"#{evaluate(output, expected_output)} : input=#{input.to_s}, expected=#{expected_output.to_s}, actual=#{output.to_s}\"\nend\n\n# actual codes here\n\ndef solve(input, output)\n v = parse_int_array(input[0])\n if (v[0] - v[1]).abs <= 1\n output << \"YES\"\n else\n output << \"NO\"\n end\nend\n\ntests do\n # test cases\n t(\"2 3\", \"YES\")\n t(\"3 1\", \"NO\")\nend\n\nputs solve(STDIN.read.split(\"\\n\"), []) unless TEST_MODE\n", "lang": "Ruby", "bug_code_uid": "d18333846eb95fd5f981c4097c453af4", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "fe53bde198cdee42930dda4b5a1520f0", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.976, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a, b = gets.strip.split.map(&:to_i)\nif a > 0 && b > 0 && (a == b || (a - b).abs == 1)\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "fd571513364bab198fe7d74ae9a3cb41", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "096babdd10e7609a149e148f06462ad2", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8309178743961353, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b=gets.split.map{|e| e.to_i}\nif (b-a).abs<=1 then\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "f06c8ad7a8dc7630407ed71f98509cda", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "4669e6413df2401e1fce347ec9115e4d", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9205020920502092, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "code=gets.strip.scan(/.{10}/)\n\nhs={}\n10.times{|i|\n\ths[gets.strip] = i\n}\n\nputs code.inspect\n\ncode.each{|digit|\n\tprint hs[digit]\n}\n", "lang": "Ruby", "bug_code_uid": "668fa5a746940fd6a3b3bf91917b110d", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "739ec72d265ab76fce2dea9cdf8aec1b", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9753086419753086, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "c=gets.strip.scan(/.{10}/)\nh={}\n10.times{|i|h[gets.strip]=i}\nc.each{|d|p h[d]}\n", "lang": "Ruby", "bug_code_uid": "b37128b0fea1e4f8ca1fe693e55845ed", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "739ec72d265ab76fce2dea9cdf8aec1b", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9805013927576601, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "# ... LETS HACK THE WORLD ...\n#... KEEP CALM AND SAY LE ROI EST MORT IS HERE ...\n# ... EL-BADRY BECOME A LEGEND ...\nx,z = gets.chomp.split.map(&:to_i)\nputs(x*z)/2", "lang": "Ruby", "bug_code_uid": "cf89e6cb0812ecef01f2d33189a7d84c", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "db8e7f3e6b2fd58256d45fc9a3644aa9", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9807692307692307, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "m, n = gets.chomp.split.map{ |x| x.to_s }\nputs m*n/2", "lang": "Ruby", "bug_code_uid": "019a8828b2f7d1db52bcc37a28c61386", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "c4fa5a110f06280360cf687373425e8b", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.46153846153846156, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "m = gets.chomp.to_i\nn = gets.chomp.to_i\n\nputs (n*m)/2\n", "lang": "Ruby", "bug_code_uid": "0742b67c029f63d49009f628728ae2d0", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "aac8a927c41e20ee99649900e0273ab9", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.338368580060423, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "x = gets.chomp.split()\nx.downcase()\nans=\"\"\nfor i in x\n\tif i==\"a\" or i==\"e\" or i==\"i\" or i==\"o\" or i==\"u\" or i==\"y\"\n\t\tans+=\"\"\n\telse\n\t\tans+=\".\"+i.downcase()\n\tend\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "7d4f1c721e0faa613d1ff4023993be6c", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "d4f79185fa7be845a2351d3e3a04efac", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7837837837837838, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "x = gets.split(\"\")\nx.downcase()\nans=\"\"\nfor i in x\n if i==\"a\" or i==\"e\" or i==\"i\" or i==\"o\" or i==\"u\" or i==\"y\"\n ans+=\"\"\n else\n ans+=\".\"+i\n end\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "7a678269d89e369c0e0a26861aa7c6b6", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "8d73949b5b746163d8ec2f9a8a731eea", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.973293768545994, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "vowel = ['a','e','i','o','u','y']\nword = gets.chomp\nstr = ''\nword.split(\"\").each do |c|\nunless vowel.include? c.downcase\nstr = str + '.' + c.downcase\nend\nend\nprint str\nend", "lang": "Ruby", "bug_code_uid": "6bd79307726f255ab7e0bd8c64566e02", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "7fd42764ddcff635f1410f952905c12c", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7570621468926554, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "a=gets.strip.downcase\na.gsub!(/aeiou/,\"\")\na.each do |c| \n print \".\"+c\nend\n", "lang": "Ruby", "bug_code_uid": "baa42cd7795532e5feb4a4cd6c8ad7a2", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "f34028d2e44cf69645cb99b41224f981", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.37735849056603776, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n,k=gets.split.map(&:to_i);\np=[];input=[];\nn.times{ input.push(gets.split[0]) }\nans=[]\nk.times{|i|\n p.push(i);\n}\np.permutation{|a|\n t=[]\n input.each{|i|\n tmp=\"\"\n k.times{|j|\n tmp+=i[a[j]]\n }\n t.push(tmp.to_i)\n }\n ans.push(t.max-t.min)\n}\np ans.min", "lang": "Ruby", "bug_code_uid": "263a05274db3cb2b357723d14075643d", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "apr_id": "beda8411fc1e8c7242e0d2facda73c1f", "difficulty": 1400, "tags": ["brute force", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.889795918367347, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "a,b,w,x,c=gets.split.map(&:to_i)\nh={}\ni=0\nwhile true\n if c<=a\n p i\n exit\n end\n if b>=x\n b-=x\n else\n a-=1\n b=w-(x-b)\n end\n break if h[b]!= nil\n h[b]=[i,a]\n i+=1\n c-=1\nend\ncl=i-h[b][0]\nda=h[b][1]-a\nd=(c-a)/cl\na-=da*d\nc-=d*cl\ni+=d*cl\nwhile c>a\n if b>=x\n b-=x\n else\n a-=1\n b=w-(x-b)\n end\n c-=1\n i+=1\nend\ni-=2 if d>0\np i\n\n\n", "lang": "Ruby", "bug_code_uid": "4d2c15f59f3e643540341ca5c6623411", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "38df02d8451ca62252afe47eac1e9cd4", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9744279946164199, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a,b,w,x,c=gets.split.map(&:to_i)\nh={}\ni=0\nwhile true\n if c<=a\n p i\n exit\n end\n if b>=x\n bb=b-x\n else\n a-=1\n bb=w-(x-b)\n end\n break if h[bb]!= nil\n b=bb\n h[b]=[i,a]\n i+=1\n c-=1\nend\ncl=i-h[bb][0]\nda=h[bb][1]-a\nd=(c-a)/(cl-da)-1\na-=da*d\nc-=d*cl\ni+=d*cl\nwhile c>a\n if b>=x\n b-=x\n else\n a-=1\n b=w-(x-b)\n end\n c-=1\n i+=1\nend\np i\n\n\n", "lang": "Ruby", "bug_code_uid": "654661cfb786d29ebe69a5e7c939cdf7", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "38df02d8451ca62252afe47eac1e9cd4", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9826589595375722, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "r=0\n[0,*gets.chomp.bytes.map{|b|b-97}].each_cons{|x,y|r+=[(y-x)%26,(x-y)%26].min}\np r", "lang": "Ruby", "bug_code_uid": "01e775abe5965f20ba5359c9dd87a61b", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "08376b404148732ba8e22a5071183969", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9841549295774648, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "require 'byebug'\n\nexhibit = gets.rstrip\n\narr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\ncount = 0\ncurrent_index = 0\nexhibit.split('').each do |char|\n index = arr.find_index do |l|\n l == char\n end\n\n distance_index = (index - current_index).abs\n\n if distance_index > 13\n if index < current_index\n count += index + 26 - current_index\n else\n count += current_index + 26 - index\n end\n else\n count += distance_index\n end\n current_index = index\nend\n\nputs count\n", "lang": "Ruby", "bug_code_uid": "050a87b033d843c84320eb03d776d20a", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "2a3fd361441f0fbd8c1e298d50285036", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9690721649484536, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "t=0;('a'+gets).split('').inject{|pr,i|td=((pr||'a').ord-i.ord).abs;t+=[td,26-td].min;i};puts t", "lang": "Ruby", "bug_code_uid": "8a6d8f7757688237979dcb59e4933e67", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "dd184a247654d2bc0d346de5ddecc216", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9950166112956811, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "word = gets.chomp.split(\"\")\nalphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\nsum = 0\npos = 0\nfor i in (0..word.size-1)\n\tif i == 0\n\t\tif alphabet.find_index(word[i]) >= 13\n\t\t\tsum += 26 - alphabet.find_index(word[i])\n\t\telse\n\t\t\tsum += alphabet.find_index(word[i])\n\t\tend\n\t\tpos = alphabet.find_index(word[i])\n\telse\n\t\tif (pos - alphabet.find_index(word[i])).abs >= 13\n\t\t\tsum += 26 - (pos - alphabet.find_index(word[i])).abs\n\t\telse\n\t\t\tsum += pos - alphabet.find_index(word[i])\n\t\tend\n\t\tpos = alphabet.find_index(word[i])\n\tend\nend\n\nprint sum", "lang": "Ruby", "bug_code_uid": "11a64406941a7114a11a18febbd1c98b", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "9298da56c0a3f70f393771497c3f00b8", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9704565801253358, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def inpf() a=gets.chomp.split(\" \").map(&:to_f)end\n\ndef inps() a=gets.chomp.split(\" \")end\n\ndef copy(a) Marshal.load(Marshal.dump(a)) end\n\ndef kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end\n\ndef na(n,d=0) Array.new(n,d)end\n\ndef na2(n,m,d=0) Array.new(n){Array.new(m,d)}end\n\ndef na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end\n\ndef inp() a=gets.chomp.split(\" \").map(&:to_i)end\n\ndef r_up(a, b) (a+b-1)/b end\n\ndef sum(a) a.inject(:+) end\n\nrequire 'prime'\nn = inp[0]\n\nd = Prime.prime_division(n)\np d[0][0]\n", "lang": "Ruby", "bug_code_uid": "d691076a0408be8c71432d5521595914", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "38b31eb1e8c252f58a2ae171c593c3ab", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8536371603856266, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def inpf() a=gets.chomp.split(\" \").map(&:to_f)end\n\ndef inps() a=gets.chomp.split(\" \")end\n\ndef copy(a) Marshal.load(Marshal.dump(a)) end\n\ndef kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end\n\ndef na(n,d=0) Array.new(n,d)end\n\ndef na2(n,m,d=0) Array.new(n){Array.new(m,d)}end\n\ndef na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end\n\ndef inp() a=gets.chomp.split(\" \").map(&:to_i)end\n\ndef r_up(a, b) (a+b-1)/b end\n\ndef sum(a) a.inject(:+) end\n\nn = inp[0]\n(2..((n**0.5).ceil)).each do |d|\n if (n%d ==0)\n p d\n exit\n end\nend\np n\n", "lang": "Ruby", "bug_code_uid": "9b38865a9be0b9a0694912e1e08dbe61", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "38b31eb1e8c252f58a2ae171c593c3ab", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9584905660377359, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\na,b=gets.split.map(&:to_i)\nh=1.step(6).group_by{|i|(a-i).abs<=>(b-i).abs}\nputs -1.step(1).map{|i|h[i].size}*' '", "lang": "Ruby", "bug_code_uid": "3fcc1df8a2ce83bb99c6fa0caf673bf7", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "40457415bf0aa084a5f19f0db6fe6ebb", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.463855421686747, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "\na, b = gets.chomp.split.map(&:to_i);\nx,y,z = 0;\nz = 1 - ((a + b) % 2);\nx, y = [a, b].minmax;\nx, y = x + (y - x - 1) / 2, 7 - y + (y - x - 1) / 2;\nputs \"#{x} #{z} #{y}\\n\";\n", "lang": "Ruby", "bug_code_uid": "8020331cfddfe25b81f83aa84ab45752", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "c44c7e24268a8021961274a88d7cd061", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.87248322147651, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "p lambda {|a| t=[0,0,0]; (1..6).each{|x| q=((a[0]-x).abs-(a[1]-x).abs); p \"x\"+x.to_s+\"q\"+q.to_s; t[(q<0)?0:((q==0)?1:2)]+=1}; t } [gets.split.map(&:to_i)]\n", "lang": "Ruby", "bug_code_uid": "9925899b5fc1b1a131765eb9d86cde2f", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "e64c8a6552490ebc98a41aee2113eb04", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9955022488755623, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "# your code goes here\ncin=$stdin\n\na,b=cin.read.split(' ')\n\na=Integer(a)\nb=Integer(b)\ni=1\nres1=0\nres2=0\nres3=0\nwhile i<7 do\n x=a-i\n y=a-i\n if x<0\n x=x*-1\n end\n if y<0\n y=y*-1\n end\n if x= [a[k], 1].max ? r += 1 : r}\n", "lang": "Ruby", "bug_code_uid": "4e90d4c878d0c66f1931685f504a36a0", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "5f2fcdedc21d0e01277ec33cfc9805b1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9947916666666666, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "$a = [\n\t[],\n\t[0, 0, 0, 0, 0, 0],\n\t[0, 1, 3, 6, 0, 0],\n\t[0, 1, 2, 3, 5, 6]]\n\ndef gao(m, n)\n\treturn m > 5 ? 0 : $a[n][m] if n < 4\n\ts = n / 2\n\treturn 1 if m <= s\n\ts += (n - 1) / 2\n\treturn 2 if m <= s\n\ts += n / 2 - 1\n\treturn 3 if m <= s\n\ts += (n - 1) / 2\n\treturn 4 if m <= s\n\tt = n / 2 - 1\n\treturn t <= 0 ? 0 : (m - s + t - 1) / t\nend\n\nm, n = gets.split.map(&:to_i)\np gao(m, n) * 2 - 1\n", "lang": "Ruby", "bug_code_uid": "16952047a37d7291c5af1e095b469a86", "src_uid": "83f1d50a1802e08dd154d4c9778e3d80", "apr_id": "ddc087e5fd89b937290142e5f1d711eb", "difficulty": 2500, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.896969696969697, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "hq = gets.strip\nl = hq.length\ns = false\n\nfor i in 0...l\n if hq[i] == \"H\" || hq[i] == \"Q\" || hq[i] == \"9\" then s = true end\nend\n\nputs if s then \"Yes\" else \"No\" end", "lang": "Ruby", "bug_code_uid": "b8644153f3baeccb7b6a9b1669dcfa8e", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "c261b4255eb796bba0b9ec3e1f49c18d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6544117647058824, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "y = gets.chomp.to_i;\nx = gets.chomp;\n#a = gets.strip.split(' ').map(&:to_i);\n\nx.reverse!\nputs x;", "lang": "Ruby", "bug_code_uid": "605ae685d70cde368ef6f264225b0c0f", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "9cea40bc2cae178dec287407a982b98e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7934426229508197, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "a = gets.to_i\ns = gets\n\ndivs = []\nwhile 1 < a\n divs << a\n a /= 2\nend\ndivs.reverse!\n\ndivs.each {|d|\n s = s[0...d].reverse + s[d..-1]\n}\n\nputs s\n", "lang": "Ruby", "bug_code_uid": "f2cee920bfd1d2c21a7713939cca025e", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "669d6b225f793c36bd5895957462e87f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9887640449438202, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, d, $x = gets.split(' ').map(&:to_i)\na, b = [], []\ndef gnx\n $x = ($x *37 + 10007) % 1000000007\nend\n # initAB\n(1..n).each{|i| a << i}\n(1..n).each do |i|\n tgt = gnx % i\n a[i-1], a[tgt] = a[tgt], a[i-1]\nend\n(1..n).each{|i| b << ( i<=d ? 1 : 0 )}\n(1..n).each do |i|\n tgt = gnx % i\n b[i-1], b[tgt] = b[tgt], b[i-1]\nend\n # end of initAB\n\naid = (0...n).sort_by{|i| -a[i]}\nbid = (0...n).each_with_object([]){|i,a| a << i if b[i]>0}\nc = (0...n).map{|_| -1}\nnf, maxc = n, n-1\naid.each do |ai|\n break if nf == 0\n bid.each do |bi|\n id = ai + bi\n break if id > maxc\n if c[id] < 0\n c[id] = a[ai]\n nf -= 1\n end\n maxc -= 1 until (maxc < 0) || (c[maxc] < 0)\n end\nend\nc.each{|i| puts i}", "lang": "Ruby", "bug_code_uid": "a191f46d83518bf4ddbb82f5d22a6f49", "src_uid": "948ae7a0189ada07c8c67a1757f691f0", "apr_id": "eb97bed0cd5add7cb1729762c90b8723", "difficulty": 2300, "tags": ["probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9925280199252802, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = gets.split.map{|i| [i[0].ord - 97, i[1].ord - 49]}\nb = Array.new(8){Array.new(8){false}}\nc = Array.new(8){Array.new(8){false}}\na[0 .. 2].each{|x,y| b[x][y] = true}\na[0 .. 1].each do |x,y|\n\tx.pred.downto(0).each{|i| c[i][y] = true; break if b[i][y]}\n\tx.succ.upto(7).each{|i| c[i][y] = true; break if b[i][y]}\n\ty.pred.downto(0).each{|j| c[x][j] = true; break if b[x][j]}\n\ty.succ.upto(7).each{|j| c[x][j] = true; break if b[x][j]}\nend\n(a[2][0] - 1 .. a[2][0] + 1).each do |i|\n\t(a[2][1] - 1 .. a[2][1] + 1).each do |j|\n\t\tc[i][j] = true if (0 .. 7).include?(i) && (0 .. 7).include?(j) && !b[i][j]\n\tend\nend\n(a[3][0] - 1 .. a[3][0] + 1).each do |i|\n\t(a[3][1] - 1 .. a[3][1] + 1).each do |j|\n\t\tif (0 .. 7).include?(i) && (0 .. 7).include?(j) && !c[i][j] then\n\t\t\tputs :OTHER\n\t\t\texit\n\t\tend\n\tend\nend\nputs :CHECKMATE\n", "lang": "Ruby", "bug_code_uid": "8b80eeea4a3b0f0ef18f287e5d877248", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "47624242240121226f3dadc01d2e818a", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9706666666666667, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "k=gets.chomp.to_i\nl=gets.chomp.to_i\nm=gets.chomp.to_i\nn=gets.chomp.to_i\nd=gets.chomp.to_i\nret=0\n1.upto(d){|i| if %k==0 || i%l==0 || i%m==0 || i%n==0 || i%d==0 then ret+=1 end}\nprint(ret,\"\\n\")\n", "lang": "Ruby", "bug_code_uid": "0c4701ac905e50309ef13ae75890a68f", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "e6f92c4776fa0e3413e9c0e39b43a8a3", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.500875656742557, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "input_nums = []\nuntil (input = gets.chomp).empty?\n input_nums.push input.to_i\nend\n\ndragons_number = input_nums[-1]\ninput_nums.delete_at(input_nums.count)\ndragons = 1.upto(dragons_number).to_a\ninput_nums.each do |damage|\n dragons.select!{ |dragon| dragon % damage != 0 }\nend\nputs \"#{dragons_number - dragons.count}\"", "lang": "Ruby", "bug_code_uid": "9b08e84e30724d3019be026e33eaa5ba", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "25b9e662681da550080b6d764dd46d5c", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9779411764705882, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "k = $stdin.readline.to_i\nl = $stdin.readline.to_i\nm = $stdin.readline.to_i\nn = $stdin.readline.to_i\nd = $stdin.readline.to_i\n\na = Array.new(d)\ni = 1\nwhile i<=d\n a[i] = 1 if i%k==0 || i%l==0 || i%m==0 || i%n==0\n i+=1\nend\n\ns = a.compact.inject(:+)\nputs s.nil? : 0 : s ", "lang": "Ruby", "bug_code_uid": "83a780a29a40c4d712af4f8a3c8cf33d", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "2344c743567d2a513ec32b963d535e85", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.40572792362768495, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "k = gets.chomp.to_i\nl = gets.chomp.to_i\nm = gets.chomp.to_i\nn = gets.chomp.to_i\ndragons = gets.chomp.to_i\ndragon_arr = []\n\ni = 1\nwhile i <= dragons\n\tdragon_arr << i\n\ti += 1\nend\n\ncount = 0\nif k == 1 || l == 1 || m == 1 || n == 1\n\tputs dragons\nelse\n\tx = 1\n\ti = k\n\twhile i <= dragons\n\t\tif dragon_arr.include? i\n\t\t\tdragon_arr.delete(i)\n\t\tend\t\t\n\t\ti = k * x\n\t\tx += 1 \n\tend\n\tx = 1\n\ti = l\n\twhile i <= dragons\n\t\tif dragon_arr.include? i\n\t\t\tdragon_arr.delete(i)\n\t\tend\n\t\ti = l * x\n\t\tx += 1\n\tend\n\ti = m\n\tx = 1\n\twhile i <= dragons\n\t\tif dragon_arr.include? i\n\t\t\tdragon_arr.delete(i)\n\t\tend\n\t\ti = m * x\n\t\tx += 1\n\tend\n\ti = n\n\tx = 1\n\twhile i <= dragons\n\t\tif dragon_arr.include? i\n\t\t\tdragon_arr.delete(i)\n\t\tend\n\t\ti = n * x\n\t\tx += 1\n\tend\n\tcount = dragons - dragon_arr.size\n\tputs count\nend\n\t", "lang": "Ruby", "bug_code_uid": "703b0d8e87573e4d217b10fb91d25a51", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "83129118d1db884d390da3a31864bcb0", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.957345971563981, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,*a=gets.split.map &:to_i\na=a.map{|e|e*2}.sort\ni=0;s=a.reduce(:+)\nwhile s0?1:0) + (nb/10 + nb%10>0?1:0)\n\nputs (k<=n) ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "ab2aff94da9511ee7158a52fac7d917f", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "ecae09e3de577417bc25c0d9b3e9546b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9661016949152542, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "h=Hash.new 0;gets;gets.split.map{|e|h[e]+=1};p h.values.min", "lang": "Ruby", "bug_code_uid": "bc7da5235f4fcf9ecced1df3809ac738", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "fc606f5c4e26c5de1be695246782f16f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9930715935334873, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\ncoin_count = gets.to_i\ncoins = gets.split(' ').map(&:to_i)\n\npockets = 0\ncoin_counts = Hash.new {|h, k| h[k] = 0}\n\ncoins.each do |c|\n coin_count[c] += 1\n pockets = [pockets, coin_count[c]].max\nend\n\nputs pockets", "lang": "Ruby", "bug_code_uid": "8bb41d723fbc29368ddb8cb1636575cc", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "e2b046cb8bbd05124cf792918088a562", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7972027972027972, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i; ar = gets.split.map &:to_i\nputs ar.size - ar.uniq.size", "lang": "Ruby", "bug_code_uid": "65714daabb62ccc933e2e07afb77da33", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "3afc64ede8f30941ec4e08a64aea2a9a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5433526011560693, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 16, "bug_source_code": "n, a, b, c = gets.chomp.split().map { |x| x.to_i }\n\nn = (-n % 4)\n\nputs case n\n when 0\n 0\n when 1\n a\n when 2\n [ 2*a, b ].min\n when 3\n [ 3*a, a+b, c ].min\nend\n", "lang": "Ruby", "bug_code_uid": "e8c037499ff63d4833dd2b5f146652a1", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "547d8bafe90892f7a2683ff8110f2c4b", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9874213836477987, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nn,a,b,c=gets.split.map(&:to_i)\nif n%4==0\n\tp 0\nelsif n%4==1\n\tp [a*3,a+b,c].min\nelsif n%4==2\n\tp [a*2,b,c*2].min\nelsif n%4==3\n\tp [a,c*3].min\nend", "lang": "Ruby", "bug_code_uid": "de29cce7a9add7af920c3db04e62a9f2", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "b1c87d14fde4f1ac0969dd00d45311cb", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6431372549019608, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "inp = gets.chomp.split(' ')\n\nn=inp[0].to_i\n\na=inp[1].to_i\n\nb=inp[2].to_i\n\nc=inp[3].to_i\n\nk= 4-n%4 if(n%4!=0)\n\nif (n%4==0)\n puts 0\n \nk=0\n\nend\n\n\nif(k==1)\n\n puts a\n\nelsif (k==2)\n \n puts [2*a,b].min\n\nelsif (k==3)\n \n puts [3*a,a+b,c].min\n\nend", "lang": "Ruby", "bug_code_uid": "b3408a387accbe4b3ccd1ee6a1ee42b8", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "8e0d43465399d66b646260a06d0fbcc3", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9932432432432432, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,a,b,c = gets.chomp.split(\" \").map(&:to_i)\nputs n%4 == 0? 0 : n%4==3? [a,b+c,3*a].min : (n%4==2? [2*a,b,2*c].min : (n%4==1? [3*a,a+b,c].min : -1))\n", "lang": "Ruby", "bug_code_uid": "3df800500cf630258a2adb245f3284ae", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "4e67fc468ed6fabaf60c667098c9492a", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9185185185185185, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# TEMPLATE BEGIN\ndef read_vector\n gets.chomp.split(/\\s+/)\nend\ndef read_vector_int\n read_vector.map(&:to_i)\nend\n# TEMPLATE END\n\na, b, x, y = read_vector_int\nputs [a / x, b / y].min\n", "lang": "Ruby", "bug_code_uid": "dcb51a35c16f6ee4eb8a3835ff46f6cd", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "apr_id": "041233a7b168da0e1bb80ff91fcf26ac", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5701943844492441, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "line = gets.chomp\na,b,width,height = line.split(' ').map!(&:to_f)\n\na_times = (a/width).floor\nb_times = (b/height).floor\n\nputs [a_times, b_times].min", "lang": "Ruby", "bug_code_uid": "99d6200c525d4f3ab1af4240de54587a", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "apr_id": "49cd461de434413a7e1863b74012c49d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9090909090909091, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b,c,n=gets.split.map &:to_i;x=n-a-b+c;p x<1?-1:x", "lang": "Ruby", "bug_code_uid": "9a0cb05dee6f91470c169b6ca6e163f1", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "b23ef32a2d7329ce0e38c0b2bd41238f", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8666666666666667, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a, b, c, n = gets.split.map(&:to_i)\nx = a + b - c\nputs n - x > 0 ? n - x : -1\n", "lang": "Ruby", "bug_code_uid": "927bf9628a72b465ba9af0b900de28e0", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "fc2f54fe3c236be5edc39fec35d589cd", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9121338912133892, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b, c, n = gets.chomp.split(' ').map(&:to_i)\n\nsol = n - a - b + c\nif sol > 0\n\tputs sol\nelse\n\tputs -1\nend\n\n", "lang": "Ruby", "bug_code_uid": "695f49e5127b06e991c4562b1e80fa68", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "e9d3917e0e87108160058cc6e451550a", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.995335486185863, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def dsum(given_degree)\n given_degree['1'] + given_degree['2'] + given_degree['3']\nend\n\nn = gets.to_i\ndegree = gets.split(' ')\ndegree_1 = {:min => degree.first.to_i, :max => degree.last.to_i}\ndegree = gets.split(' ')\ndegree_2 = {:min => degree.first.to_i, :max => degree.last.to_i}\ndegree = gets.split(' ')\ndegree_3 = {:min => degree.first.to_i, :max => degree.last.to_i}\ngiven_degree = {'1' => degree_1[:min], '2' => degree_2[:min], '3' => degree_3[:min]}\nif dsum(given_degree) == n\n puts \"#{given_degree['1']} #{given_degree['2']} #{given_degree['3']}\"\nelse\n if n - dsum(given_degree) <= (degree_1[:max] - given_degree['1'])\n given_degree['1'] += n - dsum(given_degree)\n else\n given_degree['1'] = degree_1[:max]\n puts \"#{given_degree['2']} #{given_degree['2']} #{given_degree['3']}\" if dsum(given_degree) == n\n if n - dsum(given_degree) <= (degree_2[:max] - given_degree['2'])\n given_degree['2'] += n - dsum(given_degree)\n else\n given_degree['2'] = degree_2[:max]\n puts \"#{given_degree['1']} #{given_degree['2']} #{given_degree['3']}\" if dsum(given_degree) == n\n if n - dsum(given_degree) <= (degree_3[:max] - given_degree['3'])\n given_degree['3'] += n - dsum(given_degree)\n end\n end\n end\nend\nputs \"#{given_degree['1']} #{given_degree['2']} #{given_degree['3']}\"\n", "lang": "Ruby", "bug_code_uid": "2b1623b5684f5ecfd192cfbdbab84b22", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "31008b8003c0bc6bd8a15e1c88567f41", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.28846153846153844, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "x = gets.split.map(&:to_i)\n\nc = 0\nf = 0\nwhile c < x \n c+=5\n f+=1\nend\n\nputs f", "lang": "Ruby", "bug_code_uid": "15570959612b10fdd8d245a3fd84e8da", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "bbf362c24134cd0f122032f13228ff79", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6875, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "puts(get/5)", "lang": "Ruby", "bug_code_uid": "fd102e03cf98223b3d8221c44bb05c89", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "d1b4c6d176f74987bb4d54311c535839", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6792452830188679, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "puts get.chomp.to_i / 5 + 1\n", "lang": "Ruby", "bug_code_uid": "115e5a35658f6a3aa3b623ed73d202ef", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "32e0e46519fc54a16eb6ef94b2a4eaee", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.20735538717427462, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "=begin\n\n Online Ruby Interpreter.\n Code, Compile, Run and Debug Ruby script online.\nWrite your code in this editor and press \"Run\" button to execute it.\n\n=end\n\ndef test\n\tinput = $stdin.read\n\tinput = input.split(\"\\n\")\n\tchars = ['a','b','c','d','e','f','j','h']\n\tplace1 = [chars.find_index(input[0][0]) ,input[0][1].to_i-1]\n\tplace2 = [chars.find_index(input[1][0]),input[1][1].to_i-1]\n \n\twrong_p = []\n\twrong_p.push(place1)\n\twrong_p.push(place2)\n\t\t\n \n\tfor i in 0...8\n\t if !wrong_p.include?([place1[0],i]) && i >=0\n\t wrong_p.push([place1[0],i])\n\t end\n\t if !wrong_p.include?([i,place1[0]]) && i >=0\n\t wrong_p.push([i,place1[0]])\n\t end\n\tend\n\t\n\tif !wrong_p.include?([place2[0]+2, place2[1]+1]) && place2[0]+2 >=0 && place2[1]+1 >=0\n\t wrong_p.push([place2[0]+2, place2[1]+1])\n\tend\n\tif !wrong_p.include?([place2[0]+2, place2[1]-1]) && place2[0]+2 >=0 && place2[1]-1 >= 0\n\twrong_p.push([place2[0]+2, place2[1]-1])\n\tend\n\tif !wrong_p.include?([place2[0]-2, place2[1]+1]) && place2[0]-2 >=0 && place2[1]+1 >=0 \n\twrong_p.push([place2[0]-2, place2[1]+1])\n\tend\n\tif !wrong_p.include?([place2[0]-2, place2[1]-1]) && place2[0]-2 >=0 && place2[1]-1 >=0\n\twrong_p.push([place2[0]-2, place2[1]-1])\n\tend\n\tif !wrong_p.include?([place2[0]+1, place2[1]+2]) && place2[0]+1 >= 0 && place2[1]+2 >= 0\n\twrong_p.push([place2[0]+1, place2[1]+2])\n\tend\n\tif !wrong_p.include?([place2[0]+1, place2[1]-2]) && place2[0]+1 >=0 && place2[1]-2 >= 0\n\twrong_p.push([place2[0]+1, place2[1]-2])\n\tend\n\tif !wrong_p.include?([place2[0]-1, place2[1]+2]) && place2[0]-1 >=0 && place2[1]+2 >=0 \n\twrong_p.push([place2[0]-1, place2[1]+2])\n\tend\n\tif !wrong_p.include?([place2[0]-1, place2[1]-2]) && place2[0]-1 >= 0 && place2[1]-2 >=0\n\twrong_p.push([place2[0]-1, place2[1]-2])\n\tend\n\n\n\n \n if !wrong_p.include?([place1[0]+1, place1[1]+2]) && place1[0]+1 >= 0 && place1[1]+2 >=0\n\t wrong_p.push([place1[0]+1, place1[1]+2])\n\tend\n\tif !wrong_p.include?([place1[0]+1, place1[1]-2]) && place1[0]+1 >= 0 && place1[1]-2 >=0\n\t wrong_p.push([place1[0]+1, place1[1]-2])\n\tend\n\tif !wrong_p.include?([place1[0]-1, place1[1]+2]) && place1[0]-1 >= 0 && place1[1]+2 >=0\n\t wrong_p.push([place1[0]-1, place1[1]+2])\n\tend\n if !wrong_p.include?([place1[0]-1, place1[1]-2]) && place1[0]-1 >= 0 && place1[1]-2 >=0\n\t wrong_p.push([place1[0]-1, place1[1]-2])\n\tend\t\n if !wrong_p.include?([place1[0]+2, place1[1]+1]) && place1[0]+2 >= 0 && place1[1]+1 >=0\n\t wrong_p.push([place1[0]+2, place1[1]+1])\n\tend\n\tif !wrong_p.include?([place1[0]+2, place1[1]-1]) && place1[0]+2 >= 0 && place1[1]-1 >=0\n\t wrong_p.push([place1[0]+2, place1[1]-1])\n\tend\n\tif !wrong_p.include?([place1[0]-2, place1[1]+1]) && place1[0]-2 >= 0 && place1[1]+1 >=0\n\t wrong_p.push([place1[0]-2, place1[1]+1])\n\tend\n if !wrong_p.include?([place1[0]-2, place1[1]-1]) && place1[0]-2 >= 0 && place1[1]-1 >=0\n\t wrong_p.push([place1[0]-2, place1[1]-1])\n\tend\t\n\t\n\t\n\t\n\t\n\n\n \n\tcount = 0\n for i in 0...8\n for j in 0...8\n if !wrong_p.include?([i,j])\n count = count+1\n end\n end\n end\n puts count\nend \ntest\n \n", "lang": "Ruby", "bug_code_uid": "f2149c1f4da36457a0e53a3c085a12d7", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "678edda80592ef969a8db6010eecc2da", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9155805093242431, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "=begin\n\n Online Ruby Interpreter.\n Code, Compile, Run and Debug Ruby script online.\nWrite your code in this editor and press \"Run\" button to execute it.\n\n=end\n\n=begin\n\n Online Ruby Interpreter.\n Code, Compile, Run and Debug Ruby script online.\nWrite your code in this editor and press \"Run\" button to execute it.\n\n=end\n\ndef test\n\tinput = $stdin.read\n\tinput = input.split(\"\\n\")\n\tchars = ['a','b','c','d','e','f','j','h']\n\tplace1 = [chars.find_index(input[0][0]) ,input[0][1].to_i-1]\n\tplace2 = [chars.find_index(input[1][0]),input[1][1].to_i-1]\n \n\twrong_p = []\n\twrong_p.push(place1)\n\twrong_p.push(place2)\n\t\t\n \n\tfor i in 0...8\n\t if !wrong_p.include?([place1[0],i]) && i >=0\n\t wrong_p.push([place1[0],i])\n\t end\n\t if !wrong_p.include?([i,place1[1]]) && i >=0\n\t wrong_p.push([i,place1[1]])\n\t end\n\tend\n\t\n\tif !wrong_p.include?([place2[0]+2, place2[1]+1]) \n\t wrong_p.push([place2[0]+2, place2[1]+1])\n\tend\n\tif !wrong_p.include?([place2[0]+2, place2[1]-1]) \n\twrong_p.push([place2[0]+2, place2[1]-1])\n\tend\n\tif !wrong_p.include?([place2[0]-2, place2[1]+1]) \n\twrong_p.push([place2[0]-2, place2[1]+1])\n\tend\n\tif !wrong_p.include?([place2[0]-2, place2[1]-1]) \n\twrong_p.push([place2[0]-2, place2[1]-1])\n\tend\n\tif !wrong_p.include?([place2[0]+1, place2[1]+2])\n\twrong_p.push([place2[0]+1, place2[1]+2])\n\tend\n\tif !wrong_p.include?([place2[0]+1, place2[1]-2]) \n\twrong_p.push([place2[0]+1, place2[1]-2])\n\tend\n\tif !wrong_p.include?([place2[0]-1, place2[1]+2]) \n\twrong_p.push([place2[0]-1, place2[1]+2])\n\tend\n\tif !wrong_p.include?([place2[0]-1, place2[1]-2]) \n\twrong_p.push([place2[0]-1, place2[1]-2])\n\tend\n\n\n\n \n if !wrong_p.include?([place1[0]+1, place1[1]+2]) \n\t wrong_p.push([place1[0]+1, place1[1]+2])\n\tend\n\tif !wrong_p.include?([place1[0]+1, place1[1]-2]) \n\t wrong_p.push([place1[0]+1, place1[1]-2])\n\tend\n\tif !wrong_p.include?([place1[0]-1, place1[1]+2])\n\t wrong_p.push([place1[0]-1, place1[1]+2])\n\tend\n if !wrong_p.include?([place1[0]-1, place1[1]-2])\n\t wrong_p.push([place1[0]-1, place1[1]-2])\n\tend\t\n if !wrong_p.include?([place1[0]+2, place1[1]+1]) \n\t wrong_p.push([place1[0]+2, place1[1]+1])\n\tend\n\tif !wrong_p.include?([place1[0]+2, place1[1]-1]) \n\t wrong_p.push([place1[0]+2, place1[1]-1])\n\tend\n\tif !wrong_p.include?([place1[0]-2, place1[1]+1])\n\t wrong_p.push([place1[0]-2, place1[1]+1])\n\tend\n if !wrong_p.include?([place1[0]-2, place1[1]-1]) \n\t wrong_p.push([place1[0]-2, place1[1]-1])\n\tend\t\n\t\n\t\n\t\n\t\n\n\n\tcount = 0\n for i in 0...8\n for j in 0...8\n if !wrong_p.include?([i,j])\n count = count+1\n end\n end\n end\n puts count\nend \ntest\n \n\n", "lang": "Ruby", "bug_code_uid": "f0f3e59afffef0c0244fae74ce2f00af", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "678edda80592ef969a8db6010eecc2da", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9850860420650096, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\nres=[\"ABC\",\"ACB\",\"BAC\",\"BCA\",\"CAB\",\"CBA\"]\ninput=[gets.split[0],gets.split[0],gets.split[0]]\nres.each{|ans|\n check=1\n input.each{|i|\n if i[1]==\">\" then\n a0=0\n a1=0\n 3.times{|j|\n if ans[j]==i[0] then\n a0=j\n end\n if ans[j]==i[2] then\n a1=j\n end\n }\n if a0<=a1 then\n check=0\n end\n else\n a0=0\n a1=0\n 3.times{|j|\n if ans[j]==i[0] then\n a0=j\n end\n if ans[j]==i[2] then\n a1=j\n end\n }\n if a0>=a1 then\n check=0\n end\n\n end\n }\n if check==1 then\n puts ans\n end\n\n}\n", "lang": "Ruby", "bug_code_uid": "abf1113b65ae57da915f6f09d5f582e8", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "apr_id": "b24a2082bc28e449d02e0f4d1cc5e48e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9764705882352941, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nn=gets.to_i\na=gets.split.map(&:to_i)[-2..-1]\nif a[-1]==0\n\tputs :UP\nelsif a[-1]==15\n\tputs :DOWN\nelsif n==1\n\tp -1\nelse\n\tputs a[0]b ? neg+=(a-b) : pos+=(b-a)\nend\nneg = neg/2;\nif(neg>=pos)\n puts \"Yes\"\nelse\n puts \"No\"\nend", "lang": "Ruby", "bug_code_uid": "e5047c9ca98ac1623ac2546c9a438393", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "622f5d000828a22f464803e227948a83", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9664596273291925, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "data=gets.chomp.split\ncol1=[]\ndata.each do |i|\n\tcol1.push(i.to_i)\nend\n\ncol2=[]\ndata1=gets.chomp.split\ndata1.each do |i|\n\tcol2.push(i.to_i)\nend\n\ndiff1=0\ndiff2=0\n\nfor i in(0..col1.length-1)\n\tif col1[i]>=col2[i]\n\t\ta=col1[i]-col2[i]\n\t\tif a>=2\n\t\t\tdiff1+=col1[i]-col2[i]\n\t\tend\n\telse\n\t\tdiff2+=col2[i]-col1[i]\n\tend\nend\n\nif diff2==0\n\tputs \"Yes\"\nelse\n\tk=diff1/2\n\tif k>=diff2\n\t\tputs \"Yes\"\n\telse\n\t\tputs \"No\"\n\tend\nend", "lang": "Ruby", "bug_code_uid": "218e2dced3cd2674a0d6f75c8c06b7b0", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "a5fb715f18872b95b0f905a1d0d98f96", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9694323144104804, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/env ruby\n\nhave = ARGF.gets.chomp.split(' ').map{ |s| s.to_i }\nwant = ARGF.gets.chomp.split(' ').map{ |s| s.to_i }\n\nfor i in 0..2\n if have[i] < want[i]\n have[i] = 0\n want[i] = want[i] - have[i]\n else\n have[i] = have[i] - want[i]\n want[i] = 0\n end\nend\n\nfor i in 0..2\n while want[i] > 0 and (have[(i+1) % 3] >= 2 or have[(i+2) % 3] >= 2)\n if have[(i+1) % 3] >= 2\n want[i] -= 1;\n have[(i+1) % 3] -=2\n end\n if have[(i+2) % 3] >= 2\n want[i] -= 1;\n have[(i+2) % 3] -=2\n end\n end\nend\n\nif want[0] > 0 or want[1] > 0 or want[2] > 0\n puts \"No\"\nelse\n puts \"Yes\"\nend\n", "lang": "Ruby", "bug_code_uid": "156fd3df53c062eac144768db8d95142", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "580d970a43d749566c8ce3ef92f6a9fc", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8153846153846154, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "a,b,c=gets.split.map(&:to_i)\narr=gets.split.map(&:to_i)\ncounter=0\ncounter+=(a-arr[0])/2\ncounter+=(b-arr[1])/2\ncounter+=(c-arr[2])/2\nputs (counter>=0)?\"YES\":\"NO\"", "lang": "Ruby", "bug_code_uid": "31558c4b091c4ba988fd7a578e465e66", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "963d0ad7197907b3fc5845cd548078b8", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9995244888254874, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "count = 0\nwinner = 0\nwagons, sp, cp = gets.chomp.split.map{|s| s.to_i}\nh = gets.chomp == \"to head\"\ngets.chomp.each_char do |c|\n count += 1\n if c.to_i == 0\n if sp < cp\n sp -= 1 unless sp == 1\n else\n sp += 1 unless sp == wagons\n end\n if h\n if cp == 1\n h = !h\n cp += 1\n else\n cp -= 1\n end\n else\n if cp == wagons\n h = !h\n cp -= 1\n else\n cp += 1\n end\n end\n if sp == cp\n winner = 1\n break\n end\n else\n if h\n if cp == 1\n h = !h\n cp += 1\n else\n cp -= 1\n end\n else\n if cp == wagons\n h = !h\n cp -= 1\n else\n cp += 1\n end\n end\n if cp == 1\n sp = 2\n elsif cp == wagons\n sp = wagons - 1\n else\n if h\n sp = wagons\n else\n sp = 1\n end\n end\n end\n puts \"#{sp} #{cp}\"\n raise \"invalid position\" if sp < 1 || wagons < sp || cp < 1 || wagons < cp\nend\nif winner == 0 \n puts \"Stowaway\"\nelse\n puts \"Controller #{count}\"\nend\n", "lang": "Ruby", "bug_code_uid": "3f77ab14447058d67c7dc5ba4c677170", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "68c3ecd4b650364d48eb829b16eb9793", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.33170254403131116, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "count = 0\nwinner = 0\nwagons, sp, cp = gets.chomp.split.map{|s| s.to_i}\nh = gets[3] == 'h' ? 0 : 1\ngets.chomp.each_char do |c|\n count += 1\n if c.to_i == 0\n if sp < cp\n if sp > 1\n sp -= 1\n else\n sp += 1\n end\n else\n if sp < wagons\n sp += 1\n else\n sp -= 1\n end\n end\n if sp == cp\n winner = 1\n break\n end\n if h\n if cp > 1\n cp -= 1\n else\n cp += 1\n h = !h\n end\n else\n if cp < wagons\n cp += 1\n else\n cp -= 1\n h = !h\n end\n end\n if sp == cp\n winner = 1\n break\n end\n else\n if h\n if cp > 0\n cp -= 1\n else\n cp += 1\n h = !h\n end\n else\n if cp < wagons\n cp += 1\n else\n cp -= 1\n h = !h\n end\n end\n sp = cp <= wagons / 2 > ? cp + 1 : cp - 1\n end\n #puts \"#{sp} #{cp}\"\nend\nif winner == 0 \n puts \"Stowaway\"\nelse\n puts \"Controller #{count}\"\nend\n", "lang": "Ruby", "bug_code_uid": "0edb9cb2757cfc138b994ec9167bd84e", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "68c3ecd4b650364d48eb829b16eb9793", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3795066413662239, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "count = 0\nwinner = 0\nwagons, sp, cp = gets.chomp.split.map{|s| s.to_i}\nh = gets[3] == 'h' ? 0 : 1\ngets.chomp.each_char do |c|\n count += 1\n if c.to_i == 0\n if sp < cp\n if sp > 1\n sp -= 1\n else\n sp += 1\n end\n else\n if sp < wagons\n sp += 1\n else\n sp -= 1\n end\n end\n if sp == cp\n winner = 1\n break\n end\n if h\n if cp > 1\n cp -= 1\n else\n cp += 1\n h = !h\n end\n else\n if cp < wagons\n cp += 1\n else\n cp -= 1\n h = !h\n end\n end\n if sp == cp\n winner = 1\n break\n end\n else\n if h\n if cp > 0\n cp -= 1\n else\n cp += 1\n h = !h\n end\n else\n if cp < wagons\n cp += 1\n else\n cp -= 1\n h = !h\n end\n end\n sp = cp <= wagons / 2 ? cp + 1 : cp - 1\n end\n #puts \"#{sp} #{cp}\"\n raise \"error\" if sp < 1 || wagons < sp || cp < 1 || wagons < cp\nend\nif winner == 0 \n puts \"Stowaway\"\nelse\n puts \"Controller #{count}\"\nend\n", "lang": "Ruby", "bug_code_uid": "9046e230539bcd857aa0ca0822a623bb", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "68c3ecd4b650364d48eb829b16eb9793", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9145299145299145, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#!/usr/bin/ruby\nx,y=gets.split.map(&:to_i)\na=[x]*3\nr=0\nwhile a[2]!=y\n\ta[2]=[a[1]-a[0]+1,y].max\n\ta.sort!\n\tr+=1\nend\np r", "lang": "Ruby", "bug_code_uid": "ab664692d2722280dcbe1da783443160", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "efd721ab0114e4e289eb19ee2eb069d7", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6332703213610587, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "def printlol(ar)\n for i in 0..(ar.length-2) do\n print ar[i]\n print \" \"\n end\n print ar.last\n puts \"\"\nend\n\n\ninput = gets.strip.split(' ').map(&:to_i)\nx = input[0]\ny = input[1]\n\nlol = [x, x, x]\ncount = 0\nwhile lol[0] != y or lol[1] != y or lol[2] != y do\n asd = lol.dup\n asd.slice!(lol.index(lol.max))\n fark = (asd[0] - asd[1]).abs\n if fark + 1 < y\n asd << [y, ((asd[0] + asd[1]) / 6)].max\n else\n if (fark + 1) >= ((asd[0] + asd[1]) / 6)\n asd << (fark + 1)\n else\n asd << ((asd[0] + asd[1]) / 6)\n end\n end\n lol = asd\n count += 1\n printlol(lol)\nend\n\nputs count", "lang": "Ruby", "bug_code_uid": "29c460ad5f83b94aaeb4b403c102ca19", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "ce1ec142c774fa547024e551bc42080b", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9924242424242424, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = readline.split.map(&:to_i)\n\ns = [m,m,m]\n\nans = 0\nwhile s.min <= n\n s[0] = s[1] + s[2]\n s=s.sort\n ans += 1\nend\n\nputs ans\n\n", "lang": "Ruby", "bug_code_uid": "7ab487c742d25dabb7b1179d0e996fb9", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "07b9f78f4291a80a0edabc67c0931d5c", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9929078014184397, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\n# coding: utf-8\n\nn, m = gets.split.map &:to_i\ndef f(n, i, m)\n if i == n\n return i.to_s\n elsif m > 2 ** (n - i + 1)\n return f(n, i + 1, m - 2 ** (n - i + 1)) + i.to_s\n else\n return i.to_s + f(n, i + 1, m)\n end\nend\nputs f(n, 1, m).each_char.to_a.join(\" \")", "lang": "Ruby", "bug_code_uid": "b5e0ebd06b199420bd4eceff04c5664a", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "9247201b273e840c630506c327ebe0f7", "difficulty": 1400, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9311594202898551, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/ruby\n# coding: utf-8\n\nn, m = gets.split.map &:to_i\ndef f(n, i, m)\n if i == n\n return i.to_s\n elsif m > 2 ** (n - i - 1)\n return f(n, i + 1, m - 2 ** (n - i - 1)) + i.to_s\n else\n return i.to_s + f(n, i + 1, m)\n end\nend\nputs f(n, 1, m).each_char.to_a.join(\" \")", "lang": "Ruby", "bug_code_uid": "7e0dedfa1ee4f48b42a1af9bdc4faee5", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "9247201b273e840c630506c327ebe0f7", "difficulty": 1800, "tags": ["divide and conquer", "math", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9798657718120806, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n, m = gets.split.map {|i| i.to_i}\narr = [nil] * n\nk = 1 << (n - 1)\np1 = 0\np2 = -1\nfor i in 1..n\n if m >= k\n m -= k\n arr[p2] = i\n p2 -= 1\n else\n arr[p1] = i\n p1 += 1\n end\n k >>= 1\nend\nputs arr.join ' '", "lang": "Ruby", "bug_code_uid": "46a8dee5a1b021edaff529459d5145a6", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "a409742b9f838c3049ea9bb5bf4b820b", "difficulty": 1800, "tags": ["divide and conquer", "math", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9062119366626066, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "n,m = gets.chomp.split(\" \")\nn = n.to_i;\nm = m.to_i;\ndiv = m / n; \n\nunless (m % n == 0) \n puts \"-1\";\nend\n\nmoves = 0;\n\nwhile div != 1 && m % n == 0 do \n if div % 2 == 0 then \n moves += 1;\n div /= 2;\n elsif div % 3 == 0 then \n moves += 1;\n div /= 3;\n else \n puts \"-1\";\n break;\n end\nend \n\nif (m % n == 0) then \n puts moves \nend\n", "lang": "Ruby", "bug_code_uid": "e4794d2bf05006974fccab64088d3ad1", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "4379c962b73c4e089ad0977b117956a0", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9454094292803971, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "tmp = $stdin.gets.chomp.split(' ')\nn = tmp[0].to_i\nm = tmp[1].to_i\n\nnn=[]\nmm=[]\nnc=0\nmc=0\n\nwhile n%2==0\n nc+=1\n n/=2\nend\n\nnn.push(nc)\nnc=0\nwhile n%3==0\n nc+=1\n n/=3\nend\nnn.push(nc)\n\nwhile m%2==0\n mc+=1\n m/=2\nend\n\nmm.push(mc)\nmc=0\nwhile m%3==0\n mc+=1\n m/=3\nend\nmm.push(mc)\n\n#puts nn,mm\n\na1 = (mm[0]-nn[0])\na2 = (mm[1]-nn[1])\nif a1<0 || a2<0\n puts \"-1\"\nelse\n puts a1+a2\nend", "lang": "Ruby", "bug_code_uid": "dda4d107b8bd7c408634950d05b8cc6d", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "60bd64e5dbe85546175cbb0515032021", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8212765957446808, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "x=gets.to_i\ny=gets.to_i\nif (y/x).to_i==y/x\n puts \"-1\"\nelse\n n=y/x\n res=0\n while n!=1\n if n%2==0\n n/=2\n res+=1\n elsif n%3==0\n n/=3\n res+=1\n else\n puts \"-1\"\n exit\n end\n end\n puts res\nend\n", "lang": "Ruby", "bug_code_uid": "d1af272504f07c5e88d9e06177293fbf", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "e805c965bc284d7b868ccc500b14042d", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9449152542372882, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x=gets.to_i\ny=gets.to_i\nn=y.to_f/x.to_f\nif n.to_i!=n\n puts \"-1\"\nelse\n res=0\n while n!=1\n if n%2==0\n n/=2\n res+=1\n elsif n%3==0\n n/=3\n res+=1\n else\n puts \"-1\"\n exit\n end\n end\n puts res\nend\n", "lang": "Ruby", "bug_code_uid": "fbc0ed1f799c4568b6f3df6309b8db56", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "e805c965bc284d7b868ccc500b14042d", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9847715736040609, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets\nif s.scan(/[a-z]/).size >= s.scan(/[A-Z]/).size\n\tputs s.downcase\nelse\n\tputs s.uppercase\nend", "lang": "Ruby", "bug_code_uid": "ab49cab6b7d1cbdcf162483882f71311", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "fc2ce92b0d9682bf51df4241f9b63f05", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7450980392156863, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": " a = gets.chomp\n b = a.scan[/(A-Z)/].length\n c = a.scan[/(a-z)/].length\n if b > c\n puts a.upcase!\n else\n puts a.downcase!\n \n end", "lang": "Ruby", "bug_code_uid": "ddbe0bc46a8075293e9191d40a0bbad1", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "5bde6611efb53339ebedf73312aa5672", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.44100482111139305, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "MAX_INT = 1<<31\n\nn, m = $stdin.readline.split.map(&:to_i)\nf = $stdin.readline.split.map(&:to_i)\n\nclass Array\n def diameter\n m = 0\n for i in 0...self.count\n for j in i+1...self.count\n t = (self[i]-self[j]).abs\n if t>m\n m = t\n end\n end\n end\n m\n end\n\n def complect_and_count\n self.dup.complect_and_count!\n end\n\n def complect_and_count!\n a = self.shift\n h = {a => 1}\n k = 1\n while self.size>0\n b = self.shift\n if a != b\n h[a] = k\n h[b] = 1\n k = 0\n end\n a = b\n k += 1\n end\n h[b]=k\n h\n end\nend\n\nf_uniq = f.uniq\nff = f.sort!.complect_and_count\n\n# found all with d=0\nt_s = ff.collect do |key,value|\n [key]*value\nend\n\n# p t_s\nt = t_s.dup\n\nloop do\n\n min_d = MAX_INT\n min_d_count = 0\n min_i = nil\n for i in 0...t.count\n elem = t[i]\n elem_d = elem.diameter\n if elem_d <= min_d && (elem.count>=n || elem.count>=min_d_count)\n min_d = elem_d\n min_d_count = elem.count\n min_i = i\n end\n end\n\n #puts \"min_d=#{min_d}, min_d_count=#{min_d_count}, min_i=#{min_i}\"\n\n if t[min_i].count >= n\n p t[min_i].diameter\n break\n else\n tt = []\n t.each do |t_elem|\n ttt = f_uniq - t_elem\n #p ttt\n ttt.each do |ttt_elem|\n count = ff[ttt_elem]\n tt << t_elem + ([ttt_elem]*count)\n end\n end\n t = tt\n #puts t\n end\n\nend\n#t = solve(n,f)\n#p t\n#puts t[0...n].diameter", "lang": "Ruby", "bug_code_uid": "c975736d3763089e7043e3faa38a8645", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "799b21b87614034189c3bc9e8630a9d7", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9869281045751634, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.split(' ').map(&:to_i)\na = gets.split(' ').map(&:to_i).sort\nret = 1000\nfor i in 0...a.size-n+1\n ret = [a[i+3] - a[i], ret].min\nend\nputs ret", "lang": "Ruby", "bug_code_uid": "7cc10bd1905c3ac0567398b207063ce9", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "3f48115fafbe111609cb148ff0d03442", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7351485148514851, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "students, puzzles = gets.chomp.split(/ /).map(&:to_i)\npieces = gets.chomp.split(/ /).map(&:to_i)\npieces.sort!\nans = []\nmin = -1\npuzzles.times do |i|\n break if i + students >= pieces.length\n first = pieces[i]\n last = pieces[i + students - 1]\n diff = last - first\n min = diff if min > -1\n min = [min, diff].min\n ans = pieces[i..students]\nend\nputs ans[students - 1] - ans[0]", "lang": "Ruby", "bug_code_uid": "1cc50ccb3c3a6699ad54c6d5e2d6fefa", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "0e35b2e062fdbc13f42ae77bbb1859d9", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9672727272727273, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nphone = gets.split('')\n\neight_num = 0\n\nfor digit in phone\n\teight_num += 1 if digit=='8'\nend\n\nputs [eight_num, phone.size/11].min", "lang": "Ruby", "bug_code_uid": "91000d7bb72c732b626b79d70572ae1e", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "1dadbaa3a2c55f76838959e62605fa27", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9763779527559056, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\ns = gets.chomp\nputs [s.count('8'), s.size/8].min\n", "lang": "Ruby", "bug_code_uid": "386f05c0c52bef5065c6498e7cf03551", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "0285d88206bed516b30e13bfd9c5c609", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.881578947368421, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "for i in 0..3*10**7\nend\ngets\nprint gets.split.map(&:to_i).sort.join(' ')", "lang": "Ruby", "bug_code_uid": "000ed431fde5b179a3b97a7f513ebe48", "src_uid": "29e481abfa9ad1f18e6157c9e833f16e", "apr_id": "a8f795be66abc0a4605dc5937fe1cab2", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.5625, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split(/\\s+/).map {|e| e.to_i}\nx = a[1..-1]\nprint x.sort\n", "lang": "Ruby", "bug_code_uid": "86a17b07a2578176b2836af59d2055a3", "src_uid": "29e481abfa9ad1f18e6157c9e833f16e", "apr_id": "613e3f727efaf9dddc368835be2ab229", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "p (gets.to_i+2)/3", "lang": "Ruby", "bug_code_uid": "c6bb3c5e2354aa0ab46104d0551f942d", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "2cf5061a7eda8facd63d98882dff3f4c", "difficulty": 1600, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6910112359550562, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = gets.chomp\ndigits = gets.chomp.chars.map(&:to_i)\ntable = {\n 1 => 4, 2 => 5, 3 => 6,\n 4 => 7, 5 => 8, 6 => 9,\n 8 => 0\n}\n\ninc = digits.map { |d| table[d] }.any?(&:nil?)\ndec = digits.map { |d| table.invert[d] }.any?(&:nil?)\n\nputs (inc && dec) ? \"YES\" : \"NO\"\n", "lang": "Ruby", "bug_code_uid": "9e2d704dfb8bebc43ddc4d5fb86665db", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "3697c439abb7e799eb1387be4d672297", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8290909090909091, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n = gets.chomp.to_i\nds = gets.chomp.split('')\n\nns = ['123', '456', '789', '*0#']\nxs = []\nys = []\nds.each do |d| \n for y in 0..3\n for x in 0..2\n if d == ns[y][x]\n xd = x\n yd = y\n end\n end\n end\n xs << xd\n ys << yd\nend\n\nas = []\n'1234567890'.split('').each do |d|\n f = true\n for y in 0..3\n for x in 0..2\n if d == ns[y][x]\n xn = x\n yn = y\n end\n end\n end\n for i in 0...xs.size\n f &= 0 <= xn + xs[i] \n f &= xn + xs[i] <= 2\n f &= 0 <= yn + ys[i]\n f &= ((xn + xs[i] == 1 && yn + ys[i] <= 3) || (xn + xs[i] != 1 && yn + ys[i] <= 2))\n end\n if f\n as << d\n end\nend\n\nputs as.size == 1 ? 'YES' : 'NO'\n\n", "lang": "Ruby", "bug_code_uid": "b372fa781d31c83485388978460dc57e", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "845f38d7b7eb0b3d304dfba13b9cb73e", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9745762711864406, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets\na = gets.chars.map(&:to_i)\nputs [[1,2,3], [7,0,9], [1,4,7,0], [3,6,9,0]].all?{|b| (a & b).any?} ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "e90824ab7693859dc26b10b473e96078", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "88df35d1c6f8545c57d434b2f9246711", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9950953678474115, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "numLength = gets.chomp.to_i\nnum = gets.chomp.split('').map(&:to_i)\nfound = false\n\nfor i in 0...numLength\n\tnum[i] = 10 if num[i] == 0\nend\n\n###############\nprob = false\n\nupper = num[0...numLength].map { |i| i -= 3}\n\nupper.each do |i|\n\tprob = true if i < 0\nend\n\n#puts \"Upper : #{prob}\"\nfound = true if !prob\n################\nprob = false\n\n\nleft = num[0...numLength].map { |i| i -= 1}\n\nleft.each do |i|\n\tprob = true if i < 0 || i % 3 == 0\nend\n\n#puts \"Left : #{prob}\"\nfound = true if !prob\n###############\nprob = false\n\nright = num[0...numLength].map { |i| i += 1}\n\nright.each do |i|\n\tprob = true if i < 0 || i % 3 == 1\nend\n\n#puts \"Right : #{prob}\"\nfound = true if !prob\n#################\nprob = false\n\nbelow = num[0...numLength].map { |i| i += 3 }\n\nbelow.each do |i|\n\tprob = true if (i != 11 && i > 10)\nend\n\n#puts \"below : #{prob}\"\nfound = true if !prob\n########################\n\nputs 'YES' if !found\nputs 'NO' if found", "lang": "Ruby", "bug_code_uid": "34c2e414e4e6d2089f4712fe1c9f06a3", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "63748fc0205c9a652122f5f62bb384b9", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9583333333333334, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "s=gets.chomp\nputs s[0,s.size/2].reverse.chars.zip(s[s.size/2..-1].chars).zip{|x,y|x+y.to_s}*''", "lang": "Ruby", "bug_code_uid": "d73327b96a8bed60d64dc53d3bdefe0d", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "1997588939100ebde0db08f132ba351e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9791666666666666, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "s=gets.chomp\nputs s[0,s.size/2].reverse.chars.zip(s[s.size/2..-1].chars).map{|x,y|x+y.to_s}*''", "lang": "Ruby", "bug_code_uid": "341da110d31bc7f1a34319a7d3a0d26a", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "1997588939100ebde0db08f132ba351e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9681528662420382, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "n,m = gets.split.map(&:to_i)\n\ncounter = 0\nfor i in 0..n-1\n for j in 0..m-1\n if i*i + j == n && i + j*j == m\n counter+=1\n end\n end\nend\n\nputs counter", "lang": "Ruby", "bug_code_uid": "38dd08bbf799f8048f651663a8700df4", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "35a98d7565f46d5ff1769ba5cda7ee0d", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9683257918552036, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/ruby\n# -*- coding: cp932 -*-\ninclude Mat\n\nxs = gets.split.map{ |x| x.to_i}\nnans = 0\n1000.times do |a|\n 1000.times do |b|\n next if a*a + b != xs[0]\n nans += 1 if a + b*b == sx[1]\n end\nend\nputs nans\n\n\n\n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "4142fa226e8fec7b3badeca26076bb54", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "7d10e5875a2ecfafe721b43dbf5883c2", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9887640449438202, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "# coding: utf-8\n\n# a^2 + b = n\n# a + b^2 = m\n\nn, m = gets.split.map(&:to_i)\ncount = 0\n# how many pairs of (a, b)\n# \uc2dd\uc744 \uc7ac\uc804\uac1c \ud574\ubcf4\uba74\n# b = n - a^2\n# a + b^2 = m \uc5d0 \ub300\uc785\ud558\uba74\n# for i 0..100 \uc815\ub3c4\uba74\n\nfor a in 0..(Math.sqrt(n).ceil)\n res = a + (n - a**2)**2\n # p res\n if res == m\n count += 1\n end\nend\n\nputs count", "lang": "Ruby", "bug_code_uid": "d2b474415d8f0a19baeb195f0ab48e25", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "d9978b3b3e4d7aaa842e102351929131", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6627450980392157, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "x = gets[1]\ny = x.split()\nn = y[1].to_i\nm = y[2].to_i\n\ni = 0\na = 0\nb = 0\n\n1000.times do\n 1000.times do \n\n if\n a*a + b == n && a + b*b == m\n then \n i = i + 1\n a = a + 1 \n else \n \n a = a + 1\n \n end\n end\n a = 0\n b = b + 1\nend\nputs i\n", "lang": "Ruby", "bug_code_uid": "2fec505da30905490fda6df6596da86e", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "ce09da4f3e30008a86fbb6a932c1a4a0", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9617224880382775, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n, k = gets.strip.split(' ').map(&:to_i);\na = gets.strip.split(' ').map(&:to_i);\nan = 0\nk -= 1\n(0...n).each { |e|\n ok1 = a[k + e] if k + e < n\n ok2 = a[k - e] if (k - e) >= 0\n if e == 0 && ok1 == 1\n an += 1\n next\n end\n next if ok1.nil? && ok2.nil?\n if !ok1.nil?\n next if ok1.zero?\n an += 1 if !ok1.zero?\n end\n if !ok2.nil?\n next if ok2.zero?\n an += 1 if !ok2.zero?\n end\n}\nputs an", "lang": "Ruby", "bug_code_uid": "7e93f65e7977fdd1a037e48344877065", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "402542738b66d0f4f7cca49010fc164e", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9143576826196473, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n, k = gets.strip.split(' ').map(&:to_i);\na = gets.strip.split(' ').map(&:to_i);\nan = 0\nk -= 1\n(0...n).each { |e|\n ok1 = a[k + e] if k + e < n\n ok2 = a[k - e] if (k - e) >= 0\n if e == 0 && ok1 == 1\n an += 1\n next\n end\n next if ok1.nil? && ok2.nil?\n if !ok1.nil?\n next if ok1.zero?\n end\n if !ok2.nil?\n next if ok2.zero?\n end\n an += 2\n}\nputs an", "lang": "Ruby", "bug_code_uid": "f8f5e0776bbf7979216e4654f14c8eb6", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "46fe15955d4affcb715d5dbcf45215f6", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7887763055339049, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "input = gets.chars\nbandidos = gets.split(\" \")\n\n\ncidades = input[0].to_i\nlimark = input[2].to_i\nele_pega = []\npegos = 0\ntodas_distancias = []\n\n\nfor i in 0..cidades-1\n\tif bandidos[i] == \"1\"\n\t\tdistancia = (1+i) - limark\n\t\tdistancia_final = distancia.abs\n\ttodas_distancias << distancia_final\t\n\tend\nend\nfor a in 0..todas_distancias.size-1\n\tnext if todas_distancias[a] == 0\n\tif todas_distancias[a] > (1 - limark).abs || todas_distancias[a] > (bandidos.size + 1 - limark).abs\n\t\tpegos += 1\n\tend\n\tif ele_pega.include? todas_distancias[a]\n\t\tpegos += 2\n\tend\n\tele_pega<< todas_distancias[a]\nend\nif todas_distancias.include? 0\n\tpegos += 1\nend\nputs pegos", "lang": "Ruby", "bug_code_uid": "97aab9ddcc9561cedc7d88f06b037123", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "da96736fab3d1af394487b81ec6e1cd0", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.22189349112426035, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n, a = gets.split.map(&:to_i)\nb = gets.split.map(&:to_i)\na -= 1\nx = 0\nans = 0\nif a <= n - 1 - a\n x = a\n ans = b[(x + a + 1)..-1].inject(:+).to_i\nelse\n x = n - 1 - a\n ans = b[0...(x - a)].inject(:+).to_i\nend\nc = b[(x - a)..(x + a)]\nd = a * 2\n\nx.times{|i|\n if c[i] == 1 && c[d - i] == 1\n ans += 2\n end\n }\np ans + c[x]", "lang": "Ruby", "bug_code_uid": "669e6ac927fec77d7d545d208527fe3d", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "d8c093dd07068d024049d32fb000ec0d", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.0841683366733467, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "r, b, y, g = (0..3).to_a\ns = gets.strip\nk = Array.new(4, 0)\ni = 0\nn = s.length\nwhile i < n\n c = s[i]\n d = s[i + 1]\n e = s[i + 2]\n f = s[i + 3]\n if i + 3 < n\n k[r] += 1 if c != 'R' && d != 'R' && e != 'R' && f != 'R' && [c, d, e, f].include?( '!' )\n k[b] += 1 if c != 'B' && d != 'B' && e != 'B' && f != 'B' && [c, d, e, f].include?( '!' )\n k[y] += 1 if c != 'Y' && d != 'Y' && e != 'Y' && f != 'Y' && [c, d, e, f].include?( '!' )\n k[g] += 1 if c != 'G' && d != 'G' && e != 'G' && f != 'G' && [c, d, e, f].include?( '!' )\n else\n if c != 'R' && d != 'R' && e != 'R' && f != 'R' && [c, d, e, f].include?( '!' )\n k[r] += 1\n elsif c != 'B' && d != 'B' && e != 'B' && f != 'B' && [c, d, e, f].include?( '!' )\n k[b] += 1\n elsif c != 'Y' && d != 'Y' && e != 'Y' && f != 'Y' && [c, d, e, f].include?( '!' )\n k[y] += 1\n elsif c != 'G' && d != 'G' && e != 'G' && f != 'G' && [c, d, e, f].include?( '!' )\n k[g] += 1\n end\n end\n i += 4\nend\nputs k.join(\" \")\n", "lang": "Ruby", "bug_code_uid": "d2c9100ed84c275b297ff2f10af7ed24", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "752733c165ab925ac7d46d599637ba0e", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9753521126760564, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a = gets.chomp.to_i\nb = gets.chomp.to_s\n\n# check if valid\nCOLORS = ['C', 'M', 'Y']\n$valid = true\ndef valids(b)\n\tprev = nil\n\tb.split(\"\").each do |char|\n\t\tif !(char == '?' || char != prev)\n\t\t\treturn false\n\t\tend\n\t\tprev = char\n\tend\n\treturn true\nend\nll = b.length\ndef permute(b, cols, i, str, out)\n\tif i == b.length \n\t\tout.push(str)\n\telsif out.length > 3\n\t\treturn out\n\telse\n\t\tprevc = nil\n\t\tprevc = str[i-1] if i > 0\n\t\tnextc = nil\n\t\twhile str[i] != '?' && i < b.length\n\t\t\tprevc = str[i]\n\t\t\ti += 1\n\t\tend\n\t\tnextc = b[i+1]\n\t\tif i < b.length\n\t\t\tcola = cols - [prevc, nextc]\n\t\t\tcola.each do |col|\n\t\t\t\tstr[i] = col\n\t\t\t\tout = permute(b, cols, i+1, str.dup, out)\n\t\t\t\tstr[i] = '?'\n\t\t\tend\n\t\telse\n\t\t\tout.push(str)\n\t\tend\n\tend\n\treturn out\nend\nif valids(b)\n\tout = permute(b, COLORS, 0, b.dup, [])\n\tif out.length == 2\n\t\tputs \"Yes\"\n\telse\n\t\tputs \"No\"\n\tend\n\t# puts out\nelse\n\tputs \"No\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "b0797037a558b36d70350f19cdeec4e3", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "cfbdeadf660f58770daab607a61ff16f", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9504950495049505, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p gets.chomp.split(/[AEIOUY]/).map(&:size).max+1", "lang": "Ruby", "bug_code_uid": "801f0fd158710ab1c09f4dbb6eb9679a", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "0956855549982f47a95fb7dd3d739440", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7571428571428571, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "s = gets.strip\nmaxl = 1\nlen = 1\nvowels = ['A', 'E', 'I', 'O', 'U', 'Y']\n0.upto(s.length - 1) do |i|\n if vowels.include?(s[i])\n maxl = [maxl, len].max\n len = 1\n else\n len += 1\n end\nend\n\nprintf(\"%d\\n\", maxl)\n", "lang": "Ruby", "bug_code_uid": "60d27dd8236a9c42431df11c302d83eb", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "1e7e555e8187e14f6c2f4c99e3bf23cb", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9612403100775194, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.strip\nputs s.split(/[AEIOUY]/).map{|x| x.size+1}.max\n", "lang": "Ruby", "bug_code_uid": "8681a16c13b758b652fc6248bc09177b", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "3e66654f9fa2a0d64a07b16684b39c6f", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9905362776025236, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def calc(m, k, filters)\n return 0 if k >= m\n\n socket_count = k - 1\n filter_count = 1\n\n filters.sort_by! { |x| -x }\n filters.each do |item|\n return filter_count if item + socket_count >= m\n\n socket_count += item - 1\n filter_count += 1\n end\n\n return -1\nend\n\nif $0 == __FILE__\n ARGF.readlines.each_slice(2) do |line1, line2|\n n, m, k = line1.chomp.split.map {|x| x.to_i }\n filters = lien2.chomp.split.map {|x| x.to_i }\n calc(m, k, filters)\n end\nend\n", "lang": "Ruby", "bug_code_uid": "3b5a3df95c6f42206196779e6a914aca", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "4a3e30e3bed2000d3626a078308a9c78", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.95, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a=gets.chomp.split(\" \")\n0.upto(2) {|i| a[i]=a[i].to_i}\nn=a[0]\nm=a[1]\nk=a[2]\nb=gets.chomp.split(\" \")\n0.upto(n-1) {|i| b[i]=b[i].to_i}\nb.sort!\nb.reverse!\n\nans=0\nsock=k\n\nloop do\n if sock>=m\n sock=-100\n break\n end\n \n sock=sock+b[ans]-1\n ans+=1\n break if ans==n\n end\n\n\n\n\nif sock==-100\nputs \"#{ans}\"\nelse\nputs \"-1\"\nend\n\n \n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "4696a32caf180b1230ad4fc9913e728d", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "433d3468968c376a2c772cc49244007f", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.726962457337884, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "n,m,k=gets.split.map(&:to_i)\na=gets.split.map(&:to_i).sort {|i,j| j<=>i}\n\nif k>=m\n puts 0\n exit\nelse\n i=0\n while k>0\n m-=a[i]\n i+=1\n k-=1\n if m<=k\n puts i\n exit\n end\n end\n while i= 1\n n -= 1\n cnt += 1\n else\n break\n end\n if n >= 2\n n -= 2\n cnt += 1\n else\n break\n end\nend\nputs cnt\n", "lang": "Ruby", "bug_code_uid": "b5a7bc5910b00fc968259cf91c3557bc", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "6ffc6a0ae70d754eed5faabe0805c42a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9828431372549019, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x,y = gets.split.map(&:to_i)\nprime = []\nk = (y**0.5).to_i\n\na = Array.new(k+1,1)\ni = 2\nwhile i <= k\n if a[i] == 1\n prime << i\n (k/i).times do |j|\n a[i*j] = 0\n end\n end\n i += 1\nend\nisprime = false\nwhile !isprime && x < y\n isprime = true\n prime.length.times do |i|\n isprime = false if y % prime[i] == 0\n end\n if isprime\n ans = y\n end\n y -= 1\nend\nans = -1 if !isprime\nputs ans", "lang": "Ruby", "bug_code_uid": "10557863ea75da68a257cc40dfeb23ed", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "f4c0ff1505bc75e065c9ae938b31300d", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.31216931216931215, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "require 'prime'\np, y=gets.split.map &:to_i\ny.downto(p+1){|x|\n if x.prime?\n puts x\n exit\n end\n}\nputs -1\n", "lang": "Ruby", "bug_code_uid": "ad4dc188eb976da493ad1c2fbfc47a52", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "41ac5690d36f442792ac1abc21f3a5e9", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9767610748002905, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "ttfs = gets.chomp\nttfs = ttfs.split\ntwo = ttfs[0].to_i\nthree = ttfs[1].to_i\nfive = ttfs[2].to_i\nsix = ttfs[3].to_i\n\nthmax = 0\nif two <= five && two <= six\n\tthmax = two\nelsif five <= two && five <= six\n\tthmax = five\nelsif six <= two && six <= five\n\tthmax = six\nend\n\nif three <= two\n\ttwmax = three\nelse\n\ttwmax = two\nend\n\n# 256 is greater\nif two == 0 || three == 0\n\tprint 0\nelsif five == 0 || six == 0\n\tif three <= two\n\t\tprint 32 * three\n\telse\n\t\tprint 32 * two\n\tend\nelsif thmax >= twmax && thmax >= twmax \n\ttwofivesix = thmax * 256\n\tttfs[0] = ttfs[0].to_i - thmax\n\tttfs[2] = ttfs[2].to_i - thmax\n\tttfs[3] = ttfs[3].to_i - thmax\n\tif ttfs[1].to_i <= ttfs[0].to_i\n\t\ttwmax = ttfs[1].to_i\n\telse\n\t\ttwmax = ttfs[0].to_i\n\tend\n\tthreetwo = twmax * 32\n\tprint twofivesix + threetwo\nelse\n\tif thmax == two \n\t\tif six <= five\n\t\t\tthmax = six\n\t\telse\n\t\t\tthmax = five\n\t\tend\n\t\ttwofivesix = thmax * 256\n\t\tttfs[0] = ttfs[0].to_i - thmax\n\t\tttfs[2] = ttfs[2].to_i - thmax\n\t\tttfs[3] = ttfs[3].to_i - thmax\n\t\tif ttfs[1].to_i <= ttfs[0].to_i\n\t\t\ttwmax = ttfs[1].to_i\n\t\telse\n\t\t\ttwmax = ttfs[0].to_i\n\t\tend\n\t\tthreetwo = twmax * 32\n\telse\n\t\ttwofivesix = thmax * 256\n\t\tttfs[0] = ttfs[0].to_i - thmax\n\t\tttfs[2] = ttfs[2].to_i - thmax\n\t\tttfs[3] = ttfs[3].to_i - thmax\n\t\tif ttfs[1].to_i <= ttfs[0].to_i\n\t\t\ttwmax = ttfs[1].to_i\n\t\telse\n\t\t\ttwmax = ttfs[0].to_i\n\t\tend\n\t\tthreetwo = twmax * 32\n\tend\n\tprint twofivesix + threetwo\nend", "lang": "Ruby", "bug_code_uid": "7eddbad7b5ac7589e484d2009186d27a", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "13b48b8f27b5e99292eaa7db81dbd20f", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7441860465116279, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "# a is 2\n# b is 3\n# c is 5\n# d is 6\n\na = gets.to_i\nb = gets.to_i\nc = gets.to_i\nd = gets.to_i\n\nk256 = [a, c, d].min\na -= k256\nk32 = [a, b].min\nputs k256*256 + k32*32", "lang": "Ruby", "bug_code_uid": "8dc4e70442a7de49aec83237c0fd7d96", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "f45a36b010a198e12afc9f971c194a3f", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9613259668508287, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "a, b, c, d = gets.split.map &:to_i\n\nx = [a,c,d].min \ny = [a,b].min\n\n\nputs 256*x + 32*y", "lang": "Ruby", "bug_code_uid": "4afcf39a7ecf5898e19fda3d73f2ab65", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "0aaca766038428d244dee757a6a6c827", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9703872437357631, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "require 'set'\nparse_int = lambda{ gets.split.map{|el| el.to_i} }\nsign = lambda {|el| (el>0?1:0)-(el<0?1:0)}\n\nd2,d3,d5,d6 = parse_int.call\n\nans = 256*[d5,d6].min\nd2 -= [d5,d6].min\n\nans += 32*[d2,d3].min\n\n\nputs ans\n\n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "529a029fb85bf5630d970e75ad141923", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "d2e81d2274986c5a0d1d7112f4c5f4fc", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9752066115702479, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "if gets.chomp =~ /1{7}|0{7}/\n puts \"YES\"\nelse\n puts \"NO\"\n", "lang": "Ruby", "bug_code_uid": "b3d11f7d36ac0105e3e27c1a9c295596", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "d66ca6d7c9512478987b380721a5e0b4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.784, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "a.gets\nb = a.scan(/0000000/).count\nc = a.scan(/1111111/).count\n\nif b || c > 0\nputs \"YES\"\nelse\nputs \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "ab60c03cc17739f7c42bc2a98c63b526", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "f784d900792f5aa8a4537af41a1aefdc", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9696969696969697, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def function\na=gets.chomp.to_i\na+=1\nc=1\nwhile !a.to_s.include?('8')\nc+=1\na+=1\nend\nc\nend\nfunction", "lang": "Ruby", "bug_code_uid": "d53645d6ad0eaebe91931c715ee27ad2", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "4f6256b9c5a166c837818f7068a436a4", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9795918367346939, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n=gets.to_i\nx=n\na=[]\n10.times do\n\ta<<(x+1).to_s.split('')\n\tx+=1\nend\nans=nil\nfor x in 0..9\n\tif a[x].include?'8'\n\t\tans=x+1\n\t\tbreak\n\tend\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "a3f876cf958a1e45d08db46a70c1f862", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "2c82df704255e55eced1013250afa6ee", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9058823529411765, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "require 'pp'\n\nn = STDIN.gets.chomp.to_i\n\nans = 0\nwhile true\n n.to_s.split(//).each do |e|\n if e == '8'\n puts ans\n exit(0)\n end\n end\n n+=1\n ans+=1\nend\n", "lang": "Ruby", "bug_code_uid": "b84a8922465ea1fe9f9d01a1af2c5c91", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "c2e3f84880963f6302b050961ed4f8bf", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9813664596273292, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, b = [gets.chomp.to_i, -1]\nuntil ((a + (b += 1)).to_s.include?('8'))\nend\nputs b", "lang": "Ruby", "bug_code_uid": "88db6ccf05c34020c48aae97c4d8a52b", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "262a24718d96c58566c4c0cc2a251848", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9481481481481482, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nmoves = gets.strip.gsub(/(UR|RU)/, 'D')\nputs moves", "lang": "Ruby", "bug_code_uid": "9688a466fd1a52e9d5b2969531d71c2c", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "acb8c15d82edf710352947ab844f8c37", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9565217391304348, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nputs ((Math.sqrt(n).floor + 1) * (Math.sqrt(n).floor) / 2 == n) ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "d9ef7bd0124fef727523fdc4869f372d", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "9369e7ebed0e869ff3405deaffa1a142", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.918918918918919, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "a=[]\nfor i in 1..40\n a.push i*(i+1)/2\nend\nb=gets.to_i\nif a.index(b)!=nil then\np \"YES\"\nelse\np \"NO\"\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "72c678e426273a28c55bc8082912a246", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "e86455026fcd34804758e77d22524dc2", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9976359338061466, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def color_to_bitmask(color)\n case color\n when 'B'\n bitmask = 0b00001\n when 'Y'\n bitmask = 0b00010\n when 'W'\n bitmask = 0b00100\n when 'G'\n bitmask = 0b01000\n when 'R'\n bitmask = 0b10000\n end\nend\n\ndef card_strings_to_card_bitmasks(card_strings)\n card_strings.map {\n |c|\n color = c[0]\n value = c[1].to_i\n \n color_to_bitmask(color) * 0b100000 + 2 ** (value - 1)\n }\nend\n\ndef check_ops_for_pair(ops, a, b)\n if a != b \n (a ^ b) & ops > 0\n else true\n end\nend\n\ndef combinations(i1)\n (0...(i1.size-1)).inject([]) {|pairs,x| pairs += ((x+1)...i1.size).map {|y| [i1[x],i1[y]]}}\nend\n\ndef check_ops_for_combinations(ops, combinations)\n combinations.inject { \n |result, combination|\n a, b = combination\n check = check_ops_for_pair(ops, a, b)\n if not check\n break(false) \n end\n check\n }\nend\n\ndef count_ones(n)\n n.to_s(2).count('1')\nend\n\nstrings = STDIN.read.split(\"\\n\")[1].split(\" \")\n\nbitmasks = card_strings_to_card_bitmasks(strings)\n\nbitmasks_combinations = combinations(bitmasks)\n\nbest_solution = 10\n\nfor ops in 0..2 ** 10 - 1\n if check_ops_for_combinations(ops, bitmasks_combinations)\n ones = count_ones(ops)\n if ones < best_solution\n best_solution = ones\n end\n end\nend\n\nputs best_solution\n", "lang": "Ruby", "bug_code_uid": "da6ae100f75bc6de89c971cf8e266d94", "src_uid": "3b12863997b377b47bae43566ec1a63b", "apr_id": "8acc519ee7712eda60c55052b06ca552", "difficulty": 1700, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5740551583248212, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "s = gets\nans =nil\nans_count =0\nm = {}\n0.upto s.length do |i|\n 1.upto s.length-i do |j|\n ss = s[i, j]\n b = false\n ss.each_char {|c| b ||= (c!='7' && c!='4')}\n if !b do\n count=m[ss]+1\n m[ss] = count\n if count > ans_count) do\n ans = ss\n elsif count== ans_count do\n ans = ss if ans==nil\n ans = min ans, ss\n end\n end\n end\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "bdb0ac70c7caf5fa5270a65d9a3e0ff7", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "64a194d84898597081d29c3b507d1bd9", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9815712900096993, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "require 'jcode'\ns = gets\nans = -1\nans_count =0\nm = {}\n0.upto s.length do |i|\n 1.upto s.length-i do |j|\n ss = s[i, j]\n b = false\n ss.each_char {|c| b ||= (c!='7' && c!='4')}\n if !b \n count= (m[ss]== nil ? 0 : m[ss] )+1\n m[ss] = count \n if count > ans_count\n ans,ans_count=ss,count\n else count== ans_count \n ans = ss if ans==-1\n ans = ss if ss < ans\n end\n end\n end\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "2ad1944562bc55df023f1ae5169cba4f", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "64a194d84898597081d29c3b507d1bd9", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6818181818181818, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "s = gets\nv,f=-1,-1\ns.each_char {|c| v,f= v+(c==7? 1:0) , f+(c==7? 1:0)}\nputs (max v,f)+1", "lang": "Ruby", "bug_code_uid": "0bbc076ae61247ffcf503de34657f257", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "64a194d84898597081d29c3b507d1bd9", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9142857142857143, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "s = gets\nv,f,a=s.count'7',s.count'4',-1\na=4 if f>0\na=7 if v>f\nputs a", "lang": "Ruby", "bug_code_uid": "f045aa297b3d19f8244f9eeec8e0903d", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "64a194d84898597081d29c3b507d1bd9", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.26936026936026936, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "s = gets\nr = \"\"\nm = 0\nfor i in 0...s.length\n\tfor j in i...s.length\n\t\tt = s[i, j]\n\t\tnext if t =~ /[^47]/ or t.size < 1\n\t\tr = t if r.size < 1\n\t\tn = 0\n\t\tscan(t) { n += 1 }\n\t\t\n\tend\nend\nputs r == \"\" ? -1 : r\n\n", "lang": "Ruby", "bug_code_uid": "2b47abb12a228f53f31a2424a51a8a33", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "880795a12c0809b34d45db16e96674ef", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9808917197452229, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets.to_i.times{\n puts [1, 4, 5, 8, 11].include?(gets.to_i) ? \"NO\" : \"YES\"\n}", "lang": "Ruby", "bug_code_uid": "4366fbf2c17a9884015183e9b1ff16a2", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "78f7fcf5b2a0d38ac3feeaee606f5504", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9568845618915159, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = Array.new\nn = $stdin.gets.to_i\nn.times do\n line = $stdin.gets\n input << line.to_i\nend\n \ninput.each do |a|\n if a == 0\n puts 'NO'\n elsif a%3 == 0\n puts 'YES'\n elsif a%7 == 0\n puts 'YES'\n elsif a%21 == 0\n puts 'YES'\n elsif a%3%7 == 0\n puts 'YES'\n elsif a%7%3 == 0\n puts 'YES' \n else\n puts 'NO'\n end\nend\n\n", "lang": "Ruby", "bug_code_uid": "a9ab40600a746b07b3913caa090ecf05", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "56a31662914909a4cac4e68bad819d43", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8775790921595599, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\narr = []\nfor i in (0..n-1)\n\tarr << gets.chomp.to_i\nend\n\nfor i in (0..n-1)\n\tif arr[i]%3 == 0 || arr[i]%7 == 0\n\t\tputs \"YES\"\n\telse\n\t\tx = arr[i]\n\t\twhile x >= 0\n\t\t\tif x - 7 >= 0\n\t\t\t\tx -= 7\n\t\t\telsif x - 3 >= 0\n\t\t\t\tx -= 3\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\tif x == 0\n\t\t\tputs \"YES\"\n\t\telse\n\t\t\tputs \"NO\"\n\t\tend\n\tend\nend", "lang": "Ruby", "bug_code_uid": "b33e7636afd2410fc024e413f70a72c7", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "8b6aac0012c0a4cf391590c9840205e9", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5551020408163265, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "gets.to_i.times.map{|x| gets.to_i}.each{|x| puts (x%3 == 0 || x%7 == 0)? \"YES\" : \"NO\" }", "lang": "Ruby", "bug_code_uid": "df5efd675df3b392caf83e65b9e9905a", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "252e1ff2a0c1be80221ef0e82c891a3a", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5297670405522001, "equal_cnt": 23, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 23, "bug_source_code": "p, k = gets.chomp.split\np = p.to_i\nk = k.to_i\n\nb = [1]\nl = [0]\nr = [k]\nwhile true\n bb = b.last\n nb = -k*bb\n b.push(nb)\n if nb > 0\n r.push(r.last + (k-1)*nb)\n l.push(l.last)\n else\n l.push(l.last + (k-1)*nb)\n r.push(r.last)\n end\n break if p < r.last\nend\n\nans = []\nwhile b.length > 1\n l.pop\n r.pop\n bb = b.pop\n le = l.last\n ri = r.last\n i = 0\n while !(le <= p && p < ri)\n p -= bb\n i += 1\n end\n ans.push(i)\nend\nans.push(p)\nans.reverse!\nputs(ans.length)\nputs(ans.join(\" \"))\n", "lang": "Ruby", "bug_code_uid": "8da0e7a9d00c1aa831ad219caa485f13", "src_uid": "f4dbaa8deb2bd5c054fe34bb83bc6cd5", "apr_id": "9cbb4ad008a58da50553aa4bb4979594", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8533333333333334, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p 2**((s=gets).size-2)*s.to_i(2)", "lang": "Ruby", "bug_code_uid": "2539b28f1b689bb859adcd10a4988426", "src_uid": "89b51a31e00424edd1385f2120028b9d", "apr_id": "69ed3eac7e61fff3233e7c916bc86f0d", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6343283582089553, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "k, b, n, t = gets.split.map(&:to_i)\nbg=1\nn.times {bg=bg*k+b}\nsec=0\nwhile t ss\n# sz = ary.size\n# while i= sz\n# sum = ary[j]\n# end\n# end\n# end\n\ndef poss?(ary, ss)\n i=0\n sum = 0\n sz = ary.size\n while i ss\n return false\n end\n i += 1\n end\n sum == 0\nend\n\n1.upto(lim).each do |ss|\n if poss?(ary, ss)\n # puts ss\n puts \"YES\"\n exit 0\n end\nend\n\nputs \"NO\"", "lang": "Ruby", "bug_code_uid": "fa8dffca57c6d165261b992ded397bf7", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "cab03efccdb718f85a7544d7e9bcf14b", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9973454683352294, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\n\ndata = gets.split\nx = data[0].to_i\ny = data[1].to_i\n\ncode = [\"111111101010101111100101001111111\", \"100000100000000001010110001000001\", \"101110100110110000011010001011101\", \"101110101011001001111101001011101\", \"101110101100011000111100101011101\", \"100000101010101011010000101000001\", \"111111101010101010101010101111111\", \"000000001111101111100111100000000\", \"100010111100100001011110111111001\", \"110111001111111100100001000101100\", \"011100111010000101000111010001010\", \"011110000110001111110101100000011\", \"111111111111111000111001001011000\", \"111000010111010011010011010100100\", \"101010100010110010110101010000010\", \"101100000101010001111101000000000\", \"000010100011001101000111101011010\", \"101001001111101111000101010001110\", \"101101111111000100100001110001000\", \"000010011000100110000011010000010\", \"001101101001101110010010011011000\", \"011101011010001000111101010100110\", \"111010100110011101001101000001110\", \"110001010010101111000101111111000\", \"001000111011100001010110111110000\", \"000000001110010110100010100010110\", \"111111101000101111000110101011010\", \"100000100111010101111100100011011\", \"101110101001010000101000111111000\", \"101110100011010010010111111011010\", \"101110100100011011110110101110000\", \"100000100110011001111100111100000\", \"111111101101000101001101110010001\"]\nputs code[x][y] - 48\n\n\n", "lang": "Ruby", "bug_code_uid": "b6d467387d8ab7d9ff52dda2450386d7", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "b981a92c24c080df800cda56c4c2fdff", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7019354838709677, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "require 'prime'\n\ndef f(a,b)\n c=0\n x = Prime.prime_division(a)\n while b>0 do\n tmp = b\n x.each do |ar|\n tmp = [tmp, b%ar[0]].min\n end\n c += tmp\n b -= tmp\n x.each do |ar|\n while b%ar[0]==0\n b/=ar[0]\n ar[1]-=1\n x.delete(ar) if ar[1]==0\n end\n end\n end\n return c\nend", "lang": "Ruby", "bug_code_uid": "7f6bdc50c00e326e96c342cda834cb07", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "f775e272b8516409f56014e0d40213b1", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6479532163742691, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "require 'prime'\n\ndef f(a,b)\n c=0\n x = Prime.prime_division(a)\n while b>0 do\n tmp = b\n x.each do |ar|\n tmp = [tmp, b%ar[0]].min\n end\n c += tmp\n b -= tmp\n x.each do |ar|\n while b%ar[0]==0\n b/=ar[0]\n ar[1]-=1\n x.delete(ar) if ar[1]==0\n end\n end\n end\n return c\nend\n\ninput = gets.chomp\na = input.split(\" \")[0]\nb = input.split(\" \")[1]\nputs f(a,b)", "lang": "Ruby", "bug_code_uid": "ec1d17014971387fad237ec5de4bbc5f", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "f775e272b8516409f56014e0d40213b1", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6404624277456648, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "require 'prime'\n\ndef f(a,b)\n c=0\n x = Prime.prime_division(a)\n while b>0 do\n tmp = b\n x.each do |ar|\n tmp = [tmp, b%ar[0]].min\n end\n c += tmp\n b -= tmp\n x.each do |ar|\n while b%ar[0]==0\n b/=ar[0]\n ar[1]-=1\n x.delete(ar) if ar[1]==0\n end\n end\n end\n return c\nend\n\ninput = gets.chomp\na = input.split(\" \")[0].to_i\nb = input.split(\" \")[1].to_i\nputs f(a,b)", "lang": "Ruby", "bug_code_uid": "17135e5d2a0f687b7f1eea89c2b0dc71", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "f775e272b8516409f56014e0d40213b1", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9375, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a, b = $stdin.gets.split.map {|x| x.to_i}\n\nb = b.to_s\n\nwhile true\n if a.to_s.gsub(/[12356890]/, \"\") == b\n p a\n break\n end\n a += 1\nend\n\n", "lang": "Ruby", "bug_code_uid": "83b5e6cccbf0955241c23a0b91ce31d9", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "9c1913a3bee64e4f3876468fbd3a1cc1", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.4723756906077348, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "def lucky_n?(str)\n str.chars.all?{|i| i == \"4\" || i == \"7\" }\nend\n\ndef lucky_s?(str,n)\n str = str.chars.to_a\n str[0,n/2].map(&:to_i).inject(:+) == str[(n/2)..-1].map(&:to_i).inject(:+)\nend\n\ndef lucky?(n,str)\n lucky_n?(str) && lucky_s?(str,n)\nend\n\ndef mask_of(str)\n str.chars.select{|i| i == \"4\" || i == \"7\" }.join\nend\n\ndef solve(a,mask)\n i = a.to_i\n mask = mask.to_s\n while mask != mask_of(i.to_s)\n i += 1\n end\n i\nend\n\na, mask = STDIN.gets.chomp.split(/ /)\np solve(a, mask)\n", "lang": "Ruby", "bug_code_uid": "e1c4f12c0760894d2d2c6902ed569285", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "183adfdfd2cddaf6a0af7fd42b5d2ed1", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9916247906197655, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "gets\narr = gets.chomp.split(\" \").map(&:to_i)\n\nmax_arr = []\n(1...arr.count).each do |i|\nmax_arr << arr[i] - arr[i-1]\nend\ninitial_max = max_arr.max\nmax_arr = []\n(1...arr.count-1).each do |i|\n max_arr << arr[i+1] - arr[i-1]\nend\na = max_arr.any?{|x| x < initial_max}\nputs a ? initial_max : max_arr.max", "lang": "Ruby", "bug_code_uid": "a337dc2b5a6ad5de5063d6f0a30f7cd5", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "aa8cc567b5f3c9222639916c607cd601", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9706498951781971, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\ns = gets.chomp.to_i\nar = gets.chomp.split.map {|x| x.to_i}\nmin = []\n\nunless ar.size != s \n\t(0...ar.size).each do |n|\n\t\tif ar[n] != ar.first and ar[n] != ar.last\n\t\t\tcomb = (ar - [ar[n]]) \n\t\t\tm = []\n\t\t\t(1...comb.size).each do |c|\n\t\t\t\tif comb[c] != comb.first and comb[c-1] != comb.first\n\t\t\t\t\t#puts \"#{comb[c]} - #{comb[c-1]} = #{(comb[c] - comb[c-1])}\" \n\t\t\t\t\tm << (comb[c] - comb[c-1])\n\t\t\t\tend\n\t\t\tend\n\t\t\tmin << m.max\n\t\tend\n\t\t#if ar[n] == ar.first then puts ar.first end\n\tend \n\tp min.min\nend\n\n", "lang": "Ruby", "bug_code_uid": "f344e0309187c6458088a459140c3cf8", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "4ba6de3b7ae06a07346b4ad7394e613e", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8900523560209425, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "# 496A\n\nn = gets.to_i\na = gets.chomp.split.map &:to_i\nmin, max = 1_000, 0\nmin_ind = 0\n(n - 1).times do |i|\n diff = a[i + 1] - a[i]\n if diff < min && i < n - 2\n min = diff\n min_ind = i\n elsif diff > max\n max = diff\n end\nend\nputs [max, a[min_ind + 2] - a[min_ind]].max", "lang": "Ruby", "bug_code_uid": "4ec8afad60e3dc5a2e8cd69c541c0d57", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "1c8950486e5f29d55e19a13bfed5e71f", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.813953488372093, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "t=[*$<]*'';puts(t==t.reverse ? :YES:'NO')", "lang": "Ruby", "bug_code_uid": "5790981bd2a86f0130381b516ddeb44c", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "2c1ac42cf4233e5052b2cca569d9500a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "t=[*$<]*'';puts(t==t.reverse ?:YES:'NO')", "lang": "Ruby", "bug_code_uid": "c25c0ef5db93522e646970525d1ff639", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "2c1ac42cf4233e5052b2cca569d9500a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9195402298850575, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "t=\"\n\"+$<.read;puts t==t.reverse ?\"YES\":\"NO\"", "lang": "Ruby", "bug_code_uid": "eddb966690ac64f4f44ffc5c7c888140", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "2c1ac42cf4233e5052b2cca569d9500a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9260042283298098, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "buttons=[]\nbuttons[0]=gets.chomp\nbuttons[1]=gets.chomp\nbuttons[2]=gets.chomp\n(0..2).each{|i|\n (0..2).each{|j|\n if buttons[i][j].chr=='X' && buttons[2-i][2-j].chr!='X' then print(\"NO\\n\");exit end\n }\n}\nprint(buttons[1][1].chr=='X' ? 'NO':'YES',\"\\n\")\n", "lang": "Ruby", "bug_code_uid": "c25bf6572c51a74620d04d700a667ca9", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "d1b97206014743cdb620b04afbcc050d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9222750963063675, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "s = gets.chomp\nt = gets.chomp\ndivs = []\ndivt = []\n(s.length-1).times do |i|\n divs.push(i) if s[i] != s[i+1]\nend\ndivs.push(s.length-1)\n(t.length-1).times do |i|\n divt.push(i) if t[i] != t[i+1]\nend\ndivt.push(t.length-1)\n\nans = []\n\nif s[0] == t[0]\n ps, pt = nil, nil\n if divs.length == 2 && divt.length >= 4\n ps = divs[0]+1\n pt = divt[1]+1\n elsif divt.length == 2 && divs.length >= 4\n ps = divs[1]+1\n pt = divt[0]+1\n end\n if ps\n ans.push([ps, pt])\n s, t = [\n t[0, pt] + s[ps, s.length],\n s[0, ps] + t[pt, t.length]\n ]\n divs = []\n divt = []\n (s.length-1).times do |i|\n divs.push(i) if s[i] != s[i+1]\n end\n divs.push(s.length-1)\n (t.length-1).times do |i|\n divt.push(i) if t[i] != t[i+1]\n end\n divt.push(t.length-1)\n end\nend\n\n\nif divs.length == 1 && divt.length == 1\n puts 0\n exit\nend\n\nif s[0] == t[0]\n if divs.length < divt.length\n ns = 0\n nt = (divt.length - divs.length)/2\n nt += 1 if nt % 2 == 0\n else\n nt = 0\n ns = (divs.length - divt.length)/2\n ns += 1 if ns % 2 == 0\n end\nelse\n if divs.length < divt.length\n ns = 1\n nt = (divt.length - 1 - divs.length)/2 + 1\n nt += 1 if nt % 2 == 0\n else\n nt = 1\n ns = (divs.length - 1 - divt.length)/2 + 1\n ns += 1 if ns % 2 == 0\n end\nend\n\nps = ns == 0 ? 0 : divs[ns-1]+1\npt = nt == 0 ? 0 : divt[nt-1]+1\nans.push([ps, pt])\ns, t = [\n t[0, pt] + s[ps, s.length],\n s[0, ps] + t[pt, t.length]\n]\n\ndivs = []\ndivt = []\n(s.length-1).times do |i|\n divs.push(i) if s[i] != s[i+1]\nend\ndivs.push(s.length-1)\n(t.length-1).times do |i|\n divt.push(i) if t[i] != t[i+1]\nend\ndivt.push(t.length-1)\n\nmax = [divs.length, divt.length].max\n[max-2, max-1].each do |i|\n next if i < 0\n divs[i] ||= divs[-1]\n divt[i] ||= divt[-1]\nend\n\nps, pt = 0, 0\n(max-1).times do |i|\n ps += divs[i] - (i > 0 ? divs[i-1] : -1)\n pt += divt[i] - (i > 0 ? divt[i-1] : -1)\n ans.push([ps, pt])\n ps, pt = pt, ps\nend\n\nputs ans.length\nans.each do |arr|\n puts arr.join(' ')\nend", "lang": "Ruby", "bug_code_uid": "3e9ef075b2ea49314d43793ad21c9a2a", "src_uid": "4a50c4147becea13946272230f3dde6d", "apr_id": "887a650b4b82ecd3cabe533e20488f57", "difficulty": 2800, "tags": ["constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9452054794520548, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n,*a=$<.read.split.map &:to_i\ns=a.reduce :+\nputs (1<0}.map{|j|a[j]}.reduce :+;t*2==n} ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "3fd32e885b73d6bf29a51cb2db4bda13", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "efdcf36957d8a6c32fb1159df85ae8d6", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9797297297297297, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,*a=$<.read.split.map &:to_i\ns=a.reduce :+\nputs (1<0}.map{|j|a[j]}.reduce 0,:+;t%360==0} ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "d1bc5004661719c54fb1675739f1d789", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "efdcf36957d8a6c32fb1159df85ae8d6", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.991583779648049, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#http://codeforces.com/contest/816/problem/A\n\n\ntime = gets.chop\n\nh = time.slice(0, 2).to_i\nm = time.slice(3, 2).to_i\n\ntmp = h / 10\npal_m = (h - (tmp * 10)) * 10 + tmp\ncount = 0\n\nf = false\n if(m == pal_m) then\n f = true\n end\nwhile(!f) do\n m = m + 1\n if(m == 60) then\n m = 0\n h = h + 1\n end\n h = h % 24\n pal_m = (h % 10) * 10 + (h / 10)\n count = count + 1\n if(m == pal_m) then\n f = true\n end\nend\n\nputs count\n\nif(m<10) then\n if(h<10) then\n puts \"0\" + h.to_s + \":0\" + m.to_s\n else\n puts h.to_s + \":0\" + m.to_s\n end\nelse\n if(h<10) then\n puts \"0\" + h.to_s + \":\" + m.to_s\n else\n puts h.to_s + \":\" + m.to_s\n end\nend\n", "lang": "Ruby", "bug_code_uid": "70bf723b51c9dce1a2c012aed8d9e0cb", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "3e36beb8cabf7746eec2ef869587584c", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9673790776152981, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "palindrome_times = [\n 0, 70, 140, 210, 280, 350, 420, 601, 671, 741, 811, 881, 951, 1202,\n 1272, 1342, 1412, 1440, 1482, 1510, 1580, 1650, 1720, 1790, 1860, 2041,\n 2111, 2181, 2251, 2321, 2391, 2642, 2712, 2782, 2852, 2922\n]\n\ntime_string = gets\ninitial_hour, initial_minutes = time_string.split(':')\ninitial_time = initial_hour.to_i * 60 + initial_minutes.to_i\n\nans = palindrome_times.bsearch { |x| x - initial_time >= 0 }\nputs ans - initial_time\n", "lang": "Ruby", "bug_code_uid": "07a6c78e0f87c82cc795f2519e9960c8", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "4063480356b331b923f53a4727d3a74b", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.36220472440944884, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#http://www.codeforces.com/contest/653/problem/B\n\nclass BearCompression\n def initialize(length)\n @output_length = length\n @operations = {}\n end\n\n def add_operation(input)\n a, b = input.split\n @operations[a] = b\n end\n\n def run\n @output = []\n @chars = ['a']\n\n (@output_length - 1).times do \n @output = @operations.select { |_, v| @chars.include?(v) }.keys\n @chars = @output.map { |x| x[0] }\n end\n\n puts @output.count\n end\nend\n\nstring_length, operations_count = gets.chomp.split.map(&:to_i)\n\nb = BearCompression.new(string_length)\noperations_count.times do \n b.add_operation(gets.chomp)\nend\n\nb.run\n", "lang": "Ruby", "bug_code_uid": "cade05276099fac5e17dae5bef2c5d95", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "apr_id": "018684166775368f775aa05346661c69", "difficulty": 1300, "tags": ["brute force", "dp", "dfs and similar", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.819672131147541, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\na = Hash.new(false)\na[n] = true\nwhile n > 1\n n += 1\n n /= 10 while n%10 == 0\n a[n] = true\nend\nputs a.size", "lang": "Ruby", "bug_code_uid": "d3baac86c476cfbcdb563c505832753e", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "76d23c0514dc44edbaedb8f3d6b4bd46", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9739130434782609, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, t, k, d = gets.split.map(&:to_i)\nfst = n / k * t\nsnd = fst + 1\nfor i in 0 .. fst\n tmp = i / t * k\n if i >= d\n tmp += (i - d) / t * k\n end\n if tmp >= n\n snd = i\n break\n end\nend\nputs (fst > snd ? \"YES\" : \"NO\")\n", "lang": "Ruby", "bug_code_uid": "a5291fafe8a9ce9869e7b6e4ef1c158b", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "48aadb5fca5a8b09e55da539b4c782c6", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8827160493827161, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "# your code goes here\na, b = gets.chomp.split.map(&:to_i)\n\nresult = 1\n(1..(b-a)).each do |i|\n\tresult = result * (b + 1 - i)\t\nend\n\nputs result%10", "lang": "Ruby", "bug_code_uid": "80ead794ec19c5860bdcb801a6888a41", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "7dcfc2c80b5612aa72a6da8ef8e96402", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8142292490118577, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "a = gets.chomp.to_i\nb = gets.chomp.to_i\n\nr= 1\n\n(a+1 .. b).each do |i|\n\tr = r*i\n\tif r%10 == 0\n\t\tbreak\n\tend\nend\n\nprint r%10", "lang": "Ruby", "bug_code_uid": "100990323ff12216dcc9f168bccd48d4", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "cc6ac6ddf1904a6f74237768104e094c", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8513513513513513, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\na = gets.strip.split.map{|s| s.to_i}\ncnt1 = a.select{|i| 100 == i}.length\ncnt2 = n - cnt1\nif 0 == cnt1 % 2 and 0 == cnt2 % 2 or 0 == cnt1 % 2 and 1 == cnt2 % 2 and cnt1 >= 2\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "d724bfe2c30a0510583d285a48e31645", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "651aa1398e5cb33b39b8a1a1b53c6f01", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9777777777777777, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp.to_i\n\ndef solve(n)\n dp = [0] * (n + 1)\n dp[1] = 1\n for i in 2...n+1 do\n dp[i] = dp[i-1] + 2**i\n end\n return dp[n]\nend\n\nputs solve(n)\n", "lang": "Ruby", "bug_code_uid": "bd8db18ec7ac57682a6a3c787bb13207", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "a41ba90b9e0ff5437e700e5f3ae808fe", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.44642857142857145, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n = gets.to_i\np n==1 ? 1 : (2*n-3)**2+4", "lang": "Ruby", "bug_code_uid": "1a31404da2ac88f7d6bd54c853b59325", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "ad25aa1f7731c117ca9a16acc088b81c", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6741573033707865, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n,*a=$<.map &:to_i;p a.min*~-a", "lang": "Ruby", "bug_code_uid": "756023f4efa0f2f740ef1dcabcd4e8b9", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "f57d388d98c4513a4a29b20c2edfc6b7", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5431425976385105, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n = gets.strip.to_i\na = gets.strip.to_i\nb = gets.strip.to_i\nc = gets.strip.to_i\ncurr = 1\nans = 0\nif n > 1\n i = 1\n while i < n\n dist = 0\n if curr.odd?\n dist = [a, b].min\n curr = 2\n else\n dist = [a, b, c].min\n curr = 1\n end\n ans += dist\n i += 1\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "b4308d6e2e59d9f76888b9273e9ee2e9", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "a8f7c062a9886d55edb7d8371cd5d1d5", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9838187702265372, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nn,a,b,c = (gets+gets+gets+gets).split.map(&:to_i)\n\nif n==1\n p 0\nend\nlen = 0\n\nx = [a,b].min\nlen += x\nn-=2\n\nif n > 0\n len += [x,c].min*n\nend\n\np len", "lang": "Ruby", "bug_code_uid": "a7252dd93f554a565bbc9d24d18eae6e", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "7539c73d60aca5720a6858a761ddbde9", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9398280802292264, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#! /usr/bin/env ruby\n\nn = gets.to_i\na = gets.to_i\nb = gets.to_i\nc = gets.to_i\n\nn -= 1\n\nans = 0\n\nans += [a, b].min\nn -= 1\n\nans += [a, b, c].min * n\nn -= n\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "430ddda5f298d86a4ce81f4c30cd85cc", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "5e4032be446a22a85e552fbd2fbe55c1", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6826923076923077, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "word = gets.chop.gsub!(/[aoyeui]/i,\"\").downcase.scan(/(.)/).flatten.map {|i| i = \".\".concat(i) }\nputs \"#{word.join}\"", "lang": "Ruby", "bug_code_uid": "c26db43c890e7dd765802889cf66b34f", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "84e9efa0102100cffa731fbae71b44a7", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7021276595744681, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "word = gets.gsub!(/[aoyeui]/i,\"\").downcase.to_a.map {|i| i = \". + #{i}\") }\nputs \"#{word.join}\"\n\n", "lang": "Ruby", "bug_code_uid": "5c2ce7cc9f2dd90b7c8409365bd9098a", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "84e9efa0102100cffa731fbae71b44a7", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9939148073022313, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n=gets.to_i;d=Array.new(6){Array.new(6){0}}\nn.times{f,t=gets.split.map(&:to_i);d[f][t]=d[t][f]=1}\nfor i in 1..m\n for j in 1..m\n next if i==j\n \n for k in 1..m\n next if i==j || j==k || i==k\n \n if d[i][j]+d[j][k]+d[k][i]==3 || d[i][j]+d[j][k]+d[k][i]==0\n puts :WIN;exit\n end\n end\n end\nend\nputs :FAIL", "lang": "Ruby", "bug_code_uid": "f9790113333b00fb634f048df076634b", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "abf8467e97348913206eaf0ec4430673", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.21914008321775313, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 17, "bug_source_code": "n=gets.to_i\ng=Array.new(5){[]}\n\nn.times{\n\tfrom,to=gets.split.map(&:to_i)\n\t\n\tfrom-=1\n\tto-=1\n\t\n\tg[from] << to\n\tg[to] << from\n}\n\nans=false\ng.each{|v|\n\tif [0, 3].include?(v.size)\n\t\tans=true\n\t\tbreak\n\tend\n}\n\nputs ans ? \"WIN\" : \"FAIL\"\n", "lang": "Ruby", "bug_code_uid": "dab62db09d717d2ca2b0800d788c50d8", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "abf8467e97348913206eaf0ec4430673", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9962406015037594, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "table = Hash.new(false)\n(1..5).each { |i| table[i] = Hash.new(false) }\n\ncount = gets.chop.to_i\n(1..count).each {\n sf1, sf2 = gets.split(/\\s+/)\n f1 = sf1.to_i\n f2 = sf2.to_i\n\n table[f1][f2] = true\n table[f2][f1] = true\n}\n\nwin = false\n(1..5).each { |i|\n know = 0\n unknown = 0\n (1..5).each { |j|\n if (i != j)\n if (table[i][j] == true)\n know += 1\n else\n unknown += 1\n end\n end\n }\n\n if (know == 3 or unknown == 3)\n win = true\n break\n end\n}\n\nif (win)\n puts \"WIN\"\nelse\n puts \"FAIL\"\nend", "lang": "Ruby", "bug_code_uid": "cf170bc41fbbf27eb14e6f4ed7542cb8", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "6e76710b7f4759b6150a8852e539d04f", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9211087420042644, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\ncount = Hash.new(0)\nn.times do\n\ta,b = gets.split(\" \").map(&:to_i)\n\tcount[a] += 1\n\tcount[b] += 1\t\nend\n\nans = false\ncount.values.each do |a|\n\tif a >= 3 || a <= 1\n\t\tans = true\n\t\tbreak\n\tend\nend\n\nputs ans ? \"WIN\" : \"FAIL\"", "lang": "Ruby", "bug_code_uid": "769728b6555ff5d41a1d25e25de6124a", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "3bc0202b78a450d7bab5063455961f1f", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.502283105022831, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "input=gets.chomp.to_i\noutput=0\ni=1\nloop do\nbreak if i >= (input-(i*2))/2\n\ti+=1\n\toutput+=1\nend\nputs output", "lang": "Ruby", "bug_code_uid": "0750efdfbdf39d102331d51d772d9c6c", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "00999da6ef724b52a5b2e7e86abae34b", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2708333333333333, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#\u041f\u0430\u0448\u0430 \u0438 \u043f\u0430\u043b\u043a\u0430\n\ndef f(l, n, n2)\n return 0 if n-l%2==1 || l>=n2\n 1 + f(l+2, n, n2)\nend\n\n\nn = gets.to_i\nres = f(2, n, n/2)\n\nputs res", "lang": "Ruby", "bug_code_uid": "e088fe4619af89d9f5b767c3a610bc2f", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "b9b82d28842bcd777ea4a5ca36898f28", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7292817679558011, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "# http://www.codeforces.com/contest/610/problem/A\nclass Solv\n def initialize(limit)\n @limit = limit\n @count = 0\n end\n\n def run\n target = @limit / 2\n (1..(target/2-1)).each do |i|\n @count += 1\n end\n\n @count += 1 if (target % 2 != 0) and target != 1\n @count\n end\nend\n\nlen = gets.to_i\nsolv = Solv.new(len)\nputs solv.run\n", "lang": "Ruby", "bug_code_uid": "0fd0e64bf905c13a21a4ca46eeb98861", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "f9c891f8e4248f9236b352dd0bd8c819", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.95, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "# http://www.codeforces.com/contest/610/problem/A\n\nclass Solv\n def initialize(limit)\n @limit = limit\n @count = 0\n end\n\n def run\n target = @limit / 2\n @count = (target/2-1)\n @count = 0 if @count < 0\n\n @count += 1 if (target % 2 != 0) and target != 1\n @count\n end\nend\n\nlen = gets.to_i\nsolv = Solv.new(len)\nputs solv.run\n", "lang": "Ruby", "bug_code_uid": "069c98b97b2c1d91481b911b044daac5", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "f9c891f8e4248f9236b352dd0bd8c819", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8547297297297297, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = gets.chomp\nstr = \"\"\nif s.start_with? \"ftp\" then \n str += \"ftp://\"\n s = s[3..-1]\nelse\n str += \"http://\"\n s = s[4..-1]\nend\nk = s.index(\"ru\")\nif k == 0 then k = s.index(\"ru\", 1)\nend\nstr = str + s[0...k] + \".ru\"\nif !str[k+2] then\n str = str + \"/\" + s[k+2..-1]\nend\nputs \"#{str}\"", "lang": "Ruby", "bug_code_uid": "7899afc9d996a5615bc79c9d24a13942", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "8b4cb470c893caacefa417b5b27a72f1", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7736389684813754, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.strip\ns.insert(s.index(\"p\")+1, \"://\")\ni = s.index(\"ru\")\ns.insert(i, \".\")\ni += 3\nif i < s.length\n s.insert(i, \"/\")\nend\nprint s", "lang": "Ruby", "bug_code_uid": "65dd12c11f94eac9b1024d9f7cea5c23", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "48e2add8a0b0203c535cd553e0725b75", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9833729216152018, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp\nans = ((s[0] == \"h\") ? (j=4; s[0..3]) : (j=3; s[0..2])) + \"://\"\ni = j\nwhile s[j..j+1] != \"ru\"\n j += 1\nend\nans += s[i...j] + \".\" + s[j..j+1]\nj += 2\nans += \"/\" + s[j..-1] if j < s.size\nputs ans", "lang": "Ruby", "bug_code_uid": "f43791404cce7b100cbd7d9b940684cb", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "e2bd55cc21f7adcc79fd8b4f0f83d173", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7632850241545893, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "def foo()\n x,y=gets.split.map(&:to_i)\n u = x**2+y**2\n return \"black\" if (u**0.5).to_i**2 == u\n return \"black\" if x % 2 == 0 and x * y > 0\n return \"black\" if x % 2 > 0 and x*y < 0\n return \"white\"\nend\n\nputs foo", "lang": "Ruby", "bug_code_uid": "737714433312ed98e5cee54e3317f522", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "dc2a6a0dd74dac894690ceedec2d0ca5", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.40129449838187703, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "x,y = gets.split.map(&:to_i)\nputs (((Math.sqrt(x*y))%2).zero?)? 'white' : 'black'", "lang": "Ruby", "bug_code_uid": "f47be36a52b56c4264af2c47bb4dda3c", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "4241c136744809b465e7794926294b08", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9292035398230089, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x,y = gets.split.map(&:to_i)\n\nsqrt = ((x**2 + y**2)**0.5)\n\nif sqrt == sqrt.to_i then\n\tputs 'black'\nelse\n\tunless ( (sqrt%2).zero? )\n\t\t\tputs (x*y > 0) ? 'black' : 'white'\n\t\telse\n\t\t\tputs (x*y > 0) ? 'white' : 'black'\n\tend \t\nend", "lang": "Ruby", "bug_code_uid": "ae90073b081b32909c763ac942508411", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "4241c136744809b465e7794926294b08", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8846153846153846, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets\nputs gets.chomp.split(\" \").sort.join(\" \")", "lang": "Ruby", "bug_code_uid": "a2908da517d2c17d0967c8c483f474e9", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "0851ad176eda511a7bd9f7a53997a8a4", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7855421686746988, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "line = gets.split();\na,b = line[0].to_i,line[1].to_i;\n\n\nif(b >= a*2)\n puts \"0\";\nelse\n n = 1;\n if(b > a)\n n = b - a;\n else\n a = b;\n end\n ans = (a-n-1)/2 + 1;\n puts\"#{ans}\";\nend\n", "lang": "Ruby", "bug_code_uid": "2e945768a9fcb13202191aded5759037", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "0a6d81f3c177e75b5ace3a5c36f21a79", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8406169665809768, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n, s = gets.chomp.split.map &:to_i\n\ndef differ(x)\n string = x.to_s\n for i in 0...string.length\n x -= string[i].to_i\n end\n return x\nend\n\nl = 1\nr = n\nm = -1\nwhile l <= r do\n m = (l + r) / 2\n if differ(m) < s\n l = m + 1\n else\n r = m - 1\n end\nend\n\namount = n - m + 1\nif m == n\n if differ(m) >= s\n amount = 1\n else\n amount = 0\n end\nend\nputs amount", "lang": "Ruby", "bug_code_uid": "d2dbb2ff99957ed5e68b02ba6ca4ecc6", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "1c41584b9bb01972f6f5060c52363506", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.980688497061293, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.chomp.split.map(&:to_i)\n\ndef fromdec(n)\n rtn = \"\"\n while 0 < n.to_i\n rtn = (n.to_i % 7).to_s + rtn\n n = (n.to_i / 7).to_s\n end\n return rtn\nend\n\ndef todec(n)\n rtn = 0\n (0...n.size).each do |i| \n rtn += n[i].to_i * 7 ** (n.size - i - 1)\n end\n return rtn\nend\n\nln = fromdec(n - 1).size\nlm = fromdec(m - 1).size\n\nans = 0\n(0...7).to_a.permutation(ln + lm) do |ps|\n pn = (0...ln).inject('') { |str , i| str + ps[i].to_s }\n pm = (ln...ln + lm).inject('') { |str , i| str + ps[i].to_s }\n if todec(pn) < n && todec(pm) < m\n ans = ans + 1\n end\nend\n\nputs ans\n\n", "lang": "Ruby", "bug_code_uid": "09fbe1c935470178a0930f49a91ef129", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "c08f2f8bbd373d9c366c9d10fe308cd1", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.45864661654135336, "equal_cnt": 21, "replace_cnt": 7, "delete_cnt": 9, "insert_cnt": 5, "fix_ops_cnt": 21, "bug_source_code": "n, x = gets.split.map(&:to_i)\nans, a = 0, 0\n1.upto(n) do |i|\n ans += 1 if i * i == x\n (i + 1).upto(n) do |j|\n a += 1 if i * j == x\n end\nend\nputs ans + a * 2\n", "lang": "Ruby", "bug_code_uid": "60921011f38642d15a3a048e931dbb95", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "c533a4ff031e7be913029d8f24ad699e", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9815242494226328, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "as=gets.chomp\na=as.split(\"\")\nbs=gets.chomp\nb=bs.split(\"\")\nal=a.length\nbl=b.length\n\nif al==bl\n\nif a.sort==b.sort\nputs \"array\"\nelse\nputs \"need tree\"\nend\n\n\nelse\n\nif al= t.size && (Set.new(t_chars) - Set.new(s_chars)).empty?\n 'both'\n else\n 'need tree'\n end)", "lang": "Ruby", "bug_code_uid": "1992dc8e1b0d57fb71a07f2368189485", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "fba27b815bcf81e1feafbea397ab87c6", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9973262032085561, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp\nt = gets.chomp\n\nsubs = s.dup\nautomaton = t.chars.all? do |c|\n n = subs.index(c)\n n.nil? ? false : subs = subs[n..-1]\nend\n\narray = s.chars.sort == t.chars.sort\n\nsubs = s.dup\nboth = t.chars.all? do |c|\n n = subs.index(c)\n n.nil? ? false : subs.slice!(n)\nend\n\nputs case\nwhen automaton; \"automaton\"\nwhen array; \"array\"\nwhen both; \"both\"\nelse \"need tree\"\nend\n", "lang": "Ruby", "bug_code_uid": "ebc830b544e92e36f7cd12c8341dc307", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "674a15b4adb2d15df7ae41d1f8dbe3cd", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9559032716927454, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "total_cards = gets.to_i\ncards_1 = gets.split(' ')\ntotal_cards_1 = cards_1[0].to_i\ncards_2 = gets.split(' ')\ntotal_cards_2 = cards_2[0].to_i\ncards_1.shift\ncards_2.shift\nplay_1 = cards_1.clone\nplay_2 = cards_2.clone\ntotal = 0\nloop do\n card_1 = play_1.shift.to_i\n card_2 = play_2.shift.to_i\n if card_1 > card_2\n play_1.push(card_2)\n play_1.push(card_1)\n else\n play_2.push(card_1)\n play_2.push(card_2)\n end \n total+=1\n break if (play_1==cards_1 && play_2==cards_2) || play_1.size == 0 || play_2.size == 0\nend\nif play_1.size == 0\n puts \"#{total} 2\"\nelsif play_2.size == 0\n puts \"#{total} 1\"\nelse\n puts \"-1\"\nend\n ", "lang": "Ruby", "bug_code_uid": "bdc0bb55300863a74eda2035d346235f", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "0d6f3bff5b4041e9edc9868431dad46a", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9517396184062851, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a=gets.chomp.to_i\nb=gets.chomp.split(\" \")\nlb=b.delete_at(0).to_i\n0.upto(lb-1) {|i|b[i]=b[i].to_i}\ne=[]\ne=e+b\nc=gets.chomp.split(\" \")\nlc=c.delete_at(0).to_i\n0.upto(lc-1) {|i|c[i]=c[i].to_i}\nd=[]\nd=d+c\nturn=0\nloop do\nif b[0]>c[0]\nb< a2[0]\n a1 << a2[0] << a1[0]\n else\n a2 << a1[0] << a2[0]\n end\n a1.shift\n a2.shift\n ans += 1\n break if a1.empty? || a2.empty? || (a1 == s1[1..-1] && a2 == s2[1..-1])\nend\nif a1 == s1[1..-1] && a2 == s2[1..-1]\n puts -1\nelse\n puts \"#{ans} #{a1.empty? ? 2 : 1}\"\nend\n", "lang": "Ruby", "bug_code_uid": "e4962f5b8bdfec08cbba36f037ac60d7", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "5e483b2671d046a5708c9a486de5cfb2", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9771784232365145, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "totalCard = gets.chomp.to_i\n\nfirstPerson = gets.chomp.split(' ').map {|item| item.to_i}\nsecondPerson = gets.chomp.split(' ').map {|item| item.to_i}\n\noriginalfPerson ||= []\noriginalsPerson ||= []\n\nfirstTurn = false\nturnNum = 0\n#####\n\nfirstPerson.each do |item|\n\toriginalfPerson << item\nend\n\nsecondPerson.each do |item|\n\toriginalsPerson << item\nend\n\nloop do\n\tif (originalfPerson <=> firstPerson) == 0 &&\n\t\t(originalsPerson <=> secondPerson) == 0 && firstTurn\n\n\t\tputs -1\n\t\tbreak\n\tend\n\n\tif firstPerson.length == 1\n\t\tprint \"#{turnNum} 2\"\n\t\tbreak\n\tend\n\n\tif secondPerson.length == 1\n\t\tprint \"#{turnNum} 1\"\n\t\tbreak\n\tend\n\n\tif firstPerson[1] > secondPerson[1]\n\t\tfirstPerson << secondPerson[1]\n\t\tfirstPerson << firstPerson[1]\n\n\t\tfirstPerson.delete_at(1)\n\t\tsecondPerson.delete_at(1)\n\telse\n\t\tsecondPerson << firstPerson[1]\n\t\tsecondPerson << secondPerson[1]\n\n\t\tfirstPerson.delete_at(1)\n\t\tsecondPerson.delete_at(1)\n\tend\n\n\tturnNum += 1\n\tfirstTurn = true;\nend", "lang": "Ruby", "bug_code_uid": "47b64e274ffd01e7421e955d0477128b", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "27336232ebab5349e386655140c04c28", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7766990291262136, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "gets\nputs gets.split.reverse.uniq.reverse*' '", "lang": "Ruby", "bug_code_uid": "9865fc799c77a4f8dd3c4aea06cf426c", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "4d5028063667b9092b9f6dde14145f8e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6484641638225256, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "number_size = gets.to_i\nnumbers = gets.split(' ').map(&:to_i)\n\nputs numbers.uniq.size\nputs numbers.uniq.join(' ')", "lang": "Ruby", "bug_code_uid": "f54be630d962c7ed7aa48e121bd2bead", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "0d5bf4da05a622d1ce3f88c87b1c9000", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.07291666666666667, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "#include \n\nconst int MAXN = 128;\n\nint main() {\n\tint r, c;\n\tchar s[MAXN][MAXN];\n\n\tscanf(\"%d%d\", &r, &c);\n\tfor (int i = 0; i < r; ++i) {\n\t\tscanf(\"%s\", s[i]);\n\t}\n\tfor (int i = 0; i < r; ++i) {\n\t\tfor (int j = 0; j < c; ++j) {\n\t\t\tbool flag = true;\n\t\t\tfor (int k = 0; flag && k < r; ++k) {\n\t\t\t\tflag &= k == i || s[k][j] != s[i][j];\n\t\t\t}\n\t\t\tfor (int k = 0; flag && k < c; ++k) {\n\t\t\t\tflag &= k == j || s[i][k] != s[i][j];\n\t\t\t}\n\t\t\tif (flag) {\n\t\t\t\tputchar(s[i][j]);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0;\n}\n", "lang": "Ruby", "bug_code_uid": "1c4a1022efbff6a99d154ada084bbcbf", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "7aec26b1a921f6895dbb787c064d9f81", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.005291005291005291, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "puts \"34\"", "lang": "Ruby", "bug_code_uid": "4c7d364074c156a7bb64b2b2a4dd96f7", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "5babe9e0fccdb1cc161dd36d75c2d937", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9708029197080292, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "# Hello World Program in Rub\nr,g,b = gets.split(\" \").map(&:to_f)\na = [((r/2).ceil-1)*3,((g/2).ceil-1)*4,((b/2).ceil-1)*5]\nputs a.max+30", "lang": "Ruby", "bug_code_uid": "a7784ff266e7a0ed2a02679cd018e7fa", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "44b6f8c3ee8ba3fe1a9689887c6eb63e", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2063157894736842, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "r, g, b = gets.split.map(&:to_i)\nrr, gg, bb = [r, g, b].map { |i| i <= 2 ? 0 : (i % 2 == 0) ? i / 2 - 1 : i / 2 }\nif r > g && r > b\n ret = 30 + rr * 3\nelsif g > r && g > b\n ret = 31 + gg * 3\nelsif b > r && b > g\n ret = 32 + bb * 3\nelse\n ret = 30 + rr * 3\nend\nputs ret\n\n", "lang": "Ruby", "bug_code_uid": "c7a6b7abee744842756859f532ab985b", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "55bddb881c25d28dfab9ffbe0824c862", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5825242718446602, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 18, "bug_source_code": "n = gets.to_i\na = n\n(n..9013).each do |x|\n if x.to_s.split('').uniq.count>3\n a = x\n break\n end\nend\nputs a", "lang": "Ruby", "bug_code_uid": "2bea8baa86d0bf79140203a1b5f6cf85", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "149703c57e66e0ca4772b51009fa6de5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9506726457399103, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i + 1\n\nwhile 1\n if(n.to_s.to_a.uniq.size == 4)\n break\n else\n n+=1\n end\nend\n\nputs n", "lang": "Ruby", "bug_code_uid": "51e442bdf0981e2448f97116ab3982b2", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "9f63c5c7231e851ea6a1a96a725c175d", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9980506822612085, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "class A\n def initialize\n n = gets.chomp\n size = n.size\n\n n.gsub!(\"144\", \"aaa\")\n n.gsub!(\"14\", \"aa\")\n n.gsub!(\"1\", \"a\")\n\n n.delete!(\"123456789\")\n\n if n.size == size\n puts \"YES\"\n else\n puts \"NO\"\n end\n end\nend\n\na = A.new", "lang": "Ruby", "bug_code_uid": "b142850692e75466d41da97c09b24f0a", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "d2a33b547f0e872dc9c7158fa195f19f", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9333333333333333, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "puts gets.chomp.gsub(\"144\",\"\").gsub(\"14\",\"\").gsub(\"1\",\"\").empty? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "20aeb2e718ac0741ccc42cdc03643de6", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "a5566e113ab56a4cf7ff27d7ff53019e", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9003690036900369, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "d = gets.chomp.to_s\n\nd.gsub!('144', '')\nd.gsub!('14', '')\nd.gsub!('1', '')\nif d.size > 0\n puts 'NO'\nelse\n puts 'YES'\nend", "lang": "Ruby", "bug_code_uid": "16ca9ce453daa141bf20a13b83a65247", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "d2b7a27084de954f6502b7c6031ef415", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.37800687285223367, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "# coding: utf-8\n\n# if __FILE__ == $0\n# end\n\ns = gets.chomp\nns = s.gsub(\"144\", \"\").gsub(\"14\", \"\").gsub(\"1\", \"\")\n\nif ns == \"\"\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "fbffa0e234293f05a01963fd1cee5f7b", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "addba100be2d09440202756fe8cf7abc", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9972451790633609, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def fill_primes(max)\n primes = [2,3]\n now = primes[-1]\n loop{\n now+=2\n break if now>max\n prime, check = true, 0\n while primes[check]**2 <= now:\n prime = false if now%primes[check]==0\n break if not prime\n check+=1\n end\n primes << now if prime\n }\n return primes\nend\n\ndef is_almost_prime(num, primes)\n check = 0\n divisors = [1]\n while num>1\n while num % primes[check] == 0\n num /= primes[check]\n divisors << primes[check] if divisors[-1] != primes[check]\n end\n check+=1\n end\n if divisors.length == 3\n 1\n else\n 0\n end\nend\n\nprimes = fill_primes(3000)\n\nprimes, n, ans = fill_primes(3000), gets.chomp.to_i, 0\n2.upto(n){|i| ans+=is_almost_prime(i, primes) }\np ans", "lang": "Ruby", "bug_code_uid": "95b1801759f5bc51f035c60522600781", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "d1dc2f9c7b0b31f6bb3f3fca0051aad1", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.688295165394402, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 11, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "solution = 0\nif ARGV.length > 0\n input = ARGV[0].to_i\n lower = 6 \n lower.upto(input) do |i|\n temp = i \n divisorCount = 0\n if (temp % 2 == 0)\n divisorCount = divisorCount + 1\n while (temp % 2 == 0)\n temp = temp / 2\n end\n end\n \n oddDivisor = 3\n while (temp >= oddDivisor)\n if (temp % oddDivisor == 0)\n divisorCount = divisorCount + 1\n if (divisorCount > 2)\n break\n end\n while (temp % oddDivisor == 0)\n temp = temp / oddDivisor\n end\n end \n oddDivisor = oddDivisor + 2\n end\n \n if divisorCount == 2\n solution = solution + 1\n end\n end\nend\n\nputs solution", "lang": "Ruby", "bug_code_uid": "578e37756063b2df49cfbb443503c5b8", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "a06047b2b9a9fc0390b28975c10dc2a9", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9969558599695586, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\n\nn, a, b = gets.chomp.split(\" \").map(&:to_i)\ndancers = gets.chomp.split(\" \").map(&:to_i)\n\ndef palindrome(n, a, b, dancers)\n min_cost = 0\n len = dancers.size\n\n min_cost = [a, b].min if (len % 2 == 1) and (dancers[len/2] == 2)\n (0..len/2-1).each do |idx|\n if dancers[idx] != dancers[len-idx-1] and dancers[idx] != 2 and dancers[len-idx-1] != 2\n p -1\n return\n elsif (dancers[idx] == 2) and (dancers[len-idx-1] == 2)\n min_cost += [a, b].min\n elsif (dancers[idx] == 2) or (dancers[len-idx-1] == 2)\n min_cost += ([dancers[idx], dancers[len-idx-1]].min == 0) ? a : b\n end\n end\n p min_cost\nend\n\npalindrome(n, a, b, dancers)\n", "lang": "Ruby", "bug_code_uid": "f025c11e4028ea87678de21e75bf7c18", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "91fb0bd910a9a604b4a8e917eda5df22", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9958071278825996, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\ufeff# -*- encoding: utf-8 -*-\n$stdin = File.open(\"input.txt\")\n$stdout = File.open(\"output.txt\", \"w\")\n\nn = gets.chomp.to_i\na = gets.chomp.split(\" \").map{|n| n.to_i}\n\nchest = 0\nbiceps = 0\nback = 0\n\n0.step(n, 3) do |idx|\n chest += a[idx] if not a[idx].nil?\n biceps += a[idx + 1] if not a[idx + 1].nil?\n back += a[idx + 2] if not a[idx + 2].nil?\nend\n\nif chest > biceps and chest > back\n puts \"chest\"\nelsif biceps > chest and biceps > back\n puts \"biceps\"\nelse\n puts \"back\"\nend\n", "lang": "Ruby", "bug_code_uid": "145fe1975b2afdfe7cb4c9bb70a8ced1", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "12a52c848ef61a91fe1b81269343186a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9659090909090909, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "x=[0,0,0]\nn=gets.to_i\na=gets.split.map(&:to_i)\n\nn.times{|i| x[i%3]+=a[i] }\n\ncase x.each_with_index.max[1]\n\twhen 0\n\tputs \"chest\"\n\twhen 1\n\tputs \"back\"\n\twhen 2\n\tputs \"biceps\"\nend\n", "lang": "Ruby", "bug_code_uid": "e523c91ec553e4998d461777b07b3804", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "baef69d25da33e12410214e8aa6fbb26", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.978328173374613, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a,b,c,n=0,0,0,gets.to_i;k=gets.split.map &:to_i\n1.upto(n) {|x| x%3==1 ?a+=k[x-1]:x%3==2 ?b+=k[x-1]:c+=k[x-1]}\nputs a>b ?(a>c ?\"chest\":1):(b>c ?\"biceps\":\"back\")", "lang": "Ruby", "bug_code_uid": "ca0183a4e131e6a703b7aef275e7c4f8", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "7ac0653aa17d2b73a1fe42c3829a1ded", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7515923566878981, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = gets.split(\" \").map(&:to_i)\n\nbody_part = [\"chest\", \"biceps\", \"back\"]\n\nanswer = a.each_slice(3).to_a\n(1 + a.length % 3).times { |_| answer[-1].insert(-1, 0) }\n\nputs body_part[answer.map { |arr| arr.reduce(:+) }.each_with_index.max[1]]\n", "lang": "Ruby", "bug_code_uid": "f0628dddcc592b7598a0e50e747f5d65", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "108f44339d49a3a7e5d9b90ede7eba0e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8496522204387373, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']\n\ndef inpf() a=gets.chomp.split(\" \").map(&:to_f)end\n\ndef inps() a=gets.chomp.split(\" \")end\n\ndef copy(a) Marshal.load(Marshal.dump(a)) end\n\ndef kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end\n\ndef na(n,d=0) Array.new(n,d)end\n\ndef na2(n,m,d=0) Array.new(n){Array.new(m,d)}end\n\ndef na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end\n\ndef inp() a=gets.chomp.split(\" \").map(&:to_i)end\n\ndef r_up(a, b) (a+b-1)/b end\n\ndef sum(a) a.inject(:+) end\n\nn = inp[0]\nn.times do\n n, d, k = inp\n onf = na(d+1)\n t = inp\n tail = 0\n min = 9999999\n now = 0\n t.size.times do |i|\n if(onf[t[i]] == 0)\n now += 1\n end\n onf[t[i]] += 1\n if(i-k >= 0)\n onf[t[i-k]] -= 1\n if(onf[t[i-k]] == 0)\n now -= 1\n end\n min = [now,min].min\n end\n end\n min = [now,min].min\n p min\nend\n", "lang": "Ruby", "bug_code_uid": "e39f3229b0d274bcfc86530bd10c1215", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "89a78b3332cc77c9fb7514009c279d7b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9664429530201343, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "gets\ns=gets.chomp.downcase\np (s.each_char.to_a.uniq.size==26)?\"YES\":\"NO\"\n\n", "lang": "Ruby", "bug_code_uid": "a5ff0e0fbe67679f418d7fb8ea165874", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "340f7f61f2f584c1409b517b4cf31fb2", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9355932203389831, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "stringLen = gets.chomp.to_i\nstr = gets.chomp.upcase\n\nuniqLen = str.split('').uniq.length\n\nif stringLen == uniqLen\n puts 'YES'\nelse\n puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "b3cc913680089a58e8117ee6a8589488", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "0797dc8a7c353379697fb826e492d566", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8518518518518519, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a=gets.chomp.to_i\nb=a%7\nc=(a/7)*2\nif b==0\nputs\"#{c} #{c}\"\nelsif b==1\nputs \"#{c} #{c+1}\"\nelse\nputs \"#{c} #{c+2}\"\nend\n", "lang": "Ruby", "bug_code_uid": "0050602fcd574ad6a5a6686ffa9cfa23", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "0b8dd346c48c766ca07148d65f013bd1", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9617271835132483, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\ndays = 0\nif n <= 2\n puts \"0 #{n}\"\nelsif n <= 5\n puts \"0 2\"\nelsif n < 7\n puts \"#{n - 5} 2\"\nelse\n min_offs = 0\n remaining_days = n\n begin\n days += 7\n min_offs += 2\n remaining_days -= 7\n end while remaining_days >= 7\n max_offs = min_offs\n if remaining_days > 5\n max_offs += 2\n elsif remaining_days < 2\n max_offs += remaining_days\n else\n max_offs += 2\n end\n puts \"#{min_offs} #{max_offs}\"\nend\n", "lang": "Ruby", "bug_code_uid": "4650ee8397f378ee16e88394b634b913", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "c4448dc2d56b3787c1d0d75e89046a8b", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8702928870292888, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nmin = n/7*2\nmax = min\nn%=7\n\nif n < 7\n\tmax += n%7 > 2 ? 2 : n%7\n\tputs \"#{min} #{max}\"\t\nend\n", "lang": "Ruby", "bug_code_uid": "0e6a67ffed1be06a15f8d161d2ab6eb4", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "ab0c615444f9d59f70d913b5920b2de8", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7849462365591398, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "input = gets.chomp.to_i\n\nportion = if input % 7 > 2\n\t2\nelse\n\tinput % 7\nend\n\nmin = (input / 7) * 2\nmax = ((input / 7) * 2) + portion\n\nputs \"#{min} #{max}\"", "lang": "Ruby", "bug_code_uid": "187857b636b06987dc91cf6bfd1de511", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "bc97f89017bf10f49fb1ecdfd6e25031", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9494949494949495, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\n\nx = (n / 2.0).ceil - 1.0\n\nputs x", "lang": "Ruby", "bug_code_uid": "b5b14a5128dd564f0953c97ee292f6fa", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "98d34cf7cb81b2d66b9869397da71b6e", "difficulty": 1000, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3486682808716707, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "@r1 = gets.strip\n@r2 = gets.strip\nn = @r1.size-1\n@cache = {}\n@cache[0] = 0\n\ndef get_x_count(a, b, c, d)\n ret = 0\n ret += 1 if a == 'X'\n ret += 1 if b == 'X'\n ret += 1 if c == 'X'\n ret += 1 if d == 'X'\n ret\nend\n\nif n > 0 && get_x_count(@r1[0], @r1[1], @r2[0], @r2[1]) > 1# ( (@r1[0]=='X' && @r2[1]=='X') || (@r1[1]=='X' && @r2[0]=='X') )\n @cache[1] = 0\nelse\n @cache[1] = 1\nend\n\ndef solve(i)\n unless @cache[i]\n ans1 = solve(i-1)\n ans2 = solve(i-2)\n if get_x_count(@r1[i-1], @r1[i], @r2[i-1], @r2[i]) > 1# ( (@r1[i-1]=='X' && @r2[i]=='X') || (@r1[i]=='X' && @r2[i-1]=='X') )\n else\n ans2 += 1\n end \n @cache[i] = [ans1, ans2].max\n end\n @cache[i]\nend\n\nsolve(n)\nputs @cache[n]", "lang": "Ruby", "bug_code_uid": "7f8a43c8aee89939af64e231b2a4eca9", "src_uid": "e6b3e787919e96fc893a034eae233fc6", "apr_id": "1a0574b6105146c991b8ab0f422bda4f", "difficulty": 1500, "tags": ["dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.358974358974359, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "p \"2 3 1 2 1\"", "lang": "Ruby", "bug_code_uid": "0b321952a2f04d4ff58b06a9a40588ab", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "d285cdeaf8ea7d64607913ca28c9691a", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9864864864864865, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "puts {\"3\" => 1, \"1\" => 2, \"2\" => 3, \"4\" => 2, \"5\" => 1}[readline.strip]\n\n", "lang": "Ruby", "bug_code_uid": "bf88da736d76181e44836a81d90bf0ff", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "17ec3760a794cd22b312c413021f0333", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9696969696969697, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = gets.chomp.to_i\ncase s\nwhen 1\n puts 2 ## ok\nwhen 2\n puts 3\nwhen 3\n puts 1 ## ok\nwhen 4\n puts 2 ## ok\nwhen 5\n puts 3\nend\n", "lang": "Ruby", "bug_code_uid": "f8c8ab7fcd793269089f824d1989a785", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "7dad61f4a14fe0f74effe353fea9bb20", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9092783505154639, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "def neighbor(a,b)\n return (a[0].to_i - b[0].to_i).abs == 1 && a[1] == b[1]\nend\ndef neighbor2(a,b)\n return (a[0].to_i - b[0].to_i).abs == 2 && a[1] == b[1]\nend\n\nt = gets.split.sort\n\nif t[0] == t[1] && t[1] == t[2]\n p 0\nelsif neighbor(t[0],t[1]) && neighbor(t[1],t[2])\n p 0\nelsif t[0] == t[1] || t[1] == t[2]\n p 1\nelsif neighbor(t[0],t[1]) || neighbor(t[1],t[2])\n p 1\nelsif neighbor2(t[0],t[1]) || neighbor2(t[0],t[2]) || neighbor2(t[1],t[2])\n p 1\nelse\n p 2\nend\n", "lang": "Ruby", "bug_code_uid": "dc488d96f59456d8df2c77418b7789e0", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "45eddb8e18f31e5a2f52993129375680", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9915611814345991, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp.split.sort\nans = 2\nif s[0] == s[1]\n if s[1] == s[2]\n ans = 0\n else\n ans = 1\n end\nelsif s[1] == s[2]\n ans = 1\nelse\n a = Hash.new\n a[\"s\"] = 0\n a[\"p\"] = 1\n a[\"m\"] = 2\n b = Array.new(3).map{Array.new(10,0)}\n 3.times do |i|\n b[a[s[i][1]]][s[i][0].to_i] += 1\n end\n 3.times do |i|\n c = 1\n (2..9).each do |j|\n if b[i][j] == 1 && b[i][j-1] == 1\n c += 1\n ans = [ans,3-c].min\n else\n c = 1\n end\n end\n (2..8).each do |j|\n if b[i][j-1] == 1 && b[i][j+1] == 1\n ans = 1\n end\n end\n end\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "7a65e7ef4ad5e2626fdc5c44596865e0", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "6f626d6b8d7c99399b108464ac70ef54", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2857142857142857, "equal_cnt": 21, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 20, "bug_source_code": "#!/usr/bin/env ruby\n\nn, l, r = gets.split.map(&:to_i)\n\n#\n\nto_one_cache = { 0 => [0],\n\t\t\t\t 1 => [1]}\nstack = []\nc = n\nwhile c > 1\n stack << c\n c = c / 2\nend\n\n#p stack\n\nlist_one = [c]\nwhile d = stack.pop\n list_one = list_one + [d&1] + list_one\nend\n\n#p list_one\nputs list_one[l - 1..r - 1].count(1)\n", "lang": "Ruby", "bug_code_uid": "a84355e72f76128ebd3616820078af58", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "fbcd2fc9fb0c26d44a8b7ff315ed002f", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6583333333333333, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 7, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "#Bear and Big Brother\nl_weight, b_weight = gets.chomp.split\ny = 0\nuntil l_weight > b_weight\n l_weight *= 3\n b_weight *= 2\n y += 1\nend\nputs y", "lang": "Ruby", "bug_code_uid": "548ea4c716987336357fa3c92dca3018", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "78ab7d0d802fd727c7432b78c492d531", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6466165413533834, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "a = gets.chomp.to_i\nb = gets.chomp.to_i\nc = 0 \nwhile a <= b\n a = a * 3 \n b = b * 2\n c = c + 1\nend\n\nputs c\n\n", "lang": "Ruby", "bug_code_uid": "1b98a2dbae2b6ecd80db51b581f97d87", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "ac8a9149ddbcfb1da86f49dbd9a97ac7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.967741935483871, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "file = File.exist?('in.in') ? File.new('in.in', 'r') : STDIN\n\na,b = file.gets.split\n\nyears = 0\nif a == b\n puts 1\nelse\n while a <= b \n a *= 3\n b *= 2\n years += 1\n end \n puts years\nend\n", "lang": "Ruby", "bug_code_uid": "5e62fbf1d545ad240c8622a71d0567c8", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "942169ea6a0c12d9ff7947f37fff2e88", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9962825278810409, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, b = gets.chomp.split.map(&:to_i)\ni =0\nwhile(true) do\n a = a*3\n b = b*2\n i = i+1\n if(a>=b) then\n break\n end\nend\nprint(i,\"\\n\")", "lang": "Ruby", "bug_code_uid": "73abb17b26eea84a6693aa39488065c8", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "8bfe759feee91ff9938b0fb48d676e6e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8811188811188811, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=gets.to_i\n(p 1;exit)if n<10\nx=10**Math.log10(n).to_i\np (x-n)%x\n", "lang": "Ruby", "bug_code_uid": "b3e5a9e68d2a13c9e7a201f18448b6d2", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "79c9b9cf519758449ac67f547540e424", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9705882352941176, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\n(p 1;exit)if n<10\nx=10**Math.log10(n).to_i\nn=(x-n-1)%x+1", "lang": "Ruby", "bug_code_uid": "d7aee09c13f5fdf0f09fd6b3fd263610", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "79c9b9cf519758449ac67f547540e424", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9767441860465116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def scan;gets.split.map(&:to_i);end\ns = gets.chomp\nsn = s[0].succ + '0'*s[1..-1].size\np sn\np sn.to_i - s.to_i\n", "lang": "Ruby", "bug_code_uid": "5fa04f8e622553b621716629c69c133a", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "38ccddb38719009295d49243188f7e88", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.985797827903091, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "require 'prime'\n\nclass Integer\n def divisor_list\n return [] if self <= 0\n return [1] if self == 1\n\n prime_division.map.with_index { |(base, k), i|\n s = i.zero? ? 0 : 1\n (s..k).map { |n| base ** n }\n }.inject { |res, e| res + res.flat_map { |t| e.map { |v| t * v } } }.sort\n end\nend\n\nA, B = gets.split.map(&:to_i).sort\n\nif A == B\n puts 0\n exit\nend\n\nk = B - A\nmin_lcm = Float::INFINITY\nans = Float::INFINITY\n\np k.divisor_list\nk.divisor_list.each do |x|\n d = x * (A / x.to_f).ceil - A\n\n lcm = (A + d).lcm(B + d)\n\n if min_lcm > lcm\n min_lcm = lcm\n ans = d\n end\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "6a877432bec133a7ec79bec78355c5d9", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "d912d0dacb85bb3f905c57c3bd8eeba7", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9967914438502674, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "require 'prime'\n\na,b = gets.split.map(&:to_i)\nif a != b\n g = (a-b).abs\nelse\n g = a\nend\nx = Prime.prime_division(g)\nm = a.lcm(b)\nans = 0\n\n$p = []\n\ndef div(c,d,i)\n if i == d.size\n $p << c\n else\n div(c,d,i+1)\n d[i][1].times do |j|\n div(c*(d[i][0]**(j+1)),d,i+1)\n end\n end\nend\n\ndiv(1,x,0)\n$p.sort!\n$p.each do |k|\n l = (k-a%k)%k\n if m > (a+l)*(b+l)/k\n m = (a+l)*(b+l)\n ans = l\n end\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "dad3dc27a15a3ac5ec5fc6fc828650f9", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "ef15f2422ddaf6fedef72e14229984a2", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9203539823008849, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,c=gets.split.map &:to_i\nmas=gets.split.map &:to_i\ni,k=0,0\nwhile(i k\n k=mas[i]-mas[i+1]\n end\n i+=1\nend\nputs k-c", "lang": "Ruby", "bug_code_uid": "345bec31046f578b8ad648c85ba05419", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "0c07d4945ba6872cd8615d10dbb3ad9e", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.889967637540453, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n, c = gets.chomp.split(/ /).map(&:to_i)\nprices = gets.chomp.split(/ /).map(&:to_i)\nprofits = []\nif c > 0\n (1...n).each do |day|\n current_buy = prices[day - 1]\n next_sell = prices[day]\n profit = current_buy - next_sell - c\n profits << profit if profit > 0\n end\n puts profits.max\nelse\n puts \"0\"\nend\n", "lang": "Ruby", "bug_code_uid": "3172a6568a1b128d3f4f37f68f3cd21a", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "9d6b9ba927411ac090d163148a388f19", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9857549857549858, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, c = gets.split.map(&:to_i)\na = gets.split.map(&:to_i)\ndiff = 0\n(n - 1).times do |i|\n diff = [diff, a[i] - a[i + 1]].max\nend\nif diff > c\n puts diff - c\nelse\n puts diff\nend\n", "lang": "Ruby", "bug_code_uid": "02aa3dba839aee8d556ea8bef849721b", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "bbcb758c780ac9b3323e80e3debd5ab8", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.46640788295013436, "equal_cnt": 26, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 13, "fix_ops_cnt": 26, "bug_source_code": "size=gets.chomp\n\nrows= size.split(\" \")[0].to_i\ncolumns= size.split(\" \")[1].to_i\na=[]\nfor i in (0...rows.to_i) do\n line=gets.chomp\n a<0\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j-1]=\".\"\n elsif a[i][j+1]==\"P\" && j+10\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j-1]=\".\"\n elsif a[i][j+1]==\"P\" && j+10\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j-1]=\".\"\n elsif a[i][j+1]==\"P\" && j+1=0\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j-1]=\".\"\n elsif a[i][j+1]==\"P\" \n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j+1]=\".\"\n elsif a[i+1][j]==\"P\" \n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i+1][j]=\".\"\n end\n elsif i==rows-1 #tpt\n if a[i][j-1]==\"P\" && j-1>=0\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j-1]=\".\"\n elsif a[i][j+1]==\"P\"\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j+1]=\".\"\n elsif a[i-1][j]==\"P\" \n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i-1][j]=\".\"\n end\n\n else #tptd\n if a[i][j-1]==\"P\" && j-1>=0\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j-1]=\".\"\n elsif a[i][j+1]==\"P\"\n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i][j+1]=\".\"\n elsif a[i+1][j]==\"P\" \n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i+1][j]=\".\"\n elsif a[i-1][j]==\"P\" \n count_pigs_eaten+=1\n a[i][j]=\".\"\n a[i-1][j]=\".\"\n end\n end\n\n\n end\n end\nend\n\np count_pigs_eaten\n\n", "lang": "Ruby", "bug_code_uid": "fd10e24051a120093fd27658e820e45b", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "4be1cc8ec96cea71296293f5f4d4bd04", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9899244332493703, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n, m = gets.split.map { |x| x.to_i }\ng = []\nfor _ in 1..n\n g << gets.chomp\nend\n\np = 0\nfor i in 0...n\n for j in 0...m\n p += 1 if g[i][j] == 'W' && [j > 0 ? g[i][j - 1] : nil,\n j + 2 < n ? g[i][j + 1] : nil,\n i > 0 ? g[i - 1][j] : nil,\n i + 2 < m ? g[i + 1][j] : nil].include?('P')\n end\nend\nputs p", "lang": "Ruby", "bug_code_uid": "52359edf2d4a25b961a3d355228dc1d9", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "339998d61a399e6f904bb19cb71c6075", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.48130841121495327, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "line = gets.split\nn = line[0].to_i\nm = line[1].to_i\nfield = []\n\n0.upto(n - 1) do |i|\n field[i] = gets.chomp.split('')\nend\n\npigs = 0\npos = []\n\n0.upto(n - 1) do |x|\n 0.upto(m - 1) do |y|\n\n unless pos.empty?\n field[pos[0]][pos[1]] = \"\"\n pigs = pigs + 1\n pos = []\n end\n\n if field[x][y] == \"W\"\n\n if x > 0 and field[x - 1][y] == \"P\"\n pos = [x - 1, y]\n\n elsif x < n - 1 and field[x + 1][y] == \"P\"\n pos = [x + 1, y]\n\n elsif y > 0 and field[x][y - 1] == \"P\"\n pos = [x, y - 1]\n\n elsif y < m - 1 and field[x][y + 1] == \"P\"\n pos = [x, y + 1]\n end\n end\n end\nend\n\nputs pigs\n", "lang": "Ruby", "bug_code_uid": "ad34a1af04f1430219c25f28553927d7", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "97c4bc440be0af587022af763874be8e", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9954337899543378, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\n\nfor i in 0..n-2\n\tfor j in 0..n-2\n\t\tif i == 0\n\t\t\tprint \" \" if j > 0\n\t\t\tprint j+1\n\t\telse\n\t\t\tif j == 0\n\t\t\t\tprint i\n\t\t\telse\n\t\t\t\tprint \" \"\n\t\t\t\tprint ((i+1)*(j+1)).to_s(n)\n\t\t\tend\n\t\tend\n\tend\n\tputs \"\"\nend\n", "lang": "Ruby", "bug_code_uid": "372851cd3e1ec4470436120758f03e75", "src_uid": "a705144ace798d6b41068aa284d99050", "apr_id": "526743a86a3e0140425fc067678118e9", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "25", "lang": "Ruby", "bug_code_uid": "42a91b15ab2122f350c851c5618c5237", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "8a2d01eaa3f55029fd2eef3fd86b0b15", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.857707509881423, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def ascan; gets.split.map(&:to_i);end\n\nrequire 'prime'\n\nn,k = ascan\n\nh = {}\nPrime.prime_division(n).each{|k,v| h[k]=v}\n\nh2 = h[2] || 0\nh5 = h[5] || 0\n\nh10 = [h2,h5].min\n\n\nif h10 >= k\n p n\nelse\n n *= 2**(k-h2)\n n *= 5**(k-h5)\n p n\nend", "lang": "Ruby", "bug_code_uid": "f091abf8278f65cbd2fcfb52891a1118", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "be91327737bc1a31c6139b081194018d", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.25072463768115943, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 14, "bug_source_code": "\n\n\nsize = gets.split(' ').collect{|i| i.to_i}\nb1 = gets.split(' ').collect{|i| i.to_i}\nb2 = gets.split(' ').collect{|i| i.to_i}\n\nboard_area = size[0] * size[1]\nb1_area = b1[0] * b1[1]\nb2_area = b2[0] * b2[1]\n\nif(board_area < b1_area + b2_area)\n puts 'YES'\nelse\n puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "ed59be4c7e8977d5f1480e8352789440", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "c15de0da9b2250153ed5ca6551fed40d", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7743467933491687, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "# Fitting Arts\n\ninp = Array.new\nfor i in 0..2\n\tinp.push (gets.chomp.split().map { |e| e.to_i }) ###\nend\n\nx = Array.new\nfor i in 0..2\n\tx.push(inp[i][0].to_i)\n\tx.push(inp[i][2].to_i)\nend\n\ninput = Array.new(3) { |i| Array.new(2) }\nfor i in 0..5\n\tinput[i/2][i%2] = x[i]\t\nend\n\nout = \"NO\"\nfor i in 0..1\n\tfor j in 0..1\n\t\tfor k in 0..1\n\t\t\tif input[1][i] + input[2][j] <= input[0][k] \n\t\t\t\tif [input[1][(i+1)%2] , input[2][(j+1)%2]].max <= input[0][(k+1)%2]\n\t\t\t\t\tout = \"YES\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend\n\nputs out", "lang": "Ruby", "bug_code_uid": "92d536155522f3c211a6ed4b18863799", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "cbf888d72942cddc55287f1e51901d36", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.30587241233629064, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "board = gets.chomp.split(' ').map {|item| item.to_i}\npainting = gets.chomp.split(' ').map {|item| item.to_i}\npainting_2 = gets.chomp.split(' ').map {|item| item.to_i}\nflag = false\n\n\nif painting[0] + painting_2[0] == board[0]\n\tif painting[1] <= board[1] && painting_2[1] <= board[1]\n\t\tflag = true\n\tend\nend\n\nif painting[0] + painting_2[1] == board[0]\n\tif painting[1] <= board[1] && painting_2[0] <= board[1]\n\t\tflag = true\n\tend\nend\n\nif painting[1] + painting_2[0] == board[0]\n\tif painting[0] <= board[1] && painting_2[1] <= board[1]\n\t\tflag = true\n\tend\nend\n\nif painting[1] + painting_2[1] == board[0]\n\tif painting[0] <= board[1] && painting_2[0] <= board[1]\n\t\tflag = true\n\tend\nend\n\nif painting[0] + painting_2[0] == board[1]\n\tif painting[1] <= board[0] && painting_2[1] <= board[0]\n\t\tflag = true\n\tend\nend\n\nif painting[0] + painting_2[1] == board[1]\n\tif painting[1] <= board[0] && painting_2[0] <= board[0]\n\t\tflag = true\n\tend\nend\n\nif painting[1] + painting_2[0] == board[1]\n\tif painting[0] <= board[0] && painting_2[1] <= board[0]\n\t\tflag = true\n\tend\nend\n\nif painting[1] + painting_2[1] == board[1]\n\tif painting[0] <= board[0] && painting_2[0] <= board[0]\n\t\tflag = true\n\tend\nend\n\nputs \"YES\" if flag\nputs \"NO\" if !flag\n", "lang": "Ruby", "bug_code_uid": "28cc8827648c207f9636baf0d05aa652", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "4f888cf9a6646c63fe9faebecd32f1f4", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9955555555555555, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def calc(n,m,d)\n\tk = (n - 1) / d + 1\n t = (m - 1) / d + 1\n i = (n - 1) % d + 1\n j = (m - 1) % d + 1\n return k * t * i * j\nend\n\ndef countone(x, d)\n\tdd = ((x-1)/d)+1\n\treturn (((x-1) % d)+1)*dd\nend\n\ns = gets.chomp\nns,ms,ds = s.split(/ /)\nn = ns.to_i\nm = ms.to_i\nd = ds.to_i\nret = n*m\nif (n > d) || (m > d) \n\tif (n <= d)\n\t\tni = 2\n\telse\n\t\tni = countone(n,d)\n\tend\n\tif (m <= d)\n\t\tmi = 2\n\telse\n\t\tmi = countone(m,d)\n\tend\n\tret = ni*mi\nend\nputs ret\n", "lang": "Ruby", "bug_code_uid": "7acbaa1ce94a9ab76957b0a365463c48", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "c9f559f42e922611907b06dcd924a5ff", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9584055459272097, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def num_solutions(a1, b1, c1, a2, b2, c2)\n if a2 == 0 and b2 == 0\n if c2 != 0\n return 0\n else\n if a1 == 0 and b1 == 0\n return (c1 == 0 ? -1 : 0)\n elsif a1 == 0 or b1 == 0\n return 1\n else\n return -1\n end\n end\n end\n det = a1*b2-a2*b1\n return 1 if det != 0\n det2 = a1*c2-a2*c1\n det3 = b1*c2-b2*c1\n return ((det2 == 0 and det3 == 0) ? -1 : 0)\nend\n\na1, b1, c1 = gets.split.map(&:to_i)\na2, b2, c2 = gets.split.map(&:to_i)\n\nif a1 == 0 and b1 == 0\n a1, b1, c1, a2, b2, c2 = a2, b2, c2, a1, b1, c1\nend\n\nputs num_solutions(a1, b1, c1, a2, b2, c2)\n", "lang": "Ruby", "bug_code_uid": "d80966d6bddedf1f9365ca1c321507f0", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "481067f5c0e33d3b00c14753ebaf029a", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.11328125, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "(a1,b1,c1)=gets.chomp.split.map{|i| i.to_i}\n(a2,b2,c2)=gets.chomp.split.map{|i| i.to_i}\nif a1 == 0 && b1 == 0&&c1!=0\n puts(-1)\nend\nif a2==0&&b2==0&&c2!=0\n puts(-1)\nend\nputs a1*b2-a2*b1 == 0 ? -1 : 1\n", "lang": "Ruby", "bug_code_uid": "e530adeb213918651ce278d7a267e5af", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "4c4e53128e851f5b909f84720bf4c0e9", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.703125, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "def solve(n,k)\n big=n;small=k\n a=0\n while big!=1||small!=1\n big-=small\n if big 200\n\tabort(\"Incorrent input string\")\nend\n\nwhile remix.include? wubWord\n\t#remix[wubWord] = \" \"\n\tremix = remix.sub(\"WUB\", \" \")\nend\n\nsplitted = remix.split(\" \")\noriginal = splitted.join(\" \")\n\nputs original", "lang": "Ruby", "bug_code_uid": "0243967b2f829638661efb0c4fcde84f", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "ca6f0460378cb80fa9d5b104177cb753", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6330935251798561, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n,k,*a=$<.read.split.map &to_i\np a.count{|e|e<=k}", "lang": "Ruby", "bug_code_uid": "5484a8434b11ec5afada537c983c3ec8", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "da6feb8cb957b604d38bcf0dddd3e3b6", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9887640449438202, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k,*a=$<.read.split.map &:to_i\np a.all?{|e|e<=k}?n:a.index{|e|e>k}+(n-a.rindex{|e|e>k})", "lang": "Ruby", "bug_code_uid": "e182b3e380c3d3dc8c2be31961b41035", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "da6feb8cb957b604d38bcf0dddd3e3b6", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.936, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "m, n = STDIN.read.split.map &:to_i\n\nif n.odd?\n c = (m * (n - 1)) / 2\n c += (m - 1) / 2\nelse\n c = m * n / 2\nend\n\nprint c", "lang": "Ruby", "bug_code_uid": "8c6dd6a3dafa93d11c0949fbfc55b53d", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "62b83fc08ed07f52fb4c98ae2cf751f4", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.875, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "def adjust_number(number)\n if(number % 3 == 0)\n find_number(number)\n elsif\n find_number(number + 1)\n else\n find_number(number + 2)\n end\nend\ndef find_number(number)\n loop do\n if (sum_of_digit(number) % 4 == 0)\n puts number\n break\n end\n number += 3\n end\nend\ndef sum_of_digit(number)\n @sum = 0\n while number > 0\n @sum += (number)%10\n number /= 10\n end\n return @sum\nend\nnumber = gets.chomp.to_i\nadjust_number(number)", "lang": "Ruby", "bug_code_uid": "11f3adefd9f5db65319734397fe65565", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "5a6073e1d06453338f53044d6153626e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9872340425531915, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m,k,*a=$<.read.split.map(&:to_i)\nb=a.map.with_index{|e,i|0= 5 && (password.split('').to_a & digits).length > 0 && (password.split('').to_a & small_letters).length > 0 && (password.split('').to_a & big_letters).length > 0\n\tputs 'Correct'\nelse\n\tputs 'Too weak'\nend", "lang": "Ruby", "bug_code_uid": "18f4baed79d387fcf8ee3fd3373edead", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "dd838f06a3fb940ec20cf4900f20293d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9920634920634921, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nl = 1\nr = 10**14\nwhile l+1 @numX\n return true if @numX > @num0 + 1\n return true unless @numX + @num0 + @numP == 9\n return true if too_many_wins?\n end\n\n def is_draw?\n return false if @num_winning_rows > 0\n return true if @numX + @num0 == 9\n end\n\n def second_won?\n return false if too_many_wins?\n return @ohWins\n end\n\n def first_won?\n return false if too_many_wins?\n return @xWins\n end\n\n def second_turn?\n @numX == @num0 + 1\n end\n\n def first_turn?\n @numX == @num0\n end\n\n def how_many_in_a_row?\n num = 0\n (0..2).each { |col| num += 1 if horizontal_win(col) }\n (0..2).each { |row| num += 1 if vertical_win(row) }\n num += 1 if left_right_win\n num += 1 if right_left_win\n num\n end\n\n def horizontal_win(xPos)\n return false unless @lines[xPos][0] == \"X\" || @lines[xPos][0] == \"0\"\n if @lines[xPos][0] == @lines[xPos][1] && @lines[xPos][1] == @lines[xPos][2]\n set_winner(@lines[xPos][0])\n @horizontal_winner = true\n return true\n end\n end\n\n def vertical_win(yPos)\n return false unless @lines[0][yPos] == \"X\" || @lines[0][yPos] == \"0\"\n if @lines[0][yPos] == @lines[1][yPos] && @lines[1][yPos] == @lines[2][yPos]\n set_winner(@lines[0][yPos])\n @vertical_winner = true\n return true\n end\n end\n\n def left_right_win\n return false unless @lines[0][0] == \"X\" || @lines[0][0] == \"0\"\n if @lines[0][0] == @lines[1][1] && @lines[1][1] == @lines[2][2]\n set_winner(@lines[0][0])\n @diag_winner = true\n return true\n end\n end\n\n def right_left_win\n return false unless @lines[2][0] == \"X\" || @lines[2][0] == \"0\"\n if @lines[2][0] == @lines[1][1] && @lines[1][1] == @lines[0][2]\n set_winner(@lines[2][0])\n @diag_winner = true\n return true\n end\n end\n\n def set_winner(player)\n @xWins = true if player == \"X\"\n @ohWins = true if player == \"0\"\n end\n\n def too_many_wins?\n return false if @num_winning_rows == 1 || @num_winning_rows == 0\n return true if @num_winning_rows > 2\n winner = @xWins ? \"X\" : \"0\"\n return true if @horizontal_winner && !@diag_winner && !@vertical_winner\n return true if @vertical_winner && !@diag_winner && !@horizontal_winner\n return false\n end\nend\n\n\ndef solve\n l1 = gets.chomp\n l2 = gets.chomp\n l3 = gets.chomp\n grid = Grid.new([l1, l2, l3].join(\"\\n\"))\n puts grid.analyze()\nend\n\nsolve()", "lang": "Ruby", "bug_code_uid": "b7be959c87d6a2c33017676e31fe377d", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "576f53cd316f71b435bcac6152d9f145", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9327014218009478, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "board = Array.new\n3.times do\n board << gets.split(//)\nend\nfl = false\nsl = false\nfc = 0\nsc = 0\n0.upto(2) do |i|\n 0.upto(2) do |j|\n if board[i][j]==\"X\"\n fc+=1\n elsif board[i][j]==\"0\"\n sc+=1\n end\n end\n if board[i][0]==board[i][1] and board[i][1]==board[i][2]\n if board[i][0]==\"X\"\n fl = true\n elsif board[i][0]==\"0\"\n sl = true\n end\n end\n if board[0][i]==board[1][i] and board[1][i]==board[2][i]\n if board[0][i]==\"X\"\n fl = true\n elsif board[0][i]==\"0\"\n sl = true\n end\n end\nend\nif board[0][0]==board[1][1] and board[1][1]==board[2][2]\n if board[0][0]==\"X\"\n fl = true\n elsif board[0][0]==\"0\"\n sl = true\n end\nend\nif fc==sc\n if fl\n puts \"illegal\"\n elsif sl\n puts \"the second player won\"\n else\n puts \"first\"\n end\nelsif fc==sc+1\n if sl\n puts \"illegal\"\n elsif fl\n puts \"the first player won\"\n else\n if fc+sc==9\n puts \"draw\"\n else\n puts \"second\"\n end\n end\nelse\n puts \"illegal\"\nend\n", "lang": "Ruby", "bug_code_uid": "613152e9f53d348fa685bfd8fc69b192", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "be071e8c4ecae385df10a5c83235414e", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9824561403508771, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\na=0;b=0\n$<.read.split(')').each{|e|\n\tx,y=e.split('(')\n\tx.scan(/[A-Za-z]+/).each{|f|a=[a,f.size].max}\n\tb+=(y||'').scan(/[A-Za-z]+/).size\n}\nputs [a,b]*' '", "lang": "Ruby", "bug_code_uid": "ffed5f86e0c90f7af7a88feff4ddaf8d", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "5ded67d16eeb6780c1ad86d33bc9c946", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9824561403508771, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets\nres=[]\ns=gets.chomp\nwhile s=~/\\(_*([^()]*)_*\\)/\n t=$&\n res[1]+=$1.split(/_+/).size if $1\n s[t]=?_\nend\nres[0]=s.split(/_+/).map(&:size).max || 0\nputs res*' '", "lang": "Ruby", "bug_code_uid": "6ec57d7a716ed319a482b3e3a3e5bad5", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "9b826544f74f4c233637b828b725ceea", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9877094972067039, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n\ndef main\n n = gets\n words = gets\n in_brackets = /\\([^)]+\\)/\n out_brackets = /(?:\\A|\\))[^\\(]+\\(/\n word_gex = /[A-Za-z]+/\n inner_brackets = words.scan(in_brackets)\n outer_brackets = words.scan(out_brackets)\n inner_words = inner_brackets.map{|s| s.scan(word_gex)}.flatten\n outer_words = outer_brackets.map{|s| s.scan(word_gex)}.flatten\n l = (outer_words.map(&:length).max) || 0\n i = (inner_words.length)\n puts(\"#{l} #{i}\")\nend\n\nmain\n", "lang": "Ruby", "bug_code_uid": "b04393175e3f29a7b325e782207b1be1", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "bd75ca9a6ed5808c900c7897f4e2b6a4", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9802816901408451, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "gets\ns=gets.chomp\nq=s.scan(/\\(\\w+\\)/).map{|v|v[1..v.size-2]}*'_'\nr=s.split(/\\(\\w+\\)/)*'_'\nputs \"#{(r.split('_')+[\"\"]).map{|v|v.size}.max} #{q.split('_').select{|v|v!=\"\"}.size}\"\n", "lang": "Ruby", "bug_code_uid": "3e2fff1ce471167b7b4ebf6277eb3296", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "b119ff3737ad82349c4b51ad74abe8e0", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9675213675213675, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "def main\n\tnum = gets.chomp\n\thash = {1=>'one',\n\t\t2=> 'two',\n\t\t3=>'three',\n\t\t4=> 'four',\n\t\t5=> 'five',\n\t\t6=> 'six',\n\t\t7=> 'seven',\n\t\t8=> 'eight',\n\t\t9=> 'nine',\n\t\t10=> 'ten',\n\t\t11=> 'eleven',\n\t\t12=> 'twelve',\n\t\t13=> 'thirteen',\n\t\t20=> 'twenty',\n\t\t30=> 'thirty',\n\t\t40=> 'fourty',\n\t\t50=> 'fifty',\n\t\t60=> 'sixty',\n\t\t70=> 'seventy',\n\t\t80=> 'eigthty',\n\t\t90=> 'ninety'\n\t\t}\n\tif num.to_i == 0\n\t\treturn 'zero'\n\telsif num.to_i == 15\n\t\treturn 'fifteen'\n\telsif num.to_i < 14 || hash.include?(num.to_i)\n\t\treturn hash[num.to_i]\n\telsif num.to_i > 13 && num.to_i < 20 \n\t\treturn hash[num[1].to_i].to_s+'teen'\n\telsif num.to_i > 90\n\t\treturn hash[90] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 80\n\t\treturn hash[80] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 70\n\t\treturn hash[70] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 60\n\t\treturn hash[60] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 50\n\t\treturn hash[50] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 40\n\t\treturn hash[40] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 30\n\t\treturn hash[30] +'-'+hash[num[1].to_i].to_s\n\telsif num.to_i > 20\n\t\treturn hash[20] +'-'+hash[num[1].to_i].to_s\n\tend\nend\nmain", "lang": "Ruby", "bug_code_uid": "cf8bde16b3b407ba303fe47d77d8735a", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "be91ac8c5b07d679484c4ecdd9fee5b2", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.987363100252738, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "hash = {\n 0 => \"zero\",\n 1 => \"one\",\n 2 => \"two\",\n 3 => \"three\",\n 4 => \"four\",\n 5 => \"five\",\n 6 => \"six\",\n 7 => \"seven\",\n 8 => \"eight\",\n 9 => \"nine\",\n 10 => \"ten\",\n 11 => \"eleven\",\n 12 => \"twelve\",\n 13 => \"thirteen\",\n 14 => \"fourteen\",\n 15 => \"fifteen\",\n 16 => \"sixteen\",\n 17 => \"seventeen\",\n 18 => \"eighteen\",\n 19 => \"nineteen\",\n 20 => \"twenty\",\n 30 => \"thirty\",\n 40 => \"forty\",\n 50 => \"fifty\",\n 60 => \"sixty\",\n 70 => \"seventy\",\n 80 => \"eighty\",\n 90 => \"ninety\",\n}\nn = gets.to_i\nif n <= 20\n puts hash[n]\nelse\n puts \"#{hash[n/10 * 10]}-#{hash[n % 10]}\"\nend\n", "lang": "Ruby", "bug_code_uid": "79500a337fce01462e0995aa660342bd", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "9cbcc78cc287f96070962ee2ebaed9c2", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9926144756277696, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "arraynum1 = [\"zero\", \"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\"seven\",\"eight\",\"nine\"]\narraynum2 = [nil , nil ,\"twenty\",\"thirty\",\"forty\",\"fifty\",\"sixty\",\"seventy\",\"eighty\",\"ninety\"]\narraynumtens = [\"ten\",\"eleven\",\"twelve\",\"thirteen\",\"fourteen\",\"fifteen\",\"seventeen\",\"eighteen\",\"nineteen\"]\nnumero = gets.chomp\narray = numero.split(//)\nif numero.to_i >=10 && numero.to_i <20\n print \"#{arraynumtens[array[1].to_i]}\"\n\nelsif array.length == 2\n if array[1].to_i == 0\n print \"#{arraynum2[array[0].to_i]}\"\n else \n print \"#{arraynum2[array[0].to_i]}-\"+\"#{arraynum1[array[1].to_i]}\"\n end\nelsif array.length == 1\n print \"#{arraynum1[array[0].to_i]}\"\nend", "lang": "Ruby", "bug_code_uid": "448a1ef086594b3b7301ed57eed928ff", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "79c8620ea36dade2fce419344df79d84", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9988826815642458, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\na=[\"zero\", \"one\", \"two\", \"three\", \"for\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"]\na[20]=\"twenty\"\na[30]=\"thirty\"\na[40]=\"forty\"\na[50]=\"fifty\"\na[60]=\"sixty\"\na[70]=\"seventy\"\na[80]=\"eighty\"\na[90]=\"ninety\"\nif n>=0 && n<=20 || n==30 || n==40 || n==50 || n==60 || n==70 || n==80 || n==90\nputs a[n]\nelse\nputs a[n-n%10]+'-'+a[n%10]\nend", "lang": "Ruby", "bug_code_uid": "a330dfde234844ccb9ebeb5b4864a4f9", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "94fa437456b61df20acf2c3fbeab41f4", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9975609756097561, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "names = [\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"]\nvalue =gets.chomp\nword = gets.chomp\nk=0\ni=0\np=0\nresult_word=''\nnames.each do |name|\n if value.to_i == name.length\n\n while (ip\n result_word = name\n p=k\n end\n k=0\n end\nend\nputs result_word\n\n\n", "lang": "Ruby", "bug_code_uid": "9c4d170a1c4c423e4f9a556f7d1bc025", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "281b08b522fac58e69c13bf2ea36eea5", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7555555555555555, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "puts $<.map{|s|\"vapor\\njolt\\nflar\\nesp\\numbr\\nleaf\\nglac\\nsylv\".match(s.strip[0..-4])}.compact[1][0]+'eon'\n", "lang": "Ruby", "bug_code_uid": "6434c3fb38228904101526f1c8477b7c", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "1ce225d74158ef48d2d8a45b081ad3d7", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9555555555555556, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "\n\nn = gets.chomp.to_i\nname = gets.chomp\n\nletters = name.split(\"\")\ncheck = name.delete '.'\n\npokemons = [\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \n\t\t\t\t\t\"leafeon\", \"glaceon\", \"sylveon\"]\n\nif name.size == n\n\n\tpokemons.each do |pokemon|\n\n\t\tp = pokemon.split(\"\")\n\t\tc = 0\n\n\t\t(0...p.size).each do |l|\n\t\t\t#puts \"#{letters[l]} - #{p[l]} - #{(letters[l] == p[l])}\"\n\t\t\tc += (letters[l] == p[l])? 1 : 0\n\t\tend\n\n\t\tputs pokemon if c == check.size\n\n\tend\nelse\n\tputs \"Size #{n} doesnt match word '#{name}' (#{name.size}).\"\nend\n", "lang": "Ruby", "bug_code_uid": "6b1d86a8c7b0aca705ad3360859e5ef8", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "2cc783ccf1d630e72cb4052c88461b22", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8986486486486487, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "line = gets\nn = line.split(' ')[0].to_i\nx = line.split(' ')[1].to_i\ny = line.split(' ')[2].to_i\na = (n * y * 1.0 / 100).ceil\nputs a - x\n", "lang": "Ruby", "bug_code_uid": "4883581a5f176ba01517dfddcae5639d", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "bc54b4f05967841fd305915119c02ad9", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.48951048951048953, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "I = ->{gets.split.map(&:to_i)}\nn, a, b = I[]\nc = I[].sort\np c[b] - c[b - 1]\n", "lang": "Ruby", "bug_code_uid": "3e1b968ea093f4c0786cd1022e6d761c", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "7e45aa8cdd1f5cc48cbc35b91b0eebd5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.49480249480249483, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "arr = gets.chomp.split(\" \")\nn = arr[0].to_i\nx = arr[1].to_i\ny = arr[2].to_i\n\np = 0\n\nif x > n then\n k = x - n\nend\nif (x+p)*100 <= y*n and n*y%100 == 0 then\n p = n*y/100 - x + k\nelsif (x+p)*100 != y*n\n p = n*y/100 - x + 1 + k\nend\n\nputs p", "lang": "Ruby", "bug_code_uid": "c6516054e719936a67d53479c6002ae6", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "bfc4b4ceab1147c38ecfaaf42b4d5d96", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9577464788732394, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = ARGV ? $< : File(ARGV[0])\n\nn, x, y = input.gets.split(' ').map &:to_i\n\nneedTotal = n * y / 100.0\na = needTotal.ceil - x\n\nputs a\n", "lang": "Ruby", "bug_code_uid": "a219d74462f817c3e31257782373119b", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "28a2a9b63329887f90723095a97982f5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9466666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "ar = gets.chomp\nhs = ar.split(//).group_by{|x| x=~/[[:upper:]]/}\nif hs[0].length > hs[nil].length\n puts ar.upcase\nelse\n puts ar.downcase\nend", "lang": "Ruby", "bug_code_uid": "517bc57bfb69d58d67b6cea53ccc286e", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "609561edfdd8042dfd148bd95b474a40", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2841225626740947, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "word = gets\n\ni = 0\nup = 0\nlow = 0\n\nwhile i < word.length ;\n\tif word[i] <= 90\n\t\tup++\n\telse\n\t\tlow++\n\nif up > low\n\tword.upcase\nelse\n\tword.lowcase\n\nreturn word", "lang": "Ruby", "bug_code_uid": "03051501860ef5e89bcdd60cf51b6d57", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "4a85d7d77499012ed8cd75d73531bbc6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.599009900990099, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "word = gets\n\ni = 0\nup = 0\nlow = 0\n\nwhile i < word.length ;\n\tif word[i] <= 90\n\t\tup += 1\n\telse\n\t\tlow += 1\n\tend\n\ti += 1\nend\n\nputs up\nputs low\n\nif up > low\n\tprint word.upcase\nelse\n\tprint word.downcase\nend", "lang": "Ruby", "bug_code_uid": "f93967e6b517379bcaa4bd195bf9f09d", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "4a85d7d77499012ed8cd75d73531bbc6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9921259842519685, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, a, b = gets.split.map(&:to_i)\nans, k = 0, 2\nuntil (a-1)/k == (b-1)/k do\n k *= 2\n ans += 1\nend\nputs k == n ? \"Final!\" : ans", "lang": "Ruby", "bug_code_uid": "533028664eb7e20df8c5f905cd8a6d55", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "e8e778930932d1c0da832f238a98a824", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9957446808510638, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, p, k = gets.split.map { |x| x.to_i }\n\nif p-k > 1 ;\n\tprint ?<, ?<, ' '\nend\n\n(p-k).upto(p+k) do |i|\n\tif i == p ;\n\t\tprint ?(, i, ?), ' '\n\telsif i >= 1 && i <= n ;\n\t\tprint i, ' '\n\tend\nend\n\nif p-k < n ;\n\tprint ?>, ?>, ' '\nend\n\nprint ?\\n\n", "lang": "Ruby", "bug_code_uid": "952fef4165d1ec6d144b48ad0456db8c", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "be28e3b8e8ea1d7340b978c6eba06d55", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.975609756097561, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\n\nputs (n / 2250).to_i", "lang": "Ruby", "bug_code_uid": "15e23ea774ada60ceb68f7528cb777dd", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "23c585f3351feb674d4064e359f22365", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8125, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "p gets.to_i/1890", "lang": "Ruby", "bug_code_uid": "3ff43ff1facd40335d7c9017fc3efc30", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "490b826fc8afb9ab2748aa02b1cb8f10", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8336314847942755, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "a,b,n=gets.split.map(&:to_i)\n\nm=10**9+7\n\ndef pow(a,n,m)\n return 1 if n==0\n d=n%2\n r=pow(a,n/2,m)**2\n r*=a if d==1\n r%=m\nend\n\ndef fact(n,m)\n f=[1.0]\n for i in 1..n do\n f[i] = f[i-1]*i%m\n end\n f\nend\n\nf = fact(n,m)\n\ndef good? (x,a,b)\n while x > 0\n d=x%10\n return false if d!=a && d!=b\n x/=10\n end\n true\nend\n\ndef inv(a,m)\n pow(a.to_i,m-2,m)\nend\n\nr=0\nfor i in 0..n do\n if good?(a*i+(n-i)*b,a,b)\n r+=f[n]*inv(f[n-i]*f[i],m)\n r%=m\n end\nend\n\nputs r.to_i", "lang": "Ruby", "bug_code_uid": "70b0392381fd5909d7f2d6299b93f123", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "d6750f08de17e922ed7ef0a91b8d7289", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.865814696485623, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "$a,$b,$n=gets.split.map(&:to_i)\n$m=10**9+7\nf=[1.0]\n1.upto($n){|i|f[i]=f[i-1]*i%$m}\nf.map!(&:to_i)\ndef g(x)!(/[^#{$a}#{$b}]/=~x.to_s) end\ndef pow(x,p)p<1?1:pow(x,p/2)**2*(p%2==1?x:1)%$m end\nr=0\n($n+1).times do|i|\n if g($a*i+($n-i)*$b)\n r+=f[$n]*pow(f[$n-i]*f[i],$m-2)\n r%=$m\n end\nend\np r", "lang": "Ruby", "bug_code_uid": "2778a6c744d27a3169114638eb64438c", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "d6750f08de17e922ed7ef0a91b8d7289", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.19423368740515934, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "a,b,n=gets.split.map(&:to_i)\nm=10**9+7\ndef pow a,n,m\n return 1 if n==0\n d=n%2\n r=pow(a,n/2,m)**2\n r*=a if d==1\n r%=m\nend\nf=[1.0]\n1.upto(n){|i|f[i]=f[i-1]*i%m}\nf.map!(&:to_i)\ndef g x,a,b\n !(/[^#{$a}#{$b}]/=~x.to_s)\nend\nr=0\n(n+1).times do|i|\n if g(a*i+(n-i)*b,a,b)\n r+=f[n]*pow(f[n-i]*f[i],m-2,m)\n r%=m\n end\nend\np r", "lang": "Ruby", "bug_code_uid": "766966ebfbc6c0da76e08b3e8f043fc5", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "d6750f08de17e922ed7ef0a91b8d7289", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9895678092399404, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "$a,$b,$n=2,3,10#gets.split.map(&:to_i)\n$m=10**9+7\nf=[1.0]\n1.upto($n){|i|f[i]=f[i-1]*i%$m}\nf.map!(&:to_i)\ndef g(x)while x>0;x,d=x.divmod 10;return false if d!=$a&&d!=$b end; true end\ndef pow(x,p)p<1?1:pow(x,p/2)**2*(p%2==1?x:1)%$m end\nr=0\n($n+1).times do|i|\n if g($a*i+($n-i)*$b)\n r+=f[$n]*pow(f[$n-i]*f[i],$m-2)\n r%=$m\n end\nend\np r", "lang": "Ruby", "bug_code_uid": "643cdc1c220564311060f6fc1dc91942", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "d6750f08de17e922ed7ef0a91b8d7289", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.5472312703583062, "equal_cnt": 23, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 8, "fix_ops_cnt": 22, "bug_source_code": "n, k = gets.chomp.split(/ /).map(&:to_i)\nodds = []\neven = []\n(1..n).each do |i|\n odds << i if i.odd?\n even << i if i.even?\nend\nfinal = odds + even\nputs final[k - 1]\n", "lang": "Ruby", "bug_code_uid": "d67b4e9b1d4ea43fe4c51921ef352f60", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "5e273f8d715e4126eb258afd69d125e2", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9878682842287695, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, k = cin.split(/\\s+/).map {|x| x.to_i}\nclass Integer\n def num_at_position (k)\n chet_num, ostatok = self.divmod(2)\n nechet_num = chet_num + ostatok\n if k > nechet_num\n return (k - nechet_num) * 2\n else\n return k * 2 - 1\n end\n end\nend\n\nputs n.num_at_position(k)", "lang": "Ruby", "bug_code_uid": "5e9276d8d4035356aa30928852f5b461", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "9cc9a8cd900965a613eda98198495334", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5831842576028623, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "num = gets.chomp\nnum = num.split\nnumbers = num[0].to_i\nposition = num[1].to_i\n\nif position <= (numbers/2) + (numbers%2)\n\tnew_number = 1\n\tfor i in (2..position)\n\t\tnew_number += 2\n\tend\nelse\n\tnew_number = 2\n\tfor i in (1..position - ((numbers/2) + (numbers%2)))\n\t\tif i != 1\n\t\t\tnew_number += 2\n\t\tend\n\tend\nend\n\nprint new_number", "lang": "Ruby", "bug_code_uid": "a94218ae580433385a82b88bf40dcd66", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "1dcfde9e49aa0f7ea492c75305b1f1da", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4163265306122449, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#puts \"Enter the total number and position to find the number\\n\"\nn, v = gets.split.map(&:to_i)\na = [n]\nc = 0\nk = 0\nfor i in 1..n do\n if i%2 == 1\n a[k] = i\n k += 1 \n end\nend\nl = 0\nfor j in 1..n do\n if j%2 == 0\n a[k+l] = j\n l += 1\n end\nend\nputs a[v-1]", "lang": "Ruby", "bug_code_uid": "0acda5d5a9bb6b45e34b8a74ea7df82b", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "0fb41f772cfc69a7bfa767b8677207bd", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5823293172690763, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#puts \"Enter the total number and position to find the number\\n\"\nn, v = gets.split.map(&:to_i)\na = [n]\nif n%2 == 0\n c = n/2\nelse\n c = n/2 + 1\nend\n#puts c\nk = 0\nfor i in 1..n do\n if i%2 == 1\n a[k] = i\n k += 1\n else\n a[c] = i\n c += 1\n end\nend\n\nputs a[v-1]", "lang": "Ruby", "bug_code_uid": "552801e72d54656464ebb3161e282b85", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "0fb41f772cfc69a7bfa767b8677207bd", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.45595854922279794, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n,i = gets.split.map(&:to_i)\np (((1..n).to_a.each.select{|x| x.odd?}) + ((1..n).to_a.each.select{|x| x.even?}))[i-1]\n", "lang": "Ruby", "bug_code_uid": "e37de8b74bac79845704ecea2b3aa9e8", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "fa990108560847a53a4b8db3d2f09d0c", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9162011173184358, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "input = gets.split\nn = input[0].to_i\nk = input[1].to_i\nhalf = (n/2.0).ceil\n\nval = 0\nif k > half\n val = 2\n k -= half\nelse\n val = 1\nend\n\nfor i in 1..k-1\n val += 2\nend\n\nprint val\n", "lang": "Ruby", "bug_code_uid": "45d529cc8611d537a0e222d9b6317c3e", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "4f6791f61fda25f076adbd5d555163d8", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4845605700712589, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "input = gets.chomp.split(' ').map {|item| item.to_i}\n\nn = input[0]\nk = input[1]\n\nodd = []\neven = []\nresult = []\n\n(1..n).each do |number|\n odd << number if number % 2 == 1\n even << number if number % 2 == 0\nend\n\nresult = odd + even\n\nputs result[k - 1]", "lang": "Ruby", "bug_code_uid": "d5e01cf673170e1c93f8eb8410ebc4eb", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "3fec2eb6cd12b946631c058cf4604956", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9893617021276596, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "t, w, b = gets.strip.split.map(&:to_i)\n\nl = w.lcm(b)\na = t/l * [w, b].min\na += [t % l, [w, b].min].min\na -= 1\n\nif w == b then\n puts \"1/1\"\nelse\n g = a.gcd(t)\n puts \"#{a/g}/#{t/g}\"\nend\n", "lang": "Ruby", "bug_code_uid": "71167c147360cc0b775cecdb12e230ee", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "6e68c6f23df6695686925fbd1bc199e3", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9511400651465798, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "t, w, b = gets.split(\" \").map &:to_i\nx = [w, b].min * (t / w.lcm(b)) + ([w, b, 1 + t - [w, b].min * (t / w.lcm(b) * w.lcm(b))].min - 1)\ny = t\nputs Rational(x, y)", "lang": "Ruby", "bug_code_uid": "65cc3bfb0d06b2ff818b9a9a3126e2fd", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "e237627daa917af2e0a90fba075e4f80", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8593155893536122, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "t, w, b = gets.split(\" \").map &:to_i\nx = [w, b].min * (t / w.lcm(b)) + ([w, b].min - 1)\ny = t\nputs Rational.new(x, y)", "lang": "Ruby", "bug_code_uid": "ef32c1cdcb0e11a28538f9bd6743948f", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "e237627daa917af2e0a90fba075e4f80", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7657992565055762, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "a = gets.chomp.split\nn = a[0].to_i\nk = a[1].to_i\nx = 0\nif (k == (n*(n + 1))/2)\n x = 0 \nelse\n x = n - ((Math.sqrt(9 + (8 * (n + k)) - 3)/2))\nend\nputs (x).to_i", "lang": "Ruby", "bug_code_uid": "06edd885e98fd33b9d565071939da608", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "aadf3188a18dc68df9da50387f987bd2", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.5322128851540616, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "a = gets.chomp.split\nn = a[0].to_i\nk = a[1].to_i\nif (k == (n*(n + 1))/2)\n x = 0\nelsif( k == 0)\n x = (Math.sqrt(9 + (8 * n)) - 3)/2\nelse\n x = (Math.sqrt(2 * k))\nend\ny = x*(x+1)/2\ncount = 0\nwhile (y < n - x) do\n count += 1\nend\nputs (n - x).to_i", "lang": "Ruby", "bug_code_uid": "8e6113a9ee74b951ec719fad490c7228", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "aadf3188a18dc68df9da50387f987bd2", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.99, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\ncase n%4\nwhen 0\n\tputs \"1 A\"\nwhen 1\n\tputs \"0 A\"\nwhen 3\n\tputs \"2 A\"\nelse\n\tputs \"1 A\"\nend", "lang": "Ruby", "bug_code_uid": "f9d6d7d82cb20bd6b9d9fd1f35d7c553", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "cf83984e55c1c188ffa795c2aad8d829", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8866799204771372, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "def power(x, y, z)\n\tnumber = 1\n\twhile (y > 0) do\n\t\tif (y%2==1)\n\t\t\tnumber = number * x % z\n\t\tend\n\t\ty >>= 1\n\t\tx = x * x % z\n\tend\n\treturn number\nend\n\nn, m, k = gets.split.map(&:to_i)\nmd = 1000000007\np power(2, (n-1)*(m-1), md)", "lang": "Ruby", "bug_code_uid": "2cc5b8c8fff2c8ccf3e8789cb3479ef0", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "db043eb68ec52cffb45a7bbe3ecdd7c3", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8541666666666666, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "s = gets.to_i\nk = gets.to_i\nd = ( s / 2 ) / ( k + 1)\nputs \"#{d} #{d*k} #{s-d*(k+1)}\"", "lang": "Ruby", "bug_code_uid": "1565dd4873c9ae10f24765519c904647", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "4c3418b83e6f37f9c4def4bf92ab1a5d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9147982062780269, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "st = gets\ns = st.split.first.to_i\nk = st.split.second.to_i\nd = ( s / 2 ) / ( k + 1)\nputs \"#{d} #{d*k} #{s-d*(k+1)}\"", "lang": "Ruby", "bug_code_uid": "7e4bb50c03768143524dfc330e585ca0", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "4c3418b83e6f37f9c4def4bf92ab1a5d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7502467917077986, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "# ... LETS HACK THE WORLD ...\n#... KEEP CALM AND SAY LE ROI EST MORT IS HERE ...\n# ... EL-BADRY BECOME A LEGEND ...\nn, m, a = gets.chomp.split.map(&:to_i)\n\n if m%a==0 and n%a==0\n \n puts (m/a)*(n/a)\n \n if m%a!=0 and n%a!=0\n \n puts ((m/a)+1)*((n/a)+1)\n \n if m%a==0 and n%a!=0\n \n puts (m/a)*((n/a)+1)\n \n if m%a!=0 and n%a==0\n \n puts ((m/a)+1)*(n/a)\n \n", "lang": "Ruby", "bug_code_uid": "063433c0ed76f0709c0124c79d45b804", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "a38d835c94b1d0644519b64f77fadeb3", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8023952095808383, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "n=gets.to_i\nm=gets.to_i\na=gets.to_i\n\nif((n%a)==0)\n l = n/a;\nelse\n l = n/a;\n l = l+1;\nend\nif(m%a)==0\n p = m/a;\nelse\n p = m/a;\n p = p+1;\nend\nprint p*l", "lang": "Ruby", "bug_code_uid": "cff0a61356f335c23d9e40d8b302086a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "c0b34eac44ceaf4969ac9ac434f87fc3", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5217391304347826, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "loop{z=gets.split.map(&:to_i);p ((z[0]+z[2]-1)/z[2])*((z[1]+z[2]-1)/z[2])}", "lang": "Ruby", "bug_code_uid": "a95a6bfb64421943190341d2fc41a0de", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "4e826ce69e55ba39be9fe7765c79f2a9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4774774774774775, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "class A1\n def m(n, m, a)\n puts (n / a.to_f).ceil * (m / a.to_f).ceil\n end\nend\n\nn, m, a = gets.split.map(&:to_i)\na = A1.new\nputs a.m(n,m,a)\n\n", "lang": "Ruby", "bug_code_uid": "45837b6a9e3fa41076a01eb73806be07", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "c4708ec9c73956070332d94c1fe0e1bd", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.3983739837398374, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "class A1\n def m(n, m, a)\n (n / a.to_f).ceil * (m / a.to_f).ceil\n end\n end\nend\n\nn, m, a = gets.chomp.split(\"\\s\").map { |x| x.to_i }\na = A1.new\nputs a.m(n,m,a)\n\n", "lang": "Ruby", "bug_code_uid": "d9af1e1bea1ca644a28ff6b06f6b7969", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "c4708ec9c73956070332d94c1fe0e1bd", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.011466011466011465, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\t\n \n\n\n \n\n\n \n\t\n \n\n\t \n\n\t\n\n\n\n\t\t\n\n \n\t\t\n\t\n \t\n \n", "lang": "Ruby", "bug_code_uid": "dd5a7290a5a7c1f7848ba8dd6050411b", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e58a4b7db35e2ff65ec4ecd0bae65ac5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.015973786606594306, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n\n \n\n\n\n\t\t\n\n\n\n\n \n \n\t\n\t\t\n \t\n\n \n\n \t\n\n\n\n\n\t\t\n \n\t\n\n\t\n\t", "lang": "Ruby", "bug_code_uid": "5029345e6329444a032c8d35bba36993", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e58a4b7db35e2ff65ec4ecd0bae65ac5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.013925865246774524, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \n \t\n \t\n \n \t\n\t\n \n\t \n\n\t\n \n\t\n\n \t\n \n \t \n\t \t\n \t", "lang": "Ruby", "bug_code_uid": "7e9522f09755b87c0ef544f2edf1471e", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e58a4b7db35e2ff65ec4ecd0bae65ac5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.008594229588704727, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \n\n\n\n \n \n\n \n\n\n \n\n\n \t\t \n \n\n\n\n\n\n \t \n\t \t\t \t \n ", "lang": "Ruby", "bug_code_uid": "85cd428b476ab12b5e082caf2d3c4d25", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e58a4b7db35e2ff65ec4ecd0bae65ac5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6146788990825688, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "n = gets.to_i\nm = gets.to_i\na = gets.to_i\n\nt = (n % a).ceil\ny = (m % a ).ceil\nputs t * y ", "lang": "Ruby", "bug_code_uid": "d88d9ca2385c9315f8ef9409698df941", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "046292b503bbbbff82cf1b901ee32421", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6585365853658537, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n=gets.to_i\nm=gets.to_i\na=gets.to_f\n\nputs ((n/a).round) * ((m/a).round)\n", "lang": "Ruby", "bug_code_uid": "732d4ba1ed64be69ca89d9b183ae0017", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fab0aec715c4774e7f23f395b384f996", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5833333333333334, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "n = gets.to_i\nm = gets.to_i\na = gets.to_i\nputs ((n/a)+1)*((m/a)+1)", "lang": "Ruby", "bug_code_uid": "6d67e3b2a2614d27a97d3be61bb4c515", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "613b14c58b349514f03e6d98cd73fa52", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6440677966101694, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": " a = gets.chomp.to_i\n b = gets.chomp.to_i\n c = gets.chomp.to_i\n\n p a.fdiv(c).ceil * b.fdiv(c).ceil", "lang": "Ruby", "bug_code_uid": "6c286be40b39b7de8b04de6d9bf80619", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "ba61257be4f53d8a42a7006c7a7162d3", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.06844106463878327, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n = gets.chomp\n m = gets.chomp\n a = gets.chomp\n \n x = n/a;\n y = m/a;\n mod_n = n % a;\n if (mod_n > 0)\n x = x+1\n \n mod_m = m % a;\n if (mod_m > 0)\n y = y+1\n \n\n print(\"#{x*y}\")", "lang": "Ruby", "bug_code_uid": "fafa76fc44f593164e9fd32c9ae66534", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e4062d3f9068a5ff65c75e215f2d96e9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.25203252032520324, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "a,b,c=gets.split.map &:to_i\n\n x = n/a;\n y = m/a;\n mod_n = n % a;\n if (mod_n > 0)\n x = x+1;\n end\n \n mod_m = m % a;\n if (mod_m > 0)\n y = y+1;\n end\n \n\n puts x*y;", "lang": "Ruby", "bug_code_uid": "284efe117967c38800c2d3c89c737e38", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e4062d3f9068a5ff65c75e215f2d96e9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9828850855745721, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a,b,c=gets.split.map &:to_i;\n\n x = n/a;\n y = m/a;\n mod_n = n % a;\n if (mod_n > 0)\n x = x+1;\n end\n \n mod_m = m % a;\n if (mod_m > 0)\n y = y+1;\n end\n \n\n p (x*y);", "lang": "Ruby", "bug_code_uid": "7ac2c15099de3a338da5c08a92d31f2d", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e4062d3f9068a5ff65c75e215f2d96e9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6132075471698113, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "n = gets.chomp.to_i\nm = gets.chomp.to_i\na = gets.chomp.to_i\n\nputs ((n + a - 1) / a) * ((m + a - 1) / a)\n", "lang": "Ruby", "bug_code_uid": "80452a065cae1267f3d14f7cf38477b5", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "5093d4b3b447e3bba5c12e026a664406", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.32950191570881227, "equal_cnt": 18, "replace_cnt": 4, "delete_cnt": 12, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "m = ARGV[1].to_i\nn = ARGV[0].to_i\na = ARGV[2].to_i\np ((m / a) + ((m % a)<=> 0)) * ((n / a) + ((n % a) <=> 0))", "lang": "Ruby", "bug_code_uid": "f2fb2a703fe4833cf9bf1ad2e1c9b976", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6681d18ebaea5ced3c3a902866fdbdd5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.55, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "m, n, a = gets.split.map(&:to_i)\np (m / a + (m%a)/(10**(m%a)))*(n / a + (n%a/(10**(n%a)))", "lang": "Ruby", "bug_code_uid": "c93243c650b773880c3df267d58b2d3a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6681d18ebaea5ced3c3a902866fdbdd5", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7435897435897436, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, m, a = ARGV\nputs (n.to_f/a.to_f).ceil * (m.to_f/a.to_f).ceil\n", "lang": "Ruby", "bug_code_uid": "0b6e59e18432af9360f31ef91785e44a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "b96df704698f7d4e5bb402aa5ab57f2c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.05929919137466307, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\nm = gets.to_i\na = gets.to_i\n\n# m_tolerance\n# n_tolerance\nm_tolerance = (m / a).ceil\nn_tolerance = (n / a).ceil\n# m\u304b\u3089\u8003\u3048\u308b\n\nputs m_tolerance + n_tolerance - 1\n", "lang": "Ruby", "bug_code_uid": "4835bf2cd322e14acc3d09b095001bd6", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "78b280e9e64fcc6acfb5cbd348ba6e6d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7665952890792291, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n,m = gets().split(' ')\nn,m = n.to_i, m.to_i\nk1 = n / m + (n % m > 0 ? 1 : 0)\nk2 = n - (m - 1)\ncouples = lambda {|n| n*(n-1)/2}\nsame = n%m == 0 ? m : n%m\nprint couples.call(k1)*same, ' ', couples.call(k2)", "lang": "Ruby", "bug_code_uid": "1c145f142857946f90599d3ab6c1668c", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "f7e5a54b567775a00d01e2147f9882c8", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9611650485436893, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\nn,m = gets.split.map{|x| x.to_i}\n\ndef C(x)\n\treturn x*(x-1)/2\nend\n\ndef kmin(n,m)\n\tk = (n/m).floor\n\tr = n&m\n\treturn C(k)*(m-r)+C(k+1)*r\t\nend\n\ndef kmax(n,m)\n\treturn m-1+C(n-m+1)\nend\n\nputs \"#{kmin} #{kmax}\"", "lang": "Ruby", "bug_code_uid": "0263c0323470afd2fdeb403687dd1d9d", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "a7e4df534f105615c4ead06d3c08bf8f", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7230169050715215, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def comb(n,r)\n\treturn 0 if n < r\n return 1 if n == r\n return n if r == 1\n return 1 if n == 0 \n comb(n-1,r) + comb(n-1,r-1)\nend\n\nn,m = gets.split(\" \").map(&:to_i)\nmax = comb(n-m+1,2)\n\nq = n / m\nr = n % m\nmin = 1\nmin = (r * comb(q+1,2)) + ((m-r) * comb(q,2))\n\nputs \"#{min} #{max}\"", "lang": "Ruby", "bug_code_uid": "c6f059bd31076f940cd7b3e706161935", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "b6f6d9971166e020be4ed8c611563e8c", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6065857885615251, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n, m = gets.chomp.split.map(&:to_i)\ndef fi(n)\n f = 0\n for i in 1...n\n f += i\n end\n f\nend\nmax = fi(n - m + 1)\nif n % m == 0\n min = fi(n / m) * m\nelse\n a = []\n min = 0\n m.times do\n a << n / m\n end\n (n % m).times do |i|\n a[i] += 1\n end\n m.times do |i|\n min += fi(a[i])\n end\nend\nprint min, \" \", max, \"\\n\"\n", "lang": "Ruby", "bug_code_uid": "76cdd450c57ad1b1e9c2b29b259d30fe", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "162391eee797a665944c7b7594ef0ae7", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.702928870292887, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#ruby 2.4.1 \n\nrequire \"prime\"\nt = gets.to_i\nt.times do |a, b|\n\tnums = gets\n\ta1, b1 = nums.split\n\ta = a1.to_i\n\tb = b1.to_i\t\n\tif Prime.prime?(((a+b)*(a-b))) == true\n\t\tputs \"YES\"\n\telse\n\t\tputs \"NO\"\n\tend\n\t#puts \"#{a} #{b}\"\nend", "lang": "Ruby", "bug_code_uid": "bfa252129b1c4252aec691043e01bbd6", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "7941b37b6fe01b133280ffabfe83bad4", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.88, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#ruby 2.4.1 \n\nrequire \"prime\"\nt = gets.to_i\nt.times do |a, b|\n\tflag = false\n\tnums = \"\"\n\tnums = gets\n\ta1, b1 = nums.split(' ')\n\ta = a1.to_i\n\tb = b1.to_i\n\tif ((a-b)*(a+b)) == (a + b)\n\t\tputs \"YES\"\n\telse\n\t\tputs \"NO\"\n\tend\nend", "lang": "Ruby", "bug_code_uid": "e4a0c4d510234ead7a25f534e6a7b08f", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "7941b37b6fe01b133280ffabfe83bad4", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.11049723756906077, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "dasklaskjdaskjdkjasjkdasjkjkd", "lang": "Ruby", "bug_code_uid": "ccae738c8fb83ee5d6e7b0ebc99f3a2e", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "6749b7c19b683f777e44059bad5777b4", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8605577689243028, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n,m = gets.split.map(&:to_i)\n\nif n < m\n puts \"Impossible\"\nelse\n puts n + m - [n,m].min, n + m - [1,m].min", "lang": "Ruby", "bug_code_uid": "24f290bd826b24b7a76bde22a2f91ef3", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "f6853e9b6df01d8512e5205cd4c28b8e", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6392857142857142, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#!/usr/bin/ruby\ninclude Math\n\ndata = gets.split.map{ |x| x.to_i}\notona = data[0]\nkodomo = data[1]\n\nif otona == 0\n puts \"impossible\"\nelse\n print otona+kodomo-1\n print ' '\n kodomo -= min(otona,kodomo)\n print otona+kodomo\n print \"\\n\"\nend\n", "lang": "Ruby", "bug_code_uid": "10b0f859e7f3dbcd846c6af275d4598e", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "33e3549e4a9b1403de3490b1d58ae057", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7114624505928854, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n,m=gets.split.map(&:to_i)\nif n==0\n puts \"Impossible\"\nelse \n puts \"#{nmin(r/k,y) ?\"NO\":\"YES\"", "lang": "Ruby", "bug_code_uid": "91d5edd3c90000ed3403cdc0f944aae3", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "c9c206bb37d872244e31582617a6953b", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8589743589743589, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "l,r,x,y,k=gets.split.map &:to_i\nputs [l,x*k-k+1].max>[r,y*k].min ? 'NO':'YES'", "lang": "Ruby", "bug_code_uid": "d8ea604215cfe5db335bcdaf66cff63e", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "c9c206bb37d872244e31582617a6953b", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9466666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nn,x=gets.split.map(&:to_i)\np 1.step(n).count{|i|x%i==0}", "lang": "Ruby", "bug_code_uid": "c0fdc2cff08e8ac177bc4a384b825313", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "4657403c9cf410ef593c19f9421664d2", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7889908256880734, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "n, x = gets.split.map(&:to_i)\ns = 0\n\nfor i in 1..n\n s+=1 if x % i == 0\nend\n\ns-=1 if x > n\n\nputs s\n", "lang": "Ruby", "bug_code_uid": "09e33a07c8d2dea71c30e383ccff314d", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "eb8e6000fbae9d31bb0964520d9d1116", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8260869565217391, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "n, x = gets.split.map(&:to_i)\ns = 0\nfor i in 1..n do\n for j in 1..n do\n s+=1 if i*j == x\n end\nend\n\nputs s\n", "lang": "Ruby", "bug_code_uid": "4a9b1ec528dc05c9c066258ea46b7445", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "eb8e6000fbae9d31bb0964520d9d1116", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9635922330097088, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = gets.chomp.to_i\nk = gets.chomp.to_i\na = gets.chomp.to_i\nb = gets.chomp.to_i\n\nresult = 0\n\nif k != 1\n while n != 1\n if(n%k == 0)\n sum = (n - n/k) * a\n \n \n \n if(b < sum)\n result += b\n n = n/k\n else\n result += (n - 1) * a\n break\n end\n else\n n -= 1\n result += a\n end\n end\nelse\n result = (n - 1) * a\nend\n\nputs result\n\n\n", "lang": "Ruby", "bug_code_uid": "0882912f78b209a16cfd73d8fca86b1b", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "84e3e50400b224db62287dfc0e4f60ab", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9349693251533743, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n = gets.chomp.to_i\nk = gets.chomp.to_i\na = gets.chomp.to_i\nb = gets.chomp.to_i\n\nresult = 0\n\nif k != 1\n while n != 1\n if(n%k == 0)\n sum = (n - n/k) * a\n \n n = n/k\n \n if(b < sum)\n result += b\n else\n result += (n - 1) * a\n break\n end\n else\n n -= 1\n result += a\n end\n end\nelse\n result = (n - 1) * a\nend\n\nputs result\n\n\n", "lang": "Ruby", "bug_code_uid": "eed317aeb70a86ad5e16bbdaf48b5a6c", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "84e3e50400b224db62287dfc0e4f60ab", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9682539682539683, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "num = [8,4,6,2]\nn = gets.to_i\nputs n == 0 ? 1 : num[(n-1) % 4]\n", "lang": "Ruby", "bug_code_uid": "0ad2e4dc9a5528c873715478eb982eb2", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "2db246f2c9f522e620a9e013e7377990", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.3924050632911392, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# coding: utf-8\n\n# if __FILE__ == $0\n# end\n\n# power of 1378, and last digit\nn = gets.to_i\nbase = 8\n(n-1).times {\n base *= 8\n base = base % 10\n}\n\nputs base", "lang": "Ruby", "bug_code_uid": "1065c7c99a119d37dc3fa2889ce5efe0", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "09df07917c6f77adcad9b038aa9a05a0", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7862068965517242, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.strip.to_i\na = [8, 4, 2, 6]\nn -= 1\nputs a[n % 4]", "lang": "Ruby", "bug_code_uid": "ce98d3d1eb2808b52c0fa9e1d4b82c19", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "e0097c95565692fb23aac7c208c25bf7", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2962962962962963, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "puts (1378**gets.to_i).to_s.chars.last\n", "lang": "Ruby", "bug_code_uid": "b796b1f92a4abd7804bc1e30ab804d03", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "79ae4c6346391ee8598575626290ac42", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9977477477477478, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\n\nk,b,n,t = gets.split.map(&:to_i)\n\nif k == 1\n puts [0, ((1+n*b-t)/b.to_f).ceil].max\nelse\n lim = Math.log(t) / Math.log(k)\n left = 0\n right = n\n 30.times do\n center = (left+right) / 2\n if n-center > lim\n left = center\n else\n sum = k**(n-center) + b*(1-k**(n-center))/(1-k)\n if sum <= t\n right = center\n else\n left = center+1\n end\n end\n end\n\n puts (left+right)/2\nend\n", "lang": "Ruby", "bug_code_uid": "9709ed7d0cf02b4b856f29606cd9ece2", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "bc2a3705853ec1e82b207cb177463b4a", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.926829268292683, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "k,b,n,t,x = gets.split.map{|i| i.to_i},1\nx,n=x*k+b,n-1 until x > t\nputs [0, n+1].max", "lang": "Ruby", "bug_code_uid": "a00a605f8a2a8fd42c01af454c6dcd7f", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "6066ece5e39ae8c56904ad28ce8accf9", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9847328244274809, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def all_equal(array)\n\treturn array.max == array.min \nend\nx = gets.to_i\ninstone = gets.chomp().split(\"\")\ncount =0\ni = 0 \nwhile i= 1 && g == 0 && r == 0) || ( g > 1 || r > 1 )\n\tres += 'G' if g == 1 || (b == 1 && r == 1) || (g >= 1 && b == 0 && r == 0) || ( b > 1 || r > 1 )\n\tres += 'R' if r == 1 || (b == 1 && g == 1) || (r >= 1 && b == 0 && g == 0) || ( b > 1 || g > 1 )\n\tputs res\nend\nprocess(arr)", "lang": "Ruby", "bug_code_uid": "003ed41c2d730f259da24668193b9656", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "c7cb684e35fefd0e08aefdf015f3689e", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.19944341372912802, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = gets.to_i\nc = gets.strip\nd = {'R'=>0, 'G'=>0, 'B'=>0}\nfor i in c.split('')\n d[i]+=1\nend\n\nr = ''\nif c.size == 0\n puts ''\nelsif d['R'] > 0 && d['G'] > 0 && d['B'] > 0\n puts 'BGR'\nelsif d['R'] == d['G'] && d['G'] == d['B']\n puts 'BGR'\nelsif d['R'] == d['G'] && d['B'] == 0\n if d['R'] > 1\n puts 'BGR'\n else\n puts 'B'\n end\nelsif d['R'] == d['B'] && d['G'] == 0\n if d['R'] > 1\n puts 'BGR'\n else\n puts 'G'\n end\nelsif d['G'] == d['B'] && d['R'] == 0\n if d['G'] > 1\n puts 'BGR'\n else\n puts 'R'\n end\nelsif d['R'] == 0 || d['G'] == 0 || d['B'] == 0\n if d['R'] == 0 && d['G'] == 0\n puts 'B'\n elsif d['R'] == 0 && d['B'] == 0\n puts 'G'\n elsif d['G'] == 0 && d['B'] == 0\n puts 'R'\n elsif d['R'] == 0\n if d['G'] == 2 && d['B'] == 1\n puts 'BR'\n elsif d['B'] == 2 && d['G'] == 1\n puts 'GR'\n else\n puts 'BGR'\n end\n elsif d['G'] == 0\n if d['R'] == 2 && d['B'] == 1\n puts 'BG'\n elsif d['B'] == 2 && d['R'] == 1\n puts 'GR'\n else\n puts 'BGR'\n end\n elsif d['B'] == 0\n if d['R'] == 2 && d['G'] == 1\n puts 'BG'\n elsif d['G'] == 2 && d['R'] == 1\n puts 'BR'\n else\n puts 'BGR'\n end\n end\nend\n", "lang": "Ruby", "bug_code_uid": "bdd6ddfa26468e33b7b59bb4bbfd7b69", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "917398ffa69b539e8ec368d2eb0e0844", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9069767441860465, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets;puts gets.gsub(/([aeiouy])+/,'\\1')", "lang": "Ruby", "bug_code_uid": "8730088209137e5e8f955779aec5ce33", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "4d8b56fe90b6311d3004ec822aa25f14", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9983416252072969, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def IsVowel(c)\n \"aeiou\".include?(c)\nend\n\ndef HasConsVowels(s)\n s.each_cons(2).to_a.map{|a, b| IsVowel(a)&&IsVowel(b)}.include?(true)\nend\ngets\ns = gets.chomp.chars\nuntil !HasConsVowels(s) do\ns.each_index do |i|\n next if i == 0\n s.delete_at(i) if IsVowel(s[i]) && IsVowel(s[i-1])\nend\nend\nputs s.join", "lang": "Ruby", "bug_code_uid": "bd9af737ef5eeed6d950c61f8fbabc3c", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "0081d54d45fcbfec0b70ddea746a9e13", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9866666666666667, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets\ns = gets\n\n1000.times{s = s.sub(/([aeiou])[aeiou]/,'\\1')}\n\nputs s\n", "lang": "Ruby", "bug_code_uid": "60a5f90441728ce05f65985b857796f4", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "dcbe1cb2af91d8fe986f236cbad08ef0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.994535519125683, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "length = gets.chomp().to_i\nword = gets.chomp().split(\"\")\ndel = 1\nvowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"]\nvowel = false\n\nfor i in 1..length do\n if vowels.include?(word[i - del]) and vowel == true\n word.delete_at(i - del)\n del += 1\n elsif vowels.include?(word[i - 1])\n vowel = true\n else\n vowel = false\n end\nend\n\nputs word.join", "lang": "Ruby", "bug_code_uid": "b6b32dea6f9f519657bf6e31190eb5cc", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "b37c8e60c187d3d99c109d510ceb5693", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.998158379373849, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "MOD=10**9+7\ncnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)\ndef gs() gets.chomp end\ndef gi() gets.to_i end\ndef gsmi() gets.chomp.split.map(&:to_i) end\n\ndef desc(ar) ar.sort!{|x,y|y<=>x} end\ndef min(a,b) a<=b ? a : b end\ndef max(a,b) a>=b ? a : b end\ndef sum(ar) ar.inject(:+) end\n\n#def bs(ar,eq,n) en=(eq==1 ? :>= : :>); ar.bsearch_index{|x|x.send(en,n)} end\ndef C(a,b) b==0||a==b ? 1 : (b=a-b if a/2=x2&&y4>=y2)||(x5<=x1&&y5<=y1&&x6>=x2&&y6>=y2)\n putsend('NO')\nend\n# half cover\n# \u305f\u3066\nif (y3<=y1&&y4>=y2 &&y5<=y1&&y6>=y2) && ((x5<=x2&&x6>=x2&&x3<=x1&&x4>=x1&&x4>=x5)||(x3<=x2&&x4>=x2&&x5<=x1&&x6>=x1&&x6>=x4))\n putsend('NO')\nend\n# \u3088\u3053\nif (x3<=x1&&x4>=x2 &&x5<=x1&&x6>=x2) && ((y5<=y2&&y6>=y2&&y3<=y1&&y4>=y1&&y4>=y5)||(y3<=y2&&y4>=y2&&y5<=y1&&y6>=y1&&y6>=y4))\n putsend('NO')\nend\n\nputsend('YES')\n", "lang": "Ruby", "bug_code_uid": "07715ac23da2accd2df3707370bea94e", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "56d0c5d78a09fa16a0c33a9be3654930", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9931972789115646, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\nchecked=Array.new(n,false);\ns=0\nn.times do |t|\n if checked[s] then puts \"NO\"; exit; end\n checked[s]=true;\n s=(s+t)%n\nend\nputs \"YES\"", "lang": "Ruby", "bug_code_uid": "1b6098d96b838de9905aaf606263e93d", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "968d94ff0c1798e1ab99ba56058d23f5", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9309623430962343, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "recipe = gets\nn = gets.split.map{|e| e.to_i}\np = gets.split.map{|e| e.to_i}\nbudget = gets.to_i\n\nk = [\"B\", \"S\", \"C\"].map{|e| recipe.count e}\n\nl = 0; r = budget + n.max; x = 0\nwhile l <= r\n m = (l + r) / 2\n sum_cost = k.map.with_index{|e, i| e == 0 ? 0 : (e * m - n[i]) * p[i]}.inject(:+)\n if sum_cost < budget\n l = m + 1\n x = m\n elsif sum_cost > budget\n r = m - 1\n else\n x = m\n break\n end\nend\nputs x\n", "lang": "Ruby", "bug_code_uid": "d67dc38fea7e99f56f739ae58e852ce5", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "7362de7b9b83f1deac355f476dc02e92", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8804469273743016, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "\nrecipe = gets.chomp\nhas = Hash.new(0)\nprice = Hash.new(0)\n\nhas['B'],has['S'],has['C'] = gets.split(\" \").map(&:to_i)\nprice['B'],price['S'],price['C'] = gets.split(\" \").map(&:to_i)\n\nruby = gets.to_i\n\n\ncost = 0\ncount = Hash.new(0)\nrecipe.each_char do |a|\n\tcost += price[a]\n\tcount[a] += 1\nend\n\npossible = {}\ncount.each_key do |a|\n\tpossible[a] = has[a] / count[a]\nend\n\nmin,max = possible.values.minmax\nrequired_cost = nil\n# puts \"min #{min} max #{max} coutn #{count}\"\nwhile min < max\n\tmid = min + ((max-min)+1)/2\n\n\tneeded_cost = 0\n\n\tcount.each_key do |a|\n\t\tmid_count = count[a] * mid\n\t\tif mid_count > has[a]\n\t\t\tneeded_cost += (mid_count - has[a]) * price[a]\n\t\tend\n\tend\n\n\tif needed_cost <= ruby # purchasing things amount should be less than ruby\n\t\trequired_cost = needed_cost\n\t\tmin = mid\n\telse\n\t\tmax = mid - 1\n\tend\nend\n# puts \"min #{min} max #{max} req #{required_cost}\"\n# puts \"cost #{cost}\"\n# puts \"count #{count}\"\n\nif required_cost\n\truby -= required_cost \nend\nans = max\n\nqty = ruby / cost\nspent = cost * qty\n# puts \"qt #{qty}\"\nans += qty\n\nruby -= spent\n\nremaining_cost = 0\n\ncount.each_key do |a|\n\trem = has[a] % (count[a] * max)\n\tremaining_cost += (count[a] - rem) * price[a]\nend\n# puts \"ruby #{ruby} rem #{remaining_cost} count #{count}\"\nif remaining_cost > 0 && ruby >= remaining_cost\n\tans += 1\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "fc230f364b2e8044d11a27c6b3005a2c", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "0dcf5274d41dde9af42c1af9273411fa", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8941954445260838, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "\nrecipe = gets.chomp\nhas = Hash.new(0)\nprice = Hash.new(0)\n\nhas['B'],has['S'],has['C'] = gets.split(\" \").map(&:to_i)\nprice['B'],price['S'],price['C'] = gets.split(\" \").map(&:to_i)\n\nruby = gets.to_i\n\n\ncost = 0\ncount = Hash.new(0)\nrecipe.each_char do |a|\n\tcost += price[a]\n\tcount[a] += 1\nend\n\npossible = {}\ncount.each_key do |a|\n\tpossible[a] = has[a] / count[a]\nend\n\nmin,max = possible.values.minmax\nrequired_cost = nil\n# puts \"min #{min} max #{max} coutn #{count}\"\nwhile min < max\n\tmid = min + ((max-min)+1)/2\n\n\tneeded_cost = 0\n\n\tcount.each_key do |a|\n\t\tmid_count = count[a] * mid\n\t\tif mid_count > has[a]\n\t\t\tneeded_cost += (mid_count - has[a]) * price[a]\n\t\tend\n\tend\n\n\tif needed_cost <= ruby # purchasing things amount should be less than ruby\n\t\trequired_cost = needed_cost\n\t\tmin = mid\n\telse\n\t\tmax = mid - 1\n\tend\nend\n# puts \"min #{min} max #{max} req #{required_cost}\"\n# puts \"cost #{cost}\"\n# puts \"count #{count}\"\n\nif required_cost\n\truby -= required_cost \nend\nans = max\n\nqty = ruby / cost\nspent = cost * qty\n# puts \"qt #{qty}\"\nans += qty\n\nruby -= spent\n\nremaining_cost = 0\n\ncount.each_key do |a|\n\trem = 0\n\trem = has[a] % (count[a] * max) if has[a] >= count[a] * max\n\tremaining_cost += (count[a] - rem) * price[a]\nend\n# puts \"ruby #{ruby} rem #{remaining_cost} count #{count}\"\nif remaining_cost > 0 && ruby >= remaining_cost\n\tans += 1\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "5a960936d33984409239323db8718ccf", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "0dcf5274d41dde9af42c1af9273411fa", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9940828402366864, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "nm = gets.chomp.split(\" \").map(&:to_i)\nn = nm[0]\nm = nm[1]\n\ndef findfor(x,y,k)\n count = 0\n (1..x).each do |a|\n (1..y).each do |b|\n if (a**2+b**2)%k==0\n count += 1\n end\n end\n end\n return count\nend\n\nif n n1 ? puts \"Second\" : puts \"First\"", "lang": "Ruby", "bug_code_uid": "87afd9f554ac81c9d8c2940afb84d59f", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "f236ebc7507404cd9d429416b55a8e82", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8111111111111111, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split(\" \").to_i\n\nif a[0] > a[1]\n puts \"First\"\nelse\n puts \"Second\"\nend", "lang": "Ruby", "bug_code_uid": "e50e274ed132f3fbe698ee4a5e788184", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "c04103143ee5db6a45ac9bd287fa396e", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9842931937172775, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a , b , c ,d = gets.split.map |i|{i.to_i}\n\nif a > b\n puts \"First\"\nelse\n puts \"Second\"\nend", "lang": "Ruby", "bug_code_uid": "100394d6940bfea6e34382133702a835", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "c04103143ee5db6a45ac9bd287fa396e", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9960629921259843, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = ARGV ? $< : File(ARGV[0])\n\nn, m = input.gets.split(' ').map &:to_i\narr = input.gets.split(' ').map &:to_i\n\narr.sort!()\n\ndiff = arr[n] - arr[0]\nstop = m - n\nfor i in (1..stop)\n\tlocal = arr[n-1+i] - arr[i]\n\tdiff = [diff, local].min\nend\n\nputs diff\n", "lang": "Ruby", "bug_code_uid": "cfaa0b0e271b8a582461a4bb67d03cb1", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "f89f897040157c0ceb26bc8c3c576ad1", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.941747572815534, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n=gets.to_i\ns=gets.to_s.downcase!\n\nif s.split('').uniq.size == 26\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "0a795c6d2acd2e545acd6331b9b63581", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "639d78e8be861153e06918b78eb529ac", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9673202614379085, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts gets.chomp.downcase.chars.uniq.sort == ('a'..'z').to_a ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "bb4a5fbbb05112f43ec2d28ec6d2f79e", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "2acc5bf0564f45160d7179895b5899ae", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9451327433628318, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "b = [1]\n10.times { b << b.last * 9 }\n\nn = gets.chomp\na = n.split('').map(&:to_i)\n\nm = a.reduce(:*)\n\na.count.times do |i|\n r = (a[0..i].join.to_i - 1).to_s.split('').map(&:to_i).reduce(:*)\n rem_digits = a.count - i - 1\n r *= b[rem_digits]\n m = [r, m].max\nend\n\nputs m\n", "lang": "Ruby", "bug_code_uid": "11fcd46b66dd933956244c261be92b30", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "f3d88f290c7eee2fa24022e25b7d7960", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9798657718120806, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a1=gets.chomp\nw=a1.split(\" \")\na=w[0].to_i\nb=w[1].to_i\n\nputs sum(a*b-1)/(b-1)", "lang": "Ruby", "bug_code_uid": "a7b8fcd596736f8ec69ad02badb280bb", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "da1be36018fad43c3e8e3ab09cecdb55", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8085106382978723, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "a,b = gets.chomp.split(\" \").map(&:to_i)\nacc = a\nloop do\n\ta += 1 if a % b != 0\n\tacc += a /= b\n\tbreak if a == 0\nend\nputs acc", "lang": "Ruby", "bug_code_uid": "cec594b44de92842d82ef618e505fb6c", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "bfd81255713e4b771b8780d602bfe3e0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "ar=gets.chomp.strip\na=ar[0].to_i\nb=ar[2].to_i\n#puts a\n#puts b\nsum=0\nwhile a!=0\n\tsum+=a\n\ta/=b\nend\nputs sum", "lang": "Ruby", "bug_code_uid": "0134003dac9d72bb0cf949bbb669f366", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "048106b8a67c2fb7a8129b9e5602f1c1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7838383838383839, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "amount_candles = gets.to_i\ndivide = gets.to_i\nsum = amount_candles\n\nwhile amount_candles / divide >= 1 do\n sum += amount_candles / divide\n amount_candles = amount_candles / divide + amount_candles % divide\nend\n\nputs sum\n", "lang": "Ruby", "bug_code_uid": "5543a0b131e90725e8385b6b03e2be3f", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "1bee07f168148e093223dfc4265ce7fc", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8114478114478114, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def solve(str)\n x,m = str.split.map{|x| x.to_i}\n data = []\n loop do\n d = x % m\n if d.zero?\n puts 'Yes'\n return\n end\n x = x + d\n if data.include? d \n puts 'No'\n return\n else\n data << d\n end\n end\nend\n\nsolve(gets)", "lang": "Ruby", "bug_code_uid": "27daf4296f14f7c074a28fabc09cdb36", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "86d3edf5bf84642183d2e299af783331", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9985007496251874, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def solve(str)\n x,m = str.split.map{|x| x.to_i}\n data = []\n t = 0\n loop do\n t += 1 if x > m\n d = x % m\n if d.zero?\n puts 'Yes'\n return\n end\n x = x + d\n if data.include?(d) || t>20\n puts 'No'\n return\n else\n data << d\n end\n puts \"x:#{x} d:#{d} m:#{m}\"\n end\nend\n\nputs solve(gets)", "lang": "Ruby", "bug_code_uid": "6865f99bfd70918d288422c2b61f46da", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "86d3edf5bf84642183d2e299af783331", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9612403100775194, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts gets.split.map{|i| i.to_i}.min % 2 ? 'Akshat' : 'Malvika'", "lang": "Ruby", "bug_code_uid": "c354e1ddc59a5122da26db76e4bd102c", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "7a92d2b9c81bed79edd42c0eb294d504", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8994708994708994, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,m = gets.split.map{ |e| e.to_i }\nif n.even? or m.even?\n puts 'Malvika'\nelse\n puts 'Akshat'\nend\n", "lang": "Ruby", "bug_code_uid": "870040892bebd944dd2d62e654a72bb1", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "76a908b726930c8b22fe9f51b691076d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9519230769230769, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m = gets.split\nturnos=[n,m].min\nif turnos.to_i%2==0\n puts \"Malvika\"\nelse\n puts \"Akshat\"\nend", "lang": "Ruby", "bug_code_uid": "57685a6f35e26ea2bcce3ff9a6b1bf1d", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "a80122a6f28afc16b813029cbac8e9ad", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.37185929648241206, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "\nn,m=gets.split.map{|x|x.to_i}\n#n,m=gets.split.map(&:to_i)\nprev=\"z\"; result=true\nn.times do\n\tline=gets.split(//)\n\tif line[0]==prev\n\t\tresult=false\n\tend\n\tprev=line[0]\n\tif line.count(line[0])!=m\n\t\tresult=false\n\tend\nend\n\nif result\n\tputs \"YES\\n\"\nelse\n\tputs \"NO\\n\"\nend\n\n\n\n", "lang": "Ruby", "bug_code_uid": "6dea85433bd5d4a7b61c376eb2d0869e", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "5f07aea3dbe0521c4fbd95e140a74763", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9933014354066986, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def palindrome?( hh, mm )\n hh == mm.reverse\nend\nhh, mm = gets.chomp.split(\":\")\nfound = false\nn_hh, n_mm = hh.to_i, mm.to_i\nwhile !found\n n_hh = n_hh.to_s.rjust(2, '0')\n t = n_hh.reverse.to_i\n if n_mm.to_i >= t || t > 32\n n_hh = n_hh.to_i + 1\n n_hh = 0 if n_hh == 24\n n_mm = n_hh.to_s.reverse\n else\n n_mm = t\n end\n n_mm = 0 if n_mm.to_i > 60\n n_hh = n_hh.to_s.rjust(2, '0')\n n_mm = n_mm.to_s.rjust(2, '0')\n found = palindrome? n_hh, n_mm\nend\nputs \"#{n_hh}:#{n_mm}\"\n", "lang": "Ruby", "bug_code_uid": "bcba6972912e22c497d0e1ac8456417b", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "b9bd1887b6333e6f9ad685c69ecb29b5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9893719806763285, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def palindrome?( hh, mm )\n hh == mm.reverse\nend\nhh, mm = gets.chomp.split(\":\")\nfound = false\nn_hh, n_mm = hh.to_i, mm.to_i\nwhile !found\n n_hh = n_hh.to_s.rjust(2, '0')\n t = n_hh.reverse.to_i\n if n_mm.to_i >= t\n n_hh = n_hh.to_i + 1\n n_hh = 0 if n_hh == 24\n n_mm = n_hh.to_s.reverse\n else\n n_mm = t\n end\n n_mm = 0 if n_mm.to_i > 60\n n_hh = n_hh.to_s.rjust(2, '0')\n n_mm = n_mm.to_s.rjust(2, '0')\n found = palindrome? n_hh, n_mm\nend\nputs \"#{n_hh}:#{n_mm}\"\n", "lang": "Ruby", "bug_code_uid": "19d27c29d74f7849e8d3fed48fb31046", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "b9bd1887b6333e6f9ad685c69ecb29b5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.03076923076923077, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "inp = gets.split(':')\n\nhh = inp[0]\nmm = inp[1]\n\n\nif hh.to_i == mm.reverse.to_i\n if hh.to_i == 23\n puts \"00:00\"\n else\n hh2 = hh.to_i+1\n if hh2/10 == 0\n hh2 = \"0#{hh2}\"\n end\n puts \"#{hh2}:#{hh2.reverse}\"\n end\nelse\n if hh.reverse.to_i < mm.to_i\n if hh == '23'\n puts \"00:00\"\n else\n hh2 = hh.to_i+1\n if hh2/10 == 0\n hh2 = \"0#{hh2}\"\n end\n puts \"#{hh2}:#{hh2.reverse}\"\n end\n else\n puts \"#{hh}:#{hh.reverse}\"\n end\nend", "lang": "Ruby", "bug_code_uid": "1be76187ed10dbc7d2a4df4d216d77c6", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "c3bdf1d48a5b005b73785c0fa36659e1", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9794007490636704, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\ndef toMin arg\n arg[0].to_i*60 + arg[1].to_i\nend\narg = STDIN.gets.split(\":\")\n\nnow = toMin(arg)\ncand = toMin([arg[0],arg[0].reverse])\nif cand > now and arg[0].reverse.to_i < 60\n puts sprintf(\"%02d:%02d\",arg[0].to_i,arg[0].reverse.to_i)\n exit 0\nelse\n begin\n arg[0] = ((arg[0].to_i + 1) % 24).to_s\n cand = toMin([arg[0],arg[0].reverse])\n if ( cand > now and arg[0].reverse.to_i < 60)\n puts sprintf(\"%02d:%02d\",arg[0].to_i,arg[0].reverse.to_i)\n exit 0\n end\n end while (arg[0].to_i > 0)\n puts \"00:00\"\nend\n", "lang": "Ruby", "bug_code_uid": "c91301c341f8b8cae04ba3bdbc8cda13", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "723b3a14c6d33155b1997d9aa8ab4cc3", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8990825688073395, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,a,b=gets.split.collect{|i| i.to_i}\nputs min n-a, b+1", "lang": "Ruby", "bug_code_uid": "5fcffe082a1916c3e1a13e003d5fc919", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "985e41033cc2e6b8b6f749e0956e6d93", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8080808080808081, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n,a,b = gets.split.map(&:to_i)\n \nif a+b == n \n puts b\nelse\n for i in n-b..n\n counter+=1\n end\nend\n\nputs counter", "lang": "Ruby", "bug_code_uid": "05ed6775ce146c50e38b1688c12835d3", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "422d5255db46fe9b1d6e4276293f73c3", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7079646017699115, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, a, b = gets.split.map &:to_i\nputs a == b ? n - 1 : n - a\n", "lang": "Ruby", "bug_code_uid": "8b8b5f51d074188c822bbbfee2b6d64d", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "0e7432826fd05afd043028b97a6b8994", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9485714285714286, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,a,b=gets.split.map(&:to_i)\nans=0\n(1..n).each{|_| ans+=1 if (_-1)>=a && (n-_)<=b}\n", "lang": "Ruby", "bug_code_uid": "d593f48f22918e6d58f19d5f5dc34799", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "09d19d36e1a49bf6a41bc917658a2e6e", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6911984087518648, "equal_cnt": 29, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 28, "bug_source_code": "def del(s)\n return s.delete(\"abcdefghijklmnopqrstuvwxyz_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\nend\n\ns = gets.chomp\nresult = \"YES\"\nk = s.index(\"@\")\nif s[0...k].size < 1 then\n result = \"NO\"\nend\nuser = del(s[0...k])\nif user.size > 0 then\n result = \"NO\"\nend\nif (n = s.index(\"/\")) then\n host = s[k+1...n]\n resource = s[n+1..-1]\nelse\n host = s[k+1..-1]\n resource = nil\nend\nif host.size < 1 then\n result = \"NO\"\nend\nk = -1\nwhile (m = host.index(\".\", k+1)) do\n if m-k > 16 then\n result = \"NO\"\n end\n k = m\nend\nhost = del(host).delete(\".\")\nif host.size > 0 then\n result = \"NO\"\nend\n\nif resource then\n if resource.size > 16 then \n result = \"NO\"\n else\n resource = del(resource)\n if resource.size > 0 then\n result = \"NO\"\n end\n end\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "0080011482e7b34a2c66f79c89358765", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "6a4e0487ede0cd1bb5657885d35246f5", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9659863945578231, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "puts gets =~ /^\\w{1,16}@\\w{1,16}.\\w{1,16}(\\/\\w{1,16})$/ ? \"YES\" : \"NO\"\n", "lang": "Ruby", "bug_code_uid": "a94f5645f62781cd7c711adf0a286066", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "6a2f643b0b763a3ed5309debfc14ae26", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9982964224872232, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.strip\nunless s =~ %r{([0-9a-zA-Z_]{1,16})@([0-9a-zA-Z_]{1,16}(\\.[0-9a-zA-Z_]{1,16})*)((/[0-9a-zA-Z_]{1,16})?)$}\n puts \"NO\"\n exit 0\nend\n#puts $1, $2, $3, $4\nusername, hostname, resource = $1, $2, $4\n\nif hostname.length >= 1 && hostname.length <= 32\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "8c896db5c7ca800fe6a0accbaaee9776", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "e021114606f84a29c88302a56e671fb9", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6565874730021598, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,R,r = gets.split.map{|x| x.to_f}\n\nif R == r then\n\tputs \"YES\" if n == 1\n\tputs \"NO\" if n != 1\nelsif r > R then\n\tputs \"NO\"\nelse\n\ttheta = 2*Math.acos(r/(R-r))\n\n\tif (n-2)*Math::PI <= n * theta then\n\t\tputs \"YES\"\n\telse\n\t\tputs \"NO\"\n\tend\nend\n", "lang": "Ruby", "bug_code_uid": "f6ad8b662a28476f4abd83003f5bce97", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "fcece78169e71b578651e14045e37ef4", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9306930693069307, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n, u, r = gets.split.map { |x| x.to_i }\nr_max = u\nif n > 1\n s = Math.sin(180 / n)\n r_max = s * u / (1 + s)\nend\nputs(r <= r_max ? 'YES' : 'NO')", "lang": "Ruby", "bug_code_uid": "29a4a88d2709e04020453a96be884cea", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "b6b7beeabe9f4644b4375f32ba1070d4", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.553020134228188, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "a = gets.chomp!.split\nn = a[0].to_i\nr = a[2].to_i\ns = a[1].to_i - r\nif s == 0 then \n\tif n == 1 then puts(\"YES\")\n\telse puts(\"NO\") end\nelsif s < 0 then puts(\"NO\")\nelse\n\tr = r.to_f\n\ts = s.to_f\n\tn = n.to_f\n\tif Math.asin(r / s) <= Math::PI / n then puts(\"YES\")\n\telse puts(\"NO\") end\nend", "lang": "Ruby", "bug_code_uid": "2cdbe956d2f368a37e819b6aba7b577d", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "aef59ea3e33bfcc333d84b7341e30f0c", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9721115537848606, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, R, r = gets.split.map{|_|_.to_i}\nputs n == 1 && r <= R || n > 1 && (R - r) * Math.sin(Math::PI / n) >= r ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "0cb9e06b9636205ef560207f5a3b3ec2", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "ebda815a4f06b94dd1ba00ef30a32d41", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9895287958115183, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def binpow(a,n,m)\n return 1%m if n == 0\n if n%2 == 0\n b = binpow(a,n/2,m)\n return (b*b)%m\n end\n return (a*binpow(a,n-1,m))%m\nend\nn,m = gets.split.map &:to_i\n\nputs binpow(3,n,m)-1\n", "lang": "Ruby", "bug_code_uid": "d344ae4f563eb512d6db3ac91a975730", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "9755235ccf1c28b82a70c805f912a415", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.997872340425532, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.split.map(&:to_i)\n# p gets.split.map(&:to_i)\ndef f(day, n, m)\n minus = (m + 1 + day) * (day - m) / 2\n plus = (day - m - 1) * m\n return n - minus + plus <= 0\nend\n\nif(m >= n)\n puts m\nelse\n\n l = m\n r = 1000000000000000000\n while(r - l > 1)\n mid = (r + l) / 2\n if(f(mid, n, m))\n r = mid\n else\n l = mid\n end\n \n end\n \n while(r >= l)\n if(f(r, n, m))\n r -= 1\n else\n r += 1\n break\n end\n end\n \n puts(r)\nend", "lang": "Ruby", "bug_code_uid": "55e60305ddb1f9bb14c538820fcc2822", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "0e07ba0c9cdff5dc972727a5dc039ec0", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7402376910016978, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "def pred(x, n, m)\n (n-m+x*m)-((m+x)*(m+x+1)-m*(m+1))/2 <= 0;\nend\ninput = gets.chomp.split(' ').map(&:to_i)\nn = input[0];\nm = input[1];\nif m > n\n puts n;\nend\n\nlo = 0\nhi = n;\nwhile lo < hi\n mid = lo+(hi-lo)/2;\n if pred(mid, n, m)\n hi = mid;\n else\n lo = mid+1\n end\nend\n\nputs m+hi;", "lang": "Ruby", "bug_code_uid": "cc78ac3d4b55746edec3a139dd9e361d", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "6b6f82b2c96aa07cbe48d598fbb681ac", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9478991596638655, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def pred(x, n, m)\n (n-m+x*m)-((m+x)*(m+x+1)-m*(m+1))/2 <= 0;\nend\ninput = gets.chomp.split(' ').map(&:to_i)\nn = input[0];\nm = input[1];\nif m > n\n puts n;\nelse\n lo = 0\n hi = n;\n while lo < hi\n\tmid = lo+(hi-lo)/2;\n\tif pred(mid, n, m)\n\t hi = mid;\n\telse\n\t lo = mid+1\n\tend\n end\nend\n\nputs m+hi;", "lang": "Ruby", "bug_code_uid": "15c18b832ea6a10cc39df71488d0efce", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "6b6f82b2c96aa07cbe48d598fbb681ac", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9798994974874372, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m=gets.split.map &:to_i\n\nif n<=m\n p n\nelse\n res=2**63-1\n a=2**62\n while a>0\n x=res-a\n res=x if x*(x+1)/2-m*(m+1)/2>=n+m*(x-m-1)\n a>>=1\n end\n p res\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "395cff2a002612fdb1e89f1cf26cae17", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "ae6d2c301f546f28868d171f5901a0d8", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9850746268656716, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "puts gets.codepoints.each_cons(3).any?{|x,y,z|x^y^z==96}?'Yes':'No'", "lang": "Ruby", "bug_code_uid": "d383ae056cd890aea887b10beb66ee09", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "6234814fd415fb0736dc2af45d77bbd5", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9943181818181818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "str = gets \nif str.include?\"ABC\" or str.include?\"ACB\" or str.include?\"BCA\" or str.include?\"BAC\" or str.include?\"CBA\" or str.include?\"CBA\"\n puts 'YES'\nelse \n puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "9ad7aac44ab97d86ff96f63304bebe80", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "87c6f9067da8c9623383e9e7ef1ea2cb", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9935483870967742, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=gets.split.map &:to_i\nt=0\n(n[0]-=1;n[1]-=2;t+=1)while(n.sort<=>[1,1])>0\np t", "lang": "Ruby", "bug_code_uid": "a124759567340a1a0ccf227ddf615309", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "69e18538219f2668d55c7c6209dd70e3", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.07087486157253599, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "# coding: utf-8\n\n# if __FILE__ == $0\n# end\n\ndef weigh(c)\n c = c.capitalize\n case c\n when 'Q'\n 9\n when 'R'\n 5\n when 'B'\n 3\n when 'N'\n 3\n when 'P'\n 1\n else\n 0\n end\nend\n\nwhite, black = 0, 0\n8.times {\n gets.chomp.split(//).each { |c|\n if c == '.'\n next\n elsif c == c.upcase\n white += weigh(c)\n else\n black += weigh(c)\n end\n }\n}\n\nif black < white\n puts \"White\"\nelsif black == white\n puts \"Draw\"\nelse\n puts \"Black\"\nend", "lang": "Ruby", "bug_code_uid": "0af4fea2ce0cd9e34bc2120060194e71", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "7dcc0e246079e1ceca91c1048d589457", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7155425219941349, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "# coding: utf-8\n\n# A's standard: 1 Expert 2 Newbs\n# B's standard: 2 Experts 1 News\n# Maximize the number of teams\n\nn, m = gets.split.map(&:to_i)\n# 0<=n,m<=5*10**5\nteams = 0\nif n < m\n n, m = m, n\nend\n\nq = [n/2, m].min\nteams += q\nn -= q*2\nm -= q\nif m > 0\n q2 = [n, m/2].min\n\n if q2 > 0\n teams += q2\n end\nend\n\nputs teams", "lang": "Ruby", "bug_code_uid": "2fe2d9e0f42a16f6dbc8ecf87a2f48b7", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "7dcc0e246079e1ceca91c1048d589457", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9656203288490284, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# coding: utf-8\n\n# A's standard: 1 Expert 2 Newbs\n# B's standard: 2 Experts 1 News\n# Maximize the number of teams\n\nn, m = gets.split.map(&:to_i)\n# 0<=n,m<=5*10**5\nteams = 0\n\nwhile n > 0 && m > 0\n if n < m\n n, m = m, n\n end\n\n if n >= 2\n teams += 1\n n -= 2\n m -= 1\n end\nend\n\nputs teams", "lang": "Ruby", "bug_code_uid": "9812eb2985d47ca3c9058b0dc6e0abb1", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "7dcc0e246079e1ceca91c1048d589457", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9389920424403183, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "def raise(x, n, mod)\n\tres = 1;\n\twhile n != 0\n\t\tres = (res*x)%mod if x%2\n\t\tx = (x*x)%mod\n\t\tn = n/2\n\tend\n\tres\nend\nn, mod = gets.split.map(&:to_i)\nans = raise(3, n, mod) - 1\nputs ans\n", "lang": "Ruby", "bug_code_uid": "bb3ce98daf3bd246333baa35f7dd2de7", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "0fc2384a942925d827f2e21cb088f5ae", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8903803131991052, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def pow(a, b)\n if (b==1) return a;\n if (b==0) return 1;\n c = pow(a,b/2)\n c = (c * c) % $mod\n c = (c * a) % $mod if (b % 2==1)\n c\nend\n\nn, m = *gets.split.map {|x|x.to_i}\n$mod = m\nputs (pow(3, n) - 1 + m) % m", "lang": "Ruby", "bug_code_uid": "c6c482316cac4ada469ed081986acfe2", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "1c6ba914ac84351b28aa14d32c322863", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6490066225165563, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "a, b = gets.chomp.split.map(&:to_i)\n\nc = 0\nloop do\n break if b <= 0\n c += 1\n\n a, b = [a, b].sort\n a += 1\n b -= 2\nend\nputs c\n", "lang": "Ruby", "bug_code_uid": "77025373de697e10e1c7507e49268212", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "b6b9e9c40a944f3d5b60f41086a17906", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6960227272727273, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "x= gets.chomp.split(' ').map(&:to_i)\nif x[0]>=x[1]\n\tmn=x[1]\n\tmx= x[0]\nelse\n mn=x[0] \n mx=x[1]\nend\n\n\nt=0;\n#puts\"#{mn}\"\n#print mx\n\n while (mx >= 0 && mn>=0) do\n \n mx=mx-2\n mn=mn+1\n t=t+1\n a= mx\n b=mn\n if a>=b\n\tmn=b\n\tmx=a\nelse \n mn=a \n mx=b\nend\n\n\n\n end \n print t-2\n # print mx\n # print mn\n", "lang": "Ruby", "bug_code_uid": "453a02afc142719ba179574ec52b03fa", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "d6c2cd62edf6cfb2287f56664e97fdba", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9395973154362416, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a, b = gets.split.map(&:to_i)\nputs a + b - ((a - b) % 3 == 0 ? 3 : 2)\n", "lang": "Ruby", "bug_code_uid": "d0bb86695becae1eeda6bc946f7b9235", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "07fb8f1cf866bc15572f1b1ece604c72", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3582089552238806, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "def solve(a,b)\n\tif a<=0 || b<=0\n\t\treturn 0\n\tend\n\tif a<=1 && b<=1\n\t\treturn 0\n\tend\n\tans=[solve(a-2,b+1),solve(a+1,b-2)].max+1\n\t#puts 'a='+a.to_s+' b='+b.to_s\n\t#puts 'ans='+ans.to_s\n\treturn ans\nend\na,b=gets.split.map(&:to_i)\nputs solve(a,b)", "lang": "Ruby", "bug_code_uid": "5c9f0361f3ca39a2485244689f2e4cfc", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "3664a3d0acfd2dc9588004024c59c288", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3257918552036199, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\nputs (n/Math.sqrt(n)).ceil + Math.sqrt(n).floor\n", "lang": "Ruby", "bug_code_uid": "bc46f01f148283e643e9951e73656a9c", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "e7599990909ab4a654f59c62c0b7a17b", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.06578947368421052, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "p = gets.to_i\n\ncount = 0\nfor i in 2...p\n pri = true\n x = i\n for j in 1...(p-1)\n if (x-1)%p == 0\n\t pri = false\n\t break\n\tend\n\tx *= i\n end\n if pri && (x-1)%p == 0 then\n count+=1\n end\nend\nputs count\n", "lang": "Ruby", "bug_code_uid": "32ebb803dceb4e8c4e093e1245f54559", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "054743ecddae7a614b1e0c64f15d48bc", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2018018018018018, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def check(x, i, p)\n val = x ** i - 1\n val % p == 0\nend\n\ndef run\n count = 0\n p = $stdin.gets.to_i\n for x in 1..p\n flag = true\n for i in 1..(p - 2)\n flag = false if check(x, i, p)\n end\n\n if flag and check(x, p - 1, p)\n count += 1\n end\n end\n\n puts count\nend\n\nrun if $0 == __FILE__\n", "lang": "Ruby", "bug_code_uid": "5d0b8548e5a9638b7a47f29202cafc56", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "f6b09899fc681ba60760588e59d93abd", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.0364963503649635, "equal_cnt": 3, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "require 'prime'\np=gets.to_i\np Prime.each(p-1).count", "lang": "Ruby", "bug_code_uid": "a1c29a8a7f63e08315693d3f5d35fb69", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "9334fdc13fe8cf979f06441bac5fa49c", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.55470737913486, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "p = gets.to_i\n\nc = 0\n(1..p-1).each{|x|\n v = 1\n next if (x**(p-1) - 1) % p != 0\n\n (1..p-2).each{|y|\n if ((x**y)-1) % p == 0\n v = 0\n break\n end\n }\n\n if v == 1\n c += 1\n end\n}\n\nputs c", "lang": "Ruby", "bug_code_uid": "d7b7b4a6dd0ae0f53bed2ec56c57e7eb", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "9a32b203494f5b7de7789ffa4c262ca5", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8037974683544303, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "def read_line\n gets.chomp.split.map &:to_i\nend\n\nc, d = gets.chomp.split('').map\n\nk = 8\nk -= 3 if c=='a' || c=='h'\nk -= 3 if d=='1' || d=='8'\n\nputs k\n", "lang": "Ruby", "bug_code_uid": "668234898790daaae32427b3cf567924", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "7a066b35ffec020bcaa6ac4b08c4c1d7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9864253393665159, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets;a=[0]+gets.split.map(&:to_i)\nz=a.each_cons(2).find{|x,y|y-x>15}\nz=(z ? z[0] : a.last[1])+15\np z>90 ? 90 : z", "lang": "Ruby", "bug_code_uid": "f34e0811089c6e5b0cab17162c62304c", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "ad3ef95e6d5bd59784fe664ef1ec84eb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.953662182361734, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\ninterestings = gets.chomp.split(/ /).map(&:to_i)\nwatch = 0\nprev = 0\n(0...n).each do |i|\n curr = interestings[i]\n watch = curr\n if curr - prev > 15\n watch = prev + 15\n break\n end\n prev = curr\nend\nwatch = prev + 15 if 90 - prev > 15\nwatch = 90 if watch > 90 || 90 - prev < 15\nputs watch\n", "lang": "Ruby", "bug_code_uid": "30fcab158291a83b96c810dedce1b504", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "cf5cecfe66862ed8f79168148024a1c5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9584487534626038, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = [0] + gets.split.map(&:to_i)\nans = 0\nn.times do |i|\n if a[i + 1] - a[i] > 15\n ans = a[i] + 15 \n break\n end\n ans = a[n] if i == n - 1\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "17c7046ec9bebbe11c313e0c7983d8d9", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "9c52dedd671be29981468c53affdc926", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9936575052854123, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "arr = gets.split(\" \").map(&:to_i)\n\nans = 0\n# if sum >=3\n# \tmin,min_ind = arr.each_with_index.min\n# \tarr.delete_at(min_ind)\n# \tarr = arr.map{|e| e - min}\n# \tans = min\n# \tsum = arr.inject(0,:+) \n# \tif sum >= 3 \n# \t\tmax = arr.max\n# \t\tpair = max / 2\n# \t\tmin = arr.min\n# \t\tif pair <= min\n# \t\t\tans += pair\n# \t\t\tif pair % 2 != 0\n# \t\t\t\tmin -= pair\n# \t\t\t\tans += 1 if min >= 2\n# \t\t\tend\n# \t\telse\n# \t\t\tans += min\n# \t\tend\n\n# \tend\n# end\n# arr = []\n# ac2 = a/2\n# bc2 = b/2\n# cc2 = c/2\n# # 0 2 1\n# arr << [bc2,c].min\n# # 0 1 2\n# arr << b + cc2 \n# # 1 1 1\n# arr << a + b + c\n# # 1 2 0\n# # 1 0 2\n# puts ans\n# 66,\n# 34,23\n\narr.sort!\nif((2 * (arr[0] + arr[1])) >= arr[2])\n\tputs arr[0] + arr[1]\nelse\n\tputs arr.inject(0,:+) / 3\nend", "lang": "Ruby", "bug_code_uid": "f18e84e342f8bb269bd2e33201c0020c", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "f61832acdf490bc1706a64f14539103b", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5754385964912281, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "c = gets.split.collect{|i| i.to_i}\nans = c.min\nc = c.collect{|i| i-ans if i!=ans}.compact\nif c.size == 2\n ans += [c.min, c.max-c.min].min\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "65eae87482e0855f92f28ee572d7c0a7", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "97bd33ac685a2a63ef85445a5d9d4f6a", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.2012072434607646, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n, m = gets.chomp.split.map(&:to_i)\ndef fi(n)\n f = n * (n - 1) / 2\nend\nmax = fi(n - m + 1)\nif n % m == 0\n min = fi(n / m) * m\nelse\n q = fi(n / m)\n p = q + n / m\n min = 0\n min += p * (n % m)\n min += q * (m - n % m)\nend\nprint min, \" \", max, \"\\n\"\n", "lang": "Ruby", "bug_code_uid": "fdc13698f0895ee8917215dfe75833a3", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "07e6eabb8104621ad671727c90a1eab3", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.592, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "gets\nputs gets.chomp.gsub(\"ogogogo\", \"***\").gsub(\"ogogo\", \"***\").gsub(\"ogo\", \"***\")", "lang": "Ruby", "bug_code_uid": "28003ecc5a47ba468f1c63865296979c", "src_uid": "619665bed79ecf77b083251fe6fe7eb3", "apr_id": "a47f4c777922761d3d2d9999b2ad94a6", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9523809523809523, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets;p [0,gets.split.map(&:to_i).max-25]", "lang": "Ruby", "bug_code_uid": "929452d2d7ca70787f7291baacc56d30", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "1362babef8d72b368977d944203e9bb4", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5555555555555556, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "def min (a,b) if a=7}.size", "lang": "Ruby", "bug_code_uid": "d7de0f93d6d721a867df4eadc672d850", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "8820a16385db50713606490fda035017", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.989247311827957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p1,p2,p3,p4,a,b = gets.split.map(&:to_i)\n\npp = [p1,p2,p3,p4].min\n\np [[b,pp].min - a, 0].max\n", "lang": "Ruby", "bug_code_uid": "cb12d01eb959ad7a2a2e990345ee4f89", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "8f9ddcb7791d5a28a2a66ca5df65b88a", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9847094801223242, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n, d = gets.chomp.split(' ').map(&:to_i)\n\npoints = gets.chomp.split(' ').map(&:to_i)\n\nresult = 0\n\nwhile true\n hash = Hash.new(0)\n \n points.each_with_index do |point, index|\n points.each_with_index do |p, i|\n hash[index] += 1 if((point - p).abs > d and index != i)\n end \n end\n \n hash = hash.sort{|x, y| y[1] <=> x[1]}\n break if hash.empty?\n ind, repeat = hash[0][0], hash[0][1]\n if repeat > 0\n points.delete_at(ind)\n result += 1\n else\n break\n end\nend\n\nresult", "lang": "Ruby", "bug_code_uid": "f685772a387236c99437138274785102", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "5f162f3a91f65587e37a9829018235c3", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7927046263345195, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#Infinity\n#geti,getia\n#Object # dcopy\n#\n#String # to_a\n# \"abc\".to_a #=> [\"a\",\"b\",\"c\"]\n#String # to_ia\n# \"1 2 3\".to_ia #=> [1,2,3]\n#\n#Array # rsort,rsort!\n# [1,3,2,4].rsort #=> [4,3,2,1]\n#\n#Integer # divisor\n# 24.divisor #=> [1,2,3,4,6,8,12,24]\n#\ninclude Math\nrequire \"prime\"\nrequire \"bigdecimal\"\nrequire \"bigdecimal/math\"\nrequire \"matrix\"\nrequire \"pp\"\nrequire \"benchmark\"\n\nInfinity = 1/0.0\nclass Matrix;def inspect;empty? ? \"Matrix.empty(#{row_size}, #{column_size})\":\"Matrix[\\n#{@rows.map(&:inspect).join(\"\\n\")}\\n]\";end;end\ndef pbin(obj);case obj;when Integer;puts obj.to_s(2);end;end\nclass String;def to_a;split(\"\");end;end\nclass String;def to_ia;split.map(&:to_i);end;end\ndef getia;gets.to_ia;end\ndef geti;gets.to_i;end\nclass Object;def dcopy;Marshal.load(Marshal.dump(self));end;end\nclass Array;def rsort;sort.reverse;end;def rsort!;sort!.reverse!;end;end\n\nx,y = getia\nsum = x * 100 + y * 10\na = sum / 220\nputs a&1 == 0 ? \"Hanako\" : \"Ciel\"\n\n", "lang": "Ruby", "bug_code_uid": "4bd1c1d9c6fc6d80ef4c41dbd918692f", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "ff10d7bbaf2eb4f9ef75f369fbe956f7", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9704918032786886, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n, c = gets.split.map(&:to_i)\nps = gets.split.map(&:to_i)\nts = gets.split.map(&:to_i)\n\nl = 0\nlt = 0\nr = 0\nrt = 0\n(0..n-1).each do |i|\n lt += ts[i]\n rt += ts[i-1]\n l += [0, ps[i]-lt*c].max\n r += [0, ps[i-1]-rt*c].max\nend\nif l == r\n puts 'Tie'\nelsif l > r\n puts 'Limak'\nelse\n puts 'Radewoosh'\nend", "lang": "Ruby", "bug_code_uid": "36d812a8cf994dc07bed706a8b262887", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "c72f93b20b47220739602cbc868f1c6f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.16466950135291844, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#!/Users/mike/.rvm/rubies/ruby-1.9.3-p327/bin/ruby\n\nredNum, blueNum = STDIN.readline.split.collect {|s| s.to_i}\n\ndef msg s=''\n\tputs s\nend\n\ndef simulate(isRed, redCount, blueCount, petyaMove)\n\treturn [0, 0] if redCount+blueCount == 0\n\tif petyaMove\n\t\tif isRed and redCount > 0\n\t\t\tp, v = simulate(true, redCount-1, blueCount, false)\n\t\t\tmsg 'red'\n\t\t\treturn [p+1, v]\n\t\telsif not isRed and blueCount > 0\n\t\t\tmsg 'blue'\n\t\t\tp, v = simulate(false, redCount, blueCount-1, false)\n\t\t\treturn [p+1, v]\n\t\telsif redCount > 0\n\t\t\tmsg 'red'\n\t\t\tp, v = simulate(true, redCount-1, blueCount, false)\n\t\t\treturn [p, v+1]\n\t\telse\n\t\t\tmsg 'blue'\n\t\t\tp, v = simulate(true, redCount, blueCount-1, false)\n\t\t\treturn [p, v+1]\n\t\tend\n\telse\n\t\tif isRed and blueCount > 0\n\t\t\tmsg 'blue'\n\t\t\tp, v = simulate(false, redCount, blueCount-1, true)\n\t\t\treturn [p, v+1]\n\t\telsif not isRed and redCount > 0\n\t\t\tmsg 'red'\n\t\t\tp, v = simulate(true, redCount-1, blueCount, true)\n\t\t\treturn [p, v+1]\n\t\telsif redCount > 0\n\t\t\tmsg 'red'\n\t\t\tp, v = simulate(true, redCount-1, blueCount, false)\n\t\t\treturn [p+1, v]\n\t\telse\n\t\t\tmsg 'blue'\n\t\t\tp, v = simulate(true, redCount, blueCount-1, false)\n\t\t\treturn [p+1, v]\n\t\tend\n\tend\nend\n\nmsg 'red'\npetya0, vasya0 = simulate(true, redNum-1, blueNum, false)\nmsg\nmsg 'blue'\npetya1, vasya1 = simulate(false, redNum, blueNum-1, false)\nmsg\n\nif (petya0 > petya1)\n\tputs '%s %s' % [petya0, vasya0]\nelse (petya1 > petya0)\n\tputs '%s %s' % [petya1, vasya1]\nend\n", "lang": "Ruby", "bug_code_uid": "e754804023575cd001200fdff07befdd", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "0b7768c9e0188138e58835c47e4d2419", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.18204385601985934, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#!/Users/mike/.rvm/rubies/ruby-1.9.3-p327/bin/ruby\n\nredNum, blueNum = STDIN.readline.split.collect {|s| s.to_i}\n\ndef msg s=''\n\t#puts s\nend\n\ndef simulate(isRed, redCount, blueCount, petyaMove)\n\treturn [0, 0] if redCount+blueCount == 0\n\tplayRed, playBlue = false, false\n\tpetyaScore, vasyaScore = 0, 0\n\tif petyaMove\n\t\tif isRed and redCount > 0\n\t\t\tplayRed, petyaScore = true, 1\n\t\telsif not isRed and blueCount > 0\n\t\t\tplayBlue, petyaScore = true, 1\n\t\telsif redCount > 0\n\t\t\tplayRed, vasyaScore = true, 1\n\t\telse\n\t\t\tplayBlue, vasyaScore = true, 1\n\t\tend\n\telse\n\t\tif isRed and blueCount > 0\n\t\t\tplayBlue, vasyaScore = true, 1\n\t\telsif not isRed and redCount > 0\n\t\t\tplayRed, vasyaScore = true, 1\n\t\telsif redCount > 0\n\t\t\tplayRed, petyaScore = true, 1\n\t\telse\n\t\t\tplayBlue, petyaScore = true, 1\n\t\tend\n\tend\n\tredCount -= 1 if playRed\n\tblueCount -= 1 if playBlue\n\tmsg 'red' if playRed\n\tmsg 'blue' if playBlue\n\tp, v = simulate(playRed, redCount, blueCount, !petyaMove)\n\treturn [p+petyaScore, v+vasyaScore]\nend\n\nmsg 'red'\npetya0, vasya0 = simulate(true, redNum-1, blueNum, false)\nmsg\nmsg 'blue'\npetya1, vasya1 = simulate(false, redNum, blueNum-1, false)\nmsg\n\nif (petya0 > petya1)\n\tputs '%s %s' % [petya0, vasya0]\nelse (petya1 > petya0)\n\tputs '%s %s' % [petya1, vasya1]\nend\n", "lang": "Ruby", "bug_code_uid": "8332234808bc44d300e197035cd4c190", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "0b7768c9e0188138e58835c47e4d2419", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.05128205128205128, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a=gets.split.map(&:to_i)\nline=[]\nline << (a[0]>=a[1]?0:1)\na[line[0]]-=1\n\n(1..(a[0]+a[1])).each {|i|\n if i%2==0 #first player\n if a[line[i-1]]>0\n line<0\n line<<(line[i-1]+1)%2\n a[(line[i-1]+1)%2]-=1\n else\n line<2}\n10.times {|i| a[gets] = i }\n10.times {|i| puts a[c[10*i .. 10*i+9]] }", "lang": "Ruby", "bug_code_uid": "c9f50adccbb9e6c09d145be5b6b32818", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "ef68b1134d4d8f1a57cbd10915ce3ca4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.03741496598639456, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a,b = gets.split(\" \").map{|item| item.to_i}\nquery = gets.to_i\nmaxans = 0\n\nquery.times do\n ans = -1\n low,high = gets.split(\" \").map{|item| item.to_i}\n \n (low..high).each do |item|\n \n break if [a,b].max < item\n \n next if a%item != 0\n next if b%item != 0\n ans = item\n answer << item\n end\n puts ans\nend", "lang": "Ruby", "bug_code_uid": "5cd7a9e4486f066c46706802016ab720", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "6957c1322634fe055def8e850d2f32c1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7358490566037735, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "a = gets.chomp\nb = gets.chomp\ns = a.to_i + b.to_i\n\na.sub(/0/, \"\")\nb.sub(/0/, \"\")\n\nif (a.to_i + b.to_i == s)\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "0db736cbfc6fbac922afc17f49ae2641", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "1d97cf1b4838c0eeb68e45e6b2ddbbef", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8468468468468469, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a = gets.chomp\nb = gets.chomp\ns = a.to_i + b.to_i\n\nif (a.gsub(/0/, \"\").to_i + b.gsub(/0/, \"\").to_i == s.gsub(/0/, \"\").to_i)\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "850b3cba418b0cb26eac16f0524b1afa", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "1d97cf1b4838c0eeb68e45e6b2ddbbef", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9333333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s=gets(p).tr$/,?+\ns+=\"==#{eval s}\"\nputs eval(s.tr ?0,\"\")?\"YES\":\"NO\"", "lang": "Ruby", "bug_code_uid": "43f8d0fc7fb7a185fa86cb3727d74641", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "aea0443320a27d41cc91e70644026b8b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9849246231155779, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=(0..3).map{gets}*''\nif a['xx.'] or a['x.x'] or a['.xx'] or\n a[/x.{3}x.{3}\\./] or a[/x.{3}\\..{3}x/] or a[/\\..{3}x.{3}x/] or\n a[/x.{4}x.{4}\\./] or a[/x.{4}\\..{4}x/] or a[/\\..{4}x.{4}x/] or\n a[/x.{5}x.{5}\\./] or a[/x.{5}\\..{5}x/] or a[/\\..{5}x.{5}x/]\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "31809acdfdd27456e1412f13ddbc8eec", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "1d75e86ad745c9b1e7bc9118cfed05cd", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.704119850187266, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "$_=$<.map{|s|s.chop+?o}*''\nf=->n{~/([.x]).{#{n}}([.x]).{#{n}}([.x])/&&($1+$2+$3).sum==286}\nputs f[0]||f[3]||f[4]||f[5]?:YES: :NO", "lang": "Ruby", "bug_code_uid": "d5e519d19c80c4aa357d94e16d6f1a7e", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "1d75e86ad745c9b1e7bc9118cfed05cd", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.921090387374462, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "parse_int = lambda { gets.split.map{|x| x.to_i} }\n\ndef sign(x)\n x>0 ? 1 : x<0 ? -1 : 0\nend\nx, o = 0, 0 \n\nmtx = []\n4.times do |_|\n line = gets.chomp\n x += line.count 'x'\n o += line.count 'o'\n mtx << line\nend\n\n$ourchar = x > o ? 'o' : 'x'\n\ndef check(mtx)\n for i in (0..3)\n for j in (0..1)\n return true if (mtx[i][j] == $ourchar) && (mtx[i][j+1] == $ourchar) && (mtx[i][j+2] == $ourchar)\n end\n end\n \n for i in (0..1)\n for j in (0..3)\n return true if (mtx[i][j] == $ourchar) && (mtx[i+1][j] == $ourchar) && (mtx[i+2][j] == $ourchar)\n end\n end\n \n for i in (0..1)\n for j in (0..1)\n return true if (mtx[i][j] == $ourchar) && (mtx[i+1][j+1] == $ourchar) && (mtx[i+2][j+2] == $ourchar)\n end\n end\n false\nend\n\nfor i in (0..3)\n for j in (0..3)\n if mtx[i][j] == '.'\n mtx[i][j] = $ourchar\n \n if check(mtx)\n puts 'YES'\n exit\n end\n \n mtx[i][j] = '.'\n end\n end\nend\n\nputs 'NO'\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "8b13dea5eae6c296816904ab62ef77a0", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "aba5b0563effd46191558afd1109cfa6", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9945945945945946, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\nH={'Q'=>9,'R'=>5,'B'=>3,'K'=>3,'P'=>1}\nw=b=0\n$<.read.each_char{|c|\n\tif H[c]\n\t\tw+=H[c]\n\telsif H[c.upcase]\n\t\tb+=H[c.upcase]\n\tend\n}\nputs %w(White Draw Black)[(b<=>w)+1]", "lang": "Ruby", "bug_code_uid": "d41c54eeeb03d579db84902065e50037", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "0145e50ea5ca6fe922021527d9f39295", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9675711449371277, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "class Board\n WEIGHTS = { q: 9, r: 5, b: 3, k: 3, p: 1 }\n\n def initialize(lines)\n @pieces = lines.join.chars\n end\n\n def which_to_win?\n case\n when score('white') > score('black')\n 'White'\n when score('white') == score('black')\n 'Draw'\n else\n 'Black'\n end\n end\n\n private\n\n def score(color)\n selector = (color == 'white') ? ('A'..'Z').to_a : ('a'..'z').to_a\n\n @pieces.select { |piece| selector.include? piece }.map do |piece|\n weight piece\n end.inject(0, :+)\n end\n\n def weight(piece)\n key = piece.downcase.to_sym\n\n WEIGHTS.key?(key) ? WEIGHTS[key] : 0\n end\nend\n\nlines = [].tap do |arr|\n 8.times { arr << gets.chomp }\nend\n\n\nboard = Board.new(lines)\nputs board.which_to_win?\n", "lang": "Ruby", "bug_code_uid": "30a3bc1accc30339f6b843fa847489ff", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "b9b7bc50e29217363f42d567ae7e8755", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9693251533742331, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\nk=n.size-1\np (n-('9'*k).to_i).to_s.chars.map(&:to_i).reduce(:+)+9*k", "lang": "Ruby", "bug_code_uid": "45d486124b8e48a440fabf0a0bbfb17a", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "d575a970bbd0d8f439b8b0c85bcda58f", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5796178343949044, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n = gets.chomp.to_i\na = gets.chomp.split(/ /).map(&:to_i)\nmin_element = a.min\nmax_element = a.max\npos_min = a.index min_element\npos_max = a.index max_element\nif pos_min > pos_max\n pos_min = n - 1\nelsif pos_max > pos_min\n pos_max = n - 1\nend\ndist = (pos_min - pos_max).abs\nputs dist\n", "lang": "Ruby", "bug_code_uid": "20122d983a4f838d72d62a75f71be9ce", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "3b453336c03540f683b5fe90d7339250", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6019184652278178, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "n = 0\nnums = Array.new\n\nbiggest = 0\nsmallest = 100\n\nn = gets.chomp.to_i\nfor i in 1..n\n\tnums.push(gets.chomp.to_i) \n\tif n == nums.last\n\t\tbiggest = i\n\tend\n\tif 1 == nums.last\n\t\tsmallest = i\n\tend\nend\n\nputs \"\\n#{[n - [smallest, biggest].min, [smallest, biggest].min - 1].max}\"\n\n=begin\n7\n1 \n6 \n5 \n3 \n4 \n7 \n2\n\n=end", "lang": "Ruby", "bug_code_uid": "ae10e08864d0ba8ff26a6b1fa7e15bb0", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "5f409dce57c3b2f7184d9465770d21ed", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9789272030651341, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = 0\nnums = Array.new\n\n\n\nbiggest = 0\nsmallest = 100\n\nn = gets.chomp.to_i\nnums = gets.split.map(&:to_i)\n\n#p nums\n#puts n\n#puts nums.last\n\nfor i in 0..n\n\t#nums.push($stdin.read.chomp.to_i) \n\t#thing = gets.chomp.split('|')[1].scan(/\\d+/).map{|n| n.to_i}\n\tif n == nums[i]\n\t\tbiggest = i + 1\n\tend\n\tif 1 == nums[i]\n\t\tsmallest = i + 1\n\tend\nend\n\n#puts \"Biggest: #{biggest}, smallest: #{smallest}\\n\\n\"\n\nputs [n - [smallest, biggest].min, [smallest, biggest].min - 1].max\n\n=begin\n7\n1 \n6 \n5 \n3 \n4 \n7 \n2\n\n6\n6 \n5 \n4 \n3 \n2 \n1\n\n=end", "lang": "Ruby", "bug_code_uid": "b4693d4af04afea3f16d16deeaed5a12", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "5f409dce57c3b2f7184d9465770d21ed", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7221570926143025, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "arrLen = gets.chomp.to_i\narr = gets.chomp.split(' ').map { |i| i.to_i }\n\nminIdx = arr.index { |i| i == arr.min}\nmaxIdx = arr.index { |i| i == arr.max}\n\nbiggerIdx = minIdx > maxIdx ? minIdx : maxIdx\nnonBiggerIdx = minIdx < maxIdx ? minIdx : maxIdx\n\nans = if (arrLen - biggerIdx) > (nonBiggerIdx - 0)\n\tarrLen - nonBiggerIdx\nelse\n\tbiggerIdx - 0\nend\n\nputs ans - 1", "lang": "Ruby", "bug_code_uid": "6a018b61c79515aad7203f7a8d4b8927", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "237545c1ab1638ead53fb109758e604b", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9861111111111112, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "k = gets.split.map(&:to_i)[1]\nps = gets.split.map(&:to_i)\nres = ps.length\nps.each { |p| \n res = res - 1 if (p < ps[k] or p == 0)\n}\nputs res\n\n\n", "lang": "Ruby", "bug_code_uid": "76cd6da8e1e70f92d03689795c07d92b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "e290bbd600caec0cffde3a805a953c23", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9565217391304348, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "p gets(p)[/\\n(\\d+){#{$_[/ .+/].to_i}}( ?\\1)*/].scan(/\\b[1-9]/).size", "lang": "Ruby", "bug_code_uid": "a1e67fd6d422f7ac45159336db49ce21", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "af3c807af699f0d38470a1aa26335499", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9714285714285714, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\ninput = gets.chomp.split(' ').map(&:to_i)\nscores = gets.chomp.split(' ').map(&:to_i)\n\ni = k = input[1] - 1\nn = input[0]\n\nif scores[k] > 0\n if i == n - 1\n abort(i.to_s)\n end\n while scores[i] == scores[k] && i < n\n i += 1\n end\n\n puts i\nelse \n loop do\n i -= 1 \n break if i < 0 || scores[i] != 0\n end\n\n if i == 0 && scores[i] == 0\n puts 0\n end\n\n puts i + 1\nend\n\n", "lang": "Ruby", "bug_code_uid": "06f57b8c42cc42bd7ee47f43127952d9", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2fe8c74517b8add3036b0e56060bab67", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9023569023569024, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, k = gets.chomp.split(\" \").map(&:to_i)\ns = gets.chomp.split(\" \").map(&:to_i)\nw = s[k]\n# puts \"k: #{k}, w: #{w}\"\ns.reject! { |e| e < w || w <= 0 }\nputs s.count", "lang": "Ruby", "bug_code_uid": "966557c3e161395f063f693ffb5e17e9", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9d784a968c68317b2c402a68bae28bc2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9604863221884499, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\ngets\nprev='0'\nx=0\ngets.chomp.chars{|c|\n\tif c=='0'\n\t\tif prev=='0'\n\t\t\tprint 0\n\t\telse\n\t\t\tprint x\n\t\t\tx=0\n\t\tend\n\telse\n\t\tx+=1\n\tend\n\tprev=c\n}\nprint x if prev!='0'", "lang": "Ruby", "bug_code_uid": "2693ee58f9972e3e1b69458ef3071790", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "499d99df88400cf15141f4c0f0ba7a2d", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.33976833976833976, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n=gets.to_i\ns=gets.chomp\nt=s.split('0')\nputs t.map{|e| e.size}.join\n", "lang": "Ruby", "bug_code_uid": "eca90657b39004364580effe87a4138f", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "817d60a4bfa405e240a68e2ae63587d9", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.958904109589041, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x = gets.to_i\n p [x,x==3 ? 5 : (Math::sqrt(2*(x-1)+0.9).floor+1)/2*2+1]", "lang": "Ruby", "bug_code_uid": "320382b2382c963a5b1d7a7b37086691", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "87c557380e93ef4a39f911bfcce95e69", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8494623655913979, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nc = 1\nk = 1\nwhile ca ^ c>0)&&(b-a)%c==0 ? :YES : :NO\nend", "lang": "Ruby", "bug_code_uid": "d0aac8dfdebf9d6e5248932d3ada150d", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "854ef00f1d5fe77cdb6451c5437fa075", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9634551495016611, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b, c = gets.strip.split(\" \").collect{|v| v.to_i}\n\nif (c == 0 and a == b) or ((b-a)%c == 0 and (b-a)/c >= 0)\n\tputs 'YES' \nelse \n\tputs 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "f39df032f1008315becea6235bcf3cd3", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "bc02885a533fece96ee3065c4fa2d831", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.68, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "a, b, c = gets.chomp.split(/ /).map(&:to_i)\nans = \"NO\"\nwhile true\n if a == b\n ans = \"YES\"\n break\n end\n a += c\n break if a > b\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "c0f10fee5ed49ff7cda06c557a6b51ef", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "b4baa2271141bfc7cd4d43e111680384", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3028391167192429, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a,b,c=gets.split.map{|e| e.to_i}\n\nd=b-a\n\nif d%c==0\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n\n\t", "lang": "Ruby", "bug_code_uid": "b4878b88b562ada58d08d5fe04d6e828", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "a2752fed2669e9bd42ffbf8bc3f9abeb", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8167202572347267, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 10, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "a, b, c = gets.split.map(&:to_i)\nputs a == b || (c == 0 and a == b) || ( (b - a) % c == 0 and b < a and c < 0 ) || ( (b - a) % c == 0 and b > a ) ? :YES : :NO\n", "lang": "Ruby", "bug_code_uid": "23290f00595bec3ca05d7533dcdcdfd6", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "61a26b6ae0413c765e182354ad479402", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9606299212598425, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b, c = gets.split.map(&:to_i)\nputs ( ( c == 0 && b == a ) || ( (b - a) * c >= 0 && (b - a) % c == 0 ) ) ? 'YES' : 'NO'\n", "lang": "Ruby", "bug_code_uid": "275b7f0df8d39e671be56317d634281c", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "12e9b106e7fcc62dec95c76a3035f163", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6989247311827957, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "s = gets.chomp\nlen = s.length\nnum_distic_chars = s.chars.uniq.count\nputs ((len+1)*26)-num_distic_chars\n=begin\naa\n=end\n", "lang": "Ruby", "bug_code_uid": "b51ee41da76ec9bf109419a9834e7477", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "6224c0bd6a3513bdf984f70e429f9727", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9680111265646731, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "def make(a, b, c, x)\n (x ** a) * b + c\nend\n\ndef cnt(t)\n x = 0\n while t != 0\n x += t % 10\n t /= 10\n end\n x\nend\n\na, b, c = gets.split.map(&:to_i)\nx = 1\nans = []\nwhile(true)\n t = make(a, b, c, x)\n if t >= 10 ** 9\n break\n end\n if x == cnt(t) \n ans << t.to_s\n end\n x += 1\nend\nputs ans.size\nif ans.size != 0\n puts ans.join(\" \")\nend", "lang": "Ruby", "bug_code_uid": "abdb49f4ea4da88111d69e753d952ac1", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "936e6e4dbb4043274e9ee43006604a54", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6659459459459459, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a,b,c = gets.split(/\\s+/).map {|x| x.to_i}\n\npowers = []\n9.times {|i| powers << 10**i}\n\nr = []\nsum = 0\nst = 1.0/a\n\ndef sum(n)\n a = 0\n while n > 0\n a += n%10\n n/=10\n end\n a\nend\n\n(0..81).each do |x|\n q = (x**a)*b+c\n r << q if q > 0 && q == (sum(q)**a)*b+c\nend\n\np r.size\nputs r.sort*\" \" if r != []\n\n# x-c\n# sum(x)**a = ---\n# b\n\n# a = 5 => 2\n# a = 4 => 2,3\n# a = 3 => 2,3,4\n# a = 2 =>\n# a = 1 =>\n\n# 13726 = 2*sum(13726)**3+3\n\n\n# b*sum(x)**a+c = x\n", "lang": "Ruby", "bug_code_uid": "e6d2b408936f14c78b7f49ce7b042f44", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "212e8ea647de90ed7a275092056091f7", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9663299663299664, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\n\ndef digit_sum(a)\n a.to_s.split(//).map(&:to_i).inject(:+)\nend\n\na, b, c = gets.split.map(&:to_i)\n\nresult = []\n\n(1..81).each do |sx|\n num = b * (sx ** a) + c\n if num > 0 && digit_sum(num) == sx\n result << num\n end\nend\n\n\nputs result.size\nputs result.sort.map(&:to_s).join(\" \")\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "ae8fe9c44704215e445def8adb5db2a7", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "b7d49b0fc5c180235addc309f76c934c", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9476744186046512, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def s(x);x>0?x%10+s(x/10):0;end\na,b,c=gets.split.map &:to_i\nr=[]\n(1..72).each{|q|(x=b*(q**a)+c)>=10**9&&break;q==s(x)&&r<a*c+e]", "lang": "Ruby", "bug_code_uid": "f709d0e301327e82ad13fb9ed1613f6e", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "2487a283bcc62dbdc2a330531f0b018e", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.99375, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=gets.split()\nb=a.collect{|x| x.to_i}\nc=b[0]*b[1]+2*b[3]\nd=b[0]*b[2]+2*b[4]\nif c>d\n puts 'Second'\nelsif b==d\n puts 'Friendship'\nelse\n puts 'First'\nend", "lang": "Ruby", "bug_code_uid": "1b422d4e62155c2e0ca32de12bf46161", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "a92b397bb633101c61d2eb35da1506d9", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.91005291005291, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets\na=gets.chars.chunk{|c|c}.select{|k,v|k=='B'}.map{|k,v|v.size}\na<<0 if a.empty?\np a.size\nputs a*' '", "lang": "Ruby", "bug_code_uid": "d4aa39db3c9bf27e6651ded85668865a", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "408b3ab91da77ac5fafb36e5243dec46", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9948186528497409, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\nline = gets\n\ngroups = []\ni = 0\nwhile i < n-1\n c=0\n while line[i]=='B'\n c+=1\n i+=1\n end\n groups << c unless c == 0\n i+=1\nend\n\nputs groups.size\nputs groups.join(' ')", "lang": "Ruby", "bug_code_uid": "2001e01fe21924666fb75c2836f576d5", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "944bdf460a4caf0cc7114e1400b74e2e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9986468200270636, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts (%w[Washington Adams Jefferson Madison Monroe Adams Jackson]+['Van Buren']+%w[Harrison Tyler Polk Taylor Filmore Pierce Buchanan Lincoln Johnson Grant Hayes Garfield Arthur Cleveland Harrison Cleveland McKinley Roosevelt Taft Wilson Harding Coolidge Hoover Roosevelt Truman Eisenhower Kennedy Johnson Nixon Ford Carter Reagan Bush Clinton Bush Obama])[gets.to_i-1]", "lang": "Ruby", "bug_code_uid": "80f7462e98cb67b3cfa2a9755474aaba", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "56f1ff51de4f3cb03fd3d28b4cae4bbb", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9951876804619827, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "class A\n def initialize\n @names = %w(siman \n Washington Adams Jefferson Madison Monroe Adams Jackson Buren\n Harrison Tyler Polk Taylor Fillmore Pierce Buchanan Lincoln Johnson\n Grant Hayes Garfield Arthur Cleveland Harrison Cleveland McKinley\n Roosevelt Taft Wilson Harding Coolidge Hoover Roosevelt Truman \n Eisenhower Kennedy Johnson Nixon Ford Carter Reagan)\n\n val = $stdin.gets.chomp.to_i\n\n puts @names[val]\n end\nend\n\na = A.new", "lang": "Ruby", "bug_code_uid": "e1203c1544c5badd8f3468922f0ab3bb", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "28827ee247902180eb8235136d437939", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9975728155339806, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "BEGIN{\n\tdef gint()\n\t\treturn gets.split.map(&:to_i)\n\tend\n\tdef main()\n\t\tn, t = gint\n\t\ts = gets.to_s\n\t\tl = s.length - 1\n\t\tt.times do |item|\n\t\t\tflag = false\n\t\t\t(0..l).each do |i|\n\t\t\t\tif flag then\n\t\t\t\t\tflag = false\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tif s[i] == 'B' and s[i + 1] == 'G' then\n\t\t\t\t\ts[i], s[i + 1] = s[i + 1], s[i]\n\t\t\t\t\tflag = true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tputs s\n\tend\n\tTest_case = 3\n\tTest_case.times do\n\t\tmain()\n\tend\n}\n", "lang": "Ruby", "bug_code_uid": "55d6182794b8df7e0d363a49a8fd96b0", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "513a38ed3e5f88994eb07eb0e4463923", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9809523809523809, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, t = gets.chomp.split.map.to_i\nf = gets.chomp\nt.times do |i|\n f.gsub!(/BG/) { |x| 'GB' }\nend\nputs f", "lang": "Ruby", "bug_code_uid": "4e375fba24207ddf3cb3bcd7a3670d6f", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "d5a155fdf95ab133d1b7aacc285766ef", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9294117647058824, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts [4,7,44,47,74,77,444,447,474,477,744,747,774,777].all?{|i|n%i>0}?:NO:\"YES\"", "lang": "Ruby", "bug_code_uid": "0fcf0b5ea2be58c84031b9d539f06818", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "6efd5151be8364a33935d2e4d27ca64b", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8455284552845529, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "y,w=gets.split.map(&:to_i)\nputs \"#{[*[y,w].min..6].size}/6\".to_r\n", "lang": "Ruby", "bug_code_uid": "09b299592c4dda1303f713870b4e48bb", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "798e5b0f3a3baa534b5b1cd11236073c", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8324873096446701, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "# 09 A\ndef gcd(a, b)\n while b != 0 do\n c = a % b\n a = b\n b = c\n end\n return a;\nend\n\na,b = gets.split.map(&:to_i)\nc = 1\nif a > 0 && b > 0 then\n c = gcd(a, b)\nend\n\nprint b/c, \"/\", a/c\nputs\n\n", "lang": "Ruby", "bug_code_uid": "e1bdb365a8bb0a9b1a8a58861c3ae0e9", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "6a58cdfb1763da7d449415ff7fc4a539", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9722222222222222, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets\nx = 0\ngets.each_char do |c|\n x += 1 if c == s[x]\nend\nputs x\n", "lang": "Ruby", "bug_code_uid": "8f56df1e3f486445c540126d3721c6c9", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "189a4a95d51ccdaf670537c9cb670bdb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.943089430894309, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = gets.chomp.split('')\nt = gets.chomp.split('')\nc = 0\nfor i in 0...[s.size, t.size].min\n c += 1 if t[i] == s[c]\nend\nputs(c + 1)", "lang": "Ruby", "bug_code_uid": "8397042606fadfaf24f508a0fe9e4413", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "525fa7d6ba53897035b2b3290f4aabe3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.4280442804428044, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a1, b1 = gets.split.map {|x| Integer x}\na2, b2 = gets.split.map {|x| Integer x}\na3, b3 = gets.split.map {|x| Integer x}\na4, b4 = gets.split.map {|x| Integer x}\nif (a1 > b3 and b2 > a4 and a1 > b4 and b2 > a3) or (b1 > a3 and a2 > b4 and b1 > a4 and a2 > b3)\n puts 'Team 1'\nelsif (a3 > b1 and b4 > a2 or b3 > a2 and a4 > b1) and (b3 > a1 and a4 > b2 or b4 > a1 and a3 > b2)\n puts 'Team 2'\nelse\n puts 'Draw'\nend", "lang": "Ruby", "bug_code_uid": "197f1f4df51df5e1bfaed57e6d1f6a96", "src_uid": "1a70ed6f58028a7c7a86e73c28ff245f", "apr_id": "01deb60ec3fcd82e7671403449e39e4b", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9574468085106383, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "puts (1..gets.to_i).inject(:*)/(2*((n/2)**2))", "lang": "Ruby", "bug_code_uid": "ed60888b48b639fbf0a4b7248b5936e2", "src_uid": "ad0985c56a207f76afa2ecd642f56728", "apr_id": "6b00988bbd9d71ffb2a463629b4c2938", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8851540616246498, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n, t = gets.split.map{ |e| e.to_i}\nq = gets.chomp\n\nfor i in 1..t\n s = q.split('BG')\n\n q = s[0]\n\n for i in 1..s.size-1\n q += 'GB' + s[i]\n end\n q += 'GB' if q.length < n\nend\n\nputs q\n", "lang": "Ruby", "bug_code_uid": "251a8aea0a57b459b0713b6c3bf33786", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "37a642b9926956c020c972f8ebc32dff", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9083333333333333, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "require 'algorithms'\n\nn, t = gets.chomp.split.map(&:to_i)\na = gets.chomp\n\nt.times do |i|\n a.gsub!(/BG/) { |x| 'GB' }\nend\n\nputs a", "lang": "Ruby", "bug_code_uid": "b6c72c841b4ce8884ee8b57934bfa69d", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "913f2e46c12cc6aeb62e0e225bcaa851", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9701149425287356, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, t = gets.split.map(&:to_i)\ns = gets.chomp.to_a\nt.times do\n\ti = 0\n\twhile i < s.size - 1\n\t\tif s[i] == \"B\" and s[i + 1] == \"G\"\n\t\t\ts[i], s[i + 1] = s[i + 1], s[i]\n\t\t\t\n\t\t\ti += 1\n\t\tend\n\t\t\n\t\ti += 1\n\tend\nend\n\nputs s.join", "lang": "Ruby", "bug_code_uid": "99e7e4261de47266e27cf32cf518f6b7", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "587adbdf79b9734ecce4e1bc83fcd2f6", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9598540145985401, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "# frozen_string_literal: true\n\n# @param [String] stones\n# @param [String] instructions\ndef find_last_stone_to_stand_on(stones, instructions)\n current_stone = 0\n current_inst = 0\n\n stones.each_char do |stone|\n\n if current_inst.nil?\n return current_stone\n else\n current_inst = instructions.index(stone, current_inst)\n current_stone += 1\n end\n \n unless current_inst.nil?\n current_inst += 1\n end\n end\n\nend\n\n\nstones = gets.chomp\ninstructions = gets.chomp\nprint find_last_stone_to_stand_on(stones, instructions)\n\n\n", "lang": "Ruby", "bug_code_uid": "e8b50bcf8f29c72cd8bc179a807bb498", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "5fcee23b8762049063dd2840aa4e5e5e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9221556886227545, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s1,s2=gets.chomp\na=0\nfor i in 0...s2.size do\na+=1 if s2[i]==s1[a]\nend\nputs a+1", "lang": "Ruby", "bug_code_uid": "b6bbce8d8747f3f1d6d19677e83d47ab", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "868a7590a118e1c463e0ed1c7b8439c0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9425706472196901, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "TEST_MODE = ARGV[0] == 't'\n\ndef evaluate(actual, expected); actual == expected ? \"OK\" : \"**NG**\"; end\ndef tests(); yield if TEST_MODE; end\ndef to_array(val); val.kind_of?(Array) ? val : [val]; end\ndef parse_int_array(str); str.split(\" \").collect{|s| s.to_i}; end\n\ndef t(input, expected_output)\n input = to_array(input)\n expected_output = to_array(expected_output)\n output = []\n solve(input, output)\n puts \"#{evaluate(output, expected_output)} : input=#{input.to_s}, expected=#{expected_output.to_s}, actual=#{output.to_s}\"\nend\n\nrequire 'prime'\n\ndef lcd(a, b)\n temp = {}\n a.prime_division.each {|p|\n temp[p[0]] = p[1]\n }\n b.prime_division.each {|p|\n if temp.has_key? p[0]\n temp[p[0]] += p[1]\n else\n temp[p[0]] = p[1]\n end\n }\n temp.keys.reduce(1) {|a, n| a * (n**temp[n])}\nend\n\ndef solve(input, output)\n n, m, z = parse_int_array(input[0])\n output << (z/lcd(n, m)).to_s\nend\n\ntests do\n # test cases\n puts lcd(2,3)\n puts lcd(4, 10)\n t(\"1 1 10\", \"10\")\n t(\"1 2 5\", \"2\")\n t(\"2 3 9\", \"1\")\nend\n\nputs solve(STDIN.read.split, []) unless TEST_MODE\n", "lang": "Ruby", "bug_code_uid": "5e927b1289e9d8263ee90506aae7c2c2", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "9ea4e28807d8b7b44bfabe91b968fdf7", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7928571428571428, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, m, z = gets.strip.split.map(&:to_i)\ncount = 0\n(1..z).each do |i|\n call = i * n\n count += 1 if call % m == 0\n break if call > z\nend\nputs count\n", "lang": "Ruby", "bug_code_uid": "10f21110701dd1eaaede9e63a6972966", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "9fb6b6bf9c10c96d3d00ea70927d9a91", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7388535031847133, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "b = gets.to_i\ng = gets.to_i\nn = gets.to_i\n\ncnt=0\n\nif b>=n && g>=n\n cnt = n+1\nelse\n cnt = [b,g].min+1\nend\n\nputs cnt", "lang": "Ruby", "bug_code_uid": "3a09a6ec8ae9523d941187bf0ce2d3a5", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "6fb571df4ab1a308b6a253bf301ab375", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5942028985507246, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "_, base = gets.chomp.split.map(&:to_i)\na = gets.chomp.split.join.to_i(base)\n\n_, base = gets.chomp.split.map(&:to_i)\nb = gets.chomp.split.join.to_i(base)\n\nans = \"\".tap do |out|\n case\n when a == b\n out << \"=\"\n when a > b\n out << \">\"\n else\n out << \"<\"\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "e7db7f7d3e76537fd504763ec7f9d7ab", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "2360c123dc0da2f9a387cab983197644", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5546875, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "_, b1 = gets.split.map(&:to_i)\na1 = gets.split.join('').to_i(b1)\n_, b2 = gets.split.map(&:to_i)\na2 = gets.split.join().to_i(b2)\nif a1 < a2\n puts '<'\nelsif a1 > a2\n puts '>'\nelse\n puts '='\nend\n", "lang": "Ruby", "bug_code_uid": "91514cd3355023c0a9b3c6d51946e7a9", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "78b32dd662419a8733a9ad1f028ed01d", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.842809364548495, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "x, y = 2.times.map {\n n, b = gets.split.map(&:to_i)\n gets.delete(' ').to_i(b)\n}\nputs '<' if x < y\nputs '>' if x > y\nputs '=' if x == y\n", "lang": "Ruby", "bug_code_uid": "a4a7a33af9b307a0be56e9df9c1345ae", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "a297e8b877102653f2750ed0bf9e9969", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.951310861423221, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "x, y = 2.times.map{\n n, a = gets.split.map(&:to_i)\n gets.split.map(&:to_i).inject{|x, y| x *= a ; x += y}\n} \np '=><'[x <=> y] ", "lang": "Ruby", "bug_code_uid": "835bbf0278c3ead09559cb63b9664110", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "552a55eaa937becf69783eb269205ab2", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8796992481203008, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# cook your code here\n\na = gets.to_i;\nb = gets.to_i;\nans = 0;\n\nwhile a>0 and b>0 \n if a>=b \n ans += a/b; \n a %= b;\n else \n ans += b/a; \n b %= a; \n end\nend \n\nputs ans; ", "lang": "Ruby", "bug_code_uid": "59f82a56ac82cec6d19d129123c394b9", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "9ef95def205f885cd2a0c4a577935da1", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5775075987841946, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a,b = gets.split(\" \").map{|x| x.to_i}\ncounter=1\nif b == 1\n puts a\n exit\nend\nwhile a!=b do\n if b > a\n a ,b = b,a\n end\n a -= b\n counter+=1\nend\nputs counter\n", "lang": "Ruby", "bug_code_uid": "964e5eae67e3fa80aef71ed8495a92e2", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "227f0deac6b69b8fb0dd51eaf85247e5", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.48346055979643765, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a,b = gets.split(\" \").map{|x| x.to_i}\ncounter=1\nif b == 1\n puts a\n exit\nelsif b==a-1\n puts a\n exit\nelsif b==a-2\n puts (a/2)+1\n exit\nend\nwhile a!=b do\n if b > a\n a ,b = b,a\n end\n a -= b\n counter+=1\nend\nputs counter\n", "lang": "Ruby", "bug_code_uid": "5905938faf82ecb2ffede77c110d8bc3", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "227f0deac6b69b8fb0dd51eaf85247e5", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8950617283950617, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "h,w=gets.split.map{|e| e.to_i}\nans=0\nwhile h>1 && w>1\n\th1=[h,w].max\n\tw1=[h,w].min\n\tans+=h1/w1\n\th1=h1%w1\n\tw=w1\n\th=h1\nend\nans+=[h,w].max\nputs ans\n\n", "lang": "Ruby", "bug_code_uid": "5dad4ab004660d9a95af90335b5b610f", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "78ce177ff545160d9b63691f46038880", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6984126984126984, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "gets.to_i.to_a.each{|n| p 6*n*n-6*n+1}", "lang": "Ruby", "bug_code_uid": "bf545d1f40f64415c7d333b38e91ac46", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "554aba610204f08c6821f160dde9bfed", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.96, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=gets.to_i\np 6*x*(x-1)+1", "lang": "Ruby", "bug_code_uid": "3b9a11763f91c253ef56e4ac0041f8a9", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "af583a0d15a413a92f3b6be57ce24e9a", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7058823529411765, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = gets.to_i\nk = n-1\np = 1 +12((k+1)*k/2)\nputs p", "lang": "Ruby", "bug_code_uid": "5b0d6b471538134507c68abc6cde1950", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "ae08a32eadd1826f0c93711217646009", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.769811320754717, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "n = gets.to_i\n\ndef split_amount(amount, count = 0)\n return count if amount == 0 \n bill = [100, 20, 10, 5, 1].find { |n| n <= amount }\n count += 1\n split_amount(amount - bill, count)\nend\n\nputs split_amount(n)", "lang": "Ruby", "bug_code_uid": "6815f2621697eebbfd61bab253a9a5f9", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "9797b8a253cd8edebd07c694163fabb4", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3620178041543027, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "n = gets.to_i\n\ndef split_amount(amount, count = 0)\n multiple = [100, 20, 10, 5, 1].find { |n| amount % n == 0 }\n if amount == 0\n return count\n elsif !multiple.nil?\n return count + amount / multiple\n else\n bill = [100, 20, 10, 5, 1].find { |n| n <= amount }\n count += 1\n split_amount(amount - bill, count)\n end\nend\n\nputs split_amount(n)", "lang": "Ruby", "bug_code_uid": "ee005caa94c8679be54de2da9f881986", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "9797b8a253cd8edebd07c694163fabb4", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9258160237388724, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "# frozen_string_literal: true\n\nrequire 'set'\n\ndef findMinNeededHorseShoes (shoecolors)\n s = Set.new\n counter = 0\n shoecolors.each do |color|\n if s.include? color\n counter += 1\n else\n s << color\n end\n end\n counter\nend\n\nshoecolors = []\nfor i in 1..4 do\n shoecolors[i] = gets.chomp\nend\nputs findMinNeededHorseShoes(shoecolors).to_s\n", "lang": "Ruby", "bug_code_uid": "e030225a659b387e128d84d24d38b8c9", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "3d3a6e194befa1293ee442c7a2deeb32", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9821717990275527, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def add_count counter, item\n if counter[item].nil?\n counter[item] = 1\n else\n counter[item] += 1\n end\nend\na, b, c, d = gets.strip.split.map(&:to_i)\ncount = {}\nadd_count count, a\nadd_count count, b\nadd_count count, c\nadd_count count, d\nans = count.length % 4\nans = 4 - ans\nputs ans\n", "lang": "Ruby", "bug_code_uid": "e057496ec4d1d915139beb4d424a069a", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "707090c616d4e1c035bba69fa44f1642", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.609375, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "puts (4 - gets.split.map(&:to_i).uniq!.length).to_i", "lang": "Ruby", "bug_code_uid": "11f8c22fa94b96749d8c6731f459e10a", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "a289383d055bf4f5bc20336444319d96", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9367088607594937, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts 4 - gets.split.map(&:to_i).uniq\n", "lang": "Ruby", "bug_code_uid": "b457e9f2d4002f801667b8e1b2971940", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "b81f975edf94fb50d377485c41a3767b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.993607305936073, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "=begin\n , \\ / , \n / \\ )\\__/( / \\ \n / \\ (_\\ /_) / \\ \n ____/_____\\__\\@ @/___/_____\\____ \n | |\\../| |\n | \\VV/ |\n | ------hoi------- |\n |_________________________________|\n | /\\ / \\\\ \\ /\\ | \n | / V )) V \\ | \n |/ ` // ' \\| \n ` V '\n=end\n\nn = gets.chomp\nn = n.to_i\na = [1, (4 * (n * (2 ** 0.5).to_i).to_i).to_i]\nputs a.max", "lang": "Ruby", "bug_code_uid": "15876bb4f72ea0759d013902097a3ad5", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "479f9d4678ddbd81516f20b409c26f4d", "difficulty": null, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.1453287197231834, "equal_cnt": 5, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def calc(n, k)\n base = k\n sum = n\n while n / base > 0\n sum += n / base\n base *= k\n end\n sum\nend\nn, k = gets.split.map(&:to_i)\nans = n\nwhile calc(ans-1, k) >= n\n ans -= 1\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "42142fc7a4d2fc47ba30a62286aa30fa", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "fb9e5edf6ebfe3a1eea8a751d84d23b8", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.18900343642611683, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n,k = gets.split.map(&:to_i)\nf = false\n1.upto n do |i|\n s = 0\n j = 0\n l = 0\n loop do\n l = i*(k**j)\n break if l >= n\n s += l\n if s >= n\n f = true\n break\n end\n j += 1\n end\n if f\n p l\n exit\n end\nend\np n\n", "lang": "Ruby", "bug_code_uid": "ca3eeb83a4c4c49dcac7b2c267230e0a", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "ca64d663a63d69f5b5c429c9285b5f55", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9895734597156398, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "MOD = 10 ** 9 + 9\ndef pow2(x)\n st = 1\n pow = 2\n while(x != 0)\n if(x & 1)\n st = (st * pow) % MOD\n end\n pow = (pow * pow) % MOD\n x >>= 1\n end\n return st\nend\nn, m, k = gets.chop.split.map(&:to_i)\nextra = n - m\nif(extra * k >= n)\n print m % MOD\nelse\n st = n - extra * k\n cnt = st / k\n rest = st % k\n total = pow2(cnt)\n total = (total - 2 + MOD) % MOD\n total = (total * k + rest) % MOD\n total += extra * (k - 1)\n total %= MOD\n print total\nend\n", "lang": "Ruby", "bug_code_uid": "3d2dddab6f8d335fca2532212babbb60", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "05b3dea70ce52c3be97801ce5d58ad9c", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.40864864864864864, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "MOD = 10 ** 9 + 9\nn, m, k = gets.chop.split.map(&:to_i)\nextra = n - m\nif(extra * k >= n)\n print m % MOD\nelse\n st = n - extra * k\n cnt = st / k\n rest = st % k\n total = 1 \n (cnt + 1).times do\n total = (total * 2) % MOD \n end\n total = (total - 2 + MOD) % MOD\n total = (total * k + rest) % MOD\n total += extra * (k - 1)\n total %= MOD\n print total\nend\n", "lang": "Ruby", "bug_code_uid": "8d12ea40d5d1e7093a01ec2602dfb78a", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "05b3dea70ce52c3be97801ce5d58ad9c", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.17972681524083392, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "module Containers\n class Stack\n\n end\nend\n\nmodule Algorithm\n def pow_mod(a, b, c) #compute (a ^ b) mod c\n ans, tich = 1, a\n while b > 0\n ans = (ans * tich) % c if b % 2 == 1\n tich = (tich * tich) % c\n b /= 2\n end\n ans\n end\nend\n\ndef read(f = nil)\n if f\n @n, @m, @k = f.gets.split.map(&:to_i)\n else\n @n, @m, @k = gets.split.map(&:to_i)\n end\nend\n\ndef input(test_case, &block)\n (1..test_case).each do |e|\n f = File.new(\"test#{e}.txt\", 'r')\n read\n yield\n f.close\n end\nend\n\ndef solve(n = @n, m = @m, k = @k)\n t = (n / k) * (k - 1) + n % k\n if m <= t\n puts m\n else\n a = m - t\n puts k * ((1 << (a + 1)) - 2) + m - a * k\n end\nend\n\ndef main\n input 2 do\n solve\n end\nend\n\nmain", "lang": "Ruby", "bug_code_uid": "75df81437e04868e8f4c66c0dafc88c5", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "745dba1d64820cf0b41ed27af3f52307", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.23883318140382861, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "module Containers\n class Stack\n\n end\nend\n\nmodule Algorithm\n def pow_mod(a, b, c) #compute (a ^ b) mod c\n ans, tich = 1, a\n while b > 0\n ans = (ans * tich) % c if b % 2 == 1\n tich = (tich * tich) % c\n b /= 2\n end\n ans\n end\nend\n\ndef solve\n n, m, k = gets.split.map(&:to_i)\n t = (n / k) * (k - 1) + n % k\n if m <= t\n puts m\n else\n a = m - t\n puts k * ((1 << (a + 1)) - 2) + m - a * k\n end\nend\n\nsolve", "lang": "Ruby", "bug_code_uid": "b9c651fbac9fad2e9e999e3ce1a19b23", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "745dba1d64820cf0b41ed27af3f52307", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9976905311778291, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "h1, h2 = gets.split.map(&:to_i)\na, b = gets.split.map(&:to_i)\n\nh1 += a * 8\nif h1 < h2 and b > a\n puts -1\nelse\n cnt = 0\n rem = (h2 - h1)\n while rem > 0 do\n rem -= (a - b) * 12\n cnt += 1\n end\n puts cnt\nend\n", "lang": "Ruby", "bug_code_uid": "a6b449ff99538d840a6eefa5043c734b", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "8167452415bde536b1c30a938d213efe", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9934640522875817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a=gets.chomp.split(\" \")\n0.upto(1) {|i| a[i]=a[i].to_i}\nb=gets.chomp.split(\" \")\n0.upto(1) {|i| b[i]=b[i].to_i}\ndis=a[1]-a[0]\nfd=8*b[0]\nfn=12*b[1]\nad=12*b[0]\nan=12*b[1]\nif dis-fd<=0\nputs \"0\"\nelsif ad<=0\nputs \"-1\"\nelse\ndis=dis-fd+fn\nans=1\nloop do\ndis-=ad\nbreak if dis<=0\nans+=1\ndis+=an\nend\nputs \"#{ans}\"\nend", "lang": "Ruby", "bug_code_uid": "a0cd6a281311e3942b6a80b7abe66066", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "1c3bb75e2ef621b326b05119844bcf40", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7483702737940026, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "def solve(t, acc, type)\n return t if acc >= @goal\n return -1 if t == 0 and @n_mul > @d_mul and acc < @goal\n\n if type == :day\n solve(t+1, acc + (@d_mul * 12), :night)\n else\n solve(t, acc - (@n_mul * 12), :day)\n end\nend\n\nsp, @goal = gets.split(\" \").map(&:to_i)\n@d_mul, @n_mul = gets.split(\" \").map(&:to_i)\n\nputs solve(0, sp + (8 * @d_mul), :day)\n", "lang": "Ruby", "bug_code_uid": "728199de61136cfc7b0c550a0b030a27", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "641b204689ee8f205f178f852d7600eb", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8233766233766234, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "def solve(t, acc, type)\n return -1 if t == 0 and @n_mul >= @d_mul and acc < @goal\n\n if type == :day\n return t if acc >= @goal\n solve(t+1, acc + (@d_mul * 12), :night)\n else\n solve(t, acc - (@n_mul * 12), :day)\n end\nend\n\nsp, @goal = gets.split(\" \").map(&:to_i)\n@d_mul, @n_mul = gets.split(\" \").map(&:to_i)\n\nputs solve(0, sp + (8 * @d_mul), :day)\n", "lang": "Ruby", "bug_code_uid": "948e5c7f5c23b9a1264cf8d59132d3b0", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "641b204689ee8f205f178f852d7600eb", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9937106918238994, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b=gets.split\nidx=(1...a.size).find{|i|a[i]>b[0]}||a.size\nputs a[0...idx]+b[0]", "lang": "Ruby", "bug_code_uid": "770d0325f2355d245403f99857efe85a", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "apr_id": "f9b1b1787200dad6b68b1fe3aa15584b", "difficulty": 1000, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.92, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "# http://codeforces.com/contest/586/problem/A\n# A. Alena's Schedule\nn = gets.chomp.to_i\narr = gets.chomp.split.join.gsub(/00/, '').chars\n\narr.pop if arr.last == '0'\narr.shift if arr.first == '0'\nputs arr.join.length\n", "lang": "Ruby", "bug_code_uid": "f7d64e17e81aea2128716ec353efd53f", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "70d5475d78691bf7957279b7da663282", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6644182124789207, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a=gets.chomp.to_i\nb=gets.chomp.split(\" \")\nloop do\nif b[0]==\"0\"\nb.delete_at(0)\nelse\nbreak\nend\nend\nloop do\nif b[b.length-1]==\"0\"\nb.delete_at(b.length-1)\nelse\nbreak\nend\nend\ntrig=0\n0.upto(b.length-3) do |i|\nif b[i]==\"0\"&& b[i+1]==\"0\"\nb.delete_at(i)\nb.delete_at(i+1)\nend\nend\nputs \"#{b.length}\"\n", "lang": "Ruby", "bug_code_uid": "ee88ea65c189f6e4b015fda6bd03c76b", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "d18f35b07acb20e93160d860edafa28b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9724473257698542, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nv = gets.split.map(&:to_i)\ncont = 0\nsw = 0\nc = 0\nfor i in(0..(n-1))\n if v[i] == 1\n sw = 1\n end\n if sw == 1\n if(v[i]==0)\n c+=1\n elsif c < 2 \n cont=cont+1+c\n c=0\n else\n cont+=1\n end\n end\nend\np cont", "lang": "Ruby", "bug_code_uid": "62856c1383600c9eaa844af509809128", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "2e16c970d1a7a6e5679cc5df133b168d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.25654450261780104, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# #325 Div2 A. Alena's Schedule\nn = gets.chomp.to_i\nl = gets.chomp.split(\" \").map(&:to_i)\nif l.length <=3\n puts l.count(1)\nelse\n start = l.index(1)\n lessons = []\n lesson = 0\n (start..n-2).each do |i|\n if l[i] == 1 then\n lesson += 1\n else\n if l[i-1] == 1 and l[i+1] == 1 then\n lesson += 1\n else\n lessons << lesson\n lesson = 0\n end\n end\n end\n if l[n-1] == 1 then\n lesson += 1\n end\n lessons << lesson\n puts lessons.inject(:+)\nend", "lang": "Ruby", "bug_code_uid": "300cf24395f8a5a124021acd0904ab44", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "dd58934d73a093dc36ca7afa6b5ccf70", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9885057471264368, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nw=0.0\ngets.to_i.times{|i|\n\tw+=1 if gets.to_i==1\n\tr=[r,w/-~i].max\n}\np r", "lang": "Ruby", "bug_code_uid": "b16ca48ebb4fa28ce5e24369b6a9bcc3", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "8817ddd972f36a35dfed4da675c68867", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8128342245989305, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "def function\na=gets.chomp\nb=gets.chomp\nc=gets.chomp\na=a.to_i\nb=b.to_i\nc=c.to_i\nz=a+b\nif cstep\n puts \"No\"\nelsif need==step \n puts \"Yes\"\nelse \n if (need-step)%2==o \n puts \"Yes\"\n else\n puts \"No\"\n end\nend\n", "lang": "Ruby", "bug_code_uid": "bef6927e4a7ad3d803db7430e7b62ac2", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "7c96ebfb2c1f5537fdb8cd9ad94491f7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9590163934426229, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a, b, s = gets.chomp.split.map &:to_i\nsum = a + b\nputs if s >= sum && (s - sum) % 2 == 0 then\n \"Yes\"\nelse\n \"No\"\nend", "lang": "Ruby", "bug_code_uid": "da7ecaed9b471d273c1eb746de4cc67a", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "b3e769db33c4c495b00be9a12f43965a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.24964539007092199, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "target = ARGV[0..1].map{|i| i.to_i }\nsteps = ARGV[2].to_i\n\ndef can_do_in_n_steps(target, steps)\n sum_of_target_coords = target[0].abs + target[1].abs\n if sum_of_target_coords <= steps and (steps - sum_of_target_coords) % 2 == 0\n return true\n end\n return false\nend\n\nputs can_do_in_n_steps(target, steps) ? 'Yes' : 'No'\n\n\n", "lang": "Ruby", "bug_code_uid": "84af21d38231393b9600162a608ddc1a", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "4d1f5a423af2713e72d41e9351ba79b1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9473684210526315, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts gets==\"2\"?2:1", "lang": "Ruby", "bug_code_uid": "f0ed4074cb26e66e912db7e98b47649b", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "0476b5033be2a4ba8d054dd997b5e190", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8648648648648649, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "gets.to_i==2?2:1", "lang": "Ruby", "bug_code_uid": "926ebd932dd8bd6e685099a3cbc475cb", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "ffe2c858d83a3d2ca8a4f62354cf2fc5", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\ni = n\ni -= 1\nif( i != 0)\n while(n % i != 1)\n i -= 1\n end\nend\nputs n - i", "lang": "Ruby", "bug_code_uid": "e47ab51e3ac06b4fed968c500ed71682", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "6d075b93031a1ce49ba8e0ef52af70c9", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.07096774193548387, "equal_cnt": 20, "replace_cnt": 17, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 21, "bug_source_code": "def fact(n)\n (1..n).inject(&:*)\nend\n\ndef kind_cnt(arr)\n list = Hash.new(0)\n arr.each do |c|\n list[c] += 1\n end\n\n tmp = 24\n vals = list.values.sort\n vals.each do |i|\n tmp /= fact(i)\n end\n tmp / (4-vals[0]+1)\nend\n\n\narr = gets.chomp.each_char.sort.freeze\nprev = ''\ncnt = 0\n(1..5).each do |i|\n c = arr[i]\n next if c == prev\n\n sub = arr[1...i]\n sub += arr[(i+1)..-1] if i+1 < arr.size\n cnt += kind_cnt(sub)\n \n prev = arr[i]\nend\n\np cnt\n", "lang": "Ruby", "bug_code_uid": "402c4ebdaae4be311c514c3e982faa60", "src_uid": "8176c709c774fa87ca0e45a5a502a409", "apr_id": "5e4c02d8a7ce746c2cf1840acf623f76", "difficulty": 1700, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9830508474576272, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\ngets;a=gets.split.map(&:to_i)\ns=0;h=Hash.new(0)\na.each{|e|s+=e;h[e]+=1}\nr=s\nh.each{|k,v|\n\tif v>=2\n\t\tr=[r,s-k*[v,3].min].min\n\tend\n}\np r", "lang": "Ruby", "bug_code_uid": "f5f087655d822c37d41e11c6fb4a0666", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "ef1b5fdd0b60f5d4035adec13588eb17", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9844054580896686, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=gets.chomp.split(\" \").map{|i|i.to_i}\na.sort!\nif a.count(a[4])>=3\nputs \"#{a[0]+a[1]}\"\nelsif a.count(a[4])==2\nif a.count(a[2])>=3\n\tif a[2]*3 > a[4]*2\n\tputs \"#{a[4]*2}\"\n\telse\n\tputs \"#{a[2]*3}\"\n\tend\nelse\n\tputs \"#{a[4]*2}\"\nend\n\nelsif a.count(a[3])==2\n\tputs \"#{a[4]+a[1]+a[0]}\"\nelsif a.count(a[3])>=3\n\tputs \"#{a[4]+a[0]}\"\nelsif a.count(a[2])==2\n puts \"#{a[4]+a[3]+a[0]}\"\nelsif a.count(a[2])==3\n\tputs \"#{a[4]+a[3]}\"\nelsif a.count(a[1])==2\n\tputs \"#{a[4]+a[3]+a[2]}\"\nelse\n\tputs \"#{a[4]+a[3]+a[2]+a[1]+a[0]}\"\nend\n\t", "lang": "Ruby", "bug_code_uid": "fd0fa2c05969be2de61cb53d2e334ee6", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "e661e973a5a760203186031cc05ade1a", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.18758256274768825, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "cards = gets.strip.split.map(&:to_i)\ncounts = Array.new(100, 0)\ncards.each do |i|\n counts[i - 1] += 1\nend\nduplicates = counts.each_index.select { |i| counts[i] >= 2 }.sort.reverse\nif duplicates.length == 0\n puts cards.inject(:+)\nelse\n discard = duplicates[0]\n count = counts[discard]\n index = 0\n upto = [count, 3].min\n while index < upto\n pos = cards.index(discard + 1)\n cards.delete_at pos\n index += 1\n end\n puts cards.inject(:+)\nend\n", "lang": "Ruby", "bug_code_uid": "37d1cd2b008a1f1adce3a94187e35eb7", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "04f556408cc3dd29644202584692ef5d", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7704280155642024, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n, l, r = gets.split.map(&:to_i)\narr = [0] * 3\n(l..r).each do |e|\n arr[e % 3] += 1\nend\ncur = arr.dup\nnxt = [0] * 3\n(2..n).each do |i|\n nxt = [0] * 3\n nxt[0] = cur[0] * arr[0] + cur[1] * arr[2] + cur[2] * arr[1]\n nxt[1] = cur[0] * arr[1] + cur[1] * arr[0] + cur[2] * arr[2]\n nxt[2] = cur[0] * arr[2] + cur[1] * arr[1] + cur[2] * arr[0]\n # puts nxt.join(' ')\n cur = nxt.dup\n cur = cur.map{ |e| e % (10 ** 9 + 7)}\nend\nputs cur[0]", "lang": "Ruby", "bug_code_uid": "0dbda34b7aad8328197e482e93637420", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "cef538ca2500fb54ca94cea9a8dcb408", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6258741258741258, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "DBG = true\nn,l,r = gets.split.map{|z| z.to_i}\nt0 = Array.new(n)\nt1 = Array.new(n)\nt2 = Array.new(n)\n\ns0 = 0\ns1 = 0\ns2 = 0\nfor i in l..r\n if i%3 == 0\n s0 += 1\n elsif i%3 == 1\n s1 += 1\n else\n s2 += 1\n end\nend\n\nt0[0] = s0\nt1[0] = s1\nt2[0] = s2\nR = 1000000007\nfor i in 1...n\n t0[i] = (s0*t0[i-1] + s2*t1[i-1] + s1*t2[i-1]) % R\n t1[i] = (s1*t0[i-1] + s0*t1[i-1] + s2*t2[i-1]) % R\n t2[i] = (s2*t0[i-1] + s1*t1[i-1] + s0*t2[i-1]) % R\nend\nputs \"#{t0[n-1]}\"\n", "lang": "Ruby", "bug_code_uid": "fb2af9bcdc0fe515247f10b5d4ed7ec3", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "19351d15613e52b12e66c4eb4bf7e7da", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.638396299151889, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "require 'test/unit'\n\nclass UnitTest < Test::Unit::TestCase\n \n \n def test_first\n res = solve \"CPCPCPC\"\n assert_equal(7, res)\n end\n \n def test_second\n res = solve \"CCCCCCPPPPPP\"\n assert_equal(4, res)\n end\n \n def test_third\n res = solve \"CCCCCCPPCPPPPPPPPPP\"\n assert_equal(6, res)\n end\n \n def test_fourth\n res = solve \"CCCCCCCCCC\"\n assert_equal(2, res)\n end\nend\n\ndef solve inp\n count = 0\n curr = 1\n prev = inp[0]\n (1..(inp.length - 1)).each do |index|\n if inp[index] == prev\n curr += 1\n else\n prev = inp[index]\n count += 1\n curr = 1\n end\n if curr == 5\n count += 1\n curr = 0\n end\n end\n curr == 0 ? count : count + 1\nend\n\nstr = STDIN.gets.chomp\nputs solve str", "lang": "Ruby", "bug_code_uid": "3a21e853f3e910cf0aed27faad8bacd9", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "ea1e46c1ee98e3828f272d28057def4f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9946902654867257, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "s = gets.chomp\nres = 0\nk = s.index(\"CP\")\nn = s.index(\"PC\")\nif n && k then\n st = n > k ? \"CP\" : \"PC\"\nelsif n then\n st = \"PC\"\nelsif k\n st = \"CP\"\nend\nk = -1\nn = 0\n\nif st then\n while k = s.index(st, k+1) do\n res += s[n..k].size / 5 \n if (s[n..k].size % 5) != 0 then\n res += 1\n end\n n = k\n st = st == \"CP\" ? \"PC\" : \"CP\"\n end\n res += s[n+1..-1].size/5 \n if (s[n+1..-1].size % 5) != 0 then\n res += 1\n end\nelse\n res += s.size / 5 \n if s.size % 5 != 0 then\n res += 1\n end\nend\n\np res", "lang": "Ruby", "bug_code_uid": "b0b38ec9832064169643c8e80f540216", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "14bf0c98eec4f37cecf7edf07f5ea04d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9425287356321839, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "$<.first.strip.scan(/C{1,5}|P{1,5}/).size", "lang": "Ruby", "bug_code_uid": "3cf4dc31a8f5d706cea5b88ce5fea678", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "c7087072ce5633664516390b38e7f446", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9879518072289156, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "c = 0\n(gets.trim.split(/(P+)/) - [\"\"]).each do |r|\n\tdm = r.length.divmod 5\n\tc += dm[1] == 0 ? dm[0] : dm[0] + 1\nend\nprint c\n", "lang": "Ruby", "bug_code_uid": "f100bec3d4c09468ec8155c8baa8f099", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "5b1b48c88dca2a198901e4e925594583", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9995821145006268, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "class Fixnum\n def compare(fixnum)\n return -1 if self < fixnum\n return 1 if self > fixnum\n return 0 if self == fixnum\n end\nend\n\nclass Tram\n attr_reader(:s, :x1, :x2, :t1, :t2, :p, :d)\n def initialize(s, x1, x2, t1, t2, p, d)\n @s = s\n @x1 = x1\n @x2 = x2\n @t1 = t1\n @t2 = t2\n @p = p\n @d = d\n end\n\n def direction\n x2.compare(x1)\n end\n\n def by_foot\n (x1 - x2).abs * t2\n end\n\n def wait_time\n if(direction == d)\n if(d == -1)\n if(p <= x1)\n (((p + s) + (s - x1))) * t1\n else\n (x1 - p).abs * t1\n end\n else\n if(p <= x1)\n (x1 - p).abs * t1\n else\n ((s - p) + s + x1) * t1\n end\n end\n else\n if(d == -1)\n (p * t1) + (x1 * t1)\n else\n ((s - p) * t1) + ((s - x1) * t1)\n end\n end\n end\n\n def tram_time\n (x1 - x2).abs * t1\n end\n\n def by_tram\n wait_time + tram_time\n end\nend\n\ndef main\n s, x1, x2 = gets.split(\" \").map(&:to_i)\n t1, t2 = gets.split(\" \").map(&:to_i)\n p, d = gets.split(\" \").map(&:to_i)\n tram = Tram.new(s, x1, x2, t1, t2, p, d)\n cands = [tram.by_tram, tram.by_foot]\n puts cands.select{|x| x >= 0 }.min\nend\n\nmain\n", "lang": "Ruby", "bug_code_uid": "8133822c52e728a2485026932e58a3c7", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "677a5d276f3fea89312f414b44346a64", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9361702127659575, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\na = gets.chomp\nx = a.size\n\nputs (2**x.size * (a.to_i(2)))%1000000007\n\n", "lang": "Ruby", "bug_code_uid": "3983cfe7e07982f76dcf641d502b62de", "src_uid": "89b51a31e00424edd1385f2120028b9d", "apr_id": "773daabc0b748d511fe640e9a721bc6b", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9847715736040609, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "l, r = gets.split.map(&:to_i)\n\nif l == r\n puts 0\nelse\nx = r^l\n\nputs 2**(Math.log2(x).ceil) -1\nend", "lang": "Ruby", "bug_code_uid": "7d535117fd7cc54e074562a801dd50b0", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "166211b24eb6b6c8466a9dafb03c3bcd", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8165680473372781, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "l, r = gets.split.map(&:to_i)\n\nx = r^l\n\nputs 2**(Math.log2(x).ceil) -1", "lang": "Ruby", "bug_code_uid": "0b95e4bb036e7c8ffda46512e40ab2f0", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "166211b24eb6b6c8466a9dafb03c3bcd", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9743589743589743, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "l, r = gets.split.map(&:to_i)\n\nif l == r puts 0\nelse\nx = r^l\n\nputs 2**(Math.log2(x).ceil) -1\nend", "lang": "Ruby", "bug_code_uid": "9a4a5d4e3379183a25811a6355ba8e52", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "166211b24eb6b6c8466a9dafb03c3bcd", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9971988795518207, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l, r = gets.split.map(&:to_i)\nans = 0\n70.downto(0) do |i|\n\tst = 1<l && st<=r )\n\t\tans = [ans, st*2-1].max\n\telsif (rst)\n\t\tl -= st\n\t\tr -= st\n\tend\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "baac02708c7683e422d98a22dfb8b784", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "2330c105522524c8e8d5a1dba3add946", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.723404255319149, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "n, m = gets.strip.split.map(&:to_i)\nans = 0\n(1..n).each do |i|\n (1..m).each do |j|\n ans += 1 if (i + j) % 5 == 0\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "1cc7a8a81370defdcd2c9a58a0ac24c4", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "7fb6c5bd0391cf0c2b5f555719a03651", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.978021978021978, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.strip.split.map(&:to_i)\ncount = Array.new(n, 0)\nans = 0\n(1..n).each do |i|\n count[i % 5] += 1\nend\n(1..m).each do |i|\n ans += count[(5 - i % 5) % 5]\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "3ab00847c61c04242f868358e91df7e0", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "7fb6c5bd0391cf0c2b5f555719a03651", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.952112676056338, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 10, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "t = gets.to_i\nt.times do\n\tn, m = gets.split.map(&:to_i)\n\tcount = 0\n\t(1..n).each do |x|\n\t\ty1 = 5 - x % 5\n\t\tk = ((m - y1)/5).to_i\n\t\t# y2 = y1 + 5* k\n\t\tcount += k+1\n\tend\n\tputs count\nend", "lang": "Ruby", "bug_code_uid": "dec9277e5df51041ddda4e3efd723152", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "87c49505bedcc6ca0179e464fad250e4", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6328358208955224, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n, m = gets.chomp.split(' ').map(&:to_i)\nx = 1\nans = 0\nuntil x > n\n\tbalanceFactor = (5 * ((x / 5) + 1)) - x\n\ty = balanceFactor\n\tuntil y > m\n\t\t#puts \"x : #{x}, y : #{y}\"\n\t\tans += 1\n\t\ty += 5\n\tend\n\tx += 1\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "f542156d3e5ec92f0639f202d4aaf064", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "03e06334760f40a225f49deeac0fa416", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7633333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\ntemp = gets.to_i\na = []\na[0] = 2 if temp == 1\na[0] = 1 if temp == 2\na[1] = temp\nflag = true\nfor i in 2..n\n\ta[i] = gets.to_i\n\tflag = false if a[i]==a[i-2]\nend\nif temp == 3 || flag == false\n\tprint('NO')\nelse\n\tprint(\"YES\")\nend\n\n\n\n", "lang": "Ruby", "bug_code_uid": "d86232185269a2fdadb7f0394cd04571", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "8229d3ee59a78a0d0c6062700995fe30", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9021897810218978, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\ntemp = gets.to_i\na = []\na[0] = 2 if temp == 1\na[0] = 1 if temp == 2\na[1] = temp\nflag = true\nflag = false if temp=3\nty = [1,2,3] - a[0]\nfor i in 2..n\n\ta[i] = gets.to_i\n\tflag = false if !ty.include? a[i]\n\ttyr = ty - a[i]\n\tty = [1,2,3] - tyr\nend\nif temp == 3 || flag == false\n\tprint('NO')\nelse\n\tprint(\"YES\")\nend\n\n\n\n", "lang": "Ruby", "bug_code_uid": "ba992d3327c351929c7c919fba0d2a65", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "8229d3ee59a78a0d0c6062700995fe30", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9299363057324841, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "arr = gets.split(' ')\nk = arr[0].to_i\nn = arr[1].to_i\nw = arr[2].to_i\ntotal_sum = w*(k+w*k)/2\nneeded = total_sum - n\nneeded>0 ? puts needed : puts 0", "lang": "Ruby", "bug_code_uid": "691c964306c40be61b498e30b3943b40", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "b6867169f4a8d23aaf05ca6f15aab492", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5229357798165137, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "a = gets.chomp.to_i\nb = gets.chomp.to_i\nc = gets.chomp.to_i\n\nr = (a + c -1)*(b + c -1)/c**2\nputs r", "lang": "Ruby", "bug_code_uid": "bdef0abc4149d068524a61314857c9d4", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e077ef89b39c563c63b34244f0b4f662", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5738045738045738, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets\nm = gets\na = gets\nn = n.to_i\nm = m.to_i\na = a.to_i\n\nl = (n-n%a)/a\nh = (m-m%a)/a\n\nif(n%a != 0)\n\tl = l + 1\nend\n\nif(m%a != 0)\n\th = h + 1\nend\n\nputs l*h", "lang": "Ruby", "bug_code_uid": "7d83981fac0c2e3177cdee0ce136949d", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f93972f434ed41625f61fce2f4c9e842", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.011875511875511875, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n \n\n\n \n\n\t\n\t \n \n\t \t \t\t\t \t\n \n\t\n\n \t \n \n \n \n\n\n\n", "lang": "Ruby", "bug_code_uid": "da866f97576b3b0ac5e53e7339b30fd3", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "ac9331f5f0835defa1ea307de31bf710", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.01187794388695474, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n\t\t\n\n\n\t\t\n\t\n\t\t \n\n\t\t\t\t\n\n \n\t \t\t\n\n\n\t \n \n\t\t\t\n \t\n\n \n", "lang": "Ruby", "bug_code_uid": "58c4401acb27b93a3bacb514b26e3c54", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "ac9331f5f0835defa1ea307de31bf710", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.84688995215311, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp.to_i\nm = gets.chomp.to_i\na = gets.chomp.to_i\n\nm_div_a = m/a\nm_rest_a = m%a\n\nn_div_a = n/a\nn_rest_a = n%a\n\nm_a = m_div_a + (m_rest_a != 0 ? 1 : 0)\nn_a = n_div_a + (n_rest_a != 0 ? 1 : 0)\n\nputs m_a * n_a\n", "lang": "Ruby", "bug_code_uid": "03e6c0a2649acda47b13a5c065d8a5aa", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "8d25c3f0bdc683d5c82aecff96710466", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.72782874617737, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "n = gets.to_i\nm = gets.to_i\na = gets.to_i\n\nres = n / a\nif ((n % a) != 0) then res+=1\nend\nres += m / a\nif ((m % a) != 0) then res+=1\nend\nputs res", "lang": "Ruby", "bug_code_uid": "5ba586449a31ee5819116c88fb4d43de", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "4d3505b354f3850beb9df50f109431be", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9957081545064378, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#C:\\Ruby26-x64\\bin -w\n# -*- coding: UTF-8 -*-\n\nn, m, a = get.split.map(&:to_i)\nputs (n.to_f/a).ceil*(m.to_f/a).ceil\n", "lang": "Ruby", "bug_code_uid": "9d7663ca22b3eaaa20eb870c7f7be8c2", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "eafd9ca69f0685b7442920adf36fb8d7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.15555555555555556, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "gets.to", "lang": "Ruby", "bug_code_uid": "5c862af34770cf7fd7b57282cc1c0062", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "ff10e4e36ab95cfea95d3344f7a0bed8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.0171990171990172, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 19, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \n \n\n \n \n\n\t\n\n\t \t\t\n\n\t \n\t \t\n\n\t\t\n\n \n\n\t\n \n\t\n\t\n\t \n\t", "lang": "Ruby", "bug_code_uid": "f0604b01ceebdabaadb4f4c28ff3dcab", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "0834f5e65cc18060cdba08482266a336", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9440914866581956, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "def chrnum(ch)\n if ch >= \"0\" && ch <= \"9\"\n return ch.to_i\n end\n return ch.ord - 55\nend\n\ndef strnum(str, rdx)\n ret = 0\n mult = 1\n str.reverse!.each_byte{|s|\n ret += chrnum(s.chr)*mult\n mult *= rdx\n }\n return ret\nend\n\nh,m = gets.chomp.split(\":\")\nh = h.sub(/^0+/,\"\")\nm = m.sub(/^0+/,\"\")\nminrdx = 2\n(h+m).each_byte{|hm|\n wk = chrnum(hm.chr)+1\n minrdx = wk if wk > minrdx\n}\nif h.length == 1 && m.length == 1\n if chrnum(h) < 24 && chrnum(m) < 60\n puts \"-1\"\n else\n puts \"0\"\n end\nelse\n if strnum(h,minrdx) >= 24 || strnum(m,minrdx) >= 60\n puts \"0\"\n else\n print minrdx.to_s\n minrdx += 1\n while strnum(h,minrdx) < 24 && strnum(m,minrdx) < 60\n print \" \" + minrdx.to_s\n minrdx += 1\n end\n puts \"\"\n end\nend\n", "lang": "Ruby", "bug_code_uid": "d08fbdabf05cfe82db298069d5a679b6", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "fbb70d6db76d8660868c26ace92a61a5", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6752, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "time = gets\nm = /(.*):(.*)/.match(time)\nhour = m[1]\nminute = m[2]\n\nmax = 0\nhour.each_char {|c| max = [c.to_i(36), max].max}\nminute.each_char {|c| max = [c.to_i(36), max].max}\ninfinite = false \nbases = []\nfor i in max + 1..35\n if(!(hour.to_i(i) < 0 || hour.to_i(i) > 23 || minute.to_i(i) < 0 || minute.to_i(i) > 59))\n bases << i\n\tif(hour.to_i(i) == hour.to_i(i + 1) && minute.to_i(i) == minute.to_i(i + 1))\n\t infinite = true\n\tend\n end\nend\n\nif infinite\n puts -1\nelsif bases.length > 0\n puts bases.join(\" \")\nelse\n puts 0\nend", "lang": "Ruby", "bug_code_uid": "dc13ef2abe534568c494daf26c2a9e97", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "2a21aa9ba4f5b103fbe34bd41ce582e0", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9986091794158554, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def convert str, b\n num = 0\n for i in 0..str.length-1\n num += (str[i].to_i(36) * (b**(str.length-1 - i)).to_i)\n end\n return num\nend\n\ntime = gets\nm = /(.*):(.*)/.match(time)\nhour = m[1]\nminute = m[2]\n\nmax = 1\nhour.each_char {|c| max = [c.to_i(36), max].max}\nminute.each_char {|c| max = [c.to_i(36), max].max}\ninfinite = false \nbases = []\nfor i in max + 1..60\n if(!(convert(hour,i) < 0 || convert(hour,i) > 23 || convert(minute, i) < 0 || convert(minute, i) > 59))\n bases << i\n\tif(i < 36 && convert(hour,i) == convert(hour, i + 1) && convert(minute, i) == convert(minute, i + 1))\n\t infinite = true\n\t break\n\tend\n end\nend\n\nif infinite\n puts -1\nelsif bases.length > 0\n puts bases.join(\" \")\nelse\n puts 0\nend", "lang": "Ruby", "bug_code_uid": "9c1cd5f5c7cf098b1d9a2c0318284af0", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "2a21aa9ba4f5b103fbe34bd41ce582e0", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9925925925925926, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "h, m = gets.chomp.split(\":\").map do |s|\n s.sub(/^0+(.)/, '\\1').bytes.to_a.map do |s|\n if s <= 57\n s - 48\n else\n s - 55\n end\n end\nend\n\nif h.size == 1 && m.size == 1 && h.first < 24 && m.first < 59\n puts -1\n exit\nend\n\ndef cand(a, n)\n sum = 0\n a.reverse.each_with_index do |i, index|\n sum += i * (n ** index)\n end\n sum\nend\n\nhh = []\nmm = []\n(2..60).each do |n|\n hh << n if h.all?{|i| i < n} && cand(h, n) < 24\n mm << n if m.all?{|i| i < n} && cand(m, n) < 59\nend\nr = hh & mm\nputs r.empty? ? 0 : r.join(\" \")\nexit\n", "lang": "Ruby", "bug_code_uid": "d6ded71eb9dfc1756f01d7774eed1a04", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "1673999068e5ee4cf183a6c729796af4", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9166666666666666, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,k=gets.split.map &:to_i;puts [:YES,:NO][n/k%2]", "lang": "Ruby", "bug_code_uid": "bf6109313c9a4c3baf6bfbacbc064f7e", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "852925ffd7499138e181261f76507e0b", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8899521531100478, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n, k = gets.strip.split.map(&:to_i)\nans = \"YES\"\nmod = n % k\ndiv = n / k\nans = \"NO\" if div.even? && mod > 0\nputs ans\n", "lang": "Ruby", "bug_code_uid": "870954eb43292e97b44e561bd753281d", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "5c7a5337038148aeb9112fbe1fa9b9d4", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6639676113360324, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "nk = gets.chomp.split.map(&:to_i)\nn = nk[0]\nk = nk[1]\n\nif n%k == 0\n\tprint \"YES\"\nelse\n\tif (n/k)%2 == 0\n\t\tprint \"NO\"\n\telse\n\t\tprint \"YES\"\n\tend\nend", "lang": "Ruby", "bug_code_uid": "5ef446e4dd27534e73f26733c1431f61", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "de0a52101d0e6374b3c8102a74c7bf37", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8092485549132948, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets\nk = gets\n\ndef kek(n,k)\n (n/k).even? ? 'NO' : 'YES'\nend\nputs kek(n,k)", "lang": "Ruby", "bug_code_uid": "d6ecbbec40ef887955fc3c4f664b1fbd", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "da976d55be7cb719d1bb4776103bb871", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.21951219512195122, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "puts gets", "lang": "Ruby", "bug_code_uid": "8d941d67f4047d2d3c39af6101133ff5", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "6e8f14b82cede25ebd58720d9df807ef", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9222797927461139, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "b = gets.to_i\n\n#example 1\n# b = 1\n#assert 1\n#example 2\n# b = 2\n#assert 2\nrequire 'prime'\n\nfast_divisors = b.prime_division.map{ |e| e.last + 1 }.inject(:*)\n\nputs fast_divisors\n", "lang": "Ruby", "bug_code_uid": "e96fdc7f7f59180f93572bf65fa14f7a", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "7eb86a43adff5fc2dc6c1821c6cbaff8", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9933333333333333, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nn,k=gets.split.map(&:to_i)\ns=gets\na,b=['G','T'].map{|e|s.index(e)}.sort\nputs (b-a)%k==0 && a.step(b,k).all?{|i|a[i]!='#'} ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "eb60ccfb1fe6d2dfafd22d6e371a6357", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "db9c061e862c7d980055ca5c3033719c", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5654450261780105, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "input_word = gets.chomp\ninitial = input_word.split(\"\")\n\nif input_word == input_word.upcase\n p input_word.downcase\nelsif input_word[1,input_word.length-1]==input_word.upcase[1,input_word.length-1] && initial == input_word.at(0) ==initial\n p input_word.capitalize\nend\n", "lang": "Ruby", "bug_code_uid": "a7cbc37fad9a8733737aa8f54f6352c9", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "753917d9e838b580888f1416b6cfde3b", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.926829268292683, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "input_word = gets.chomp\ninitial = input_word.split(\"\")\nif input_word[1,input_word.length-1] == input_word.upcase[1,input_word.length-1]\n if input_word.at(0) == input_word.downcase.at(0)\n print (input_word.capitalize+\"\\n\")\n else\n print(input_word.downcase+\"\\n\")\n end\nelse\n print(input_word+\"\\n\")\nend\n", "lang": "Ruby", "bug_code_uid": "aa91f7eeaa0053220a1ed84e8090fc14", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "753917d9e838b580888f1416b6cfde3b", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5240174672489083, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "a = gets.chomp\nb = \"a\"..\"z\"\nc = b.to_a\nd = c.join(\" \")\n\nif d.include([0])\nputs a.capitalize\n\nelse\nputs a\nend", "lang": "Ruby", "bug_code_uid": "96302509d632373a9303ee73b4954941", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "12110d6014371551ab4229c5a2443906", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9872340425531915, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#=================================\n# Better be sure than sorry. \n#=================================\n$stdin=File.open(\"./input.txt\",\"r\") if ENV[\"LOGNAME\"]==\"skydos\"\n#=================================\n\nh, m=gets.split(':').map(&:to_i)\n\nh-=12\n\nmins_angl = m * 6.0\nhour_angl = h * (360.0/12.0) + m * (360.0/12.0/60.0)\n\nputs \"#{hour_angl} #{mins_angl}\"\n", "lang": "Ruby", "bug_code_uid": "16382332273e3266250394c76c9c47b6", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "c6bd09c0c4df8f5fe6851efe9d4c595d", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9505703422053232, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\na = gets.split('').map(&:to_i)\n(a.length-1).times{|i|\n if (i!=0 && a[i]>4)\n print 9-a[i]\n else\n print a[i]\n end\n}", "lang": "Ruby", "bug_code_uid": "43155194959b8e60ccca12d1957ebe03", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "3feec6378d171c10ea70a79807388dd6", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7822878228782287, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "def lights_out(a,b,c)\n\tinput = [a,b,c]\n\tgrid = [[1,1,1],[1,1,1],[1,1,1]]\n\tinput.each_with_index do |inp, ind|\n\t\tinp.each_with_index do |element,index|\n\t\t\telement.times do |i|\n\t\t\t\tgrid[ind][index] = toggle(grid[ind][index])\n\t\t\t\tgrid[ind][index-1] = toggle(grid[ind][index-1]) unless index <= 0 #izquierda\n\t\t\t\tgrid[ind][index+1] = toggle(grid[ind][index+1]) unless index >= grid[0].size-1 #derecha\n\t\t\t\tgrid[ind+1][index] = toggle(grid[ind+1][index]) unless ind+1 > grid.size-1 # el de abajo\n\t\t\t\tgrid[ind-1][index] = toggle(grid[ind=1][index]) unless ind-1 <= 0 #el de arriba\n\t\t\tend\n\t\tend\n\tend\n\tputs grid[0].join('')\n\tputs grid[1].join('')\n\tputs grid[2].join('')\nend\n\ndef toggle(number)\n\tnumber = 1 - number # MATH! PROBLEM?\nend\n\na = gets.chomp.split(' ').map { |str| str.to_i }\nb = gets.chomp.split(' ').map { |str| str.to_i }\nc = gets.chomp.split(' ').map { |str| str.to_i }\n\nlights_out(a,b,c)", "lang": "Ruby", "bug_code_uid": "2db378e597b91a01da96e749a01f878f", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "0815bc4b55fe4a4970c70d47e1da06d3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.781414994720169, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "def lights_out(a,b,c)\n\tinput = [a,b,c]\n\tgrid = [[1,1,1],[1,1,1],[1,1,1]]\n\tinput.each_with_index do |inp, ind|\n\t\tinp.each_with_index do |element,index|\n\t\t\telement.times do |i|\n\t\t\t\tgrid[ind][index] = toggle(grid[ind][index])\n\t\t\t\tgrid[ind][index-1] = toggle(grid[ind][index-1]) unless index < 0 #izquierda\n\t\t\t\tgrid[ind][index+1] = toggle(grid[ind][index+1]) unless index > grid[0].size-1 #derecha\n\t\t\t\tgrid[ind+1][index] = toggle(grid[ind+1][index]) unless ind+1 > grid.size-1 # el de abajo\n\t\t\t\tgrid[ind-1][index] = toggle(grid[ind=1][index]) unless ind-1 < 0 #el de arriba\n\t\t\tend\n\t\tend\n\tend\n\tputs grid[0].join('')\n\tputs grid[1].join('')\n\tputs grid[2].join('')\nend\n\ndef toggle(number)\n\tnumber = 1 - number # MATH! PROBLEM?\nend\n\na = gets.chomp.split(' ').map { |str| str.to_i }\nb = gets.chomp.split(' ').map { |str| str.to_i }\nc = gets.chomp.split(' ').map { |str| str.to_i }\n\nlights_out(a,b,c)", "lang": "Ruby", "bug_code_uid": "3fce0f6430ae78e781fbf0daec6c4571", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "0815bc4b55fe4a4970c70d47e1da06d3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.975975975975976, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = $stdin.read.map(&:to_i)\ndst = Array.new(9, 1)\n[[1, 3], [0, 2, 4], [1, 5], [0, 4, 6], [1, 3, 5, 7], [2, 4, 8], [3, 7], [4, 6, 8], [5, 7]].each.with_index {|is, i|\n dst[i] += a[i]\n is.each {|n|\n dst[n] += a[i]\n }\n}\n\nputs dst.each_slice(3).to_a.map{|n|\n n.map {|x|\n (x & 1).zero? ? 0 : 1\n }.join(\" \")\n}.join(\"\\n\")\n", "lang": "Ruby", "bug_code_uid": "dec15c2c384c73fc94f5dd7aa7d88968", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "58cce03088b1a6c5bbd0b1d35827048f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9985315712187959, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = $stdin.read.split(/[ \\n]/).map(&:to_i)\ndst = Array.new(9, 1)\n[[1, 3], [0, 2, 4], [1, 5], [0, 4, 6], [1, 3, 5, 7], [2, 4, 8], [3, 7], [4, 6, 8], [5, 7]].each.with_index {|is, i|\n dst[i] += a[i]\n is.each {|n|\n dst[n] += a[i]\n }\n}\n\nputs dst.each_slice(3).to_a.map{|n|\n n.map {|x|\n (x & 1).zero? ? 0 : 1\n }.join(\" \")\n}.join(\"\\n\")\n", "lang": "Ruby", "bug_code_uid": "9a683f1425bbad006b0296e513d075a7", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "58cce03088b1a6c5bbd0b1d35827048f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9858429858429858, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i \na = gets.split.map{|x| x = x.to_i}\na.uniq! \nif(a.length <= 3) \n\tif(a.length == 3)\n\t\tif((a[1]-a[0]).abs == (a[1]-a[2]).abs) \n\t\t\tprint((a[1]-a[0]).abs)\n\t\telse \n\t\t\tprint(-1)\n\t\tend\n\telsif (a.length == 2)\n\t\t#for fucking minimum \n\t\tif((a[1]-a[0]).abs % 2 == 0) \n\t\t\tprint((a[1]-a[0]).abs / 2)\n\t\telse\n\t\t\tprint((a[1]-a[0]).abs)\n\t\tend\n\telse \n\t\tprint(0)\n\tend\nelse \n\tprint(-1)\nend", "lang": "Ruby", "bug_code_uid": "2dd9f60d044f46350b00cf7fc834344c", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "262b6c7ff6015021cfe9598ecba99580", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9847522236340533, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def get_sumator(arr)\n return -1 if arr.length > 3\n case arr.length\n when 1\n return 0\n when 2\n max = arr.max\n min = arr.min\n if (max - min) % 2 == 0\n return (max - min) / 2\n else\n return (max - min)\n end\n when 3\n max = arr[-1]\n min = arr[0]\n # if the average of max and min is the same as\n # the middle one it can be done\n if (max + min) / 2 == arr[1]\n return (max - min)/ 2\n else\n return -1\n end\n else\n return -1\n end\nend\n\nn = gets.chomp.to_i\nnums = gets.chomp.split(\" \").map(&:to_i)\nunique_arr = []\nnums.each do |num|\n unique_arr.push(num) if !unique_arr.include?(num)\nend\n\nputs get_sumator(unique_arr.sort)\n", "lang": "Ruby", "bug_code_uid": "c4adf811ada7e765dcceb487687c3e78", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "36fc68b5a2ecd64595c94af8edc1686b", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9537037037037037, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=gets.chomp.split(\" \")\nsum=0\na.each {|i| sum+=i.to_i}\nif sum%5==0\nputs \"#{sum/5}\"\nelse \nputs \"-1\"\nend\n", "lang": "Ruby", "bug_code_uid": "a58fb62a4dc915446911e1eff687de38", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "b966a91a7e2bf32689f622d78e08ef91", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9504950495049505, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s=0\ngets.split.map{|i|s+=i.to_i}\np s%5==0?s/5:-1", "lang": "Ruby", "bug_code_uid": "4e923f39f8c6a06182165148fb4c1c0a", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "995e50aa5a264bce365de433128e0ae5", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.759581881533101, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "line=gets.chomp.strip.split(' ').map{|x| x.to_i}\nsum=line.inject(&:+)\nputs sum%line.size==0? sum/line.size : -1", "lang": "Ruby", "bug_code_uid": "94be1eb34bf129649ae9caf75aa4dd93", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "e24b82d9d59c117d1e3ef753d8b73fdb", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9477911646586346, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = gets.split\nsum = 0\ninput.each { |num| sum += num.to_i }\nif sum % 5 == 0\n puts sum / 5\nelse\n puts -1\nend\n", "lang": "Ruby", "bug_code_uid": "5a0f31fefd98db56944ab91e6f043a4b", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "17c51e0680be77931fb66d8579ad54c6", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9841897233201581, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "min = gets().chomp!.split(\" \").max {|a, b| a.to_i <=> b.to_i}.to_i - 1\ncase min \n when 0 then puts( \"1/1\" )\n when 1 then puts( \"1/6\" )\n when 2 then puts( \"1/3\" )\n when 3 then puts( \"1/2\" )\n when 4 then puts( \"2/3\" )\n when 5 then puts( \"5/6\" )\nend\n", "lang": "Ruby", "bug_code_uid": "d6966f7b331062f2acb209fa5daa000e", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "b125568ce3c7fb613ecb852ae17cf7e4", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8666666666666667, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = 6 - gets.split.map(&:to_i).max + 1\ncase s\n when 1\n puts '0/1'\n when 2, 3\n puts \"#{1}/#{6 / s}\"\n when 4\n puts '2/3'\n when 5\n puts '5/6'\n when 6\n puts '1/1'\nend\n", "lang": "Ruby", "bug_code_uid": "2cc60f137532522154a5a1e5a2864064", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "46bcc60bb262fc4a80e56ff4f97ab127", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.07086614173228346, "equal_cnt": 24, "replace_cnt": 16, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 25, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n\n#define INIT(range, val) memset(range, val, sizeof(range))\n#define inject(x) { cerr << \"Fuction: \" << __FUNCTION__ << \", Line: \" << __LINE__ << \", \" << #x << \": \" << (x) << endl; }\n#define mp make_pair\n#define pb push_back\n\ninline void __CIN__() { ios::sync_with_stdio(false); cin.tie(0); }\n\ntypedef long long ll;\ntypedef unsigned long long ull;\ntypedef pair pii;\n\nchar buf;\ninline int xint() { while (buf = getchar(), buf < '0' || buf > '9'); int x = buf - '0'; for (; buf = getchar(), buf >= '0' && buf <= '9'; x = x * 10 + buf - '0'); return x; }\ninline ll xll() { while (buf = getchar(), buf < '0' || buf > '9'); ll x = buf - '0'; for (; buf = getchar(), buf >= '0' && buf <= '9'; x = x * 10 + buf - '0'); return x; }\ninline string xstring() { while (buf = getchar(), buf == ' ' || buf == '\\n'); string x = \"\"; for (x += buf; buf = getchar(), buf != ' ' && buf != '\\n'; x += buf); return x; }\n\nint main() {\n\treturn 0;\n}", "lang": "Ruby", "bug_code_uid": "827295a507b768dc92a56ed3d501a640", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "c8c37fe332c794544fc8d858f824ad04", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7851851851851852, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "a, b = gets.split.map &:to_i\ntotal = a\nwhile a != 1\n total += a % b == 0 ? a / b : a / b + 1\n a /= b\nend\nputs total\n", "lang": "Ruby", "bug_code_uid": "fb2466398269a32a33a41ac252712650", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "a9acd7db044f2d44425930fb2193f6e0", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8543689320388349, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# cook your code here\nn = gets.chomp \n\nn = n.gsub(/[98765]/,'9'=>'0','8'=>'1','7'=>'2','6'=>'3','5'=>'4') \n\ni = 0 ;\n\nif n[0] == '0' \n n[0] == '9' \nend \n\nputs n ", "lang": "Ruby", "bug_code_uid": "9d7c0a5327c009d78749efabc36c9688", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "74a25fe99a21cc744943c3674ba4aab3", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.88, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "a=gets.chomp.bytes{|e|57-e}\na[0]=9 if a[0]==0\nputs a*''", "lang": "Ruby", "bug_code_uid": "dc204e763c238bbc96e141f1dd72d799", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "a0d6be27e4bd0f510a0a8ac48eab08d3", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6731707317073171, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "# http://codeforces.com/contest/514/problem/A\n\ndigits = gets.chomp.chars.map(&:to_i)\ndigits.map! { |n| (9 - n) < n ? 9 - n : n }\n\nputs digits.join.to_i\n", "lang": "Ruby", "bug_code_uid": "a40643d0c1f43183af4b42b68061caa3", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "76c54fe2f0fd20193c0bf02a9fecf5cf", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5608108108108109, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "s = gets.to_i\nh, m = gets.split.map(&:to_i)\nres = []\nmin = [7,17,27,37,47,57]\nm += 60 if m<7\nmin.each do |i|\n res<<(m-i)/s if (m>i && (m-i)%s==0)\nend\np res.min", "lang": "Ruby", "bug_code_uid": "d950793299691c53c6f08bf9c90660b4", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "3f397d37840a98a3abe824471fb246bd", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.989010989010989, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = gets.to_i\nh, m = gets.split.map(&:to_i)\nres = 0\nti = h*60+m\nuntil /7/.match?(\"#{ti / 60 % 24}#{ti % 60}\")\n ti-=x\n res+=1\nend\np res\n", "lang": "Ruby", "bug_code_uid": "a126c7401ee86118e7953603f2893afb", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "3f397d37840a98a3abe824471fb246bd", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7512437810945274, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "x = gets.to_i\nh, m = gets.split().map(&:to_i)\n\nans = 0\nwhile true\n\tif h.to_s.include? '7' or m.to_s.include? '7'\n\t\tbreak\n\tend\n\tm += x\n\tif m > 60\n\t\th = (h+1)%24\n\t\tm -= 60\n\tend\n\tans += 1\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "b653f48d81698295933b55301136a13b", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "8b1237a53baba38bafcede7f29ffaf62", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6938775510204082, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\n\n p [n/2-1,0].max", "lang": "Ruby", "bug_code_uid": "578960abf387e3770c80a922e54d120a", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "45697f28e325dca6da836105b0f43242", "difficulty": 1000, "tags": ["constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7006369426751592, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "s,t = gets,gets\n\nif t == s.reverse \n puts \"YES\"\nelse \n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "666c7e0750352ab016b5ca27c83a5f38", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "2108d2fd0b5d42714f86923294531302", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6536856745479833, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "number=gets.chomp.split\nn=number[0].to_i\nk=number[1].to_i\n#puts n,k\nzeros=0\nnon_zeros=0\ndigits=0\nwhile n>0\n\tif zeros==k \n\t\tbreak\n\telsif n%10==0\n\t\tzeros+=1\n\telse\n\t\tnon_zeros+=1\n\tend\n\tdigits+=1\n\tn=n/10\nend\n#puts \"zeros=#{zeros}\"\n#puts \"digits=#{digits}\"\nif zeros==k\n\tputs non_zeros\nelsif zeros= n\n puts i\n break\n end\nend\n", "lang": "Ruby", "bug_code_uid": "54e78ea8a32ed874faaeb86112f0acc2", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "0f0964de32a193f65a28d8c614b066b6", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7027444916892153, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def answer(num)\n ret = []\n counts = Hash.new(0)\n num.each_char.with_index do |c, index|\n i = c.to_i\n case i\n when 4,7\n if counts[c] == num.size / 2 && c == '4'\n c = '7'\n end\n if counts[c] < num.size / 2\n ret << c\n counts[c] += 1\n next\n end\n when 0..3\n if counts['4'] == num.size / 2\n ret << '7'\n counts['7'] += 1\n end\n ret << '4' * (num.size / 2 - counts['4'])\n ret << '7' * (num.size / 2 - counts['7'])\n return ret.join\n when 5,6\n if counts['7'] < num.size / 2\n ret << '7'\n counts['7'] += 1\n ret << '4' * (num.size / 2 - counts['4'])\n ret << '7' * (num.size / 2 - counts['7'])\n return ret.join\n end\n when 8,9\n if index == 0\n size = (num.size + 2) / 2\n return ('4' * size) + ('7' * size)\n end\n end\n if n = ret.slice(0...index).rindex('4')\n ret[n] = '7'\n ret << '4'\n counts['4'] += 1\n else\n size = (num.size + 2) / 2\n return ('4' * size) + ('7' * size)\n end\n end\n ret.join\nend\n\nnum = gets.strip\nif num.size % 2 == 1\n size = (num.size + 1) / 2\n puts '4' * size + '7' * size\nelse\n puts answer num\nend\n", "lang": "Ruby", "bug_code_uid": "e9ba393706e64cb8a74495924a8e24b2", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "3a63c80cda436c7a693d3e306aaca25b", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.988929889298893, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def answer(num)\n ret = []\n counts = Hash.new(0)\n num.each_char.with_index do |c, index|\n i = c.to_i\n case i\n when 4,7\n if counts[c] == num.size / 2 && c == '4'\n c = '7'\n end\n if counts[c] < num.size / 2\n ret << c\n counts[c] += 1\n next\n end\n when 0..3\n if counts['4'] == num.size / 2\n ret << '7'\n counts['7'] += 1\n end\n ret << '4' * (num.size / 2 - counts['4'])\n ret << '7' * (num.size / 2 - counts['7'])\n return ret.join\n when 5,6\n if counts['7'] < num.size / 2\n ret << '7'\n counts['7'] += 1\n ret << '4' * (num.size / 2 - counts['4'])\n ret << '7' * (num.size / 2 - counts['7'])\n return ret.join\n end\n when 8,9\n if index == 0\n size = (num.size + 2) / 2\n return ('4' * size) + ('7' * size)\n end\n end\n while n = ret.pop\n counts[n] -= 1\n if n == '4'\n ret << '7'\n counts['7'] += 1\n ret << '4' * (num.size / 2 - counts['4'])\n ret << '7' * (num.size / 2 - counts['7'])\n return ret.join\n end\n end\n size = (num.size + 2) / 2\n return ('4' * size) + ('7' * size)\n end\n ret.join\nend\n\nnum = gets.strip\nif num.size % 2 == 1\n size = (num.size + 1) / 2\n puts '4' * size + '7' * size\nelse\n puts answer num\nend\n", "lang": "Ruby", "bug_code_uid": "717ef141ff17561b2e9be1d73a577d0f", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "3a63c80cda436c7a693d3e306aaca25b", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7759562841530054, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a,b,c = gets.split.map(&:to_i)\nputs [a*b*c, a+b+c, (a+b)*c, a+b*c, a*(b+c), a*b+c].max", "lang": "Ruby", "bug_code_uid": "9e6cf7009fa7988769be0326720ea65e", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "29c9e56d73b5bc079d48868a011f843b", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9622641509433962, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "(a,b,c) = gets.chomp.to_i,gets.chomp.to_i,gets.chomp.to_i\nputs [a+b*c , (a+b)*c , a*(b+c) , a*b*c].max", "lang": "Ruby", "bug_code_uid": "e275f54f87e6f9b8e62e921fcfe75012", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "5c7044791b23e114382a22b072c43e6a", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9117647058823529, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a = gets.to_i\nb = gets.to_i\nc = gets.to_i\nbest = [a+[b+c,b*c].max,a*b*c,(a+b)+c].max\nputs best", "lang": "Ruby", "bug_code_uid": "f87c9be8aaf9671f1a8285e7578b7d85", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "d7dfa5c4341bda5b393896dec3742249", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9979035639412998, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def solve\n a,b=read_ints;\n b.times do\n if(a%10!=0)\n a-=1\n else\n a=a/10\n end\n end\n puts a\nend\n\ndef read_int\n gets.split(\" \");\nend\n\ndef read_ints\n gets.split.map(&:to_i);\nend\n100000000.times do \nend\nsolve", "lang": "Ruby", "bug_code_uid": "2067ef6be066bcfdbbd89fde53178e16", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "0356256a09a62afb080c1e53dbe0ae7d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.72, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "puts \"enter n\"\nn=gets.chomp().to_i\nputs \"enter k\"\nk=gets.chomp().to_i\ni=1\nwhile i<=k \n\n if n%10==0\n n=n/10\n else\n n=n-1\n end\n i=i+1\nend\nputs(n)", "lang": "Ruby", "bug_code_uid": "a3cff282e5465adaa0e36a1590611bb2", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "b05cd0b5af29f71735401bc08dc38d7c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.920863309352518, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = gets\nn, k = input.split(\" \")\nk.times do\n if n % 10 == 0\n n = n / 10\n else\n n -= 1\n end\nend\nputs n", "lang": "Ruby", "bug_code_uid": "28025c3d70db4b0f8ea6e267c91036d9", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "dd689d54cf4a031ff7a20a673d2d8e69", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8373702422145328, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "$a = gets.chomp\n$a = $a.to_i\n$b = gets.chomp\n$b = $b.to_i\n\n(0...$b).each do |i|\n\tif $a%10 == 0\n\t\t$a = $a/10\n\telse\n\t\t$a -= 1\n\tend\nend\nprint $a;", "lang": "Ruby", "bug_code_uid": "a8eca37b7c07638444a933ae8b2532f4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "566e52c5b13202b2c7892046c0e67082", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.972, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def subtract(n, k)\n result = 0\n (1..k).each do |number|\n if n % 10 != 0\n n -= 1\n else\n n /= 10 if n % 10 == 0\n end\n result = n\n end\n puts result\nend\n\na = gets\nn = a.split(' ').first\nk = a.split(' ').last\nsubtract(n, k)\n", "lang": "Ruby", "bug_code_uid": "b7b91e8cfde0203a13534e5550f03d11", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "f42ef04ec879bbc5083c88966dadb0cd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9959183673469387, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "c=gets.chomp.split(\" \").map {|i| i.to_i}\nn=c[0]\na=c[1]\nb=c[2]\nans=0\nif b==0\nputs \"#{a}\"\nelsif b>0\nans=((b%n)+a)%n\nif ans==0 \nputs \"#{n}\"\nelse \nputs \"#{ans}\"\nend\nelsif b<0\nans=(6-(b.abs%n)+a)%n\n\nif ans==0 \nputs \"#{n}\"\nelse \nputs \"#{ans}\"\nend\nend\n", "lang": "Ruby", "bug_code_uid": "4d23d1493d017f1845c884b5193950d4", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "88774956a948619e77e401ecd0f9126f", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9955555555555555, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,a,b=gets.chomp.split(\" \").map(&:to_i)\nc=a+b-1\nif c>n\n c=c%n\nelsif c<0\n while c<0\n c+=n\n end\nend\nputs c+1", "lang": "Ruby", "bug_code_uid": "4291a352e85475217ab88207393a473b", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "0b7b03d9a9834129346e758895ea0094", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6451612903225806, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n, a, b = gets.split(\" \").map(&:to_i)\nputs (b % n + a) % n\n", "lang": "Ruby", "bug_code_uid": "53a8a445bd21345d3ae0b24348404c4b", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "63f8608c70aa2939240e0200dd8676f5", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8809849521203831, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n, a, b = gets.chomp.split(' ').map { |i| i.to_i }\ntmp = if (a + b) % n == 0\n\tn\nelse\n\t(a + b) % n\nend\n\nputs tmp if b > 0\nputs n - ((a + b).abs % n) if b < 0\nputs a if b == 0\n\n#2 0\n#1 -1\n#6 (0) -2\n#5 -3\n#4 -4\n#3 -5\n#2 -6\n#1 -7\n#6 (0) -8\n\n\n#5 1 3\n\n#1 0\n#2 1\n#3 2\n#4 3\n#5 4\n#1 5\n#2 6\n#3 7\n#4 8\n#5 9", "lang": "Ruby", "bug_code_uid": "80619f623c72d9b9878e49ac0014eec9", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "021654eb610fc33536f432333783a2e6", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9964071856287425, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/ruby\ntxt = gets;\ntxt.gsub!(\">\", \"1000\");\ntxt.gsub!(\"<\", \"1001\"); \ntxt.gsub!(\"+\", \"1010\"); \ntxt.gsub!(\"-\", \"1011\"); \ntxt.gsub!(\".\", \"1100\"); \ntxt.gsub!(\",\", \"1101\"); \ntxt.gsub!(\"[\", \"1110\"); \ntxt.gsub!(\"]\", \"1111\"); \nputs(txt);\nputs(txt.length.to_s);\nnum = 0;\nfor i in 0..txt.length-1\n\tif(txt[i] == \"1\")\n\t\tputs((2**(txt.length-2-i)).to_s);\n\t\tnum += 2**(txt.length-2-i)\n\tend\nend\nputs((num%1000003).to_s);\n\t\n", "lang": "Ruby", "bug_code_uid": "bd0de842975d4892faef7c9c0b2d0cf6", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "318c789f6012d160d6b753038c4ca9e6", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.030959752321981424, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n#define li long long int\n#define rep(i,to) for(li i=0;i<((li)(to));++i)\n#define pb push_back\n#define sz(v) ((li)(v).size())\n#define bit(n) (1ll<<(li)(n))\n#define all(vec) (vec).begin(),(vec).end()\n#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)\n#define MP make_pair\n#define F first\n#define S second\n\nint main(){\n\tfor(li pos=2;pos<120;pos+=2){ cout< [l,b].min\n# x = 0\n# y = 0\n\n# count = 0\n# left_x = d\n# right_x = l - d\n# top_y = d\n# bottom_y = b - d\n\n# while true\n# \twhile x + d <= l\n# \t\tbreak if (x >= left_x && x <= right_x && y >=top_y && y <= bottom_y)\n# \t\tcount += 1\n# \t\tx += d\n# \tend\n# \ty += d\n# \tbreak if y + d > b\n# \tx = 0\n# end\n# puts \"#{count}\"\nputs ans ? \"First\" : \"Second\"", "lang": "Ruby", "bug_code_uid": "08dc523438d613980de711e758ed0ced", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "222687577350a3c129072ab317c7cd4d", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8387096774193549, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "a = gets\nmin=a[2]>a[0]?a[0]:a[2] \nputs a[4]*2>min ? \"Second\":\"First\"", "lang": "Ruby", "bug_code_uid": "75c3b93d2e20cbce2d33d33caed4ffb0", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "71f307634b69c19314f9faa60a08cc27", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7114624505928854, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "p = gets\ns, e, t = p.split.map\na = s.to_i\nb = e.to_i\nr = t.to_i\nr *= 2\nif a >= r && b >= r \nputs \"First\"\nelse\nputs \"Second\"\nend", "lang": "Ruby", "bug_code_uid": "da2bd9c30cdc14750ad9ce3607b7506d", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "70e3ba8d9996093229e947e04a5e3e53", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4342857142857143, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "a=gets.chomp.to_i\nputs \"#{(a*(a+1)*(a+2)*(a+3))/24}\"", "lang": "Ruby", "bug_code_uid": "395fa2f360e508d6c711975cb62ac9be", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "27657f7247890eb5b3a271101f0dbcab", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5669781931464174, "equal_cnt": 22, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 21, "bug_source_code": "n = gets.to_i\nfs = [1,1,1,1,1]\n(n-1).times do\n t = []\n f = 0\n (0..4).each do |i|\n f += fs[i]\n t << f\n end\n fs = t\nend\nputs fs.max", "lang": "Ruby", "bug_code_uid": "19ea9e1c9da9281cfc172e051481e1c5", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "0008c5678174877bfbb7da3d5b5a8c5b", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9824561403508771, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=[0,1,3,6,20,70,252,924,3432,12870,48620]\np a[gets.to_i]", "lang": "Ruby", "bug_code_uid": "c93b78a16008c8a0c7cdca5e9393754e", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "2afabe2765c29a85b856c5833cd848ab", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9867172675521821, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, a, b, c = gets.split.map(&:to_i)\n\ncut = Array.new(n*2+1, 0)\ncut[a] = 1\ncut[b] = 1\ncut[c] = 1\n\nfor i in 1..n\n if cut[i] != 0\n cut[a+i] = [cut[a+i], cut[i]+1].max\n\tcut[b+i] = [cut[b+i], cut[i]+1].max\n\tcut[c+i] = [cut[c+i], cut[i]+1].max\n end\nend\n\nputs cut[n]", "lang": "Ruby", "bug_code_uid": "1350222305d2a1fcf9bbba5a5c22c6f7", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "b440c7b37cacd6e64ab8c4557be4197e", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.99644128113879, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, a, b, c, = gets.chomp.split(/ /).map(&:to_i)\ncuts = [a, b, c]\ndp = Array.new(4000, 0)\ncuts.each do |cut|\n dp[cut] = [dp[cut], 1].max\n ((cut + 1)..n).each do |j|\n if dp[j - cut] > 0\n dp[j] = [dp[j], 1 + dp[j - cut]].max\n end\n end\nend\nputs dp[n]\n", "lang": "Ruby", "bug_code_uid": "ab3fac2cc6c8c41704e477f39b6481f1", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "ed6f72479bc155a34f1fbd970e11d65b", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6652806652806653, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "n, A, B, C = gets.split(' ').map { |x| x.to_i }\nH = Hash.new\nf = ->(n) {\n if n <= 0 then return n end\n if H[n] != nil then return H[n] end\n t = [f[n-A], f[n-B], f[n-C]].max\n if t >= 0 then H[n] = t + 1 else return -1 end \n return H[n]\n}\np f[n]", "lang": "Ruby", "bug_code_uid": "96b48c603213dd59edb5d4102dd20b0c", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "14a7cddd403b47324d1be6f41d23b069", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.23193916349809887, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "n,a,b,c = gets.split(' ').map(&:to_i)\nA = [a,b,c].sort {|x,y| y <=> x}\nH = Hash.new\ndef solve(k)\n if k <= 0 then return k end\n if H[k] != nil then return H[k] end\n t = A.map {|x| solve(k-x)}.select {|x| x >= 0}\n if t.size > 0 then return H[k] = t.max+1 else return -1 end\nend\nputs solve(n)", "lang": "Ruby", "bug_code_uid": "3059ef7cb220b92d92d21c8aececa442", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "14a7cddd403b47324d1be6f41d23b069", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3611111111111111, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "n = ARGV[0].to_i\npieces = ARGV.slice(1, 4).map(&:to_i).sort\n\ndef count2(n, pieces)\n\ti = 0\n\twhile pieces[i] && n != 0 && n >= pieces[i]\n\t\tpiece = pieces[i]\n\t\ti += 1\n\t\treturn 1 if (n - piece == 0)\n\t\tnext if (n - piece < piece)\n\n\t\tc = count(n - piece, pieces)\n\t\tnext if c == 0\n\t\treturn c + 1\n\tend\n\treturn 0\nend\n\np count2 n, pieces", "lang": "Ruby", "bug_code_uid": "dc1a381ab39960623352c4dfe8f9d220", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "50dc33891ebad05e9902cf30cf7bcf03", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4406779661016949, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n, *pieces = gets.chomp.split.map(&:to_i)\n\ndef count2(n, pieces)\n\ti = 0\n\twhile pieces[i] && n != 0 && n >= pieces[i]\n\t\tpiece = pieces[i]\n\t\ti += 1\n\t\treturn 1 if (n - piece == 0)\n\t\tnext if (n - piece < piece)\n\n\t\tc = count2(n - piece, pieces)\n\t\tnext if c == 0\n\t\treturn c + 1\n\tend\n\treturn 0\nend\n\np count2 n, pieces.sort", "lang": "Ruby", "bug_code_uid": "a0b59bcc2a28eda3bc381c51c0091bdd", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "50dc33891ebad05e9902cf30cf7bcf03", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9100062932662052, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "\n# Extract valid 2 element summations\ndef get_valid_pairs(dpa, i)\n pairs = []\n for j in 0..((i/2).floor) do\n if dpa[j] != -1 && dpa[i-j] != -1 \n pairs.push([j, i-j])\n end \n end\n return pairs\nend\n\n# Find the best solution for i\ndef get_result(dpa, i)\n pairs = get_valid_pairs(dpa, i)\n best = -1\n for j in 0..(pairs.length - 1) do\n ans = dpa[pairs[j][0]] + dpa[pairs[j][1]]\n best = ans if ans > best\n end\n return best\nend\n\n# Read Input\nn, a, b, c = gets.strip.split.map{|s| s.to_i}\n\n# Initialize params\ndpa = Array.new(n+1,-1); dpa[0] = 0; dpa[a] = 1; dpa[b] = 1; dpa[c] = 1;\n\n# Iterate over values 0 to n to fill dp array\nfor i in 0..(n) do\n dpa[i] = get_result(dpa, i)\nend\n\n# Return solution\nputs dpa.last\n\n", "lang": "Ruby", "bug_code_uid": "8456df1c49c6fb0365a35de5c5141163", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "758a91dce3353a89fc91d1f91afa373e", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6566037735849056, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 10, "bug_source_code": "n, a, b, c = gets.split.map(&:to_i)\nmax = 1\narr = [a, b, c].sort.uniq\nif n % arr[0] == 0\n p n/arr[0]\nelse\n arr[2] ||= 0\n i = n/arr[2]\n j = n/arr[1]\n (0..i).each do |i|\n (0..j).each do |j|\n temp = n - i*arr[2] - j*arr[1]\n next if temp < 0\n if temp % arr[0] == 0\n max = (i + j + temp/arr[0]) if (i + j + temp/arr[0]) > max\n else\n next\n end\n end\n end\n p max\nend\n", "lang": "Ruby", "bug_code_uid": "53d0103903e05515c227916c2072262d", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "c820320bcf2207ed4d98c0a21d79edb5", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9714285714285714, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nt = 1\nwhile n%t==0\n t *= 3\nend\nans = n/t+n%t\nputs ans\n", "lang": "Ruby", "bug_code_uid": "e39665894c2c9ab29a70782b164c5e00", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "36dc0eabae72f048a32ae243c94ef0d0", "difficulty": 1600, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5112781954887218, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "red, green, blue = gets.split.map(&:to_i)\n\nanswer = (red + green + blue) / 3\n\nputs answer\n", "lang": "Ruby", "bug_code_uid": "ff8f8e62ca2485f579cc56d350c5eb81", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "dd9c1462ceb39ad37be360c586c807a4", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9906015037593985, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "PLAYERS = %w[F M S]\nRANKS = %w[rock paper scissors]\n\ndef winner?(g1, g2)\n r1 = RANKS.rindex(g1)\n r2 = RANKS.rindex(g2)\n return true if r1 == 0 and r2 == 2\n return false if r1 == 2 and r2 == 0\n return true if r1 > r2\n false\nend\n\ngestures = []\n3.times { gestures << STDIN.gets.chomp }\nwinners = []\n\ngestures.each_index do |i|\n gestures.each_index do |j|\n g1, g2 = gestures[i], gestures[j]\n next if g1 == g2\n winners << PLAYERS[i] if winner?(g1, g2)\n end\nend\n\np winners\nputs (winners.uniq.count == 1) ? winners[0] : \"?\"", "lang": "Ruby", "bug_code_uid": "78a41e2b20b32ab9908a4111f8a7c1f4", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "f93cdbc45a663ce14cb77107b2faa731", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9026217228464419, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "mappings = {\"paper\" => 0, \"scissors\" => 1, \"rock\" => 2}\nnames = [\"F\", \"M\", \"S\"]\ng = []\n3.times do\n g << mappings[gets.strip]\nend\nsum = eval g.join('+')\nputs case sum\n when 0, 2, 3, 5, 6\n \"?\"\n when 1\n names[g.index(1)]\n when 4\n names[g.index(0)]\nend", "lang": "Ruby", "bug_code_uid": "4f5fffa463318dda1720fd852d0e0ae1", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "504da60f456d584899695ccda713677e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9583333333333334, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "def rps a, b, c\n\th = {:rock => :scissor, :scissor => :paper, :paper => :rock}\n\treturn 1 if h[a] == b && h[a] == c\n\treturn 2 if h[b] == a && h[b] == c\n\treturn 3 if h[c] == a && h[c] == b\n\treturn 0\nend\n\na, b, c = STDIN.read.split(\"\\n\").map(&:to_sym)\np = %w{? F M S}\n\nprint p[rps(a, b, c)]", "lang": "Ruby", "bug_code_uid": "dc41100d97339c60baaf7d541231e997", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "8eefeb973d2ae3d43d8bb12b868b122f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9175141242937853, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a, b, c = gets.split.map(&:to_i)\n\nweek = [a / 3, b / 2, c / 2].min\n\nla = a - 3 * week\nlb = b - 2 * week\nlc = c - 2 * week\n\nlist = %w(a a b c a c b) * 2\nmax_remain = 0\n\n(1..6).each do |d|\n ((7 - d)..7).each do |s|\n counter = Hash.new(0)\n\n (s...(s + d)).each do |t|\n counter[list[t]] += 1\n end\n\n if counter['a'] <= la && counter['b'] <= lb && counter['c'] <= lc\n max_remain = d\n end\n end\nend\n\nputs 7 * week + max_remain\n", "lang": "Ruby", "bug_code_uid": "2a660deeee4bb2aaafa853399a1bb720", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "5f04f15e61d2aaba406c77ade7364f63", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8770491803278688, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n,d=gets.split.map(&:to_i)\na=gets.split.map(&:to_i)\nm=gets.to_i\nres=0\na.each{|v| res+=v }\nputs res-d*[0,m-n].max\n", "lang": "Ruby", "bug_code_uid": "eb92e36ba4f5edd40c602bcd6db5a2cd", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "2731896d4cda582564ebb981be3ec905", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.968503937007874, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,d=gets.split.map(&:to_i)\na=gets.split.map(&:to_i).sort\nm=gets.to_i\nres=0\nm.times {|i| res+=a[i] }\nputs res-d*[0,m-n].max\n", "lang": "Ruby", "bug_code_uid": "157f7bf5758511816d387cb1e6f96a14", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "2731896d4cda582564ebb981be3ec905", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9832402234636871, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def s(x)\n res = 0\n until x == 0\n res += x%10\n x /= 10\n end\n return res\nend\n\nn = gets.to_i\nx = Math.sqrt(n)\nnotfound = true\nfor i in [x-1000000, 0].max..x\n if i**2 + s(i)*i - n == 0\n print i\n notfound = false\n break\n end\nend\n\nprint -1 if notfound", "lang": "Ruby", "bug_code_uid": "82d1f1b7591f6e92292e38ac30cd3205", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "c20ef7a3cefa6094475d7c1872b43abb", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.998158379373849, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def s(x)\n res = 0\n until x == 0\n res += x%10\n x /= 10\n end\n return res\nend\n\nn = gets.to_i\nx = Math.sqrt(n).floor\nnotfound = true\nfor i in [x-1000000, 1].max..x\n if i**2 + s(i)*i - n == 0\n print i\n notfound = false\n break\n end\nend\n\nprint -1 if notfound", "lang": "Ruby", "bug_code_uid": "49a0f53658648ab3edce31661ccd1f01", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "c20ef7a3cefa6094475d7c1872b43abb", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8899521531100478, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/ruby2.0\n\nn = STDIN.readline.to_i\n\ncandidates = []\n\n(1..162).each do |c|\n\tlow, high = 1, n\n\twhile high-low > 1e-6\n\t\tmid = (low+high)/2.0\n\t\tif n/mid - mid > c\n\t\t\tlow = mid\n\t\telse\n\t\t\thigh = mid\n\t\tend\n\tend\n\tx = mid.round\n\tt = x\n\ttotal = 0\n\twhile t != 0\n\t\ttotal += t%10\n\t\tt /= 10\n\tend\n\tif total == c\n\t\tcandidates.push(x)\n\tend\nend\n\nif candidates.length == 0\n\tputs -1\nelse\n\tputs candidates.sort[0]\nend\n", "lang": "Ruby", "bug_code_uid": "0f6534bb5bde7390595f4d699109c837", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "179d1900c3dd1f7342cea26fccb69739", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9540412044374009, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def s(x)\n\tret=0\n\twhile x>0\n\t\tret+=x%10\n\t\tx/=10\n\tend\n\tret\nend\n\ndef is_int?(_x)\n\tx=_x.round\n\t(x-1e-9<_x)&&(_x 28\n\t\t\tans -= 4 if x > 30\n\t\t\tputs ans\n\t\tend\n\tend\nend\nSolver.new.main\n", "lang": "Ruby", "bug_code_uid": "262a7b3b2e090d26d85beeead816012a", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "22f27a45d94ca16368f813a19353a437", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5971914264597191, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "#! /usr/bin/ruby\n\nn = gets.to_i\ncards = gets.split(\" \")\n\ndef card_compare( a, b )\n if a[0] == b[0] or a[1] == b[1]\n return true\n end\n return false\nend\n\ndef f( a )\n if a.length == 1\n return true\n end\n ###------------------------------------\n if card_compare( a[0], a[1] )\n b = a\n b[1] = b[0]\n b.shift\n if f( b )\n return true \n end\n end\n ###------------------------------------\n if a.length >= 3\n if card_compare( a[0], a[3] )\n b = a\n b[3] = b[0]\n b.shift\n if f( b )\n\treturn true\n end\n end\n end\n return false\nend\n\nif f( cards.reverse! )\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "5c6462af02d5c4d7938d419c07a71b5b", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "b9f8d067eeeb956cb8c42c4476362115", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9346210995542348, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#! /usr/bin/ruby\n\n$n = gets.to_i\n$cards = gets.split(\" \")\n\ndef card_compare( a, b )\n a[0] == b[0] or a[1] == b[1]\nend\n\ndef ff( a, i )\n a[i] = a[0]\n a.shift\n return a\nend\n\ndef f( a )\n if a.length == 1\n return true\n #####################\n if card_compare( a[0], a[1] ) \n b = a.clone\n b = ff( b, 1 )\n if f( b )\n return true\n end\n end\n #####################\n if a.length > 3 \n if card_compare( a[0], a[3] )\n b = a.clone \n b = ff( b, 3 )\n if f( b )\n\treturn true\n end\n end\n end\n #####################\n return false\nend\n\nif f( $cards.reverse! )\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "e8762e7eee20a940ba593c1893369d5e", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "b9f8d067eeeb956cb8c42c4476362115", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9423076923076923, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#! /usr/bin/ruby\n\n$n = gets.to_i\n$cards = gets.split(\" \")\n\ndef card_compare( a, b )\n a[0] == b[0] or a[1] == b[1]\nend\n\ndef ff( a, i )\n a[i] = a[0]\n a.shift\n return a\nend\n\ndef f( a )\n if a.length == 1\n return true\n end\n #####################\n if card_compare( a[0], a[1] ) \n b = a.clone\n b = ff( b, 1 )\n if f( b )\n return true\n end\n end\n #####################\n if a.length > 3 \n if card_compare( a[0], a[3] )\n b = a.clone \n b = ff( b, 3 )\n if f( b )\n\treturn true\n end\n end\n end\n #####################\n return false\nend\n\nif f( $cards.reverse! )\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "e7f5bbde55757b78bebe0ed1f67c8eb8", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "b9f8d067eeeb956cb8c42c4476362115", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.12253829321663019, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#f = File.open(\"b.in\")\n@n = gets.to_i\n@a = gets.split\n\ndef doit(b, k, c) \n return true if c == 1\n return false if c == 0\n r = false\n\n (k - 1).downto(0) { |i| \n if b[k][0] == b[i][0] or b[k][1] == b[i][1]\n d = b.dup\n d[i] = d[k]\n r = r | doit(d, k - 1, c - 1)\n end\n }\n\n return r\nend\n\nr = doit(@a, @n - 1, @n)\nputs \"YES\" if r\nputs \"NO\" if not r\n", "lang": "Ruby", "bug_code_uid": "fe9b3286eac2b423429646f23decbea4", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "4aaa1d68af4265f343c466f87e1ecb45", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9987293519695044, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "vp,vd,t,f,c=gets.to_i,gets.to_i,gets.to_i,gets.to_i,gets.to_i\nif vp>vd then\n puts 0\n exit\nend\ntime=Rational(t,1)\nfor ans in 0..100000\n #t*vp+time*vp=(vd-vp)*t\n #t*(vp-vd)=-vp*time\n tmp=Rational(-vp*time,vp-vd)\n #p [tmp,vp,vd]\n if tmp+time>=Rational(c,vp) then\n puts ans\n exit\n end\n time+=tmp*2+f\nend\n", "lang": "Ruby", "bug_code_uid": "d47469dae06e93860fb2b4a79ca5db0f", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "885db9034601ae715edd95f2572a0e33", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9846938775510204, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "u, v, t, f, c = 5.times.map{gets.to_f}\nd, ans = u * t, 0\n\n\nif v > u\n loop do\n d += d / (v - u) * u\n break if d >= c\n d += (d / v + f) * u\n k += 1\n end\nend\np ans", "lang": "Ruby", "bug_code_uid": "487bb19939fd9f582c92a71e73ce480b", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "fcf07d9ae04ea8e421a6480d1089b59a", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.09799554565701558, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "def escape\n vp = STDIN.gets.to_i\n vd = STDIN.gets.to_i\n t = STDIN.gets.to_i\n f = STDIN.gets.to_i\n c = STDIN.gets.to_i\n\n arr = { 0 => [0,0], 1 => [vp,0] }\n ind = 1\n while arr[ind][0] < c\n ind += 1\n arr[ind] = [arr[ind-1][0] + vp,0]\n end\n\n b = i = 0\n while i < arr.size\n if i > t\n arr[i][1] += arr[i-1][1] + vd\n end\n\n if arr[i][0] == arr[i][1] and arr[i][0] != 0\n b += 1\n while i < arr.size-1 and arr[i][1] > 0\n i += 1\n arr[i][1] = [arr[i-1][1] - vd, 0].max\n end\n f.times do\n i += 1\n break if i >= arr.size\n arr[i][1] = 0\n end\n end\n\n i += 1\n end\n puts b\nend\n\nescape", "lang": "Ruby", "bug_code_uid": "2cf093a3ed2f833767de0e89755401a0", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "377b3f3701d7b0f6586745ef78640966", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8501440922190202, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "vp = gets.to_i\nvd = gets.to_i\nt = gets.to_i\nf = gets.to_i\nc = gets.to_i\n\nif tp >= td\n dem = 0\nelse\n mile = c/vp\n dem = 0\n T = []\n T[dem] = t*vp/(vd-vp)\n\n while t < mile do\n t += T[dem]\n if t < mile\n t += T[dem] + f\n dem += 1\n T[dem] = t*vp/(vd-vp)\n end\n end\nend\n\nputs dem ", "lang": "Ruby", "bug_code_uid": "cf8605a427af4c07a7a647e4062a101c", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "64c7ca0613ca3c4142ddea95fcf583ed", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.19158200290275762, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "args = gets.split(\" \").map{ |i| i.to_i}\na = args[0]\nb = args[1]\nres = 0\nheap = [0, a]\ncurrent = 1\nfinish = false\nwhile !finish \n for i in current...current * 2\n if (heap[i] > 0)\n left = heap[i] - 1\n right = 2 * heap[i]\n heap[2*i] = left\n heap[2*i+1] = right\n if (left == b || right == b)\n puts Math.log2(i).to_i + 1\n finish = true\n break\n end\n end \n end\n current *= 2 \nend", "lang": "Ruby", "bug_code_uid": "22f2a172488fa89e412e138d341ba56c", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "517743fc7ec104751140ce6e4293ba23", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.1778975741239892, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "args = gets.split(\" \").map{ |i| i.to_i}\na = args[0]\nb = args[1]\nres = 0\nheap = [0, a]\ncurrent = 1\nfinish = false\nwhile !finish \n for i in current...current * 2\n if (heap[i] > 0)\n left = heap[i] - 1\n right = 2 * heap[i]\n heap[2*i] = left\n heap[2*i+1] = right\n if (left == b || right == b) \n puts Math.log2(i).to_i + 1\n finish = true\n break\n end\n else \n heap[2*i] = 0\n heap[2*i+1] = 0\n end \n end\n current *= 2 \nend", "lang": "Ruby", "bug_code_uid": "e99c4830f46e659590bdde2e8e1b8d48", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "517743fc7ec104751140ce6e4293ba23", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8258178603006189, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "class StrangeDevice\n def initialize(n, m)\n @m = m\n @array = [n]\n end\n\n def minimum_times\n t = 0\n until @array.include?(@m)\n operate\n t += 1\n end\n\n t\n end\n\n def self.minimum_times(n, m)\n new(n, m).minimum_times\n end\n\n private\n\n def operate\n @array = [].tap do |out|\n @array.each do |a|\n out << a * 2\n out << a - 1\n end\n end\n end\nend\n\nn, m = gets.chomp.split.map(&:to_i)\nputs StrangeDevice.minimum_times(n, m)\n", "lang": "Ruby", "bug_code_uid": "c8751d25e4a10e1b818e7e04be7bb560", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "303c09c0257d73339c4ef9f19c89aadf", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.976897689768977, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\n# coding: utf-8\n\nn, m = gets.split.map &:to_i\nt = 0\nwhile n < m do\n m = ((m & 1) ? m + 1 : m / 2)\n t += 1\nend \nputs t + (n - m).abs", "lang": "Ruby", "bug_code_uid": "463608f3883930a937bbc8a6f2047589", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "07bed95a1ea7a4acc6bd43875404ee73", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7397959183673469, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "data = gets.chomp.split\n\na = data[0].to_i\nb = data[1].to_i\n\nn=0\n\nif b x\n return false if x % i == 0\n end\n return true\nend\ndef next_prime( x )\n return 2 if x <= 2\n n = x + 1\n while !prime? n\n n += 1\n end\n n\nend\nn, m = gets.strip.split.map(&:to_i)\na = next_prime n\nif a == m\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "39a4cab3f7553f1e2a7d9d1c5f1a0050", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "df9a06911ec1c26e5f05f38a47074b8d", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8746355685131195, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "require 'prime'\n#-------------------\n\nn,m=gets.split.map(&:to_i)\n\nfor i in n+1..m\n\tif i.prime?\n\t\t(i==m) ? (puts \"YES\") : (puts \"NO\")\n\t\tbreak\n\tend\nend\n", "lang": "Ruby", "bug_code_uid": "d5af40b7adae8483a4bbec15d08595e4", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "a0eebe0b6b6b221dfeed63ff29058d91", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9910714285714286, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s=[2,3,5,7,11,13,17,19,23,39,31,37,41,43,47]\nn,m=gets.split.map &:to_i \nputs s[s.index(n).to_i+1]==m ?\"YES\":\"NO\"", "lang": "Ruby", "bug_code_uid": "2f52c3991ff3cbeac4d47de99baf1ebe", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "3ab3117677558df1d5defc9734c239dd", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9957081545064378, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "require 'date'\n\nx, y, z=gets.split\nx=x.to_i\n\nres=0\na=Date.new(2016, 1, 1)\n365.times do\n if z==\"week\" and a.cwday==x then\n res+=1\n elsif z==\"month\" and a.day==x then\n res+=1\n end\n a=a.next\nend\np res\n \n", "lang": "Ruby", "bug_code_uid": "e017b9c6e9036d88ba20fa9ce623095e", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "72eac77b7f8e6643944814ceab00af8b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "s=gets.chomp.to_s\ns=s.split(\" \")\nr=s[0].to_i\nc=s[1].to_i\nrow_straw=[]\ncol_strar=[]\nrows= Array.new(r)\nr.times{|iter|\n\trows[iter]=gets.chomp.to_s\n\tc.times{|iter2|\n\t\tif (rows[iter][iter2]=='S')\n\t\t\t#record\n\t\t\tcol_strar.unshift(iter2)\n\t\t\trow_straw.unshift(iter)\n\t}\n}\nputs((r-row_straw.size)*c+(c-col_straw.count)*(row_straw.count))\n", "lang": "Ruby", "bug_code_uid": "4e6c23d2061cc0830efb3a2c6365a021", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "74e88e5ae503ecc635c5103ffc878a03", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8302872062663186, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "s=gets.chomp.to_s\ns=s.split(\" \")\nr=s[0].to_i\nc=s[1].to_i\nrow_straw=[]\ncol_straw=[]\nrows= Array.new(r)\nr.times{|iter|\n\trows[iter]=gets.chomp.to_s\n\tc.times{|iter2|\n\t\tif (rows[iter][iter2]=='S')\n\t\t\t#record\n\t\t\tcol_straw.unshift(iter2)\n\t\t\trow_straw.unshift(iter)\n\t\tend\n\t}\n}\nputs((r-row_straw.size)*c+(c-col_straw.count)*(row_straw.count))\n", "lang": "Ruby", "bug_code_uid": "303c6cf2935f866a6533b01bce505af0", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "74e88e5ae503ecc635c5103ffc878a03", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8467966573816156, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "rc = gets.chomp.split.map(&:to_i)\nr = rc[0]\nc = rc[1]\ncake = []\nfor i in (0..r-1)\n\tcake << gets.chomp.split(\"\")\nend\n\ncount = 0\nevil = []\nfor i in (0..r-1)\n\tif cake[i].include?(\"S\") == false\n\t\tcount += c\n\t\tr -= 1\n\telse\n\t\tif evil.include?(cake[i].index(\"S\")) == false\n\t\t\tevil << cake[i].index(\"S\")\n\t\tend\n\tend\nend\n\ncount += (c-evil.size)*r \n\nprint count\n", "lang": "Ruby", "bug_code_uid": "409d06c8ab34585aaa9992296e9acae9", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "28da859e7e91ab8706f670369a03f044", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6950437317784257, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "args = STDIN.gets.split.map do |i|\n\ti.to_i\nend\nx = 1\ny = 1\nxx = Array.new(args[0], 0)\nyy = Array.new(args[1], 0)\n#s = {}\nargs[0].times do \n\tl = STDIN.gets \n\targs[1].times do |i|\n\t\tif 'S' == l[i]\n\t\t\t#s.store((y*10)+i+1, 1)\n\t\t\txx[i] = 1\n\t\t\tyy[y-1] = 1\n\t\telse\n\t\t\t#s.store((y*10)+i+1, 0)\n\t\tend\n\tend\n\ty += 1\nend\n\nres = 0\ntmp = 0\nyyy = Array.new(args[1], 0)\n\nargs[0].times do |x|\n\targs[1].times do |y|\n\t\tnext if yy[y] == 1\n\t\ttmp += 1\n\t\tyyy[y] = 1\n\tend\nend\nargs[1].times do |y|\n\targs[0].times do |x|\n\t\tnext if xx[x] == 1 or yyy[y] == 1\n\t\ttmp += 1\n\tend\nend\nres = tmp if res < tmp\n#puts res\ntmp = 0\nxxx = Array.new(args[0], 0)\nargs[1].times do |y|\n\targs[0].times do |x|\n\t\tnext if xx[x] == 1\n\t\ttmp += 1\n\t\txxx[x] = 1\n\tend\nend\nargs[0].times do |x|\n\targs[1].times do |y|\n\t\tnext if yy[y] == 1 or xxx[x] == 1\n\t\ttmp += 1\n\t\tyyy[y] = 1\n\tend\nend\n#puts res\nres = tmp if res < tmp\n#puts res\n", "lang": "Ruby", "bug_code_uid": "9173ea3bfed0b68d79ab1fe2b4469a8f", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "c27d711306ddf00d000b9f467bbe66f7", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8672566371681416, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "p = ('H','Q','+','9').to_a\ns = gets.to_s.split(//)\ns = s & p\nif s.size>0 \n print 'YES'\nelse\n print 'NO'\nend", "lang": "Ruby", "bug_code_uid": "81355484a42c01da9dacc3216507bd4b", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "3d0c2b376ad316b4a39221e5533072cd", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.35121951219512193, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "n = gets.chomp.to_i\ndominos = []\nn.times do\n dominos << gets.chomp.split(/ /).map(&:to_i)\nend\ntime = row = 0\nwhile true\n if row == n\n time = -1\n break\n end\n upper = lower = 0\n dominos.each do |domino|\n u = domino[0]\n l = domino[1]\n upper += u\n lower += l\n end\n if upper.even? && lower.even?\n break\n else\n dominos[row][0], dominos[row][1] = dominos[row][1], dominos[row][0]\n time += 1\n row += 1\n end\nend\nputs time\n", "lang": "Ruby", "bug_code_uid": "623c11e1ae87eebe3d9949a705a138d4", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "c9090038b6ff0c9d4174e0793ece41d4", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6476190476190476, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "odd=0\nl1=0\nr1=0\nn=gets.to_i\nn.times{\n\ta,b=gets.split.map{|e| e.to_i}\n\tl1+=a%2\n\tr1+=b%2\n\todd+=1 if (a+b)%2==1\n}\nif (l1+r1)!=0 then\n\tif odd<2 then\n\t\tputs -1\n\telse\n\t\tputs 1\n\tend\nelse\n\tputs 0\nend", "lang": "Ruby", "bug_code_uid": "520d0659ac62e10bacd1cfafca8c4cff", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "710849819cb67582bcec6dbae7326619", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8546481766820749, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\nmatrixs = []\nn.times do |i|\n matrixs << gets.chomp.split(\" \").map{|x| x.to_i }\nend\neven_even = 0\nodd_odd = 0\neven_odd = 0\nodd_even = 0\nmatrixs.each do |domino|\n a, b = domino\n if a % 2 == 0\n if b % 2 == 0\n even_even += 1\n else\n even_odd += 1\n end\n else\n if b % 2 == 0\n odd_even += 1\n else\n odd_odd += 1\n end\n end\nend\n\n\nif odd_odd % 2 == 1\n if even_odd == 0 || odd_even == 0\n puts -1\n elsif even_odd % 2 == 0\n if odd_even % 2 == 0\n puts 1\n else\n puts -1\n end\n else\n if odd_even % 2 == 0\n puts -1\n else\n if (odd_even + odd_odd) % 2 == 0 && (even_odd + odd_odd) % 2 == 0\n puts 0\n else\n puts -1\n end\n end\n end\nelsif even_odd % 2 == 0\n if odd_even % 2 == 0\n puts 0\n else\n puts -1\n end\nelse\n if odd_even % 2 == 0\n puts -1\n else\n puts 1\n end\nend\n", "lang": "Ruby", "bug_code_uid": "10514452e4f9700d598139e8a063271c", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "2f1b5a03afb7fd4959c175664959aea7", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7916666666666666, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\na = n.times.map{gets.split.map(&:to_i)}\nc = Array.new(4, 0)\na.each do |x, y|\n case [x.even?, y.even?]\n when [true, true]\n c[0] += 1\n when [true, false]\n c[1] += 1\n when [false, true]\n c[2] += 1\n when [false, false]\n c[3] += 1\n end\nend\nif (c[2] + c[3]) % 2 == 0 && (c[1] + c[3]) % 2 == 0\n puts 0\nelsif (c[2] + c[3] + 1) % 2 == 0 && (c[1] + c[3] - 1) % 2 == 0\n puts 1\nelse\n puts -1\nend\n", "lang": "Ruby", "bug_code_uid": "5cce958f865c9f8e7fd7429caf653cc1", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "84313716d7a73ffef592fa522014418c", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9953051643192489, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "wh,wm=gets.chomp.split(':').collect{|a| a.to_i}\nsh,sm=gets.chomp.split(':').collect{|a| a.to_i}\nrh=0\nrm=0\nif wm b\n \ncount = 1\npow = a * a\n\nwhile pow < b do\n pow *= a\n count += 1\nend\n\nif pow == b\n puts \"YES\"\n puts count\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "22dff865bc492f5b9d1435363c782772", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "3368dbeea1c7189ec63c7e6d6b0f3876", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9800796812749004, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.chomp.split().map { |e| e.to_i }\nLIMIT = Math.sqrt(n)\nfactors = []\nfor i in 2 .. LIMIT\n\twhile n % i == 0 && k != 1\n\t\tfactors << i\n\t\tn /= i\n\t\tk -= 1\n\tend\nend\n\nif k != 1\n\tputs \"-1\"\nelse\n\tfor i in factors\n\t\tprint(i,\" \")\n\tend\n\tputs n\nend", "lang": "Ruby", "bug_code_uid": "2eb954fab5dd00706d27267b619b1a3f", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "16233861d23ac524ffa3561954215032", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9402985074626866, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=gets.split.map(&:to_i)\na=n.prime_division.flat_map{|n,p|[n]*p}\nputs a.size(a){(a[0]+a[2]-1)/a[2] + (a[1]+a[2]-1)/a[2] + (a[0]%a[2] == 0 and a[1]%a[2] == 0 ? -1 : 0)}[gets.chomp.split(\" \").map(&:to_i)]", "lang": "Ruby", "bug_code_uid": "7d011fe0fdf9e3d69fcfbdd110ffbd09", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f6f552dc8490ecbc7d3a4a140b697080", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.010233319688907082, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n\t \n\n\n\t\n \n \n\n\t\t \n \t\n\n\n\n \t\n\t\n\t\t\n \t\t \n\t\n \t\t \n", "lang": "Ruby", "bug_code_uid": "6a3e4fe1720239c6be14b8a453c06ae6", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fc9020e611013c0545a59a549291b550", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.012279983626688497, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\n \n\t\t\n \n\n\t \t\n \n\t \n \t\t\n\n\t\n \n \t \n\t\t\t\n\n\n\t\t \t\t \n\n ", "lang": "Ruby", "bug_code_uid": "29688ec93569d8d8804942585f2d2f63", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fc9020e611013c0545a59a549291b550", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7857142857142857, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n,m,a = gets.chomp.split(' ').to_i\nputs ((n-a+1)/(a)) * ((m-a+1)/(a)) ", "lang": "Ruby", "bug_code_uid": "fb4f71f4f19a0473d1fc4d44b2b7f638", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "bed69612061f10bcfc5391f36bdd13ca", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7136563876651982, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n = gets.chomp.to_f\nm = gets.chomp.to_f\na = gets.chomp.to_f\n\nx = (n/a).ceil\ny = (m/a).ceil\n\nputs x*y", "lang": "Ruby", "bug_code_uid": "ed02633cd1d9dce6b394a924c85e54b3", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "a179a03fe134f553f158feba25984ab7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5786516853932584, "equal_cnt": 21, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "width = gets.to_f\nheight = gets.to_f\nblock_size = gets.to_f\n\nwidthNumber = (width/block_size).ceil\nheightNumber = (height/block_size).ceil\n\nputs widthNumber * heightNumber\n", "lang": "Ruby", "bug_code_uid": "f4201b1a516a12fb425fee9e868c0ea4", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "12a9cfa2739b283d0a6c3fed28f90b02", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5407725321888412, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "n=gets.to_i\nm=gets.to_i\na=gets.to_f\n\nn =(n/a).ceil\nm =(m/a).ceil\n\nputs n*m", "lang": "Ruby", "bug_code_uid": "0e5d51ee552d931f8aa6aa1f2725aa05", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "26ce3edb72ebb48382dbc3979cf5f6a2", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.810077519379845, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/env ruby\n\"\"\"(c) gorlum0 [at] gmail.com\"\"\"\nbegin fin = open('A.in')\nrescue fin = STDIN\nend\n\ndef flagstones(n, m, a)\n (n/a).ceil * (m/a).ceil\nend\n\nfor line in fin\n n, m, a = line.split.map(&:to_i)\n puts flagstones(n, m, a) \nend\n", "lang": "Ruby", "bug_code_uid": "c9309af643971364178e0d8fbd26f308", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "47ea9c95557dc79d7d10fa538858271d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8624052004333694, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "# http://codeforces.com/contest/592/problem/A\n# A. PawnChess\n\ncols = [].tap do |arr|\n 8.times { arr << gets.chomp.chars }\nend\nb_idx = []\nw_idx = []\nrows = cols.transpose.reject do |row|\n b = row.rindex('B')\n w = row.rindex('W')\n if b && (w.nil? || (b > w))\n b_idx << 7 - b\n end\n\n b = row.index('B')\n w = row.index('W')\n if w && (b.nil? || (w > b))\n w_idx << w\n end\nend\n\nif !b_idx.empty? && (w_idx.empty? || b_idx.min < w_idx.min)\n puts 'B'\nelse\n puts 'A'\nend\n", "lang": "Ruby", "bug_code_uid": "c7c749fe67e7b24ec4d946f735a2fcc0", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "074a5618d7637099f06ec0a8d2a8eaad", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.33489461358313816, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "# http://codeforces.com/contest/592/problem/A\n# A. PawnChess\n\ncols = [].tap do |arr|\n 8.times { arr << gets.chomp.chars }\nend\nrows = cols.transpose.reject do |row|\n row.include?('B') && row.include?('W')\nend\n\nb_indexes = rows.map { |row| row.rindex('B') }.compact.map { |idx| 7 - idx }\nw_indexes = rows.map { |row| row.index('W') }.compact\n\nif b_indexes.min < w_indexes.min\n puts 'B'\nelse\n puts 'A'\nend\n", "lang": "Ruby", "bug_code_uid": "53ddb8750e8ce1201e81a9b0af49c81b", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "074a5618d7637099f06ec0a8d2a8eaad", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9950544015825915, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "field = []\nwhile line = gets\n field << line.chomp.split(\"\")\nend\nfield = field.transpose\nstepA = []\nstepB = []\nfield.each do |r|\n a = r.rindex(\"W\")\n b = r.rindex(\"B\")\n unless b.nil? then\n if a.nil? or (a < b) then\n stepB << 7 - b\n end\n end\n a = r.index(\"W\")\n b = r.index(\"B\")\n unless a.nil? then\n if b.nil? or (a < b) then\n stepA << 7 - a\n end\n end\nend\nif stepB.empty? or (stepA.min < stepB.min) then\n puts \"A\"\nelsif stepA.empty? or (stepA.min > stepB.min) then\n puts \"B\"\nend", "lang": "Ruby", "bug_code_uid": "e003026d838a504ff2a958506e57cf51", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "4be7b6712784b534a17e720c3e759d5a", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.38786565547128926, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "a = Array.new(8)\nfor x in 0..7\n a[x] = gets\nend\nfor x in 0..7\n for y in 0..7\n if a[7 - x][y] == 'B'\n print \"B\\n\"\n exit\n end\n if a[7 - x][y] == 'W'\n print \"A\\n\"\n exit\n end\n end\nend\n", "lang": "Ruby", "bug_code_uid": "353a3365a2a1fe17c396aa9c4521de8b", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "78e1077b1f33bd05faad84a57d2531fd", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.963265306122449, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "$stdin = File.open \"input.txt\"\n\ndef min(m, s)\n\ta = [0] * m\n\ta[0] = 1\n\t\n\treturn -1 if s < 1\n\t\n\tms = s - 1\n\ti = m - 1\n\twhile ms > 0\n\t\tif i == 0\n\t\t\tif ms < 9\n\t\t\t\ta[i] += ms\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\treturn -1\n\t\t\tend\n\t\telse\n\t\t\ta[i] = [9, ms].min\n\t\t\tms -= a[i]\n\t\t\ti -= 1\n\t\tend\n\tend\n\t\n\treturn a.join\nend\n\ndef max(m, s)\n\ta = [0] * m\n\t\n\treturn -1 if s < 1\n\t\n\ti = 0\n\twhile s > 0\n\t\tif i == m - 1\n\t\t\tif s <= 9\n\t\t\t\ta[i] = s\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\treturn -1\n\t\t\tend\n\t\telse\n\t\t\ta[i] = [9, s].min\n\t\t\ts -= a[i]\n\t\t\ti += 1\n\t\tend\n\tend\n\t\n\treturn a.join\nend\n\nm, s = gets.split.map &:to_i\nputs \"#{min(m, s)} #{max(m, s)}\"", "lang": "Ruby", "bug_code_uid": "a1156b45262242cadf2208ceb3917d46", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "d53d501bded3d22130e50923f6df68c9", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7189873417721518, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "m, s = gets.split.map(&:to_i)\n\ndef dp (m, mm, ss)\n return ss if mm == 1\n a = 0\n a = 1 if mm == m\n while ss - a > 9 * (mm - 1)\n a += 1\n end\n a * (10 ** (mm - 1)) + dp(m, mm - 1, ss - a)\nend\n\nif 9 * m < s || (m > 1 && s == 0)\n puts [-1, -1].join(\" \")\nelse\n a = dp(m, m, s)\n puts [a, a.to_s.chars.sort.reverse.join(\"\").to_i].join(\" \")\nend\n", "lang": "Ruby", "bug_code_uid": "09fa1c3b05ea401c3a5bb63cc0113c5a", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "5ac78dceeee65298b59b1b9127224e94", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.13125, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "def sum(n, num)\n total = 0\n n.times do |i|\n total += (num / 10 ** i) % 10\n end\n total\nend\nn, s = gets.chomp.split.map(&:to_i)\n#p n = rand(1..5)\n#p s = rand(0..n * 10)\nmi = 10 ** (n - 1)\n\n(10 ** n - 1).times do\n break if sum(n, mi) == s\n if mi >= 10 ** n - 1\n mi = -1\n break\n end\n mi += 1\nend\nmx = 10 ** n - 1\n(10 ** n - 1).times do\n break if sum(n, mx) == s\n if mx <= mi && mi != -1\n mx = mi\n break\n elsif mx <= 10 ** (n - 1)\n mx = -1\n break\n end\n mx -= 1\nend\nputs [mi, mx].join(\" \")\n", "lang": "Ruby", "bug_code_uid": "0839fd12ae030930dcfdbe49716e55a6", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "5ac78dceeee65298b59b1b9127224e94", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8692756036636137, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "m,s=gets.split(\" \").map{|x| x.to_i}\nif 9*m=s\n d.push(i)\n minValue=i.to_s\n s-=i\n break\n end\n end\n minValue+=([0]*(m-s/9-2)).join(\"\")+(s%9).to_s+([9]*(s/9)).join(\"\")\n puts \"#{minValue} #{maxValue}\"\nend\n", "lang": "Ruby", "bug_code_uid": "31d7718d1b06cd64b07927f081b45884", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "aea475ba38ed1b0e99caa49fc93b17b6", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5167037861915368, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/ruby\n\ndef readNextValues\n return gets.chomp.split.collect {|x| x.to_i }\nend\n\na, c = readNextValues\nas = a.to_s(3)\ncs = c.to_s(3)\nresult = \"\"\n\nn = as.size - cs.size\nif n > 0\n result = as[0..n-1].map{|x| 3-x.to_i}.join('')\n as = as[n..-1]\nelsif n < 0\n n = n.abs\n result = cs[0..n-1]\n cs = cs[n..-1]\nend\nfor i in 0..as.size-1\n result << ((cs[i].to_i - as[i].to_i) % 3).to_s\nend\n\nputs result.to_i(3)\n", "lang": "Ruby", "bug_code_uid": "b44060a6a4a62e0302a16ee1ef57f8c0", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "176af4f97528e683f6d9e46dd064a4ea", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9803149606299213, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a,c = gets.split.map(&:to_i)\n\na = a.to_s(3)\nc = c.to_s(3)\n\nif a.size > c.size\n c = \"0\" * (a.size - c.size) + c\nelsif a.size < c.size\n a = \"0\" * (c.size - a.size) + a\nend\n\nb = \"\"\na.size.times do |i|\n b << ((c[i] - a[i]) % 3).to_s\nend\n\np b.to_i(3)\n", "lang": "Ruby", "bug_code_uid": "1c7cb7c41929c04cecaba74ff1bad953", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "23ebf7bbb728c9a00e4c675afb4dfe69", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9943820224719101, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, c = gets.split.map{ |x|\n (x.to_i.to_s(3).reverse+\"0\"*10).split(\"\").map(&:to_i)\n}\n[a.length, c.length].min.times{ |i|\n c[i] = (c[i]-a[i]+3) % 3 \n}\np c.join(\"\").reverse.to_i(3)\n", "lang": "Ruby", "bug_code_uid": "b031cc86cd8614fd6c2507c00d5f1220", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "8e655e6b26ddd1a15bca39f9e78c97e9", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5025641025641026, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def lscan;gets.split.map(&:to_i);end\n\nx,y,z = lscan\n\npl = x + z > y\nmi = y + z > x\n\nif pl && mi\n puts \"?\"\nelsif pl\n puts \"+\"\nelsif mi\n puts \"-\"\nelse\n puts \"0\"\nend", "lang": "Ruby", "bug_code_uid": "18228818ea89ca731847af99aa1d9e32", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "c2feb0bb8045687960239ea1d049504a", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8767123287671232, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "p gets.split('+').sort.join('+')", "lang": "Ruby", "bug_code_uid": "7a622bc4c863a3407cd62246f8a0ba55", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "e91a5b5c212a56addf11b74eef960996", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8674698795180723, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "gets\nputs gets.split('+').sort.join('+')\n", "lang": "Ruby", "bug_code_uid": "4a6e0482ada80c4c0e15226c62c0344d", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "24f46ec3521cd181ee3748c55c48bfa1", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9732620320855615, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\na = gets.to_i\nif a % 2 == 1\n\tputs (a + 1) / 2\nelse\n\tputs (n - a) / 2 + 1\nend\n", "lang": "Ruby", "bug_code_uid": "41526aa91dfb72050d96dcc3fb7754a7", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "ee45ae0873c0785dde11f3ec5f884d93", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8024691358024691, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "inp = gets\np (inp.index('0000000') || inp.index('1111111')) ? YES : NO", "lang": "Ruby", "bug_code_uid": "d04c4594e8accc16134f06d56ee98ff9", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "ddcc9fe5f06ad1c0b7865a1a9abddc47", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9945945945945946, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "inp = gets\nif inp.index('0000000') || inp.index('1111111'))\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "0b2a52118a4e091a83a0b4ebf27ba3a5", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "ddcc9fe5f06ad1c0b7865a1a9abddc47", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.989247311827957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "input = gets.chomp\nif input == (input[0].downcase + input.reverse.chop.reverse.upcase)\n puts input.capitalize\nelsif input.upcase == input || \n puts input.downcase\nelse\n puts input \nend", "lang": "Ruby", "bug_code_uid": "4e9ec6d3ec32d6ba88067a7f80132163", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "97f444329f1cc41cd428d2ee1a0461f3", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6690140845070423, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "given_word = ARGV[0]\n\ndef upcase_match?(word)\n (word <=> word.upcase) == 0\nend\n\nif upcase_match?(given_word) || (!upcase_match?(given_word[0]) && upcase_match?(given_word[1..-1]))\n puts \"#{given_word[0].upcase}#{given_word[1..-1].downcase}\"\nelse\n puts given_word\nend\n\n", "lang": "Ruby", "bug_code_uid": "9be7c9f1c66a11f7039ed0ce26b257a7", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "3e2e9ac50024a2a97148db4ef1337ca0", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9863013698630136, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s=gets.chomp;\ns1=s.capitalize.swapcase;s2=s1.uppercase;\nif (s==s1)or(s==s2)\n puts s.swapcase\nelse\n puts s\nend", "lang": "Ruby", "bug_code_uid": "62667399bb107da7955d1e51ff0f408d", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "e700127c5b6f2bee93918e80403c36d1", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9534883720930233, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = ARGF.read.strip\n\nif s[1, -1] == s[1, -1].upcase\n\tputs s.swapcase\nelse\n\tputs s\nend\n", "lang": "Ruby", "bug_code_uid": "bcc42f1635eda4002438bc313fa598a7", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "dea5de4f86521f0837afe3747ac6bfd2", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9294755877034359, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n = $stdin.gets.to_i\ns = $stdin.gets.chomp\n\nif s.gsub(/[47]/, '') == \"\"\n first = 0\n second = 0\n\n (n / 2).times do |i|\n first += s[i,1].to_i\n second += s[-i,1].to_i\n end\n\n if first == second\n puts \"YES\"\n else\n puts \"NO\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "224c833b0c87e69b170dda28a24674a0", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "apr_id": "6246124f44b104be87d521ef25fec0a0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9688013136288999, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = $stdin.gets.to_i\ns = $stdin.gets.chomp\n\nif s.gsub(/[47]/, '') == \"\"\n first = 0\n second = 0\n\n (n / 2).times do |i|\n first += s[i,1].to_i\n end\n\n (n / 2).times do |i|\n second += s[~i,1].to_i\n end\n\n p first, second\n\n if first == second\n puts \"YES\"\n else\n puts \"NO\"\n end\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "d554befa4e42ac671b676d6249376cb0", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "apr_id": "6246124f44b104be87d521ef25fec0a0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9414519906323185, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\ns = gets.chomp.split('').map(&:to_i)\n\nif s.uniq.sort == [4,7]\n if s.each_slice(n/2).map{|x| x.inject(:+)}.uniq.size == 1\n puts \"YES\"\n else\n puts \"NO\"\n end\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "10e21bd2ab399bccaa6f94d26fb070e5", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "apr_id": "1ffcaa888bc76480361c6a888b2a95ed", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9839080459770115, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "\na = gets.split.map(&:to_i)\nb = gets.split.map(&:to_i)\ncnt =0\n(0..a.length - 1).each{|i|\n if a[i] == b[i]\n p \"YES\"\n break\n else\n cnt += 1\n end \n}\nif cnt == a.length\n p \"NO\"\nend ", "lang": "Ruby", "bug_code_uid": "1f83667bef0fd4b48e2b559492ff3363", "src_uid": "91c9dbbceb467d5fd420e92c2919ecb6", "apr_id": "bf0223979a55e3aaa0b31898aedd54de", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9761222540592168, "equal_cnt": 13, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 9, "fix_ops_cnt": 13, "bug_source_code": "v=1000000000;\ninput=gets.split.map(&:to_i);\na=input[0];b=input[1];m=input[2];\nif a==v then\n a-=1\nend\nif b==v then\n b-=1\nend\nv%=m;\nif b>=m || v==0 then\n puts 2\nelse\n el=[a,m].min\n j=v\n for i in 1..el\n if (j%m)+b>=m then\n\n else\n printf \"1 %09d\\n\",i\n exit\n end\n j+=v\n if j>=m then\n j-=m\n end\n end\n puts 2\nend\n", "lang": "Ruby", "bug_code_uid": "d3e5ef97a113ac3f66dbcc349752a22b", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "fb9e528d552f45256e151ec8f3919b51", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9794238683127572, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\ns = gets.chomp\n\nl = s[0...n].split(//).map(&:to_i)\nr = s[n...2*n].split(//).map(&:to_i)\n\nlh, rh = true, true\nfor i in 0...n do\n lh = lh && l[i] < r[i]\n rh = rh && l[i] > r[i]\nend\n\nputs(if lh || rh then \"YES\" else \"NO\" end)", "lang": "Ruby", "bug_code_uid": "2b148e97219587591819569d90aca102", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "81280ff31c501e91969f76b5ee3c24fd", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.03125, "equal_cnt": 12, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "import sys\nimport math\nimport itertools\n\ndef to_numeric(c, r):\n ret = 0\n \n array = [i for i in c]\n array.reverse()\n for i in range(len(array)):\n tmp = 0\n if array[i].isalpha():\n tmp = ord(array[i]) - ord('A') + 10\n else:\n tmp = int(array[i])\n\n ret += tmp * r ** i\n\n return ret \n \nif __name__ == '__main__':\n print to_numeric(\"2A\", 2)\n \"\"\"\n s = raw_input().rstrip()\n a = s.split(\":\")[0]\n b = s.split(\":\")[1]\n\n r = 3\n radixes = []\n for i in range(2, 61):\n a2 = to_numeric(a, i)\n b2 = to_numeric(b, i)\n\n if a2 < 24 and b2 < 60:\n radixes.append(i)\n \n if len(radixes) == 0:\n print 0\n else:\n if len(radixes) == 59:\n print -1\n else:\n print \" \".join([str(i) for i in radixes])\n \"\"\"\n \n\n \n", "lang": "Ruby", "bug_code_uid": "b271e165f431be610965abaee4897a72", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "28c2bdeb1967284638588a225616d587", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.995366079703429, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# http://codeforces.ru/problemset/problem/160/B\n\ndef run(input = STDIN.read)\n lines = input.split(\"\\n\")\n\n n = lines[0].to_i\n ticket = lines[1].split(\"\").map(&:to_i)\n\n first = ticket.take(ticket.size / 2).sort\n second = ticket.drop(ticket.size / 2).sort\n \n if (0..n-1).all? { |i| first[i] < second[i] } or\n (0..n-1).all? { |i| first[i] > second[i] } then\n return 'YES'\n else\n return 'NO'\n end\nend\n\nbegin\n require './testing.rb'\nrescue LoadError\n run\nend\n__END__\n2\n2421\n=\nYES\n---\n2\n0135\n=\nYES\n---\n2\n3754\n=\nNO", "lang": "Ruby", "bug_code_uid": "812ad42bd8a76a7d5fefff4ce25726aa", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "b876ca5cb6eda9fc30bec4b4c931c00c", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9655172413793104, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "t,s,x = gets.chomp.split \n\nt = t.to_i \nx = x.to_i \ns = s.to_i \n\nif x x\n time += s\n if time == x || time + 1 == x\n puts 'YES'\n exit\n end\nend\n\nputs 'NO'", "lang": "Ruby", "bug_code_uid": "3a95b25c00b022c9ae451b9b12b47892", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "64c114d8630e9dabdd2177895f7d6a86", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5526315789473685, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/env ruby\n\nt, s, x = ARGF.gets.chomp.split(\" \").map { |s| s.to_i }\n\nif t == x\n puts \"YES\"\n exit\nend\n\ni = 1\nwhile (barktime = t + i * s) <= x + 1 do\n if x == barktime or x == barktime + 1\n puts \"YES\"\n exit\n end\n i += 1\nend\nputs \"NO\"\n", "lang": "Ruby", "bug_code_uid": "3b9e883a4449bdbe3e99f1a1cf0fb3e0", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "68d0d5a6a8479c8ecdffd61b60b8e992", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7541984732824427, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "t, s, x = gets.chomp.split(' ').map(&:to_i)\n\nnum = t\noneTime = false\nfirst = true\n\nuntil num >= x\n\tnum += s if first\n\tnum += (s - 1) if !oneTime && !first\n\tnum += 1 if oneTime\n\n\toneTime = !oneTime\n\tfirst = false\n\n\t#puts \"Num : #{num}\"\nend\n\nif num == x\n\tputs 'YES'\nelse\n\tputs 'NO'\nend", "lang": "Ruby", "bug_code_uid": "646ebf302adca952614391b62917d0d9", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "bef9738367b93a4a031a3adab539c797", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.998812351543943, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#out = Number.new\nc = 0\na = 0\nt = 0\nb = Array.new()\ncount = 0\n#a = Fixnum.new()\n#c = Fixnum.new()\nout = 0\ngets.scan(/\\d+/).each do |str|\nif t == 0 then #first num\n\tt = t + 1\n\ta = str.to_i\n\t#puts \"a = \" + a.to_s\nelse\t#sec num = c\n\tc = str.to_i\n\t#puts \"c = \" + c.to_s\n\twhile c != 0 and a != 0\n\t\tif c%3 >= a%3 then\n\t\t\tb[count] = c%3 - a%3\n\t\telse\n\t\t\tb[count] = c%3+3-a%3\n\t\tend\n\t\t#puts count.to_s + \" \" + a.to_s + \" \" + c.to_s + \" \" + b[count].to_s\n\t\tc = c/3\n\t\ta = a/3\n\t\tcount = count + 1\n\tend\n\tif c == 0 then\n\t\twhile a != 0\n\t\t\tb[count] = (a != 0 ? 3-a%3 : 0)\n\t\t\ta = a/3\n\t\t\tcount = count + 1\n\t\tend\n\telse\n\t\twhile c!= 0\n\t\t\tb[count] = c%3\n\t\t\tc = c/3\n\t\t\tcount = count+1\n\t\tend\n\tend\nend\nend\ncount = count - 1\nn = 1\n#p b\n0.upto(count) do |i|\n\tout = out + n*b[i]\n\t#puts \"i = \" + i.to_s + \"n = \" + n.to_s + \"out = \" + out.to_s\n\tn = n*3\nend\nputs out \n#p b\n", "lang": "Ruby", "bug_code_uid": "d00dc4c358e0eef8c4ca91bcde8fe014", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "c6847df00a1268aa6b3a34bc8158ca5e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9762611275964391, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\n\ndef solution(n, arr)\n ans = 0\n m = arr[0]\n arr = arr.slice 1, arr.length\n while arr.any? {|a|a >= m}\n m += 1\n arr.sort!.reverse!\n arr[0]-=1\n ans += 1\n end\n puts ans\nend\n\nn = gets.to_i\narr = gets.split(' ')\nsolution n, arr\n#\n# solution 5, [5,1,11,2,8]\n# solution 4, [1,8,8,8]\n# solution 2, [7,6]", "lang": "Ruby", "bug_code_uid": "5d9846074152d4f29d3fa65d17cfe331", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "f24ec9c861cf0c5e28636c72fa805acf", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.32673267326732675, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "u = [0]*10000\na = gets.chomp.to_i\nb = gets.chomp.split(' ')\nprint b\n", "lang": "Ruby", "bug_code_uid": "5c8cf189e7cf0a3723e739f61e6a389f", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "5ef0060344fd640b6da19f8e0a4e8406", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6970387243735763, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = gets.to_i\na, *b = gets.split.map(&:to_i)\nif a > b.max\n puts 0\nelse\n c = b.select{|x| x > a}.sort.reverse\n ans = 0\n while a <= c.max\n ans += 1\n a += 1\n c[0] -= 1\n c = c.sort.reverse if c[0] != c.max\n end\n puts ans\nend\n", "lang": "Ruby", "bug_code_uid": "cb65e34829e6aa2bc0a4c808d6d3d474", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "9d514415bdfa17928aa927509d2d4046", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.009377093101138647, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main() {\n int tol = 0;\n scanf(\"%d\", &tol);\n for (int o=0; o q;\n scanf(\"%d\", &n);\n\n for (int i = 0; i < n; ++i) {\n scanf(\"%d\", &x);\n\n if (i > 0) {\n q.push(x);\n } else {\n first = x;\n }\n }\n\n while (q.top() >= first) {\n int max = q.top();\n q.pop();\n q.push(max - 1);\n ++first, ++ans;\n }\n\n printf(\"%d\\n\", ans);\n }\n return 0;\n}\n", "lang": "Ruby", "bug_code_uid": "d5b08ca34c4ddb96bfa7351ac44e0acc", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "933b1ffe0a2cd5a0eba5425199f1c9c5", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6039603960396039, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#!/usr/bin/ruby\n\nn = gets.to_i\nx = 1\nwhile x*2 <= n\n x*=2\nend\n\nputs 1 + n - x\n", "lang": "Ruby", "bug_code_uid": "8031b5ef511b7e846c1d895b44db9216", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "3337fe8bfe4b37da6db9de5090378036", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.96875, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "puts gets.to_i.to_s(2).count(1)", "lang": "Ruby", "bug_code_uid": "83dcd41ad95919bc3f0c71c537e4a3be", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "d3151312c5fd1e9feac90a62148c005c", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.31343283582089554, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = gets.to_i\nputs a.odd? && a != 1 ? 2 : 1\n", "lang": "Ruby", "bug_code_uid": "daa8c355f88c30433e7e72fbe1d1965e", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "d739d4349393be9cb54dd07f58f91145", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7713310580204779, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n = gets.to_i\na = Array.new(n)\n\nfor i in 0..n-1\n a[i] = gets.chomp.to_s\nend\n\ncounter = 0\nfor i in 0..n-1 \n if a[i] == a[i+1]\n counter+=1\n end\nend\nputs counter", "lang": "Ruby", "bug_code_uid": "00dcdc41c719105d875d9ce183077fd6", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "6059276818ec2c82e05bb41600150705", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9285714285714286, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "stones = gets.chomp.to_i\ncolors = gets.chomp\ncolors = colors.split(\"\")\n\nfor i in (0..stones-1)\n\tif i < stones - 1\n\t\twhile colors[i] == colors[i+1] && colors.size > 1\n\t\t\tcolors.delete_at(i+1)\n\t\tend\n\tend\nend\n\nprint stones - colors.size", "lang": "Ruby", "bug_code_uid": "ce77a632d92eb405089d8df575fe5e10", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "2eae6714df212d02719926e1cd189595", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9285714285714286, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\n\nfunds, start, factor = STDIN.readline.split.collect {|s| s.to_i }\n\ncount = 0\nlength = start.to_s.length\n\nwhile true\n\tlimit = 10**(length)\n\tmax_steps = limit-start\n\n\tif max_steps*length*factor >= funds\n\t\tcount += funds/(length*factor)\n\t\tbreak\n\tend\n\n\tcount += max_steps\n\tfunds -= max_steps*length*factor\n\tlength += 1\n\tstart = limit-1\nend\n\nputs count\n\n", "lang": "Ruby", "bug_code_uid": "b43f67751a1ee3dcc08d432c4ec32b12", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "8b83844361b886434b08df739fbabdfa", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9868421052631579, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "w,m,k=gets.split.map(&:to_i)\na=Math.log10(m).to_i+1\nv=l=0\nwhile k*(c=(b=10**a-1)-m+1)+v <=w do\n v+=k*c\n l+=c\n m=b+1\n a+=1\nend\nl+=(w-v)/(a*k)\np l\n\n", "lang": "Ruby", "bug_code_uid": "ff5561d87f17782d895c640076011acc", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "323d69ce52e7dc557d814ce0443ec3d7", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8378378378378378, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "gets;p gets.split.uniq.reject('0').size", "lang": "Ruby", "bug_code_uid": "c15eb079a94a45c24cae197c230073e8", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "598d94905712584fbc51663836495667", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9607843137254902, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "t,s,q=gets.split.map(&:to_f)\ni=Math.log(t/s,q).ceil", "lang": "Ruby", "bug_code_uid": "45b6afd72d97edd92059ca357ef80737", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "d3c5404a289a0c3b05ad2127bf9ea991", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.99, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=gets.chomp.split(\" \")\ns=a[1].to_i\nq=a[2].to_i\nt=a[0].to_i\nans=(Math.log(t/s,q)).ceil\nputs \"#{ans}\"", "lang": "Ruby", "bug_code_uid": "839b20aa298d97fb5122746a439a4cb2", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "66fc0bcc82579160b1e2a30f2b806397", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9563492063492064, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby \n\n#f = File.open('input', 'r')\n\nwhile line = f.gets do\n line.chomp!\n tt, ss, qq = line.scan(/\\d+/).map(&:to_i)\n tt = tt.to_i\n cnt = 1\n while qq * ss < tt do \n cnt += 1\n ss = qq * ss\n end\n puts cnt\nend \n\n#f.close\n", "lang": "Ruby", "bug_code_uid": "b03c3718e5213575ef63f846a981855a", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "2b63be96f1e25239731789f5b10a0c57", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9636363636363636, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=(1..110).to_a\na=a.join\nputs \"#{a[gets.chomp.to_i-1]}\"", "lang": "Ruby", "bug_code_uid": "8264e27dea33f22ed48f42c386f40a2f", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "00a2ba389bf52decfcce860495505e83", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9051094890510949, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nN,M=gets.to_i\np N==1 ? 1 : M-1=m\n m += 1\n puts m\n exit\nend\nm -= 1\nputs m\n\n", "lang": "Ruby", "bug_code_uid": "a578b49ca6dd48723ba838b931f23e5b", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "3942483c908bdf09372480d3a79633dc", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9799749687108886, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "# coding: utf-8\n\nn, m = gets.split.map(&:to_i)\n# m -> number picked by Misha\n# c -> any random number range [1, n], uniform probability\n# n -> n number range\n# a -> number picked by Andrew\n# |c - a| < |c - m|\n# if distances are same, Misha wins\n# Make highest probability for Andrew's winning\n\nif n == 1\n puts \"1\" # no other possible case\nelse\n mid = n/2 + n%2\n if m < mid\n puts m + 1\n else\n puts m - 1\n end\nend\n\n# ex)\n# 1 2 3 4 5 6 7 8\n# M A \n# M wins at: 1, 2\n# A wins at: 3, 4, 5, 6, 7, 9\n# 1 2 3 4 5 6 7 8\n# M A\n# M wins at: 1, 2, 3, 4\n# A wins at: 5, 6, 7, 8\n# 1 2 3 4 5 6 7 8\n# M A\n# M wins at: 1, 2, 3, 4, 5\n# A wins at: 6, 7, 8\n# 1 2 3 4 5\n# A M\n# M wins: 4, 5\n# A wins: 1, 2, 3\n# 1 2 3 4 5\n# A M\n# M wins: 5\n# A wins: 1, 2, 3, 4", "lang": "Ruby", "bug_code_uid": "d47f4c1e6e0dd384503a79c1f63048b7", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "f2f5c28fbb041fce28e0e50e2a8137b1", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.11382113821138211, "equal_cnt": 6, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "import sys\nval=map(int,raw_input().split(\" \"))\nval=sorted(val)\nm=max(val[0]+val[1]-val[2],val[1]+val[2]-val[3])\nprint [\"IMPOSSIBLE\",\"SEGMENT\",\"TRIANGLE\"][(m>=0)+(m>0)]\n", "lang": "Ruby", "bug_code_uid": "8755d485dfd034c0de4d2909c7003160", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "5f8da038bf3741198dceff5afbcff38e", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.97632058287796, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "# -*- coding: utf-8 -*-\ndef triangle(a, b, c)\n if a + b > c then\n return 1\n elsif a + b == c then\n return 0\n else\n return -1\n end\nend\n\ninputs = gets.split.map(&:to_i)\ninputs.sort!\nans = -1\nfor i in 0...4 do\n for j in i+1...4 do\n for k in j+1...4 do\n work = triangle(inputs[i], inputs[j], inputs[k])\n if work > ans then ans = work end\n #print inputs[i], inputs[j], inputs[k] , \" \" , work\n puts\n end\n end\nend\ncase ans\n when 1\n p \"TRIANGLE\"\n when 0\n p \"SEGMENT\"\n when -1\n p \"IMPOSSIBLE\"\nend\n", "lang": "Ruby", "bug_code_uid": "417955c6ba9bdae53923e7df8dd3f6d4", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "905bfe5b8dd0a49f5e58c3b7984fbbe2", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6973079448456992, "equal_cnt": 22, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 22, "bug_source_code": "#!/usr/bin/env ruby\n# -*- cofing: utf-8 -*-\n\nPrimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97].freeze\n\ndef get_abn(io)\n line = io.gets\n parts = line.split(' ')\n return parts[0], parts[1], parts[2]\nend\n\n# greatest common divisor\ndef gcd(x, y)\n x_divisor = divisor x\n y_divisor = divisor y\n common_divisor = x_divisor & y_divisor\n return common_divisor.max\nend\n\ndef divisor(x)\n divisor = [1]\n Primes.each do |p|\n divisor << p if x%p == 0\n end\n unless Primes.include? x then\n divisor << x\n end\n return divisor\nend\n\na, b, n = get_abn($stdin)\nwhile true\n taken = gcd(a, n)\n if taken > n then\n puts 1\n break\n else\n n -= taken\n end\n\n taken = gcd(b, n)\n if taken > n then\n puts 0\n break\n else\n n -= taken\n end\nend\n", "lang": "Ruby", "bug_code_uid": "89ef15779de2224e399d04ba6a8636f5", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "ed26ec77be2a1919174e815cda164b56", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.29621125143513205, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "include Math\n\ndef get_abn(io)\n line = io.gets\n parts = line.split(' ')\n return (parts[0], parts[1], parts[2])\nend\n\na, b, n = get_abn($stdin)\nprint a,b,n", "lang": "Ruby", "bug_code_uid": "aea2076db7cfa164ed45dcfbb9add0d4", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "ed26ec77be2a1919174e815cda164b56", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9669811320754716, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/env ruby\n# -*- cofing: utf-8 -*-\n\ndef get_abn(io)\n io.gets.split(' ').map! {|p| p.to_i}\nend\n\n# greatest common divisor\ndef gcd(x, y)\n m, n = [x, y].sort\n until n==0 do\n m, n = [n, m%n]\n end\n return m\nend\n\nif $0 == __FILE__ then\n a, b, n = get_abn($stdin)\n cnt = 1\n [a, b].cycle do |x|\n taken = gcd(x, n)\n if taken > n then\n puts cnt\n break\n end\n cnt += 1\n end\nend\n\n", "lang": "Ruby", "bug_code_uid": "ed638ca5921f1645992c3a1446c4f81c", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "ed26ec77be2a1919174e815cda164b56", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7549407114624506, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "x,y,z=gets.chomp.split()\nx = x.to_i\ny = y.to_i\nz = z.to_i\npoint = 0\nwhile true\n\tif x>y\n\t\tif point==0\n\t\t\tz-=x.gcd(z)\n\t\t\tif z<0\n\t\t\t\tputs 0\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tpoint+=1\n\t\tend\n\t\tif point==1\n\t\t\tz-=y.gcd(z)\n\t\t\tif z<0\n\t\t\t\tputs 1\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tpoint-=1\n\t\tend\n\tend\nend\n", "lang": "Ruby", "bug_code_uid": "8720b35fe4d146d1b10d7cadb8036926", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "d52e1787f7c506fa0be3c579e0d296a7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9565217391304348, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=gets.to_i\np 1+3*n*~-n", "lang": "Ruby", "bug_code_uid": "4f01bb4b70b733a4fc632d003701c6af", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "03a4f8625edc469cbad4f3276f2c4f70", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7787610619469026, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = gets.chomp.to_i;\nans = 1;\nn.times{|i| ans += 6*(i+1)}\np ans\n", "lang": "Ruby", "bug_code_uid": "277771b4074123623509bd0f7a11cae3", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "e085c0c27bc624c716211bcd5bd18710", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9761904761904762, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=gets.chomp.to_i\nb=3*(a+1)*a-1\nputs\"#{b}\"", "lang": "Ruby", "bug_code_uid": "b6aca08c487358be2b6a8f7afc01104f", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "a34a7773f3403cfac3b9b2e18f16363d", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7401574803149606, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets.strip.to_i\nputs(1) and return if n == 0\nputs(1 + (2*6 + 6*(n-1)*n)/2)", "lang": "Ruby", "bug_code_uid": "4ccdbf477d44e2dfe60cd167f56b29dc", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "3ec297d1fe3c43cb550551b44d5c0b3b", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9950083194675541, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "def dist(x1,y1,x2,y2)\n x1-=x2\n y1-=y2\n x1=x1>0?x1:-x1\n y1=y1>0?y1:-y1\n return x1+y1\nend\n\nposx=[]\nposy=[]\ndelta=[]\nsm=[]\nargs=gets.split.collect{|s|s.to_i}\nx0,y0,ax,ay,bx,by=args[0],args[1],args[2],args[3],args[4],args[5]\nargs=gets.split.collect{|s|s.to_i}\nxs,ys,t=args[0],args[1],args[2]\nposx.push(x0)\nposy.push(y0)\ndelta.push(0)\nsm.push(0)\nwhile delta[-1]<=t\n x0,y0=ax*posx[-1]+bx,ay*posy[-1]+by\n delta.push(dist(x0,y0,posx[-1],posy[-1]))\n sm.push(delta[-1]+sm[-1])\n posx.push(x0)\n posy.push(y0)\nend\n\nma=0\nl=posx.length\nfor i in 0..l-1\n king=dist(xs,ys,posx[i],posy[i])\n for j in 0..i\n miles=(sm[i]-sm[j])+king\n cnt=i-j+1\n if miles<=t&&cnt>ma\n ma=cnt\n end\n miles+=(sm[i]-sm[j])\n for k in i+1..l-1\n miles+=delta[k]\n if miles<=t\n cnt+=1\n if(cnt>ma)\n ma=cnt\n end\n else \n break\n end\n end\n end\nend\nputs ma\n", "lang": "Ruby", "bug_code_uid": "ccce3770edd80bbb93368ece55cff038", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "e2434b354168dbf44a7b72c049983172", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9966960352422908, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def dist(x1,y1,x2,y2)\n x1-=x2\n y1-=y2\n x1=x1>0?x1:-x1\n y1=y1>0?y1:-y1\n return x1+y1\nend\n \nposx=[]\nposy=[]\ndelta=[]\nsm=[]\nargs=gets.split.collect{|s|s.to_i}\nx0,y0,ax,ay,bx,by=args[0],args[1],args[2],args[3],args[4],args[5]\nargs=gets.split.collect{|s|s.to_i}\nxs,ys,t=args[0],args[1],args[2]\nposx.push(x0)\nposy.push(y0)\ndelta.push(0)\nsm.push(0)\nwhile delta[-1]<=t+x0+y0+xs+ys\n x0,y0=ax*posx[-1]+bx,ay*posy[-1]+by\n delta.push(dist(x0,y0,posx[-1],posy[-1]))\n sm.push(delta[-1]+sm[-1])\n posx.push(x0)\n posy.push(y0)\nend\n \nma=0\nl=posx.length\nfor i in 0..l-1\n king=dist(xs,ys,posx[i],posy[i])\n for j in 0..i\n miles=(sm[i]-sm[j])+king\n cnt=i-j+1\n if miles<=t&&cnt>ma\n ma=cnt\n end\n miles+=(sm[i]-sm[j])\n for k in i+1..l-1\n miles+=delta[k]\n if miles<=t\n cnt+=1\n if(cnt>ma)\n ma=cnt\n end\n else \n break\n end\n end\n end\nend\nputs ma", "lang": "Ruby", "bug_code_uid": "ac4f2787950cb544c3f69d206b98a771", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "e2434b354168dbf44a7b72c049983172", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.3719806763285024, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n = gets.to_i\nk = gets.to_i\na = gets.to_i\nb = gets.to_i\no = n\ncnt = 0\nuntil n%k == 0 || n==1 do\n n -= 1\n cnt += a\nend\nuntil n%k != 0 || n==1 do\n n = n/k\n cnt += b\nend\ncnt += a*(n-1)\nputs [cnt, a*(o-1)].min\n", "lang": "Ruby", "bug_code_uid": "e8a3e44f334f792b7e3812479c1d1e59", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "a03605484736bdcdaa278bf9233a65ee", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9778869778869779, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nk = gets.to_i\na = gets.to_i\nb, ans = gets.to_i, 0\nuntil n < k || n == 1 || k == 1\n m = n%k\n q = n/k\n n -= m\n ans += a*m\n ans += [a*(n-q), b].min\n n -= n-q\nend\nans += a * (n-1)\nput ans", "lang": "Ruby", "bug_code_uid": "0a128a413763c343677e3313d9b119d2", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "a03605484736bdcdaa278bf9233a65ee", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9472049689440993, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def maxdiv(a,x)\n\treturn -1 if a < x\n\tw = a.divmod(x)\n\treturn x*w[0]\nend\n\nas,bs,xs,ys = gets.chomp.split(/ /)\na = as.to_i\nb = bs.to_i\nx = xs.to_i\ny = ys.to_i\na = maxdiv(a,x)\nb = maxdiv(b,y)\nif a < 0 || b < 0\n\tputs \"0 0\"\nelse\n\tax = a / x\n\tby = b / y\n\twk = [ax, by].min\n\tputs sprintf(\"%d %d\", x*wk, y*wk)\nend", "lang": "Ruby", "bug_code_uid": "bb91df77bb7dd6737a255e8d2f14a86b", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "1165b8608e2c0c514e1b5042dbda4c33", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9022988505747126, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/env ruby\n#codeforces.com/problemset/problem/16/C\n\ninput = gets.chomp.split(\" \").map(&:to_i)\n\na = input[0]\nb = input[1]\nx = input[2]\ny = input[3]\n\n\ndef gcd(a1, b1)\n b1 == 0 ? a1 : gcd(b1, a1.modulo(b1))\nend\n\nif x>a and y > b\n\tgcdd = gcd(x,y)\n\tx = x/gcdd\n\ty = y/gcdd\nend\n\nmultiply = [a/x, b/y].min\n\nputs (x*multiply).to_s + \" \" +(y*multiply).to_s\n\n\n", "lang": "Ruby", "bug_code_uid": "d42ece58fd5fef88ae7008e93e22fe48", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "439ddbd05d9708131cef7757c2c29b1c", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.503448275862069, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "a,b,x,y=gets.split.map(&:to_i)\nif a.to_f/b >= x.to_f/y\n\tna = b * x/y\n\tnb = na * y/x\nelse\n\tnb = a * y/x\n\tna = nb * x/y\nend\n\nprint(na, \" \", nb, \"\\n\")\n\n\n", "lang": "Ruby", "bug_code_uid": "83fbdf0c18523f7514d731e99f24287b", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "761fecacc4d3090527baf11920b5a744", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9134438305709024, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\n# encoding: utf-8\n\nary = gets.split.map(&:to_i).sort\nif ary[0] == 1 || (ary[0] == 2 && ary[1] == 2) || (ary[0] == 2 && ary[1] == 3 && ary[2] == 3) || (ary[0] == 2 && ary[1] == 4 && ary[2] == 4) || (ary[0] == 3 && ary[1] == 3 && ary[2] == 3)\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "01dc79dadf5333b6a7f0e859f48b6744", "src_uid": "df48af9f5e68cb6efc1214f7138accf9", "apr_id": "df16d6b43b047019a33fdef989c28500", "difficulty": 1400, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8205128205128205, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a=gets.split.map(&:to_i)\nif a.count(a.min)>=a.min\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "803e27768579234e5902392e1afe2582", "src_uid": "df48af9f5e68cb6efc1214f7138accf9", "apr_id": "e58b599da3100fbe84329f4cecf39e88", "difficulty": 1400, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.48739495798319327, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n, k = gets.split(\" \").map{|n| n.to_i }\na = gets.split(\" \").map{|n| n.to_i }\ncount = 0\nall_solved = true\na.each {|n|\n count += 1 if n <= k\n all_solved = false\n break\n}\nif all_solved\n puts count\nelse\n a.reverse.each {|n|\n count += 1 if n <= k\n break\n }\nend\n\n", "lang": "Ruby", "bug_code_uid": "154f38d24e9f1c9212f6a635934cf907", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "055c74385621ca571cc2642878060810", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9661482159194876, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def is_consonant(c)\n c =~ /[^aeiou]/\nend\n\ndef is_bertlanese(word)\n next_must_be_vowel = false\n\n word.chars.each do |c|\n\n return false if next_must_be_vowel && is_consonant(c)\n\n next_must_be_vowel =\n c != ?a &&\n c != ?e &&\n c != ?i &&\n c != ?o &&\n c != ?u &&\n c != ?n\n end\n\n !next_must_be_vowel\nend\n\ndef solution\n word = read_string\n puts is_bertlanese(word) ? \"YES\" : \"NO\"\nend\n\nsolution if __FILE__ == $0\n\ndef rest_int\n gets.to_i\nend\n\ndef read_ints\n gets.split.map &:to_i\nend\n\ndef read_string\n gets.chomp\nend\n", "lang": "Ruby", "bug_code_uid": "4a0bf4467de87b33e23ef7f12a24f375", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "9828a962eb35362b4c2822d19dea2930", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9045226130653267, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp.downcase\nputs (s =~ /[^aeioun][^aeiou]/ || s =~ /^[aeiou]/ || s=~ /[^aeioun]$/) ? \"NO\" : \"YES\"", "lang": "Ruby", "bug_code_uid": "bc569d679a437316db480053e35a0c07", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "1ab5dbb92d6f503672f8081d4f33e8d0", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9920564872021183, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\n\n\ndef isvowel(x)\n if x == 'a'||x=='e'||x=='i'||x=='o'||x=='u'\n return true\n end\n\nend\nname = gets().chomp()\nflag = 0\nfor i in 0...name.length\n\n #puts(name[i])\n\n if(i == name.length-1)\n\n if(name[i] == 'n')\n flag = 0\n elsif (isvowel(name[i]))\n flag = 0\n else\n flag = 1\n break\n end\n\n\n\n elsif(!isvowel(i))\n\n if(name[i] == 'n')\n flag = 0\n\n else\n if(!isvowel(name[i+1]))\n flag = 1\n break\n end\n\n end\n\n end\n\nend\n\nif(flag == 0)\n puts(\"YES\")\nelse\n puts(\"NO\")\nend", "lang": "Ruby", "bug_code_uid": "7acd07ea46c4220bda74f452e547b361", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "67033d5ed7fdf6dd7d0ca1daa8c3a717", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7854785478547854, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def run\n x, y, m = $stdin.gets.split.map(&:to_i)\n\n if x <= 0 and y <= 0 and m > 0\n puts \"-1\"\n else\n cnt = 0\n while [x, y].max < m\n x > y ? y += x : x += y\n cnt += 1\n end\n\n puts cnt\n end\nend\n\nrun if $0 == __FILE__\n", "lang": "Ruby", "bug_code_uid": "9ebbfff670dc1152cd2ca9194493a6cc", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "b7fa3fbfc547026431b10331eac9f564", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9411764705882353, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b, m = gets.split(' ').map {|i| i.to_i}\nans = 0\nwhile a < m && b < m do\n a, b = b, a if a > b\n if b <= 0 then\n ans = -1\n break\n end\n delta = (b - a + b - 1) / b\n ans += delta\n a += b * delta\nend\np ans\n", "lang": "Ruby", "bug_code_uid": "8c53a96c7b425300cbc78d7863230a7b", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "dcdd968884749ef8d8565bb8a52cb1a4", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9936305732484076, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\n\ndays = gets.split.map{|i| i.to_i}\n\nd = 1\ns = 0\nwhile s < n do\n s += days[d-1]\n d = d < 7 ? d + 1 : 1\nend\n\nd = d != 0 ? d - 1 : 7\n\nputs d", "lang": "Ruby", "bug_code_uid": "0c2070796d139473d98ca18c81669a2e", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "55c6b2dc526567e9695e74d83b88ba56", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8355387523629489, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "pages = STDIN.gets.chomp.to_i\nread = STDIN.gets.chomp.split(' ').map(&:to_i)\nwol = pages-1\n\nred = 0\nweek = 1\nwhile true\n read.each_with_index do |pa,i|\n red += pa\n if red >= pages\n p i+1\n exit\n end\n if red >= wol\n p i+1\n exit\n end\n end\n week += 1\nend\n", "lang": "Ruby", "bug_code_uid": "b9565dad09ff4312739531acf9bdb5b8", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "b7932396495d4828c1f85465e896b480", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8085714285714286, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "pages = gets\nreading_speed = gets\n\n#pages = \"20\"\n#reading_speed = \"5 3 7 2 1 6 4\"\n\npages = pages.to_i\nreading_speed = reading_speed.split(' ').map { |speed| speed.to_i }\n\nwhile pages > 0\n day = 0\n reading_speed.each do |speed|\n pages -= speed\n day += 1\n if pages < 0\n puts day\n break\n end\n end\nend", "lang": "Ruby", "bug_code_uid": "b47004195c521a3dcd24828edc7e92d7", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "00945dfe835eed4b16003caaedc053e5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9630606860158312, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#pages = gets\n#reading_speed = gets\n\n#pages = \"20\"\n#reading_speed = \"5 3 7 2 1 6 4\"\n#pages = \"100\"\n#reading_speed = \"15 20 20 15 10 30 45\"\n\npages = pages.to_i\nreading_speed = reading_speed.split(' ').map { |speed| speed.to_i }\n\nwhile pages > 0\n day = 0\n reading_speed.each do |speed|\n pages -= speed\n day += 1\n if pages <= 0\n break\n end\n end\nend\n\nputs day.to_i", "lang": "Ruby", "bug_code_uid": "8f2c76758c5ab6050b2d5b2e08430060", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "00945dfe835eed4b16003caaedc053e5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7247386759581882, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "A = [gets, gets, gets, gets]\ndef rr(t)\n t = t.chars.sort {|x,y| y <=> x}.join\n if (t[0] == t[1] and t[1] == t[2] and t[2] == t[3]) then return true end\n if t[0] != t[1] then return true end\n return false\nend\ndef solve()\n i, j = 0, 0\n while i != 3\n if rr(A[i][j] + A[i][j+1] + A[i+1][j] + A[i+1][j+1]) then return \"YES\" end\n j = j+1\n if j == 3 then i, j = i+1, 0 end\n end\n return \"NO\"\nend\nputs solve()\n", "lang": "Ruby", "bug_code_uid": "87d7ad93e93bc200070fcdda909cf6b2", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "2eeca3113f8fd2e8c53de3a61d8838ed", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9380530973451328, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "m = Array.new\n\n4.times do\n m << gets.chomp\nend\n\n3.times do |y|\n 3.times do |x|\n if (m[y][x] + m[y+1][x] + m[y][x+1] + m[y+1][x+1]).delete(\".\").length >= 3\n puts 'YES'\n exit 0\n end\n end\nend\n\nputs 'NO'\n", "lang": "Ruby", "bug_code_uid": "33497f2a8af1878f416b2ae4a8ba705e", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "52d7e307c828a180ccb3723e24b40271", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8571428571428571, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "a=[*$<]\nputs [0,1,2].product([0,1,2]).map{|x,y| [x,x+1].product([y,y+1]).count{|u,v| a[u][v]=='#'} }.max >= 3 ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "8b382fa3db3a32463c055ba43bee5b64", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "7ef34d95f38679825af5c5ecbcded168", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7751937984496124, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\nif n == 1; p 2; exit; end;\nif n == 3; p 1; exit; end;\nif n == 4; p 2; exit; end;\np rand(3) + 1\n", "lang": "Ruby", "bug_code_uid": "d7151f88cd09e4b797a52cf4b6761bf5", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "b0713e44fe88a93b7fecf550b7b27d0d", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9473684210526315, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = gets.to_i\narr = gets.chomp.split(\" \").map(&:to_i)\n\nnewarr = []\n\nprev = [-1]\n\narr.each do |x|\n if x != prev.max+1\n newarr.push prev\n prev = [x]\n else\n prev.push x\n end\nend\nnewarr.push prev\ncount = 0\n\nnewarr.each do |z|\n len = z.length\n next if len == 1\n\n if z.include?(1) or z.include?(1000)\n count += len-1\n else\n count += len-2\n end\nend\n\n#p newarr\nputs count\n", "lang": "Ruby", "bug_code_uid": "c2aa878f146e70478383802f71d3282c", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "810fe5ef1c022711c5d8cd3df46f7336", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9926289926289926, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\narr = gets.chomp.split(\" \").map(&:to_i)\n\nnewarr = []\n\nprev = [-1]\n\narr.each do |x|\n if x != prev.max+1\n newarr.push prev\n prev = [x]\n else\n prev.push x\n end\nend\nnewarr.push prev\ncountarr = [0]\n\nnewarr.each do |z|\n len = z.length\n next if len == 1\n\n if z.include?(1) or z.include?(1000)\n count.push len-1\n else\n count.push len-2\n end\nend\n\n#p newarr\nputs countarr.max\n", "lang": "Ruby", "bug_code_uid": "7f5f931e11ea716615ea23aa931368fd", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "810fe5ef1c022711c5d8cd3df46f7336", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9120198265179678, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def getmask(number)\n number_length = number.to_s.length\n i = 1\n result = ''\n while i <= number_length do\n digit = number % 10\n number = number / 10\n result << digit.to_s if [4,7].include?(digit)\n i+=1\n end\n \n result.reverse.to_i\nend\n\nnumber = gets.to_i + 1\nfunny_number = gets.to_i\nmask = -1\n\nwhile mask != funny_number do\n number += 1\n mask = getmask number\nend\n\nputs number", "lang": "Ruby", "bug_code_uid": "eaefab4fa62240c6265131de44ba30fe", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "b5fdc22959c5ff4b01f38a2281101a8f", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9778534923339012, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "class Integer\n\tdef lucky?\n\t\ts = self.to_s\n\t\ts.length == s.count(\"47\")\n\tend\n\tdef unmask\n\t\ts = self.to_s\n\t\ts.split('').select { |char| %w{4 7}.include? char }.join.to_i\n\tend\nend\n\na, b = gets.strip.split.map &:to_i\n\nif a == 1; print 7; exit; end\nn = a + 1\n\nuntil b == n.unmask; n += 1; end\n\np n\n", "lang": "Ruby", "bug_code_uid": "cda4d9584ef0c1fb76c9f7f140e12ac1", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "2fd12c21a09c76373989fda3e13bcbda", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6422018348623854, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#!/usr/bin/ruby\nn,m=gets.split.map(&:to_i)\nm%=n*(n+1)/2\n1.step(m){|i|\n\tif m= i\n m= m - i\n if i == n \n i = 1 \n else\n i = i + 1\n end\nend\n\np m ", "lang": "Ruby", "bug_code_uid": "15e8a11dd7de9908f8325b03681f001c", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "54bbbe874f7223e275dc7bd452d0aca9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.2935960591133005, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "$MAXN = 2222;\n$P = Integer(1e9 + 7);\n\n$f=[]; \n\ndef init()\n (0...$MAXN) .each {\n $f << Array.new($MAXN, 0 ) ;\n }\nend\n\ndef dp()\n (0...$MAXN).each { |i| \n (0..i).each{ |j|\n if ((i == 0) or (j == 0)) \n $f[i][j] = 1;\n else \n $f[i][j] = ($f[i-1][j] + $f[i-1][j-1]) % $P ;\n end\n }\n }\nend\n\ninit();\ndp();\n\nn, m, k = gets().split(\" \").map(&:to_i);\nprintf \"%d\\n\", ($f[n-1][2*k] * $f[m-1][2*k] )% $P;\n", "lang": "Ruby", "bug_code_uid": "9ba7b94b64cffc94af47d7c04875d6a0", "src_uid": "309d2d46086d526d160292717dfef308", "apr_id": "72fe6764f779ee184a9dab445f97b79b", "difficulty": 2000, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8662420382165605, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "n,a,b,p,q = gets.split.map{|a| Integer(a)}\ndiva = n/a\ndivb = n/b\ndivab = n/(a*b)\nputs [diva*p + (divb-divab)*q, divb*q + (diva-divab)*p].max", "lang": "Ruby", "bug_code_uid": "f9e9ca772e13052e3fc156283a0bfeb2", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "784af997fbec7da48d086304c2306568", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9887640449438202, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=gets().to_i\nline=gets().split(\" \")\nc100=0\nc200=0\nfor i in 0...line\n c100+=1 if line[i].to_i==100\n c200+=1 if line[i].to_i==200\nend\nif c100%2==0 and c100>=2 or c200%2==0 and c100%2==0\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "200a1f127b9eb8ab82aebf129faf828b", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "9be7303e4d7b68f19bb9e56c08c8da87", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9866666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = gets.split.map(&:to_i)\n\nx = 0\ny = 0\na.each { |z| z==200 ? x+=1 : y+=1 }\nx+=1 if x%2 && y>1\nx = x%2 + y%2\n\nputs x==0 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "a32f9c8448eb4416ff666440f811bc71", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "bfff076a56d0858bf94fece5730da49e", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9267461669505963, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\napp = gets.split.map(&:to_i)\nif n == 1\n\tprint \"NO\"\nelse\n\twt = Hash.new\n\tapp.each do |a|\n\t\twt[a] = (wt[a] || 0) + 1\n\tend\n\t\n\tif n % 2 != 0\n\t\tprint (wt[100] || 1) % 2 == 0 ? \"YES\" : \"NO\"\n\telse\n\t\ta100 = (wt[100] || 1) % 2 == 0\n\t\tprint a100 ? \"YES\" : \"NO\"\n\tend\nend", "lang": "Ruby", "bug_code_uid": "8015db8ab54faee6224c4edc83a45176", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "e0af38d52e0457d5e03f8dd30027a88a", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8571428571428571, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "k = gets.to_i\na = gets.split(\" \").map(&:to_i).sort {|x,y| y <=> x }\nsum, i = 0, 0\nwhile sum < k\n sum += a[i]\n i += 1\nend\nputs i", "lang": "Ruby", "bug_code_uid": "b8a361c67853980b7e9715ad67948dda", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "f41ed3203460fa59d28609d38fdd7195", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9948717948717949, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\ndef read_int; gets.chomp.to_i; end\ndef read_ints; gets.chomp.split.map(&:to_i); end\n\nk = read_int\na = read_ints\na.sort!.reverse!\n\nif k == 0 do\n puts 0\n exit\nend\n\ncount = 0\nsum = 0\n\na.each do |i|\n count += 1\n sum += i\n if k <= sum\n puts count\n exit\n end\nend\n\nputs -1\n", "lang": "Ruby", "bug_code_uid": "4999b95268f63565abb47ef1fe39bb7f", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "f933216266d777b566d7ed88e3578080", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.845360824742268, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "k, arr = gets.to_i, gets.split.map { |x| x.to_i }.sort\nm, sum = 0, 0\nwhile sum < k do\n sum += arr.pop\n m += 1\nend\nputs m\n", "lang": "Ruby", "bug_code_uid": "43e0fa6cd98c3a14c76f03376067aec9", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "dbd2ed897368d308e7b63ce48a533074", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2245430809399478, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "def mygcd(a, b)\n while a != 0\n a, b = b, a if a < b\n a = a % b\n end\n return b\nend\ndef mylcm(a, b)\n a * b / mygcd(a, b)\nend\nn = gets.chomp.to_i\nn\na = n-1 if n-1 >= 1\nb = n-2 if n-2 >= 1\nputs mylcm(mylcm(n, a), b)\n", "lang": "Ruby", "bug_code_uid": "c8b6385884f0312e8652a206fc940d1f", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "2b902e92b0d55543d34ce3c6ca1c96e0", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9559748427672956, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\nif n <= 2\n puts n\nelsif n % 6 == 0\n puts n * (n-1) * (n-4)\nelsif n % 2 == 0\n puts n * (n-1) * (n-3)\nelse\n puts n * (n-1) * (n-2)\nend\n", "lang": "Ruby", "bug_code_uid": "0cebf557e862c18ea67dd9a589698eea", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "2b902e92b0d55543d34ce3c6ca1c96e0", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5201238390092879, "equal_cnt": 29, "replace_cnt": 7, "delete_cnt": 14, "insert_cnt": 8, "fix_ops_cnt": 29, "bug_source_code": "n = gets().to_i\nres = case n\n when 1..2: n\n when 3: 6\n when n % 2 == 0 : ( n - 1 ) * ( n - 2 ) * ( n - 3 )\n else n * (n - 1) * (n - 2)\nend\n\nputs res", "lang": "Ruby", "bug_code_uid": "09d608fee6d7e9eb3a1d6c6bbed99aca", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "9239a2c9103d9a673f60d3646cdeed22", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6787330316742082, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env ruby\ngets;p gets.split.map(&:to_i).each_cons(3).map{|x,y,z|z-x}.min", "lang": "Ruby", "bug_code_uid": "b760ecbe23a426ff6cc3f59259212a44", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "6e13a739e1771a8dd70d1a5a1c610828", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2634730538922156, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\n\nk = false\n\nwhile (n > 0)\n if (n % 2 == 1) \n k = true\n end\n n /= 10\nend\n\nif (k) \n puts 1\nelse\n puts 0\nend", "lang": "Ruby", "bug_code_uid": "713bdc24374de7c438b7c90492aefe60", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "67b81e7207cd921d23a03512754e9f46", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9375, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "puts gets.to_i/2", "lang": "Ruby", "bug_code_uid": "e2bba68d986f56c7ea2c3997af7d7721", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "ebd92973634ecc55a35b82c37d0d7db4", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8732394366197183, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "puts gets[0].to_i.even? ? 0 : 1\n", "lang": "Ruby", "bug_code_uid": "949df7ae18c2481fc90497a0b2d30831", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "7943bce4fbc196a4f922fbe9e5c00b76", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8888888888888888, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\nn = gets.to_i \n\nif(n&1)\n puts 1 \nelse\n puts 0 \nend ", "lang": "Ruby", "bug_code_uid": "8067decab0be02d902871edccbd4c3ce", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "92b3386cf23d60579b9bddb685edde60", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9588235294117647, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#! ruby\n# Try Codeforces\n# author: Leonardone @ NEETSDKASU\n\nd1, d2, d3 = gets.chomp.split.map(&:to_i)\n\nputs [d1 * 2 + d2 * 2, d2 * 2 + d3 * 2, d3 * 2 + d1 * 2].min", "lang": "Ruby", "bug_code_uid": "1500ecea88d78ad067f2e5b73f9afa10", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "bd6e2f4153b15b4d452957a7d4a8b546", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7647058823529411, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a,b,c = gets.split.map(&:to_i)\nputs [a,b].min + [a + b,c].min + [a,b].max", "lang": "Ruby", "bug_code_uid": "d4e5c0b79561ae1483232bf80b4040de", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "64f57477f525ad2210c34bab2c642e47", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7990762124711316, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "class Array\n def r\n self.map { |q| q.to_i }\n end\nend\n\ndef read_line\n STDIN.gets.split(\" \")\nend\n\ndef read_to_array\n read_line.to_a\nend\n\ndef read_numbers_to_array\n read_to_array.r\nend\n\na, b, c = read_numbers_to_array\nif a * 2 + b * 2 < c\n puts a + a + b + b\nelse\n if b * 2 + c * 2 < a\n puts b + b + c + c\n else\n if c * 2 + a * 2 < b\n puts a + a + c + c\n else\n puts a + b + c\n end\n end\nend\n", "lang": "Ruby", "bug_code_uid": "8fc3487b93b0498e023f610ce0bbdf53", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "4022b186f870bcdc6f5f1d39d2ac081c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.875, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "d1, d2, d3 = gets.chomp.split(\" \").map(&:to_i)\nputs [2*(d1+d2), d1+d2+d3].min", "lang": "Ruby", "bug_code_uid": "cdca038622eff8d782a5cbef824b1c37", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "8e9053a0a157461c0d36c01ac69c5acc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8046511627906977, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a,b = gets.split(/\\s+/).map(&:to_i)\nmod = 1000000007\n\n maxa = b - 1\n\nans = 0\n if maxa > 0\n x1 = (b + 1 + b + maxa) * maxa / 2\n xn = (a*b + 1 + a*b + maxa) * maxa / 2\n ans = (x1 + xn) * a / 2\n end\n\np ans % mod\n", "lang": "Ruby", "bug_code_uid": "3cba54b6422e6772c49bf92eb70df233", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "6d97d445321a09a354ab889d1aa069cd", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.40372670807453415, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n, m = gets.split(' ').map &:to_i\nif n == 0\n puts m*3\nelsif m == 0\n puts n*2\nelse\n for i in 1...5e6\n if i%3 == 0 && m > 0\n m -= 1\n elsif i%2 == 0 && n > 0\n n -= 1\n end\n\n if n == 0 && m == 0\n puts i\n break\n end\n end\nend", "lang": "Ruby", "bug_code_uid": "8004e159ced334440cbed1c0a4b3d325", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "1f8ee66bd84f86629abb424a7771f58f", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9914529914529915, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,a=$<.read.split.map &:to_i\np [*a,2*a.reduce(:+)/n+1].max", "lang": "Ruby", "bug_code_uid": "13d92c8d7f9844f9fecf0d1bc62e9c3e", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "00485c3993da568e6a5aa9be5973dbce", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9955156950672646, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nas = gets.split.map(&:to_i)\n\nas_max = as.max\n\ne = as.inject(:+)\naw = as.map { |a| as_max - a }.inject(:+)\nans = -1\n(as_max..100).each do |a|\n if aw + (a-as_max)*n > e\n ans = a\n break\n end\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "fdf7cb871fc052fabe629c307306d84d", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "3259fe1a667d2afcb7ebb00b70ac0786", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9828571428571429, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = gets.split.map &:to_i\nf = a.inject { |s, x| s + x }\n(a.max..201).each do |k|\n s = a.inject { |s, x| s + k - x }\n if s > f\n puts k\n exit\n end\nend\n", "lang": "Ruby", "bug_code_uid": "1e41e83f22b8e95ef10582853c7e38fc", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "bb2a4c2f20bb3329b5350a9b3074a601", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8960817717206133, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# http://codeforces.com/problemset/problem/7/A\n\nrows = 0\ncols = 0\ncols_painted = false\n\nuntil (row = gets.chomp) == ''\n num_painted = row.count('B')\n if num_painted == 8\n rows += 1 \n else\n cols += num_painted unless cols_painted\n cols_painted = true\n end\nend\n\nputs rows + cols", "lang": "Ruby", "bug_code_uid": "de881f7c76d10ea9dbcb282c4a13cc0a", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "7a2ef411938ca13d8b70b2dbdf26d817", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.976271186440678, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "resl = 0\nresr = 0\n8.times do |i|\n line = gets.chomp\n if line =~ /^B+\\Z/\n resl += 1\n else\n line.size.times do |i|\n resr += 1 if line[i]==\"B\"[0]\n end\n end\nend\nputs resl\nputs resr\nprint resl+(resr/(8-resl))\n#\n#def fstlr mat\n# resl = 8\n# 8.times do |i|\n# 8.times do |j|\n# resl = if mat[i][j] == 0\n# end\n# end\n#end\n#\n#mat = Array.new(8)\n#fstl = true\n#fstr = true\n#8.times do |i| \n# mat[i]=Array.new(8)\n# line = gets\n# 8.times do |j|\n# if line[j] == \"B\"[0]\n# mat[i][j] = 1\n# else\n# mat[i][j] = 0\n# end\n# if i==0\n# fstl = false if mat[0][j] != 1\n# end\n# end\n# fstr = false if mat[i][0] != 1\n#end\n#res = 0\n#if fstl\n# res += 1\n#else \n# mat[0].each do |x|\n# res += 1 if x == 1\n# end\n# if fstr\n# else\n# mat.each_index do |i|\n# res += 1 if mat[i][0] == 1\n# end\n# print res\n# exit(0)\n# end\n#end\n# \n#end\n#while line = gets\n# lines << line.chomp\n#end\n#if lines[0] !~ /^BBBBBBBB\\Z/\n# lines[0].each do |c|\n# res += 1 if c==\"B\"[0]\n# end\n# \n#end\n", "lang": "Ruby", "bug_code_uid": "cc54a770950b2e7c04cc516353c8326d", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "b265d0075eb44b5debe6c4ff501e9475", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.984841075794621, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "resl = 0\nresr = 0\n8.times do |i|\n line = gets.chomp\n if line =~ /^B+\\Z/\n resl += 1\n else\n line.size.times do |i|\n resr += 1 if line[i]==\"B\"[0]\n end\n end\nend\nprint resl+(resr/(8-resl))\n#\n#def fstlr mat\n# resl = 8\n# 8.times do |i|\n# 8.times do |j|\n# resl = if mat[i][j] == 0\n# end\n# end\n#end\n#\n#mat = Array.new(8)\n#fstl = true\n#fstr = true\n#8.times do |i| \n# mat[i]=Array.new(8)\n# line = gets\n# 8.times do |j|\n# if line[j] == \"B\"[0]\n# mat[i][j] = 1\n# else\n# mat[i][j] = 0\n# end\n# if i==0\n# fstl = false if mat[0][j] != 1\n# end\n# end\n# fstr = false if mat[i][0] != 1\n#end\n#res = 0\n#if fstl\n# res += 1\n#else \n# mat[0].each do |x|\n# res += 1 if x == 1\n# end\n# if fstr\n# else\n# mat.each_index do |i|\n# res += 1 if mat[i][0] == 1\n# end\n# print res\n# exit(0)\n# end\n#end\n# \n#end\n#while line = gets\n# lines << line.chomp\n#end\n#if lines[0] !~ /^BBBBBBBB\\Z/\n# lines[0].each do |c|\n# res += 1 if c==\"B\"[0]\n# end\n# \n#end\n", "lang": "Ruby", "bug_code_uid": "3e79a2f0e9f6c072bc18cb8c7d48e4de", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "b265d0075eb44b5debe6c4ff501e9475", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8202137998056366, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/env ruby\n\nboard = Array.new\n\nli = 0\nARGF.each do |line|\n\tboard[li] = line.strip\n\tli += 1\nend\n\nstroke_count = 0\nfor li in 0..7 do\n\tstroke_needed = true\n\tfor ci in 0..7\n\t\tif board[li].to_s[ci] != 'B'\n\t\t\tstroke_needed = false\n\t\t\tbreak\n\t\tend\n\tend\n\tstroke_count += 1 if stroke_needed\nend\n\nfor ci in 0..7 do\n\tstroke_needed = true\n\tfor li in 0..7\n\t\tif board[li].to_s[ci] != 'B'\n\t\t\tstroke_needed = false\n\t\t\tbreak\n\t\tend\n\tend\n\tstroke_count += 1 if stroke_needed && stroke_count < 8\nend\n\nputs stroke_count", "lang": "Ruby", "bug_code_uid": "a0b833b522a51f0805c3a29868373fb0", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "3b7382313e3b0b5d3a3fadf29526d5ee", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9826086956521739, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,x,y=gets.split.map(&:to_i)\n\nn/=2\nif [n, n+1].include?(x) || [n, n+1].include?(y)\n\tputs \"NO\"\nelse\n\tputs \"YES\"\nend\n", "lang": "Ruby", "bug_code_uid": "3b78937a240eedc6fca4727558b9ddea", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "bd064e88a2ee3e4c2364d44131616b2b", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9727463312368972, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "input = $stdin.readline.split(' ')\nn = input[0].to_i; x=input[1].to_i; y=input[2].to_i\n\nif n%2==0 then\n center = (n/2)\n if x==center or x==center+1 or y==center or y==center+1 then puts \"NO\"\n else puts \"YES\" end\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "7400d093803b2249e950a36b8a339170", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "6df21c406d81728088daac59c3a7d776", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.961038961038961, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n, x, y = gets.strip.split.map &:to_i\nc /= 2\nprint (x == c || x == c + 1) && (y == c || y == c + 1) ? :NO : :YES", "lang": "Ruby", "bug_code_uid": "1d18e3e3af6c1d9500ea7d11e1e358b2", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "32b4bfc1c5d517f51c019aab91541261", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9868421052631579, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nr,h=gets.split.map(&:to_i)\nd=(h/r+0.5).to_i\np ((h/r+1-d)*1.154701).to_i+d*2", "lang": "Ruby", "bug_code_uid": "9ac0a3199e77a970291ed6aa2fc9f9c2", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "74eb7e91b6d66f9bb22b9512d91e0283", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9868421052631579, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nr,h=gets.split.map(&:to_d)\nd=(h/r+0.5).to_i\np ((h/r+1-d)*1.154701).to_i+d*2", "lang": "Ruby", "bug_code_uid": "7cac4df6997a4816122e180f69d5ae5b", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "74eb7e91b6d66f9bb22b9512d91e0283", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9052631578947369, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "p [:No, :Yes][gets.split.uniq.size == 1? 1:0]", "lang": "Ruby", "bug_code_uid": "c84dcd093ac5206c6b19341cdbc9b7a5", "src_uid": "65f81f621c228c09915adcb05256c634", "apr_id": "b0c2ea81e3e7255a923cd10ecf4ca293", "difficulty": 1600, "tags": ["geometry", "math", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8905109489051095, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "gets.strip.scan(/[47]/).size.to_s =~ /^[47]*$/ ? puts \"YES\" : puts \"NO\"", "lang": "Ruby", "bug_code_uid": "3081e811e430aad206ba8d36964ed12b", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "84bbd6ad7f041ea13852628126e88ce2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9863013698630136, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "s = gets.chomp.to_s.split(//)\n\ncounter = 0\ns.each do |x| \n if x == \"4\" || x == \"7\" \n counter+=1\n end\nend\nif counter == \"7\" || counter == \"4\"\n puts \"YES\"\nelse \n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "1688435ca2156539b7426aebc7e71755", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "1de7f37ef7e02126dd2ba5cf251e13e8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9565217391304348, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "s = gets.chomp\n\nans = 0\nve = %w(a i u e o 0 2 4 6 8)\ns.each_char do |c|\n ans += 1 if ve.include?(c)\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "c3c2a0a3832cbb44c31e7443efdb6685", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "58626844deded4f67be2adcfdff605e9", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8682170542635659, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s=gets;s=[0,2,4,3,1].map{|e|s[e]}*'';p (s.to_i**5)%100000", "lang": "Ruby", "bug_code_uid": "35838cf757a46a2f488fbf13671323d6", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "061dadc74387952810514edb5076396f", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.825938566552901, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "puts 'Enter number'\ncode = gets.chomp\nreturn unless code.length == 5\ncode = (code[0] + code[2] + code[4] + code[3] + code[1])\nputs (code.to_i ** 5).to_s.chars.last(5).join\n", "lang": "Ruby", "bug_code_uid": "ce1612937b81f76c7e19ee4bd28fdc25", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "62a03cce9711013b17c9359d0f0d448d", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6152849740932642, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#!/usr/bin/env ruby\n\ndef pow(n)\n n*n\nend\n\nclass Circle\n attr_accessor :x, :y, :r\n def initialize(x, y, r)\n @x = x\n @y = y\n @r = r\n end\n\n def include?(other)\n pow(@x-other.x) + pow(@y-other.y) <= pow(@r-other.r)\n end\n\n def collide?(other)\n (not include?(other)) and pow(@x-other.x) + pow(@y-other.y) < pow(@r+other.r)\n end\nend\n\ncircles = []\n2.times do\n x, y, r1, r2 = gets.split.map(&:to_i)\n circles << Circle.new(x, y, r1)\n circles << Circle.new(x, y, r2)\nend\n\ncnt = 0\ncircles.each_with_index do |c1, i|\n valid = true\n circles.each_with_index do |c2, j|\n next if i == j\n if c1.collide?(c2)\n valid = false\n break\n end\n end\n cnt += 1 if valid\nend\n\np cnt\n", "lang": "Ruby", "bug_code_uid": "ecc211b5a7c786d668e14e7307c092e2", "src_uid": "4c2865e4742a29460ca64860740b84f4", "apr_id": "3baf0074310ec058ec30ee14981f5683", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7512886597938144, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/ruby\n\nx, y, small_r, big_r = STDIN.readline.split.map {|s| s.to_i }\na, b = [x, y, big_r], [x, y, small_r]\nx, y, small_r, big_r = STDIN.readline.split.map {|s| s.to_i }\nc, d = [x, y, big_r], [x, y, small_r]\n\ndef intersects(a, b)\n\tx0, y0, r0 = a\n\tx1, y1, r1 = b\n\treturn false if includes(a, b) or includes(b, a)\n\tdd = (x1-x0)**2 + (y1-y0)**2\n\tdd < (r0 + r1)**2\nend\n\ndef includes(a, b)\n\tx0, y0, r0 = a\n\tx1, y1, r1 = b\n\treturn false if r1 >= r0\n\tdd = (x1-x0)**2 + (y1-y0)**2\n\tdd <= (r1 - r0)**2\nend\n\ncount = 0\n[a, b].each do |x|\n\tnext if intersects(x, c) or intersects(x, d)\n\tnext if includes(c, x) and includes(x, d)\n\tcount += 1\nend\n[c, d].each do |x|\n\tnext if intersects(x, a) or intersects(x, b)\n\tnext if includes(a, x) and includes(x, b)\n\tcount += 1\nend\nputs count\n", "lang": "Ruby", "bug_code_uid": "4d2d063b43c14ced929fbc95238ef823", "src_uid": "4c2865e4742a29460ca64860740b84f4", "apr_id": "d7db2ddacb355985c197f72992cff963", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9761467889908257, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a,b,c,d=gets.split.map &:to_i\ne,f,g,h=gets.split.map &:to_i\n$dd=Math.sqrt((a-e)**2+(b-f)**2)\ndef pf(r,r1,r2)\n return 1 if r1+r<=$dd&&(r2+r)**2<=$dd\n return 1 if r1-r>=$dd&&r2-r>=$dd\n return 1 if r-r1>=$dd&&r-r2>=$dd\n return 0\nend\np pf(c,g,h)+pf(d,g,h)+pf(g,c,d)+pf(h,c,d)", "lang": "Ruby", "bug_code_uid": "f5a04f0ec35a6f92c24dad77d680eb9e", "src_uid": "4c2865e4742a29460ca64860740b84f4", "apr_id": "417cb6a7c2aeb47bfd85a6e8a0c30714", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9928507596067918, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def solution(n1, n2, k1, k2, flag)\n return 1 if n1 == 0 && n2 == 0\n\n return 0 if n1 == 0 && flag\n return 0 if n2 == 0 && !flag\n\n if flag\n return @beging_with_soldiers[n1][n2] if @beging_with_soldiers[n1][n2]\n else\n return @beging_with_horses[n1][n2] if @beging_with_horses[n1][n2]\n end\n\n k = 1\n possibilities = 0\n if flag\n while k <= k1 && n1 - k >= 0 do\n possibilities += solution(n1-k, n2, k1, k2, !flag)\n k += 1\n end\n else\n while k <= k2 && n2 - k >= 0 do\n possibilities += solution(n1, n2-k, k1, k2, !flag)\n k += 1\n end\n end\n\n possibilities = possibilities % 100000000\n if flag\n @beging_with_soldiers[n1][n2] = possibilities\n else\n @beging_with_horses[n1][n2] = possibilities\n end\n possibilities\nend\n\nn1, n2, k1, k2 = gets.strip().split().map(&:to_i)\n\nmax_n = [n1, n2].max + 1\n@beging_with_soldiers = Array.new(max_n) { Array.new(max_n) { false } }\n@beging_with_horses = Array.new(max_n) { Array.new(max_n) { false } }\n\nsolution(n1, n2, k1, k2, true)\nsolution(n1, n2, k1, k2, false)\nputs @beging_with_soldiers[n1][n2] + @beging_with_horses[n1][n2]\n", "lang": "Ruby", "bug_code_uid": "464d8ffa8869960499dba6ee1c07f42b", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "7f7c5c156f32f8392a99beb71bff4c3f", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9607843137254902, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,a=gets.split.map &:to_i;p [(n+~-a)/2,-~a/2][a%2]", "lang": "Ruby", "bug_code_uid": "e4d42067a290f688a28a3c1d77fa1e43", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "bc920dfa21260ef41835de408ba03775", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9565217391304348, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, b = gets.split\nputs a.to_i + b.inverse.to_i", "lang": "Ruby", "bug_code_uid": "33046ceae40900a771cb5c1f8dc6f671", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "7bfee04a347c1a63fbadb573204021d9", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6585365853658537, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "print gets.to_i + gets.reverse.to_i", "lang": "Ruby", "bug_code_uid": "8ce7772fd994d89a389e3063cd4edda8", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "eeb7781af0aef33eaf78bb33f4e3acd7", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3821958456973294, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "require 'prime'\n\n# TEMPLATE BEGIN\ndef read_vector\n gets.chomp.split(/\\s+/)\nend\ndef read_vector_int\n read_vector.map(&:to_i)\nend\n# TEMPLATE END\n\nn = gets.to_i\nval = 2\nwhile n > 0 do\n val += 1\n next unless val.prime?\n rev = val.to_s.reverse.to_i\n next if rev == val\n next unless rev.prime?\n n -= 1\nend\nputs val\n", "lang": "Ruby", "bug_code_uid": "331f0847f14cd66fe7f4a484a4802d21", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "6454acd709ae1f9313d6b5d96e8c4bc6", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4797219003476246, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "def prime x\n return false if x==1\n i=2\n while (i*i<=x)\n return false if x%i==0\n i+=1\n end\n true\nend\n\nn=gets.to_i\n1.upto(100) do |x|\n y = x.to_s.reverse.to_i\n if x != y && prime(x) && prime(y) \n n-=1\n if n==0\n p x\n break\n end\n end\nend", "lang": "Ruby", "bug_code_uid": "415d98e4ce43cd5b27f8ffd07e3aac66", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "bd5907ba3deb41fa1e0482c172ef760b", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "def prime x\n return false if x==1\n i=2\n while (i*i<=x)\n return false if x%i==0\n i+=1\n end\n true\nend\n\nn=gets.to_i\nst = 1\nif (n>8000) \n n -= 8000\n st = 758672\nelsif (n>5000) \n n -= 5000\n st = 328814\nend\nst.upto(10000000) do |x|\n if prime x \n y = x.to_s.reverse.to_i\n if x != y && prime(y) \n n-=1\n if n==0\n p x\n break\n end\n end\n end\nend", "lang": "Ruby", "bug_code_uid": "988f48065cf44021a12a3e11968f11e1", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "bd5907ba3deb41fa1e0482c172ef760b", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7469287469287469, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "a=Array.new(gets.split.map(&:to_i))\nb=Array.new(gets.split.map(&:to_i))\nn=gets.to_i\n\nfloat n1, n2\n\nn1=(a[0]+a[1]+a[2])/5\nn2=(b[0]+b[1]+b[2])/10\n\nif(n1.ceil+n2.ceil<=n)\n puts \"YES\"\nelse\n puts \"NO\"", "lang": "Ruby", "bug_code_uid": "8749217f548b22ecc337ac8acc0f028c", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "dbcf67661bde6ac8e882ad794a22ce05", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7572815533980582, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "a=Array.new(gets.split.map(&:to_i))\nb=Array.new(gets.split.map(&:to_i))\nn=gets.to_i\n\nfloat n1, n2\n\nn1=(a[0]+a[1]+a[2])/5\nn2=(b[0]+b[1]+b[2])/10\n\nif(n1.ceil+n2.ceil<=n)\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "409235e57d40d5848cb6649b6bfd048c", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "dbcf67661bde6ac8e882ad794a22ce05", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7572815533980582, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "a=Array.new(gets.split.map(&:to_i))\nb=Array.new(gets.split.map(&:to_i))\nn=gets.to_i\n\nn1,n2=Float(0)\nn1=(a[0]+a[1]+a[2])/5\nn2=(b[0]+b[1]+b[2])/10\n\nif(n1.ceil+n2.ceil<=n)\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "e8766d0da14fba703287fc70a64e37ec", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "dbcf67661bde6ac8e882ad794a22ce05", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7840735068912711, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "x = Integer gets.to_s\n\nd = 1000000\nif x < d then\n\tx = 2**(x-1) * (1+2**x)\n\tputs x\n\texit\nend\n\nx -= 1\np = 1\nq = 2**d % 1000000007\nwhile x >= d\n\te = d\nwhile x >= e do\n\tp *= q\n\tp = p % 1000000007\n\tx -= e\n\te *= 10\nend\nend\n\np *= 2**x\np = p % 1000000007\n\np = (p * ( 1 + 2*p)) % 1000000007\n\nputs p\n", "lang": "Ruby", "bug_code_uid": "db6ce3c8a2d0e46258db79a8c9f4e8ee", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "1f76b71ffde275e3efd99a24219924a3", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9032258064516129, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "\ndef pow(a,k)\n n = 1000000007\n b = 1\n while (k!= 0) do\n if (k % 2 == 0 ) then\n k/=2\n a = (a*a) % n\n else\n k-=1\n b = (b*a) % n\n end\n end\n return b\nend\n\n\nn = gets.to_i\nif (n == 0) then\n puts \"1\"\nelse\n ans = (pow(4,n)/2 + pow(2,n-1)) % 1000000007\n puts ans\nend\n", "lang": "Ruby", "bug_code_uid": "b3836adf465b5b9ab83bb3a402b2a94d", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "564c9e17cbaa275f1f97c68d3bb247a3", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9056603773584906, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a = gets.split.map(&:to_i)\np [a.min, 3].max.times.map{|i|\n a.map{|j| (j - i) / 3}.inject(i, &:+)\n}.max\n", "lang": "Ruby", "bug_code_uid": "be026b764bab5d16664eb6a2b1d5ebe8", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "9dfa06cb7f5d578d92886ab45a8ab820", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9925093632958801, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def main()\n\trbg=gets.chomp.split(\" \")\n\tr=rbg[0].to_i\n\tb=rbg[1].to_i\n\tg=rbg[2].to_i\n\trbgarra=[r,b,g]\n\tmin=rbgarra.min();\n\tans=(r+b+g)/3;\n\tif (r-min)%3+(b-min)%3+(g-min)%3==3\n\t\tans-=1\n\tend\n\tif (r-min)%3+(b-min)%3+(g-min)%3==4 && t==0\n\t\tans-=1\n\tend\n\tputs ans\nend\nmain()", "lang": "Ruby", "bug_code_uid": "4ce015f185a94475e89e44ca833ff7f9", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "db48ad068087cb05c79d41684cce4ba8", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9824046920821115, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "while(1)\n r,g,b = STDIN.readline.split.map(&:to_i)\n val0 = r/3 + b/3 + g/3\n if r > 0 and g > 0 and b > 0\n val1 = (r-1)/3 + (b-1)/3 + (g-1)/3 + 1\n else \n val1 = 0\n end\n\n\n if r > 1 and g > 1 and b > 1\n val2 = (r-2)/3 + (b-2)/3 + (g-2)/3 +2\n else \n val2 = 0\n end\n\n puts [val0,val1,val2].max\n\nend", "lang": "Ruby", "bug_code_uid": "19568af48297bfea526c5a53d2162eba", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "005df66b2b4cdba154059e36e39180eb", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.09840255591054313, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "#!/usr/bin/ruby\nmatches_count = gets.chomp.to_i\n\nfor\ti in 1..matches_count\n\tplayers_count = gets.chomp.to_i\n\tplayers_heights = gets.chomp.split(\" \").map { |x| x.to_i }\n\n\tdifferences_sum = 0\n\tdifferences_count = 0\n\tplayers_heights.each_with_index do |height1, index1|\n\n\t\tplayers_heights.each_with_index do |height2, index2|\n\t\t\tif (index2 <= index1)\n\t\t\t\tputs \"Idx1 #{index1} vs Index2 #{index2}\"\n\t\t\t\tnext\n\t\t\telse\t\n\t\t\t\tputs \"Incrementing differences_count : #{differences_count}\"\n\t\t\t\tdifferences_count+=1\n\t\t\t\tdifferences_sum += (height2 - height1).abs\n\t\t end\n\t\tend\n\t\t\n\tend\n\n\tputs differences_sum / players_heights.length\n\n\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "c0a527da76dc438c46e36e8c12929e24", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "910b47028a0212892f6f311d9128afe1", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.702928870292887, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "input = gets.chomp\n\ndef lucky_number(str)\n\tif str.index(/[^47]/)== nil\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend\n\nif lucky_number(input.length.to_s)\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "44c1348c8235aeb5a9b8f60181e46678", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "81d39e072fa94c70cd8dad1de8fc2a6d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9425742574257425, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/env ruby\n\n\nng = 0\nok = 0\nSTDIN.gets.chomp.each_byte do |i|\n n = format(\"%c\",i)\n if n != \"4\" and n != \"7\"\n ng += 1\n else\n ok += 1\n end\nend\n\nif (ok == 4 or ok == 7 or ng == 0) and ok > 0\n ptus \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "27a85d324ec25818819a3c6f5494880a", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "9c08e35251fac684e933482c8ac3556b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9940119760479041, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets.strip\nif !s.include?( '/' )\n\ts += \"/a\"\nend\nputs /^\\w{1,16}@\\w{1,16}(\\.\\w{1,16})*\\/\\w{1,16}$/ =~ s && s.index( \"/\" ) - s.index( \"@\" ) + 1 <= 32 ? \"YES\" : \"NO\"\n", "lang": "Ruby", "bug_code_uid": "05c3b4ae80f3f7800de544b0cb3ccca1", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "ad650a71d3dcb21e92f7b821a7626b89", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "m, d=gets.split.map &:to_i\nk=1\nc=1\na=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m-1]\nwhile k 0\n return 5\nend\nm, d = gets.strip.split(\" \").map(&:to_i)\nputs solve(m, d)\n", "lang": "Ruby", "bug_code_uid": "353887d1c5088b572e993dfd5310855b", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "3fb2d7deefb3393b05ce6cf0b2f94bdd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9831932773109243, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "ml = [31,28,31,30,31,30,31,31,30,31,30,31]\nm,d = gets.split.map &:to_i\nm -= 1\nd -= 1\nputs (d + ml[m] - 1) / 7 - d / 7", "lang": "Ruby", "bug_code_uid": "553c09a3d35819c4b601103ec8fde72e", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "43468710ed393daf524e241f75bfc3b5", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4335981838819523, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "a = gets.split('')\nb = gets.split('')\nai=0\nfor i in 0...a.size\n\tif (a[i] == '+')\n\t\tai++\n\telsif (a[i] == '-')\n\t\tai--\n\tend\nend\nbi=[]\nbi[0]=0\nfor i in b\n\tif i =='+'\n\t\tfor j in 0...bi.size\n\t\t\tbi[j]++\n\t\tend\n\telsif i == '-' \n\t\tfor j in 0 ... bi.size\n\t\t\tbi[j]--\n\t\tend\n\telsif i == '?'\n\t\tv = bi.size\n\t\tfor j in 0...v\n\t\t\tbi[j]++\n\t\t\tbi << (bi[j]-2)\n\t\tend\n\tend\nend\ncount = 0.0\nfor i in bi\n\tcount++ if i == ai\nend\ncount /=bi.size\nprintf(\"%.9f\", count)\n\n", "lang": "Ruby", "bug_code_uid": "2d7a03014e3304e2ac165647123e06ec", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "6199f9d12a73974fd231ff98f041db35", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.45776173285198557, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "def solution(s1, s2)\n x = s1.count(\"+\") - s1.count(\"-\") \n @memo = Array.new(10) { Array.new(20) }\n \n def solve(s2, pos, i, x)\n return 0 if i < 0 || i > 9\n\n if @memo[i][pos+10]\n return @memo[i][pos+10] \n end\n \n if s2.size == i \n return 0 if pos != x\n return 1\n end\n\n if s2[i] == \"?\"\n @memo[i][pos+10] = solve(s2, pos+1, i+1, x) + solve(s2, pos-1, i+1, x)\n return @memo[i][pos+10] \n end\n \n @memo[i][pos+10] = solve(s2, pos+( s2[i] == \"+\" ? 1 : -1), i+1, x)\n @memo[i][pos+10]\n end\n\n if s2.count(\"?\") == 0\n return Float(solve(s2, 0, 0, x))\n else\n return solve(s2, 0, 0, x) / Float(s2.count(\"?\")**2)\n end\nend\n\ns1 = gets.strip\ns2 = gets.strip\nputs solution(s1, s2)\n\n", "lang": "Ruby", "bug_code_uid": "624b21ab8e588fe77b8260431b94240e", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "bb11b2ae4659215f5047b1ef6a2e5336", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9964788732394366, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s1 = gets.chomp\ns2 = gets.chomp\n\nn = (s1.count('+') - s1.count('-') - (s2.count('+') - s2.count('-'))).abs\nm = s2.count('?')\n\nif (n - m).odd? or n > m\n\tputs 0\nelse\n\tm = (m - n) / 2\n\tans = Math.gamma(m + 1) / Math.gamma(n + 1) / Math.gamma(m - n + 1) / (2 ** m)\n\tputs '%.12f' % ans\nend", "lang": "Ruby", "bug_code_uid": "1ad62790777dbc96af481b74c828687f", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "a91987712f50f13ae36537dc1764e98c", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.0695970695970696, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split.map(&:to_i)\no = gets.split\nmin = 100 ** 10000\na.permutation(a.size) do |x|\n o.permutation(o.size) do |y|\n u = x[0].send(y[0], x[1]).send(y[1], x[2]).send(y[2], x[3])\n if u < min\n min = u\n end\n end\nend\n\nputs min", "lang": "Ruby", "bug_code_uid": "da314a650869d7fcd225980e58f69f84", "src_uid": "7a66fae63d9b27e444d84447012e484c", "apr_id": "f80c086144fbdc0444d07d27f590df76", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9411764705882353, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "k,n,s,q=gets.split.map &:to_i\np((n+~-s)/(s*k+~-q)/q)", "lang": "Ruby", "bug_code_uid": "e751f586ea2472880b8dd6f3cf8c8ce4", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "52aaa92fad0c63b7dae6aa53ab1cf9ae", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9702970297029703, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s=gets.chomp\nt=s.reverse\nn=s.size.count{|i|s[i]!=t[i]}\nputs n==2||(n==0&&s.size%2==1) ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "3f7c261b029deab13e8b54387a8ea11d", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "e02750d3e4ea30c125f5a6ef8f964187", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8176991150442477, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#http://codeforces.com/problemset/problem/798/A\n\nstr = gets.chomp! \n\nstr_rev = str.reverse \n\ndifference = 0 \n\nind = 0 \n\nstr.size.times do \n if str[ind]!= str_rev[ind]\n difference +=1 \n end \n ind +=1 \nend \n\n\nputs difference <=2 ? \"YES\" : \"NO\"\n", "lang": "Ruby", "bug_code_uid": "15e286b72af566f2ca5900e6e3126a9e", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "8e8cffb010ca3d3d79fb1bf15482da73", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9129129129129129, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "s=gets.chomp.chars\nr=s.reverse\n\nc=0\nwhile !s.empty?\n\tif s[0]!=r[0] then\n\t\tc+=1\n\tend\n\ts.shift\n\tr.shift\nend\nif c==2 then\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "a00b9e5997abbe230e13bb65dab030a8", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "7b6418e73bed489e14c7411efc88f816", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9017632241813602, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "# coding: utf-8\n\ns = gets.chomp\nl = s.length\nr = s.reverse\ndiff = 0\nfor i in 0...l\n if s[i] != r[i]\n diff += 1\n end\nend\n\nif diff <= 2\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "5a9ba0c8eec1b10682b5630ec74c0601", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "13d91443a4cd5065481349afb2fa85d9", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5863192182410424, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "n=gets.to_i.abs\ni=1\nk=0\nwhile k x && i % 2 != 0)\n puts i\n break;\n end\n i += 1\nend\n \n", "lang": "Ruby", "bug_code_uid": "2c2df1336ed197a7c2800a5165905eb1", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "953f8f22cc0235d5500dc1c706dc0946", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9256198347107438, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x=gets.to_i;i=j=0;while j0:j+=i+=1 end;puts i", "lang": "Ruby", "bug_code_uid": "9fdbc016a56093bb89af7dd68e7164f4", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "02841df08c060a9aee895668b4c1eba6", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.967741935483871, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x=gets.to_i;i=j=0;while j0 do j+=i+=1 end;puts i", "lang": "Ruby", "bug_code_uid": "a9d3ec746c7582fdb54bf571b0be291d", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "02841df08c060a9aee895668b4c1eba6", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9603960396039604, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "N, X, Y = $stdin.gets.split.map(&:to_i)\n\n$sep = Y / X\n\n# n = N\n# result = 0\n\ndef getResult(n)\n # temp = n>>1 * X < Y\n return X if n == 1\n if (n>>1) <= $sep\n return n * X\n end\n result = 0\n if n & 1 == 1\n minus = getResult(n-1)\n plus = getResult(n+1)\n result = X + minus < plus ? minus : plus\n else\n result = Y + getResult(n>>1)\n end\n result\nend\n\n\n\nputs getResult(N)", "lang": "Ruby", "bug_code_uid": "811f5b3832e71a3b19074f85da4e475a", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "cc0fcc07f14cf74215d51cfd8a5780be", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4534412955465587, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "word = raw_input()\nprint (word[0].swapcase() + word[1:].lower()) if (word[1:] == \"\" or word[1:].isupper()) else word\n", "lang": "Ruby", "bug_code_uid": "e05febfd7d086d9eb0cf68f0e2f39a33", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "f163e3ddc095013dcf5861e828851efe", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2857142857142857, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "str = gets\nputs str.downcase.camelcase", "lang": "Ruby", "bug_code_uid": "50fa4d554d6e872283bd27e5f2892425", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "c6cbf318d2d18eddde9d7bc9dee6d0d6", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9922879177377892, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def Flood(s)\n\n f = reverse.chop.reverse\n \n if (s[0] ==s[0].downcase) && f == f.upcase\n s = s.downcase.capitalize\n elsif s == s.upcase \n s.downcase!\n end\n \n puts s\n \n end\n\nFlood(gets)", "lang": "Ruby", "bug_code_uid": "cff2127ed3f7d457244a9ad144d24417", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "208e72aa8a030a81ecd2722c806ea043", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9876543209876543, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts gets[/^.[A-Z]*$] ? $_.swapcase : $_", "lang": "Ruby", "bug_code_uid": "f86aa27df42cbfa4a5a36393a5b81a59", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "381913f060335e0206a700163356f097", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9973190348525469, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#! ruby\n# Try Codeforces\n# author: Leonardone @ NEETSDKASU\n############################################################\ndef gs() gets.chomp end\ndef gi() gets.to_i end\ndef gss() gs.split end\ndef gis() gss.map(&:to_i) end\ndef nmapf(n,f) n.times.map{ __send__ f } end\ndef ngs(n) nmapf n,:gs end\ndef ngi(n) nmapf n,:gi end\ndef ngss(n) nmapf n,:gss end\ndef ngis(n) nmapf n,:gis end\ndef arr2d(h,w,v=0) h.times.map{[v] * w} end\ndef for2p(hr,wr,&pr) hr.each{|i|wr.each{|j| yield(i,j)}} end\ndef nsum(n) n * (n + 1) / 2 end\ndef vcount(d,r=Hash.new(0)) d.inject(r){|r,e| r[e]+=1;r} end\n############################################################\n\na, b = gis\n\nans = a.gcd(b)\n\na.succ.upto(b) do |x|\n break if x == 1\n ans = ans.gcd(x)\nend\n\nputs ans\n\n\n\n", "lang": "Ruby", "bug_code_uid": "b9c2f96113d316b1153707db1671536e", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "c3b4206ee381c7e696e2b4168fe2f2ee", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9779559118236473, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "_a = gets.split.map { |e| e.to_i }\n\ndef Gcd(a, b)\n while(b != 0)\n r = b\n b = a % b\n a = r\n end\n return a\nend\n\nanswer = _a[0]\n\n(_a[0]+1..._a[1]).each do |i|\n temp = Gcd(i, answer)\n if temp == 1\n answer = 1\n end\nend\n\nputs answer\n", "lang": "Ruby", "bug_code_uid": "048169a538087debc0e69215597cf58f", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "03bf62692a5850afb2bd315f519c1901", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6724890829694323, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "a = 0\nb = 0\n\na = STDIN.gets.chomp.to_i\nb = STDIN.gets.chomp.to_i\n\ndef findGCD(first, second)\n\tif second == 0 \n\t\treturn first\n\telse\n\t\tfindGCD(second, first % second)\n\tend\n\t\t\n\t#return ? first : findGCD(second, first % second)\nend\n\nputs findGCD(a, b)\n", "lang": "Ruby", "bug_code_uid": "bcbbbafd8685a7c4c44122fb4579745c", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "650bd8ec129855a38151ede1d0fb73e4", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.64, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "def gcd(a,b)\n\treturn b>0 ? gcd(b,a%b) : a\nend\n\nbuf=gets.split(' ')\na,b=buf[0].to_i, buf[1].to_i\nputs gcd(a,b)", "lang": "Ruby", "bug_code_uid": "204fb70d0c6fcfc04e4899073eb93ac2", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "e0fe88e62e6e5fa9e7d2bae0e113669c", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9555555555555556, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "x,h,m=$<.read.split.map &:to_i\nm+=h*60\nwhile !\"#{m/60}#{m%60}\"=~/7/\n\tm+=x\n\ti+=1\nend\np i", "lang": "Ruby", "bug_code_uid": "a02ab400f53e9055e9ff5ec647f7de7c", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "11baba3dde945cd9939fe75f4e56f2d1", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7585301837270341, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "# coding: utf-8\n\nx, y, z = gets.split.map(&:to_i)\n# x -> andrew: only green\n# y -> dmitry: green and purple\n# z -> michal: any type is good\na, b, c = gets.split.map(&:to_i)\n# a -> green\n# b -> purple\n# c -> black\n# happy YES unhappy NO\n\na -= x\nbc = b + c - y\n\nif a >= 0 && (a + bc) >= z\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "d9d8cdbd05a16509bf2be7794b7e0fbf", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "5c3770d906df5d0c019889685c5afc3a", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9407407407407408, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "x, y, x = gets.split.map(&:to_i)\na, b, c = gets.split.map(&:to_i)\n\nputs a >= x && a + b - x >= y && a + b + c - x - y >= z ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "923011093d0a538ecacbc2585616c754", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "c3bd33c9ce6caaa263b4db8a56325c9c", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9931972789115646, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def solve(x,y,z,a,b,c)\n return 1 if (x >= a)\n return 1 if (x+y >= a+b)\n return 1 if (x+y+z >= a+b+c)\n return 0\nend\n\nx,y,z = gets.split.map(&:to_i)\na,b,c = gets.split.map(&:to_i)\n\nputs ['YES', 'NO'][solve(x,y,z,a,b,c)]\n", "lang": "Ruby", "bug_code_uid": "00736516244383491a5be6cdf580f457", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "5b24c8b8faeee8de18227976dcdde33d", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9473684210526315, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# 1114 A\ndef solve(x, y, z, a, b, c)\n\tif (x > a || x + y > a + b)\n\t\treturn 1\n\telse\n\t\treturn 0\n\tend\nend\n\nx, y, z = gets.split.map(&:to_i)\na, b, c = gets.split.map(&:to_i)\n\nans = solve(x, y, z, a, b, c)\nputs ['YES', 'NO'][ans]\n", "lang": "Ruby", "bug_code_uid": "73d0a0f6389229ee88d6b60cfaf01bd0", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "5b24c8b8faeee8de18227976dcdde33d", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5393258426966292, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "a, b = gets.split.map(&:to_i)\np [(a + 2) / 3 * b, (b + 2) / 3 * a].max\n", "lang": "Ruby", "bug_code_uid": "a3d52aa918ac45fa390e65c63ede72d3", "src_uid": "e858e7f22d91aaadd7a48a174d7b2dc9", "apr_id": "a48ea75004f92ae480453916dda32072", "difficulty": 1800, "tags": ["greedy", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4078091106290672, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x, t, a, b, da, db = gets.split.map(&:to_i)\n(0..t).each do |i|\n (0..t).each do |j|\n z1 = a - i*da\n z2 = b - j*db\n if z1+z2 == x or z2 == x or z1 == x\n puts :YES\n exit\n end\n end\nend\nputs :NO", "lang": "Ruby", "bug_code_uid": "7fa7dd1bd7a35e87e17cfe9f3b45c363", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "7f3295266d7d8c2e48e8c2ea53bb59b7", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7051282051282052, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=gets.chomp.split(\" \")\nt=0\n0.upto(6) {|i| a[i]=a[i].to_i }\n0.upto(a[1]-1) do |i|\n0.upto(a[1]-1) do |j|\nnum=a[2]+a[3]-a[4]*i-a[5]*j\nif num==a[0]\nt=1\nbreak\nend\nend\nbreak if t==1\nend\nif t==1\nputs \"YES\"\nelse\nputs \"NO\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "0dfefbb9a35985096e45cc7795f0c224", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "e0568f2c20818c642c5c8e3f99c5779e", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9952153110047847, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "x,t,a,b,da,db=gets.split.map(&:to_i);\ntag=0;\nfor i in 0..t\n\tfor j in 0..t\n\t\tif a-i*da+b-j*db==x or a-i*da==x or b-j*db==x or x==0\n\t\t\ttag=1;\n\t\t\tbreak;\n\t\tend\n\tend\nend\n\nif tag==1\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "6b2c70a2997244d60453669003b599e8", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "05505cb97500e184067a603aeec5a0c1", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.960919540229885, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x,t,a,b,da,db=gets.split.map(&:to_i)\nyes=false\nt.times do |i|\n t.times do |j|\n if a-da*i+b-db*j==x or a-da*i==x or b-db*j==x\n yes=true\n end\n end\nend\nif yes then puts \"YES\"\nelse puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "cb12825cdc6d676e042208611f98da51", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "2f2eef028c658cbcc41c6bd60de3eaa1", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9719626168224299, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets\nif s == s[0] * s.length\n puts \"0\"\nelse\n puts \"#{s.length - (s == s.reverse ? 1 : 0)}\"\nend", "lang": "Ruby", "bug_code_uid": "8e97a778919c89fa15e45dd6724e3f8d", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "2cef5474dff22badb6476353707e9133", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.17647058823529413, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "\ufeff# -*- encoding: utf-8 -*-\ndef is_ok?(arr, t)\n arr.select{ |x| x > t }.length == 0 ? true : false\nend \n\nn, t, c = gets.chomp.split(\" \").map(&:to_i)\nprisoners = gets.chomp.split(\" \").map(&:to_i)\nans = 0\ni = 0\n\nwhile i <= (n - c)\n arr = prisoners[i, c]\n if is_ok?(arr, t)\n ans += 1\n i += 1\n else\n i += c\n end\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "5035f6ee12245eda31ca250393e6f5d6", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "0f4b1c5a5596df33a3f9c8a776d9d479", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9867256637168141, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "keyboard = \"qwertyuiop\n asdfghjkl;\n zxcvbnm,./\"\ndir = gets.chomp\ngets.chomp.split(\"\").each { |x| print dir == \"R\" ? \n keyboard[keyboard.index(x) - 1] : keyboard[keyboard(x) + 1] }\n", "lang": "Ruby", "bug_code_uid": "cb8eb81ca92a59c6e741259182acf383", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "02760ad049fbbd2e93d9fb72012b263a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9485458612975392, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "a=gets\nstr=\"qwertyuiopasdfghjkl;zxcvbnm,./\"\nstrk=gets\nif a==\"R\\n\"\n \n for i in 0...strk.size-1\n strk[i]=str[str.index(strk[i])-1]\n end\nelse\n for i in 0...str.size\n strk[i]=str[str.index(strk[i])+1]\n end\nend\nputs strk", "lang": "Ruby", "bug_code_uid": "bd47c41539ea2bc65fd5aec60494381c", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "625a4038325a2650bf3fd4f80cae9bd3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.975, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = \"qwertyuiopasdfghjkl;zxcvbnm,./\"\nk = gets.chomp == \"L\" ? 1 : -1\nputs gets.split('').map{|x|s[s.index(x)+k]}.join\n", "lang": "Ruby", "bug_code_uid": "5b489d055f32f609f0096d3b009fc4b4", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "f711bb4a9f5b50ddd4d4e8cb5a32fcc3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7094188376753507, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n=gets.chop\n\ni=1\nflag=false\nwhile i*(i+1)/2<=n.to_i and !flag do\n sum=i*(i+1)/2\n j=i+1\n while sum+j*(j+1)/2<=n.to_i and !flag do\n if sum+j*(j+1)/2==n.to_i then\n flag=true\n break\n end\n j+=1\n end\n i+=1\nend\n\nif flag then puts \"YES\"\nelse puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "1152fa1572ad4548bb12ef23ec31940a", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "4c9839588f451c4faf40b9c0e30e8688", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4774774774774775, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "n = gets.to_i\n\ndef check(x,co) \n k = 0\n z = 0\n while kup\nbreak if ((i*(i+1))+j*(j+1))>a\nend\nbreak if trig==1\nbreak if in-x) then break end\n if (x+y==n) then ans = true end\n y += j\n end\n y = 1\n x += i\nend\nif (ans) then puts \"YES\"\n else puts \"NO\" end ", "lang": "Ruby", "bug_code_uid": "2bdc700415f34ce5181159f633a8b503", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "040cecd1d63303468afda6fdecd15dea", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9969788519637462, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\ndef gcd(a,b)\n a,b = b,a if b==0\n a%b==0 ? b : gcd(b, a%b)\nend\n\nif n==4\n puts 12\n exit\nend\nlow = n-100>0 ? n-100:1\nmax = 0\nn.downto(low) do |i|\n n.downto(low) do |j|\n n.downto(low) do |k|\n if gcd(i,j)==1 && gcd(j,k)==1 && gcd(i,k)==1\n max = i*j*k if i*j*k > max\n end\n end\n end\nend\nputs max", "lang": "Ruby", "bug_code_uid": "70fec482f2e46f8406b12e38b4cb9cb2", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "e889906b193763135afcc33a36339e9c", "difficulty": 1600, "tags": ["greedy", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.966804979253112, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nclass Integer\n\tdef isqrt\n\t\treturn 0 if self<=0\n\t\treturn 1 if self<4 # 1\n\t\tx,y=0,self\n\t\twhile x!=y&&x+1!=y\n\t\t\tx,y=y,(self/y+y)/2\n\t\tend\n\t\tx\n\tend\nend\n\na,b=gets.split.map &:to_i\na=a.isqrt\nputs [:Vladik,:Vladik,:Valera][a*-~a<=>b]", "lang": "Ruby", "bug_code_uid": "67ca8037bd757d4786085e96d17707b3", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "2e0d97d35f13d3dac5a53e9d6b7efc6a", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9187675070028011, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "a,b=gets.split.map{|e| e.to_i}\nd=2\nans=\"Valera\"\nwhile a>0 && b>0\n\ta-=(d-1)\n\tif a<=0 then\n\t\t\n\t\tbreak\n\tend\n\tb-=d\n\tif b<=0 then\n\t\tans=\"Vladik\"\n\t\tbreak\n\tend\n\t\n\td+=2\nend\nputs ans\n\n", "lang": "Ruby", "bug_code_uid": "ba8797669f3f4425907bef53a1fb52a6", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "d9defad2b0c430c86d4607c58ae72828", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6766169154228856, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "def scan; gets.split.map(&:to_i); end\n\nf,s = scan\n\nv = 1\nloop{\n f-=v\n p [f,s]\n if f<=0\n puts \"Valera\";break\n end\n v+=1\n s-=v\n if s<=0\n puts \"Vladik\";break\n end\n v+=1\n}", "lang": "Ruby", "bug_code_uid": "292997c76b30d2f91704a4fe036c8e76", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "a7e991d6363c23fcd5a097b9b94cecea", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9236641221374046, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def f(x,y,x1,y1)\n\treturn (x-x1).abs+(y-y1).abs\nend\nx,y=gets.split.map{|e| e.to_i}\nx1,y1=gets.split.map{|e| e.to_i}\nx,y=(x-x1).abs,(y-y1).abs\nx,y=[x,y].min,[x,y].max\nans=0\nif x==0\n\tans=6+y*2+f(x-1,y,-1,1)+f(x+1,y,1,1)\nelse\n\tans=4+f(x,y,-1,1)+f(x,y,1,-1)\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "e4ebad7b3fd3a87e04263ee6596d0898", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "cf8d0a5d4ea43fee9fed692c078801d7", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.10379241516966067, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "a=[]\n4.times do\n\ta<=2*B && A>=2*C && A>=2*D\n\tputs \"A\"\nelsif B>=2*A && B>=2*C && B>=2*D\n\tputs \"B\"\nelsif C>=2*A && C>=2*B && C>=2*D\n\tputs \"C\"\nelsif D>=2*A && D>=2*C && D>=2*A\n\tputs \"D\"\nelse\n\tputs \"C\"\nend\n", "lang": "Ruby", "bug_code_uid": "fbb5ab0ecd28700d4b6845f2398bc26d", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "033101b0ce8cb2398773baf80099d6ee", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9181969949916527, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "descriptions = []\n4.times do\n descriptions << gets.chomp\nend\n\ndescriptions.sort_by!{ |x| x.length }\n# puts descriptions.join \"\\n\"\nflag = false\nif((descriptions[0].length-2)*2 <= (descriptions[1].length-2)) then\n flag = true\nend\nif (descriptions[2].length-2)*2 <= (descriptions[3].length-2) then\n if(flag)\n flag = false\n puts \"C\"\n else\n puts descriptions[3][0]\n end\nelse\n puts \"C\"\nend\nputs descriptions[0][0] if(flag)\n \n\n \n# flag0 = true\n# descriptions.each_with_index do |x,i|\n# flag1 = true\n# descriptions.each_with_index do |y,j|\n# next if i==j\n# end\n# end\n\n", "lang": "Ruby", "bug_code_uid": "c87df4027b684f044f6136057db1e20e", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "e49c847bb2a1a3cbdf6b8bfb7220823f", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7564766839378239, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "c=$<.map{|x| x.size-3}\nc.each_with_index do |v,i|\n\tcc=c[i+1..-1]\n\tcc+=c[0..i-1] if i > 0\n\tif c[i] >= 2 * cc.max || 2 * c[i] <= cc.min\n\t\tputs (i + 'A'.ord).chr\n\t\texit\n\tend\nend\nputs 'C'\n", "lang": "Ruby", "bug_code_uid": "e63ea014e8b55712e3bab7fa6e84c28d", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "1b59faf997354a005b29e0f522d68ec3", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9974874371859297, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "# be name khoda ...\ndef read_ints; STDIN.gets.split.map(&:to_i); end\ndef isPrime(x)\n t = 2\n while (t*t <= x)\n if(x % t == 0) \n return false\n end\n t+=1;\n end\n return true\nend\nn = gets.to_i\nres = '85'\nif(n % 2 == 0)\n if(n == 2)\n res = '1'\n else\n res = '2'\n end\nelse\n if(isPrime(n))\n res = '1'\n elsif(isPrime(n-1))\n res = '2'\n else\n res = '3'\n end\nend\nputs res", "lang": "Ruby", "bug_code_uid": "cf404f1c600491a825e6d1bdddaa4f24", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "b82bc979d6f1f0130ffeeb15c7e7bf10", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9987163029525032, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def isPrime?(x)\n d = 2\n until (d*d >= x)\n if(x % d == 0)\n return false\n end\n d = d + 1\n end\n return true\nend\n\nn = gets.to_i\n\nif (n==2)\n puts 1\nelsif (n == 3)\n puts 1\nelsif (n == 4)\n puts 2\nelsif (n == 5)\n puts 1\nelsif (n == 6)\n puts 2\nelsif (n == 7)\n puts 1\nelsif (n % 2 == 0)\n puts 2\nelsif (isPrime?(n))\n puts 1\nelsif (isPrime?(n-2))\n puts 2\nelse\n puts 3\nend\n\n", "lang": "Ruby", "bug_code_uid": "cd7d7c2c9c2ca665eaf7dab3ffc159df", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "1125be58819bce75a84e8b72373073a3", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9733333333333334, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nn=gets.chomp\nputs [n,*(1...n.size).map{|i|\n\t(n[0,i].to_i-1).to_s+'9'*(n.size-i)\n}].max_by{|e|[e.chars.map(&:to_i).reduce(:+),e.to_i]}", "lang": "Ruby", "bug_code_uid": "ff70f7080e451c181aa792293f2eacf0", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "6a50337bc3ccce7c358cfc8ed9b60d97", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9925093632958801, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "arow1 = gets.chomp\narow2 = gets.chomp\nbrow1 = gets.chomp\nbrow2 = gets.chomp\narow1.gsub!(\"X\", \"\")\narow2.gsub!(\"X\", \"\")\nbrow1.gsub!(\"X\", \"\")\nbrow2.gsub!(\"X\", \"\")\n\na = arow1 + arow2.reverse\nb = brow1 + brow2.reverse\n\nif (2 * a).index(b)\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "9d250318449fbcc39829f9b3d129a650", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "e9b686acc14158c6ee50960d1990cd74", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9871794871794872, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = [\"ABXC\", \"XBAC\", \"BXAC\", \"BCAX\", \"BCXA\", \"XCBA\", \"CXBA\", \"CABX\", \"CAXB\", \"XACB\", \"AXCB\"]\n#b = [\"BAXC\", \"XABC\", \"AXBC\", \"ACBX\", \"ACXB\", \"XCAB\", \"CXAB\", \"CBAX\", \"CBXA\", \"XBCA\", \"BXCA\"]\nsa = readline.strip + readline.strip\nsb = readline.strip + readline.strip\nputs a.count(sa) == a.count(sb) ? \"YES\" : \"NO\"\n", "lang": "Ruby", "bug_code_uid": "062a4b9a40a55b6a7626fed2c19b68ea", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "13e13a47b2307a4b272f4db24413e92e", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9907692307692307, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n=gets.to_i\ns=gets.to_s\np=s.chomp.split(\"\")\nx=1;\n600.times do\n x*=10;\nend\ndp = Array.new(100,x)\ndp[0]=0;\ny=p.size.to_i\nfor i in 0..y-1 do\n tmp=0\n j=i\n while j= arr.max ? arr.size : arr.index(arr.max) + 1\n", "lang": "Ruby", "bug_code_uid": "279078fd424538e3f43886ed67eef44b", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "90472e9e42a4436884be7f1bbc2f22f0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7616438356164383, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "a=gets.chomp.split(\" \")\nb=gets.chomp.split(\" \")\nans=1\nmax=b[0].to_i\n1.upto(a[0].to_i-1) do |i|\nif b[i].to_i>=max\nmax=b[i].to_i\nans=i+1\nend\nend\nputs \"#{ans}\"\n", "lang": "Ruby", "bug_code_uid": "8c7fc95ade427bc3d66b40514fda5a65", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "962442278726afa0b95ab93fa75a905e", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9645390070921985, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "m=gets.split[1].to_i;a=gets.split.map{|x|x.to_i/m};p a.rindex(a.max)+1", "lang": "Ruby", "bug_code_uid": "d52c9cd8ded61ae85dcbedc15959c3cb", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "5a90b244ae46d688e8472795b2c33958", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6153846153846154, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n, m = gets.split.map(&:to_i)\nputs gets.split.map(&:to_i).map.with_index{|x, i| [x, i + 1]}.sort.reverse[0][1]\n", "lang": "Ruby", "bug_code_uid": "ba36a4340487a740e36ddbefbc60e8dc", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "7ef0ff078585af3b235c36f9658600b9", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9315068493150684, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,m,a,b=gets.split.map(&:to_i)\nmax=[b/m-a/m+1,3].min\nupper_r=(m+1-a%m)%m\nlower_r=b%m\nputs(\n\tif upper_r==0&&lower_r==0\n\t\t1\n\telsif upper_r==0||lower_r==0||(upper_r+lower_r==m)\n\t\t[2,max].min\n\telse\n\t\tmax\n\tend\n)", "lang": "Ruby", "bug_code_uid": "86e7eb57212b59dc14f36de2af7b8498", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "4587781bdaa809b2943d5b834f9e7249", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9582463465553236, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "st, fin = gets.split(' ').map(&:to_i)\nnum, diff = gets.split(' ').map(&:to_i)\n\nsum_st = st\nsum_fin = fin\n(1...num).each do |i|\n l, r = i, num-1-i\n st += diff\n sum_st += st\n fin += diff\n sum_fin += fin\n if l == r || (r-l) == 1\n if (st-fin).abs <= diff\n if l == r\n puts sum_st + sum_fin - [st,fin].max\n else\n puts sum_st + sum_fin\n end\n exit\n end\n\n if l != r\n fin += diff\n sum_fin += fin\n end\n\n if st > fin\n l.downto(0) { |i|\n if (st-fin).abs <= diff\n puts sum_st + sum_fin - [st,fin].max\n exit\n end\n sum_st -= st\n st -= diff\n fin += diff\n sum_fin += fin\n }\n else\n (l...num).each do |i|\n if (st-fin).abs <= diff\n puts sum_st + sum_fin - [st,fin].max\n exit\n end\n sum_fin -= fin\n fin -= diff\n st += diff\n sum_st += st\n end\n end\n end\nend\n", "lang": "Ruby", "bug_code_uid": "e7042ed8374b4947af09a858181e65ee", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "a6874a4261c18a6553e72404898094c8", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9953917050691244, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "v1, v2 = gets.split.collect{|i| i.to_i}.minmax\nt, d = gets.split.collect{|i| i.to_i}\nif d.zero?\n puts v1*t\n exit\nend\nx = (1.0*d*t+v2-v1)/(2*d).round\nans = v1*x+d*(x-1)*x/2 + v2*(t-x)+d*(t-x-1)*(t-x)/2\nputs ans\n", "lang": "Ruby", "bug_code_uid": "99e1ed3e7c1c0af7b2ab9c12ae8d31ac", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "c2f715b97483b809649caf725aaf7b19", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3045977011494253, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "x, y, m = gets.split.map(&:to_i)\nans = 0\nloop do\n x, y = y, x if x > y\n if y >= m\n break\n elsif y <= 0\n ans = -1\n break\n elsif x + y <= [0, m].min\n z = ([0, m].min - x) / y\n x += y * z\n ans += z\n else\n x += y\n ans += 1\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "e3d257d9f256959519912f8e86381cd4", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "f3ae87ffa924b0f774d95f11ffbfd7d0", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6638655462184874, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "n,k = gets.split.map(&:to_i)\n\none, two = (1..n).partition{ |x| x%2 != 0 }\n\nif k>one.size\n puts two[k-1-one.size]\nelse\n puts one[k-1]\nend", "lang": "Ruby", "bug_code_uid": "44766d9f5d920359805211c3c7b73a17", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "e7f854ea77e7d3db5f9765ade6a037d7", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.38515901060070673, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 8, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "\ndef zyc(str)\n res = true \n l = 0\n r = str.length - 1\n while l < r\n if str[l] == str[r]\n l += 1\n r -= 1\n else\n res = false\n break\n end\n end\n res\nend\n\n\nnums, devider = gets.chomp.split.map(&:to_i)\n\narray = 0\nsum = 0\n\ni = 11\nwhile array != nums\n y = i.to_s\n if y.length%2 != 0\n i *= 10\n elsif zyc(y)\n array += 1\n sum += i\n i += 1\n else\n i += 1\n end\nend\n\nputs sum%devider\n\n\n", "lang": "Ruby", "bug_code_uid": "91e92cd62180239165649717632bcaf4", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "1839f28631d98b862bc5383c268989b0", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9855072463768116, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\nnums, devider = gets.chomp.split.map(&:to_i)\nsum = 0\nnums.times do |i|\n a = i.to_s\n sum += ( a + a.reverse).to_i\nend\nputs sum%devider", "lang": "Ruby", "bug_code_uid": "d941e3f77a3683e30b62c76bb37a2fac", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "1839f28631d98b862bc5383c268989b0", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5488565488565489, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "def f0(s)\n\treturn (s+s.reverse).to_i\nend\ndef f1(s)\n\tt=s.slice(0,s.size-1)\n\treturn (t+s[s.size-1]+t.reverse).to_i\nend\n\narr=[]\n(\"1\"..\"9\").each{|e1|\n\tarr<n\n x += 1\nend\n\nputs x*k\n", "lang": "Ruby", "bug_code_uid": "df4c8173eedf1379983948518a572082", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "03d16b50f9c274bcab87a8e7a2ccd509", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9746835443037974, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a, b = gets, gets\na.length.times{|i| print (a[i, 1].to_i == b[i,1].to_i)?0:1}", "lang": "Ruby", "bug_code_uid": "3b6c999217ad8e82a94aaf7711b2e825", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "5f70c2cc7fdfe361d067cbd019bcdf0a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.669051878354204, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "sammy = gets.chars.map(&:to_i)\n\nymmas = gets.chars.map(&:to_i)\n\n\n\npokemon = []\ndigimon = []\n\n\nsammy.pop\nymmas.pop\n\npokemon << a.zip(b).map { |x, y| x <=> y}\npokemon.flatten!\n\npokemon.each do |i|\nif i == 1 || i == -1\ndigimon << 1\n\nelse\ndigimon << 0\nend\nend\n\n\np digimon.join.to_i\n\n\n\n", "lang": "Ruby", "bug_code_uid": "dd6d8a03219411ea6d1f1854b5eca5eb", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "9bd30e75042b7cf6647667bccf8acf1c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.946524064171123, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\n\nans = 0\n\nabc = []\ngets.chomp.each_char do |c|\n\tif 'a' <= c && c <= 'z'\n\t\tabc[c.ord - 'a'.ord] = 1\n\telse\n\t\tans = [ans, abc.count(1)].max\n\t\tabc = []\n\tend\nend\n\np ans", "lang": "Ruby", "bug_code_uid": "33907f977140c0cb67a7cb254c044d24", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "f95246e2b9bef09a12bbd0e7f374c911", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.10138248847926268, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n = gets.strip.to_i\ns = gets.strip\ncount = Array.new(26, 0)\nn.times do |i|\n curr = s[i]\n if curr >= 'a' && curr <= 'z'\n pos = curr.ord - 'a'.ord\n count[pos] += 1\n end\nend\nans = 0\ncount.each do |a|\n ans += 1 if a > 0\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "ae682fab18aeff594096721718f0af02", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "5214bb1b98200ab42ffb2bf44229018e", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9381443298969072, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def is_up_case?( chr )\n chr >= 'A' && chr <= 'Z'\nend\nn = gets.strip.to_i\ns = gets.strip\ni = ans = 0\nprev = '0'\nwhile i < n\n curr = s[i]\n dist = {}\n while !is_up_case? curr\n curr = s[i]\n break if is_up_case? curr\n dist[curr] = 1 if dist[curr].nil?\n prev = curr\n i += 1\n end\n ans = [ans, dist.length].max\n i += 1\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "9f02933ca1b9e9383a74d0df4c3e6d4a", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "5214bb1b98200ab42ffb2bf44229018e", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9403973509933775, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "class String\n def is_lower?\n self == self.downcase\n end\nend\n\nn = STDIN.gets.chomp.to_i\ns = STDIN.gets.chomp\nletters = {}\nanswer = 0\ns.each_char do |ch|\n if ch.is_lower?\n letters[ch] = true\n else\n answer = [answer, letters.size].max\n letters = {}\n end\nend\nputs answer\n", "lang": "Ruby", "bug_code_uid": "661d35d7d2e2c99d7cff797431c885dd", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "8726a9538a8b3ede28a9243f49fb8b1b", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9429824561403509, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def dist(x1, y1, x2, y2)\n\t(x1 - x2)**2 + (y1- y2)**2\nend\n\nax, ay, bx, by, cx, cy = gets.split.map{|x| x.to_i}\nputs ((ay - by) * (ax - cx) == (ay - by) * (ax - cx)) || (dist(ax, ay, bx, by) != dist(cx, cy, bx, by)) ? \"No\" : \"Yes\"", "lang": "Ruby", "bug_code_uid": "580c28f217fde5cd789fadc6ec476efb", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "ba662b846bd241b18477c85b2540b977", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.334020618556701, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "ax,ay,bx,by,cx,cy=gets.split.map(&:to_i)\nif ax == bx\n puts ax == cx ? \"No\" : \"Yes\"\nelse\n puts (cy - ay) * (ax - bx) == (ay - by) * (cx - ax) ? \"No\" : \"Yes\"\nend", "lang": "Ruby", "bug_code_uid": "89fb860b580ef73010b7e9fa9796c352", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "3756b44ab3eec3e988cf56ce1ef68c20", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.64, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "puts \"\u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043b\u0438\u043d\u0443 \u043f\u043b\u043e\u0449\u0430\u0434\u0438\"\na = gets.chomp.to_i\nputs \"\u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u043b\u043e\u0449\u0430\u0434\u0438\"\nb = gets.chomp.to_i\nputs \"\u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043b\u0438\u043d\u0443 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0433\u0440\u0430\u043d\u0438\u0442\u043d\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438\"\nc = gets.chomp.to_i\n\ndef counter_of_squares(length, r)\n x = length / r\n if length % r != 0\n x += 1\n else\n return x\n end\nend\nputs counter_of_squares( a , c) * counter_of_squares( b, c)\n", "lang": "Ruby", "bug_code_uid": "235b2075a1def23c1ca4988afebc3ca1", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e367b3096a7bac7037c5b007d3533491", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8290909090909091, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 9, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": " n, m, a = ARGV.map(&:to_i)\n na = n / a\n if n % a > 0\n na += 1\n end\n\n\n ma = m / a\n if m % a > 0\n ma += 1\n end\n\n puts na * ma", "lang": "Ruby", "bug_code_uid": "c002e3b74492aa67db9d5342d35134a8", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "fa6ff11b83aa5dc619d2f3892082dd9d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7384615384615385, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n, m, a = ARGV.map(&:to_i)\nputs (n % a).ceil * (m % a).ceil ", "lang": "Ruby", "bug_code_uid": "0a09a9eb13c643c3db4753f4474de9f5", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f9f949cc4c161b2d0dde325c6aec5346", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6320754716981132, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "input = gets.chomp\nvalue = input.split\n\nx = 1 if value[0].to_i % value[2].to_i != 0 \ny = 1 if value[1].to_i % value[2].to_i != 0\nx += value[0].to_i / value[2].to_i\ny += value[1].to_i / value[2].to_i\nputs x * y\n\t", "lang": "Ruby", "bug_code_uid": "8a0957c1f9049975fd9790f90eff1d7c", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "802129748cc6635a2e9e0d24c73f541a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.875, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "result = 'YES'\nn = -1\ns = -1\n\nline1 = ARGF.readline\nline2 = ARGF.readline\n\n\nn = line1.split(' ')[0].to_i\ns = line1.split(' ')[1].to_i\n\ntemp = []\n\ntemp = line2.split(' ')\n\n#convert array of chars into array of int\n\nmugs = []\n\ntemp.each do |t|\n\tmugs.push(t.to_i)\nend\n\ngroups = mugs.combination(n-1).to_a\n\ngroups.each do |g|\n\t\n\tsum = g.reduce(:+)\n\n\tif sum > s\n\t\tresult = 'NO'\n\t\tbreak\n\tend\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "4ee55a18d81a9dccc3e3870a256588ee", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "30e2c842aee014a860ed81f187124ee4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.979757085020243, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,s = gets.split.map(&:to_i)\nmugs = gets.split.map(&:to_i)\n\nif mugs.slice(0,n-1).sum <= s\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "18ce6dc9b2f39575177aebbe04256992", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "20f4f77786e2043b3d36d29a12805b1c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9605373635600336, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def isright( x1, y1, x2, y2, x3, y3 )\n\ta2 = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)\n\tb2 = (x2-x3)*(x2-x3) + (y2-y3)*(y2-y3)\n\tc2 = (x3-x1)*(x3-x1) + (y3-y1)*(y3-y1)\n\ta2 + b2 == c2 || b2 + c2 == a2 || c2 + a2 == b2\nend\n\ns = gets.chomp\nar = s.split(/ /)\nar.map!{|x| x.to_i }\n\nret = \"NEITHER\"\nif isright(ar[0],ar[1],ar[2],ar[3],ar[4],ar[5])\n\tret = \"RIGHT\" \nelse\n\tfor i in 0..5\n\t\tar[i] += 1\n\t\tif isright(ar[0],ar[1],ar[2],ar[3],ar[4],ar[5])\n\t\t\tret = \"ALMOST\"\n\t\tend\n\t\tar[i] -= 2\n\t\tif isright(ar[0],ar[1],ar[2],ar[3],ar[4],ar[5])\n\t\t\tret = \"ALMOST\"\n\t\tend\n\t\tar[i] += 1\n\tend\nend\nputs ret\n", "lang": "Ruby", "bug_code_uid": "46683b904286da35fd64f775bd32ad3a", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "fbfadb16eb5db5221d4f2e4d9e39e635", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.09082125603864734, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def adj(a,b,c,d)\n\t((a-c)*(a-c))+((b-d)*(b-d))\nend\ndef tri(a,b,c,d,e,f)\n\tadj(a,b,c,d)>0 && adj(c,d,e,f)>0 && adj(a,b,c,d)+adj(c,d,e,f) == adj(e,f,a,b)\nend\ndef judge(a,b,c,d,e,f)\n\ttri(c,d,e,f,a,b) || tri(c,d,e,f,a,b) || tri(e,f,a,b,c,d)\nend\ndx,dy=[0,0,1,-1],[1,-1,0,0]\na=gets.chomp.split.map(&:to_i)\nif judge(a[0],a[1],a[2],a[3],a[4],a[5])\n\tputs \"RIGHT\"\n\texit\nend\nfor i in 0...3\n\tfor j in 0...4\n\t\ta[2*i]+=dx[j]\n\t\ta[2*i+1]+=dy[j]\n\t\tif judge(a[0],a[1],a[2],a[3],a[4],a[5])\n\t\t\tputs \"ALMOST\"\n\t\t\texit\n\t\tend\n\tend\nend\nputs \"NEITHER\"\n", "lang": "Ruby", "bug_code_uid": "ec10f848d5d2f2c38d5225cbf9c7f101", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "0608e06db51bece62d78f6f1d9fe99d0", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8744479495268139, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "def distance(x1,y1,x2,y2)\n xx=x1-x2\n yy=y1-y2\n return xx*xx+yy*yy\nend\ndef isRight(x,y)\n d=Array.new(3)\n 3.times do |i|\n d[i]=distance(x[i],y[i],x[(i+1)%3],y[(i+1)%3])\n if d[i] == 0\n return false\n end\n end\n max=-1\n ti=-1\n 3.times do |i|\n if max 0 do\n cost = (ary[ni] - ary[ni+1]).abs\n if cost <= b && valid(ary, ni+1, i)\n mc = solve(ni, ary, b-cost)\n if mc != -1\n ans = [ans, mc+1].max\n end\n end\n ni -= 2\n end\n # puts [i, b, ans].inspect\n @cache[i] = ans\n end\n end\n @cache[i]\nend\n\nn, b = gets.strip.split.map(&:to_i)\nary = gets.strip.split.map(&:to_i)\n0.upto(n-1).each do |i|\n if ary[i]%2 == 0\n @es << (@es[i] + 1)\n @os << (@os[i])\n else\n @es << (@es[i])\n @os << (@os[i] + 1)\n end\nend\n\nputs [solve(n-1, ary, b),0].max\n# puts @cache.inspect\n", "lang": "Ruby", "bug_code_uid": "49791d99b86a78c270f1847666e98e34", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e", "apr_id": "fd98e9cee04c5abbac24e1fdd4d6a45b", "difficulty": 1200, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8979591836734694, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "s=gets.chomp\ni=s.index('1')\ns=s[i+1..-1]\nputs s.count('0')>=6 ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "7d51f50586c33978594af277d0fc7d17", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "186cecb4d46a55c827e5821e12b38792", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8954423592493298, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp\ni = s.index(?1)\ncnt = 0\n(i + 1).upto(s.size - 1) do |i|\n if s[i] == ?0\n cnt += 1\n end\nend\nif cnt >= 6\n puts \"yes\"\nelse\n puts \"no\"\nend", "lang": "Ruby", "bug_code_uid": "eeef24d471f88bc5059c8bafc8ab9d7c", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "590e2a13023196eb46b375a722492748", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9236111111111112, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n= gets\nwhile(n.size > 0)\n n.delete_at(0) if n[0] == '0'\n break if n[0]== '1'\nend\nif n.count('0')>=6\n print('yes')\nelse\n\tprint('no')\nend\n", "lang": "Ruby", "bug_code_uid": "3d13655423519a6f90ab8ece2cbc902c", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "0a4fa759270ac75eb8df74b61418669c", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9929577464788732, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n= gets\nwhile(n.size > 0)\n n=n[1..-1] if n[0] == '0'\n break if n[0]== '1'\nend\nif n.count('0')>=6\n print('yes')\nelse\n\tprint('no')\nend\n", "lang": "Ruby", "bug_code_uid": "54e60511a731f916611518309e9e0e16", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "0a4fa759270ac75eb8df74b61418669c", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8717339667458432, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "# http://codeforces.com/contest/596/problem/A\nn = gets.chomp.to_i\npoints = [].tap do |a|\n n.times { a << gets.chomp.split.map(&:to_i) }\nend\n\nif n == 1\n puts -1\nelsif n == 2\n puts (points[0][0] - points[1][0]).abs * (points[0][1] - points[1][1]).abs\nelse\n x = points.map(&:first).uniq\n y = points.map(&:last).uniq\n puts (x[0] - x[1]).abs * (y[0] - y[1]).abs\nend\n", "lang": "Ruby", "bug_code_uid": "f1459a41f28790a9df804ce41bd64cba", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "9ef4f18e396b68ef52c208325cb15ebf", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.994413407821229, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nxx = []\nyy = []\nn.times do\n x, y = gets.split.map(&:to_i)\n xx << x\n yy << y\nend\nxx.sort\nyy.sort\nans = (xx[-1] - xx[0]) * (yy[-1] - yy[0])\nputs ans > 0? ans : -1\n", "lang": "Ruby", "bug_code_uid": "288062e3a00c7cf4b51e1a315458b631", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "84de3fec4f564e1bff607dd5094e0b60", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8305084745762712, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "a = gets.strip\nb = gets.strip\n\na.each do |c|\n bc = b.shift\n if c == bc\n print 0\n else\n print 1\n end\nend\n\nputs\n", "lang": "Ruby", "bug_code_uid": "de82b0c1e76652823dcea6b7147fcce5", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "3fa4487e718c9534d29ac69df5780187", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8163265306122449, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "a = gets.strip\nb = gets.strip\n\na.each_byte do |c|\n bc = b.slice!(0)\n if c == bc\n print 0\n else\n print 1\n end\nend\n\nputs\n", "lang": "Ruby", "bug_code_uid": "aecf833877504c0a654983cae793d759", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "3fa4487e718c9534d29ac69df5780187", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9936842105263158, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,a,x,b,y = gets.split.map(&:to_i)\nflag = false\nwhile a != x && b != y\n a += 1\n a = 1 if a > n\n b -= 1\n b = n if b <= 0\n if a == b\n f = true\n break\n end\nend\nif flag\n puts(\"YES\")\nelse\n puts(\"NO\")\nend", "lang": "Ruby", "bug_code_uid": "734de240d3c23a20036185c3175ff31f", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "0c09ea44a0ff9a3540e64af2044a9459", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.1525096525096525, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n, x, y, c = gets.split.map(&:to_i)\n\ndef square(x) \n x * x\nend\n\ndef triangle(x)\n x * (x + 1) >> 1\nend\n\ndef solve(n, x, y, t)\n count = t * t + (t + 1) * (t + 1)\n 4.times do\n count -= square(t - x + 1) if x <= t\n count += triangle(t - x + y + 1) if x + y <= t\n x, y = n + 1 - y, x\n end\n count\nend\n\nlow, high = 0, n - 1 << 1\nwhile low < high\n middle = low + high >> 1\n if solve(n, x, y, middle) >= c\n high = middle \n else\n low = middle + 1\n end\nend\np high\n", "lang": "Ruby", "bug_code_uid": "d7e15081639e83913908d02f209bc215", "src_uid": "232c5206ee7c1903556c3625e0b0efc6", "apr_id": "cf8f21cb3600ae56ed9e2121fb46a00f", "difficulty": 1800, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.996268656716418, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a = gets.split(' ').map(&:to_i)\nb = gets.split(' ').map(&:to_i)\nc = gets.split(' ').map(&:to_i)\n\ndef tmatch(a, b, c)\n a[0] == b[0] && (\n [b[1], a[1]].min > c[1] || c[1] > [b[1], a[1]].max\n ) || \n a[1] == b[1] && (\n [b[0], a[0]].min > c[0] || c[0] > [b[0], a[0]].max\n )\nend\n\nif a[0] == b[0] && b[0] == c[0] || a[1] == b[1] && b[1] == c[1]\n puts 1\nelsif tmatch(a,b,c) ||\n tmatch(a,c,b) ||\n tmatch(b,a,c) ||\n tmatch(c,b,a) ||\n tmatch(c,a,b) ||\n tmatch(b,c,a)\n puts 2\nelse\n puts 3\nend", "lang": "Ruby", "bug_code_uid": "5e79e8ac0504f7a2fb6d4ea85ecb1523", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "d6c5df41d8e9a1a12b96f851852add44", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.49391304347826087, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": " #$stdin.reopen('/cygdrive/d/input.txt', 'r')\n\n\n c,d = gets.split.map(&:to_i)\n n,m = gets.split.map(&:to_i)\n k = gets.split.map(&:to_i)\n\n\n w = n*m-k\n\n if w==0\n \tputs 0\n \texit 0\n end\n\n\n\n\n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "f566989af2f3ec088caee35e00ad35b0", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "fc596d91d6397387e5703535dcfa741b", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9973890339425587, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": " #$stdin.reopen('/cygdrive/d/input.txt', 'r')\n\n\n c,d = gets.split.map(&:to_i)\n n,m = gets.split.map(&:to_i)\n k = gets.to_i\n\ndef solve(c,d,n,m,k)\n\t\n\tw=n*m-k\n\tif w==0\n\t\tputs 0\n\t\treturn\n\tend\n\tx = c/n\n\tif x maxpow\n odd = true if z[1]%2==1\n end\n\n if maxpow == 1\n break\n end\n\n if odd\n count += 1\n a.each_with_index do |pm,i|\n# if pm[1]%2 !=0\n if maxpow%2==0\n a[i][1]= maxpow\n else\n a[i][1] = maxpow+1\n end\n# end\n end\n end\n\n# p a\n# p odd\n# p maxpow\n\n count += 1\n \n a.each_with_index do |pm,i|\n a[i][1]/=2\n end\nend\n\n#puts count\nans = 1\na.each do |x|\n ans*=x[0]\nend\nputs \"#{ans} #{count}\"\n", "lang": "Ruby", "bug_code_uid": "e262dab3bb1b2fb2cdb71aeaeba1ad82", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "7f4e179b1603ed776ef889aea66eb32b", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9927007299270073, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "ns = Array.new(9, 0)\ngets.split.map(&:to_i).each { |e| ns[e] += 1 }\nputs (if ns.include?(4) && ns.include?(2) || ns.include?(6); \"Elephant\"\nelsif ns.include?(4) || ns.include?(5); \"Bear\"\nelse \"Alien\"\nend)\n", "lang": "Ruby", "bug_code_uid": "e3357a677002183f1cf87e147722b630", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "59f5d809c028cb313bbafee28d2790f7", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9806835066864784, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "input = gets.chomp.split(' ').map(&:to_i).compact\n\nc = input.inject({}){|h,e| h[e] ||= 0; h[e] += 1; h }\n\nif c.values.any?{|v| v >= 4 }\n\n l = c.find{|a,b| a >= 4 }[0]\n cc = input.dup\n 4.times do\n cc.delete_at( cc.index(l) )\n end\n\n if cc.uniq.count > 1\n puts \"Bear\"\n else\n puts \"Elephant\"\n end\n\nelse\n puts \"Alien\"\nend\n", "lang": "Ruby", "bug_code_uid": "b61e3ea3ea1258c0363e09812aab77d2", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "2cb94dbf56d803957a7df81a9cc8cd4c", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.30149253731343284, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split.map(&:to_i)\na.sort!()\nt = false\nif (a[0]==a[3] && a[3]!=a[4] && a[4]!=a[5] ||\n a[1]==a[4] && a[0]!=a[1] && a[4]!=a[5] ||\n a[2]==a[5] && a[0]!=a[1] && a[1]!=a[2])\n println \"Bear\"\n t = true\nend\nif (a[0]==a[3] && a[3]!=a[4] && a[4]==a[5] ||\n a[2]==a[5] && a[0]==a[1] && a[1]!=a[2])\n println \"Elephant\"\n t = true\nend\nif t == true\n print \"Alien\"\nend", "lang": "Ruby", "bug_code_uid": "d00052443aacc3ffa026246a71dc6256", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "6d329141c7f43184c4c160509eb604e1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3042168674698795, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split.map(&:to_i)\na.sort!()\nt = false\nif (a[0]==a[3] && a[3]!=a[4] && a[4]!=a[5] ||\n a[1]==a[4] && a[0]!=a[1] && a[4]!=a[5] ||\n a[2]==a[5] && a[0]!=a[1] && a[1]!=a[2])\n puts \"Bear\"\n t = true\nend\nif (a[0]==a[3] && a[3]!=a[4] && a[4]==a[5] ||\n a[2]==a[5] && a[0]==a[1] && a[1]!=a[2])\n puts \"Elephant\"\n t = true\nend\nif t == false\n puts \"Alien\"\nend", "lang": "Ruby", "bug_code_uid": "694c41e915dc333dfbe9d2688ea58f2d", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "6d329141c7f43184c4c160509eb604e1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9798293250581847, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#! ruby\n# Try Codeforces\n# author: Leonardone @ NEETSDKASU\n############################################################\ndef gs() gets.chomp end\ndef gi() gets.to_i end\ndef gss() gs.split end\ndef gis() gss.map(&:to_i) end\ndef nmapf(n,f) n.times.map{ __send__ f } end\ndef ngs(n) nmapf n,:gs end\ndef ngi(n) nmapf n,:gi end\ndef ngss(n) nmapf n,:gss end\ndef ngis(n) nmapf n,:gis end\ndef arr2d(h,w,v=0) h.times.map{[v] * w} end\ndef for2p(hr,wr,&pr) hr.each{|i|wr.each{|j| yield(i,j)}} end\ndef nsum(n) n * (n + 1) / 2 end\ndef vcount(d,r=Hash.new(0)) d.inject(r){|r,e| r[e]+=1;r} end\n############################################################\n\nn = gi\n\nif n == 0\n puts \"0 0\"\n exit\nend\n\nm = n - 1\n\nd = 0\n\n\nk = 9 + 4 * 3 * n\nd = (- 3 + (k ** 0.5)) / 6\nd = d.floor\n\nf = d * (d - 1) * 3\n\ncase\nwhen (n - f) <= d\n e = n - f\n x = d * 2 - e\n y = e * 2\nwhen (n - f) <= 2 * d\n e = (n - f) - d\n x = d - e * 2\n y = d * 2\nwhen (n - f) <= 3 * d\n e = (n - f) - d * 2\n x = -d - e\n y = d * 2 - e * 2\nwhen (n - f) <= 4 * d\n e = (n - f) - d * 3\n x = - d * 2 + e\n y = -e * 2\nwhen (n - f) <= 5 * d\n e = (n - f) - d * 4\n x = -d + 2 * e\n y = -d * 2\nelse\n e = (n - f) - d * 5\n x = d + e\n y = -d * 2 + e * 2\nend\n\nputs \"%d %d\" % [x, y]\n\n\n\n\n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "4ec29dd9adebbcfb07a3d6ba11b1ae3e", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "b3e6a0d3dddd457e02369b7bef3c2168", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9777430691136275, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#! ruby\n# Try Codeforces\n# author: Leonardone @ NEETSDKASU\n############################################################\ndef gs() gets.chomp end\ndef gi() gets.to_i end\ndef gss() gs.split end\ndef gis() gss.map(&:to_i) end\ndef nmapf(n,f) n.times.map{ __send__ f } end\ndef ngs(n) nmapf n,:gs end\ndef ngi(n) nmapf n,:gi end\ndef ngss(n) nmapf n,:gss end\ndef ngis(n) nmapf n,:gis end\ndef arr2d(h,w,v=0) h.times.map{[v] * w} end\ndef for2p(hr,wr,&pr) hr.each{|i|wr.each{|j| yield(i,j)}} end\ndef nsum(n) n * (n + 1) / 2 end\ndef vcount(d,r=Hash.new(0)) d.inject(r){|r,e| r[e]+=1;r} end\n############################################################\n\nn = gi\n\nif n == 0\n puts \"0 0\"\n exit\nend\n\nm = n - 1\n\nd = 0\n\nwhile d * (d + 1) * 3 < n\n d += 1\nend\n\nf = d * (d - 1) * 3\n\ncase\nwhen (n - f) <= d\n e = n - f\n x = d * 2 - e\n y = e * 2\nwhen (n - f) <= 2 * d\n e = (n - f) - d\n x = d - e * 2\n y = d * 2\nwhen (n - f) <= 3 * d\n e = (n - f) - d * 2\n x = -d - e\n y = d * 2 - e * 2\nwhen (n - f) <= 4 * d\n e = (n - f) - d * 3\n x = - d * 2 + e\n y = -e * 2\nwhen (n - f) <= 5 * d\n e = (n - f) - d * 4\n x = -d + 2 * e\n y = -d * 2\nelse\n e = (n - f) - d * 5\n x = d + e\n y = -d * 2 + e * 2\nend\n\nputs \"%d %d\" % [x, y]\n\n\n\n\n\n\n\n\n\n\n", "lang": "Ruby", "bug_code_uid": "5422455b591beb1dd208dc1b4187a45d", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "b3e6a0d3dddd457e02369b7bef3c2168", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9976689976689976, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "input = STDIN.read.split(\"\\n\")\n\nn = input[0].to_i\nnums = input[1].split('').map(&:to_i)\n\nnum1 = nums[0..n-1].sort!\nnum2 = nums[n..-1].sort!\n\nif num1[0] > num2[0]\n\tmore = true\nelsif num1[0] < num2[0]\n\tmore = false\nelse\n\tSTDOUT.puts \"NO\"\n\texit\nend\n\nnum1.length.times do |i|\n\tif more\n\t\tif num1[i] < num2[i]\n\t\t\tSTDOUT.puts \"NO\"\n\t\t\texit\n\t\tend\n\telse\n\t\tif num1[i] > num2[i]\n\t\t\tSTDOUT.puts \"NO\"\n\t\t\texit\n\t\tend\n\tend\nend\n\nSTDOUT.puts \"YES\"", "lang": "Ruby", "bug_code_uid": "628cdfb273d05e304d0439c6cc256007", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "8e5f98fd7decc6206867e3a6e70089d3", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3058252427184466, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "st = gets.split\nn=st[0].to_i\n\narray=[1,0,18,0,1800,0,180000,0,18000000,0,1800000000,0,18000000000,0,1800000000000,0]\n\nputs array[n-1]%1000000007", "lang": "Ruby", "bug_code_uid": "8f797ee365252ace663f00df57886324", "src_uid": "a6a804ce23bc48ec825c17d64ac0bb69", "apr_id": "5317030db3f0777ad6a8ad2bc77ebef0", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "combinatorics", "bitmasks", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6757215619694398, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,pos,l,r = gets.split.map(&:to_i)\nif r <= pos\n t = l==1 ? -r+1 : -l+2\n ans = pos + t\nelsif l >= pos\n t = r==n ? l+1 : r+2\n ans = t - pos\nelse\n a = l==1 ? 0 : pos-l+1\n b = r==n ? 0 : r-pos+1\n c = (a==0 || b==0) ? 0 : [pos-l,r-pos].min\n ans = a + b + c\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "fc0499b483fabe3fd1d238edcf79f5b8", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "9623df6d3e9334033050addcdb69b267", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7924528301886793, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n = gets.chomp.to_i\nk = gets.chomp.to_i\n\nk.times do\n if n % 10 == 0 then\n n = n / 10\n else\n n = n - 1\n end\nend\nputs n", "lang": "Ruby", "bug_code_uid": "37a7daaa7b9d83ba1fa892d7a10ccaab", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "d4b85822e5c7e51ee12772596385cf43", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.029758214507129573, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "a = \"111111101010101111100101001111111100000100000000001010110001000001101110100110110000011010001011101101110101011001001111101001011101101110101100011000111100101011101100000101010101011010000101000001111111101010101010101010101111111000000001111101111100111100000000100010111100100001011110111111001110111001111111100100001000101100011100111010000101000111010001010011110000110001111110101100000011111111111111111000111001001011000111000010111010011010011010100100101010100010110010110101010000010101100000101010001111101000000000000010100011001101000111101011010101001001111101111000101010001110101101111111000100100001110001000000010011000100110000011010000010001101101001101110010010011011000011101011010001000111101010100110111010100110011101001101000001110110001010010101111000101111111000001000111011100001010110111110000000000001110010110100010100010110111111101000101111000110101011010100000100111010101111100100011011101110101001010000101000111111000101110100011010010010111111011010101110100100011011110110101110000100000100110011001111100111100000111111101101000101001101110010001\"\nr,c = gets.split(\" \").collect {|x| x.to_i}\nputs a[r*33+c]", "lang": "Ruby", "bug_code_uid": "67656dcb3f8b894d1fd337501d1c65b7", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "c10adbe08902cee902d6bb3068a39997", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9702702702702702, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "PRESIDENTS = <0)\n x = x + (b*2+1)*(n/2)\n n = n/2 + n%2\nend\nputs x.to_s + \" \" + y.to_s", "lang": "Ruby", "bug_code_uid": "12cdbf7b9d908540d09e17bc9a09be0f", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "33c8830f93664555d38547d69eb6d410", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6900826446280992, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "n=gets.to_i\na = gets.split(' ').join('').gsub(/^0+|0+$/, '').split('')\na = a.map(&:to_i)\nd = 1\nds = [1]\nfor i in a\n if i == 0\n d+=1\n else\n ds << d\n d = 1\n end\nend\nputs ds.reduce(&:*)", "lang": "Ruby", "bug_code_uid": "67145c03c70edbc6b27dd497ed7f4e7f", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "8d42e95f208bced4a09d558aa95fee2e", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.96045197740113, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = gets.split.map(&:to_i)\ns = a.join\nt = a.inject(:+)\nans = 1\n(t - 1).times do\n ss = s.scan(/10*1/)[0]\n ans *= (ss.size - 1)\n s.gsub!(ss, '1')\nend\np ans\n", "lang": "Ruby", "bug_code_uid": "5a495e6229f6ffd5b1a2b02795304afc", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "4c1e86fc966040aa540cbaf88529638e", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9138576779026217, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = [0] + gets.split.map(&:to_i) + [0]\naa = a.join.split('1')[1..-2]\np aa.map{|x| x.size + 1}.reduce(1, :*)\n", "lang": "Ruby", "bug_code_uid": "dcf0b74af77869e9ecae9ace23d5f23b", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "4c1e86fc966040aa540cbaf88529638e", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9079365079365079, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=gets.to_i\na=gets.chomp.split.map(&:to_i)\nt=1\nl=0\nwhile(a[l]!=1) do l+=1 end\n(l+1...n).each do |i|\n\tif (a[i]==1)\n\t\tt*=(i-l)\n\t\tl=i\n\tend\nend\np t", "lang": "Ruby", "bug_code_uid": "1490905ac9bb8738873df6bc2ee195a2", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "34cbc64dcd2e3cb858d9fd0f5ba6a50c", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8914956011730205, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w, m = gets.split.map(&:to_i)\n\nbase = []\nwhile m > 0 do\n base << m % w\n m /= w\nend\n\nbase.fill(0, base.size, 100)\n\nresult = \"YES\"\nfor i in 0...100\n if base[i] > 1 and base[i] == w - 1 and \n base[i + 1] += 1\n elsif base[i] > 1\n result = \"NO\"\n break\n end\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "eeb416d6d64d05ad43c89e2515607b9e", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "4a3bb59d2f71e0c62a5ad35822b9acf1", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.011111111111111112, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "# Definition for singly-linked list.\nclass ListNode\n attr_accessor :val, :next\n def initialize(val)\n @val = val\n @next = nil\n end\nend\n\n# @param {ListNode} head\n# @param {Integer} val\n# @return {ListNode}\ndef remove_elements(head, val)\n p = head\n h = nil\n t = nil\n until p.nil?\n if p.val != val\n s = ListNode.new(p.val)\n if h.nil?\n h = t = s\n else\n t.next = s\n t = s\n end\n end\n p = p.next\n end\n h\n\nend\n\ns = ListNode.new(1)\ns.next = ListNode.new(1)\np remove_elements(s,2)", "lang": "Ruby", "bug_code_uid": "f85742cb704b633e8129ab709fe2a82a", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "e7e7b0006fc7bd894eaf314fe9520cf0", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9475982532751092, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "require 'pp'\ndef stdin_int; STDIN.gets.chomp.to_i; end\ndef stdin_ints; STDIN.gets.chomp.split(/ /).map(&:to_i); end\n\nnum = stdin_int\n\ntaiou = [2, 7, 2, 3, 2,\n 3, 2, 5, 1, 2]\n\na =num/10\nb =num%10\n\nputs taiou[a] * taiou[b]\n", "lang": "Ruby", "bug_code_uid": "2ff83d249424dfa3795991d9431226b5", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "6648b2394e589a4d2a28f8e7810e68c9", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9859154929577465, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "puts (gets.chomp.split \"\").map{|x| \"2723343512\"[x.to_i].to_i}.reduce :*", "lang": "Ruby", "bug_code_uid": "e91d134ab4f3de889e79b936cef673f5", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "9b2d031f91cbc7d6eb4ae331a44c1aa1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9948717948717949, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, b = gets.split('')\na, b = a.to_i, b.to_i\n\narr = []\narr << 2 #0\narr << 6 #1\narr << 2 #2\narr << 3 #3\narr << 3 #4\narr << 4 #5\narr << 2 #6\narr << 5 #7\narr << 1 #8\narr << 2 #9\n\nputs arr[a] * arr[b]", "lang": "Ruby", "bug_code_uid": "87842017bd527c533d2db18948acafba", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "9a8f9d89e338579b7bdb579e6666b5a1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9311827956989247, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "l,r = gets.split\n\nk=0\n\nl1 = l.clone\nr1 = r.clone\n\nl1[-1] = l1[0]\nif l1.to_ir.to_i then\n r1=(r1.to_i-10).to_s\n r1[-1]=r1[0]\nend\n\ndef count(b,e,x)\n (e-b+1)*(10**([x-2 ,0].max))\nend\n\ndef ans(s)\n z=0\n (1..s.length-1).each do |por|\n z+=count(1,9,por) \n end\n z+=count(1,s[0].to_i-1,s.length)+s[1..-2].to_i+1\nend\nputs r1\nk+=ans(r1)\nk-=ans(l1)\nk+=1\nputs k\n", "lang": "Ruby", "bug_code_uid": "1d911d2246f76ff841bad3efaad5a9a1", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "d365494078c3e9543d257bf0938875c7", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9265658747300216, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "l,r = gets.split\n\nk=0\n\nl1 = l.clone\nr1 = r.clone\n\nl1[-1] = l1[0]\nif l1.to_ir.to_i then\n r1=(r1.to_i-10).to_s\n r1[-1]=r1[0]\nend\n\ndef count(b,e,x)\n (e-b+1)*(10**([x-2 ,0].max))\nend\n\ndef ans(s)\n z=0\n (1..s.length-1).each do |por|\n z+=count(1,9,por) \n end\n z+=count(1,s[0].to_i-1,s.length)+s[1..-2].to_i+1\nend\nputs r1\nk+=ans(r1)\nk-=ans(l1)\nk+=1\nputs k\n", "lang": "Ruby", "bug_code_uid": "de3293652f29b179f93dcfe72a18ae8a", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "d365494078c3e9543d257bf0938875c7", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9779411764705882, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a, b = gets.split.chomp.map &:to_i\ns = gets.chomp.chars.map{|x|x.ord-'a'.ord+1}.sort\nres = []\ni = 0\n\nwhile i < a && res.size != b\n if res.size < 1\n res << s[i]\n elsif (res[-1] - s[i]).abs > 1\n res << s[i] \n end\n i += 1\nend\n\np res.size < b ? -1 : res.reduce(:+)", "lang": "Ruby", "bug_code_uid": "aacec88a28aee0d47e694da3f48ca25c", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "817ce38d45b94fe30ecbf5438e84a187", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7822878228782287, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "a, b = gets.split.map &:to_i\ns = gets.chars.map{|x|x.ord-'a'.ord+1}.sort\nres = []\ni = 0\nwhile i < a - 1 && res.size != b\n if res.size < 1\n res << s[i]\n elsif res[-1] - s[i] > 1\n res << s[i] \n end\n a += 1\nend\nif res.size == b\n puts res.sum\nelse\n puts -1\n end", "lang": "Ruby", "bug_code_uid": "646efd6140b5f3341560559a5ba0c88a", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "817ce38d45b94fe30ecbf5438e84a187", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9774436090225563, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a, b = gets.split.map &:to_i\ns = gets.chars.map{|x|x.ord-'a'.ord+1}.sort\nres = []\ni = 0\n\nwhile i < a && res.size != b\n if res.size < 1\n res << s[i]\n elsif (res[-1] - s[i]).abs > 1\n res << s[i] \n end\n i += 1\nend\n\np res.size < b ? -1 : res.reduce(:+)", "lang": "Ruby", "bug_code_uid": "e3ce42958bf77ecdc6396bb0bcd164b3", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "817ce38d45b94fe30ecbf5438e84a187", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.896551724137931, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "userInput = gets.chomp\nresult = 0\n\nnumberArray = userInput.to_s.split(\"\").map {|item| item.to_i }\n\nloopNum = 0\n\nuntil loopNum == numberArray.length do\n\tresult += (numberArray.length - loopNum) if numberArray[loopNum] == 4\n\tresult += (2 * (numberArray.length - loopNum)) if numberArray[loopNum] == 7\n\n\tloopNum += 1\nend\n\n\nputs result", "lang": "Ruby", "bug_code_uid": "20282dd1e59652a21cc936adbd4bba43", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "d0ca4da64be5651b302ce22ba17a60d8", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8945868945868946, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "number = gets.chomp()\n\nnumber.reverse!\n\nsum = 0\n\nfor i in 0..number.length\n\tif number[i] == '4'\n\t\tsum += (2 ** i) \n\telse\n\t\tsum += (2 ** i) * 2\n\tend\nend\n\nputs sum\n\n\n\n", "lang": "Ruby", "bug_code_uid": "eb6d65d4de2c792d1f9a1c46c03ca976", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "edb404aebbb029d3ac4f32c9236bcdbe", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9983460138934833, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#! ruby\n# Try Codeforces\n# author: Leonardone @ NEETSDKASU\n############################################################\ndef gs() gets.chomp end\ndef gi() gets.to_i end\ndef gss() gs.split end\ndef gis() gss.map(&:to_i) end\ndef nmapf(n,f) n.times.map{ __send__ f } end\ndef ngs(n) nmapf n,:gs end\ndef ngi(n) nmapf n,:gi end\ndef ngss(n) nmapf n,:gss end\ndef ngis(n) nmapf n,:gis end\ndef arr2d(h,w,v=0) h.times.map{[v] * w} end\ndef for2p(hr,wr,&pr) hr.each{|i|wr.each{|j| yield(i,j)}} end\ndef nsum(n) n * (n + 1) / 2 end\ndef vcount(d,r=Hash.new(0)) d.inject(r){|m,e| m[e]+=1;m} end\n############################################################\n\nrequire 'set'\n\nn = gi\nx = gis\n\nh1 = Set.new\nh1.add [0, 0, 0, -1]\n\nx.each do |z|\n h2 = Set.new\n h1.each do |c, s, r, e|\n case z\n when 0\n h2.add [c, s, r + 1, 2]\n when 1\n if e != 0\n h2.add [c + 1, s, r, 0]\n end\n h2.add [c + 1, s, r + 1, 2]\n when 2\n if e != 1\n h2.add [c, s + 1, r, 1]\n end\n h2.add [c, s, r + 1, 2]\n when 3\n if e != 0\n h2.add [c + 1, s, r, 0]\n end\n if e != 1\n h2.add [c, s + 1, r, 1]\n end\n h2.add [c, s, r + 1, 2]\n end\n end\n h1 = h2\nend\n\nans = nil\nh1.each do |c, s, r, e|\n next if c != s\n if ans.nil?\n ans = r\n else\n ans = [ans, r].min\n end\nend\n\nif ans.nil?\n puts 0\nelse\n puts ans\nend", "lang": "Ruby", "bug_code_uid": "c242c3f40f41fb756f666d7f3f170dbb", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "b992d9f5aaa0a5d2cb41e85626863638", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9637010676156583, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nnumbers = gets.split(' ').map { |x| x.to_i }\n#0, 1, 2 ,3\n\nn_arr = []\ns_arr = []\nc_arr = []\n\ni = 0\n\nwhile(i < n) do\n if (i == 0)\n n_arr.push 0\n s_arr.push (numbers[i]==1 || numbers[i] == 3) ? 1 : 0\n c_arr.push (numbers[i]==2 || numbers[i] == 3) ? 1 : 0\n else\n n_arr.push [n_arr[i-1], c_arr[i-1], s_arr[i-1]].max\n s_arr.push (numbers[i]==1 || numbers[i] == 3) ? [c_arr[i-1]+1, n_arr[i], n_arr[i-1] + 1].max : n_arr[i]\n c_arr.push (numbers[i]==2 || numbers[i] == 3) ? [s_arr[i-1]+1, n_arr[i], n_arr[i-1] + 1].max : n_arr[i]\n end\n #puts n_arr[i].to_s + ':' + s_arr[i].to_s + ':'+c_arr[i].to_s\n i = i + 1\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "fe2dfbc96667a4f51845579e96c1dbfc", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "6e8741b8a7119f8e05dea4c14e590b37", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9989637305699481, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.split(\" \").map(&:to_i)\narr = gets.split(\" \").map(&:to_i)\n\n#puts \"n: #{n}\"\n#puts \"k: #{k}\"\n#puts \"arr: #{arr}\"\n\nraise \"input error : n or k\" if k > n || 0 > k || n >= 50\nraise \"input error : arr\" if arr != arr.sort {|a, b| b <=> a }\n\nk_point = arr[k-1]\nif k_point > 0 \n puts arr.select{|a| a >= k_point}.count\nelse\n puts arr.select{|a| a > k_point}.count\nend\n\n=begin\nk_point > 0 k\u4ee5\u4e0a\u306e\u70b9\u6570\u7372\u5f97\u8005\u6570\nk_point = 0\n\u3000k_point\u4ee5\u4e0a\u304c\u5b58\u5728\u3059\u308b(k+1) k+1\u4ee5\u4e0a\u306e\u70b9\u6570\u7372\u5f97\u8005\u6570\n\u3000k_point\u4ee5\u4e0a\u304c\u5b58\u5728\u3057\u306a\u3044(!k+1) 0\n\n\u4ee5\u4e0a \n=end", "lang": "Ruby", "bug_code_uid": "8133a15695e356e3ce0d8995c5bfae77", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "8f30a41dcb9db183c39923643a208ec6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9956521739130435, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets(' ').to_i\nk = gets.to_i\ninput = gets.split.collect{|element| element.to_i}.sort.reverse\ncutoff = [1, input[k]].max\ncount = 0\ninput.each do |element|\n if element >= cutoff\n count = count+1\n end\nend\nputs count", "lang": "Ruby", "bug_code_uid": "e2f24b9eecbf99b3d152a4c6efbb049a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "4692c4986220b2f6a589a1a4bc018155", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.32989690721649484, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "n,k = gets.chomp.split(' ').map!{ |o| o.to_i }\nnums = gets.chomp.split(' ').map!{ |o| o.to_i }\n\nputs k + nums[k..n].count n[k]\n\n\n", "lang": "Ruby", "bug_code_uid": "676d8a95e6fbbe432a7e1fed0fa087e3", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2a324e95bb31b438259da2a9ea43c73a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7246376811594203, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "a= $stdin.read.split.map &:to_i\np a[2..a.size].count{|_|_>=[1,a[m+1]].max}", "lang": "Ruby", "bug_code_uid": "3d679326dd718f967d86f77181cdd1af", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2a324e95bb31b438259da2a9ea43c73a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9693877551020408, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "_, k = gets.split.map(&:to_i);\nk-=1\nputs gets.split.map(&:to_i).count { |x| x>= a[k] and x > 0 }", "lang": "Ruby", "bug_code_uid": "ee3d25f88e7c39851cffcf06c6542ae4", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "fe23bdeb3d557023407329e8b654c74f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9913793103448276, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k = gets.split(\" \").map(&:to_i)\na = gets.split(\" \").map(&:to_i)\n\nr = a[k]\nputs a.keep_if {|x| x>=r && x > 0}.size", "lang": "Ruby", "bug_code_uid": "2b07bf52a34d0a5f1966c6a681e5b23e", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "d71253132e64860e59ce7a0f72b361a1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9866666666666667, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "N, t = gets.split.map(&:to_i) \nms = gets.split.map(&:to_i) \nw = if ms[t] < 1 \n 1\n else\n ms[t]\n end\nputs ms.select{|m| m >= w}.size", "lang": "Ruby", "bug_code_uid": "a1175c056de4e5cbc3117206bf9dbe2b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "7e8fd75dfa661d47a3c1b7e4b235f609", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5014749262536873, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "base = gets.chomp().split(' ').map {|value| value.to_i }\nplaces = gets.chomp().split(' ').map {|value| value.to_i }\n\nlowest = places[base[-1]]\nputs places.select { |item| item >= lowest and item > 0 }.size", "lang": "Ruby", "bug_code_uid": "2ac8eb7a425b35fb2e667dc7e0102898", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9aab77772762915dcdba3106aae132ff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9921259842519685, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = gets.chomp.split(' ').to_a\nn = a[0].to_i\nk = a[1].to_i\na = gets.chomp.split(' ').to_a\nb = a.map { |x| x.to_i }\nres = 0\nb.each do |x|\n res = res + 1 if x >= b[k] && x > 0\nend\nputs res", "lang": "Ruby", "bug_code_uid": "a821946ce3fbf56971858b38db72043d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "8d6d5eff65a4f66f815869a05cd765cb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9946808510638298, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.chomp.split(' ').map{|a| a.to_i}\n\n\n\nscores = gets.chomp.split(' ').map{|a| a.to_i}\n\n\ncount = 0\n\nscores.each do |s|\n count += 1 if s >= scores[k] && s > 0\nend\n\nputs count.to_s", "lang": "Ruby", "bug_code_uid": "d17db85b1f2ea51fc078ecf6dd52bb76", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "0679e6edb76eb14070334c47b333aa36", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8478964401294499, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n, k = gets.chomp.split\narr = gets.chomp.split\narr.map!(&:to_i)\nc = 0\n(0...arr.length).each do |i|\n c += 1 if arr[i] > k\nend\np c", "lang": "Ruby", "bug_code_uid": "0ff14404775e9d3299d15708387d4e0b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "5e066d1b97fd1b2d1a054c29583d5f50", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9257142857142857, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n,k = gets.split.map &:to_i\na = gets.split.map &:to_i\n\np a.count {|x| if x > a[k-1]}", "lang": "Ruby", "bug_code_uid": "a5f31efa940e1249669def44b01ead62", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c283287f730544ffc23a33a1b5348f63", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9874213836477987, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "inp=gets.split\nn=inp[0].to_i\nk=inp[1].to_i\na=gets.split\na.map! {|x| x.to_i}\n\nb=a[k-1]\n\na.map! {|x| (x>=b) & (x!=0)}\n\na.each {|x| (x==true) ? c+=1:''}\nputs c\n", "lang": "Ruby", "bug_code_uid": "7051341072719b61211c12f95b8dfd07", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "e8c7e0961a6e3a7fbc0c7c6dc0dbc150", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9917355371900827, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k = gets.split.map {|x| x.to_i}\n\nq = gets.chomp.split.map { |x| x.to_i }\n\np q.select { |a| a >= q[k] and a > 0 }.size", "lang": "Ruby", "bug_code_uid": "d0c11d8d07f107cbfaa46fc25e53d00c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "879ea32b846feef58ff81c57d03e560c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7058823529411765, "equal_cnt": 32, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 16, "fix_ops_cnt": 32, "bug_source_code": "n, k = STDIN.readline.split ' '\nn, k = n.to_i, k.to_i\n\nresults = STDIN.readline.split ' '\nresults.map! {|x| x.to_i}\n\ncount, lim = 0, results[k]\n\nresults.each {|x| if x > 0 && x >= lim then count += 1 end}\n\nputs count\n", "lang": "Ruby", "bug_code_uid": "12bb08cf15b38ae47e3cfd62ff2ff33c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "aeec7feb37b148460dd827deaf7350b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6099290780141844, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "n_and_d = gets.split(\" \")\nprices = gets.split(\" \")\nnumber_of_clients = gets.to_i\neach_price = []\ntotal_received = 0\nprices.each do |price|\n\teach_price << price.to_i\nend\n\nn = n_and_d[0].to_i\nd = n_and_d[1].to_i\n\nto_be_payed = (number_of_clients - n) * d\n\nif number_of_clients <= n\n\tfor client in 0..number_of_clients-1\n\t\ttotal_received += each_price[client]\n\tend\nelse\n\teach_price.each do |sum|\n\t\ttotal_received += sum\n\tend\nend\nputs total_received - to_be_payed", "lang": "Ruby", "bug_code_uid": "41ec025a92529594f58e903d7a581019", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "714acbf81b05011e88288d9d21ba1e1b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5279642058165548, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n_and_d = gets.split(\" \")\nprices = gets.split(\" \")\nnumber_of_clients = gets.to_i\neach_price = []\ntotal_received = 0\nprices.each do |price|\n\teach_price << price.to_i\nend\nfor client in 0..number_of_clients-1\n\ttotal_received += each_price[client]\nend\n\nn = n_and_d[0].to_i\nd = n_and_d[1].to_i\n\nto_be_payed = (number_of_clients - n) * d\n\nputs total_received - to_be_payed", "lang": "Ruby", "bug_code_uid": "321a89db9bad29a7190c5388c9540654", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "714acbf81b05011e88288d9d21ba1e1b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7891156462585034, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/env ruby\nn = gets.to_i\nk = 0\nloop do\n if n % (3**k) != 0\n puts((n / (3.0**k)).ceil)\n break\n end\n k += 1\nend\n", "lang": "Ruby", "bug_code_uid": "5dff12b20dd4563b3f892f2512b5e758", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "96f03891207a7c60dd35dee3108dd4b0", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.918918918918919, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nputs gets.chomp.chop[-1..-1].scan(/[AEIOUYaeiouy]/).size>0 ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "b482c39c4011ba0c789530c34d9c7d6a", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "c56906955fdd8330530d846c91a4f05c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9973890339425587, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp.upcase!\n\nlast = ''\ns.chars.each do |ss|\n if (\"A\"..\"Z\").include?(ss)\n last = ss\n end\nend\n\nif ['A', 'E', 'I', 'O', 'U', 'Y'].include?(last)\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "ea576a2b4e94067b4f6822cdcf802b8e", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "3568d0c5735453dc63883682d7375128", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8970588235294118, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "class String\n def glasn?\n %w(a e i o u y).include? s[0].downcase\n end\nend\n\ns=gets\nf=false\ns[0..-2].strip[-1].glasn? ? \"Yes\" : \"No\"", "lang": "Ruby", "bug_code_uid": "b9e5a76c55db00a34c4cbd8cbe0b61b5", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "d30d59b97799237ad459a25e5a04a20d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8992248062015504, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts gets.chomp =~ /(a|e|i|o|u|y)(\\s?)\\?$/i ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "9d28657c14e45a02aa6c261593edb2af", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "72879b95f792ca11dbe547c9788b1776", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.04293628808864266, "equal_cnt": 15, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "googlerese = {\n ?a.ord => \"y\",\n ?b.ord => \"h\",\n ?c.ord => \"e\",\n ?d.ord => \"s\",\n ?e.ord => \"o\",\n ?f.ord => \"c\",\n ?g.ord => \"v\",\n ?h.ord => \"x\",\n ?i.ord => \"d\",\n ?j.ord => \"u\",\n ?k.ord => \"i\",\n ?l.ord => \"g\",\n ?m.ord => \"l\",\n ?n.ord => \"b\",\n ?o.ord => \"k\",\n ?p.ord => \"r\",\n ?q.ord => \"z\",\n ?r.ord => \"t\",\n ?s.ord => \"n\",\n ?t.ord => \"w\",\n ?u.ord => \"j\",\n ?v.ord => \"p\",\n ?w.ord => \"f\", # !> statement not reached\n ?x.ord => \"m\",\n ?y.ord => \"a\",\n ?z.ord => \"q\" \n}\n\ninput = ARGV[0]\n# input = 'a_test.txt'\nopen(input) do |f|\n t = f.gets.to_i\n t.times do |i|\n line = f.gets\n print \"Case \\##{i + 1}: \"\n line.each_byte do |p|\n if ch = googlerese[p]\n print ch\n elsif p == ?\\n.ord\n next\n else\n print ' '\n end\n end\n puts\n end\nend\n# >> Case #1: our language is impossible to understand\n# >> Case #2: there are twenty six factorial possibilities\n# >> Case #3: so it is okay if you want to just give up\n", "lang": "Ruby", "bug_code_uid": "02a06d66d1ecbc85da1c105c57bb925d", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "9632940fc964066eefa0528898f008c6", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9915074309978769, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def invalid?(s)\n (s[0] == \"0\" and s.size > 1) or s.size > 10**6\nend\n\nARGF.each_line do |line|\n max = -1\n digit = line.chomp!.size\n 1.upto(digit) do |i|\n 1.upto(digit - i - 1) do |j|\n k = digit - i - j\n\n a = line[0...i]\n b = line[i...(i + j)]\n c = line[(i + j)...digit]\n if invalid?(a) or invalid?(b) or invalid?(c)\n next\n end\n point = a.to_i + b.to_i + c.to_i\n max = point if max < point\n end\n end\n puts max\nend\n", "lang": "Ruby", "bug_code_uid": "6b4b254684ad9e603ded4cb78bb651d4", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "9632940fc964066eefa0528898f008c6", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9074074074074074, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = gets.strip\nP=1000000\nn = s.size\n#puts 'ok' if \"09\" != \"0\" and \"09\"[0] == \"0\"\nans = -1\n(0...n).each do |i|\n (i+1...n).each do |j|\n\n iv = s[0...i]\n jv = s[i...j]\n kv = s[j...n]\n #\"%s %s %s %d\\n\" % [iv,jv,kv,ans]\n next if iv.empty? or jv.empty? or kv.empty?\n next if iv != '0' and iv[0] == '0'\n next if jv != '0' and jv[0] == '0'\n next if kv != '0' and kv[0] == '0'\n ans = [ans,iv.to_i+jv.to_i+kv.to_i].max\n\n #p [iv,jv,kv,ans]\n\n end\nend\n\nputs ans\n\n", "lang": "Ruby", "bug_code_uid": "9cc73fb010e5f40ecf2fc6f1f1f914e9", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "f185979483bfd3abaa481cbaea289c67", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.309662398137369, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "s = gets.chomp\nans = -1\ns.size.times do |i|\n (i + 1).upto(s.size - 1) do |j|\n (j + 1).upto(s.size - 1) do |k|\n a, b, c = s[0..i], s[(i + 1)..j], s[(j + 1)..k]\n next if a.size > 1 and a[0] == ?0\n next if b.size > 1 and b[0] == ?0\n next if c.size > 1 and c[0] == ?0\n next if a.to_i > 1e6.to_i\n next if b.to_i > 1e6.to_i\n next if c.to_i > 1e6.to_i\n ans = [ans, a.to_i + b.to_i + c.to_i].max\n end\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "36518c73c98773fb1ff24f9aa0da31e8", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "f68f95a9b1c3eddd9363b428945ca41d", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9031007751937985, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a, b, c = gets.chomp.split(' ')\n\na = a.to_i\nb = b.to_i\nc = c.to_i\n\nfound = 0\n\nfor position in 1..1000000\n a = a * 10 if a < b\n if ( a / b ).to_i == c\n print position.to_s + \"\\n\"\n found = 1\n break\n end\n a = a % b\nend\n\nputs \"-1\" if not found\n", "lang": "Ruby", "bug_code_uid": "850aa12b881f68f0b410a39aa189d92d", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "6bb703465e7fbd1320747b8a154d2433", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9941520467836257, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "require 'set'\na, b, c = gets.split.map(&:to_i)\ns = Set.new\ni = 0\nwhile i != -1\n a %= b\n i = -2 if s.include? a\n s.add a\n a *= 10\n break if c == a / b\n i += 1\nend\np i", "lang": "Ruby", "bug_code_uid": "6777a852ab4a942115a81ac0e966436e", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "9bcb012524d89358c6d61e1a77bf7da4", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.12663755458515283, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = gets.chomp.to_i\nactN=n\na = gets.chomp.to_i\nb = gets.chomp.to_i\nc = gets.chomp.to_i\ntotb=0\nwhile n >= b do\n\tgb = n/b\n\ttotb+=gb\n\tn = (n%b)+gb*c\nend\nif n >= a\n\ttotb += n/a\nend\nif b <= a\n\tputs totb\nelse\n\tputs [totb,actN/a].max\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "f5eb492b130656e2ed7d38a713a6c3f5", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "d55bb4109191156a145a40e34d0b517e", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5211267605633803, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\na = gets.chomp.to_i\nb = gets.chomp.to_i\nc = gets.chomp.to_i\n\nif n < a && n < b\n\tputs 0\nend\nif b-c <= a && n > b\n\tputs 1+(n-b)/(b-c)+((n-b) % (b-c))/a\nelse\n\tputs (n/a)+(n%a)/b\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "dd2bffbc871a301ce99b452156cd84a0", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "d55bb4109191156a145a40e34d0b517e", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9716446124763705, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.to_i\na = gets.chomp.to_i\nb = gets.chomp.to_i\nc = gets.chomp.to_i\n\nl = 0\nr = n + 1\nm = (l + r) / 2\n\nwhile l < m && m < r\n if 0 <= n - m * b + (m - 1) * c\n l = m\n else\n r = m\n end\n m = (l + r) / 2\nend\n\nputs m + (n - m * b + m * c) / a\n", "lang": "Ruby", "bug_code_uid": "0b3c7e6a015d9fdfd5a86d6551082720", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "9fea9810506bc8296e585e5710b2ee48", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9027777777777778, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "class Solver\n\tdef main\n\t\tn = gets.to_i\n\t\ta = gets.to_i\n\t\tb = gets.to_i\n\t\tc = gets.to_i\n\t\tif b - c >= a\n\t\t\tputs n / a\n\t\telse\n\t\t\tans = 0\n\t\t\tif n >= c\n\t\t\t\tans += (n - b) / (b - c)\n\t\t\t\tn -= (n - b) / (b - c) * (b - c)\n\t\t\tend\n\t\t\tans += n / [a, b].min\n\t\t\tputs ans\n\t\tend\n\tend\nend\nSolver.new.main", "lang": "Ruby", "bug_code_uid": "244f5c6ccbaeb0748a55dcd4cf67e54c", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "ee43230334aec30775259a62759cc1c0", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9936305732484076, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\n\narr = gets.chomp.split(\" \").map(&:to_i)\nd = arr.pop\n\na = arr.sort\nright = a[2] - a[1] # 5 - 3 = 2\nleft = a[1] - a[0] # 3 - 1 = 2\ntime = 0\ntime += (d - right) if right < d\ntime += (d - left) if left < d\n\nputs times\n", "lang": "Ruby", "bug_code_uid": "3c08e0d3b800abe863baf3259f339f11", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3", "apr_id": "5fa17361a13217046d024798b173a968", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4632768361581921, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 23, "bug_source_code": "a,b,c,d = gets.split.map(&:to_i)\npos = [a,b,c].sort\nk = [pos[2]-pos[1],pos[1]-pos[0]].min\nl = [pos[2]-pos[1],pos[1]-pos[0]].max\nt = pos[2]-pos[0]\nif t < 2*d\n x = t-k\n p k+(2*d-t) >= d ? 2*d-t : d-k + (l0? x1+=1:x1-=1\n\ty>0? y1+=1:y1-=1\n\t\n\t$pasos+=1\nend\n\nprint $pasos", "lang": "Ruby", "bug_code_uid": "ce12a94534bc7e0394bff60977587f97", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "ba8bd60c0520b8f7c7c62f9f29ac7f70", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.49635036496350365, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "fox = gets.split.map(&:to_i)\ncox = gets.split.map(&:to_i)\n\ncounter = 0\nuntil fox == cox\n fox[0].freeze if fox[0] == cox[0]\n fox[1].freeze if fox[1] == cox[1]\n fox[0] < cox[0] ? fox[0]+=1 : fox[0]-=1\n fox[1] < cox[1] ? fox[1]+=1 : fox[1]-=1\n counter+=1\nend\n\nputs counter\n", "lang": "Ruby", "bug_code_uid": "b95f6b8baa02e3bbbf437cf8a8ded0c9", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "41853def2159114d377f24f7c1ab6abd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9444444444444444, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "fox = gets.split.map(&:to_i)\ncox = gets.split.map(&:to_i)\n\nroz = (cox[0].abs - fox[0].abs).abs\nvoz = (cox[1].abs - fox[1].abs).abs\n\nputs [roz, voz].max\n", "lang": "Ruby", "bug_code_uid": "85680db5206f69a0f9cc4b85f1f7434d", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "41853def2159114d377f24f7c1ab6abd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.808641975308642, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "x1, y1 = gets.chomp.split(\" \").map(&:to_i)\nx2, y2 = gets.chomp.split(\" \").map(&:to_i)\nd = (x1 - x2).abs() + (y1 - y2).abs()\nif d.even? then\n puts d / 2\nelse\n puts (d + 1)/2\nend", "lang": "Ruby", "bug_code_uid": "e8c9bc97f676b79ee731d9a18f146cc5", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "dcd675622154a37005340a0642771e7b", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9678615574783683, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "N = gets.chomp\ndigits = Hash.new(0)\nN.chars do |c|\n digits[c] += 1\nend\n\nnums = ('0'..'9').map{|i| digits[i]}.select{|n| n > 0}\nmax = nums.inject(:*)\n\ncomb = Array.new(19){Array.new(19, 0)}\ncomb[0][0] = 1\n19.times do |i|\n 19.times do |j|\n comb[i][j] += comb[i-1][j-1] if i>0 && j>0\n comb[i][j] += comb[i-1][j] if i>0\n end\nend\n\nans = 0\n(0...max).each do |i|\n use = []\n nums.each do |n|\n use.push(i % n + 1)\n i /= n\n end\n sum = use.inject(:+)\n prod = 1\n use.each do |u|\n prod *= comb[sum][u]\n sum -= u\n end\n ans += prod\n\n if digits['0'] > 0\n use[0] -= 1\n sum = use.inject(:+)\n prod = 1\n use.each do |u|\n prod *= comb[sum][u]\n sum -= u\n end\n ans -= prod\n end\nend\np ans", "lang": "Ruby", "bug_code_uid": "0224385ae6c74c05a4e07b3179921274", "src_uid": "7f4e533f49b73cc2b96b4c56847295f2", "apr_id": "6e79d71995a57f0f2d27827d92f26dee", "difficulty": 1800, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.976, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a=[]\ngets.to_i.times {\na.push [gets(' ').to_i,gets.to_i]\n}\n\nret=0\n\nfor h in a\nfor g in a\nif h==g\nret+=1\nend\nend\nend\n\np ret", "lang": "Ruby", "bug_code_uid": "872d2925314438351c597f6be8bff175", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "5745a120e35af7e9233ede03e169119b", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9970501474926253, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nclass Counter < Hash\n\tdef initialize(a=[])\n\t\tsuper\n\t\tself.default=0\n\t\ta.each{|e|self[e]+=1}\n\tend\n\tdef self.[](*a)\n\t\tnew(a)\n\tend\nend\ndef Counter(a=[]) Counter.new(a) end\n\nn=gets.to_i\na=Counter(gets.split.map &:to_i)\nb=Counter(gets.split.map &:to_i)\nr=0\np (1..6).all?{|i|\n\t(a[i]+b[i])%2<1 && r+=(a[i]-b[i]).abs/2\n} ? s/2 : -1", "lang": "Ruby", "bug_code_uid": "c3d1ffc7e3f8245ca752f9db9b6ffda6", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "c43f5412c53a466d4a309f4d064033ef", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8878127522195319, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=gets.chomp.to_i\na=Array.new(6,0)\nb=Array.new(6,0)\ninteger=gets.chomp.split(\" \")\ninteger.each do |integer|\n #puts \"a=#{integer}\"\n a[integer.to_i]+=1;\nend\ninteger=gets.chomp.split(\" \")\ninteger.each do |integer|\n #puts \"b=#{integer}\"\n b[integer.to_i]+=1;\nend\natob=0\ncan=1\n#for i in 1..5\n# puts \"#{i} #{a[i]} #{b[i]}\"\n#end\n\nfor i in 1..5\n if a[i] > b[i]\n if (a[i]-b[i])%2!=0\n can=0\n break\n end\n atob+=(a[i]-b[i])/2;\n end\n #\u611f\u89c9\u53ea\u8981\u5904\u7406\u4e00\u79cd\u60c5\u51b5\u5c31\u53ef\u4ee5\uff01\nend\nif can==1\n puts atob\nelse\n puts -1\nend\n", "lang": "Ruby", "bug_code_uid": "31335631421aea6fc7d1db45ce67b7bb", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "f58efc56d12c2498bae1e2e257c9dd26", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9625385632437197, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\nPOSSIBLES = [\n [[1, 2], [18, 20], [11, 12], [13, 15]],\n [[3, 4], [17, 19], [9, 10], [14, 16]],\n [[2, 4], [6, 8], [10, 12], [21, 23]],\n [[1, 3], [5, 7], [9, 11], [22, 24]],\n]\n\n\nFACES = [\n (1..4).to_a,\n (5..8).to_a,\n (9..12).to_a,\n (13..16).to_a,\n (17..20).to_a,\n (21..24).to_a,\n]\n\ndef check_solved(c)\n FACES.each do |face|\n return false unless face.map { |f| c[f] }.uniq.size == 1\n end\n true\nend\n\ndef solve(cube)\n # [[[2, 4], [6, 8], [10, 12], [21, 23]]].each_with_index do |possib|\n POSSIBLES.each_with_index do |possib|\n face_colors = possib.map { |p| cube[p.first] == cube[p.last] }\n next if face_colors.include?(false)\n colors = possib.map { |p| cube[p.first] }\n [possib.rotate(1), possib.rotate(-1)].each do |rot|\n c = cube.dup\n rot.each_with_index do |curr, i|\n c[curr.first] = colors[i]\n c[curr.last] = colors[i]\n end\n if check_solved(c)\n return \"YES\"\n end\n end\n end\n return \"NO\"\nend\n\n\n\ncube = {}\nvals = gets.strip.split.map(&:to_i)\n\nvals.each_with_index do |v, i|\n cube[i + 1] = v\nend\n\nputs solve(cube)\n", "lang": "Ruby", "bug_code_uid": "e37320af71b458c52e9898963e276e55", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "5b6c5f58295bb9bc78c460ca8cd2e20d", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9652945924132365, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "def rot(a, t)\n b = a.dup\n t.each{|v|\n tmp = a[v[0]]\n (1...v.size).each{|i|\n a[v[i-1]] = a[v[i]]\n }\n a[v[-1]] = tmp\n }\n return b\nend\n\ndef check(a)\n 6.times.map{|x| x*4}.all?{|x| (x...x+4).map{|i| a[i+1]}.uniq.size == 1}\nend\n\nlist = [\n [[2,6,10,23], [4,8,12,21], [18,17,19,20]],\n [[23,10,6,2], [21,12,8,4], [20,19,17,18]],\n [[1,18,12,15], [2,20,11,13], [22,21,23,24]],\n [[15,12,18,1], [13,11,20,2], [24,23,21,22]],\n [[1,2,4,3], [13,21,17,5], [14,22,18,6]],\n [[3,4,2,1], [5,17,21,13], [6,18,22,14]]\n]\n\n\ncube = [0] + gets.split.map(&:to_i)\n\n\n\n\nif list.any?{|l| check(rot(cube, l))}\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "e75b1c30b48f62b66cd3844d32dc8ccc", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "07f25a7b9dff03463cdebcba456e0f7f", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9960726558664703, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def judge(cube)\n 6.times do |i|\n if !(cube[4 * i] == cube[4 * i + 1] && cube[4 * i + 1] == cube[4 * i + 2] && cube[4 * i + 2] == cube[4 * i + 3])\n return false\n end\n end\n return true\nend\n\na1 = [0,2,4,6,8,10,23,21]\nb1 = [1,3,5,7,9,11,22,20]\na2 = [12,13,4,5,16,17,20,21]\nb2 = [14,15,6,7,18,19,22,23]\na3 = [2,3,16,18,9,8,15,13]\nb3 = [0,1,17,19,11,10,14,12]\n\ncube = gets.split.map(&:to_i)\nans = judge(cube)\n\ntmp = Array.new(a1)\ntmp.rotate!(2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[a1[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(b1)\ntmp.rotate!(2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[b1[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(a2)\ntmp.rotate!(2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[a2[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(b2)\ntmp.rotate!(2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[b2[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(a3)\ntmp.rotate!(2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[a3[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(b3)\ntmp.rotate!(2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[b3[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\n\ntmp = Array.new(a1)\ntmp.rotate!(-2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[a1[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(b1)\ntmp.rotate!(-2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[b1[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(a2)\ntmp.rotate!(-2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[a2[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(b2)\ntmp.rotate!(-2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[b2[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(a3)\ntmp.rotate!(-2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[a3[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\ntmp = Array.new(b3)\ntmp.rotate!(-2)\ncube2 = Array.new(cube)\n8.times do |i|\n cube2[b3[i]] = cube[tmp[i]]\nend\nans |= judge(cube2)\n\nputs ans ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "34e0a5b507da928acc7b88207571849b", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "a3db60ccaed6b6f715a4abaf443b7d22", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9782036828260052, "equal_cnt": 14, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 13, "bug_source_code": "def solve(a)\n\ttag = true\n\tj = 1\n\twhile(j<=21 && tag)\n\t\tif(a[j-1] == a[j]&& a[j]==a[j+1]&&a[j+1]==a[j+2])\n\t\t\tj += 4\n\t\t\tnext\n\t\tend\n\t\ttag = false\n\tend\n \treturn tag\nend\n\ntag = false\na = gets.split(' ').map(&:to_i)\ntemp1 = a[1-1]\ntemp2 = a[3-1]\na[1-1] = a[24-1]\na[3-1] = a[22-1]\na[24-1] = a[9-1] \na[22-1] = a[11-1]\na[9-1] = a[5-1]\na[11-1] = a[7-1]\na[5-1] = temp1\na[7-1] = temp2\nif solve a\n\ttag = true\nend\ntemp1 = a[1-1]\ntemp2 = a[3-1]\na[1-1] = a[5-1]\na[3-1] = a[7-1]\na[5-1] = a[9-1] \na[7-1] = a[11-1]\na[9-1] = a[24-1]\na[11-1] = a[22-1]\na[24-1] = temp1\na[22-1] = temp2\nif solve a\n\ttag = true\nend\n\n\n\ntemp1 = a[2-1]\ntemp2 = a[4-1]\na[2-1] = a[23-1]\na[4-1] = a[21-1]\na[23-1] = a[10-1] \na[21-1] = a[12-1]\na[10-1] = a[6-1]\na[12-1] = a[8-1]\na[6-1] = temp1\na[8-1] = temp2\nif solve a\n\ttag = true\nend\ntemp1 = a[2-1]\ntemp2 = a[4-1]\na[2-1] = a[6-1]\na[4-1] = a[8-1]\na[6-1] = a[10-1] \na[8-1] = a[12-1]\na[10-1] = a[23-1]\na[12-1] = a[21-1]\na[23-1] = temp1\na[21-1] = temp2\nif solve a\n\ttag = true\nend\n\n\n\ntemp1 = a[5-1]\ntemp2 = a[6-1]\na[5-1] = a[13-1]\na[6-1] = a[14-1]\na[13-1] = a[21-1] \na[14-1] = a[22-1]\na[21-1] = a[17-1]\na[22-1] = a[18-1]\na[17-1] = temp1\na[18-1] = temp2\nif solve a\n\ttag = true\nend\ntemp1 = a[5-1]\ntemp2 = a[6-1]\na[5-1] = a[17-1]\na[6-1] = a[18-1]\na[17-1] = a[21-1] \na[18-1] = a[22-1]\na[21-1] = a[13-1]\na[22-1] = a[14-1]\na[13-1] = temp1\na[14-1] = temp2\nif solve a\n\ttag = true\nend\n\n\n\n\n\ntemp1 = a[7-1]\ntemp2 = a[8-1]\na[7-1] = a[15-1]\na[8-1] = a[16-1]\na[15-1] = a[23-1] \na[16-1] = a[24-1]\na[23-1] = a[19-1]\na[24-1] = a[20-1]\na[19-1] = temp1\na[20-1] = temp2\nif solve a\n\ttag = true\nend\ntemp1 = a[7-1]\ntemp2 = a[8-1]\na[7-1] = a[19-1]\na[8-1] = a[20-1]\na[19-1] = a[23-1] \na[20-1] = a[24-1]\na[23-1] = a[15-1]\na[24-1] = a[16-1]\na[15-1] = temp1\na[16-1] = temp2\nif solve a\n\ttag = true\nend\n\n\ntemp1 = a[18-1]\ntemp2 = a[20-1]\na[18-1] = a[1-1]\na[20-1] = a[2-1]\na[1-1] = a[15-1] \na[2-1] = a[13-1]\na[13-1] = a[11-1]\na[15-1] = a[12-1]\na[12-1] = temp1\na[11-1] = temp2\nif solve a\n\ttag = true\nend\n\ntemp1 = a[18-1]\ntemp2 = a[20-1]\na[18-1] = a[12-1]\na[20-1] = a[11-1]\na[11-1] = a[13-1] \na[12-1] = a[15-1]\na[15-1] = a[1-1]\na[13-1] = a[2-1]\na[1-1] = temp1\na[2-1] = temp2\nif solve a\n\ttag = true\nend\n\n\n\n\n\n\ntemp1 = a[17-1]\ntemp2 = a[19-1]\na[17-1] = a[10-1]\na[19-1] = a[9-1]\na[9-1] = a[14-1] \na[10-1] = a[16-1]\na[16-1] = a[3-1]\na[14-1] = a[4-1]\na[3-1] = temp1\na[4-1] = temp2\nif solve a\n\ttag = true\nend\n\ntemp1 = a[17-1]\ntemp2 = a[19-1]\na[17-1] = a[3-1]\na[19-1] = a[4-1]\na[3-1] = a[16-1] \na[4-1] = a[14-1] \na[14-1] = a[9-1]\na[16-1] = a[10-1] \na[10-1] = temp1\na[9-1] = temp2\nif solve a\n\ttag = true\nend\nif tag\n\tprint('YES')\nelse\n\tprint('NO')\nend\n", "lang": "Ruby", "bug_code_uid": "9f05d0b56d65b7680dca56f6af81d53e", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "586a5a9142da632585953f909b8fda94", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9162995594713657, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a=gets.split.map &:to_i\ns=a.inject :+\nputs ((1..5).any?{|i| a.combination(i).any?{|j| j.inject(:+)*2==s}} ? \"YES\" : \"NO\")\n", "lang": "Ruby", "bug_code_uid": "68618e2303e2da1e6bfe5aa79ea6d61e", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "283497fc2a9dfb43803f1a572f248592", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8260869565217391, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "n=gets.to_i\n\nprint((n-3)*4*3*3*(1<<(n-4))+2*4*3*(1<<(n-3)));", "lang": "Ruby", "bug_code_uid": "74b12eaad8243e676fa8fd1c58e1027b", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "dc55bfab4d6cb660ae610976727cee0a", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8538011695906432, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp.downcase\nm = gets.chomp.downcase\na = 0\nwhile n[a] == m[a]\n a += 1\nend\n\nif n[a] < m[a]\n puts \"-1\"\nelsif n[a] > m[a]\n puts \"1\"\nelse\n puts \"0\"\nend", "lang": "Ruby", "bug_code_uid": "d0f613ace194f00a8a63b0b943ef7c40", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "3db241c46af737b8dcc4008b1556dfbd", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.96045197740113, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp.downcase\nm = gets.chomp.downcase\na = 0\n\nif n == m\n abort \"0\"\nend\n\nwhile n[a] == m[a]\n a += 1\nend\n\nif n[a] < m[a]\n puts \"-1\"\nelsif n[a] > m[a]\n puts \"1\"\nend", "lang": "Ruby", "bug_code_uid": "823776f1db77253d37b58094906048f1", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "3db241c46af737b8dcc4008b1556dfbd", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9855072463768116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a,b=[1,2].map{gets.chomp.downcase}\np a==b ?0:a[a,b].sort.index(a)*2-1", "lang": "Ruby", "bug_code_uid": "9557d568f7046272d5b54f511545e067", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "9fba0e9f1a84a5221f2b2c630750efcc", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.924956369982548, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "s1=gets.chomp.downcase.split(\"\")\ns2=gets.chomp.downcase.split(\"\")\nn=s1.length\ni,f=0,1\nuntil n<0\n if s1[i].ords2[i].ord\n puts 1\n f=0\n break\n end\n n -= 1\n i += 1\nend\nputs 0 if f==1\n", "lang": "Ruby", "bug_code_uid": "d294a5979cd692167ce2702833a357c0", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "dd1d9cb259534c1990c42b9949f7121b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8130671506352087, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "s1=gets.chomp.downcase.split(\"\")\ns2=gets.chomp.downcase.split(\"\")\nn=s1.length\ni,f=0,1\nuntil n<0\n if s1[i].ords2[i].ord\n puts 1\n f=0\n break\n end\nend\nputs 0 if f==1\n", "lang": "Ruby", "bug_code_uid": "8ab25f933d8c19ba6d81cbb6dca45a66", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "dd1d9cb259534c1990c42b9949f7121b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9487179487179487, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def equality(n)\n\tl = 0\n\tessai = 0\n\tnombre = 2\n\twhile n > essai\n\t\tdivi = n.to_f / nombre\n\t\tl = l + 1 if divi.to_s[divi.to_s.index(\".\") + 1] == \"0\"\n\t\tnombre = nombre + 1\n\t\tessai = essai + 1\n\tend\n\treturn l\nend\n\nn = gets.chomp.to_i\nputs(equality(n))", "lang": "Ruby", "bug_code_uid": "9f119f1b17ac55bf758bd952f482df2d", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "835027200b2ad50561c22909cac764b1", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9824561403508771, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m,*a=$<.read.split.map &:to_i\np m/a.select{|e|m%e}.max", "lang": "Ruby", "bug_code_uid": "920a337add1a064fc39bb8f2cf9a4323", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "31efacf71c966037ad965fb2b875a563", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9893992932862191, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,k = gets.split.map(&:to_i)\na = gets.split.map(&:to_i)\na.sort!\nans = 0\nwhile (t = a.pop) && ans == 0\n ans = t if k % t == 0\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "7d273048cb52dc6811d3b84377d0ad7e", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "42ecd5febb5f6529027f426722f36aef", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8970588235294118, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "strs = []\nk = false\n8.times do |i|\n strs[i] = gets.chomp\n st = strs[i].gsub(\"BB\", \"*\").gsub(\"WW\", \"*\")\n if st.index(\"*\") then k = true\n end\nend\n\nif k then\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "0abcc1ffeb266c4bb136942a34b2a415", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "9a6069289154845d39b6cd08c5376cf4", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.993125, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "first = gets\nindex = -1\nif first.include?(\"WWW\") or first.include?(\"BBB\")\n\tputs \"NO\"\n\texit\nend\nif first[0] == \"W\"\n\tsuccessful = true\n\tneeded = 0\nelse\n\tsuccessful = false\n\tneeded = temp.rfind(\"W\")\n\tafter_needed = needed+1\n\tif after_needed == 8\n\t\tafter_needed = 0\n\tend\nend\nif first.include?(\"WW\")\n\t\tif first.count(\"WW\") > 1\n\t\t\tputs \"NO\"\n\t\t\texit\n\t\tend\n\t\tif index == -1\n\t\t\tindex = first.index(\"WW\")\n\t\telse\n\t\t\tunless index == first.index(\"WW\")\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\t\tunless first[index+1] == \"W\"\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\tend\n\tif first.include?(\"BB\")\n\t\tsuccessful = false\n\t\tif first.count(\"BB\") > 1\n\t\t\tputs \"NO\"\n\t\t\texit\n\t\tend\n\t\tif index == -1\n\t\t\tindex = first.index(\"BB\")\n\t\telse\n\t\t\tunless index == first.index(\"BB\")\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\t\tunless first[index+1] == \"W\"\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\tend\nfor i in 1...8\n\ttemp = gets\n\tunless successful\n\t\tif temp[needed] == temp[after_needed]\n\t\t\tputs \"NO\"\n\t\t\texit\n\t\tend\n\tend\n\tif temp.include?(\"WWW\") or temp.include?(\"BBB\")\n\t\tputs \"NO\"\n\t\texit\n\tend\n\tif temp.include?(\"WW\")\n\t\tif temp.count(\"WW\") > 1\n\t\t\tputs \"NO\"\n\t\t\texit\n\t\tend\n\t\tif index == -1\n\t\t\tindex = temp.index(\"WW\")\n\t\telse\n\t\t\tunless index == temp.index(\"WW\")\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\t\tunless first[index+1] == \"W\"\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\tend\n\tif temp.include?(\"BB\")\n\t\tsuccessful = false\n\t\tif temp.count(\"BB\") > 1\n\t\t\tputs \"NO\"\n\t\t\texit\n\t\tend\n\t\tif index == -1\n\t\t\tindex = temp.index(\"BB\")\n\t\telse\n\t\t\tunless index == temp.index(\"BB\")\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\t\tunless first[index+1] == \"W\"\n\t\t\t\tputs \"NO\"\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\tend\nend\nputs \"YES\"\n", "lang": "Ruby", "bug_code_uid": "f256b234a1b9d09b2f231cd14ba5b3f7", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "ca1c4fdae4de9fd906e86f6a1857caca", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9872340425531915, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "infile = STDIN\na = infile.readlines.map { |i| i.chomp }\na.each do |s|\n if !((s[0] == s[2] && s[2] == s[4] && s[4] == s[6]) && (s[1] == s[3] && s[3] == s[5] && s[5] == s[7]) && a[0] != a[1])\n puts \"NO\"\n exit\n end\nend\nputs \"YES\"", "lang": "Ruby", "bug_code_uid": "374dc58333ca25cea5d5e2792f5b1fa5", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "37f96cdd448f15f16768caeb40b7c498", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.78125, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": " infile = STDIN\n8.times do\n s = input.readline\n 7.times do |i|\n if s[i] == s[i+1]\n puts \"NO\"\n exit\n end\n end\nend\nputs \"YES\"", "lang": "Ruby", "bug_code_uid": "6141b2b2fc21eff69e715d076c2853fa", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "37f96cdd448f15f16768caeb40b7c498", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.45193929173693087, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "sq = Array.new(3)\nfor i in 0..2\n sq[i] = gets.split.map(&:to_i)\nend\nsq[0][0] = sq[0][2]\nsq[2][2] = sq[2][0]\nsq[1][1] = sq[0][0] + sq[2][0] - sq[1][2]\nfor i in sq\n for j in i\n print j, \" \"\n end\n puts \"\"\nend", "lang": "Ruby", "bug_code_uid": "bb1f85cbcb9f6203409303674445bb9f", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "d2114d32c0e162324643dc734db8d991", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.927637314734089, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "lines = ARGF.readlines\n\nary = []\nlines.each do | line |\n ary << line.chomp.split(\" \").map { |x| x.to_i }\nend\n\nfor i in 1..(10**5) do\n t = ary[0][1] + ary[0][2] + i\n\n j = t - (ary[1][0] + ary[1][2])\n k = t - (ary[2][0] + ary[2][1])\n \n next if j <= 0 or k <= 0\n \n y1 = ary[1][0] + ary[2][0] + i\n y2 = ary[0][1] + ary[2][1] + j\n y3 = ary[0][2] + ary[1][2] + k\n\n if (y1 == y2) and (y2 == y3)\n ary[0][0] = i\n ary[1][1] = j\n ary[2][2] = k\n\n ary.each do | x |\n puts x.join(\" \")\n end\n \n break\n end\nend\n", "lang": "Ruby", "bug_code_uid": "d065e235173c98120856a379d652e150", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "c4482c98a9343d8d131ff4be640cff6e", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.96875, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "\nputs gets.chomp.downcase!.gsub!(/[aeiou]/,'').gsub!(/(.)/,'.\\1')", "lang": "Ruby", "bug_code_uid": "ca526036c6287b2dded465630087935e", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "248fa1d415e6d0f07492ad88c5f08a15", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9916666666666667, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "word = gets.chomp().downcase!.delete(\"aeiouy\")\ntword = word;\nword.each_char {|c| print '.', c }.delete!(tword)\n\nputs word", "lang": "Ruby", "bug_code_uid": "e340d854ebfde6cbb1d84de79ae238c5", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "aa4848610e642ec3f98e6f6c4effbecb", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9788732394366197, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\ninput = gets.chomp\n\ninput = input.downcase\ninput = input.gsub!(/[aoyeui]/, \"\")\n\ninput = input.each_char.map { |c| \".#{c}\" }.join\n\n\nputs input", "lang": "Ruby", "bug_code_uid": "5f82ef5824122330bf5a9c134b46518e", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "f23008b392394934ad41ba19f05ec69b", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9760348583877996, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#! ruby -Ku\n# -*- coding: UTF-8 -*-\ninputs = open(\"input.txt\")\n# inputs = STDIN\nword = inputs.gets.gsub(/[AOYEUIaoyeui]/, '').downcase\nret_word = String::new\nword.split(//).each do |ch|\n ret_word += \".\" + ch\nend\nputs ret_word", "lang": "Ruby", "bug_code_uid": "75f12ae4c7c8b99ba05b444da11eb6a9", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "fe835cbf0892e69b784e0368ef9ad046", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7295597484276729, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "puts gets.chomp.gsub!(/[aeiou]/i, '').downcase.scan(/./).join('.').prepend('.')", "lang": "Ruby", "bug_code_uid": "a8de9384969a111d2712860d15179763", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "a3c94a3121c002bf602b808f893d5cf0", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.958904109589041, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "c=gets.chomp\nfor i in (0..c.size-1)\nif c[i]=='a'||c[i]=='o'||c[i]=='i'||c[i]=='e'||c[i]=='u'||c[i]=='y'||c[i]=='A'||c[i]=='E'||c[i]=='Y'||c[i]=='U'||c[i]=='O'||c[i]=='I'\nelsif c[i]>='A'&&c[i]<='Z'\n\tprint\".#{c[i]-'A'+'a'}\"\nelse\n print \".#{c[i]}\"\nend\nend", "lang": "Ruby", "bug_code_uid": "6a1a64a8a718759ede1324e0d4ccb347", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "ec491d868003f53a0e8f33286f7581a5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4882108183079057, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "# https://codeforces.com/problemset/problem/1092/A\n\ndef solution(n, k)\n s = \"\"\n j = 0\n n.times do |i|\n s += ((i % k) + 97).chr\n end\n return s\nend\n\nq = gets.chomp.to_i\nq.times do\n n, k = gets.chomp.split(\" \").map(&:to_i)\n puts solution(n, k)\nend\n", "lang": "Ruby", "bug_code_uid": "20a3a177e7c68ce029edcea9ab7c9ab2", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "2b47aa7c7d35ae9e16fa325136d92b92", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.599406528189911, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "x, y = gets.strip.split.map &:to_i\nn = gets.to_i\n\nfn = [x, y]\n\n(2 ... n + 1).each do |i|\n fn[i] = fn[i - 1] - fn[i - 2]\nend\n\nputs (fn[-2] % 1000000007)\n", "lang": "Ruby", "bug_code_uid": "f74e8d3327e727aea63d6076f6371ae9", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "adc5fada23a6074201e875b02b77bc0b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.48426150121065376, "equal_cnt": 19, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 8, "fix_ops_cnt": 18, "bug_source_code": "x, y = gets.strip.split.map &:to_i\nn = gets.to_i\n\nf = [x, y]\n\ndef sequence f, n\n if f[n]\n return f[n]\n else\n f[n] = sequence(f, n - 1) - sequence(f, n - 2)\n return f[n]\n end\nend\n\nsequence f, n\nputs f[-2] % 1000000007\n", "lang": "Ruby", "bug_code_uid": "92a6ed846f72e52f32d380b933151a1e", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "adc5fada23a6074201e875b02b77bc0b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.989247311827957, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "x, y = gets.split.map(&:to_i)\nn = gets.to_i-1%6\nputs [x,y,y-x,0-x,0-y,x-y][n] % (1000000007)", "lang": "Ruby", "bug_code_uid": "2a0e625f740cbb5fafde6acc9cc0d1e1", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "569d5551ff6d98771bfceda0a5398a33", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.36043956043956044, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "x,y = gets.split(\" \").map(&:to_i)\nn = gets.to_i\nans = nil\nans = x if n == 1\nans = y if n == 2\nunless ans\n\t(n-2).times do\n\t\tans = y - x\n\t\tx = y\n\t\ty = ans\n\tend \t\nend\nputs ans % ((10**9) + 7)", "lang": "Ruby", "bug_code_uid": "a8c8b1db097531e5e45a6391927b7024", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "1c9981abb23b3e579b67934c3f3f61df", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.23503325942350334, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "no_op = gets.chomp.to_i\nops = gets.chomp.split(\"\")\ncount_add = ops.count(\"+\")\ncount_rem = ops.count(\"-\")\n\nif count_rem > count_add\n puts 0\nelsif ops[0] == \"-\"\n puts count_add - count_rem + 1\nelse\n puts count_add - count_rem\nend", "lang": "Ruby", "bug_code_uid": "a2a1ec4fded42c9ced739f77b7a416fb", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "5cea137e68e66335cc96bb962768e2c9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.855098389982111, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets.chomp.split\nh = gets.chomp.split('')\nv = gets.chomp.split('')\n\nputs ((h[0] == '<' && v[0] == '^') ||\n (h[0] == '>' && v[0] == 'v') ||\n (h[-1] == '>' && v[-1] == 'v') || \n (h[-1] == '<' && v[0] == 'v')) ? \"NO\" : \"YES\"", "lang": "Ruby", "bug_code_uid": "66b9ecf10fe3f294d3e04e0ea3052769", "src_uid": "eab5c84c9658eb32f5614cd2497541cf", "apr_id": "d40e33cef2c8d2564ae7ba80fb048a98", "difficulty": 1400, "tags": ["graphs", "brute force", "dfs and similar", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5229681978798587, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 19, "bug_source_code": "x, y = gets.split.map(&:to_i)\nif (y == 1 && x == 0) || ((x-y+1).even? && (x-y+1) > 0)\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "283a4ebf81ca944d048e4bd7f9e5d56c", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "c6f7da304ac41ac485149efb4643eaad", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9260869565217391, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def judge(a, b)\n return false if b == 0\n return false if b == 1 && a != 0\n return false if (a - b + 1) % 2 == 1\n return true\nend\n\na, b = gets.split.map(&:to_i)\nif judge(a, b)\n puts \"Yes\"\nelse\n puts \"No\"\nend\n", "lang": "Ruby", "bug_code_uid": "af18283738e3e6b2a8d1fe6502b25956", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "442dd14fdec4d2ca4bdb62cb739461d6", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9032258064516129, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,m=gets.split.map &:to_i\np n<64 ? m%2**n : m", "lang": "Ruby", "bug_code_uid": "39b57566f007e7878a515734845f8e36", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "8a9919a328bbbb4bca74063090d23028", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9951690821256038, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\nm = gets.to_i\np (0..40).map{ |i| 1 << i }.find_index{ |i| i >= m } <= n ? m : m % (1 << n)", "lang": "Ruby", "bug_code_uid": "278d63aaa1dc80f3c0437ba8dabbd073", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "1193bff79009db9f9148b805a1ee98e0", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8391608391608392, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "x = gets.chomp.to_i\ny = gets.chomp.to_i\nc = y % (power(2,x))\nputs \"#{c}\"", "lang": "Ruby", "bug_code_uid": "f7333473b6bcc3bf7bffcbf631c83b62", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "a8dba8a187edb3d563b7e63612de0785", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9911504424778761, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m=$<.map &:to_i\ni=0\ni+=1 while 2**i0;p r", "lang": "Ruby", "bug_code_uid": "b6852564e0e366fd2cb594e8d3b47b6f", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "9a2b3ad955a05a1fa455779dafb7503d", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.41245136186770426, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "length, index = gets.split\n\nseq = '1'\nlength = length.to_i\nindex = index.to_i\n\n2.upto(length) do |i|\n seq = \"#{seq}#{i}#{seq}\"\nend\nputs seq[index - 1]\n", "lang": "Ruby", "bug_code_uid": "3960948cab9ad226f69c372b6042f091", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "f2effd16f7243c0ebe207d9cf24ab7b0", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4189723320158103, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "length, index = gets.split\nseq = [1]\nlength = length.to_i\nindex = index.to_i\n\n2.upto(length) do |i|\n seq = seq + [i] + seq\nend\nputs seq[index - 1]\n", "lang": "Ruby", "bug_code_uid": "01d44116bc4062c098c9434bf452ffb3", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "f2effd16f7243c0ebe207d9cf24ab7b0", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.40569395017793597, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "n, k = gets.chomp.split(\" \").map(&:to_i)\na = Array.new\na.insert(a.length, 1)\nif n>1\n for i in 2..n\n a = a.insert(a.length, *a).insert((a.length+1)/2, i)\n end\n puts a[k-1]\nelse\n puts 1\nend", "lang": "Ruby", "bug_code_uid": "0d1116bb57db65235ed1e0e3d8a49f61", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "a7bbeaece8e318087ea8e0badc460539", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9863013698630136, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "string1 = gets.chomp.downcase\nstring2 = gets.chomp.downcase\n\nif string1 < string2\n puts \"-1\"\nelsif string1 > string2\n puts \"1\"\nelse\n puts \"0\"", "lang": "Ruby", "bug_code_uid": "43091371d527daff59b91a9b99b37fe8", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "33a259cfb8a7ce7bb6508942c0725107", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8743718592964824, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "m, n = gets.chomp.split(' ')\nputs m.downcase >= n.downcase ? m.downcase == n.downcase ? 0 : 1 : -1\n", "lang": "Ruby", "bug_code_uid": "6197d7d9bae7083bcaa0b0f444713c0e", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "43e28bc8f8af5f2bc52c92085d12d4be", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9265060240963855, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def calcs(x,y,ax,ay,bx,by) ((ax-x)*(by-y)-(bx-x)*(ay-y))/2.0 end\n\ndef inpf() a=gets.chomp.split(\" \").map(&:to_f)end\n\ndef inps() a=gets.chomp.split(\" \")end\n\ndef copy(a) Marshal.load(Marshal.dump(a)) end\n\ndef kaizyo(n)(n < 2)? 1 : (2..n).inject(:*) end\n\ndef scount(a) b=na(a.max+1);a.each{|n|b[n]+=1};return b end\n\ndef na(n=0,d=0) Array.new(n,d)end\n\ndef na2(n=0,m=0,d=0) Array.new(n){Array.new(m,d)}end\n\ndef na3(n=0,m=0,l=0,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end\n\ndef bit(n) n.to_s(2).split(\"\").map(&:to_i) end\n\ndef inp() a=gets.chomp.split(\" \").map(&:to_i)end\n\ndef k2(k,n,m)\n return 1 if k == 0\n return n if(k == 1)\n ans = 1\n if((k%2) == 0)\n ans *= k2(k/2,n,m)**2\n else\n ans *= k2(k-1,n,m)\n ans *= n\n end\n return ans % m\nend\n\na,b = inp\nmod = 10**9+7\nans = k2(b,k2(a,2,mod),mod)\nnon = a*k2(b,k2((a-1),2,mod),mod)\n\np ans - non + (a-1)", "lang": "Ruby", "bug_code_uid": "bbb290d9c6cc59cb904da3e7c06a6442", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "a0239c4c93a9f57ac4fe9b628a8f8097", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3184713375796178, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "p gets.split.map(&:to_i).max", "lang": "Ruby", "bug_code_uid": "db9a04d60cbf7e26f1a75d1aaa570625", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "2c139fd6370bb2049a9233b71d330211", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9922480620155039, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\nrequire 'rational'\na,b=gets.split.map(&:to_i)\nr=0\nwhile a>0\n\tg=a.gcd(b)\n\ta/=g;b/=g\n\tr+=a/b\n\ta,b=b,a-a/b*b\nend\np r", "lang": "Ruby", "bug_code_uid": "818536ed26f80d6a7e95370afde1ce7d", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "2c139fd6370bb2049a9233b71d330211", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9412617839013778, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "input = gets.chomp.split(' ').map { |i| i.to_i }\n\nn, a, b, c, d = input[0], input[1], input[2], input[3], input[4]\n\nans = 0\nfirstPart = a + b\nsecondPart = b + d\nthirdPart = c + d\nfourthPart = a + c\n\nguessNum = 1\n\nuntil guessNum > n\n\t# Left to right\n\tbalanceFactor = b - c + guessNum\n\n\tif balanceFactor <= 0\n\t\tguessNum += 1\n\t\tnext\n\tend\n\n\tbalanceFactor_2 = a - d + balanceFactor\n\n\tif balanceFactor_2 <= 0\n\t\tguessNum += 1\n\t\tnext\n\tend\n\n\tbalanceFactor_3 = c - b + balanceFactor_2\n\n\tif balanceFactor_3 <= 0\n\t\tguessNum += 1\n\t\tnext\n\tend\n\n\n\t#puts \"#{guessNum} #{balanceFactor} #{balanceFactor_2} #{balanceFactor_3}\"\n\tans += 1\n\tguessNum += 1\nend\n\n\nputs ans * n", "lang": "Ruby", "bug_code_uid": "9002926d3e75352cca98402b94e078e7", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "a9a0f48116413d56da9383a93dcc937a", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.19895678092399405, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "# coding: utf-8\n\n# if __FILE__ == $0\n# end\n\n# n - \ubc29\ubb38\ud55c \ubc84\ud14d\uc2a4\uae4c\uc9c0\uc758 \uc6e8\uc774\ud2b8 \ucd1d\ud569\n# k - \ud2b8\ub9ac\uc758 \uc720\ud615(the number of children)\n# d - \uc6e8\uc774\ud2b8\uac00 d\uc778 \uc5d0\uc9c0\ub85c, \ubc18\ub4dc\uc2dc \ud3ec\ud568\ub418\uc5b4\uc57c\ud568\n# 1<=d<=k \uc774\ubbc0\ub85c d\uac00 k\ubcf4\ub2e4 \ucee4\uc9c8 \uc77c\uc740 \uc5c6\uc74c\n# 1<=n,k<=100\n$n, $k, $d = gets.split.map(&:to_i)\nMODULO_BASE = 10**9 + 7\n\nways = 0\ndef recur_tree(visited, acc, depth)\n #puts \"#{'>' * (depth+1)} #{visited} #{acc}\"\n if acc >= $n\n if acc == $n\n if !visited\n return 0\n else\n return 1\n end\n else\n return 0 # exceeded\n end\n end\n\n sub_ways = 0\n\n for i in 1..$k\n sub_ways += recur_tree(visited || (i >= $d), acc + i, depth + 1)\n end\n\n return sub_ways\nend\n\nways = recur_tree(false, 0, 0)\nputs ways%MODULO_BASE\n\n", "lang": "Ruby", "bug_code_uid": "9f5ffec7722cfd58107c06cee02a883b", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "6dc25ebd52a7eda66ec32e2625b1f907", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5189075630252101, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "def count(sum,k,d,i,arr)\n\tif sum < 0\n\t\treturn\t\t\t\t\t\n\tend\n\n\tif sum == 0 && arr.any? { |e| e >= d }\n\t\t@c += 1\n\t\treturn\n\tend\n\n\t(1..k).each do |v|\n\t\tarr[i] = v\n\t\tcount(sum-v,k,d,i+1,arr.dup)\n\tend\nend\n\nn,k,d = gets.split(\" \").map(&:to_i)\n@c = 0\ncount(n,k,d,0,[])\nputs @c", "lang": "Ruby", "bug_code_uid": "35f130d247952ecd131f947d466a231b", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "253d5845efeb1b28d15946d03a23e23f", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9945593035908596, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def solution(n, k, d)\n @memo = Array.new(2) { Array.new(n+1, false) }\n def solve(n, k, d, flag)\n return @memo[(flag ? 1 : 0)][n] if @memo[(flag ? 1 : 0)][n]\n return 1 if n == 0 && flag\n return 0 if n == 0 && !flag\n cnt = 0\n for i in 1..k do\n cnt += solve(n-i, k, d, flag || (i >= d)) if n-i >= 0\n end\n @memo[(flag ? 1 : 0)][n] = cnt\n end\n solve(n, k, d, false)\n @memo[0][n] % 1000000007\nend\n\nsolution(*gets.split.map(&:to_i))\n", "lang": "Ruby", "bug_code_uid": "d04e7cbea162600d0c547399d9d5ff43", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "6ae2d9131320c16eefead0d7d8c806ed", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.992412746585736, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def ascan; gets.split.map(&:to_i);end\n\nans = []\n\nn = gets.to_i\n\n(0..9).to_a.repeated_combination(9) do |a|\n t = a.reduce(n){|s,e| s-=e}\n next if t < 0\n h = [0]*10\n a.each{|e| h[e]+=1}\n t.to_s.chars.each{|c| h[c.to_i]-=1}\n b = true\n (1..9).each{|e| b &= h[e] == 0}\n ans << t if b\nend\n\np ans.size\nputs ans", "lang": "Ruby", "bug_code_uid": "1d55090dea07a4e2827956f5f67ce99d", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "apr_id": "e4a0543daecc0ea68f4f879c79ce57e1", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6509090909090909, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "a=gets.chomp.split(\" \").map {|i| i.to_i}\nb=(a[1]*a[2]-a[0]*a[3]).abs\nif a[2]>a[3]\nc=b.gcd(a[2]*a[0])\nputs \"#{b/c}/#{(a[2]*a[0])/c}\"\nelsif a[3]>a[2]\nc=b.gcd(a[3]*a[1])\nputs \"#{b/c}/#{(a[3]*a[1])/c}\"\nelsif a[3]==a[2]\nif a[1]>a[0]\nc=b.gcd(a[3]*a[1])\nputs \"#{b/c}/#{(a[3]*a[1])/c}\"\nelse\nc=b.gcd(a[2]*a[0])\nputs \"#{b/c}/#{(a[2]*a[0])/c}\"\nend\nend", "lang": "Ruby", "bug_code_uid": "bbd77f25294ff0766350bcb20a930bab", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "118a0cdb1d728235917cc5beb32be90c", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9940828402366864, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b,c,d=gets.split.map(&:to_i)\np=a*d\nq=b*c\nputs[Rational(p-q,p),Rational(q-p,q)].max", "lang": "Ruby", "bug_code_uid": "e29aa8b63163e783752957a59b17b651", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "a01f433bdf5249f50355b1bc47c38bed", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9274537695590327, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def gcd(a,b)\nif b == 0\n return a;\nelse\n return gcd(b, a % b);\nend\nend\n\n\na,b,c,d = gets.split(\" \").map(&:to_i)\n\nl,m = (a/b.to_f),(c/d.to_f)\n\nnum = den = 0\n\nif l < m\n\tnum = (b * c) - (a * d)\n\tden = b * c\nelsif l > m\n\tnum = (a * d) - (b * c)\n\tden = a * d\nend\n\nif num == 0\n\tputs 0 \nelse\n\tg = gcd(num,den)\n\tputs \"#{num/g}/#{den/g}\"\nend\n\n", "lang": "Ruby", "bug_code_uid": "803a1e0ccad4744e7078e09967328763", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "34924ae203f43b365e69515a4e9d600d", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9954128440366973, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "# f = File.new('test.txt', 'r')\na, b, c, d = f.gets.split.map(&:to_i)\n# f.close\n\ndef gcd(a, b)\n if b == 0\n a\n else\n gcd(b, a % b)\n end\nend\n\n\nif a * d < b * c\n numerator = (b * c - a * d)\n denomerator = (b * c)\nelsif a * d > b * c\n numerator = a * d - b * c\n denomerator = a * d\nelse\n numerator, denomerator = [0, 1]\nend\n\nuc = gcd(numerator, denomerator)\nnumerator /= uc\ndenomerator /= uc\nputs \"#{numerator} / #{denomerator}\"", "lang": "Ruby", "bug_code_uid": "ee8213bfe1c6729ebd96ad7d64320db5", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "82a2459ae1ac6be97149217dc998240e", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.22740524781341107, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "def Sum(ar)\n ar.reduce(:+) || 0\nend\n\nn = gets.to_i\nar = gets.split.map(&:to_i).sort\nif n == 1\n puts ar\n exit 0\nend\nif ar[-1] < 0\n puts Sum(ar).abs\nelsif ar[-1] > 0 and ar[0] < 0\n pos = ar.select{|i| i >= 0}\n neg = ar.select{|i| i < 0}\n puts Sum(pos)-Sum(neg)\nelse\n puts Sum(ar)\nend", "lang": "Ruby", "bug_code_uid": "ea1849069f0a99a9cfcf4984c9dc6fe5", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "d0811787c0c3a42e0547e96eadc31503", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7452229299363057, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n = gets.to_i\nas = gets.split.map(&:to_i)\n\nb = 0\nc = as.inject(:+)\nans = b - c\n\n(0..n-1).each do |i|\n a = as[i]\n b += a\n c -= a\n ans = [ans, b-c].max\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "900db53eb7a4afa4061565715e75372a", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "d20ec6d7dae14faee5debc1b05022936", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.22429906542056074, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "((m+a-1)/a)*((n+a-1)/a)\n", "lang": "Ruby", "bug_code_uid": "968fa3173b6060cb0adc1ba8fac9bdfb", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "082c3144930e4c49aa96a8eb5c295927", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8951965065502183, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/ruby\n\ni = gets\nx = i.split(\" \")[0]\ny = i.split(\" \")[1]\nz = i.split(\" \")[2]\n\ntotal = 0\ntotrows = (x/z) + (x%z == 0 ? 0 : 1)\ntotcols = (y/z) + (y%z == 0 ? 0 : 1)\n\ntotal = totrows * totcols\n\nputs total", "lang": "Ruby", "bug_code_uid": "0bb9c91a49a2e0b788703dc83c8c52b2", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "970e9716d591fc9e4792df2b2c4acb40", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.2536997885835095, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "def theatre(n, m, a)\n n_m = n * m\n a_a = a * a\n sum = 0\n cnt = 0\n loop do\n if n_m - sum <= 0\n break\n else\n sum += a_a\n cnt += 1\n end\n end\n cnt\nend\n\ninput = gets.chomp\ntheatre input[0].to_i input[1].to_i input[2].to_i", "lang": "Ruby", "bug_code_uid": "91e9678471af3d48ea9452fa09a03f1f", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f53a36d9a87c14319a5b4c9c853fe31c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.014732965009208104, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n \n\t \n\n\t\n \t \n \n \t\n\t\t \n\t\t\n\t \t\n\n \t \t \t\n", "lang": "Ruby", "bug_code_uid": "cfaf35f8d6f921b0adf27c89ec06420a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f4f06b176f78fcebf98fa07b6c91cdba", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.008184980560671169, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4$soj==4\n\t\n\n\n\n\n \n\t\n \n \t\n\n\n\t\n \n\t \n\n \n \n\t\n\n\n \t\n\t\t\t \t\n\t \n", "lang": "Ruby", "bug_code_uid": "11dbf32fc9143c4b97d7f676c9b2cfdd", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f4f06b176f78fcebf98fa07b6c91cdba", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.16216216216216217, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "if a%n == 0\n if b%n == 0\n a/n * b/n\n else\n a/n * (b/n + 1)\n end\nelse\n if b%n == 0 then\n (a/n + 1 ) * (b/n)\n else\n (((a/n) +1) * ((b/n) +1))\n end\nend", "lang": "Ruby", "bug_code_uid": "ca391fc86d6d89bd472808bded8ba051", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "754a9e80b2418d310218a36b23f0b0f0", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.397212543554007, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "def splitspaceint(s)\n\taaa = s.split(/ /)\n\tbbb = []\n\tfor i in 0..aaa.length-1\n\t\tbbb.push(aaa[i].to_i)\t\n\tend\n\treturn bbb\nend\n\nn,m,a = splitspaceint(gets)\nputs (n.prec_f/a).ceil * (m.prec_f/a).ceil\n", "lang": "Ruby", "bug_code_uid": "c8913fe6675e1f89f72fd2b63aa12e30", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "be8481f59cecabb04c247a277ffa72fc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7309644670050761, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n, m, a = gets.split.map &:to_i\nwhile n%a!=0\n n+=1\nend\nwhile m%a!=0\n m+=1\nend\np n*m/(a*a)\n", "lang": "Ruby", "bug_code_uid": "5c1ade7cfbabc6986b4550060eff0dcd", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "98a8f381289340201aa734f30499dd5a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9787234042553191, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "input = gets.split.map(&:to_i)\nn = input[0]\nm = input[1]\na = input[2]\n\nb = input[2]\nc = input[2]\n\nif n == m && a == 1\n puts n*n\nelse\n temp1 = 1\n temp2 = 1\n while n > b do\n temp1 += 1\n b += a\n end\n \n while m > c do\n temp2 += 1\n c += a\n end\n \n puts temp1 * temp2\nend\n", "lang": "Ruby", "bug_code_uid": "e2dd146090a62dc56e1359d9320f477f", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2248b0cc13b4d3040dbb4b0537f792e9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6182495344506518, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 7, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "data = gets.chomp.split(\" \")\nlen = data[0].to_i\nwid = data[1].to_i\nsize = data[2].to_i\n\nnum_len = 0\nnum_wid = 0\nsize_len = 0\nsize_wid = 0\n\n\nloop do\n if size_len < len\n num_len += 1\n size_len += size\n else \n break\n end\nend\n\nloop do\n if size_wid < wid\n num_wid +=1\n size_wid += size\n else\n break\n end\nend\n\nputs(num_wid*num_len)", "lang": "Ruby", "bug_code_uid": "4a21280166fef69baacdacb6a7aa2774", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "efcbe5f6d97b6e7944c632d071ac6b63", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9168539325842696, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.chomp\n\ndigit_count = n.length\nn = n.to_i\n\nresult = (n - (10 ** (digit_count - 1) - 1)) * digit_count\n\nresult += (1..(digit_count - 1)).inject(0) do |sum, count|\n\tsum + ('9' * count).to_i * count\nend\n\nputs result", "lang": "Ruby", "bug_code_uid": "84e3fcd5c7ba867ae3af86c014484721", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "703f583d37f0bef3b751a53c9b0739c2", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5420560747663551, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "# http://codeforces.com/contest/552/problem/B\nn = gets.chomp.to_i\nputs (1..n).to_a.map(&:to_s).inject(0) { |a, e| a + e.length }\n", "lang": "Ruby", "bug_code_uid": "7eb80bb488dea7a24a66be73e74d76fc", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "4a4ffad8cb16bb943c4fbec3db068f7e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.28292682926829266, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "puts (1..gets.chomp.to_i).to_a.join.length.inspect\n\n\n", "lang": "Ruby", "bug_code_uid": "67a14cff240178caee2a048932184945", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "aee6539d2be65c4314fb28b0a7b2c480", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8745980707395499, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n, m = STDIN.read.split(' ').map(&:to_i)\n\nif m > n\n puts -1\nelse\n cand = n / m\n while cand % m != 0 do\n cand += 1\n end\n puts cand\nend\n", "lang": "Ruby", "bug_code_uid": "2442c3d06245ffaaaa90b93f4cd30408", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "a165133e934af4eef716ba54dd834ccf", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.27037773359840955, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "def run\n x, y = gets.chomp.split(\" \").map(&:to_i)\n a, b = gets.chomp.split(\" \").map(&:to_i)\n\n r = if a * 2 < b || x == 0 || y == 0\n (x + y) * a\n else\n (x - y).abs * a + [x, y].min * b\n end\n puts r\nend\n\n\ndef main\n t = gets.chomp.to_i\n\n t.times do\n run\n end\nend\n\nmain\n", "lang": "Ruby", "bug_code_uid": "c57c5afcad49a029ef46b9152d2dfb1d", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "b135ad0a6ed5d8e74fb1f91c2b4d3c86", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9989701338825953, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# coding: utf-8\n\n# if __FILE__ == $0\n# end\n\nn_stairs, moves_multiple = gets.split.map { |i| i.to_i }\n# use 2 or 1 step only. 2 step -> 1 move, 1 step -> 1 move.\ntwosteps = n_stairs/2 # moves\nonestep = n_stairs%2 # moves\nmet_condition = false\nwhile twosteps > 0\n if (twosteps + onestep) % moves_multiple == 0\n met_condition = true\n break\n else\n twosteps -= 1\n onestep += 2\n end\nend\n\nif met_condition\n puts twosteps + onestep\nelse\n puts -1\nend\n", "lang": "Ruby", "bug_code_uid": "5730c2f1bcf7b96a4b17ebc8b3f463fb", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "33528eebb28ab71245dc5b9938b6bdda", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.990521327014218, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = gets.chomp.split.map(&:to_i)\nans = -1\nif n % 2 == 0\n steps = n / 2\nelse\n steps = n / 2 + 1\nend\n(n / 2).times do\n if steps % m == 0\n ans = steps\n break\n else \n steps += 1\n end\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "c5078927fb316f4496982faf31005395", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "68884b4cdce5f33c068426d3c1f4c027", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9977116704805492, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "nmz = gets.chomp.split\nn = nmz[0].to_i\nm = nmz[1].to_i\nz = nmz[2].to_i\n\nif n == m\n\tprint z\nelse\n\ti = 0\n\tcall = []\n\tart = []\n\tnp = n\n\tmp = m\n\twhile np <= z\n\t\tnp = n * (i+1)\n\t\tcall << np\n\t\ti += 1\n\tend\n\ti = 0\n\twhile mp <= z\n\t\tmp = m * (i+1)\n\t\tart << mp\n\t\ti += 1\n\tend\n\t\n\tcount = 0\n\tfor i in (0..call.size-1)\n\t\tfor x in (0..art.size-1)\n\t\t\tif call[i] == art[x] && call[i] <= z && art[x] <= z\n\t\t\t\tcount += 1\n\t\t\tend\n\t\tend\n\tend\n\tprint count\t\nend", "lang": "Ruby", "bug_code_uid": "d3da59740c7124eda34524285303b1a7", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "ad76ba4592e59013a4fed9ffc30ab195", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.717948717948718, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "nmz = gets.chomp.split\nn = nmz[0].to_i\nm = nmz[1].to_i\nz = nmz[2].to_i\n\ni = 0\ncall = []\nart = []\nnp = n\nmp = m\nwhile np <= z\n\tnp = n * (i+1)\n\tcall << np\n\ti += 1\nend\ni = 0\nwhile mp <= z\n\tmp = m * (i+1)\n\tart << mp\n\ti += 1\nend\n\ncount = 0\nfor i in (0..call.size-1)\n\tfor x in (0..art.size-1)\n\t\tif call[i] == art[x] && call[i] <= z && art[x] <= z\n\t\t\tcount += 1\n\t\tend\n\tend\nend\nprint count", "lang": "Ruby", "bug_code_uid": "78354c30029e0a685905c645618a3793", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "ad76ba4592e59013a4fed9ffc30ab195", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7580174927113703, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "sum = gets.chomp.to_i\nsum<0 ? \n {sum = -sum\n a = sum/10\n b = (sum/100)*10 + sum%10\n acc = case\n when a<=b && a=0\n puts n\nelse\n dig1,dig2 = n%10, (n/10)%10\n n1,n2 = n/10,n1+dig1-dig2\n if n1>n2\n puts n1\n else\n puts n2\n end\nend", "lang": "Ruby", "bug_code_uid": "ec8e4fcce68ad2c934a740215959eb42", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "3c992085ad75a92fe331443da6a3bc19", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9978213507625272, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets()\ns.chomp!\nmax = s.to_i\nif s.size > 1 && s[0...s.size-1].to_i > max\n max = s[0...s.size-1].to_i\nend\n if s.size > 2\n arr = s.split(//)\n arr.delete_at(-2)\n n = aarr.join.to_i \n if n > max\n max = n\n end\nend\nputs max", "lang": "Ruby", "bug_code_uid": "2b625e4c3b7679d0633e7dc626d16e17", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "769dffe0f135cfb111020341f9830294", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.46436285097192226, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "def not_vowel? jumping\n an = %w{A E I O U Y} # a e i o u y\n an.each { |value| return false if value == jumping }\n return true\nend\n\ndef ability jump_list1\n jump_list = jump_list1.split(\"\")\n jump_list.delete_at(-1)\n jump_list.unshift('A')\n jump_list << 'A'\n # puts jump_list.length\n return 0 if jump_list.length == 0\n throw ArgumentException if jump_list.length > 100\n\n jump_ability = 0\n current_ability = 0 # at least jump 1\n jump_list.each do |current|\n current_ability = current_ability + 1\n if not_vowel?(current)\n # puts \"1\"\n elsif current_ability > jump_ability\n # puts \"2\"\n jump_ability = current_ability\n current_ability = 0\n else\n # puts \"3\"\n current_ability = 0\n end\n end\n current_ability > jump_ability ? current_ability : jump_ability\nend\n\njump_list = gets\nputs ability(jump_list)\n", "lang": "Ruby", "bug_code_uid": "80b540c05b561d15703861a71f6cb628", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "c7ba92256ba347b861c087d8af836054", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9391304347826087, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "bottle = gets.to_i - 1\npeople = w%[Sheldon Leonard Penny Rajesh Howard]\np_num = people.length\n\nuntil bottle <= p_num do\n bottle = (bottle - p_num)/2\nend\n\nputs people[n] \n", "lang": "Ruby", "bug_code_uid": "ec9c29c2d7652af517a6abd2869224eb", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "b8873f9554b41dd6f1b6376b7744af5f", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9507246376811594, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "bottle = gets.to_i - 1\npeople = w%(Sheldon Leonard Penny Rajesh Howard)\np_num = people.length\n\nuntil bottle <= p_num do\n bottle = (bottle - p_num)/2\nend\n\nputs people[n] \n", "lang": "Ruby", "bug_code_uid": "0ef79d0b64365f255489ad585950b853", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "b8873f9554b41dd6f1b6376b7744af5f", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.44386422976501305, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "queue = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\nn = gets.to_i\n\nfor i in 1...n\n queue << queue[0] << queue[0]\n queue.delete_at(0)\nend\n\nprint queue[0]", "lang": "Ruby", "bug_code_uid": "fb14897b5639db32313488560843b390", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "d44e33084b28407d3de8c7f49c6ccf88", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6020942408376964, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "n = $stdin.readline.split.first.to_i\n\nl = [:Sheldon, :Leonard, :Penny, :Rajesh, :Howard]\ns = l.count\n\nwhile n>1\n s = l.shift\n l << s << s\n n-=1\nend\n\nputs l.first", "lang": "Ruby", "bug_code_uid": "e050c2e85b64c532f3b3ab5b455bb27b", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "84599a009ee4b1127938014b2bd992d3", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7518796992481203, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "a=[\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\nn=gets.chomp.to_i\nn.times do\n x=a.shift\n a << x\n a << x\nend\nputs a.pop", "lang": "Ruby", "bug_code_uid": "881b2d800f31b6d35d0a766236c0b28d", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "2ba1c02f0dc87e8a70ae94de0cabe5ef", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3755274261603376, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\n\nname = [\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\ntmp = \"\"\nres = []\nn.times do\n tmp = name.shift\n name.push tmp\n name.push tmp\n res.push tmp\n\nend\n\nprint res[n - 1]\n", "lang": "Ruby", "bug_code_uid": "22c64f49cbe1b8f08b07dc5ab183949d", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "7036c1d6c4566ce922fed4ada2882f56", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7446808510638298, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "s=gets;puts %w(Danil Olya Slava Ann Nikita).one?{|e|s.scan(e).size==1}?:YES: :NO", "lang": "Ruby", "bug_code_uid": "ad74a6007e421ce8b4fd620fb4a618cb", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "a5cb647a4aaa86ab9b469b6979283f7b", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9049773755656109, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets\nres = 0\nfor i in 0..s.length\n case\n when i + 4 < s.length && s[i] + s[i + 1] + s[i + 2] + s[i + 3] + s[i + 4] == \"Danil\" then res += 1\n when i + 3 < s.length && s[i] + s[i + 1] + s[i + 2] + s[i + 3] == \"Olya\" then res += 1\n when i + 2 < s.length && s[i] + s[i + 1] + s[i + 2] == \"Ann\" then res += 1\n when i + 5 < s.length && s[i] + s[i + 1] + s[i + 2] + s[i + 3] + s[i + 4] + s[i + 5] == \"Nikita\" then res += 1\n end\nend\nif res == 1\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "ae0eada286c0a81264dcfa4cff834d9f", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "55b33027725fad9989b32c2f08d36651", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6796116504854369, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "f=[\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"]\ns=gets\nputs (f.one?{|x| !!s[x]} ? \"YES\" : \"NO\")\n", "lang": "Ruby", "bug_code_uid": "b7ebb28cc8b31c0eb059b3622d22900f", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "93ce7cf0bdabb20378d894b10a535972", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8280701754385965, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "names = %w(Danil Olya Slava Ann Nikita)\nline = gets.chomp\n\nputs names.select { |name| line.include?(name) }.count == 1 ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "e4a06e3fa75bb64ab76aba897214fc46", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "683e4f232e72cd924f4ce9710724a9c7", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9299363057324841, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "5.times do |i|\n j = gets.split.find_index(1)\n puts (i-2).abs + (j-2).abs\nend", "lang": "Ruby", "bug_code_uid": "cc408fd567e8fbde495a44441b0eb5ca", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "19c44678cd03c75fa843653a7bb0fbb1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9806451612903225, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = $<.gets ?1\ni = s.count(?\\n)\nj = s[/.+1/].count ?0\np (2-i).abs + (2-j).abs\n", "lang": "Ruby", "bug_code_uid": "6f89de66a1c9dbcbc22f5d81bca2cff0", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "c69b20f2537e2b291f49f7265989cf19", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6264367816091954, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 22, "bug_source_code": "a = []\n\nfor i in 0..4\n a[i] = []\n for j in 0..4\n a[i][j] = gets.to_i\n if a[i][j] == 1\n b = i\n c = j\n end\n end\nend\n\nputs (b - 2).abs + (c - 2).abs", "lang": "Ruby", "bug_code_uid": "6832075dfd328da91f90d1caf7f312d3", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "4fe8fa26c73c7aff36432e40737ac2f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7920792079207921, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "1..5 { |i| gets.chomp.split.each_with_index do |x,j|\n if x == 1\n puts (i-3).abs + (j-2).abs \n end\n}", "lang": "Ruby", "bug_code_uid": "477647bbabe39171c0aa5661374b896a", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "11af9703f491fa6298a4dcd45a70f2a5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.986737400530504, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\na = gets.chomp.split.map(&:to_i)\n\np = q = 0\na.each_with_index do |v, i|\n dp = (v - (i*2+1)).abs\n dq = (v - (i*2+2)).abs\n p += dp\n q += dq\n\nend\n\nputs p < q ? p : q", "lang": "Ruby", "bug_code_uid": "d47f9157f8cf532108248d5da036b696", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "88db44ffc37fae3d57ab722edf2d9abf", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.993103448275862, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "start, finish = gets.chop.split\nnumberOfSpins = gets.chomp.to_i % 4\nspinner = ['v', '<', '^', '>']\nsi = spinner.index start\na = spinner[si + numberOfSpins] == finish\nb = spinner[si - numberOfSpins] == finish\nif a and !b \n puts \"cw\"\nelsif b and !a\n puts \"ccw\"\nelse\n puts \"undefined\"\nend", "lang": "Ruby", "bug_code_uid": "ad7ef8030c523e899414294269324bd5", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "297c0859d8a67376f98b53e3b8086272", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4629156010230179, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "rotations = %w{ ^ > v < ^ > v < }\n\nstart_pos, end_pos = gets.strip.split\nn = gets.strip.to_i\nn %= 4\n\nstart_pos_cw = rotations.index start_pos\nstart_pos_ccw = rotations.index start_pos\n\ncw = rotations[start_pos_cw + (n - 4)] == end_pos\nccw = rotations[start_pos_ccw + (n - 4)] == end_pos\nif cw && !ccw\n puts \"cw\"\nelsif ccw && !cw\n puts \"ccw\"\nelse\n puts \"undefined\"\nend", "lang": "Ruby", "bug_code_uid": "2dd8555b5eb30b1a0725f94e42a1c4c1", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "c2988b508211720e354c3b4fa7773ce6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"}