{"similarity_score": 0.22719449225473323, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/ruby\n\n# Get one number at a time\nn = STDIN.gets.to_f\nres = Math.log2(n).ceil.to_i\nputs res\n\n", "lang": "Ruby", "bug_code_uid": "f3a85c661a7375124f5bc30de1d46118", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "9297782fa5d053bc223ac17a199ff0b0", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.46920821114369504, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "n = gets.to_i\nif n == 2\n printf(\"%d\\n\", 1)\nelsif n == 3\n printf(\"%d\\n\", 2)\nelse\n cnt = 2\n i = 3\n while(1)\n add = 2 ** (cnt - 1)\n i += add\n break if i > n\n cnt += 1\n end\n printf(\"%d\\n\", cnt)\nend\n", "lang": "Ruby", "bug_code_uid": "765bbf9467b8ddb98d79f56975f9a321", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "78b51dbf920e2a9d9ed0dc3ea0c1fc0e", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5072886297376094, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "class Main\n #def get_problem_link\n # problem_link = \"https://codeforces.com/contest/978/problem/B\"\n # return problem_link\n #end\n\n #def get_submission_link\n # submission_link = ''\n # return submisson_link\n #end\n\n #begin\n #of codeforces interface\n def run_interface\n n = gets.to_i\n k = gets.split(' ')\n puts solution(n, k)\n end\n #end\n #of codeforces interface\n\n def solution(n, array_of_strings)\n res = 0\n counter = 0\n array_of_strings.each {|value|\n if value === \"x\"\n counter +=1\n else\n counter = 0\n end\n if counter > 2\n res +=1\n end\n }\n return res\n end\n\nend\n\n#then upload to codeforces uncomment this line:\nMain.new.run_interface\n", "lang": "Ruby", "bug_code_uid": "88c2718d138260013707a18827706ae2", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "0ab4fb2271facdb4f4b6a52930780daf", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8421052631578947, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "p -~gets.to_i**2/4", "lang": "Ruby", "bug_code_uid": "19c2c7d566ae9fb5c73855cc6bf851ce", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "2ba299f837eabdaf1a10888d0ae78fdf", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9361702127659575, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m,a,b = gets.split.map{|x| x.to_i}\n#p n,m,a,b\nif a < b/m.to_f\n puts a*n\nelse\n puts b*(n/m) + a*(n%m)\nend\n#puts (x/5.0).ceil\n", "lang": "Ruby", "bug_code_uid": "f86fe89ec4d09c3de736e5dc9ec0b59b", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "d77a1bb1d8bc0c03f1e4d2ed82d6c021", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9747126436781609, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n_m_a_b = gets.split\nn = n_m_a_b[0].to_i\nm = n_m_a_b[1].to_i\na = n_m_a_b[2].to_f\nb = n_m_a_b[3].to_f\n\nif b / m < a\n cost = n / m * b + n % m * a \n puts cost.to_i\nelse\n cost = n * a \n puts cost.to_i\nend", "lang": "Ruby", "bug_code_uid": "b6a49f1c1d3110b556c9a5980756e87b", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "47e23a0c3776538232de87c16f22599d", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9488372093023256, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\n\nn, m, a, b = STDIN.readline.split.map {|s| s.to_i }\nputs [n*a, n/m*b + n%m * a].min\n\n", "lang": "Ruby", "bug_code_uid": "eb34f041df075e018895e50639d1cb3d", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "a1101eb4def3307fc7a4c310db1309fa", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9967105263157895, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#lucasmc\n\nclass Cheap\n attr_reader :result\n attr_reader :m\n attr_reader :n\n attr_reader :a\n attr_reader :b\n\n def initialize\n @result = 0\n end\n\n def calculate(n, m, a, b)\n m_ratio = b / m\n if m_ratio >= a \n @result = n * a\n else\n if m >= n\n @result = [a * n, b].min\n else\n q = n / m\n r = (n - (m * q))\n @result = [(q * b) + r * a, (q * b) + r * b].min\n end\n end\n return @result\n end\nend\n\n\ninput = gets.chomp.split(\" \").map(&:to_i)\n\nn = input[0]\nm = input[1]\na = input[2]\nb = input[3]\n\ncheap = Cheap.new\n\nputs cheap.calculate(n,m,a,b)\n", "lang": "Ruby", "bug_code_uid": "46002d064dc61bf63d6d7a2a0f3b76c5", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "bf56b16866873eab51011c293374fdc7", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9982300884955753, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m, a, b = $stdin.readline.split.map(&:to_i)\n\nv = []\nm_count = 0\nwhile m_count0 ? n_count : 0\n s = m_count*b + n_count*a\n #puts \"n_count=#{n_count}, m_count=#{m_count}, s=#{s}\"\n v << s\n m_count += 1\nend\n\nputs v.min\n", "lang": "Ruby", "bug_code_uid": "2f4e6e6cda25a65725814e2920622d98", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "b275bb3829448cc39186e6ac2bb732a1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.923943661971831, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m, a, b = gets.chomp.split.map(&:to_i)\nans = a * n\nk = 1\nwhile k * m <= n do\n tans = k * b + ( n - k * m ) * a\n ans = tans if tans < ans\n k += 1\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "dad00a3ac3500b7cc41b98adb70f2a2b", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "a879bcf402ed11c271452579445903fe", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9924585218702866, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": " na=gets.chomp\n n=na[0..na.index(\" \")-1].to_i\n i=na.index(\" \")\n m=na[i+1..na.index(\" \",i+1)-1].to_i\n i=na.index(\" \",i+1)\n a=na[i+1..na.index(\" \",i+1)-1].to_i\n i=na.index(\" \",i+1)\n b=na[i+1..na.length-1].to_i\n \n if a<(b/m).floor\n puts n*a \n else \n puts [(n/m+1)*b,(n-(n/m).floor*m)*a+((n/m).floor)*b].min.to_i\n end\n ", "lang": "Ruby", "bug_code_uid": "2dee0811bdf397db3727da5979da2344", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "6f129b55933cfeab354a95cec0e1f9c1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8514056224899599, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m, a, b = gets.chomp.split.map &:to_i\nmax = n * a\nmax = [max, (n / m) * b + (n % m) * a].min\nputs max\n", "lang": "Ruby", "bug_code_uid": "96a7b78944095b1edc72bd97c87e2c2e", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "f6dfeace7bd7b546bf602f83e8e75959", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "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": "n, m, a, b = gets.split.map(&:to_i)\nputs [n*a,n/m*b+n%m*a].min", "lang": "Ruby", "bug_code_uid": "f35dd76112aaed1cfd7ca457e6412d0a", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "61a06d949a4776da550b3963e43b0c02", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9310344827586207, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m,a,b=gets.split.map &:to_i\np [n*a,n/m*b+n%m*a].min\n", "lang": "Ruby", "bug_code_uid": "0d0b697fc27a67b9722daad75d829303", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "13119a8b3b3288cd97d76a9b7b33188e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9689213893967094, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n, m, a, b = gets.chomp.split(/ /).map(&:to_i)\ncost_each_ride = n * a\nspecial_rides = (n / m).floor\nremaining_rides = n % m\ncost_with_special_rides = (special_rides * b) + (remaining_rides * a)\nminimum_cost = [cost_each_ride, cost_with_special_rides].min\nputs minimum_cost\n", "lang": "Ruby", "bug_code_uid": "db96d6fd89a117c49283bdfc1ee127f1", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "8b02dc3c8839d5aebcf3a4ac62f67b65", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9557522123893806, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "ans=10**10\nn,m,a,b=gets.split.map{|e| e.to_i}\n0.step(n,m){|i|\n\tt=(i/m)*b+(n-i)*a\n\tans=[ans,t].min\n}\nputs ans", "lang": "Ruby", "bug_code_uid": "96c4315ba8d529b4a3894af5a303d464", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "62e1370ad095848d0d5e02588f9a73c8", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9895470383275261, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,m,a,b = gets.chomp.split.map(&:to_i)\n\nbuy_for_a = n*a\n\nif n >= m\n if n%m == 0\n buy_for_b = (n/m)*b\n else\n tt = ((n/m)*b) + ((n%m)*a)\n ttt = ((n/m)+1)*b\n buy_for_b = [tt,ttt].min\n end\n # buy_for_b = [t,tttt].min\nelse\n buy_for_b = (m*b)\nend\n\nputs [buy_for_a,buy_for_b].min", "lang": "Ruby", "bug_code_uid": "2992ee77e5934acb788a8a5e92a04d3f", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "93b354c78c37ac05a68f195cba655faf", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9947368421052631, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,m,a,b = gets.split(\" \").map(&:to_i)\nno_of_special_tickets = n / m\none_way = n % m\nputs [one_way * a + no_of_special_tickets * b, (n.to_f/m).ceil * b,n * b].min\n#min(all sp,all one way,mix)", "lang": "Ruby", "bug_code_uid": "94ad320016315acddfd010bfe383611c", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "3586770f8e344329fb9d33615adac9e0", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9952380952380953, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "input = gets.chomp.split\nn = input[0].to_i\nm = input[1].to_i\na = input[2].to_i\nb = input[3].to_i\n\nncost = n*a\nmcost = 0\nwhile n > m\n mcost += b\n n -= m\nend\n\nmcost += [n*a,m*b].min\n\nputs [ncost, mcost].min\n", "lang": "Ruby", "bug_code_uid": "2305b0381f96bc712cb8176e25b1a04e", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "d7cdc6cd2918cfeb5ee4d4152ea930e1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9139784946236559, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m, a, b = gets.split(' ').map(&:to_i)\n\nputs [a*n, a*n.modulo(m) + b*n.div(m)].min\n", "lang": "Ruby", "bug_code_uid": "568131f29cd24f663346c73498aa2eb3", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "efa077c51888131f3cecb9d011c30b72", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8949416342412452, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "line = gets\nn, m, a, b = line.split.map(&:to_i)\nnum1 = n * a\nnum2 = ((n/m) * b) + ((n%m) *a)\nputs [num1, num2].min\n", "lang": "Ruby", "bug_code_uid": "020dd0acb6d287f56824e7fe8c3fc698", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "37f8f1952eb2636ecdb4c40737d9f99f", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5210843373493976, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "nums = gets.split(\" \")\n\nn = nums[0].to_i\nm = nums[1].to_i\na = nums[2].to_i\nb = nums[3].to_i\n\nno_pass = n * a\n\nif n / m == 0\n pass = n / m * b\nelse\n buff1 = (n / m) * b + b\n buff2 = (n / m) * b + (n % m) * a\n\n buff1 > buff2 ? pass = buff2 : pass = buff1\nend\n\nno_pass > pass ? result = pass : result = no_pass\n\nputs result", "lang": "Ruby", "bug_code_uid": "4d5c853b20221a39249235e5d12a1908", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "6387af54b9fdb204c3efe951b751671e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9379310344827586, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "x, y, z, d= gets.split.map(&:to_i)\nputs [n*a,n/m*b+n%m*a, (n/m+1)*b].min", "lang": "Ruby", "bug_code_uid": "9e2fa8ff24831fcc0bd4adbb0f9dc090", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "19559f7df71db0c6048de535d12e129f", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8682432432432432, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "class Integer\n N_BYTES = [42].pack('i').size\n N_BITS = N_BYTES * 16\n MAX = 2 ** (N_BITS - 2) - 1\n MIN = -MAX - 1\nend\nn, m, a, b = gets.split.map(&:to_i)\nmin = Integer::MAX\nfor i in 0..n\n x = (b*i)+(a*(n-(m*i)).abs)\n if x < min\n min = x\n end\nend\np min\n\n", "lang": "Ruby", "bug_code_uid": "ed0dca89b6ab05055c6bce0178a04685", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "87448669ef73626247a8462fd99447e1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9486049926578561, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "r1, c1, r2, c2 = gets.split.collect{|i| i.to_i}\nif r1==r2 and c1==c2\n rook = 0\nelsif r1==r2 or c1==c2\n rook = 1\nelse\n rook = 2\nend\nif (r1+c1)%2 != (r2+c2)%2\n bishop = 0\nelsif (r1+c1)==(r2+c2) or (r1-c1).abs==(r2-c2).abs\n bishop = 1\nelse\n bishop = 2\nend\nking = [(r1-r2).abs,(c1-c2).abs].max\nputs [rook,bishop,king].join(\" \")\n", "lang": "Ruby", "bug_code_uid": "01e40f6af232215384754dc2ba978f23", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "af89fc60e0ec22f0647d409271774550", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9754601226993865, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "r1, c1, r2, c2 = gets.split.collect{|i| i.to_i}\nif r1==r2 and c1==c2\n rook = 0\nelsif r1==r2 or c1==c2\n rook = 1\nelse\n rook = 2\nend\nif (r1+c1)%2 != (r2+c2)%2\n bishop = 0\nelsif r1+c1==r2+c2 or r1-c2==r2-c1\n bishop = 1\nelse\n bishop = 2\nend\nking = [(r1-r2).abs,(c1-c2).abs].max\nputs [rook,bishop,king].join(\" \")\n", "lang": "Ruby", "bug_code_uid": "0d098f3601bfa267a809ddf631869aef", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "af89fc60e0ec22f0647d409271774550", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3073394495412844, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "require 'set'\n\ndef check n\n set=Set.new\n while set.size<=2 && n>0\n set< 0 ,'e' => 0 ,'l1' => 0 ,'l2' => 0 ,'o' => 0 }\nhello_str['h'] = input_words.index('h')\nhello_str['e'] = input_words.index('e')\nhello_str['l1'] = input_words.index('l')\nhello_str['l2'] = input_words.index('l',hello_str['l1']+1)\nhello_str['o'] = input_words.index('o')\n\nif hello_str['h'] < hello_str['e'] && hello_str['e'] < hello_str['l1'] && hello_str['l1'] < hello_str['l2'] && hello_str['l2'] < hello_str['o'] then\n print 'YES'\nelsif\n print 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "fa0aeddfe2b9dd2d96862f3e5726e2a9", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "a2d259a1d62dce1e87b3ddd5d36ac18a", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7865168539325843, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "input_words = gets.chomp\nhello_str = {'h' => 0 ,'e' => 0 ,'l1' => 0 ,'l2' => 0 ,'o' => 0 }\nhello_str['h'] = input_words.index('h')\nhello_str['e'] = input_words.index('e', hello_str['h']+1)\nhello_str['l1'] = input_words.index('l', hello_str['e']+1)\nhello_str['l2'] = input_words.index('l',hello_str['l1']+1)\nhello_str['o'] = input_words.index('o', hello_str['l2']+1)\n\nif hello_str['h'] < hello_str['e'] && hello_str['e'] < hello_str['l1'] && hello_str['l1'] < hello_str['l2'] && hello_str['l2'] < hello_str['o'] then\n print 'YES'\nelsif\n print 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "7d6237c273ec28c792498c083b2fcb80", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "a2d259a1d62dce1e87b3ddd5d36ac18a", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.984375, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts (gets.chomp =~ /.*h+.*e+l+.*l+.*o+.*/).nil? ? 'NO' : 'YES'", "lang": "Ruby", "bug_code_uid": "dd2218875764fbcda1d3936fe78137c3", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "c08ed1dff9b3897f7617fae0db9f7082", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7586206896551724, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "print gets.strip =~ /.h+e+l+o+./ ? :YES : :NO", "lang": "Ruby", "bug_code_uid": "10fa440bf3065f518275e9a2482688f4", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "fbf295f17355d6ca137a2476f8f4d67d", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4011142061281337, "equal_cnt": 19, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "n, res = gets.to_i, 0\nh = {}\na = (1..n).to_a\nc = (1..n).to_a.combination(2).each do |x, y|\n h[[x, y]] = x^y\nend\nh.each do |k, v|\n res +=1 if v <= n && v > k.max && v < k[0]+k[1]\nend\nputs res", "lang": "Ruby", "bug_code_uid": "954d01e1363c5514d1735ae3f2e7f2d8", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "bb0ece8a7c9fbd0e6aaa5df5342f541d", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9858956276445698, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\ndef fact(x)\n fact = 1\n x.times do |el|\n fact *= (el + 1)\n #fact %= (10**9 + 7)\n end\n fact\nend\n\n\ndef fact_mod(x)\n fact = 1\n x.times do |el|\n fact *= (el + 1)\n fact %= (10**9 + 7)\n end\n fact\nend\n\ndef fc(n, k)\n fact(n)/(fact(n - k)) # % (10**9 + 7)\nend\n\nn, x, pos = gets.chomp.split(' ').map(&:to_i)\nless = -1 \ngreater = 0\nleft = 0\nright = n\narr = (1..n).to_a\nwhile left < right\n middle = (left + right) / 2\n if arr[middle] <= pos + 1\n less += 1\n left = middle + 1\n else\n greater += 1\n right = middle\n end\nend\ngr_count = n - x\nls_count = n - gr_count - 1\nfixed = n - less - greater - 1\nputs (fact(fixed) * fc(gr_count, greater) * fc(ls_count, less)) % (10**9 + 7)\n", "lang": "Ruby", "bug_code_uid": "8c60b6b36c92ab34f0a92b9745df4649", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "9d5fc7b19550ac6f993274e4a12ba6b9", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5263157894736842, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "print 2**input()*2-2", "lang": "Ruby", "bug_code_uid": "991f0d4aa1794bb708231abb32413e5d", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "47eb39c7a8389dbcadc2299c97e9bce7", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9444444444444444, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "p 1**gets.to_i*2-2", "lang": "Ruby", "bug_code_uid": "8dd5ff5dd6299f1dfded256fac0a2078", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "47eb39c7a8389dbcadc2299c97e9bce7", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8789808917197452, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = gets.to_i\n\nk = 2\ns = 0\n(n-1).times do\n s += k*3\n k *= 2\nend\n\nputs n == 1 ? 2 : s", "lang": "Ruby", "bug_code_uid": "b343d2f16e80ca84171908165e285ade", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "a9f417b5b1fff080a57552a2b4d747b9", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9367088607594937, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a=gets.chomp.to_i\nb=2**a-2\nputs\"#{b}\" ", "lang": "Ruby", "bug_code_uid": "f364a1eeff00c4fd9b426d34af95a2a8", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "affe765affdf23819b446a215442971a", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6222222222222222, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.strip.to_i\nputs(2**n)", "lang": "Ruby", "bug_code_uid": "7ff17a5da667f49bc7aa11dc4cb64c2f", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "9fe0ecf2935ac9969545457cbcafb52b", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.27638190954773867, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "input = gets.split(\" \")\ninput = input.sort\n\ntotal_dist = 0\n\nfor i in 1..input.length-1\n\ttotal_dist = total_dist + (input[i].to_i - input[i-1].to_i)\nend\n\nputs total_dist", "lang": "Ruby", "bug_code_uid": "6af692c9a580cecebe6dc226c30ef512", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "a1d0268e76a57980b4f925cce4a2b1a6", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5815602836879432, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a, b, c = gets.split.map(&:to_i)\ng = (a + b + c) / 3\np (a - g).abs + (b - g).abs + (c - g).abs\n", "lang": "Ruby", "bug_code_uid": "caa089a809dcf6a1f57798ca6b95865f", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "379ef88926066a4f05e8ce232185ba7d", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.591304347826087, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "input = gets.chomp.split(' ').map(&:to_i)\n\nsum = input.reduce(:+)\nsum /= 3\nans = 0\n\ninput.each do |i|\n\tans += (sum - i).abs\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "16d328ba15382570abc0cf6da34d9cee", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "651dd34bdad964d59207bc72f7b56877", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8770833333333333, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "n = gets.chomp\ns = gets.chomp\narr = s.split('')\ndef process(arr)\n\tres = 0\n\twhile !arr.empty?\n\t\ttmp = arr.pop\n\t\tarr_tmp = []\n\t\tarr_tmp.push(tmp)\n\t\ti = arr.length-1\n\t\twhile i >= 0\n\t\t\tarr_tmp.push(arr[i])\n\t\t\tu = 0\n\t\t\tr = 0\n\t\t\td = 0\n\t\t\tl = 0\n\t\t\tarr_tmp.each{ |e|\n\t\t\t\tif e == 'U'; u += 1;break; end\n\t\t\t\tif e == 'R'; r += 1;break; end\n\t\t\t\tif e == 'D'; d += 1;break; end\n\t\t\t\tif e == 'L'; l += 1;break; end\n\t\t\t}\n\t\t\tres += 1 if u == d && r == l\n\t\t\ti -= 1\n\t\tend\n\tend\n\tputs res\n\t\nend\nprocess(arr)", "lang": "Ruby", "bug_code_uid": "f011e10fca7a3f45b0b7509b473370aa", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "a1bf30402a98ffcd9d403e7035074aa0", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9908536585365854, "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.strip\n\ndef mv(l)\n case l\n when 'U' then [0, 1]\n when 'R' then [1, 0]\n when 'L' then [-1, 0]\n when 'D' then [0, -1]\n end\nend\n\nct = 0\n\nfor i in 0...s.size\n x, y = mv(s[i])\n for j in 1...s.size\n dx, dy = mv(s[j])\n x += dx\n y += dy\n if x==0 && y==0\n ct+=1\n end\n end\nend\n\nputs ct", "lang": "Ruby", "bug_code_uid": "fab7d6fae11a394849838ab8171450f7", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "7d394c5a5240c5315f5fe2cb436575c0", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8571428571428571, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "if gets.to_i%2==0 then puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "faa68afb605922dfed7947da9723a4d3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e97278c87ca75617b14f61443260d22c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.918918918918919, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a = gets.to_i\n\nif (a % 2) == 0 || a == 2\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "3ca0e560cdd9adac84cdfcf07b48001a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "71a5debd6e394d1e5710be875f9fcc13", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7596899224806202, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": " w = gets.to_i\n (w%2 == 0 and w >= 2)? puts 'YES' : puts 'NO'", "lang": "Ruby", "bug_code_uid": "d8ef4701441538ee0c0b3d1d41b92c17", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0b5f31db6fcc73db5582842d8f4426ea", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7777777777777778, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": " w = gets.to_i\n (w%2 == 0 and w >= 2)?(puts \"YES\"):(puts \"NO\")", "lang": "Ruby", "bug_code_uid": "6adea6284265138502a5a33f80fb0f41", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0b5f31db6fcc73db5582842d8f4426ea", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9315068493150684, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w = gets.to_i\nif w % 2 == 0 then print \"YES\\n\"\nelse print \"NO\\n\"\nend", "lang": "Ruby", "bug_code_uid": "c650f9568cacf7d0f70053dc9af0c38c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "55ce834191f5146f42f9f77960791574", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9193548387096774, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w = gets.to_i\n\nif w.odd?\n\tputs 'NO'\nelse\n\tputs 'YES'\nend\t", "lang": "Ruby", "bug_code_uid": "9f35e8619a937bfe60e428f1d482339b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5e93485fe8366165441262884ac4122e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8450704225352113, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "ARGV.each_with_index do |arg, i|\n num1 = Integer(arg)\n if num1>3 && num1%2==0\n puts 'YES'\n else\n puts 'NO'\n end\nend\n", "lang": "Ruby", "bug_code_uid": "096b1d9323e492f3d0939dc2abdefa88", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "095036dda72c4faf0b18854c29dbc117", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9607843137254902, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = Integer(gets())\nif n.odd? then\n puts \"NO\"\n exit 0\nend\n\na = b = n/2\n\nif a.even? && b.even? then\n puts \"YES\"\n exit 0\nend\na--\nb++\nif a <= 0:\n puts \"NO\"\n exit 0\nend\nif a.even? && b.even? then\n puts \"YES\"\n exit 0\nend\nputs \"NO\"\n", "lang": "Ruby", "bug_code_uid": "009a4e3b60ce5b9acaa65f7fc62fe457", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8c10521633ae946087084acb3f35a50f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9727626459143969, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = Integer(gets())\nif n.odd? then\n puts \"NO\"\n exit 0\nend\n\na = b = n/2\n\nif a.even? && b.even? then\n puts \"YES\"\n exit 0\nend\na--\nb++\nif a <= 0 then\n puts \"NO\"\n exit 0\nend\nif a.even? && b.even? then\n puts \"YES\"\n exit 0\nend\nputs \"NO\"\n", "lang": "Ruby", "bug_code_uid": "dca7ec57e08cec60406a2db40ac18119", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8c10521633ae946087084acb3f35a50f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9202453987730062, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "watermelon_weight = gets.to_i\n\nif watermelon_weight >= 1 && watermelon_weight <= 100\nif watermelon_weight%2 == 0\n puts \"Yes\"\nelse\n puts \"No\"\nend\nend", "lang": "Ruby", "bug_code_uid": "ee84556e15793f943e01e6a2b9ac39d8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "4bba59c2ab5bf2b2e7d34a4bb97c8b38", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5581395348837209, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "if gets.to_i % 2 == 0\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "8e47ca084f7566deff34019db7e4c954", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a31453e37d492d8fe2dc7b9ea421a296", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9393939393939394, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a = gets.to_i\nif a%2!=0 && a>2\n puts \"NO\"\n else\n puts \"YES\"\nend\n", "lang": "Ruby", "bug_code_uid": "608f2039289434fb7ae1153d1890392b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2ad3a8b81f6110e34f6722ab4d05bf93", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.49032258064516127, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "w = gets.chomp.to_i\np,b = w/2, w/2\n(p.even? && b.even?) ? (puts \"YES\") : (puts \"NO\")", "lang": "Ruby", "bug_code_uid": "907de1dd8898038b9c5e633191f58b64", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cc092a6a1ffee49dbec91cd263e450ed", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8987341772151899, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "w = gets.chomp.to_i\nif w.odd? || w == 2\n\tputs \"NO\"\nelse\n\t(puts \"YES\") : (puts \"NO\")\nend", "lang": "Ruby", "bug_code_uid": "2919d1abd424697bc1ac9e0c7519c596", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cc092a6a1ffee49dbec91cd263e450ed", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7217391304347827, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "input = gets.to_i\n\ncount = 0\nwhile input % 2 == 0 && count < 3 do\n count += 1\n input /= 2\nend\n\nif count >= 2\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "a263da255a4d7ee0eca907179ba8e8a2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e3b5b3619f19f82441c2c1bc61bc0bef", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9747899159663865, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def water\n a=gets.chomp\n if a.to_i!=2 && a.to_i%2==0\n print\"YES\"\n else\n print\"NO\"\n end\nend", "lang": "Ruby", "bug_code_uid": "0cb7b96c6a4e8367c3bf64d4d18d46f8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b273a54595d1013bc795c81e4031afa7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7474747474747475, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "w = gets.to_i\n\nputs w % 2 == 1 ? 'NO' : 'YES'", "lang": "Ruby", "bug_code_uid": "f49345426721465fddf8fabc7b6d26d1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "7e3d046342646a7fa179e8da2bdecef1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "if gets.chomp.to_i % 2 == 0\n puts \"YES\"\nelse \n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "894037fbd60572c1562cfff3ee1861c5", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "037ef991e691e8e8a8b7d25027042b13", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.996996996996997, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "w = Integer(STDIN.gets) \nraise \"input error.\" unless (1...100).include?(w) \n\nif w == 2 \n puts \"NO\" \nelse\n if w % 2 == 0\n puts \"YES\"\n else\n puts \"NO\"\n end\nend", "lang": "Ruby", "bug_code_uid": "76b8223731872f32bdbdde26c26f1a00", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e7f971eeb971aa48f0f2b71e3aeaded7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.927710843373494, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "w = gets.to_i\n\nif w % 2 == 0 || w == 2 then\n print \"YES\"\nelse\n print \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "e9fb9e35393859a7d1d112f2075624e7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8bc2c1eb63b64ac2d1873cb336f58cfe", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5357142857142857, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "return w % 2 == 0 ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "243e0051346c59a93157c7ece9738e20", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5746491cda9037ca2a5512a8e7d96a46", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.87248322147651, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/env ruby\ninp = gets\nputs inp.to_i % 2 == 0 ? 'YES' : 'NO'\n", "lang": "Ruby", "bug_code_uid": "39bdd51c0da0ae93d179a1fe7eb830f1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5746491cda9037ca2a5512a8e7d96a46", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9932885906040269, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a,ta,b,tb,h,m=$<.read.tr(':',' ').split.map(&:to_i)\nx1=h*60+m;y1=x1+ta\nr=0\n300.step(1440-b,b){|x2|\n\ty2=x2+tb\n\tr+=1 if [x1,x2].max < [y1,y2].min\n}\np r", "lang": "Ruby", "bug_code_uid": "6fe0fccd1f97000321f1ec5427c486e5", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "9100d845cc3d6ecac6a502ad3ad9641f", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.28773584905660377, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "p, d = gets.split.map(&:to_i)\nst = 1\nst += 1 while p%10**st + 1 <= d\nst -= 1\ndown = p%(10**st) + (st == 0 ? 0 : 1)\nputs p - down", "lang": "Ruby", "bug_code_uid": "156dd55de6990348588e03bfbcdd51f4", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "c82b97e52b19e19566fe05f587cb493e", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8739205526770294, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def count(n)\n c = 0\n while n%10==9\n c+=1\n n/=10\n end\n return c\nend\n\np,d = gets.chomp.split.map(&:to_i)\nc = p\nmax = count(p)\ndiv = 1\nans = c\nwhile p - c <= d\n ans = c if(count(c)>max)\n div = div * 10\n c = (c/div)*div - 1\nend\nputs ans", "lang": "Ruby", "bug_code_uid": "a4bf0f115807ce5607a849367645bcc0", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "fbcfc9d157ec70055d0fe5fa6bc0cb0e", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9898305084745763, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "p, d = gets.chomp.split(' ')\nd = d.to_i\npointer = p.length - 1\nans = p.to_i\n\nloop do\n alen = ans.to_s.length\n if (p[pointer].to_i != 9)\n number_to_minus = (ans.to_s[pointer].to_i + 1) * (10 ** (alen - 1 - pointer))\n if (number_to_minus <= d)\n d -= number_to_minus\n ans -= number_to_minus\n else\n break\n end\n end\n pointer -= 1\n pointer -=1 if (alen != ans.to_s.length)\n break if (pointer <= 0)\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "47360f0983cb3fddae8e960d368414e9", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "8805f9b760387a295248ac7e0be042d6", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.38826185101580135, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "p, d = gets.chomp.split(' ')\n\nd = d.to_i\npointer = p.length - 1\nans = p.to_i\nend_i = 0\n\nwhile (pointer >= end_i)\n if (p[pointer].to_i != 9)\n next_reduction_number = (ans.to_s[pointer].to_i + 1) * (10 ** (ans.length - 1 - pointer))\n if (next_reduction_number <= d)\n d -= next_reduction_number\n ans -= next_reduction_number\n else\n break\n end\n end\n pointer -= 1\n end_i = p.length - ans.to_s.length\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "f9ed751ac30d4a255e7ca306a7da2015", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "8805f9b760387a295248ac7e0be042d6", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9971988795518207, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "line = STDIN.gets\nA = line.split(\" \");\ns = A[0].length\np = A[0].to_i\nd = A[1].to_i\nif( d == 0 )\n puts p\n exit(0)\nend\nres = 0\nmod = 10\nnow = 9\ns.times { |i|\n q = p\n r = q\n if( r >= now && d >= (r-now)%mod && q >= (r-now)%mod ) \n res = q-(r-now)%mod\n end\n mod *= 10\n now *= 10\n now += 9\n}\nif( res == 0 )\n puts p-1\nelse\n print res,\"\\n\"\nend", "lang": "Ruby", "bug_code_uid": "87370d3005500df0100e9bfe6ea0f894", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "da5669fa882d9267aebc646d43271093", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9214501510574018, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "line = STDIN.gets\nA = line.split(\" \");\ns = A[0].length\np = A[0].to_i\nd = A[1].to_i\nif( d == 0 )\n exit(1)\nend\nres = 0\nmod = 10\nnow = 9\ns.times { |i|\n q = p\n r = q\n if( r >= now && d >= (r-now)%mod && q >= (r-now)%mod ) \n res = q-(r-now)%mod\n end\n mod *= 10\n now *= 10\n now += 9\n}\nprint res,\"\\n\"", "lang": "Ruby", "bug_code_uid": "43ea5fc15ee668241ed63e1999b042c7", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "da5669fa882d9267aebc646d43271093", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9716713881019831, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "line = STDIN.gets\nA = line.split(\" \");\ns = A[0].length\np = A[0].to_i\nd = A[1].to_i\nif( d == 0 )\n puts p\n exit(0)\nend\nres = 0\nmod = 10\nnow = 9\ns.times { |i|\n q = p\n r = q\n if( r >= now && d >= (r-now)%mod && q >= (r-now)%mod ) \n res = q-(r-now)%mod\n end\n mod *= 10\n now *= 10\n now += 9\n}\nif( res == 0 ) puts p-1\nelse print res,\"\\n\"\nend", "lang": "Ruby", "bug_code_uid": "b63ee36b136d6f23859dd2cd994b1c5e", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "da5669fa882d9267aebc646d43271093", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.44819819819819817, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 11, "bug_source_code": "p,d = gets.split(\" \").map(&:to_i)\n# arr = []\nl = p.to_s.length\nans = p\nl.downto(1).each do |a|\n\tfirst = p / (10 ** (a)) - 1\n\tval = (first.to_s + (\"9\" * a)).to_i\n\tif val >= p - d\n\t\tans = val \n\t\tbreak\n\tend\nend\n\nputs ans", "lang": "Ruby", "bug_code_uid": "57d9c3344f659c3e8a2d7b8950b69921", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "19f1d51d71e534a864897e1ead0fd2c5", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5693430656934306, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "def function\nb=gets.chomp\na=gets.chomp\na=a.split(' ').map(&:to_i).sort.reverse\nb=a.clone\n1.upto a.length do |i|\nif a[i]==a[i-1]\nb[i]-=1\nend\nend\nsum=0\nb.each do |i|\nsum+=i\nend\nputs sum\nend\nfunction", "lang": "Ruby", "bug_code_uid": "44f218a38797d88899c529aa1b170bf2", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "151b4d2b049fcbda12335f157a73aa60", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8702290076335878, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "gets\na=gets.split.map &:to_i\nh = {}\na.sort.each{|x|\n x -= 1 while h[x]\n h[x] = true\n}\nif h[-1]\n p 0\nelse\n p h.map{|k,v|k}.inject :+\nend\n", "lang": "Ruby", "bug_code_uid": "7e2b22abbf462c1f3778bc5c27fe9751", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "ce46cec4a707afdf09790f4fccdfd2d9", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7831325301204819, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = gets.to_i\na = gets.split(' ').map &:to_i\nr = []\nbroken = false\nfor v in a\n while r.index(v)\n v-=1\n end\n if v >= 0\n r << v\n else\n r = [0]\n break\n end\nend\n\nputs r.inject(&:+)", "lang": "Ruby", "bug_code_uid": "5618b706abbee008c8fc49414523baed", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "fd10baf090b828eeef378da7e2607bab", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9704142011834319, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = gets.to_i\nif a == 2\n puts \"YES\"\n elsif a.even?\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "f31d95c5b9795c35543c9d6d7beaaf6f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c658306b32a3e8d6aed0544a27b93e79", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.864406779661017, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "w = gets.chomp.to_i\nputs w / 2.0 % 2 == 0 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "dfc217944109cebe368ad2b525c6e3be", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3fe8cae9b5f19b29cff7e22e3b1084bc", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8235294117647058, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "a = gets.to_i\nputs (a % 2) == 0 ? \"Yes\" : \"No\"", "lang": "Ruby", "bug_code_uid": "46813f8c60686e74d97723d3409bf5f6", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e21fe7d3f0bc51db4b7fda387158186a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9662921348314607, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env ruby\nn = gets.chomp.to_i\nvar = n % 2\nif (var).zero?\n puts ((n - 2)%2).zero? ? \"YES\" : \"NO\"\n\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "bfab26f342a4d9a54b8eb205fc580bcf", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cefad6f2d2146c2b0b575a8750d988ef", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7252747252747253, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "puts gets.to_i % 4 == 0 ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "6ff48cd0e41dc47d764f921a46445eff", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c5ee1be5037de7b231015037694b60e9", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7891156462585034, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "a = gets.chomp\n\nif a / 2 == 0\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "efc54d0a329c8f0ff4b3b042ab6d1675", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5f5a0651c1811fd31ac3b16bd41b5b1a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8493150684931506, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = gets.to_i\n\nif a % 2 == 0\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "4bdc023c60aa913d9329f53f49a39494", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5f5a0651c1811fd31ac3b16bd41b5b1a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9624060150375939, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w=gets.chomp\n\nif(w==2 or w%2==1)\n\tputs 'no'\nelse\n\tputs 'yes'\nend", "lang": "Ruby", "bug_code_uid": "835778937019a53e5b83e0dc28f68bf4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3209883d54de3d484c5a783eb927ad46", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5875706214689266, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "w = gets\n\nif w==2 \n puts \"NO\"\nelsif w%2==0\n puts \"YES\"\nelse\n\tputs \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "9429464ed64a7eba745210409127efa9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "fbb49dec1c2f08a2b02ea046bb552cd7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5492957746478874, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#!/usr/bin/ruby\nputs gets.to_i%2 == 0? :YES: :NO", "lang": "Ruby", "bug_code_uid": "ce7523cb058a280cd146839bbb13e59a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8c74e7e7ec387343ac5d678b1d5c5b48", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9496402877697842, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\na=gets.chomp.to_i;\n((a%2===0)&&(a!=2))? :YES : :NO", "lang": "Ruby", "bug_code_uid": "a1775fcaabd3c6d1c9b1f5abe7ac14a3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8c74e7e7ec387343ac5d678b1d5c5b48", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9814814814814815, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "w = gets.to_i\n\nputs w.even? and w > 2 ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "4709da5a8f60ce54dddd6f800e528dfd", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6ed699a35a53696ea34399c4b0e6f0e1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.84, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "input = STDIN.gets.chomp.to_i\n\nputs 'YES' if input > 2 && input % 2 == 0", "lang": "Ruby", "bug_code_uid": "797eeb5389dd4652c5cb9ee603552dde", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "44ffb02f52486426c9e84e2baf29307a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8623853211009175, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n = gets.chomp.to_i\np n % 2 == 0 && n != 2 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "77492a9162ef4ec10592e07fa800d242", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "dc4808cd97442b195bc40cf5427aac68", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9291338582677166, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a=gets.chomp.to_i\n\nif a%2==0\nputs \"YES\"\nelse \nputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "d9eef1de5d5fc2d0240af7a3554ad401", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2104922b98443c806735b53dda147340", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9779735682819384, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def watermelon(n)\n return \"NO\" if n < 3\n n % 2 == 0 ? \"YES\" : \"NO\"\nend\n\nn = gets.chomp\nwatermelon(n.to_i)", "lang": "Ruby", "bug_code_uid": "b5acef7958d9acf34372ad5ce3a3f51e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3b58a3b3708710b42afd837783f3a5aa", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7733333333333333, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "def watermelon(n)\n return \"NO\" if n < 3\n n % 2 == 0 ? \"YES\" : \"NO\"\nend\n \nn = ARGV[0]\nputs watermelon(n.to_i)", "lang": "Ruby", "bug_code_uid": "828fd3757de9dcd47f4d1d428b70911a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3b58a3b3708710b42afd837783f3a5aa", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8842975206611571, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/env ruby\n\nw = $stdin.gets\nw = $_.strip.to_i\nif w.to_i % 2 == 0 \n print 'YES'\nelse\n print 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "2be134ba03facf8169315c4145290931", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "d55110636ad2bf7a921ab07174f08be1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "puts gets.to_i.even? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "1dc7736c9bd7db498a9f171d14969cea", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "d139c1a9df5ef7661cb6a7a13d10bad5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6966292134831461, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "puts gets.to_i.even? ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "6669f9bc68b5180cadeae91ea65b0dfe", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "d139c1a9df5ef7661cb6a7a13d10bad5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9954545454545455, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x = gets.to_i\n\ny = x/2\nz = x - y\n\nif (x <= 100) and x > 0\n if ((y % 2 == 0) and (z % 2 == 0)) or (((x-2) % 2 == 0) and (x != 0))\n puts \"yes\"\n else\n puts \"no\"\n end\nelse\n puts \"not applicable\"\nend", "lang": "Ruby", "bug_code_uid": "b3bc3dcc89f0d2ad414dc7b705b5cea5", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "45c8bb96f686c8c2852fd611596113b5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6293706293706294, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "a = gets.to_i\n\nif (a % 4 == 0)\n\tp \"YES\"\nelse\n\tp \"NO\"", "lang": "Ruby", "bug_code_uid": "46beb6210eb1af74c5e4b2d4219a3f86", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "76576c55d03b316397b92819eb9314e0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6666666666666666, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "a = gets.to_i\n\nif (a % 4 == 0)\n\tp \"YES\"\nelse\n\tp \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "0836c1ce1ce710430d38a6be0b15ab7f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "76576c55d03b316397b92819eb9314e0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.42443729903536975, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n = gets.split.map(&:to_f)\nif n.even? then \n return \"YES\" \nelse\n return \"NO\"\nend \n", "lang": "Ruby", "bug_code_uid": "7ac77e0d044b0312e7a50f9cc688155f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "666ae43345a9dacbfa14006d01f5d725", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6081504702194357, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "n = gets.split.map(&:to_i)\nn = n[0]\nif n % 2 == 0 then\n print \"YES\" \nelse\n print \"NO\"\nend \n", "lang": "Ruby", "bug_code_uid": "5fb669d2c72c9f8190eafdc9fc10f693", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "666ae43345a9dacbfa14006d01f5d725", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5578231292517006, "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%4==0 then\nputs \"YES\"\nelse\nputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "35616a7b1a5fb373e1eb9313bb3a6fd1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "541c214cbcb4419e87572c455e11de89", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6705882352941176, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "n=gets.to_i\nif n%2!=0 then\nputs \"NO\"\nelseif n<=2\nputs \"NO\"\nelse \nputs \"YES\"\nend", "lang": "Ruby", "bug_code_uid": "da7b1f6c2de10a4be3739525995c6673", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "541c214cbcb4419e87572c455e11de89", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7258064516129032, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "x = gets\nif(x%2==0)\nputs \"YES\"\nelse\nputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "7ebaec7751f5319a004e667ea976f5d7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0771d99e1de9b358198c1d6b4eb9232c", "difficulty": 800, "tags": ["math", "brute force"], "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": "puts gets =~ /(h.*e.*l.*o)/ ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "480aa1980c285fca830b96ab664a377e", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "e956483cdec6d31cd9b7b80ccf8cd6f2", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8909952606635071, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "message = gets.chomp\nif(message=~/^.*?h+?e+?l{2,}?o+?$/) \n puts(\"YES\")\nelse\n puts(\"NO\")\nend\n", "lang": "Ruby", "bug_code_uid": "2e86170b4d8fae2fe5c57597a88c0f1a", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "336510d8b1cd02941994288c0585cec6", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6328358208955224, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "st = gets.chomp\ns = st.split(\"\").uniq\ns = s.join\nif (s.include? \"helo\") && (st.index(\"l\") != st.rindex(\"l\")) then\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "873b5880475c54df2e4ffe42d89d2d48", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "8365b6408f2594c024b629a15f3d7ca7", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9731800766283525, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = gets.chomp\nif s.length == 5\n\tputs s =~ /hello/ ? \"YES\" : \"NO\"\nelse\n\tputs s =~ /h+[\\w]*e+[\\w]*l+[\\w]*o+/ ? \"YES\" : \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "4f2a80b51d8002ed583edaa244f66847", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "5f55a23134d73f92890caad2a111ba00", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.875, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "print gets =~ /.+h.+e.+l.+l.+o.+/ ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "fbd6a07b796de7a66791a24c737a03f2", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "e20f540d133f6829111603ea7130bb64", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9856459330143541, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\n\ndef main()\n s = gets.chomp\n hello = [\"h\",\"e\",\"l\",\"l\",\"o\"]\n x = 0\n for i in 0..s.length-1\n if s[i] == hello[x]\n x+=1\n end\n end\n if x == 5\n print \"Yes\"\n else \n print \"NO\"\n end\nend\n\nmain", "lang": "Ruby", "bug_code_uid": "44c79d4777ea39677560f686d76a4a2a", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "dfa10802daae31e5bf9e21a09789ee41", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6478405315614618, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "typed_word = gets.strip\n\nhello_word = 'hello'\n\nindex = 0\nstate = false\ntyped_word.each_char do |char|\n if hello_word[index].eql?(nil)\n state = true\n break\n end\n\n index += 1 if hello_word[index].eql?(char)\nend\n\nif state.eql?(true)\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "7575487fd3651544c514127390f1a2af", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "e1786685ccf32d059a67b655bd36711e", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.43373493975903615, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "s = gets\nputs (s.count('h') >= 1 and s.count('e') >= 1 and s.count('l') >= 2 and s.count('o') ? \"YES\" : \"NO\")", "lang": "Ruby", "bug_code_uid": "8c8f6bd4d9559dd8d89a2e18004e6a59", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "0c582aa035bdd691948e38694a854761", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7866666666666666, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "puts gets.strip =~ /^[^helo]*[h]*[e]*[l]*[l]*[o]*[^helo]*$/ ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "ff06db42d11f778327f0c94481c887cc", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "7be3bcfc27dd8686d28176a5cb742e0f", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.21428571428571427, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "s = gets.chomp\n\ns.gsub!(/[^helo]/, '')\ns.gsub!(/hh*/, 'h')\ns.gsub!(/ee*/, 'e')\ns.gsub!(/lll*/, 'll')\ns.gsub!(/oo*/, 'o')\nputs (s=='hello' ? \"YES\" : \"NO\")", "lang": "Ruby", "bug_code_uid": "cfacb53391a797b3534315c91a48ece2", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "fb732bc249c9d1419f6d97fe098793b6", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.36213991769547327, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "require_relative 'emaxx'\n\ns = $stdin.readline\nt = s.scan(/./).complect_and_count!\ntt = t.collect {|x| x[:sym] }.join('')\n\nk = tt=~/helou/\nputs (k && t[k+2][:count]>=2) ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "01436c4168696d7fc2cd228791db57f9", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "eae69ac339bdf68ff7f35c8008bfcb13", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.976, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = $stdin.readline\n\nputs (s=~/h.*e.*l.*l.*o.*u/) ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "89185d8fbd9a4186feb4a4ea2d2fea19", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "eae69ac339bdf68ff7f35c8008bfcb13", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.847457627118644, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "unless (gets.chomp.match /h+e+l{2,}o+/).nil? then puts \"YES\" else puts \"NO\" end", "lang": "Ruby", "bug_code_uid": "b4ebbcea420138ee8627482c30abd716", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "6d6d0f65884a9950747dddd654376d50", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8387096774193549, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "okay = gets.chomp =~ /^.*h{1,}e{1,}l{1,}l{1,}o{1,}.*$/\nif okay\n puts \"YES\"\nelse \n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "9523f8194360607d99db7e76f1f88351", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "a3106d70f417b11c44281f310219017f", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9931662870159453, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "ans=0\ni=-1\ninp=gets.chomp.delete \"^helo\"\np inp\n\nwhile i 0 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "1d0d885cc30c508958be6ad47f2b6e6b", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "1455a1dd6a6158d2e4fa5df235fb424b", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9629629629629629, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts (gets.match(/[^h]*h[^e]*e[^l]*ll[^o]*o.*/).nil?)?\"NO\":\"YES\"\n", "lang": "Ruby", "bug_code_uid": "4ca365c5290d681afee45cb5887b58c3", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "35e4cca3d3c72bd37648b63aea1aa9e1", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5142857142857142, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "\nword = gets.chomp\n\na = Array.new\nfor i in 0...word.length\n a[i] = word[i]\nend\n\nb = Array.new\nb[0] = a[0]\nfor i in 0...a.length - 1\n if a[i+1] != a[i]\n b.push(a[i+1])\n end\nend\n\nx = 0\nfor i in 0...a.length - 2\n if a[i] == \"e\" && a[i+1] == \"l\" && a[i+2] == \"l\"\n for j in 0...b.length - 3\n if b[j] ==\"h\" && b[j+1] == \"e\" && b[j+2] == \"l\" && b[j+3] == \"o\"\n x = 1\n end\n end\n end\n if x == 1\n break\n end\nend\n\n\nif x ==1\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "41fc166d137910e7f5182808b8763a2e", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "82ea9346573b695e2b253a6fbeb27944", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7323943661971831, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "str = gets ; str =~ /(h)+(e)+(l)+(l)+(o)/?(puts 'YES'):(puts 'NO')", "lang": "Ruby", "bug_code_uid": "03eabb66c6e596213cdaa54c2bc7b7e2", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "b0496434151a1e0011f34eec1c7adda2", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7433628318584071, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "puts (gets.downcase.include?(\"hello\") ? \"YES\" : \"NO\")\n", "lang": "Ruby", "bug_code_uid": "d2c8d04ddd6cbdb5f379ef9ffc96e101", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "77afc2a80c5cc1fa91cf407cba59fd20", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7996715927750411, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "gets.to_i\nnums = gets.split(' ').map(&:to_i)\n\nall = 0\nmaximum = 0\n(0...nums_orig.length).each do |i|\n (i...nums_orig.length).each do |j|\n\n nums = nums_orig.dup\n (0..nums.length).each do |ind|\n if ind >= i && ind <= j\n nums[ind] = (nums[ind] - 1).abs\n end\n end\n\n\n current,all =0,0\n (0..nums.length).each do |ind|\n if nums[ind] == 1\n current += 1\n else\n all = current if current > all\n current = 0\n end\n end\n\n maximum = all if all > maximum\n all = 0\n end\nend\n\nputs maximum\n", "lang": "Ruby", "bug_code_uid": "a8d0adeb14f7a66cc09e474933d69a5f", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "86653b328b3312860d0a515456b286fd", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8045789043336059, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "gets.to_i\nnums_orig = gets.split(' ').map(&:to_i)\n\nall = 0\nmaximum = 0\n(0...nums_orig.length).each do |i|\n (i...nums_orig.length).each do |j|\n\n nums = nums_orig.dup\n (0..nums.length).each do |ind|\n if ind >= i && ind <= j\n nums[ind] = (nums[ind] - 1).abs\n end\n end\n\n\n current,all =0,0\n (0..nums.length).each do |ind|\n if nums[ind] == 1\n current += 1\n else\n all = current if current > all\n current = 0\n end\n end\n\n maximum = all if all > maximum\n all = 0\n end\nend\n\nputs maximum\n", "lang": "Ruby", "bug_code_uid": "ad749cb1a6d6855dca138f7e7ba3ac9b", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "86653b328b3312860d0a515456b286fd", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.967032967032967, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby\n\ndef countOnes(array,n)\n\n\tcount_1 = 0\n\n\tfor i in (0..n-1)\n\t\tif array[i] == 1 then\n\t\t\tcount_1 += 1\n\t\tend\n\tend\n\n\tfor i in (0..n-1)\n\t\tarray[i] = (array[i] == 1) ? -1 : 1\n\tend\n\n\tmax_ending_here, max_overall = 0 , 0\n\n\tfor i in (0..n-1)\n\t\tmax_ending_here += array[i]\n\n\t\tif max_ending_here < 0 then\n\t\t\tmax_ending_here = 0\n\t\tend\n\n\t\tif max_ending_here > max_overall\n\t\t\tmax_overall = max_ending_here\n\t\tend\n\tend\n\n\treturn max_overall + count_1\nend\n\nn = gets.strip.to_i\n\ns = gets\n\na = s.split.map(&:to_i)\n\nputs countOnes a,n\n", "lang": "Ruby", "bug_code_uid": "84547958e817dc78c550d1ac97aa2293", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "61349485c983910f0c3a62a86fe74b89", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9656357388316151, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "$mem = Array.new(102){Array.new(2,-100000)}\n$number = Array.new(102)\n\ndef dp(idx , bool , n)\n if idx == n\n\t\treturn 0\n\tend\n\tret = $mem[idx][bool]\n\tif ret != -100000\n\t\treturn ret\n\tend\n\tif bool == 1\n\t\tret = [dp(idx+1,1,n)+$number[idx] , 0].max \n\telse\n\t\tret = [dp(idx+1,0,n) , dp(idx+1,1,n)+$number[idx]].max\n\tend\n\t\n\t$mem[idx][bool] = ret\n\treturn ret\nend\n\nleng = Integer(gets)\nsum = 0\n$number = gets.split.collect {|element| element.to_i}\n$number.each{|x| sum += (x==1?1:0)}\nfor i in 0...leng do\n\t$number[i] = ($number[i]==1?-1:1)\nend\nputs \"#{sum+dp(0,0,leng)}\"\n", "lang": "Ruby", "bug_code_uid": "cd8ee607a5a6d844ab81f9786544bc2d", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "f125ff13ff6fc945b926a9c23af55046", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9643527204502814, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def dp(idx , bool)\n if idx == $n\n\t\treturn 0\n\tend\n\tret = $mem[idx][bool]\n\tif ret != -100000\n\t\treturn ret\n\tend\n\tif bool == 1\n\t\tret = [dp(idx+1,1)+$number[idx] , 0].max \n\telse\n\t\tret = [dp(idx+1,0) , dp(idx+1,1)+$number[idx]].max\n\tend\n\t\n\t$mem[idx][bool] = ret\n\treturn ret\nend\n\n$mem = Array.new(102){Array.new(2,-100000)}\n$n = gets.to_i\n$number = gets.split.collect {|element| element.to_i}\nsum = 0\n$number.each{|x| sum += (x==1?1:0)}\nfor i in 0...$n do\n\t$number[i] = ($number[i]==1?-1:1)\nend\nputs \"#{sum+dp(0,0)}\"\n", "lang": "Ruby", "bug_code_uid": "2806cff52f6293f851114109bb4bdf03", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "f125ff13ff6fc945b926a9c23af55046", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9752650176678446, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def dp(idx , bool)\n if idx == $n\n\t\treturn 0\n\tend\n\tret = $mem[idx][bool]\n\tif ret != -100000\n\t\treturn ret\n\tend\n\tif bool == 1\n\t\tret = [dp(idx+1,1)+$number[idx] , 0].max \n\telse\n\t\tret = [dp(idx+1,0) , dp(idx+1,1)+$number[idx]].max\n\tend\n\t\n\t$mem[idx][bool] = ret\n\treturn ret\nend\n\n$mem = Array.new(102){Array.new(2,-100000)}\n$n = gets.to_i\n$number = gets.split.collect {|element| element.to_i}\nsum = 0\n$number.each{|x| sum += (x==1?1:0)}\nfor i in 0...$n do\n\t$number[i] = ($number[i]==1?-1:1)\nend\nif sum == $n\n puts sum-1\nelse\n puts \"#{sum+dp(0,0,leng)}\"\nend\nputs \"#{sum+dp(0,0)}\"\n", "lang": "Ruby", "bug_code_uid": "cd604f8d87f594e36cac289f76eac469", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "f125ff13ff6fc945b926a9c23af55046", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9824561403508771, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.strip.to_i\ncoins = gets.strip.split(\" \").map(&:to_i)\noriginal_before_ones = 0\noriginal_ones = coins.count(1)\noriginal_after_ones = original_ones\nmax_ones = 0\ncurrent_ones = 0\nprev_ones = 0\nif coins[0] == 0 then\n prev_ones = 1\nelse\n prev_ones = 0\n original_after_ones -= 1\n original_before_ones += 1\nend\nmax_ones = [prev_ones, original_before_ones].max\ni = 1\n# puts max_ones\n# puts original_before_ones\n# puts original_after_ones\nwhile i < n do \n if coins[i] == 0 then\n current_ones = [original_before_ones + 1 + original_after_ones, prev_ones + 1].max\n else\n current_ones = [original_ones - 1, prev_ones - 1].max\n original_before_ones += 1\n original_after_ones -= 1\n end\n max_ones = [max_ones, current_ones].max\n prev_ones = current_ones\n # puts max_ones\n i += 1\nend\nputs max_ones", "lang": "Ruby", "bug_code_uid": "ce53a63f1db41355b5133abaa9b9aae2", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "cd60f5145685a6cb7ce0d8773a4fe64b", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.2746026378085898, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "n = gets.strip.to_i\ncoins = gets.strip.split(\" \").map(&:to_i)\ncurrent_max_ones = 0\nnumber_of_flipped_element = 0\ni = 0 \ncurrent_flipped_ones = 0\nnumber_of_ones = coins.count(1)\ni0 = 0\nj0 = 0\n# p coins\nnumber_of_ones_before = 0\nnumber_of_ones_after = number_of_ones\nwhile i < n do\n # puts i\n if coins[i] == 0 then\n if current_flipped_ones == 0 then\n i0 = i\n number_of_ones_before = coins[0..i0].count(1)\n # number_of_ones_after = number_of_ones - number_of_ones_before\n end\n current_flipped_ones += 1\n # puts \"number_of_ones_before: #{number_of_ones_before}, number_of_ones_after: #{number_of_ones_after}, \n # current_flipped_ones: #{current_flipped_ones}\"\n current_max_ones = current_max_ones >= number_of_ones_before + current_flipped_ones + number_of_ones_after ? \n current_max_ones : number_of_ones_before + current_flipped_ones + number_of_ones_after\n else\n if current_flipped_ones == 0 then\n number_of_ones_before += 1\n # puts \"here\"\n # puts i\n end\n # current_flipped_ones -= 1\n number_of_ones_after -= 1\n current_max_ones = current_max_ones >= number_of_ones_before + current_flipped_ones + number_of_ones_after ? \n current_max_ones : number_of_ones_before + current_flipped_ones + number_of_ones_after\n if current_flipped_ones == i - i0 + 1 - current_flipped_ones then\n current_flipped_ones = 0\n end\n end\n # puts \"#{i} iteration: current_max_ones: #{current_max_ones}\"\n i += 1\nend\n# puts \"something\"\n# number_of_flipped_element = number_of_flipped_element == 0 ? 1 : number_of_flipped_element\n# puts number_of_flipped_element\n# puts current_max_flipped_ones\nputs current_max_ones\n# puts coins.count(1) - (number_of_flipped_element - current_max_flipped_ones) + current_max_flipped_ones", "lang": "Ruby", "bug_code_uid": "193babdb686a3a3eb8a5ba234fdc077d", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "cd60f5145685a6cb7ce0d8773a4fe64b", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8327526132404182, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "def run\n n = $stdin.readline.to_i\n a = $stdin.readline.split(\" \").map(&:to_i)\n\n sum = a.reduce(&:+)\n max_zeros = 0\n for i in 0..n\n for j in i..n\n max_zeros = [a[i..j].count(1), max_zeros].max\n end\n end\n\n puts sum + max_zeros\nend\n\nrun if $0 == __FILE__\n", "lang": "Ruby", "bug_code_uid": "17e0e590fccc64558a43244d26d5ec3e", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "ba8392c84caf7d9d02ea3b0abef1f352", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.11253196930946291, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "gets\narr = gets.chomp.split.join(\"\")\nmax = 0\narr.scan(/0+/) { |x| max = x.length if x.length > max }\nputs arr.split(\"\").count { |x| x == \"1\" } + max\n", "lang": "Ruby", "bug_code_uid": "611ee9ffbb219485fb6a6f9e59522825", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "2a50c4cbfb36bcc63d538d9ac83087b0", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9915110356536503, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "gets\na = gets.split(' ').map(&:to_i)\ncur1 = 0\ncur0 = 0\nbest = 0\ns = 0\nfor x in a\n s += x\nend\nfor x in a\n if x==0\n cur0 += 1\n else\n if cur1 == cur0\n cur1 = cur0 = 0\n else\n cur1 += 1\n end\n end\n best = [best,cur0-cur1+s-cur1].max\nend\nif best == s\n best -= 1\nend\nprint best", "lang": "Ruby", "bug_code_uid": "f2d8f3ce7a17628b40624c370be1683a", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "aa12c39ba7ee0b799e962683c3f29e78", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8213820078226858, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "gets\nx = gets.split.map(&:to_i)\na = []\nc = 1\nr = x[0]\nfor i in 1...x.size\n\tr += x[i]\n\tif x[i] == x[i - 1]\n\t\tc += 1\n\telse\n\t\ta<= a[ i + 1] and a[i + 1] <= a[i + 2] \n\t\ta[i + 2] += a[i]\n\t\ta[i + 2] -= a[i+1]\n\tend\n\td = [a[i] , d].max\n\ti += 2\nend\nif a.size == 4 and x.first == 1\n\tputs r - 1\nelse\n\tputs r + d\nend\n", "lang": "Ruby", "bug_code_uid": "aef3549dc1aba3f0a6f5b2faef1d2c2a", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "021553fdfd6ea24cbe4c3bf4b5662b96", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5015479876160991, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "n = gets.chomp.to_i\ninput = gets.chomp.split(' ').map { |i| i.to_i}\nbits = input.clone\nbits.each_with_index { |bit,index|\n if bit.eql? 1\n bits[index] = -1\n else\n bits[index] = 1\n end\n}\ncurrentMax = bits[0]\nmaxEndingHere = bits[0]\nstart = 0\nstartTemp = 0\nlast = 0\nbits.each_with_index { |bit,i|\n\n if maxEndingHere < 0\n maxEndingHere = bit\n startTemp = i\n else\n maxEndingHere += bit\n end\n\n if maxEndingHere >= currentMax\n currentMax = maxEndingHere\n start = startTemp\n last = i\n end\n}\n\nfor i in start..last\n input[i] = (input[i] + 1) % 2\nend\n\np input.count 1 \n", "lang": "Ruby", "bug_code_uid": "cb120b3aa4e48a3de6aed62f9545aab8", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "4c5b60689313e0e43daebecd7c39a095", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9704216488357458, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = Integer(gets)\ninput = gets.chomp\nnums = input.split\nnumber = Array.new\nnumber1 = Array.new\n\nfor i in 0...n\n number[i] = number1[i] = Integer(nums[i])\nend\n\n\ndef sum(a)\n x = 0\n for i in 0...a.length\n x += a[i]\n end\n return x\nend\ndef restore(number1,number)\n for i in 0...number.length\n number1[i] = number[i]\n end\nend\n\nc = 0\nfor i in 0...n\n for j in i...n\n for x in i..j\n if number[x] == 1\n number1[x] = 0\n else\n number1[x] = 1\n end\n end\n if sum(number1) > c\n c = sum(number1)\n end\n restore(number1,number)\n end\nend\nif n == 1 && number[0] == 1\n puts 0\nelse\n\n if c > sum(number)\n puts c\n else\n puts sum(number)\n end\nend", "lang": "Ruby", "bug_code_uid": "40aee412ef043a9ee0034bfc9f4ee9f5", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "a6e0974479bd5472dac7d3983e722aef", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9888392857142857, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def solution(arr)\n if arr.size == 1\n return 1 if arr[0] == 0\n return 0 if arr[0] == 1\n end\n\n initial_value = arr.reduce(:+)\n return initial_value - 1 if initial_value == arr.size\n\n acumulator = initial_value\n max_value = 0\n\n for i in 0...arr.size do\n acumulator = [initial_value, acumulator + (arr[i] == 1 ? -1 : 1)].max\n max_value = [max_value, acumulator].max\n end\n max_value\nend\n\n\nputs solution(gets.split.map(&:to_i))\n", "lang": "Ruby", "bug_code_uid": "0a6e05ea02326681819b8a9b55e706de", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "7bfb03cbf27fb07c3ca980d179629a60", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9110169491525424, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "gets\nn = gets.chomp.split(/ /).map { |x| x.to_i }\nsum = 0\nmax = 0\nones = 0\nn.each do |x|\n if x == 1\n ones += 1\n sum -= 1\n else\n sum += 1\n end\n sum = 0 if sum < 0\n max = sum if max < sum\nend\nputs \"#{max + ones}\"\n", "lang": "Ruby", "bug_code_uid": "be71a29dbc7dba2e5cfea9030bd5144f", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "548f4d879c0609ddbe12a39ed16d9b08", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9935622317596566, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\ndef flip_sum(t,i,e)\n t[i..e] = t[i..e].map { |v| v = 1 - v }\n return t.inject(0){|sum,x| sum + x}\nend\n\n\ndef get_result(b, e, dpa)\n best = dpa[[0,e-1].max]\n for i in 0..e\n ans = flip_sum(b.clone,i,e)\n best = ans if ans > best\n end\n return best\nend\n\n# Read Input\nn = gets.strip.to_i\nb = gets.strip.split.map{|s| s.to_i}\n\n# Initialize params\ndpa = Array.new(n,0)\n\nfor i in 0..n do\n dpa[i] = get_result(b, i, dpa)\nend\n\nputs dpa.max", "lang": "Ruby", "bug_code_uid": "8bc80c9550a4f76cda8f01ea0ac17f14", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "41be2d54f6e833aa87aa2376c5fa7688", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9661399548532731, "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\nb=[]\nn.times {|i| b[i]=(i>0?b[i-1]:0)+(a[i]=='0'?1:0)}\nmax = n - b[n-1]\nn.times do |i|\n for j in i...n do\n max = [(i>0?i-b[i-1]:0)+(b[j]-(i>0?b[i-1]:0))+n-j-1-b[n-1]+b[j], max].max\n end\nend\np max\n", "lang": "Ruby", "bug_code_uid": "c2a751289fa8f8e3e97142179f0bdba3", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "6828ee7f1a0fa294b26aaedb60c1af86", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.989247311827957, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\na = gets.split(' ').map(&:to_i)\n\nx = -100000\n1.upto(n) do |i|\n i.upto(n) do |j|\n x = [x, a[i, j-i+1].count(0)-a[i, j-i+1].count(1)].max\n end\nend\n\nputs a.count(1) + x\n", "lang": "Ruby", "bug_code_uid": "79bfba2c29789cd366967bad668d5a8e", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "9693239da593373ad62d5acf11267396", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7939142461964038, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "def find_max(a)\n max_ending_here = max_so_far = 0\n a.each { |x|\n max_ending_here = [0, max_ending_here + x].max\n max_so_far = [max_so_far, max_ending_here].max\n }\n max_so_far\nend\n\ngets.chomp # Skip the first line\nseq = gets.chomp.split.map { |x| x.to_i }\nputs seq.inject(:+) + find_max(seq.map { |s| s == 1 ? -1 : 1 })", "lang": "Ruby", "bug_code_uid": "5c476d0be6bdd5c8ad1ae776500edb89", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "a78d04b2efa1a027544f2b5392d86b19", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9685157421289355, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def is_lucky(s)\n while s>0\n return false if s%10!=7 && s%10!=4\n s/=10\n end\n return true\nend\ndef fact(k)\n return 1 if k<=0\n return fact(k-1)*k\nend\ndef lucky(now)\n res=[]\n return [] if now>1000000000\n return [now]+lucky(now*10+4)+lucky(now*10+7)\nend\nn,k=gets.split.map(&:to_i)\nk-=1\nremain=[]\n\ndef solve(n,remain,k)\n return [] if n==0\n n.times{|i|\n if k 0\n min1 = l1.min\n min2 = l2.min\n return [(min2.to_s + min1.to_s).to_i, (min1.to_s + min2.to_s).to_i].min\n end\nend\nstring = ARGF.read\narr = string.split('\\n')\narr.map! { |elem| elem.strip }\narr1 = arr.drop(1)\narr1.map! { |elem| elem.split }\nputs Solver1.solve(arr1)\nexit(true)\n", "lang": "Ruby", "bug_code_uid": "8f68da5a010f9f6b9ac89a206e26ba37", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "f9b78901df72d80640ea4bfaa018af2b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9939759036144579, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#! /usr/bin/env ruby\n\nn, m = gets.split.map &:to_i\na = gets.split\nb = gets.split\nc = a - b\n\nif not c.empty?\n puts c.min\nelse\n puts [a.min, b.min].sort.join\nend\n", "lang": "Ruby", "bug_code_uid": "3cf38cb08ad1762a54e7718ebb1e9f2b", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "4abd884cfff86bf26d1a7f3b04d2d04b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9949238578680203, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "sin = STDIN\nsout = STDOUT\n# sin = File.open(\"test.in\", \"r\")\n# sout = File.open(\"test.out\", \"w\")\n\nn, k, l, c, d, p, nl, np = *sin.readline.split.map{|e| e.to_i}\n\nl *= k\nc *= d\n\nans = 0\n\nwhile l > 0 && c > 0 && p > 0\n ans += 1\n l -= nl * n\n c -= n\n p -= np * n\nend \n\nsout.puts ans - 1", "lang": "Ruby", "bug_code_uid": "0cf7e180a478b080bb228464c2b23785", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "2e722ee6410f288186ef2b61f2afcbfd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.10101010101010101, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "puts (gets.chomp+gets.chomp).chars.sort==(gets.chomp).chars.sort ? :YES :\"NO\"", "lang": "Ruby", "bug_code_uid": "2e0008cdbe72082b1bf2d85a27e5abdc", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "0dcd8c7b547326e85abd7ccf54b86e35", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9978586723768736, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k, l, c, d, p, nl, np = gets.chomp.split(/ /).map(&:to_i)\ntotal_drink = k * l\ntotal_toasts = total_drink / n\ntotal_dimes = c * d\ntotal_share_of_salt = p / np\nans = [total_toasts, total_dimes, total_share_of_salt].min / n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "9cc0ce7944913b0caa75cd1dd12e5a3a", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "0e6bc65473f91690981fabede83d4bb5", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9956896551724138, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n, k, l, c, d, p, nl, np = gets.split.map &:to_i\ndrinkm, slices, c = k * l, c * d, 0\n\nloop do\n n.times { |i| drinkm -= nl; slices -= 1; p -= np }\n break unless [drinkm, slices, p].select { |e| e <= 0 }.empty?\n c += 1\nend\n\nprint c", "lang": "Ruby", "bug_code_uid": "11dc127598c08b65b1909ece7c890b4d", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "cfefcb65327bcd4b5c80e5a2cabae117", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9017632241813602, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "a = gets.split\nl = a[0].to_i; r = a[1].to_i;\ncount = l==0?1:0\nnow = 3\nfor i in 2..18\n for j in 0..i-2\n t = now^(1<=l && t<=r) ? 1:0\n end\n now = now<<1|1\n\nend\nprint count", "lang": "Ruby", "bug_code_uid": "099db7ffef982151606616906539e8b4", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "3a430cc10f9b2e6d7de15b6d85d7f8f9", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9115646258503401, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a,b=gets.split.map(&:to_i)\nans=0\n1.upto(64){|k|\n\tn=2**k-1\n\tnext unless a<=n&&n<=b\n\t0.upto(k-1){|s|\n\t\tm=n^(1< 1\n return \"ugly\"\n end\n end\n\n sorted_list_x = list_x.sort\n sorted_list_y = list_y.sort\n avg_x, avg_y = 0, 0\n\n for i in 0..7\n avg_x += 1 if sorted_list_x[i] == sorted_list_x[3]\n avg_y += 1 if sorted_list_y[i] == sorted_list_y[3]\n end\n\n return avg_x == 2 && avg_y == 2 ? \"respectable\" : \"ugly\"\nend\n\nputs eight_point_set(list, list_x, list_y)\n", "lang": "Ruby", "bug_code_uid": "f61c0e887193718ae4729df445eef4f1", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "ed3636024c0c736efa578ae5b06e1359", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9309927360774818, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "require 'prime'\ndef find_minimum(row, col, factor, n)\n (0..n).collect {|i|\n [row * (factor**i), col * (factor**(n-i))]\n }.select{ |pair|\n pair[0] <= pair[1]\n }.min_by { |pair|\n pair[1] - pair[0]\n }\nend\n\ndef minimum_pair(row, col, primes)\n if primes.size == 1\n return find_minimum(row, col, primes[0][0], primes[0][1])\n else\n prime = primes[0][0]\n n = primes[0][1]\n rest = primes[1..-1]\n minimum = 10000000\n minimum_result = nil\n (0..n).collect { |i|\n minimum_pair(row*(prime**i), col*(prime**(n-i)), rest)\n }.select{ |pair|\n pair[0] <= pair[1]\n }.min_by { |pair|\n pair[1] - pair[0]\n }\n end\nend\n\ndef solve(n)\n primes = n.prime_division\n puts primes\n minimum_pair(1, 1, primes)\nend\n\nputs solve(STDIN.read.to_i).join(\" \")\n", "lang": "Ruby", "bug_code_uid": "9bb172025de0f97ee1f42beb9322cd28", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "20d23b275f9efad6b527dfa3b7ee3e9a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.969768820391227, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "require 'prime'\ndef find_minimum(row, col, factor, n)\n res = (0..n).collect {|i|\n [row * (factor**i), col * (factor**(n-i))]\n }.select{ |pair|\n pair[0] <= pair[1]\n }.min_by { |pair|\n pair[1] - pair[0]\n }\n res.nil? ? [1, row*col*(factor**n)] : res\nend\n\ndef minimum_pair(row, col, primes)\n if primes.size == 1\n return find_minimum(row, col, primes[0][0], primes[0][1])\n else\n prime = primes[0][0]\n n = primes[0][1]\n rest = primes[1..-1]\n minimum = 10000000\n minimum_result = nil\n (0..n).collect { |i|\n minimum_pair(row*(prime**i), col*(prime**(n-i)), rest)\n }.select{ |pair|\n pair[0] <= pair[1]\n }.min_by { |pair|\n pair[1] - pair[0]\n }\n end\nend\n\ndef solve(n)\n primes = n.prime_division\n minimum_pair(1, 1, primes)\nend\n\nputs solve(STDIN.read.to_i).join(\" \")", "lang": "Ruby", "bug_code_uid": "0439a0690def7edbd51feab543492b2e", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "20d23b275f9efad6b527dfa3b7ee3e9a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9736842105263158, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts gets.to_i&1?\"black\":\"white\\n1 2\"", "lang": "Ruby", "bug_code_uid": "75cedbf866effefbd553ab6f4cce2d89", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "11fc20e31e130336f1b44f652b60c12b", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6075949367088608, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "puts gets.to_i&1?[\"white\",\"1 2\"]:\"black\"", "lang": "Ruby", "bug_code_uid": "c86512fe94d9a4f6645e0d1ce7e00a82", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "df8fc07f589619f005bcdb88fa56cf0a", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.891566265060241, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "x= Integer(gets.chomp)\n\nif (x%2==0)\n p \"white\"\n p'1 2'\nelse\n p'black'\nend", "lang": "Ruby", "bug_code_uid": "4da9ff85deb069a3237621531a3b075a", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "d5486caf5e94d50e27babec5503c64a2", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6635367762128326, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n, c1, c2 = gets.split.map(&:to_i)\ns = gets.chomp!\ngroup = [0, 0]\nn.times do |i|\n group[s[i].to_i] += 1\nend\n\nmax = c1 + c2 * (n - 1) ** 2\ntmp = 0\n\ngroup[1].times do |i|\n tmp = (n / (i+1)).to_i * (c1 + c2 * i**2)\n tmp += c1 + c2 * ((n % (i+1)) - 1)**2 if n % (i+1) != 0\n max = tmp if max > tmp\nend\n\nputs max", "lang": "Ruby", "bug_code_uid": "23ed7b316e464e5610cb5133296e2464", "src_uid": "78d013b01497053b8e321fe7b6ce3760", "apr_id": "342bbad7ba133c21b673ce460bc9dfe2", "difficulty": 2100, "tags": ["ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8488745980707395, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n,f=gets.split.map{|e| e.to_i}\nhs=Hash.new(0)\ngets.chomp.chars.each{|e|\n\ths[e]+=1\n}\nhs.each{|k,v|\n\tf-=(v/2).to_i\n}\nif f<=0 then\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "2324156f8e163954245ece5e6378911b", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "51d992e351390e4d28f84a636eaa050a", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8903508771929824, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,k=gets.split.map(&:to_i)\ns = gets.chomp\nh = Hash.new(0)\ns.chars do |c|\n h[c] += 1\nend\n\nf = true\n[*?a..?z].each do |c|\n if h[c] % 2 == 1\n f = false\n break\n end\nend\nputs f ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "12cc9a19b01f926ddea0e4e27ffc94fa", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "0a6071c1c24cd384354204dcdfe08608", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9538461538461539, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a = Array.new(123, gets.split[1].to_i)\ngets.chars{|c| a[c.ord] -= 1}\np a.min < 0 ? 'NO' : 'YES'\n\n", "lang": "Ruby", "bug_code_uid": "d0818afbd69cfbac02b2f92b8a0644cb", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "1e53127585e1941477fe3b6dc1361e8f", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9881422924901185, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": " \na = gets.to_i \n\na=a+1 \n\nif a==1 \n puts 0\nelsif a%2 \n puts a \nelse \n puts a/2 \nend", "lang": "Ruby", "bug_code_uid": "a56be441bdff0e581f50dff3a4bb1faf", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "0ed7fb4e573733b223adf57f06e7f90a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5054945054945055, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n=gets.to_i+1\nr=0\n(r+=1;n/=2)while n%2<1\np r+(n==1 ? 0 : n)", "lang": "Ruby", "bug_code_uid": "70a57913d7f938d3e4e6a967da4d9278", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "b300e0d126e6065be931fc05c1348dab", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9491525423728814, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\np !n ? 0 : n % 2 != 0 ? (n + 1) / 2 : n + 1", "lang": "Ruby", "bug_code_uid": "4351687d283d2970350e32c55893729d", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "e2fff626d0dfc1b5a60152374dabe4ff", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.967551622418879, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": " n = gets.to_i\n if (n+1) % 2 == 0 and n != 0 \n puts ((n+1)/2)\n elsif (n+1) % 2 != 0\n puts (n+1)\n elsif n == 0\n puts \"0\"\n end ", "lang": "Ruby", "bug_code_uid": "48c1a6b45dd2a108b04ca5ad3ade793c", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "e4d117eae0d2bfad8da60d4e86473a17", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9619047619047619, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/ruby1.9\n\nn, k = STDIN.readline.split.collect {|s| s.to_i }\n\nneed = n-1\nmax = k-1\n\nif (max+1)*max/2 < need\n\tputs -1\n\texit\nend\n\nlow, high = 1, max\nwhile low < high\n\tmid = (low+high)/2\n\tsum = (mid+max)*(max-mid+1)/2\n\tif sum == need\n\t\tbreak\n\telsif sum < need\n\t\thigh = mid\n\telse\n\t\tlow = mid+1\n\tend\nend\n\nmid = (low+high)/2\nif (mid+max)*(max-mid+1)/2 >= need\n\tputs max-mid+1\nelse\n\tputs max-mid+2\nend\n", "lang": "Ruby", "bug_code_uid": "65555841642dd7aeb308c165c09ef5a3", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "86d09f42417adb7fac12b52305f22113", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.35266821345707655, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "class B\n def initialize\n n, k = $stdin.gets.chomp.split(' ').map(&:to_i)\n\n if k >= n\n puts 1\n exit\n end\n\n sum = 0\n count = 0\n\n (k-1).downto(1) do |val|\n count += 1\n if val == 1\n sum += 2\n else \n sum += val\n end\n\n if sum >= n\n puts count\n exit\n end\n end\n\n puts -1\n end\nend\n\nb = B.new", "lang": "Ruby", "bug_code_uid": "1428087478efc257e45cc2e3979994be", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "9d005eda1dd853027a3f7ea84dd19d5a", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9559613319011815, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "class B\n def initialize\n n, k = $stdin.gets.chomp.split(' ').map(&:to_i)\n\n if k >= n\n puts 1\n exit\n end\n\n left = 2\n right = k\n\n while(left < right)\n m = (left+right)/2\n\n if(m*(2*k-m-1)/2+1= s) && (b >= d) && (c >= f)\n r += 7\n end\n s += 1\n d += 2\n f += 4\nend\np r\n", "lang": "Ruby", "bug_code_uid": "0b3e7a88992b3a8378e2dcbf79e341c2", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "43fb62c26954ced8f20de8a0248b7caa", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.44327176781002636, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "h=Hash.new(0)\ngets\ngets.chomp.chars{|c|c.to_i.prime_division.each{|n,p|h[n]+=p}}\nputs '7'*h[7]+'5'*h[5]+'3'*h[3]+'2'*h[2]", "lang": "Ruby", "bug_code_uid": "1a19004a11d4a5bb4d6d33c4dc8dbc46", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "8c9abe683353856ec41700284e069cca", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9553398058252427, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def function\nb=gets.chomp\na=gets.chomp\na=a.delete('0')\na=a.delete('1')\na=a.gsub('4' , '322')\na=a.gsub('6' , '53')\na=a.gsub('8' , '7222')\narr=[]\na.each_char do |i|\narr.push(i.to_i)\nend\narr=arr.sort.reverse\narr.each do |i|\nprint i\nend\nend\nfunction\n", "lang": "Ruby", "bug_code_uid": "ffa5840747a3dae3100340f5fa863109", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "1b68d9441159cc8aa5eec3f85372f6a9", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9944547134935305, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=gets.chomp.to_i\nb=gets.chomp.split(\"\").map{|i| i.to_i }\nc=[]\nb.delete(1)\nb.delete(0)\n0.upto(b.length-1) do |i|\nif b[i]==4\nc<<3<<2<<2\nelsif b[i]==6\nc<<5<<3\nelsif b[i]==8\nc<<7<<2<<2<<2\nelsif b[i]==9\nc<<7<<3<<3<<2<<2\nelse c< 3x 2!\n ar[7] += ar[8]\n ar[2] += ar[8] * 3\n ar[8] = 0\n # break 6 -> 3!\n ar[5] += ar[6]\n ar[3] += ar[6]\n ar[6] = 0\n # break 4 -> 2x 2!\n ar[2] += ar[4]*2\n ar[3] += ar[4]\n ar[4] = 0\n # 1st point to check updated\n updated = ar.length != last_length\n # spread 9->2x 3! if 2's exist\n a9min = [ar[9], ar[2]/2].min\n ar[9] -= a9min\n ar[8] += a9min\n ar[2] -= a9min*2\n ar[3] += a9min*2\n # 2nd point to check updated\n if !updated\n updated = a9min > 0\n end\nend\n\n# 9! -> transform into 8! and spread 2x 3 (useful, only if 2's are enough)\n# --> if 2x 3 can be spreaded to somewhere, it can be 8! can create more digits.\n# 8! -> transform into 7! and create 3x 2! (useful) \n# 7! -> transform into 6! and spread 1x 7 (useless)\n# --> if 1x 7 can be spreaded to somewhere, it can be 6! so next condition works.\n# --> but by spreading 7 to 6!, 6! can not create 1x 3!. can not create digits.\n# 6! -> transform into 5! and create 1x 3! (useful)\n# 5! -> transform into 4! and spread 1x 5 (useless)\n# --> if 1x 5 can be spreaded to somewhere, it can be 4! so next condition works.\n# --> but by spreading 5 to 4!, 4! can not create 2x 2!, can not create digits.\n# 4! -> transform into 3! and create 2x 2! (useful)\n# 3! -> transform into 2! and spread 1x 3 (no need to do so, useless)\n# 2! -> most valuable one. (useful again, just leave them as is)\n\n# join'em and print out\nbuf = []\nfor j in 2..9\n if ar[j] > 0\n buf << \"#{j}\"*ar[j]\n end\nend\n\nputs buf.reverse.join('')", "lang": "Ruby", "bug_code_uid": "9a42cd55d97a5a4e6ff473a7f40f65ca", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "6160806d7cf51bac060ad5bd27f8c383", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9442970822281167, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n = gets.to_i\ns = gets.chomp.chars.map(&:to_i)\nl = [nil, [], [2], [3], [2, 2, 3], [5], [5, 3, 2], [7], [2, 2, 2], [3, 3]]\nsol = []\ns.each{|x| sol += l[x]}\nputs sol.sort.reverse.join(\"\")\n", "lang": "Ruby", "bug_code_uid": "40994af36d6fd0147c45a33d62a40e82", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "8c4ed7b26706f3f5ce6627eaf6da61d7", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9845360824742269, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.to_i\ns = gets.chomp.chars.map(&:to_i)\nl = [[], [], [2], [3], [3, 2, 2], [5], [5, 3], [7], [7, 2, 2, 2], [7, 2, 2, 2, 3, 3]]\nsol = []\ns.each{|x| sol += l[x]}\nputs sol.sort.reverse.join(\"\")\n", "lang": "Ruby", "bug_code_uid": "5031647344090f4c789303d12b82a948", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "8c4ed7b26706f3f5ce6627eaf6da61d7", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8149068322981367, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "pa=Array.new(10,0)\n\nn=gets.to_i\nstr=gets.to_s\n\nfor i in 0..n-1\n k=str[i].to_i\n pa[k]+=1\nend\n\nwhile pa[4] != 0\n pa[2] += 2\n pa[4] -= 1\n pa[3] += 1\nend\n\nwhile pa[8] != 0\n pa[2] += 3\n pa[8] -= 1\n pa[7] += 1\nend\n\nwhile pa[6]!=0 && pa[2]!=0\n pa[6] -= 1\n pa[5] += 1\n pa[3] += 1\nend\n\ni=9\nwhile i!=1\n while pa[i]!=0\n print i\n pa[i] -= 1\n end\n i -= 1\nend\n\nputs\n", "lang": "Ruby", "bug_code_uid": "08eb03ed612899707789849be22b62ad", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "b2d46fc6684f8c5d6c1d84e0bb01d884", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9523809523809523, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w = gets.chomp\ntmp = w.to_i / 2 + 1\nif w.to_i % 2 == 0 && ((tmp % 2 == 0 && w.to_i % 2 == 0) || (w.to_i / 2) % 2 == 0)\n\tputs 'YES'\nelse\n\tputs 'NO'\nend", "lang": "Ruby", "bug_code_uid": "f0c507323554deb71c3da9289a506337", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "358598c686419603c1953ff11a181904", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7261904761904762, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nif n % 2 == 0\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "e9b4e3e5fe8728cd27f80b136f6b0632", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5093a85adefdfa5df28a10f56cac0c7e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8969072164948454, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 8, "bug_source_code": "#! ruby -Ku\n# -*- coding: utf-8 -*-\n\nn = gets.to_i\nif n % 2 == 0\nputs YES\nelse\nputs NO\n", "lang": "Ruby", "bug_code_uid": "cf89f23907002d329322d4ae6fdf26c4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5093a85adefdfa5df28a10f56cac0c7e", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.944, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x = gets.to_i\nif x.even?\n puts \"YES\"\nelsif\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "a3014fd30e59eaaa3f5572e237209eaa", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9f32af880ee82fe33d92e2f46bc73b62", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9420289855072463, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x = gets.to_i\nif x.even? && x/2.even?\n puts \"YES\"\nelsif\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "fabcdecc10ff8d4b851ecbb256b2db8d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9f32af880ee82fe33d92e2f46bc73b62", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9037037037037037, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a =gets.to_i\nif (a%2==0)\n print \"YES\"\nelse\n print \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "d33d419c6cca7b678270006e5bdea968", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6ec8149b3582283b853bdd085fb82750", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8466666666666667, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "# https://codeforces.com/problemset/problem/4/A\na = gets.chomp.to_i\nif (a % 2) % 2 == 0 then\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "89f4179401514e0ab74ab191297b0c16", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ce96b44edd917be867a2a65cdd723a5c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8333333333333334, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "w = gets\nw = w.to_i\nif( w%2 == 0)\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "adf4988026ad63644b158a20efee82d6", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5e9d27803a3734405c866aefa36312b0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9523809523809523, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\n\nputs n % 2 > 0 && n >2 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "d94d9cfbf2f42e2dd8c470cdc0c3805d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8756b43c6727dfbd67b32b1fc1d09c73", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9444444444444444, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = gets.to_i\n\nputs n % 0 == 2 && n > 2 ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "8764dc1c43346dbf04648142faa601a2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8756b43c6727dfbd67b32b1fc1d09c73", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9672544080604534, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def split_watermellow(w)\n w = w.to_i\n return unless valid?(w)\n\n if divisors_are_even?(w)\n puts 'YES'\n else\n puts 'NO'\n end\nend\n\ndef valid?(w)\n w.is_a?(Integer) &&\n 1 <= w &&\n w <= 100\nend\n\ndef divisors_are_even?(w)\n divisors = []\n (1..w/2).each { |x| divisors << ((w % x == 0) && ((w / x) % 2 == 0)) }\n divisors.any?(&:trust)\nend\n\nw = gets()\nsplit_watermellow(w)\n", "lang": "Ruby", "bug_code_uid": "fde21b4d5b6be34b8bcd06a91e9ca2f3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b06bb8a2ac7bf9be605897e1b333aae5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7592319054652881, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "def split_watermellow(w)\n return unless valid?(w)\n\n if divisors_are_even?(w)\n puts 'YES'\n else\n puts 'NO'\n end\nend\n\ndef valid?(w)\n w.is_a?(Integer) &&\n 1 <= w &&\n w <= 100\nend\n\ndef divisors_are_even?(w)\n (w / 2.0) % 2 == 0\nend\n\nsplit_watermellow(w)\n", "lang": "Ruby", "bug_code_uid": "a015060decb8363344b2d9839d400179", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b06bb8a2ac7bf9be605897e1b333aae5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8913308913308914, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "def split_watermellow(w)\n w = w.to_i\n return unless valid?(w)\n\n if divisors_are_even?(w)\n puts 'YES'\n else\n puts 'NO'\n end\nend\n\ndef valid?(w)\n w.is_a?(Integer) &&\n 2 < w &&\n w <= 100\nend\n\ndef divisors_are_even?(w)\n divisors = []\n (1..w/2).each { |x| divisors << ((w % x == 0) && ((w / x) % 2 == 0)) }\n divisors.any?(&:trust)\nend\n\nw = gets()\nsplit_watermellow(w)\n", "lang": "Ruby", "bug_code_uid": "7e40f714d827b922f4de2e4105586744", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b06bb8a2ac7bf9be605897e1b333aae5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8137254901960784, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "weight = gets.chomp\n\nif weight % 2 == 0 && weight % 4 == 0\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "3f1f2154e4e1e9822d747c83fa8f902b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "52a3cbe5b287a3b2ba5b45d4ca2db233", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7642276422764228, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "weight = gets.strip.chomp\nhalf_watermelon = weight/2\n\nif weight % 2 == 0 && half_watermelon % 2 == 0\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "84f9cd870032ad3397ca82809133221d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "52a3cbe5b287a3b2ba5b45d4ca2db233", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9879518072289156, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = STDIN.gets.chomp.to_i\nif a % 2 == 0 and a > 4\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "adf49490f119a7d56c02e75440291b8e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5640051303b15e514690b9951a66f7db", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8680851063829788, "equal_cnt": 15, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 14, "bug_source_code": "w = gets.chomp.to_i\n\nif ( w == 1 or w == 2 or w == 3)\n p \"NO\"\nelsif w % 2 == 0\n p \"YES\"\nelse\n p \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "0d71d847c1508d4352760adc3995d94b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cd29ca6734ae70249d67bc1caf94e4df", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "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": "w = getc.to_i\n\nif ((w == 1) || (w == 2) || (w == 3))\n print \"NO\"\nelsif ((w % 2) == 0)\n print \"YES\"\nelse\n print \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "7b6f92279c9904a83c38630b53d2477d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cd29ca6734ae70249d67bc1caf94e4df", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8549618320610687, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "g = gets.to_i\nif g%4 == 0 then puts 'YES'\nelse puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "fec591e52bf6a501c25ce5f9ed6af069", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ee78a9ef410d9ff2decc5e01c70a68c8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9923664122137404, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "class Watermelon\n w = gets.chomp.to_i\n if w <=0\n print 'NO'\n elsif w % 2 == 0\n print 'YES'\n else\n print 'NO'\n end\nend", "lang": "Ruby", "bug_code_uid": "aec1df5bf3ef1b375135ec8c13f03a92", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c2d886bec31c6e94d2a3c80e4cd16adb", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9217391304347826, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "STDIN.read.split(\"\\n\").each do |a|\n if Integer(a) % 2 == 0\n puts \"YES\"\n else\n puts \"NO\"\n end\nend\n", "lang": "Ruby", "bug_code_uid": "ba18604878adbebe7004c55f1294b152", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9ff4064ed7ed37f1fadaa530ffff0087", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8888888888888888, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "w = gets.chomp.to_f\n\nprint w % 2 == 0 ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "b736bc5790908e2c4d70c2a05b99cff6", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "fc28f969112cd61514c94ef7d6eca0d8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9787234042553191, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/ruby\nrequire 'rational'\nx,y,a,b=gets.split.map(&:to_i)\ng=x/x.gcd(y)*y\np b/y-(a-1)/y", "lang": "Ruby", "bug_code_uid": "43c3cec1e4485edaa308be703d1bff89", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "cbd81f1dd1f1ed95e30505fcb523f034", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9416666666666667, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "def run\n x, y, a, b = $stdin.gets.split.map(&:to_i)\n c = x.lcm(y)\n puts (((b - a) / c) + 1)\nend\n\nrun if $0 == __FILE__\n", "lang": "Ruby", "bug_code_uid": "0967fde42843e590032b75a5a4d0c2a3", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "a68085d16294e0fa45621b28aaa367ff", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6357615894039735, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "x, y, a, b = gets.chomp.split.map{|e| e.to_i}\n\ns = 0\n\nfor i in a..b\n\ts += 1 if i % x == 0 and i % y == 0\nend\n\nputs s", "lang": "Ruby", "bug_code_uid": "d13a070ec7646fa58e7d93dbc828bd18", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "60021813eb8e614db64f00042bbe867f", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9809264305177112, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x, y, a, b = gets.chomp.split.map{|e| e.to_i}\n\ns = 0\n\nwhile (a % x != 0) or (a % y != 0)\n\ta += 1\nend\n\nwhile (b % x != 0) or (b % y != 0)\n\tb -= 1\nend\n\nputs ((b - a + 1.0)/(x*y)).ceil", "lang": "Ruby", "bug_code_uid": "a87095d5d8e07ea2e01b279cf623c6ef", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "60021813eb8e614db64f00042bbe867f", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.3192488262910798, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "inp = gets.split.map(&:to_i)\np ((inp[2]..inp[3]).to_a.select{|x| (x-inp[2])%inp[0]==0 } & (inp[2]..inp[3]).to_a.select{|x| (x-inp[2])%inp[1]==0 }).length", "lang": "Ruby", "bug_code_uid": "907d047b1d301a5dd2a7ed91cf0e0ad0", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "a659d25fba16e3be765ac69ec235ffb6", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4114285714285714, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "inp = gets.split.map(&:to_i)\ncount = 0\n(inp[2]..inp[3]).each{|x| count+=1 if (x%inp[0]==0 && x%inp[1]==0)}\np count", "lang": "Ruby", "bug_code_uid": "02375ee295ca6e2c77f5f2ac20157989", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "a659d25fba16e3be765ac69ec235ffb6", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6352941176470588, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "a=gets.chomp.split(\" \")\n0.upto(3) {|i| a[i]=a[i].to_i}\nans=0\n(a[2]).upto(a[3]) do |i| \nif i%a[0]==0&& i%a[1]==0 \nans+=1\nend\nend\nputs \"#{ans}\"", "lang": "Ruby", "bug_code_uid": "cb45b1cd455f95725cccdf8e58eba3a1", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "b6613e33de40d63bdd845dacc99fd842", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "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": "x,y,a,b=gets.split.map(&:to_i)\nq=x.lcm y\nb/q-(a+q-1)/q+1", "lang": "Ruby", "bug_code_uid": "9dabb85fc31b503c972efcf562c15b65", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "9057e5b05ef45223739e06c24958f563", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.49404761904761907, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x, y, a, b = gets.chomp.split.map { |x| x.to_i }\nk = x.lcm(y)\nr = (b - a) / k\nr += 1 if a % k == 0\nputs r", "lang": "Ruby", "bug_code_uid": "beef7bd21bd717d6a3b6dbb75c554c28", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "12a43e83ee9b1bc4dba3986572bbc746", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9931972789115646, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = gets.split(' ')\nb = []\n\ndef ucln(m, n)\n if m > n\n p = m%n \n while p > 0 do\n m = n \n n = p \n p = m%n \n end\n return n\n else\n p = n%m \n while p > 0 do\n n = m \n m = p \n p = n%m \n end\n return m\n end\nend\n\n(0..3).each do |i|\n b[i] = a[i].to_i\nend\n\nbcnn = b[0] * b[1] / ucln(b[0], b[1])\n\nkq = (b[3]/bcnn).floor + 1 - (b[2]/bcnn).ceil\n\nputs kq", "lang": "Ruby", "bug_code_uid": "fdc5af777e27a141b8c38985f358bad6", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "e34c4dc681c216ab35dcf707a6560517", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9114754098360656, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "input = gets.split(\" \").map {|e| e.to_i}\nx = input[0]\ny = input[1]\na = input[2]\nb = input[3]\n\nputs (b / (x*y) - (a.to_f / (x*y).to_f).ceil + 1)\n\n", "lang": "Ruby", "bug_code_uid": "480f32ee960aab8301fc0b4f7601b973", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "ab7f4006adbbf738c87766bead1b0bef", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9788732394366197, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def gcd a, b\n\treturn a if b == 0\n\tgcd b, a % b\nend\n\nx, y, a, b = gets.split.map { |x| x.to_i }\nl = x / gcd(x, y) * y\nputs a / l + (b - 1) / l\n", "lang": "Ruby", "bug_code_uid": "c3bb8de5ec4d9d2ff43539aacfe219d5", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "0765c2555150aedc476e30b9176b33cf", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9601659751037345, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "arr = gets.split.map &:to_i\n$n, x0, y0, dx, dy, t = arr\n\ndef mod(a)\n (a - 1) % $n + 1\nend\n\ndx, dy = mod(dx), mod(dy)\n\ndef zmul(a, b)\n ans = 0\n 6.times do |i|\n ans += mod(a[i] * b[i])\n ans -= $n if ans > $n\n end\n ans\nend\n\nclass Matrix\n def initialize(n)\n @mat = Array.new(n) do |i|\n Array.new(n) { |j| i == j ? 1 : 0 }\n end\n end\n\n def [](index)\n @mat[index]\n end\n\n def []=(index, val)\n @mat[index] = val\n end\n\n def mul(rhs)\n ans = Matrix.new(6)\n 6.times do |i|\n 6.times do |j|\n ans[i][j] = 0\n 6.times do |k|\n ans[i][j] += mod(@mat[i][k] * rhs[k][j])\n ans[i][j] -= $n if ans[i][j] > $n\n end\n end\n end\n ans\n end\n\n def pow(e)\n ans = Matrix.new(6)\n tmp = self.clone\n while e > 0\n ans = ans.mul(tmp) if (e & 1) == 1\n tmp = tmp.mul(tmp) if (e >>= 1) > 0\n end\n ans\n end\nend\n\n\nmat = Matrix.new(6)\nmat[0] = [2, 1, 1, 0, 1, 0]\nmat[1] = [1, 2, 0, 1, 1, 0]\nmat[2] = [1, 1, 1, 0, 1, 0]\nmat[3] = [1, 1, 0, 1, 1, 0]\nmat[4] = [0, 0, 0, 0, 1, 1]\nmat[5] = [0, 0, 0, 0, 0, 1]\n\nmat = mat.pow(t)\n\narr.shift\narr << 1\nputs \"#{zmul(mat[0], arr)} #{zmul(mat[1], arr)}\"\n", "lang": "Ruby", "bug_code_uid": "5b90dfd605220bcc16f9aadfbab801be", "src_uid": "ee9fa8be2ae05a4e831a4f608c0cc785", "apr_id": "71baca6a602e5b9c8a6c715f5981d9f7", "difficulty": 2300, "tags": ["matrices", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.920388349514563, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "# your code goes here\n\nn = STDIN.gets.chomp.to_i\nx = STDIN.gets.chomp.to_i\n\nt=[0,0,0]\n\nt[(x - 1)] = 1\n\n(n - 1).downto(1) do\n\t|i|;\n\tputs i;\n\tx = t[1];\n\tif (i % 2) == 0;\n\t\tt[1] = t[2];\n\t\tt[2] = x;\n\telse;\n\t\tt[1] = t[0];\n\t\tt[0] = x;\n\tend;\nend;\n\nputs t.index(1);", "lang": "Ruby", "bug_code_uid": "dbabc4861e00992901b25defc68775ab", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "f9136f8230bf40a3c019e1cf79777d9a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9802371541501976, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# your code goes here\n\nn = STDIN.gets.chomp.to_i\nx = STDIN.gets.chomp.to_i\n\nt=[0,0,0]\n\nt[x] = 1\n\n(n).downto(1) do\n\t|i|;\n\t#puts i;\n\tx = t[1];\n\tif (i % 2) == 0;\n\t\tt[1] = t[2];\n\t\tt[2] = x;\n\telse;\n\t\tt[1] = t[0];\n\t\tt[0] = x;\n\tend;\nend;\n\nputs t.index(1);", "lang": "Ruby", "bug_code_uid": "b18c46624a1730b6d82c429c19a98206", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "f9136f8230bf40a3c019e1cf79777d9a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.996875, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = gets.chomp.to_i\nx = gets.chomp.to_i\n\nif x == 1\n h = { 1 => 0, 3 => 1, 2 => 2 }\n puts h[n % 3]\nelsif x == 0\n h = {\n 0 => 0,\n 5 => 0,\n 1 => 1,\n 2 => 1,\n 3 => 2,\n 4 => 2\n }\n puts h[n % 6]\nelse\n h = {\n 0 => 2,\n 5 => 1,\n 1 => 2,\n 2 => 0,\n 3 => 0,\n 4 => 1\n }\n puts h[n % 6]\nend\n", "lang": "Ruby", "bug_code_uid": "9da2539f66b1cfdcdda2f506ec51dabb", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "73f9e0fad98170b65347526146ad7e3c", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.2569832402234637, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = gets.strip.to_i\nx = gets.strip.to_i\nmove = { 0 => [1, 2, 2], 1 => [0, 0, 1], 2 => [2, 1, 0] }\nn %= 3\nans = move[x][n]\nputs ans\n", "lang": "Ruby", "bug_code_uid": "38f48262a6630d44ea2067e79819a833", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "262d7b112e54ffe23b8649e07af672fe", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.5068493150684932, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n = gets.to_i\nfor i in 1..n\n if 2 ** i >= n\n break\n end\nend\nprint i\n", "lang": "Ruby", "bug_code_uid": "2c4da48b5df75f888f3d92600a5d6938", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "9398bcdd81c4172ac98779f097d65cb1", "difficulty": 1600, "tags": ["dp", "combinatorics", "dfs and similar", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9414316702819957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "r,x1,y1,x2,y2=gets.split.map{|e| e.to_f}\nr2=Math.hypot(x1-x2,y1-y2)\nr4=r*2\nif r2==0 then\n\tputs 0\nelse\n\tr3=r2.to_i\n\tans=(r2/r4).floor\n\t#p [r2,r4,ans]\n\td=r2-r4*ans\n\tif ans==0 then\n\t\tans=2\n\telsif d>0 && d-1 && a[l] == a[r] do\n l -= 1\n sum += 1\n end\n l += 1\n while r < n && a[l] == a[r] do\n r += 1\n sum += 1\n end\n r -= 1\n return ans if flag && sum < 3\n flag = 1\n ans = [ans, r - l + 1].max\n l -= 1\n r += 1\n return ans if l <0 || r >= n || a[l] != a[r]\n end\nend\n\nans = 0\nfor i in 0..n-1\n ans = [ans, cnt(i, i+1)].max if a[i] == a[i+1] && a[i] == x\nend\n\nputs ans\n", "lang": "Ruby", "bug_code_uid": "90078d05c028f09cb63d80915a8832d3", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "f2b621c6f4e2ffa01e3cfc28be2f67b7", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8729016786570744, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "# Created by Alex\nn, k, x = gets.split.map {|i| i.to_i}\na = gets.split.map {|i| i.to_i}\nmax = 0\nfor i in 0...n - 1\n if a[i] != x || a[i + 1] != x\n next\n end\n l = i - 1\n r = i + 2\n cnt = 3\n while l >= 0 && r < n\n p1 = l\n while p1 > 0 && a[p1 - 1] == a[r]\n p1 -= 1\n end\n p2 = r\n while p2 < n - 1 && a[p2 + 1] == a[l]\n p2 += 1\n end\n if l - p1 + p2 - r + 2 < 3\n break\n end\n cnt += l - p1 + p2 - r + 2\n l = p1 - 1\n r = p2 + 1\n end\n if cnt > max\n max = cnt\n end\nend\nif max < 3\n max = 1\nend\nputs max - 1", "lang": "Ruby", "bug_code_uid": "6cdcd5ec46bf83cb8137202016488db9", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "9a955331cc02c4dc55df6725799b3be0", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8732943469785575, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def run\n k = $stdin.gets.to_i\n h = Hash.new(0)\n $stdin.readlines.each do |line|\n line.chomp.split(//).each do |c|\n h[c] += 1 if c != '.'\n end\n end\n\n puts h.values.max <= 2*k ? \"YES\" : \"NO\"\nend\n\nrun if $0 == __FILE__\n", "lang": "Ruby", "bug_code_uid": "560315ac4c52d0f885f9c6d0a7cd16f3", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "1f2ed5ff2af01f346f4ec7c6be284fd7", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8829268292682927, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a=gets.chomp.to_i*2\nhash=Hash.new(0)\n4.times do\ntemp=gets.chomp\ntemp.each_char do |i|\nif i!=\".\"\nhash[i]+=1\nend\nend\nend\nk=hash.values.sort.reverse[0]\n\nif k>a\nputs \"NO\"\nelse \nputs \"YES\"\nend", "lang": "Ruby", "bug_code_uid": "86cded694d7bb3d900ab01eea39318ff", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "7557f504229aae8e33ac1db6d73fc309", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9761388286334056, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "k = gets.to_i\n\npanels = 4.times.map do\n gets.chomp.chars.to_a\nend.flatten.reject do |x|\n x == \".\"\nend\n\nhash = Hash.new 0\npanels.each do |panel|\n hash[panel] += 1\nend\n\nyes = hash.values.max <= k * 2\n\nputs yes ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "96b006db499328d20c3fe7c2867d8893", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "c772872857fd6d2a292b9d261ff23a0c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9571428571428572, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = get.to_i\nif n>2 && n%2==0 then\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "bf9a51f56429236179d90f15d4f96879", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "d6843345626230707a3f2560c8d90c49", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8023952095808383, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a = gets.chomp.to_i\n\nputs \"YES\" if a.even?\nputs \"NO\" unless a.even?", "lang": "Ruby", "bug_code_uid": "546eb44b32b741231b67b5199ad511ac", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3d75c2badf8396ed46b0882674d28471", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7910447761194029, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "w = gets\nx = w%2\nif x == 0 \n puts YES\nelse\n puts NO\nend", "lang": "Ruby", "bug_code_uid": "84e90a6219217804f85359a98c25848a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "bd3e885ec06938bb031072b529f74c74", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.965034965034965, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "w = gets.to_i\nif w%2 == 0 && ! 1\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "43d5d49a795b1365cf63504828def8f3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "bd3e885ec06938bb031072b529f74c74", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.972972972972973, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n=gets.to_i;\n if ((n % 2)==0)\n if ((n/2)% 2 == 0) \n puts \"YES\";\n else\n puts \"NO\";\n end\n else\n puts \"NO\";\n end", "lang": "Ruby", "bug_code_uid": "4e525374e6ff0c3570931713f62d9306", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e7955c4b1e873bb2ae5238a3b195b409", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5468164794007491, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 12, "bug_source_code": "n=gets.to_i;\n \n mod_n = n % 2;\n if (mod_n == 0)\n p YES;\n else\n p NO;\n end", "lang": "Ruby", "bug_code_uid": "6fa6f049f6343519b68347fd0d72cfd4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e7955c4b1e873bb2ae5238a3b195b409", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8493150684931506, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "w = gets\n\nif w.to_i % 2 == 0\n printf 'YES'\nelse\n printf 'NO'\nend", "lang": "Ruby", "bug_code_uid": "9cd577f8c5d750ef4c9bb97486d11836", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c08d92bb26462a58e6705d16adb0093f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8114285714285714, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = gets.to_i \n\nif a%2 == 0 \n\tputs \"YES\"\nelsif a%2!=0\n\tputs \"NO\"\nend\n\t\t", "lang": "Ruby", "bug_code_uid": "61977b8fa3ab478e6852a36f93285926", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "42b63432cf67aa4cb4b7d0e47cd0bfde", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9213483146067416, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input = STDIN.read\n\ninput.each_line do |w|\n puts w.to_i.even? ? 'YES' : 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "d40f62a3810aaec7870f72eb44ac0541", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ac31dfea6d4b08d991116180a7cbd26f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6056338028169014, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "puts(STDIN.gets.to_i % 2 == 0 ? 'YES' : 'NO')", "lang": "Ruby", "bug_code_uid": "d725867e3e19b617d1a1f04345445bea", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "cb59b37fb345949c7b725445922565d2", "difficulty": 800, "tags": ["math", "brute force"], "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": "\ndef is_even(w)\n\tif w % 2 != 0\n\t\treturn print \"NO\"\n\telse\n\t\treturn print \"YES\"\n\tend\nend\ninput = gets.chomp\nw = Integer(input)\nputs is_even(w)", "lang": "Ruby", "bug_code_uid": "3b355e6b581b22b0fbd36dac8619dcd0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "36e5b39e33bdada7441a8da1026f1723", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9673202614379085, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w = gets.chomp\nif w>3 && w%2 == 0\n print \"YES\"\nelse\n print \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "730a64af8c951a4e86b2a59ba9988096", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "265ef007a007d05ad1b0a79f4eb00684", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.7674418604651163, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "w = gets.chomp.to_i\nif w%2 == 0 \n\tprint \"YES\"\nelse\n\tprint \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "ea515468ed7d1f1e72f8ba407514470c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f452be884248afb1a6528f3a20845233", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9877300613496932, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a = gets.chop.to_i\ncheck = false\n\nif (a%2==0) \n\tputs ('NO')\n\tcheck=true\nend\n\nif (a%2==0)\n\tif (check==false)\t\nputs 'YES'\nend\nend\n\nif a%2==1\n\tputs 'NO'\n end\t\n\n\n\t\n\t", "lang": "Ruby", "bug_code_uid": "dea4c9e8e42057a873959cf28b21e881", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9b63f3aa5befb60885e17ff9fb3c40d0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.906832298136646, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x = gets.chomp\nif (x.to_i % 2 == 0)\n puts \"yes\" \n elsif\n puts \"no\"\nend", "lang": "Ruby", "bug_code_uid": "0e119c551e2e0897636d971b82b55309", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "297f8885d5426bb4e8335eafc2d3f747", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9444444444444444, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x = gets.chomp.to_i\nif x%2==0\n puts \"YES\"\nelse\n puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "34f14a95db14846dc8fb3f9ecb4ad7c2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "19e721f4ddad76080ca3b547f180d795", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8041237113402062, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "puts (4..101).step(2).include? gets.to_i", "lang": "Ruby", "bug_code_uid": "7b2edc44903900e9d8d6bd23a01f4b45", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "32d3f72e358fe4040296fc3306120caa", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9787234042553191, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "puts gets.match(/\\d+[02]|\\d*[468]/)?\"YES\":\"NO\"", "lang": "Ruby", "bug_code_uid": "9e1a4bd56919c789ec62d90eefee5084", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "32d3f72e358fe4040296fc3306120caa", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9320388349514563, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = gets.to_i\nputs ((a/2*2 == a) ? \"YES\" : \"NO\")", "lang": "Ruby", "bug_code_uid": "11ebeb4858ab5eb501e631774cd267a3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2cb6c094f451edbb56c3073e1c5feaa7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9315068493150684, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "w = gets.chomp.to_f\nif w/2%2==0\n puts 'YES'\nelse\n puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "ec598b6820d126e3135f525305af630e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "4968bb26feda3b82b075195e40835323", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.813953488372093, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def watermelon(w)\ntoken = w.even?\nif token && w > 2\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\nend", "lang": "Ruby", "bug_code_uid": "1d20f2137c0435870bcc675038ad5f2a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "94eb0bd7bb7e062e1a5c904b1a93d136", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5735294117647058, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "token = w.even?\n\"#{token && w > 2 ? 'YES' : 'NO'}\"\n", "lang": "Ruby", "bug_code_uid": "8b681835e9d64da1c9fab9c863c7c0a0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "94eb0bd7bb7e062e1a5c904b1a93d136", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8926553672316384, "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 == 0 && (n / 2) % 2 == 0 then\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "b4c234018e19c4bd0b542eda5cc2ace2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "eb42434b4b1d135c26b0997185ff2d7c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9494949494949495, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "weigth = gets().chomp.to_i\n\nif (weigth%2==0 && (weigth/2).even?) then puts \"YES\" else puts \"NO\" end\n", "lang": "Ruby", "bug_code_uid": "d83e0ad5759aea19b2e81ed5d9d3cb8d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e1b85ea9c0a43e5eb76f4ce9606f3009", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9193548387096774, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n=gets.to_i\nif n.even? then puts \"YES\" else puts \"NO\" end ", "lang": "Ruby", "bug_code_uid": "c9032170df4dc52f6b053975fd84b6b4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a3ca5e32f16e77ada078b4dc78ee1c0c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.5794392523364486, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a=gets.to_i\nprint \"NO\" if a%2 != 0\nprint \"YES\" if a%2 == 0", "lang": "Ruby", "bug_code_uid": "ac3c346afeea728581f049b37ac66090", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "87d1c3cf50718b554eedfedc7e64bf22", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9689807976366323, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "class BearBalls\n def consecutive_elements?(array)\n array.find.with_index do |_, i|\n array[i] + 2 == array[i + 2]\n end\n end\n\n def run(balls)\n balls_array = balls.split.sort.uniq.map(&:to_i)\n puts consecutive_elements?(balls_array) ? \"YES\" : \"NO\"\n end\nend\n\nsize = gets.chomp\nballs = gets.chomp\nBearBalls.new.run(balls)\n", "lang": "Ruby", "bug_code_uid": "07876141a1b5a62ca8e73b978da5d80f", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "f87d3926724274e5d18cd71e223eebc5", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9538461538461539, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=gets.to_i;\nt=gets.split.map{|i| i.to_i}.sort\n\nflag=false\n\nfor i in (1..t.length-2)\n if t[i]-t[i-1]==1 and t[i+1]-t[i]==1\n flag=true\n break\n end\nend\n\nif flag\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "029b8b282bc2a53d32809bf53fbcea7e", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "6401cae446856a1f240ea6de76efe290", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9930555555555556, "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(&:to_i)\nb = a.uniq.sort\nans = 'NO'\n(b.size - 3).times do |i|\n ans = 'YES' if b[i + 2] - b[i] == 2\nend\nputs ans\n", "lang": "Ruby", "bug_code_uid": "80d01f93d43b223d4bef3222f36adb86", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "4afb433d5c91a769e23255070dca97f4", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.4381625441696113, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "b = gets\na = b.split(\" \").sort\nres = 1 ; i=1 ; mn = a[0].to_i\n\nuntil i > mn\n res = res * i\n i+=1\nend\n\nprint res ", "lang": "Ruby", "bug_code_uid": "418ab77ec38c772d9e163f7a40ea2573", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "e6ee5b28813b0c189853d3f1cba33068", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8433734939759037, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "puts (a=gets.to_i)%2==0 ||a==2? \"YES\":\"NO\"", "lang": "Ruby", "bug_code_uid": "6abd0031455272d6bedeb81c22ce8814", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "bb5e3f61e023e123fb8df4dc7328e4c1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.961038961038961, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p (a=gets.to_i)%2==1||a==2? :NO:\"YES\"", "lang": "Ruby", "bug_code_uid": "77a73f73c4aa235c5a1a96c79fcd8509", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "bb5e3f61e023e123fb8df4dc7328e4c1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8374384236453202, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "watermelon = gets.chomp.to_i\nif (watermelon % 2) == 0\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "34e5842bfbe6225b90e3919c8fe77944", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a2f0b7d12eb513081a9fb890d061893b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8376068376068376, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "if gets.to_i.even?\n puts \"YES\"\nelse puts \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "daaa04874bdc5b24f732db9f71961793", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "406be2b76c47973128f643b4050343b8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.0, "equal_cnt": 0, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "8", "lang": "Ruby", "bug_code_uid": "1edf6476c1de6334db61276d71da8add", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "81033c38bbe0996a173d7243f1fa76a1", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5869565217391305, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "w = gets.to_i\nputs \"YES\" if w.even?\n", "lang": "Ruby", "bug_code_uid": "79ef738f04669247322763ab61f317b5", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "111d9974a2a26249fba378ff9b4c206f", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6602870813397129, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "w = (gets.split.map &:to_f)[0]\nd = w/2\nif d % 2 == 0\n puts 'YES' \nelse\n puts 'NO'\nend", "lang": "Ruby", "bug_code_uid": "2311a06c1e575058839e17251833cc30", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b8277230f8ab31423c1175a387c5a4e5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9760765550239234, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "W = $stdin.gets.to_i\nif W == 0\n puts(\"NO\")\nelsif W%2 == 0\n puts (\"YES\")\n else\n puts (\"NO\")\n end\n", "lang": "Ruby", "bug_code_uid": "1fab387c93bab26a15cc37e298fdc9d1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ba848c73e0a51bcb51588557f46905f7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7080745341614907, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "if W%2 == 0\n puts (\"YES\")\n else\n puts (\"NO\")\n end", "lang": "Ruby", "bug_code_uid": "e1cdf038a117aaba59ec77c8e9783bdc", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ba848c73e0a51bcb51588557f46905f7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9241379310344827, "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&1) && n != 2\n\tputs \"YES\"\nelse\n\tputs \"NO\"\nend\n", "lang": "Ruby", "bug_code_uid": "d1baccd49b51a653cde8f607da1aa55d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c580f573866e65a12ac1c162c5d5233d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9743589743589743, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "weight = 0\nweight = gets.to_i\n\nif weight % 2 == 0 || weight != 2\n\tputs \"YES\"\nelse \n\tputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "63a2512b74451291599752d54d150078", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "eca12f71515090d18aebf9bb0f878ff5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6954022988505747, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "while a = gets\n\ta = a.to_i\n\t#result = a % 2 == 0 ? 'YES' : 'NO'\n\t#puts result\n\tif a == 1 \n\t\tputs \"NO\"\n\t\tnext\n\tend\n\t\n\tresult = \"NO\"\n\t(2..a).step(2) do |n|\n\t\tif (a - n) % 2 == 0\n\t\t\tresult = \"YES\"\n\t\tend\n\tend\n\tputs result\nend\n", "lang": "Ruby", "bug_code_uid": "2c135f9dfb15c7b557ccc3f44d1fce7e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "c62e4886aa5bb0d5112396e2f8fc2e06", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.965034965034965, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x = gets.to_i\nif x > 2 and w % 2 == 0\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "6d538b18c84c2d4f539274100e3752bf", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5c8d8ba279405697f131ff13492bcbd5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9387755102040817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "w = STDIN.read.to_i\n\nif w % 2 == 0\n puts 'YES'\nelse\n puts 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "5f79ac5018a8f6befcca61b2517c409f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "445e9179e233859751246fcbc8278563", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8873239436619719, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp.to_i\nif n < 4\n puts 'NO'\nelsif n % 2 != 0\n puts 'NO'\nelsif n === 4\n puts 'YES'\nelse\n i = 0\n divisible = false\n while (i * 2 + 4) <= n / 2\n if (n - (i * 2 + 4)) % 2 === 0\n divisible = true\n break\n end\n i += 1\n end\n puts divisible ? 'YES' : 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "913aab7ea5fcf071835f2070358977e0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6eb6b21ced559f3ada70fde4fe619798", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.3111954459203036, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n = gets.chomp\nif n < 4\n p 'NO'\nelsif n % 2 != 0\n p 'NO'\nelse\n i = 0\n divisible = false\n while (i * 2 + 4) <= n / 2\n if (n - (i * 2 + 4)) % 2 === 0\n divisible = true\n break\n end\n i += 1\n end\n p divisible ? 'YES' : 'NO'\nend\n", "lang": "Ruby", "bug_code_uid": "ecc754c0ba0ad20291c453ee689b9231", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "6eb6b21ced559f3ada70fde4fe619798", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.935064935064935, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp.to_i\nif n.even? && (n / 2).even?\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "ea43c5ca7159d47469c9b50369f1e40c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "5d7bc4d283415b3c89dfa43b725efbb7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9032258064516129, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "w = gets.to_i\nputs ((w % 2).zero? || (w == 2)) ? 'YES' : 'NO'", "lang": "Ruby", "bug_code_uid": "9ecaa7e5a988eff34a0e55c3befe2fb4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "0be5d1b6db13241bbc05fc5195d6117b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7956989247311828, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "w = gets\n\nputs (w & 1) ? \"YES\" : \"NO\"", "lang": "Ruby", "bug_code_uid": "72b2cf5713ecefadd782ee12041a7744", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "4bbb4683f7bdd786afad8d677460a9a2", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.4918032786885246, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "w = gets.to_i\np (w / 2).even? ? 'YES' : 'NO'\n", "lang": "Ruby", "bug_code_uid": "05792e267245959764878b6b1fce7cc7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "4c11c2fd0eebb9b7fb13da9229482ad2", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.5068493150684932, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "w = gets.split.map &:to_i\nputs \"YES\" if w % 2 == 0\nputs \"NO\" if w % 2 != 0", "lang": "Ruby", "bug_code_uid": "dbb2f57bd839faae8440612d724d2171", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "147aa8a24b8188d45526e0220b89ccb4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.951048951048951, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "w = gets.to_i\nif w >= 4 and w % 2 == 0 do\nputs \"YES\"\nelse\nputs \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "4ebdc7c65e3032b682ad892c45e6e7c0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "147aa8a24b8188d45526e0220b89ccb4", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "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": "w = STDIN.read.to_i\nif w % 2 == 0\n puts \"YES\"\nelse\n puts \"NO\"\nend", "lang": "Ruby", "bug_code_uid": "271a0198400b0192344462d2e46ec764", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "af184fe3965d2813aec10769ff6b975d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9318181818181818, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a, b, c = STDIN.readline.split.map {|s| s.to_i }.sort\nputs a*a + (a+b)*c - (a+b+c) + 1\n", "lang": "Ruby", "bug_code_uid": "3d6d5784c0600c63eb69903810f3edda", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "bcb6efb5c08b1ba212e0ded8564afc11", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.6964285714285714, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "x, y, z = gets.split\n\nputs 2 * (x + y + z)", "lang": "Ruby", "bug_code_uid": "31ef7a05fc1c7ffb7d61047ab15fc828", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "ca2219bcc20226991e881138a87c5123", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8225806451612904, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "x, y, z = gets.split.map(&:to_i)\n\nputs 2 * (x + y + z)", "lang": "Ruby", "bug_code_uid": "8e83feb00c841f49f9e7dc504e91063f", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "ca2219bcc20226991e881138a87c5123", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.10606060606060606, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a,b,c = gets.split\nputs a*b + (a-1)*c + (b-1)*(c-1) + 1", "lang": "Ruby", "bug_code_uid": "28ce497a68cce737ae6cc776daef9cfb", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "b7dfeec68abb6d102b0d90d7fb09ead2", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9562289562289562, "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 { |x| x.to_i }\nx = [a - 1, b - 2].min\ns = (1 + x) * (2 * c + x)\nex = a + 1 - b\ns += (c + b - 1) * ex if ex > 0\nputs s", "lang": "Ruby", "bug_code_uid": "b45021004c7b2834f828866b51ba3a2c", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "9bf48a41da70ffce5f1bc2f90138bcb9", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.6260296540362438, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "x = gets.split()\na = x[0].to_i\ny = x[1].to_i\nz = x[2].to_i\n\nif y >= z\nthen\n b = y\n c = z\nelse\nb = z\nc = y\nend\n\n\ni= a \n\nd =b +c - 1\n\nif d%2== 0\nthen\n (c-1).times do \n a = a + 1\n i = i + a\n end \n (d/2-c).times do\n i = i + a\n end \n puts i*2\nelse\n (c-1).times do \n a = a + 1\n i = i + a\n end\n\n e = (d-1)/2\n (e-c).times do\n a = a + 1\n i = a + i\n end\n puts i*2 -a\nend\n", "lang": "Ruby", "bug_code_uid": "c59fef0593b63abd6dc095e314da24a2", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "b49fa82183f2fab4917702004ab4d007", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9754601226993865, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m,k=gets.split.map(&:to_i)\nplanets=n.times.map{\n\tgets\n\tm.times.map{gets.split.map(&:to_i)}\n}\nans=0\nplanets.permutation(2).each{|p1,p2|\n\tt=[]\n\tm.times{|i|t<<[p2[i][1]-p1[i][0],p1[i][2]]}\n\tkk=k\n\ta=0\n\tt.sort_by{|d,c|d}.reverse.each{|d,c|\n\t\tnum=[kk,c].min\n\t\ta+=num*d\n\t\tkk-=num\n\t\tbreak if kk==0\n\t}\n\tans=a if a>ans\n}\np ans", "lang": "Ruby", "bug_code_uid": "b041f576bf8b99fdf022fbc5ed2ea2d1", "src_uid": "7419c4268a9815282fadca6581f28ec1", "apr_id": "f9fa012ef2e056ae4517131aec5b4bee", "difficulty": 1200, "tags": ["games", "greedy", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.86, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a,b,c = gets.split.map &:to_i\nputs b*c+b+c-1\n", "lang": "Ruby", "bug_code_uid": "95490e41606dc4eb716352e6c6aa6bd1", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "d478127eba3ee40ad3772b1117e314ec", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9985693848354793, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#=================================\n# We trust in God.\n#=================================\n\ndef Profiler\n\t#=================================\n\trequire 'prime'\n\trequire 'set'\n\trequire 'matrix'\n\trequire 'tsort'\n\tinclude Math\n\n\tdef local?; ENV[\"LOGNAME\"]==\"skydos\"; end\n\n\tbegin\n\t\t$stdin = File.open(\"./input.txt\", \"r\")\n\t\t\n\t\tstart_time = Time.now\n\tend if local?\n\t\n\tyield\n\n\tbegin\n\t\tend_time = Time.now\n\t\tputs \"\\n\\n\"\n\t\tputs \"===\"*10\n\t\tprintf \"Time: %.4f sec\\n\", (end_time-start_time)\n\t\tputs \"===\"*10\n\tend if local?\n\t#=================================\nend\n\nProfiler do\n#=================================\n\nn=gets.to_i\n\nif n-1<0\n\tputs 0\nelse\n\tputs 3**(n-1)%(10**6+3)\nend\n\n#=================================\nend\n", "lang": "Ruby", "bug_code_uid": "6a7f43e040c0aa6e00961b26306e8e8e", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "5a081d79588cf486847e1a2b016f7fb2", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6097560975609756, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "puts (3**(gets.to_i-1))%(1000000+3)", "lang": "Ruby", "bug_code_uid": "5759ba7bdfdb83ae2fc5f8efb5f0e07a", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "ad979d5abfd62434fb045b4196c959aa", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9347826086956522, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = STDIN.gets.to_i\ndef remaining(n)\n return 0 if n == 0\n return 1 if n == 1\n return 3 * remaining(n-1)\nend\nprint remaining(n)\n", "lang": "Ruby", "bug_code_uid": "76d315ecd7cc97061461c7afb810f124", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "a715c567600c3f2f0a74d1feeab2ad5e", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.7912087912087912, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/env ruby\n\ni = gets.chomp.to_i\nputs i == 0 ? 0 : (3 ** (i - 1)) % (10 ** 6 + 3)\n\n", "lang": "Ruby", "bug_code_uid": "47aa5f37e337c0528adf4219e589167f", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "56028a68ad7269591ba87efa967bfbd3", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "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": "n = gets.to_i\np (n==0)? 0 : 3**(n-1)%(10**6+3).to_i\n", "lang": "Ruby", "bug_code_uid": "29ea09df0e1117fd604b25347f146cbe", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "bd2cd60d83fbbd38ffa42fc2d9cffb4a", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9333333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i;\nprint (((3**(n-1)).floor)%((10**6)+3))", "lang": "Ruby", "bug_code_uid": "d18330a20e02b528c385578fe7d407d7", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "6a4f0e40a41db44488367b3f024a8f7a", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9836065573770492, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s=gets.chomp\np s.size.times.map{|i|s[i..-1]+s[0,i]}.uniq.aize", "lang": "Ruby", "bug_code_uid": "7af53fe5aa51a26fb01096b83fb5fc32", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "3ec02a6b35748fdd808dd5ef904719a8", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9886363636363636, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "require 'set'\nclass Spelling\n attr_reader(:s)\n def initialize(s)\n @s = s\n end\n\n def sp\n @s.split(\"\")\n end\n\n def rotated\n (0..s.length).map{|i| sp.rotate(i)}\n end\n\n def result\n rotated.to_set\n end\nend\n\nprint Spelling.new(gets).result.length\n", "lang": "Ruby", "bug_code_uid": "a1442e15d1b6fabe433e557c788825cc", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "713348e76ab332d5f50e611cc534d908", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.27886056971514245, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "x, y, l, r = gets.chomp.split.map &:to_i\n\nunlucky = []\nfor i in 0...64\n for j in 0...64\n if x ** i + y ** j <= r\n unlucky.push(x ** i + y ** j)\n else\n break\n end\n end\nend\ninterval = []\nfor i in l..r \n interval.push(i)\nend\n\ngolden = interval - unlucky\n\nmax = 1\nfor i in 0...golden.length-1\n if golden[i + 1] - golden[i] == 1\n max += 1\n else\n max = 1\n end\nend\n\nif golden.length > 0\n print max\nelse\n print 0\nend\n", "lang": "Ruby", "bug_code_uid": "7b3865058e2b2ca414a5edde812a0955", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "d54b64959204d9bb361469747d6d6c5a", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9785258270458502, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x, y, l, r = gets.chomp.split.map &:to_i\n\nunlucky = []\nfor i in 0...64\n for j in 0...64\n m = x ** i + y ** j\n if m <= r && m >= l\n unlucky.push(m)\n end\n end\nend\n\nunlucky = unlucky.sort!\nprint unlucky\nputs\nunlucky_neat = []\nif !unlucky.empty?\n unlucky_neat.push(unlucky[0])\n for i in 1...unlucky.length\n if unlucky[i] != unlucky[i - 1]\n unlucky_neat.push(unlucky[i])\n end\n end\nend\nprint unlucky_neat\nif !unlucky_neat.empty?\n max = (unlucky_neat[0] - l) > (r - unlucky_neat[unlucky_neat.length - 1]) ? (unlucky_neat[0] - l) : (r - unlucky_neat[unlucky_neat.length - 1])\n for i in 0...unlucky_neat.length - 1\n if unlucky_neat[i + 1] - unlucky_neat[i] - 1 > max\n max = unlucky_neat[i + 1] - unlucky_neat[i] - 1\n end\n end\n puts max\nelse\n max = r - l + 1\n puts max\nend\n\n\n", "lang": "Ruby", "bug_code_uid": "ac01d3ea99afb0bf938af9331bc523e3", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "d54b64959204d9bb361469747d6d6c5a", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.8734746307000643, "equal_cnt": 19, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 19, "bug_source_code": "x, y, l, r = gets.chomp.split.map &:to_i\n\nunlucky = []\nfor i in 0...64\n for j in 0...64\n if x ** i + y ** j <= r && x ** i + y ** j >= l\n unlucky.push(x ** i + y ** j)\n end\n end\nend\nunlucky = unlucky.sort!\nunlucky_neat = []\nunlucky_neat.push(unlucky[0])\nfor i in 1...unlucky.length\n if unlucky[i] != unlucky[i - 1]\n unlucky_neat.push(unlucky[i])\n end\nend\n\nmax = (unlucky_neat[0] - l) > (r - unlucky_neat[unlucky_neat.length - 1]) ? (unlucky_neat[0] - l) : (r - unlucky_neat[unlucky_neat.length - 1])\nfor i in 0...unlucky_neat.length - 1\n if unlucky_neat[i + 1] - unlucky_neat[i] - 1 > max\n max = unlucky_neat[i + 1] - unlucky_neat[i] - 1\n end\nend\n\nputs max\n", "lang": "Ruby", "bug_code_uid": "1206d163c01d0f508746c92ee1ca49a0", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "d54b64959204d9bb361469747d6d6c5a", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9631190727081138, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "x,y,l,r=gets.split(\" \").map(&:to_i)\nxp=[]\nyp=[]\nt=1\nwhile t=r then\n #p [ans,tl]\n ans=[ans,r+1-tl].max\n tl=i+1\n break\n end\n if tl blue_socks\n\t\tprint blue_socks,\" \"\n\n\t\tres = (red_socks-blue_socks)/2\n\t\tputs res\n\telsif red_socks < blue_socks\n\t\tprint red_socks, \" \"\n\t\tres = (blue_socks-red_socks)/2\n\t\tputs res\n\telse\n\t\tprint red_socks,\" \", blue_socks\n\t\tprint \"\\n\"\n\tend\nend", "lang": "Ruby", "bug_code_uid": "141b4e5a08bf228e440722ef876b63a3", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "d190ffafc567af2412f6c111ca42da5a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9181286549707602, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "input = STDIN.gets\narr = input.split\nfirst_days = arr.min.to_i\nsecond_days = (arr.max.to_i - arr.min.to_i) / 2\nputs \"#{first_days} #{second_days}\"\n# puts \"input - #{input}\"", "lang": "Ruby", "bug_code_uid": "c968df9e865a3673127c974b0b1a57b9", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "3fef46ac32640b688cf09a02b7217bb1", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.9748892171344166, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "red_blue = gets.chomp\nred_blue = red_blue.split\nred = red_blue[0].to_i\nblue = red_blue[1].to_i\n\narr = [red,blue]\n\nhipster = 0\nnormal = 0\n\nif red + blue >= 2\n\tprint arr.min\n\tred = (red - arr.min)\n\tblue = (blue - arr.min)\n\tprint \" \"\n\tif red > 0\n\t\tprint red/2\n\telsif blue > 0\n\t\tprint blue/2\n\tend\nelse\n\tprint 0\n\tprint \" \"\n\tprint 0\nend", "lang": "Ruby", "bug_code_uid": "bc7d224c3ef1c10e4357d3cac18fe84e", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "1746e8b6147adfa45926cc98f18d4bdc", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9158249158249159, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/local/ruby\n\n#puts c\n#読み込み\ninput = gets.chop.split(\" \")\na = input[0].to_i\nb = input[1].to_i\n\n\nputs b.to_s+\" \"+(([a,b].max-[a,b].min)/2).to_s\n", "lang": "Ruby", "bug_code_uid": "6c09d6b91c53f49aa0765adbf89a7405", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "c741cb93a321a13d10d1d17707bb43c0", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9822064056939501, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#$stdin = File.open('in.txt')\n#$stdout = File.open('out.txt', 'w')\n\na, b = gets.split.map(&:to_i)\n\na, b = b, a if a > b\n\n\np a, (b - a + 1) / 2\n", "lang": "Ruby", "bug_code_uid": "159518ba79672a22303d2c6bcbf61b54", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "6134ef6e81a4d0c313c87c17fa29c71a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Ruby"} {"similarity_score": 0.7209302325581395, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = gets.to_i\nputs n == 1 ? \"Ehab\" : \"Mahmoud\"", "lang": "Ruby", "bug_code_uid": "f08005c71999ce40e36d0c27a3969299", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "9eae7c8a50d0cc25a94ff7c82a1be1d9", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9333333333333333, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n = gets.chomp\nif n%2 == 0\n puts \"Mahmoud\"\nelse\n puts \"Ehab\"\nend", "lang": "Ruby", "bug_code_uid": "6faa6016fc0518d83ceaf04275479805", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "b8240c7a7522dea9db0dab0eb5d0189f", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.96, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "puts (gets.to_i&1)?\"Ehab\":\"Mahmoud\"\n", "lang": "Ruby", "bug_code_uid": "fd277b45c6029dbda0065dec0a6ec8af", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "4fb6ec4039d364e73bc614c78329db03", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.9830508474576272, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a,b,c=gets.split.map(&:to_i)\ns=(a+b+c)/2\nputs (a+b+c)%2!=0||s-a<0||s-b<0||s-c<0 ? \"Impossible\": \"#{s-c} #{s-b} #{s-a}\"", "lang": "Ruby", "bug_code_uid": "c02a53f00761ee0e05df0f0415f0e44c", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "519295989955c5515fe1100215ad40fc", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.05179282868525897, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "def swap(s, i)\n\ttmp = s[i]\n\ts[i] = s[i + 1]\n\ts[i + 1] = tmp\nend\n\ns = gets.strip.split\ns1 = s[0]\ns2 = s[1].to_i\ni = 0\ncnt = 0\nwhile (i + 1) >= 0 && (i + 1) < s1.size\n\tbreak if cnt == s2\n\tif s1[i + 1] > s1[i]\n\t\tswap(s1, i)\n\t\tcnt += 1\n\t\ti -= 1\n\telse\n\t\ti += 1\n\tend\nend\nputs s1", "lang": "Ruby", "bug_code_uid": "2eab15c3a4c7708945fa414077b4c28e", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "cdb0b7eb9e1572c3b8be77c4ccd1d65e", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.6457399103139013, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "s = gets.strip.split\na = s[0].split(//)\nk = s[1].to_i\naa = []\nwhile k > 0\n\tm = a[0..k].max\n\tmp = a.index(m)\n\tif mp == 0\n\t\tnext\n\telse\n\t\t# swap...\n\t\tk -= mp\n\t\taa << a[mp]\n\t\ta.delete_at(mp)\n\tend\nend\naa << a\nputs aa.join", "lang": "Ruby", "bug_code_uid": "1a49428b693128dcade3cb9d5471d302", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "cdb0b7eb9e1572c3b8be77c4ccd1d65e", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.8252427184466019, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = gets.strip.split\na = s[0].split(//)\nk = s[1].to_i\naa = []\nwhile k > 0\n\tm = a[0..k].max\n\tmp = a.index(m)\n\tk -= mp if mp != 0\n\taa << a[mp]\n\ta.delete_at(mp)\nend\naa << a\nputs aa.join", "lang": "Ruby", "bug_code_uid": "84ef9bd19784a3ba503d16e87e32798f", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "cdb0b7eb9e1572c3b8be77c4ccd1d65e", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Ruby"} {"similarity_score": 0.9746478873239437, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "a,b=gets.split\na=a.split('').map(&:to_i)\nk=b.to_i\ni=0\nwhile k>0&&i= g ? (total_interval - till_a) : 0\n\na_to_b = (l-d) / v.to_f\n\n\nputs till_a + extra_time + a_to_b", "lang": "Ruby", "bug_code_uid": "6ba5f09b8b2f991342e812afe93e2089", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "573e6825388c32784d0b268b8c740c10", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"} {"similarity_score": 0.8814589665653495, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "def sum(x)\n\ty=((x+1)*x)/2\nend\nm=gets.chomp.to_i\nb=gets.chomp.to_i\nmax=0\n(b+1).times do |y|\n\tx=(-y*m)+b*m\n\ts=(y+1)*sum(x)+(x+1)*sum(y)\n\tmax= max > s ? max : s\nend\np max", "lang": "Ruby", "bug_code_uid": "6aec10e552214e185adf6e3701d7b6a9", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "5af1bbbcc565bb619c5856168b969a9d", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Ruby"}