{"similarity_score": 0.9413948554760011, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString='';\nlet currentLine=0;\nprocess.stdin.on('data',inputStdin=>{\n inputString+=inputStdin;\n});\nprocess.stdin.on('end',_=>{\n inputString=inputString.trim().split(\"\\n\").map(string=>{\n return string.trim();\n });\n main();\n});\nfunction readLine()\n{\n return inputString[currentLine++]; \n}\nfunction ans(s)\n{\n let zer=[-1,-1],tw=-1,se=-1,fi=-1;\n for(let i=s.length-1;i>=0;--i)\n {\n if(s[i]=='7')\n {\n se=i;\n break;\n }\n }\n for(let i=s.length-1;i>=0;--i)\n {\n if(s[i]=='2')\n {\n tw=i;\n break;\n }\n }\n for(let i=s.length-1;i>=0;--i)\n {\n if(s[i]=='5')\n {\n fi=i;\n break;\n }\n }\n let k=0;\n for(let i=s.length-1;i>=0;--i)\n {\n if(s[i]=='0')\n {\n zer[k++]=i;\n if(k==2)\n break;\n }\n }\n zer.length=k;\n if(fi==-1)\n {\n if(zer.length<2)\n return -1;\n return (2*s.length-3-zer[0]-zer[1]);\n }\n else\n {\n let ac=[];\n if(zer.length>=2)\n {\n ac.push(2*s.length-3-zer[0]-zer[1]);\n }\n if((zer.length>=1)&&(fi!=-1))\n {\n ac.push(2*s.length-3-zer[0]-fi+(fi>zer[0]?1:0));\n }\n if((tw!=-1)&&(fi!=-1))\n {\n ac.push(2*s.length-3-tw-fi+(tw>fi?1:0));\n }\n if((se!=-1)&&(fi!=-1))\n {\n ac.push(2*s.length-3-se-fi+(se>fi?1:0));\n }\n if(ac.length!=0)\n return Math.min.apply(Math,ac);\n else\n return -1;\n }\n}\nfunction main()\n{\n let n=readLine().trim();\n console.log(ans(n));\n}", "lang": "Node.js", "bug_code_uid": "c59ebf789c1e33eb6920f6e7c47527f7", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "1e2653af5be435bb7a3e57c7ccb25ed0", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9097963142580019, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet k = 0;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n k = +d;\n return;\n }\n\n const arr = d.split(' ').map(Number);\n arr.sort((a, b) => b - a);\n\n let sum = 0;\n let ans = 0;\n\n for (let i = 0; i < arr.length; i++) {\n if (sum < k) {\n sum += arr[i];\n ans++;\n }\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "743e9c19b74da1ad8bec0d7ab4e20461", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "a5921d192b7c0bcd113812a44d0d0636", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9434920634920635, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "function businessTrip(k, months) {\n // sort the array\n months = months.split(\" \");\n months = months.sort(function(a, b) {\n return b - a;\n });\n // itarate\n let count = 0;\n let sum = 0;\n for (let i = 0; i < months.length; i++) {\n if (k == 0) break;\n if (k <= parseInt(months[i]) + parseInt(sum)) {\n count++;\n break;\n } else {\n sum = parseInt(sum) + parseInt(months[i]);\n count++;\n }\n }\n return console.log(count);\n}\n\n// businessTrip(\"0\", \"0 0 0 0 0 0 0 1 1 2 3 0\");\n\nconst readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet arr = [];\nrl.on(\"line\", line => {\n arr.push(line);\n});\n\nrl.on(\"close\", () => {\n businessTrip(arr[0], arr[1]);\n});\n", "lang": "Node.js", "bug_code_uid": "a920a555fd4bcb0699c0ebc9a45ffef5", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "3ed175afc20f4e8509e1d15f02019e2a", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9770723104056437, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "function businessTrip(k, months) {\n // sort the array\n months = months.split(\" \");\n months = months.sort(function(a, b) {\n return b - a;\n });\n // itarate\n for (let i = 0; i < months.length; i++) {\n let sumOfFirsNLement = months\n .slice(0, i + 1)\n .reduce((startPoint, current) => {\n return parseInt(startPoint) + parseInt(current);\n });\n if (parseInt(sumOfFirsNLement) >= parseInt(k)) return console.log(i + 1);\n }\n return console.log(\"-1\");\n}\n\n// let sum = [1, 2, 3];\n\n// console.log(sum);\n\n// businessTrip(\"5\", \"0 0 0 0 0 0 0 1 1 2 3 0\");\n\nconst readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet arr = [];\nrl.on(\"line\", line => {\n arr.push(line);\n});\n\nrl.on(\"close\", () => {\n businessTrip(arr[0], arr[1]);\n});\n", "lang": "Node.js", "bug_code_uid": "4475a85dd37cc9e267b67d0ba8670d10", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "3ed175afc20f4e8509e1d15f02019e2a", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9776704888352444, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nvar dp = {};\n\nfunction fibonacci(n) {\n\tif (n === 0) return 0;\n\tif (n === 1) return 1;\n\n\tif (dp[n] !== undefined) return dp[n];\n\tlet result = fibonacci(n - 1) + fibonacci(n - 2);\n\treturn (dp[n] = result);\n}\n\nfunction main() {\n\tlet n = readLine() >> 0;\n\tlet m = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\n\tm.sort((a, b) => b - a);\n\n\tif (n === 0) {\n\t\tconsole.log(0);\n\t\treturn;\n\t}\n\n\tlet c = 0,\n\t\ts = 0;\n\tfor (let i = 0; i < 12; ++i) {\n\t\ts += m[i];\n\t\tif (s >= n) {\n\t\t\tc++;\n\t\t\tbreak;\n\t\t}\n\t\tc++;\n\t}\n\tconsole.log(c);\n}\n", "lang": "Node.js", "bug_code_uid": "8233e1d78aa732f3cb16aa9591cf6e64", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "a28b7995bbe6fb2d08f552871fe09077", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9533560864618885, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let k = parseInt(readLine());\n let months = readLine().split(' ').map(Number);\n months.sort((a, b) => b - a);\n if (k === 0) {\n console.log(0);\n return;\n }\n let count = 0;\n let sum = 0;\n for (let i = 0; i < months.length; i++) {\n sum = sum + months[i];\n count++;\n if (sum >= k) {\n break;\n }\n }\n console.log(count);\n}\n", "lang": "Node.js", "bug_code_uid": "b45799b77affac9313e8c82ee9113d7c", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "f55f385a31336aaec19a152826e347f0", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9892116182572614, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n return;\n }\n\n const arr = d.split(' ').map(Number);\n const sum = arr.reduce((a, b) => a + b, 0);\n let max = Math.max(...arr);\n let r = 0;\n\n for (let i = 0; i < arr.length; i++) {\n r += max - arr[i];\n }\n\n // while (r <= sum) {\n // r += arr.length;\n // max++;\n // }\n\n if (sum - r >= 0) {\n max += Math.ceil((sum - r) / arr.length);\n }\n\n console.log(max);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "9ed2e4c3e9404e81ec9790e820eb243b", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "44d0896ec1598c857d281bce97622450", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8285410010649628, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "input = []\nprocess.stdin.setEncoding('ascii');\nprocess.stdin.on('data', z => {\n input.push(z.slice(0, -1))\n})\n\nprocess.stdin.on('end', z => {\n // console.log(input)\n a = input[1].split(' ')\n b = input[2].split(' ')\n // console.log(a, b)\n for(let i in a){\n if(b.includes(a[i])){\n process.stdout.write(a[i] + ' ')\n }\n }\n process.stdout.write('\\n')\n})\n", "lang": "Node.js", "bug_code_uid": "ef88fe4ca4c3e331d5248414e049d0e2", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72", "apr_id": "0d86d30795f3bb55d29f3476ef3cd460", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.08111888111888112, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "let numbers = readline().split(' ').map((n) => parseInt(n));\nlet [n, m, a] = numbers;\n\nlet an = Math.ceil(n / a);\nlet am = Math.ceil(m / a);\n\nprint(an * am);", "lang": "Node.js", "bug_code_uid": "4dac5f033db8afee2447058ab11ea432", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "8a1af3bca4d8022330d3b5223ca39dda", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9768545994065282, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet standardInputString= '';\nlet currentLine = 0;\n\nfunction readLine(){\n return standardInputString[currentLine++];\n}\n\nprocess.stdin.on('data', rawData =>{\n standardInputString += rawData;\n});\n\nprocess.stdin.on('end', _ =>{\n standardInputString= standardInputString.trim().split('\\n').map(line =>{\n return line.trim();\n });\n\n main();\n})\n\n\n\nfunction main(){\n let [n] = readLine().split(' ').map(Number);\n\n let line = readLine().split(' ').map(Number);\n\n\n let consecutives = 0;\n\n let result = 0;\n\n for(let i =1; i<=n; i++){\n if(line[i]-1 ===line[i-1]&& line[i+1] -1 === line[i]){\n consecutives++;\n }\n else{\n consecutives = 0;\n }\n result = Math.max(result, consecutives);\n }\n console.log(result)\n }\n", "lang": "Node.js", "bug_code_uid": "b17711e4c19410c8a7bb82323779068d", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "5f6b0c7450aed058588ad86200b50bc5", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8867235079171741, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nrl.on('line', (input) => {\n if (l === 0) { l++ }\n else {\n rl.close();\n let arr = input.split(\" \").map(x => parseInt(x))\n let cnt = 0\n let max = 0\n for (let i = 1; i < arr.length; i++) {\n if (arr[i]===arr[i-1]+1) {\n cnt++\n if(i+1max){\n max=cnt\n }\n } else {\n cnt=0\n }\n }\n console.log(max)\n return 0;\n }\n})\n", "lang": "Node.js", "bug_code_uid": "a297236ab00fff63ce69cd9eb2b7d027", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "4976be6ecf9f2c55c82ab155d406f6f1", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8719052744886975, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction solve(n) {\n\tif (n < 2) return 0;\n\treturn 2 + solve(n - 2);\n}\n\nfunction main() {\n\tlet n = readLine() >> 0;\n\tlet r = solve(n);\n\n\tif ((n & 1) === 1) {\n\t\tconsole.log(0);\n\t} else {\n\t\tconsole.log(r);\n\t}\n}\n", "lang": "Node.js", "bug_code_uid": "08f845ee44aeb3afc7a268b780dc3d58", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "42850d8bd447dc203c8285d7563baf93", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.4017403915881073, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n const [n, m, k] = d.split(' ').map(Number);\n let inc = 1;\n const matrix = new Array(n).fill(0).map(x => new Array(m).fill(0)).map(row => row.map(col => {\n const pair = [inc, inc+1];\n inc += 2;\n return pair;\n }));\n\n let x, y;\n isDone :{\n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix[i].length; j++) {\n for (let z = 0; z < matrix[i][j].length; z++) {\n if (matrix[i][j][z] === k) {\n x = i + 1;\n y = j + 1;\n break isDone;\n }\n }\n }\n }\n }\n\n console.log(x, y, k % 2 ? 'L' : 'R');\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "a39ed5f02ec857e5b9e0680d942230de", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "fd2275cf0a3935bbda27c6266ec63cc6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8820960698689956, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "let data = '';\nprocess.stdin.on('data',c => data += c);\nconst solution = () => {\n\tlet [n, k, m] = data.split(' ').map(v => parseInt(v, 10));\n\tlet r = Math.trunc(m / (2 * k)) + (((m%(2*k)) > 0)?1:0);\n\tlet d = Math.trunc((m%(2 * k))/ 2) + (((m%(2 * k))%2 > 0)?1:0);\n\tlet v = (m%2 === 0)?\"R\":\"L\";\n\tconsole.log(`${r} ${d} ${v}`);\n};\n\nprocess.stdin.on('end', solution);", "lang": "Node.js", "bug_code_uid": "d2f41a7c94d42671a987fbdb5adfa24c", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "d3c371bc779e9fe611ac4b96dc25fee8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5418933623503809, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let n = +d;\n const arr = ['D', 'A', 'C', 'B'];\n\n if (n % 4 === 3 || n % 4 === 1) {\n console.log(0, arr[n % 4]);\n }\n else {\n console.log(1, arr[(n + 1) % 4]);\n }\n});\n", "lang": "Node.js", "bug_code_uid": "dfb78f4f6295b6858df0abcfb6ed3b32", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "af9a8f1fd3231ceba67e8c42afc67c31", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.998019801980198, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "//1191A\n\nconst readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nfunction rankHP(currentHP){\n if(currentHP % 4 == 1){\n return(1);\n } else if(currentHP % 4 == 3) {\n return(3);\n } else if (currentHP % 4 == 2) {\n return(2);\n } else if (currentHP % 4 == 0) {\n return(0);\n }\n}\n\nfunction rankAchievedToLetter(rankAchieved){\n if(rankAchieved == 1){\n return(' A');\n } else if(rankAchieved == 3) {\n return(' B');\n } else if (rankAchieved == 2) {\n return(' C');\n } else if (rankAchieved == 0) {\n return(' D');\n }\n}\n\nfunction getResult(hp){\n let ranks = [0,0,0];\n let rankAchieved = rankHP(hp);\n if (rankAchieved == '1'){\n return 0 + rankAchievedToLetter(rankAchieved);\n } else {\n ranks = [rankAchieved, rankHP(hp+1), rankHP(hp+2)];\n //console.log(ranks);\n if (ranks.includes(1)){\n obama = rankHP(ranks[ranks.indexOf(1)]);\n //console.log(obama);\n return (hp+ranks.indexOf(1)) + rankAchievedToLetter(obama);\n } else {\n obama = ranks[ranks.indexOf(Math.max(...ranks))];\n //console.log(obama);\n return (hp+ranks.indexOf(Math.max(...ranks))) + rankAchievedToLetter(obama);\n };\n \n };\n};\n\nrl.question('', (answer) => {\n hp = answer;\n //console.log('hp', hp, typeof hp);\n console.log(getResult(parseInt(hp)));\n process.exit();\n});", "lang": "Node.js", "bug_code_uid": "69a31ce9949e3620031310e0a7368942", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "06206309ef6463caf82531213b95d64d", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9740791268758526, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "let readline = require('readline');\nlet intInput = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\nlet arr;\n\nintInput.on('line', (line) => {\n\tarr = line.split(\" \")\n});\nintInput.on('close', () => {\n\tlet result = 'NO';\n\tlet [memb, pen, note] = arr;\n\tif ( pen >= memb && note >= memb ) {\n\t\tresult = 'YES'\n\t}\n\tconsole.log(result);\n})", "lang": "Node.js", "bug_code_uid": "8a6a3abc6624e4cf314f93a7c1af96bd", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "bad35a1c5f275d53fc05c050f4ef0468", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9692496924969249, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "const black = 'B';\nconst white = 'W';\n\nfunction is_row_all_black(row) {\n for (const sqr of row) {\n if (sqr === black) {\n // do nothing ...\n } else {\n return false;\n }\n }\n return true;\n}\n\nfunction is_column_all_black(rows, i) {\n for (const row of rows) {\n const sqr = row[i];\n if (sqr === black) {\n // do nothing ...\n } else {\n return false;\n }\n }\n return true;\n}\n\nfunction solve(rows) {\n let result = 0;\n for (const row of rows) {\n result = result + (is_row_all_black(row) ? 1 : 0);\n }\n for (let i = 0; i < rows.length; i = i + 1) {\n result = result + (is_column_all_black(rows, i) ? 1 : 0);\n }\n return result;\n};\n\nfunction main(lines) {\n const rows = [];\n for (const line of lines) {\n const t = line.trim();\n if (t.length > 0) {\n rows.push(t);\n }\n }\n const result = solve(rows);\n console.log(result);\n};\n\nasync function processLinesFromStream(rs, pf) {\n const content = [];\n rs.setEncoding(\"utf-8\");\n for await (let chunk of rs) {\n content.push(chunk);\n }\n const lines = content.join('').split(/\\n/);\n const result = pf(lines);\n return result;\n};\n\nprocessLinesFromStream(process.stdin, main);\n", "lang": "Node.js", "bug_code_uid": "0a2e56ce9ad1285e0e7125b144988d7b", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "073b1a0b39792d0c0fcb78da34e93def", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.15514592933947774, "equal_cnt": 21, "replace_cnt": 16, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "const readline = require('readline');\n\nconst cl = readline.createInterface( process.stdin, process.stdout );\nfunction question(q='') {\n return new Promise( (res, rej) => {\n cl.question( q, answer => {\n res(answer);\n })\n });\n};\n\n(async function main() {\n const numberLines = 8;\n const input = [];\n for (let i = 0; i < numberLines; i++) {\n // console.log('Asking');\n input.push(await question(''));\n // console.log(input, i)\n }\n const result = solve(input);\n process.stdout.write(result.toString());\n})();\n\nfunction solve(input) {\n // console.log('asdasa',input);\n const arr = input.map(row => row.trim().split(''));\n let counter = 0;\n const row = arr.find(r => r.some(i => i === 'W'));\n // console.log(row);\n if (row) row.forEach(i => i === 'B' && counter++);\n // console.log(counter);\n counter += arr.filter(row => row.every(i => i === 'B')).length;\n // console.log(arr);\n // console.log(arr.filter(row => row.every(i => i === 'B')))\n return counter;\n}", "lang": "Node.js", "bug_code_uid": "03586229cadbf1eed5f6d37c2f08849d", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "e9817dd51b0bf2ca1076ac6305b1b4b4", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8867082961641392, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar n = 8;\nvar answer = 0;\nvar counter = 0;\nvar check = true;\n\nrl.on(\"line\", input => {\n if (n > 0) {\n counter = 0;\n for (var i = 0; i < input.length; i++) {\n \n if (input[i] == \"B\") {\n counter++;\n }\n }\n\n if (counter == 8) {\n answer++;\n } \n else if (check && counter > 0) {\n answer += counter;\n check = false;\n }\n n--;\n }\n else \n {\n console.log(answer);\n rl.close();\n }\n\n \n});\n", "lang": "Node.js", "bug_code_uid": "e84f7fb33d67ebeb25252a03dc4ad98c", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "7fe1edba5fca5187e2bb360b1cf8e071", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9251844046364595, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\nvar answer = 0;\nvar counter = 0;\nvar check = true;\n\nrl.on(\"line\", input => {\n \n counter = (input.match(/B/g)).length;\n \n\n if (counter == 8) {\n answer++;\n } \n else if (check && counter > 0) {\n answer += counter;\n check = false;\n }\n \n\n \n}).on(\"close\", () => {\n console.log(answer);\n });\n", "lang": "Node.js", "bug_code_uid": "06dc62d596057616939ad0780ef48d67", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "7fe1edba5fca5187e2bb360b1cf8e071", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9133537206931702, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar ans = 0,\n metColumn = false;\n\n\nrl.on('line', (s) => {\n\n if (s == 'BBBBBBBB') \n ans++;\n else if (!metColumn) {\n //console.log(\"inside else if metColumn= &s\",metColumn)\n ans += s.search(/B/);\n metColumn = true;\n }\n\n}).on('close', () => {\n console.log(ans);\n rl.close();\n\n\n});", "lang": "Node.js", "bug_code_uid": "e945a85b1a563fc65fa4699d8202949e", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "f1f63f968116faf75881bce94883930e", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9352226720647774, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar ans = 0,\n metColumn = false;\n\n\nrl.on('line', (s) => {\n\n if (s == 'BBBBBBBB') \n ans++;\n else if (!metColumn) {\n //console.log(\"inside else if metColumn= &s\",metColumn)\n ans += s.match(/B/g).length;\n metColumn = true;\n }\n\n}).on('close', () => {\n console.log(ans);\n rl.close();\n\n\n});", "lang": "Node.js", "bug_code_uid": "3d70ff9ca38e0ddbfef9aca80c31216e", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "f1f63f968116faf75881bce94883930e", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9714285714285714, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet n, s;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n [n, s] = d.split(' ').map(Number);\n return;\n }\n\n const arr = d.split(' ').map(Number);\n let amount = 0;\n\n for (let i = 0; i < n - 1; i++) {\n amount += arr[i];\n }\n\n if (amount > s) {\n console.log('NO');\n }\n else {\n console.log('YES');\n }\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "6979fa95d23ec28d2c39fe5d367dce6a", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "aca06d141a831f8f97897f73ea05e0a2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9961904761904762, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet count = 0;\n\nrl.on('line', (data) => {\n let [a, b, c, d] = data.split(' ').map(Number);\n let p1Points = Math.max(a/10, a - (a / 250) * c);\n let p2Points = Math.max(b/10, b - (b / 250) * d);\n\n if (p1Points === p2Points) {\n console.log('Tie');\n }\n else if (p1Points > p2Points) {\n console.log('Misha');\n }\n else {\n console.log('Vasya');\n }\n\n count++;\n});\n", "lang": "Node.js", "bug_code_uid": "8de6f74102f8e581409a8483e1b64af3", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "c5af5561dbbae4777c0cfeb34b07ccd6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9108647450110865, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++].split(' ');\n}\n\nfunction readInt(s) {\n return parseInt(s, 10);\n}\n\nfunction readIntArray(a) {\n return a.map(e => parseInt(e, 10));\n}\n\nfunction solve(n, ar) {\n ar.sort((a, b) => a - b);\n let ans = (ar[n - 1] - ar[0]) % 2 === 0 ? (ar[n - 1] - ar[0]) / 2 : -1;\n for (let i = 0; i < n; i++) {\n if (ar[i] !== ar[0] && ar[i] !== ar[n - 1] && ar[i] !== ar[0] + ans) ans = -1;\n }\n return ans;\n}\n\nfunction main() {\n\n const nk = readLine();\n\n const n = readInt(nk[0]);\n const a = readIntArray(readLine());\n\n let result = solve(n, a);\n console.log(result);\n}\n", "lang": "Node.js", "bug_code_uid": "5cf6c3dfcc3448537cb1f3af3694b443", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "9bc704818557410c9e7a27af305a469c", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5207547169811321, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 13, "bug_source_code": "var readline = require('readline-sync');\na = [];\nx = readline.question('');\na1 = x.split(' ');\nfor (var i = 0; i < a1.length; i++) {\n a.push(Number(a1[i]));\n}\na.sort((a,b) => {\n return a-b;\n});\n\nif ((a[0] + a[3] == a[1] + a[2]) || (a[0] + a[1] + a[2] == a[3])) {\n console.log('YES');\n}\nelse \n console.log('NO');\n", "lang": "Node.js", "bug_code_uid": "86f7725cae8c41f724ae1d1e27309655", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "7e482b6f003483a2d3b7e03fcf4626ee", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5452674897119342, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const arr = d.split(' ').map(Number).sort((a, b) => a - b);\n const ans = arr[0] + arr[3] === arr[1] + arr[2];\n\n if (ans) {\n console.log('YES');\n }\n else {\n console.log('NO');\n }\n});\n", "lang": "Node.js", "bug_code_uid": "4c3203ae6e480ccf9ce87936c96b33a1", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "5e56884aacb5531ebbf6aba3bfb1e40f", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5411991022763706, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "/*\n* У Давида есть четыре мешка с конфетами. В i-м из них лежит ai\n* конфет. Также у Давида есть два друга. Он хочет отдать каждый мешок одному из двух друзей.\n* Возможно ли так распределить мешки, чтобы два друга получили одинаковое общее число конфет?\n* Обратите внимание, что вы не можете оставить мешки себе или выбросить их,\n* каждый мешок должен быть отдан одному из двух друзей.\n* Входные данные:\n* В первой строке записаны четыре целых числа a1, a2, a3 и a4 (1 ≤ ai ≤ 100) — количества конфет в каждом мешке.\n* Пример входных данных: 1 7 11 5\n* Выходные данные:\n* Выведите YES || NO\n*/\n\nvar readline = require('readline');\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', function(line){\n var candies = line.split(\" \");\n var sum = 0;\n candies.forEach(function (elem) {\n sum = sum + parseInt(elem);\n });\n console.log((sum % 2) ? 'NO': 'YES');\n});", "lang": "Node.js", "bug_code_uid": "911d24e842e71b16bba68671e18d6400", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "b522186df12a99dec34ba2574a965101", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8637316561844863, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const n = +d;\n console.log(1);\n});\n", "lang": "Node.js", "bug_code_uid": "b0fb9dea461c0d132974ec1ff2fbb8bf", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "c6515a2f8eb2b2610de2101db9c35d90", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9465648854961832, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet max;\nlet arr1, arr2;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n max = +d;\n return;\n }\n\n if (c === 1) {\n arr1 = d.split(' ').map(Number);\n c++;\n return;\n }\n\n arr2 = d.split(' ').map(Number);\n\n c++;\n});\n\nrl.on('close', () => {\n let common = 0;\n\n for (let i = 0; i < arr1.length; i++) {\n common += arr1[i] && arr2[i];\n }\n\n let sum1 = arr1.reduce((a, x) => a + x, 0) - common;\n let sum2 = arr2.reduce((a, x) => a + x, 0) - common;\n let ans = sum1 > sum2 ? 1 : -1;\n\n for (let i = 2; i <= max; i++) {\n if (sum1 * i > sum2) {\n ans = i;\n break;\n }\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "ec31860c1e0add0ae153497aa370672d", "src_uid": "b62338bff0cbb4df4e5e27e1a3ffaa07", "apr_id": "e805764add146c3d27e9fd8dec608526", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9985528219971056, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const processData = (lines) => {\n const k = lines[1].split(' ').map(x => +x)\n const l = lines[2].split(' ').map(x => +x)\n let diff = [0, 0]\n for (let i =0; i i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n processData(lines)\n})\n", "lang": "Node.js", "bug_code_uid": "d41b99f2b0f3fe3a82f89c433dc9a33f", "src_uid": "b62338bff0cbb4df4e5e27e1a3ffaa07", "apr_id": "bbab147b2398cd7548e35b4ad757c4c0", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9229583975346687, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "function main(rawInput) {\n var lines = rawInput.trim().split(\"\\n\").map(function (v) { return v.trim().split(\" \").map(function (u) { return parseInt(u, 10); }); });\n var n = lines.shift()[0];\n var ra = lines.shift();\n var rb = lines.shift();\n var sca = 0;\n var scb = 0;\n var unqa = 0;\n for (var i = 0; i < n; i++) {\n if (ra[i] == 1) {\n sca++;\n }\n if (rb[i] == 1) {\n scb++;\n }\n if (ra[i] > rb[i]) {\n unqa++;\n }\n }\n // console.error(sca, scb, unqa);\n if (sca > scb) {\n console.log(1);\n }\n else if (unqa > 0) {\n var ned = Math.ceil((scb - (sca - unqa)) / unqa) + 1;\n console.log(ned);\n }\n else {\n console.log(-1);\n }\n // console.log('----')\n}\n// main(`5\n// 1 1 1 0 0\n// 0 1 1 1 1`);\n// main(`3\n// 0 0 0\n// 0 0 0`);\n// main(`4\n// 1 1 1 1\n// 1 1 1 1`);\n// main(\n// `9\n// 1 0 0 0 0 0 0 0 1\n// 0 1 1 0 1 1 1 1 0`\n// );\n// main(`2\n// 1 1\n// 1 0`);\n// main(`3\n// 0 1 1\n// 1 0 0`);\n// main(`7\n// 0 1 1 1 0 1 1\n// 1 0 1 1 1 1 1`);\n(function () {\n var d = \"\";\n process.stdin.on(\"data\", function (v) { return d += v; });\n process.stdin.on(\"end\", function () { return main(d); });\n})();\n", "lang": "Node.js", "bug_code_uid": "34e0feff9c9510262e2a83e1d729763c", "src_uid": "b62338bff0cbb4df4e5e27e1a3ffaa07", "apr_id": "1137a3a7d22e6550af3da6118a5c026d", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9649122807017544, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "let input = [];\n \nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n\nRL.on('line', (line) => {\n input.push(line);\n});\n\n\nRL.on('close', () => {\n let {0:a, 1:b, 2:c} = {...input[0].split(' ')};\n a = parseInt(a); b = parseInt(b); c = parseInt(c);\n\n if(Math.abs(a - b) <= 1) {\n console.log(a + b + (c*2));\n } else {\n console.log(a + b + (c*2) - Math.abs(a-b-1));\n }\n});\n\n", "lang": "Node.js", "bug_code_uid": "6341e0f0bca4cfe4bd98d9808bd2a7a3", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "8fbc0c6770997b519f3b81491b5406f9", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9374208259437548, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "'use strict';\n// 9- 8- 8- 7- 7- 7- 7- 7- 7- 6- 5- 3- 2- 2- 2 2- 2- 2 1- 1- 1 0- 0-\n\n// 7 4 2 - - - - - \n// value = 3\n// arr[minIndx] = 4\n// min = 1\n// 4 - - -\n\n// 9 8 8 7 6 5 4 2 1 0\n// 7 7 7 2 1 0\n// 7 7 2 2 1 \n// 1 1\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet arr = []\nlet input = []\nlet n;\nvar readline = require('readline')\n\nprocess.stdin.on('data', inputStdin => {\n input += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n input = input.trim().split('\\n').map(string => {\n return string.trim();\n });\n n = input[0]\n arr = input[1].split(\" \")\n arr = arr.map(s=>parseInt(s))\n main(); \n});\nfunction main() {\n // console.log(\"len\",arr.length)\n let visted = {};\n arr.sort();\n arr.reverse();\n function findMinDifference(value) {\n let min = 100000000;\n let minIndex;\n for (let i = 0; i < arr.length; i++) {\n if (visted[i]) continue;\n if (Math.abs(arr[i] - value) < min ) {\n min = Math.abs(arr[i] - value);\n minIndex = i;\n }\n }\n visted[minIndex] = true;\n return arr[minIndex];\n }\n let pils = 1;\n// console.log(\"arr\",arr)\n let boxesCanHold = arr[0]; // 9\n visted[0] = true;\n // console.log(\"will start with\",arr[0])\n\n for (let i = 0; i < arr.length; i++) {\n if (visted[i]) continue;\n if(boxesCanHold ==0){\n boxesCanHold = arr[i];\n visted[i] = true;\n ++pils;\n // console.log(\"will start with\",arr[i])\n }\n if(boxesCanHold!=0){\n let nextStrength = findMinDifference(boxesCanHold-1);\n boxesCanHold = nextStrength >= boxesCanHold ? --boxesCanHold : nextStrength; \n // console.log(nextStrength,\" \",boxesCanHold)\n }\n boxesCanHold = boxesCanHold < 0 ? 0 : boxesCanHold;\n if (boxesCanHold == 0 && Object.keys(visted).length != arr.length) {\n // console.log(\"here\")\n i = 0;\n }\n if(i == arr.length-1 && Object.keys(visted).length != arr.length){\n \n }\n i = 0;\n\n }\n console.log(pils );\n\n}\n", "lang": "Node.js", "bug_code_uid": "e441474e1e2a2c4cc7929d879334b598", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "525c07e618c28213202834a73a422b0f", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.976303317535545, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\n\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question('', (answer) => {\n // TODO: Log the answer in a database\n\n check(answer);\n\n rl.close();\n});\n\nfunction check(x) {\n var arr = x.split(\" \");\n let F = arr[0];\n let S = arr[1];\n let counter = 0;\n \n \n \n while (F <= S) {\n \n\n for (let k in arr) {\n if (k == 0) {\n F = F * 3;\n }\n\n if (k == 1) {\n S = S * 2;\n }\n\n }\n counter++;\n }\n\nconsole.log(counter);\n\n\n}", "lang": "Node.js", "bug_code_uid": "f05937206547f75e9f988f26fad2924d", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "9419bb5527cd3d079ea203b28666f39a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.948780487804878, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n// CODE HERE\n\tlet [a, b] = input[0].split(' ').map(x => +x);\n\tfor(let i = 1; i > 0; i++){\n a = 3*a;\n b = 2*b;\n if ( a > b){\n return i;\n }\n }\n});", "lang": "Node.js", "bug_code_uid": "5f7ca76fa365e526f679de3658a2ae56", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "4a94bf76e52a8955854433b4f6fa2d4f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9640883977900553, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let lines = [];\nrequire('readline').createInterface({input: process.stdin,output: process.stdout})\n\t\t\t\t.on('line', line => {lines.push(line);})\n\t\t\t\t.on('close', () => {console.log(main(lines));});\n\nconst main = (input) => {\n\tlet [a, b] = input[0].split(\" \");\n\tlet counter = 0;\n\twhile (a <= b) {\n\t\tcounter++;\n\t\ta *= 3;\n\t\tb *= 2;\n\t}\n\treturn counter;\n}", "lang": "Node.js", "bug_code_uid": "767808d0f3c702fe76e26ad3f4789025", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "e2c6b7e5215e32ef3f9f4a39387f71cd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9458762886597938, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet limak = 0;\nlet bob = 0;\nlet years = 0;\nrl.on(\"line\",(input)=>{\n limak = input.split(\" \")[0]\n bob = input.split(\" \")[1]\n while(limak<=bob){\n bob*=2\n limak*=3\n years++\n }\n console.log(years)\n rl.close();\n})", "lang": "Node.js", "bug_code_uid": "d17fc8da0064a2c2655cf1c3861319d0", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "4bfb07e9e2d12ac5477e095d65f13a99", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9751750477402928, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n const x = readline().split(\" \");\n \n bearAndBigBrother(x[0],x[1]);\n }\n \nfunction bearAndBigBrother(a, b) {\n let counter = 0;\n\n while (a <= b) {\n a *= 3;\n b *= 2;\n counter++;\n }\n \n console.log(counter)\n\n return counter;\n}\n", "lang": "Node.js", "bug_code_uid": "0c056378ee98948cba980b857bb9f667", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "99960b79b81220931785746f4c79c77a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9660942316160281, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "var line_number = 0;\nconst cs = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nvar lines = {};\ncs.on(\"line\", (input) => {\n if (input == \"\") {\n cs.close();\n }\n lines[line_number] = input.split(\" \");\n line_number += 1;\n}).on(\"close\", () => {\n main();\n process.exit();\n});\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/);\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}\nfunction isInt(str) {\n return str.length === 1 && str.match(/[0-9*]/);\n}\n\nfunction print(str) {\n console.log(str);\n}\n\nfunction exit(status = 0) {\n process.exit(status);\n}\n\nfunction predict(test) {\n let op = \"\";\n let ops = [];\n let opVariables = [];\n let limits = [];\n for (let t of test) {\n // console.log(t);\n for (let i = 0; i < t.length; i++) {\n if (isOp(t[i])) {\n op = t[i];\n if (isOp(t[i + 1])) {\n op += t[i + 1];\n i += 1;\n }\n ops.push(op);\n op = \"\";\n } else if (isChr(t[i])) {\n // console.log(t[i])\n op = t[i];\n for (var j = i + 1; j < t.length; j++) {\n if (isChr(t[j]) || isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n opVariables.push(op);\n op = \"\";\n } else {\n if (i == 0 || (i > 0 && isOp(t[i - 1]))) {\n op = t[i];\n let j = i + 1;\n for (; j < t.length; j++) {\n if (isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n limits.push(op);\n op = \"\";\n }\n }\n }\n }\n\n let min = limits[0];\n let max = limits[1];\n\n let pvs = ops.map((o, i) => [o, opVariables[i]]);\n\n for (let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max;\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1];\n } else {\n print(\"input error\");\n exit();\n }\n }\n}\n\nvar a,b;\nfunction main() {\n [a,b] = lines[0].map(x => parseInt(x))\n predict([\"1<=a<=b<=10\"])\n let years = 0\n for (;;years++) {\n if (a <= b ){\n a += a*3\n b += b*2\n continue;\n }\n else break;\n }\n print(years)\n}\n", "lang": "Node.js", "bug_code_uid": "4665eab7216d2c84019faefcd348e6fa", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "80b4091b81171829fbb899271666d4e3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9458413926499033, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\nasync function getData() {\n\treturn new Promise((res,rej)=>{\n\t\trl.question('',answer=>res(answer))\t\n\t})\n\t\n}\nfunction counted(limak,bob){\n\tlet years = 0\n\t\n\twhile(limak <= bob){\n\n\t\tyears++\n\t\tlimak *= 3\n\t\tbob *= 2\n\t\t\n\t}\n\tconsole.info(years)\n}\n\nasync function main(){\n\n\tlet data = await getData()\n\trl.close()\n\tdata = data.trim().split(' ')\n\n\tcounted(...data)\n}\n\nmain()", "lang": "Node.js", "bug_code_uid": "01fe9a02d16db8b8bd16ef849641afba", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "b801eaec6aebd43af46423346265ed94", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8982898289828983, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "// http://codeforces.com/problemset/problem/977/A\nmodule.exports = solve;\nfunction solve(line) {\n const [a, b] = line.split(' ').map(n => Number.parseInt(n, 10));\n // console.log(line, a, b);\n return Math.ceil(Math.log2(b / a) / Math.log2(3 / 2)) + 1;\n}\n\n\nconst rl = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nlet i = 1;\nrl.on('line', (line) => {\n if (i++) {\n console.log(solve(line))\n rl.close();\n }\n});", "lang": "Node.js", "bug_code_uid": "1eaf58a185bc1eed6a8208b20dcfbd21", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "a7f496b1a9300b4382cb1fe1dd7d7a8c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9985272459499264, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\n\nrl.on('line', (d) => {\n let [a, b] = d.split(' ').map(Number);\n let ans = 0;\n\n while (a < b) {\n a *= 3;\n b *= 2;\n ans++;\n }\n\n console.log(ans);\n});", "lang": "Node.js", "bug_code_uid": "f88b6522b678878bb93d1886c248ba41", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "47e2196c6d46c90a1ba3d21f23fe060d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9597523219814241, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n input: process.stdin\n})\n\nrl.on('line', line => {\n const [a, b] = line.split(' ')\n console.log(solve(a, b))\n})\n\nfunction solve(a, b) {\n let years = 0\n \n while (a <= b) {\n a *= 3\n b *= 2\n years++\n }\n \n return years\n}\n", "lang": "Node.js", "bug_code_uid": "275542d84c37dbcc9490438448250b65", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "2213ad8b036c2100dd1798a80592d4c4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8775790921595599, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin\n});\n\nrl.on('line', function(line){\n const sp = line.split(' ');\n let lcw = sp[0];\n let bcw = sp[1];\n let y = 0;\n\n while (bcw > lcw) {\n y++;\n lcw *= 3;\n bcw *= 2;\n }\n\n console.log(y);\n});", "lang": "Node.js", "bug_code_uid": "c8453a28bb284c3ea80a4748a71e6aa9", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "5ae109ff8d7a797e29e01bc2b69b50f7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8106666666666666, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadline.on('line', line => input.push(line));\n\nreadline.on('close', () => {\n const [m, l] = Array.from(input[0].split(' '), x => parseInt(x));\n let x = Math.round((m + l) / 5);\n x = x > 0 ? x : 1;\n console.log(x);\n});", "lang": "Node.js", "bug_code_uid": "eff0b7f92f1efdf53ebad2f5f92fa1de", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "f0778eb9b52f15563854f1a0fde8ae2f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9462102689486552, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "var input='';\n\nprocess.stdin.on('data',givenInput=>{\n input+=givenInput;\n});\n\nprocess.stdin.on('end',()=>{\n main(input);\n});\n\nconst main=(input)=>{\n let limak=input.split(' ')[0];\n let bob=input.split(' ')[1];\n let count=0;\n \n while(true){\n if(limak>bob){\n break;\n }\n limak*=3;\n bob*=2;\n count++;\n }\n \n console.log(count);\n};", "lang": "Node.js", "bug_code_uid": "757b63fd8c652047a02d124e20a6137a", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "0bf927dcd41982b9b10b98251890b970", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6780735107731305, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let n = parseInt(readLine(), 10);\n let ans = 0;\n let passInside = 0;\n for (let i = 0; i < n; i++) {\n let arr = readLine()\n .split(' ')\n .map(value => parseInt(value));\n\n passInside = passInside - arr[0] + arr[1];\n if (passInside > ans) {\n ans = passInside;\n }\n }\n console.log(ans);\n}", "lang": "Node.js", "bug_code_uid": "38749e45250d604c5ee015913029557d", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "01c172854f50f39842c727d107f1fc98", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8742791234140715, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "'use strict';\n\nconst readline = require('readline');\n\nlet lines = [];\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\nrl.on('line', (line) => {\n lines.push(line);\n});\n\n\n\nrl.on('close', (cmd) => {\n let arr = lines[0].split(' ').map(Number);\n let ret = 0;\n while (3 * arr[0]++ < 2 * arr[1]++) { ++ret; }\n console.log(ret);\n process.exit(0);\n\n});\n", "lang": "Node.js", "bug_code_uid": "04f5545f0fe2b12bc4fcee8346593f2c", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "92b4f37bc709f42a0989cbc72429e61f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.925, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question('', (answer) => {\n const argumentArray = answer.split(' ');\n let bearWeight = argumentArray[0];\n let brotherWeight = argumentArray[1];\n let year = 0;\n\n while(brotherWeight >= bearWeight) {\n bearWeight *= 3;\n brotherWeight *= 2;\n year++;\n }\n\n console.log(year);\n\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "050a22cd0ec0c69c27b4193a62709b4d", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "318ba142e6904a7d9d88af9dbbe3e570", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.4761441090555015, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "function pangram(stringLength, word) {\n\n let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');\n let stringToMap = {};\n let occurance = {};\n word = word.toLowerCase();\n\n for (let index = 0; index < stringLength; index++) {\n stringToMap[word[index]] = 1;\n }\n\n for (let index = 0; index < alphabet.length; index++) {\n if (stringToMap[alphabet[index]])\n occurance[alphabet[index]] = 1\n }\n \n if(Object.keys(occurance).length == alphabet.length)\n return 'YES';\n\n return 'NO';\n}", "lang": "Node.js", "bug_code_uid": "6dd1bde6c07936aea8b48b4b00c1aad2", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "00c71dc686c48ba4550dd0fd0d591ce8", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9957805907172996, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "function solve(n, str) {\n str = str.toLowerCase();\n let m = {};\n for (let c = 'a'.charCodeAt(0); c <= 'z'.charCodeAt(0); c++) {\n m[c] = false;\n }\n str.split('').forEach(letter => {\n m[letter.charCodeAt(0)] = true;\n });\n for (var key in m) {\n if (m.hasOwnProperty(key) && m[key] === false) {\n return \"NO\\n\";\n }\n }\n return \"OK\\n\";\n}\n\nlet i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os');\n const lines = i.split(EOL);\n console.log(solve(lines[0], lines[1]));\n})\n\n", "lang": "Node.js", "bug_code_uid": "e7baf2f0ab0729190d19b1e28d36b1e9", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "9a3754e063644c04197a545f20d14639", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8622192423734496, "equal_cnt": 20, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 19, "bug_source_code": "function main(input) {\n \n let a,c,d =[];\n let l,i=1,v=1;\n input =input.split(/\\n/g);\n a = input[0].split('');\n //console.log(a);\n l = a.length;\n \n \n c=first(Number(a[2]),Number(a[4]));\n d=second(Number(a[6]),Number(a[8]),Number(a[0]));\n l=c.length\n \n while(i1){\n t++;\n y[t]=--b;\n }\n else{\n b=d;\n }\n }\n return y;\n}\n\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\n", "lang": "Node.js", "bug_code_uid": "4bacf55f894f11fd5564943538dce13a", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "323b1c6bd497f25022dd25650ef608c4", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9265885256014805, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "function main(input) {\n \n let a,b,c,d =[];\n let l,i=1,v=1;\n input =input.split(/\\n/g);\n a = input[0].split(' ');\n l = a.length;\n \n \n c=first(Number(a[1]),Number(a[2]),Number(a[0]));\n d=second(Number(a[3]),Number(a[4]),Number(a[0]));\n l=c.length\n \n while(i1){\n t++;\n y[t]=--b;\n }\n else if(b!=d){\n b=d;\n y[++t]=b;\n }\n else{\n \n }\n }\n return y;\n}\n\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\n", "lang": "Node.js", "bug_code_uid": "503b1a8644add447d10664f94a2b69f3", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "323b1c6bd497f25022dd25650ef608c4", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5615501519756839, "equal_cnt": 36, "replace_cnt": 18, "delete_cnt": 11, "insert_cnt": 8, "fix_ops_cnt": 37, "bug_source_code": "\n\nfunction main(input) {\n \n // console.log(input,\"ii\");\n input =input.split(/\\n/g);\n a = input[0].split(' ');\n // l = a.length;\n let n = a[0];\n let a = a[1];\n let x= a[2];\n let b = a[3];\n let y = a[4];\n var print = \"NO\";\n let min = Math.min(parseInt(x-a),parseInt(y-b),parseInt(n));\n for(let i =0;i<= min;i++){\n if(a==b){\n // console.log();\n print = \"YES\";\n break;\n } else {\n a++;\n b--;\n }\n }\n console.log(print);\n \n \n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\n\n\n", "lang": "Node.js", "bug_code_uid": "e4cb75218b890b7088edc80652e33f9a", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "0986fc2b6c3779a70f338c1f9d3ce103", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.992609437180216, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "function main(input) {\n\n // console.log(input,\"ii\");\n input =input.split(/\\n/g);\n let p = input[0].split(' ');\n // l = a.length;\n let n = parseInt(p[0]);\n let a = parseInt(p[1]);\n let x= parseInt(p[2]);\n let b = parseInt(p[3]);\n let y = parseInt(p[4]);\n var print = \"NO\";\n let gg =x;\n let ll =y;\n // if(b>y) {\n // ll = parseInt(b)-parseInt(y);\n // } else {\n // // ll = parseInt(y)+ parseInt(n) - parseInt(b) ;\n // ll = b + n - y -1;\n // }\n\n // if(a {\n return \n}\nconst VladNext = (curr, n) => {\n return (curr === 1) ? n : (n - 1);\n}\n\nlet z = '';\nprocess.stdin.on('data', c => z += c);\nprocess.stdin.on('end', () => {\n const {\n EOL\n } = require('os');\n let input = z.split(EOL)[0];\n input = input.split(' ').map(item => parseInt(item));\n while (true) {\n console.log(input[1],input[3])\n if (input[1] === input[3]) {\n console.log('YES');\n return 0;\n }\n if (input[1] === input[2] || input[3] === input[4]) {\n break;\n }\n\n input[3] = (input[3] === 1) ? input[0] : (input[3] - 1);\n input[1] = (input[1] === input[0]) ? 1 : (input[1] + 1);\n }\n if (input[1] === input[3])\n console.log('YES');\n else\n console.log('NO');\n\n\n\n\n});", "lang": "Node.js", "bug_code_uid": "13316b744688eca8b4cec0fd21a28e69", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "46a31bbc3418b4d9cd3d692a3b8ee666", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9988649262202043, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', (name) => {\n let newName = \"\"\n for(let i = 0; i < name.length; i++){\n if(newName.indexOf(name[i]) == -1){\n newName = newName + name[i]\n }\n }\n let message = newName.length % 2 == 0 ? \"CHAT WITH HER\" : \"IGNORE HIM!\"\n console.log(message)\n rl.close()\n});\n", "lang": "Node.js", "bug_code_uid": "a20f93a6877341c5b3c8deca440c3591", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "092c0f489a6b838cc95753ab283af76f", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.998165137614679, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () =>\n{\n // const nums = input[1].split(' ').map(x => parseInt(x));\n\n let myString = input[0];\n\n\n let bySet= new Set ()\n\nfor (let i = 0; i < myString.length; i++) {\n bySet.add (myString[i])\n \n}\n \n\n\n if (bySet.size()%2==0) {\n console.log('CHAT WITH HER!');\n \n }else {\n console.log('IGNORE HIM!')\n }\n\n});", "lang": "Node.js", "bug_code_uid": "47d42d9aedd3e316aea8e7d0d8b5ef10", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "8306b8d6f6b2bf7385cf8da274062399", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9977272727272727, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "var run = input => (input.split('').filter(function(item, i, ar){ return ar.indexOf(item) === i; }).join('').length % 2 == 0) ? 'CHAT WITH HER' : 'IGNORE HIM!';\n\nprocess.stdin.setEncoding('utf8');\n \nprocess.stdin.on('readable', () => {\n let input = process.stdin.read();\n input = input.trim();\n \n if (input !== null && typeof input != 'number') {\n process.stdout.write(run(input) + '\\n');\n }\n \n process.exit(0);\n \n});", "lang": "Node.js", "bug_code_uid": "42f9cb88027431cb523d415d21d3bbbb", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "d22e815ed3ff959ba78e4b34913c3743", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.99, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question(\"\", function (name) {\n var unique = name.split('').filter(function(item, i, ar){ return ar.indexOf(item) === i; }).join('');\n if (name.length % 2 === 0) {\n console.log(\"CHAT WITH HER!\")\n }\n else {\n console.log(\"IGNORE HIM!\")\n }\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "aab2396915587cde3d66c99edc9c3fd0", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "cffe1e1c58ea3bddc072d713ec1496c8", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9467455621301775, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline=require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n });\n \nreadline.question('enter the string you want', str=>{\n let arr=[];\n for(let i=0;i {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nconst readLine=()=> inputString[currentLine++];\n/* ================================================ \n Main Solution Starts Here \n===================================================*/\n\nconst main=()=>{\n\tlet counts={}\n\tlet userName=readLine()\n\tfor(let char of userName)\n\t\tif(counts[char]==undefined)\n\t\t\tcounts[char]=1\n\t\telse counts[char]++\n\n\tlet uc=0\n\tfor(let key in counts){\n\t\tif(counts[key]==1)\n\t\t\tuc++\n\t}\n\n\n\tif(uc%2==0)\n\t\tconsole.log('CHAT WITH HER!')\n\telse console.log('IGNORE HIM!')\n}", "lang": "Node.js", "bug_code_uid": "aa48fcd1aba667a16e69824520608e36", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "214b41fc998ec4784b46c404434ec978", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8949301983835415, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let s = readLine().split('');\n s = [...new Set(s)];\n let count = 0;\n for (let i = 0; i < s.length; i++) {\n if (s[i].charCodeAt(0) % 2 != 0) {\n count++;\n }\n }\n if (count % 2 == 0) {\n console.log('CHAT WITH HER!');\n } else console.log('IGNORE HIM!');\n}", "lang": "Node.js", "bug_code_uid": "56217c68a91d1205fac860d65bafb9a2", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "b86e3abd6515b369546218441b385d0b", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6217948717948718, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "// var num = readline().split(\" \").map(x => parseInt(x));\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet input = [];\nreadline.on('line', line => {\n input.push(line);\n});\nprocess.stdin.on('end', () => {\n const inp = input[0].split(' ');\n const max = Math.max(inp[0], inp[1]);\n let result;\n if (max === 1) {\n result = 1/1\n } else if (max === 6) {\n result = 0/1;\n } else {\n result = (max-1)/6\n }\n console.log(result);\n return result;\n});", "lang": "Node.js", "bug_code_uid": "af992c2f6ae3bcd1f14ffb7767e5b44c", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "55d5cfade5d7d74dc8fe8bedd52a58c8", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4521158129175947, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "// var num = readline().split(\" \").map(x => parseInt(x));\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet input = [];\nreadline.on('line', line => {\n input.push(line);\n});\n console.log({input})\n const max = Math.max(input[0][0], input[0][1]);\n let result;\n if (max === 1) {\n result = 1/1\n } else if (max === 6) {\n result = 0/1;\n } else {\n result = 6/(max-1)\n }\n console.log(result);\n return result;", "lang": "Node.js", "bug_code_uid": "27fbaa094f17c4a340f706d1b09c0f1f", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "55d5cfade5d7d74dc8fe8bedd52a58c8", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8712328767123287, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nfunction GCD(a, b) {\n if (b == 0) return a;\n return GCD(b, a % b);\n};\n\n\nrl.on('line', (input) => {\n var cont = input.split(' ').map(item => parseInt(item));\n var w = cont[0];\n var y = cont[1];\n var max = (w > y) ? w : y;\n var dot = 6 - max + 1;\n var temp = GCD(6, dot);\n console.log(dot / temp,\"/\", 6 / temp);\n\n}).on('close', () => {\n\n\n});", "lang": "Node.js", "bug_code_uid": "51d5407bae7ff38574e036965ffe79c4", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "20e099e651e5de15c4299da472bbdf66", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9550898203592815, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nrl.on('line', (input) => {\n rl.close();\n let numbers = input.split(' ').map(x=>parseInt(x))\n console.log(Math.min(Math.min(numbers[0],numbers[2]),numbers[1])*3)\n});\n", "lang": "Node.js", "bug_code_uid": "33d333a6a348824e81f98f557c1aed1c", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "97d78b68e22c1e4e284ecfbe0b1e63f9", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9940119760479041, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "var readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n input: process.stdout\n});\nvar a,b;\nvar expect = 'first_string';\nrl.on('line', function(line){\n if(expect == 'first_string'){\n a = line.toLowerCase();\n expect = 'second_string';\n }else { \n b = line.toLowerCase();\n console.log(a.localeCompare(b));\n process.exit(0);\n }\n});", "lang": "Node.js", "bug_code_uid": "4b0331f7376c242fdbf5d23103f40b67", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "e25eaf30283d5a881a452ab4b73f0547", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7385159010600707, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on( 'line', ( line )=>{\n rl.on( 'line', ( input )=>{ \n let flag = false;\n for(let i = 0; i < line.length; i+=1){\n if( input.toLowerCase().charCodeAt(i) > line.toLowerCase().charCodeAt(i) ){\n console.log(1);\n rl.close(); \n flag = true;\n break;\n }else if( input.toLowerCase().charCodeAt(i) < line.toLowerCase().charCodeAt(i) ){\n console.log(-1);\n rl.close();\n flag = true;\n break;\n }\n } \n //console.log(`Line: ${line} Input: ${input}`);\n flag || console.log(0);\n rl.close();\n });\n});", "lang": "Node.js", "bug_code_uid": "75feed01ec6986addaf126c0965c6c74", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "e88c5b4faf981cc61a4f0316cc4df2a2", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.3851286939942803, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\nreadline.question(\"\",(w1)=>{\n readline.question(\"\",(w2)=>{\n w1Total=0;\n w2Total=0;\n w1=w1.toUpperCase();\n w2=w2.toUpperCase();\n for (let i = 0; i < w1.length; i++) {\n w1Total+=w1.charCodeAt(i);\n }\n for (let i = 0; i < w1.length; i++) {\n w2Total+=w2.charCodeAt(i);\n }\n //w1Total==w2Total?console.log(0):w1Total>w2Total?console.log(1):console.log(-1);\n if(w1Totalw2Total)\n console.log(1)\n\n readline.close();\n })\n})", "lang": "Node.js", "bug_code_uid": "78fb25c5c08221981c31c93a712aeb5b", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "5aa1e374f2f1f710c3e22254171b1501", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4412017167381974, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', (_) => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((string) => {\n return string.trim();\n });\n\n driver();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction driver() {\n const a = readline();\n var b = readline();\n\n if (a === b) {\n console.log(0);\n } else if (a > b) {\n console.log(1);\n } else if (a < b) {\n console.log(-1);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "2e6437ea0ccf34c5bac94211f6aa6281", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "5b6963e4f0215232971ad9139e6ee20a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4966996699669967, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', (_) => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((string) => {\n return string.trim();\n });\n\n driver();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction driver() {\n const a = readline();\n var b = readline();\n\n a = a.toLowerCase();\n b = b.toLowerCase();\n\n if (a === b) {\n console.log(0);\n } else if (a > b) {\n console.log(1);\n } else if (a < b) {\n console.log(-1);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "e06e3da16b2136a52fcc99c3ac5e88a0", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "5b6963e4f0215232971ad9139e6ee20a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9160997732426304, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let str1 = readLine();\n let str2 = readLine();\n let [count1, count2] = [0, 0];\n const len = Math.max(str1.length, str2.length);\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n\n if (str1 === str2) {\n console.log(0);\n return;\n }\n\n str1 = str1.padEnd(len, \"A\");\n str2 = str2.padEnd(len, \"A\");\n\n str1 = str1.split(\"\").sort().join(\"\");\n str2 = str2.split(\"\").sort().join(\"\");\n\n for (let i = 0; i < len; i++) {\n if (str1[i] !== str2[i]) {\n count1 = str1[i].charCodeAt(0);\n count2 = str2[i].charCodeAt(0);\n break;\n }\n }\n\n if (count1 < count2) console.log(-1);\n else console.log(1);\n}\n", "lang": "Node.js", "bug_code_uid": "ea0b1c53a0aa34abaaf666cbdb280d6d", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "11e92611acc61c8f0490739088edcdda", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9984375, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet firstWord \nlet secondWord \nrl.on(\"line\",(input)=>{\n if(!firstWord) {\n firstWord = (input.split(\" \").toString()).toLowerCase();\n console.log(typeof(firstWord))\n }\n else {(!secondWord) \n secondWord = (input.split(\" \").toString()).toLowerCase();\n if(firstWord>secondWord) console.log(1)\n else if(firstWord {\n if (input == \"\") {\n cs.close();\n }\n lines[line_number] = input.split(\" \");\n line_number += 1;\n}).on(\"close\", () => {\n main();\n process.exit();\n});\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/);\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}\nfunction isInt(str) {\n return str.length === 1 && !isNaN(str);\n}\n\nfunction print(str) {\n console.log(str);\n}\n\nfunction predict(test) {\n let op = \"\";\n let ops = [];\n let opVariables = [];\n let limits = [];\n for (let t of test) {\n // console.log(t);\n for (let i = 0; i < t.length; i++) {\n if (isOp(t[i])) {\n op = t[i];\n if (isOp(t[i + 1])) {\n op += t[i + 1];\n i += 1;\n }\n ops.push(op);\n op = \"\";\n } else if (isChr(t[i])) {\n // console.log(t[i])\n op = t[i];\n for (var j = i + 1; j < t.length; j++) {\n if (isChr(t[j]) || isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n opVariables.push(op);\n op = \"\";\n } else {\n if (i == 0 || (i > 0 && isOp(t[i - 1]))) {\n op = t[i];\n let j = i + 1;\n for (; j < t.length; j++) {\n if (isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n limits.push(op);\n op = \"\";\n }\n }\n }\n }\n\n let min = limits[0];\n let max = limits[1];\n\n let pvs = ops.map((o, i) => [o, opVariables[i]]);\n\n for (let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max;\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1];\n } else {\n print(\"input error\");\n process.exit();\n }\n }\n}\n\nvar n;\nfunction main() {\n let str1 = lines[0][0];\n let str2 = lines[1][0].toLowerCase();\n if (str1 > str2)\n print(1)\n else if (str1 < str2)\n print(-1)\n else\n print(0)\n}\n", "lang": "Node.js", "bug_code_uid": "9b38df14e6884dff9486e93124150ba6", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "250ad5582fd01147f92add8267cdcc78", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9993597951344431, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\n\nlet inputs = [];\nconst chars = [\n 'a', 'b', 'c', 'd',\n 'e', 'f', 'g', 'h',\n 'i', 'j', 'k', 'l',\n 'm', 'n', 'o', 'b',\n 'q', 'r', 's', 't',\n 'u', 'v', 'w', 'x',\n 'y', 'z'\n];\n\n\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n inputs.push(lineInput);\n})\n\n\n// Excute algorithm\nrl.on('close', () => {\n let firstWord = inputs[0];\n let secondWord = inputs[1];\n\n recognize(firstWord, secondWord)\n\n})\n\n\n/*\n ****************************\n * Devide & Conquer functions\n ****************************\n */\n\n \n// Return the charcter position\nfunction charPosition(char) {\n let low = 0\n let high = chars.length - 1\n let mid = Math.floor((low + high) / 2)\n\n\n while (low <= high) {\n mid = Math.floor((low + high) / 2)\n if (chars.indexOf(char) > mid)\n low = mid + 1\n else if (chars.indexOf(char) < mid)\n high = mid - 1\n else\n return mid\n }\n\n return -1\n}\n\n// Recognize which one's order is greater than the other\nfunction recognize(fWord, sWord) {\n\n for (let i = 0; i < fWord.length; i++) {\n const char1 = fWord[i].toLowerCase();\n const char2 = sWord[i].toLowerCase();\n\n if (charPosition(char1) > charPosition(char2))\n return console.log(1);\n else if (charPosition(char1) < charPosition(char2))\n return console.log(-1);\n }\n\n\n return console.log(0)\n}\n\n", "lang": "Node.js", "bug_code_uid": "8c6107404459dda7642b426bac664832", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "3c7f879591b4838cc47ac53012413e07", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.40865384615384615, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "const readline = require('readline');\n\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n inputs.push(lineInput);\n})\n\n\n// Excute algorithm\nrl.on('close', () => {\n let firstWord = inputs[0];\n let secondWord = inputs[1];\n\n if (firstWord < secondWord)\n console.log(-1)\n else if (firstWord > secondWord)\n console.log(1)\n else\n console.log(0)\n\n})\n", "lang": "Node.js", "bug_code_uid": "620899d47842a6d46fa5a4eff7515b13", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "3c7f879591b4838cc47ac53012413e07", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7206572769953051, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', (firstLine) => {\n rl.on('line', (secondLine) => {\n const output = firstLine.toLowerCase() != secondLine.toLowerCase() ? -1 : 0\n console.log(output); \n rl.close();\n });\n});", "lang": "Node.js", "bug_code_uid": "a6b6054bfefe3180dd674962f19c9893", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "b39f7eefa0c5f4dedbe6ca9537396be3", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9696969696969697, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nconst input = [];\n\nrl.on('line', line => {\n input.push(line);\n});\n\nrl.on('close', () => {\n solution(input[0], input[1]);\n});\n\nfunction solution(first, second) {\n for (let i = 0; i < first.length; i++) {\n if (first[i].toLowerCase() > second[i].toLowerCase()) {\n console.log('1');\n return;\n } else if (first[i].toLowerCase() < second[i].toLowerCase()) {\n console.log('-1');\n return;\n }\n }\n\n console.log('0');\n return;\n}", "lang": "Node.js", "bug_code_uid": "0ef9869d0438974683161c8df3aebb0c", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "e4a07cd32138b8aa6b919b7a2e2a0855", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9853603603603603, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction print(s) {\n process.stdout.write(`${s}`);\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\nfunction main() {\n // input\n const a = readline();\n const b = readline();\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const c1 = a.charAt(i).toLowerCase();\n const c2 = b.charAt(i). toLowerCase();\n if (c1 < c2) {\n result = -1;\n }\n if (c1 > c2) {\n result = 1;\n }\n }\n // output\n print(result);\n}\n\n", "lang": "Node.js", "bug_code_uid": "dc23448f1b32bbacf6a20b92d9c20698", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "85386b91511476689cd68c3fcceddc7e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6349534643226473, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst strs = [];\n\nreadline.on('line', line => {\n strs.push(line);\n if (strs.length === 2) {\n let aSum = 0;\n let bSum = 0;\n for (let i = 0; i < strs[0].length; i++) {\n aSum += strs[0][i].toLowerCase().charCodeAt();\n bSum += strs[1][i].toLowerCase().charCodeAt();\n }\n if (aSum === bSum) {\n console.log(0);\n } else if (aSum < bSum) {\n console.log(-1);\n } else if (aSum > bSum) {\n console.log(1);\n }\n }\n});\n", "lang": "Node.js", "bug_code_uid": "5804c9929faa2e7397f0f1255dac580d", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "71414ca7f21b1c613195e948ea61d99a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9914435550648634, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "var read = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nvar obj;\nvar inLine = [];\nread.on('line', function (input) { inLine.push(input); });\nread.on('close', function () {\n obj = init(inLine);\n myerr(\"-----start-----\");\n var start = new Date();\n Main();\n var end = new Date() - start;\n myerr(\"----- end -----\");\n myerr(\"Time: \" + (end) + \"ms\");\n myerr(\"Memory: \" + Math.round(process.memoryUsage().heapTotal / 1024) + \"KB\");\n});\nfunction nextInt() { return myconv(next(), 1); }\nfunction nextStrArray() { return myconv(next(), 2); }\nfunction nextIntArray() { return myconv(next(), 4); }\nfunction nextCharArray() { return myconv(next(), 6); }\nfunction next() { return obj.next(); }\nfunction hasNext() { return obj.hasNext(); }\nfunction init(input) {\n var returnObj = {\n list: input, index: 0, max: input.length,\n hasNext: function () { return (this.index < this.max); },\n next: function () { if (!this.hasNext()) { throw \"ArrayIndexOutOfBoundsException\"; } else { var returnInput = this.list[this.index]; this.index++; return returnInput; } }\n };\n return returnObj;\n}\nfunction myout(s) { console.log(s); }\nfunction myerr(s) { console.error(\"debug:\" + require(\"util\").inspect(s, false, null)); }\nfunction myconv(i, no) { try { switch (no) { case 1: return parseInt(i); case 2: return i.split(\" \"); case 4: return i.split(\" \").map(Number); case 6: return i.split(\"\"); case 7: return i.split(\"\").map(Number); case 8: return i.join(\" \"); case 9: return i.join(\"\\n\"); case 0: return i.join(\"\"); default: return i; } } catch (e) { return i; } }\n\n\nfunction Main() {\n var str1 = next();\n var str2 = next();\n\n myout(str1.localeCompare(str2));\n \n} // Use Terminal to debug, not Debug Console!", "lang": "Node.js", "bug_code_uid": "9c6e02787f2b099362d13155de48c956", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "a4ae61c04e09939399fb0d04d9a33a5b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9975903614457832, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet data = [];\nrl.on('line', (input) => {\n data.push(input);\n});\n\nrl.on('close', () => {\n solve(data);\n});\n\nfunction solve(data) {\n\n s1 = data[0];\n s2 = data[1];\n\n console.log(compare(s1, s2));\n\n}\n\nfunction compare(s1, s2) {\n for (let i = 1; i < s1.length; i++) {\n s1c = s1[i].toLowerCase().charCodeAt(0);\n s2c = s2[i].toLowerCase().charCodeAt(0);\n if (s1c > s2c) {\n return 1;\n } else if (s1c < s2c) {\n return -1;\n }\n }\n return 0;\n}", "lang": "Node.js", "bug_code_uid": "7a3c26a3c773a566f0aeb1aa5983c620", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "b4e86517ba15dfd37e7f70b608757cbb", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8439763001974984, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n\t input: process.stdin,\n\t output: process.stdout,\n\tterminal : false\n});\n\n\nrl.on(\"line\", main)\nlet i = 0;\nlet n = 0;\nlet x = 0;\nlet s1, s2 = \"\"\nconst arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' ,'k', 'l', 'm', 'n', 'o','p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] \n\nfunction main(input){\n\t\n\tif(i == 0){\n\t\ts1 = input\n\t\ti++\n\t\treturn\n\t}\n\tif(i == 1){\n\t\ts2 = input\n\t\ti++\n\t}\n\n\tlet x = 0\n\tlet y = 0\n\tfor(var j = 0 ; j < s1.length ; j++){\n\t\n\t\tlet v = arr.indexOf(s1[j].toLowerCase())\n\t\tlet w = arr.indexOf(s2[j].toLowerCase())\n\t\tx = x + parseInt(v)\n\t\ty = y + parseInt(w)\n\t\n\n\t}\n\tif(y === x) {\n\t\tconsole.log(\"0\")\n\t}\n\tif(x > y){\n\t\tconsole.log(\"1\")\n\t}\n\n\tif(x < y){\n\t\tconsole.log(\"-1\")\n\t}\n}\n", "lang": "Node.js", "bug_code_uid": "b201a97e402677873f9444c1a067ef54", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "efb34b3065c0351674bbe777a31767f0", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6408094435075885, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "function lexicographically(str1, str2) {\n for (let i = 0; i < str1.length; i++) {\n if (\n str1[i].toLocaleLowerCase().charAt(0) >\n str2[i].toLocaleLowerCase().charAt(0)\n ) {\n return 1;\n } else if (\n str1[i].toLocaleLowerCase().charAt(0) <\n str2[i].toLocaleLowerCase().charAt(0)\n ) {\n return -1;\n } else {\n continue;\n }\n }\n\n return 0;\n}", "lang": "Node.js", "bug_code_uid": "875c5c0f367978fc429c94449bd0802d", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "473cea7eb9601636536a7f25366f9715", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.807936507936508, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction main() {\n\tconst str1 = readLine().toLowerCase().split('');\n\tconst str2 = readLine().toLowerCase().split('');\n\n\tconst diff = str1.reduce((a, c, i) => {\n\t\treturn a + (c.charCodeAt(0) - str2[i].charCodeAt(0));\n\t}, 0);\n\n\tconst res = diff < 0 ? -1 : diff > 0 ? 1 : 0;\n\tconsole.log(res);\n}\n", "lang": "Node.js", "bug_code_uid": "49ec47473088580d0c32b63a1ace1667", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "0aaeedf4fe8ae3d056c2a786db6c25b9", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7639699749791493, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "process.stdin.on('data', input => {\n const tests = input.toString().split('\\n');\n console.log(check(tests));\n});\n\nfunction check(tests) {\n const str1 = tests[0].trim();\n const str2 = tests[1].trim();\n\n // Both strings length are same.\n let flag = 0;\n for (let index = 0; index < str1.length; index++) {\n const s1 = str1[index].toLowerCase();\n const s2 = str2[index].toLowerCase();\n if (s1 === s2) {\n flag = 0;\n } else if (str1[index] > str2[index]) { // Small case alphabets has higher ASCII value. aka (a > A) = true\n flag = 1;\n break;\n } else {\n flag = -1;\n break;\n }\n }\n\n return flag;\n}\n\n", "lang": "Node.js", "bug_code_uid": "1922c1fab9f11dd55165c634119b96bf", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "b04a0e1a718c29a9109e39e2a35a2ec2", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7415621986499518, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction readAsInt(){\n return parseInt(readline());\n}\n\nfunction readAsIntList(){\n return readline().split(' ').filter(i => i).map(i => parseInt(i));\n}\n\n\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n const s1 = readline();\n const s2 = readline();\n const getValue = c => {\n return c.toLowerCase().charCodeAt();\n }\n const getScore = s => {\n return s.split('').map(getValue).reduce((acc, v) => acc + v, 0)\n }\n const score1 = getScore(s1);\n const score2 = getScore(s2);\n console.log(score1 < score2 ? -1 : (score2 < score1 ? 1 : 0));\n}\n\n", "lang": "Node.js", "bug_code_uid": "676c381b886b164eeda2f00e0553f944", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "51da329df55d5176995a2448358a7721", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7285546415981199, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "const stdin = process.openStdin();\n\nprocess.stdin.on('data', function (chunk) {\n lines = chunk.toString().split('\\n');\n lines.map((line, i) => processLine(line, i));\n});\n\nlet scores;\nlet output = 0;\nfunction processLine(text, i) {\n if (i === 0) {\n scores = text.toString().trim().split(' ').map(a => parseInt(a, 10)).sort();\n output += Math.trunc(scores[1] / 2) * scores[0];\n output += Math.trunc((scores[0] - 1) / 2);\n console.log(output);\n }\n}", "lang": "Node.js", "bug_code_uid": "882d2e67595f5f62ebd77df399d2eb96", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "77478b3647b924730fd04117508a9f3f", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9915966386554622, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet n, k;\n\nrl.on('line', (d) => {\n if (c === 0) {\n [n, k] = d.split(' ').map(Number);\n c++;\n return;\n }\n\n const chars = [...d];\n chars.sort();\n const alpha = 'abcdefghijklmnopqrstuvwxyz';\n\n let ans = -1;\n const str = [chars[0]];\n\n for (let i = 0; i < n; i++) {\n let prev = str[str.length - 1];\n let distance = Math.abs(alpha.indexOf(prev) - alpha.indexOf(chars[i]));\n\n if (distance < 2) {\n continue;\n }\n\n str.push(chars[i]);\n\n if (str.length === k) {\n break;\n }\n }\n\n if (str.length === k) {\n ans = 0;\n for (let i = 0; i < str.length; i++) {\n ans += alpha.indexOf(str[i]) + 1;\n }\n }\n\n console.log(ans);\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "8d39c0a074daf0214b0ebb6bf9e77645", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "aa5a5c58c441ecdf63b835aac54cc48b", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5189504373177842, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "function howMany(dim, x) {\n let amt = 0;\n for (let i = 1; i <= dim+1; i++) {\n for (let j = 1; j <= dim+1; j++) {\n if (i * j == x) amt++;\n }\n }\n return amt;\n}\n\nprocess.stdin.addListener(\"data\", data => {\n const nums = data.toString().split(\" \").map(n => parseInt(n));\n console.log(howMany(nums[0], nums[1]));\n});\n", "lang": "Node.js", "bug_code_uid": "97019a479cc2da8fb16c252e9b09138f", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "d9f75bc117cc10400ca6821adfa2d769", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9484098939929329, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "function howMany(dim, x) {\n // let pairs = [];\n \n let amt = 0;\n let prevFact = -1;\n const max = Math.min(x/2, dim);//Make sure both factors are in the table\n for (let i = 1; i <= max; i++) {//Find all factor pairs of X\n const pair = x / i;\n if (Math.floor(pair) == pair && pair <= dim && pair != prevFact) {//If a pair has been found\n amt++;\n // pairs.push([i, pair]);\n prevFact = i;\n }\n }\n // console.log(pairs);\n amt *= 2; //Only half the table is evaluated, to be more efficient\n return amt;\n}\n\nprocess.stdin.addListener(\"data\", data => {\n const nums = data.toString().split(\" \").map(n => parseInt(n));\n console.log(howMany(nums[0], nums[1]));\n});\n", "lang": "Node.js", "bug_code_uid": "1a719abcdfd8369030701de5cb33ce92", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "d9f75bc117cc10400ca6821adfa2d769", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.968, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "/**\n * Created by ishanarora on 25/11/18.\n */\n\nconst stdin = process.openStdin();\nlet content = ``;\nstdin.addListener('data', d => {\n content += d.toString();\n});\n\nstdin.addListener('end', () => {\n content = content.split(\" \");\n console.log(factors(parseInt(content[0], content[1])));\n});\n\n\n\nfunction factors(elem1, elem2) {\n let count = 0;\n for (var i = 1; i < n; i--) {\n if (elem2 % i == 0 && elem2 / i < elem1) {\n count += 2;\n }\n }\n return count;\n}\n\n", "lang": "Node.js", "bug_code_uid": "3f5056ea6fdfdc0305c5a3454c84e1a7", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "e44060d148e03ee3b9fbcb263fefeddc", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9820717131474104, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "/**\n * Created by ishanarora on 25/11/18.\n */\n\nconst stdin = process.openStdin();\nlet content = ``;\nstdin.addListener('data', d => {\n content += d.toString();\n});\n\nstdin.addListener('end', () => {\n content = content.split(\" \");\n console.log(factors(parseInt(content[0], content[1])));\n});\n\n\n\nfunction factors(elem1, elem2) {\n let count = 0;\n for (var i = 1; i < elem1; i--) {\n if (elem2 % i == 0 && elem2 / i < elem1) {\n count += 2;\n }\n }\n return count;\n}\n\n", "lang": "Node.js", "bug_code_uid": "49eb909278a9ad960ccce488642fbcc6", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "e44060d148e03ee3b9fbcb263fefeddc", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9900596421471173, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "/**\n * Created by ishanarora on 25/11/18.\n */\n\nconst stdin = process.openStdin();\nlet content = ``;\nstdin.addListener('data', d => {\n content += d.toString();\n});\n\nstdin.addListener('end', () => {\n content = content.split(\" \");\n console.log(factors(parseInt(content[0], content[1])));\n});\n\n\n\nfunction factors(elem1, elem2) {\n let count = 0;\n for (var i = 1; i <= elem1; i++) {\n if (elem2 % i == 0 && elem2 / i <= elem1) {\n count += 1;\n }\n }\n return count;\n}\n\n", "lang": "Node.js", "bug_code_uid": "7427e3d120a102e1f16fc1396f09a0ba", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "e44060d148e03ee3b9fbcb263fefeddc", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.842756183745583, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "let i = ''\n\nprocess.stdin.on('data',c => {\n i += c\n})\n\nprocess.stdin.on('end', () => {\n const { EOL } = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n\n let inputData = lines[0].split(\" \")\n let tableSize = parseInt(inputData[0])\n let desiredNumber = parseInt(inputData[1])\n let numberOfOccurance = 0\n\n for(i = 2; i <= tableSize ; i++) {\n if (desiredNumber % i === 0) {\n numberOfOccurance++\n } \n }\n\n if(desiredNumber <= tableSize) { numberOfOccurance++ }\n\n console.log(numberOfOccurance)\n})", "lang": "Node.js", "bug_code_uid": "bd80202e333c8cea70a8a000b2a107cd", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "c24e07d622dd9357acee6bc68703f632", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7336860670194003, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "let i = ''\n\nprocess.stdin.on('data',c => {\n i += c\n})\n\nprocess.stdin.on('end', () => {\n const { EOL } = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n\n let inputData = lines[0].split(\" \")\n let tableSize = parseInt(inputData[0])\n let desiredNumber = parseInt(inputData[1])\n let numberOfOccurance = 0\n\n for(i = 1; i <= tableSize; i++) {\n for (j = 1; j<= tableSize ; j++) {\n if (i * j == desiredNumber) {\n numberOfOccurance ++\n }\n }\n }\n console.log(numberOfOccurance)\n})", "lang": "Node.js", "bug_code_uid": "c0398ad3d26f042a5d663137fbd41d8d", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "c24e07d622dd9357acee6bc68703f632", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6181327940680822, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 18, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', (_) => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\n// Make a Snippet for the code above this and then write your logic in main()\nfunction main() {\n const s = readline();\n const t = readline();\n helper(s, t);\n}\n\nfunction helper(s, t) {\n if (s.length < t.length) {\n console.log('need tree');\n return;\n }\n if (s.indexOf(t) > -1) {\n console.log('automaton');\n return;\n }\n let cnt = new Array(26).fill(0);\n for (let i = 0; i < t.length; i++) {\n cnt[t.charCodeAt(i) - 97]++;\n }\n\n for (let i = 0; i < s.length; i++) {\n cnt[s.charCodeAt(i) - 97]--;\n }\n\n if (cnt.every((charCnt) => charCnt <= 0))\n if (s.length === t.length) console.log('array');\n else console.log('both');\n else console.log('need tree');\n}\n", "lang": "Node.js", "bug_code_uid": "2b69228e4c23610b3844c01fd5123f0e", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "66a1c2168b062de4d472e4be7a6c3771", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9876609442060086, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', (_) => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\n// Make a Snippet for the code above this and then write your logic in main()\nfunction main() {\n const s = readline();\n const t = readline();\n helper(s, t);\n}\n\nfunction helper(s, t) {\n if (s.length < t.length) {\n console.log('need tree');\n return;\n }\n if (s.indexOf(t) > -1) {\n console.log('automaton');\n return;\n }\n let need_tree = false;\n let automaton = false;\n let array = false;\n\n let cntT = new Array(26).fill(0);\n for (let i = 0; i < t.length; i++) {\n cntT[t.charCodeAt(i) - 97]++;\n }\n\n let cntS = new Array(26).fill(0);\n for (let i = 0; i < s.length; i++) {\n cntS[s.charCodeAt(i) - 97]++;\n }\n\n for (let i = 0; i < 26; i++) {\n if (tCount[i] > sCount[i]) {\n need_tree = true;\n break;\n }\n if (tCount[i] < sCount[i]) {\n automaton = true;\n }\n }\n\n if (need_tree) {\n console.log('need tree');\n return;\n }\n\n let match = -1;\n let found = 0\n for (let i = 0; i < t.length; i++) {\n found = s.indexOf(t.charAt(i), match + 1)\n if (index_found > match) {\n match = found;\n } else {\n array = true;\n break;\n }\n }\n\n if (automaton && array) {\n console.log('both');\n return;\n }\n if (automaton) {\n console.log('automaton');\n return;\n }\n console.log('array');\n return;\n}\n\n", "lang": "Node.js", "bug_code_uid": "795f5d8a37c096538f46cc72c6f37b73", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "66a1c2168b062de4d472e4be7a6c3771", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9987714987714987, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [n, m] = readLine().split(' ').map(Number);\n let max = Math.max(n, m);\n let loopMax = Math.round(Math.sqrt(max));\n let count = 0;\n for (let i = 0; i <= loopMax; i++) {\n for (let j = 0; j <= loopMax; j++) {\n if (i * i + j === n && j * J + i === m) {\n count++;\n }\n }\n }\n console.log(count);\n}\n", "lang": "Node.js", "bug_code_uid": "6d913db8d62055e227582d332985c51e", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "f39b844cdf571cb4fd2d3df8ae37e140", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9800747198007472, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\n\nfunction* nextLine() {\n\tlet lines = data.trim().split(/\\n/g);\n\tfor(let l of lines){\n\t\tyield l.trim();\n\t}\n}\n\nlet nl = nextLine();\n\nnl.elem = function(funParse) {\n\t\treturn funParse(this.next().value);\t\n\t};\n\nnl.array = function(funParse) {\n\t\treturn this.next().value.split(/\\s/g).map(funParse||(x => x));\n\t};\n\t\nnl.num = function() {\n\t\treturn nl.elem(Number);\n\t};\n\t\nnl.nums = function() {\n\t\treturn nl.array(Number);\n\t};\n\t\nnl.line = function() {\n\t\treturn this.next().value;\n\t};\n\t\nconst sol = () => {\n\tlet [n, m] = nl.nums();\n\tlet max = Math.max(n,m);\n\tlet cnt = 0;\n\tfor(let i = 0; i < max; i++){\n\t\tfor(let j = 0; j < max - i; j++){\n\t\t\tif (a*a + b === n && a + b*b === m){\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t}\n\tconsole.log(cnt);\n\n};\n\nprocess.stdin.on('end', sol);\n", "lang": "Node.js", "bug_code_uid": "e7633621f8e3ad0dd7d94913fefa2a1f", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "0aa3a1525189df7b9a4bad5c9bb0c700", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9987546699875467, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\n\nfunction* nextLine() {\n\tlet lines = data.trim().split(/\\n/g);\n\tfor(let l of lines){\n\t\tyield l.trim();\n\t}\n}\n\nlet nl = nextLine();\n\nnl.elem = function(funParse) {\n\t\treturn funParse(this.next().value);\t\n\t};\n\nnl.array = function(funParse) {\n\t\treturn this.next().value.split(/\\s/g).map(funParse||(x => x));\n\t};\n\t\nnl.num = function() {\n\t\treturn nl.elem(Number);\n\t};\n\t\nnl.nums = function() {\n\t\treturn nl.array(Number);\n\t};\n\t\nnl.line = function() {\n\t\treturn this.next().value;\n\t};\n\t\nconst sol = () => {\n\tlet [n, m] = nl.nums();\n\tlet max = Math.max(n,m);\n\tlet cnt = 0;\n\tfor(let a = 0; a < max; a++){\n\t\tfor(let b = 0; b < max - a; b++){\n\t\t\tif (a*a + b === n && a + b*b === m){\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t}\n\tconsole.log(cnt);\n\n};\n\nprocess.stdin.on('end', sol);\n", "lang": "Node.js", "bug_code_uid": "dab5822cb6ff36fb8ef82803e18c321e", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "0aa3a1525189df7b9a4bad5c9bb0c700", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7490636704119851, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const n = +d;\n let sum = 0;\n let ans = 0;\n\n for(let i = 1; i <= n; i++) {\n sum += sum + i;\n\n if (sum >= n) {\n ans = i;\n break;\n }\n }\n\n console.log(ans);\n\n});\n", "lang": "Node.js", "bug_code_uid": "26f099f1131af471943d098df77acb4d", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "bebad8ffe5e5bb586196dfa930a46d28", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8276972624798712, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [n, a, b] = readLine().split(' ').map(Number);\n let c = n - b;\n // console.log(n - c + 1);\n // if (c === a) {\n // console.log(n - c);\n // } else {\n // console.log(n - c + 1);\n // }\n //\n let start = n - a;\n let end = n - start + 1;\n if (end <= b) {\n console.log(end);\n } else if (start === c) {\n console.log(n - c);\n } else {\n console.log(n - c + 1);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "3a4d021139c6af59c6c480bdcb1d17bf", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "682831b6988b176166012f723652647c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9662261380323054, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nconst pad2 = (x) => (\"0\" + x).slice(-2);\n\nconst readTime = (s) => s.replace(/\\r?\\n|\\r/, \"\").split(\":\");\n\nrl.question(\"enter time1:\", (time1) => {\n const [h1, m1] = readTime(time1);\n rl.question(\"enter time2:\", (time2) => {\n const [h2, m2] = readTime(time2);\n const [A, B] = [\n new Date(0, 0, 0, h1, m1).getTime(),\n new Date(0, 0, 0, h2, m2).getTime(),\n ].sort();\n \n const result = new Date(A + (B - A) / 2); \n \n process.stdout.write(\n `${pad2(result.getHours())}:${pad2(result.getMinutes())}`\n );\n });\n});\n", "lang": "Node.js", "bug_code_uid": "255c2ca46dec52ab35c556db5afbdcd4", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "ecc952923725105d60e55cd15a79ce06", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.7233468286099866, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n}); \n\nrl.on('line', input => {\n console.log(min(input.split(' ')));\n process.exit();\n});\n\nconst min = input => {\n return parseInt(input.reduce((ant, act) => parseInt(ant) + parseInt(act)) / input.length);\n}", "lang": "Node.js", "bug_code_uid": "0bf2326ddee8629cbc69e1cd9f885e71", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "ef1472e4da28f2d0f108397dd0158389", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5901287553648069, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n \nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n const t = Number(readLine())\n for (let _i = 0; _i < t; _i++) {\n const [n, k, l] = readLine().split(/\\s/).map(Number)\n const ds = readLine().split(/\\s/).map(Number)\n let result = true\n const repeats = Array(k).fill(0)\n for (const d of ds) {\n const index = d - (l - k + 1)\n if (index >= k) {\n result = false\n break\n }\n for (let i = 0; i < k; i++) {\n repeats[i] = i > index ? 0 : repeats[i] + 1\n if (repeats[i] > k - i) {\n result = false\n break\n }\n }\n if (!result) {\n break\n }\n }\n console.log(result ? 'Yes' : 'No')\n }\n}\n", "lang": "Node.js", "bug_code_uid": "372353c24e33e1207b67c5a8966b10e6", "src_uid": "4941b0a365f86b2e2cf686cdf5d532f8", "apr_id": "8b78ec1a021b1eca9dac3b81c718aa3b", "difficulty": 1900, "tags": ["dp", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8391038696537678, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n if (+d === 2) {\n console.log(3);\n }\n else {\n console.log(6);\n }\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "0a686a7d0a7029545c784d979d741ea3", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "6e22846fd1025ea7b652bcb41eb192de", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.13428571428571429, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "var print = console.log\nvar readline = this.readline || require('lol-io').readline\nvar y = +readline() + 1\nconst check = (x) => (x + '').length === new Set(x + '').size\nwhile (!check(y)) y++\nprint(y);", "lang": "JavaScript", "bug_code_uid": "abf3bc121a4c16a5ca9cd29a4cf35412", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "d092c861ad1805b265b178fb3079cc5a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9844559585492227, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nconst daysInMonth = (month) => new Date(2017, month, 0).getDate();\n\nrl.on('line', (data) => {\n const [m, d] = data.split(' ').map(Number);\n const days = daysInMonth(m);\n const ans = Math.ceil(days / 7);\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "53dedc734e8de81415936802b47f069d", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "e6159c1a95bad6d34690ef4cc233d3dd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8432304038004751, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "var readline = require('readline');\nvar rl = readline.createInterface(process.stdin, process.stdout);\nrl.prompt();\nrl.on('line', function(input) {\n var ans = main(input.split(' '));\n console.log(ans); \n});\nfunction main(input){\n var m = Number(input[0]);\n var n = Number(input[1]);\n var a = Number(input[2]);\n var ans;\n ans = Math.ceil(m/a)*Math.ceil(n/a);\n return ans;\n}\n", "lang": "Node.js", "bug_code_uid": "2ebe27577b9c29e3cf565b8a1c0bd498", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "948d6e9bb0c7f4254d344529d32af406", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.09734513274336283, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "var a = readline().split(' ');\nprint(Math.ceil(a[0]/a[2])*Math.ceil(a[1]/a[2]))", "lang": "Node.js", "bug_code_uid": "58fb1a381b61b0427ef7879f164ef738", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "f20bf96abb0e672e238fa52f8679043d", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7792706333973128, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "const state = { stdin: Buffer.alloc(0) };\nconst consume = (chunk) =>\n (state.stdin = Buffer.concat(\n [state.stdin, chunk],\n state.stdin.length + chunk.length\n ));\nconst commit = (answer) => process.stdout.write(answer);\nconst main = (args) => {\n let data = state.stdin\n .toString(\"utf8\")\n .split(\" \")\n .map((e) => parseInt(e));\n // console.log(data);\n let ss = data[0] * data[1];\n const sc = data[2] * data[2];\n if (ss < 2) commit(ss);\n commit(ss%sc);\n};\nprocess.stdin.on(\"data\", consume).on(\"end\", main);\n", "lang": "Node.js", "bug_code_uid": "1a5eeeff812e07f26a4ab1b9792df28c", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "96fff6d33d9083951e0db52dea1ce0ba", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7895247332686712, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "const state = { stdin: Buffer.alloc(0) };\nconst consume = (chunk) =>\n (state.stdin = Buffer.concat(\n [state.stdin, chunk],\n state.stdin.length + chunk.length\n ));\nconst commit = (answer) => process.stdout.write(answer);\nconst main = (args) => {\n let data = state.stdin\n .toString(\"utf8\")\n .split(\" \")\n .map((e) => parseInt(e));\n // console.log(data);\n const ss = data[0] * data[1];\n const sc = data[2] * data[2];\n commit((ss % sc).toString());\n};\nprocess.stdin.on(\"data\", consume).on(\"end\", main);\n", "lang": "Node.js", "bug_code_uid": "9c7c67e8c0ee339139dd2e172037ade3", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "96fff6d33d9083951e0db52dea1ce0ba", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8932038834951457, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const [x, y, a] = readLine()\n .split(\" \")\n .map((n) => parseInt(n));\n const rem = (x * y) % (a * a);\n\n console.log(rem ? rem : 1);\n}\n", "lang": "Node.js", "bug_code_uid": "cc71e810b315adb2533e4e3b3632c939", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "a4d72161e3a545f1e0980d3a6993fdfc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9333333333333333, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "/* scheme2js generated file Fri, 16 Oct 2020 16:24:07 +0800 */\nconst rl = require('readline').createInterface({ input: process.stdin, output: process.stdout })\nconst print = console.log\nconst write = (...args) => {\n process.stdout.write(args.join(' '));\n}\nconst lines = []\nrl.on('line', line => {\n lines.push(line);\n});\nrl.on('close', main)\nlet rli = 0;\nfunction readline() {\n return lines[rli++];\n}\n\n\nfunction main() {\nvar BGl_rze21ze2zzscm2js1008z00;\nvar BGl_mze22ze2zzscm2js1008z00;\nvar BGl_nze23ze2zzscm2js1008z00;\nvar num = readline().split(\" \").map(x => parseInt(x));\nBGl_nze23ze2zzscm2js1008z00 = num[0];\nBGl_mze22ze2zzscm2js1008z00 = num[1];\nBGl_rze21ze2zzscm2js1008z00 = num[2];\n(print(((((parseInt(BGl_nze23ze2zzscm2js1008z00/BGl_rze21ze2zzscm2js1008z00)))*((parseInt(BGl_mze22ze2zzscm2js1008z00/BGl_rze21ze2zzscm2js1008z00)))))));\n}\n", "lang": "Node.js", "bug_code_uid": "2f8c414d304ba617409c2dce97b3ba1e", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "4538eb0fb8325d13f36e99e60c8649c4", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.2024793388429752, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "function main(readline, print) {\n let a = readline().split(\" \");\n console.log(a);\n print(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]));\n} \n main();", "lang": "Node.js", "bug_code_uid": "eb5e7d9597cf20047fb2518b0a823b63", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "268768216f3b164943e7f3ebe02efe58", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9890776699029126, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const start=(main, readlineFun, printFun) => {\n if (readlineFun && printFun) {\n main(readlineFun, printFun);\n return;\n }\n\n process.stdin.resume();\n process.stdin.setEncoding(\"utf8\");\n\n let input = \"\",\n readline,\n print;\n\n process.stdin.on(\"data\", function(chunk) {\n input += chunk;\n });\n\n process.stdin.on(\"end\", function() {\n input = input.split(\"\\n\");\n print = function(data) {\n process.stdout.write(data + \"\\n\");\n };\n let inputLineIndex = 0;\n readline = function() {\n return inputLineIndex >= input.length\n ? undefined\n : input[inputLineIndex++];\n };\n process.exit(main(readline, print) || 0);\n });\n} \n function main(readline, print) {\n let a = readline().split(\" \");\n console.log(a);\n print(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]));\n} \n start(main);", "lang": "Node.js", "bug_code_uid": "071ffb8658b28e29a7c5289494d80ed2", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "268768216f3b164943e7f3ebe02efe58", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.541993281075028, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 12, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nvar stdin = [];\nrl.on('line', function (line) {stdin.push(line);});\n\nvar num = stdin[0].split(' ');\nvar n = parseInt(num[0]);\nvar m = parseInt(num[1]);\nvar a = parseInt(num[2]);\nvar na = (n - n % a) / a;\nvar ma = (m - m % a) / a;\nif (na * a < n) na = na + 1;\nif (ma * a < m) ma = ma + 1;\nconsole.log(na * ma);", "lang": "Node.js", "bug_code_uid": "4a9ca8f192b0ca4e2fac201643f671b6", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "12a9d2ecca9a8dcdfa9b9869bc462f7f", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9912739965095986, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\n\nlet a, b, c;\nrl.on('line', (line) => {\n [a, b, c] = line.split(' ').map(i => parseInt(i));\n}).on('close', () => {\n process.stdout.write(Math.ceil(a / c) * Math.ceil(b / c));\n});\n", "lang": "Node.js", "bug_code_uid": "bf6d713b057592b19d3dcf3336ef608e", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "8e7bd9fb4eb74f2884a15551df8f3c13", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7952421410365336, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "var readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet result = 0;\n\nconst check = (n, m, a) => {\n for (let i = 1; i < Infinity; i += 1) {\n if (i >= n / a) {\n for (let j = 1; j < Infinity; j += 1) {\n if (j >= m /a) {\n return i * j;\n }\n }\n }\n }\n};\n\nrl.on('line', function (data) {\n const input = data.split(' ');\n const n = Number(input[0]);\n const m = Number(input[1]);\n const a = Number(input[2]);\n \n result = check(n, m, a);\n});\n\nprocess.stdin.on('end', () => { console.log(result); process.exit(0); });\n", "lang": "Node.js", "bug_code_uid": "02f0158fde02c8230a2c18538038ec67", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "7fbab66f6244c47a5ab6b8454d4ad9a7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8792569659442725, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "'use strict';\n\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main(){\n var n = parseInt(readLine());\n var m = parseint(readLine());\n var a =parseInt(readLine());\n var res = 0;\n res+= Math.ceil(n%a) + Math.ceil(m%a);\n \nconsole.log(res);\n\n}\n", "lang": "Node.js", "bug_code_uid": "ba519a05a819c8f2baf88de042a71486", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "3b66c33bdd958fc4d4a86fe80738104a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.999439461883408, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "if (process.env.ANT)\n{\n global.print = this.print ||\n function(){console.log([...arguments].join(' '))} ||\n require('lol-io').print;\n global.debug = function(){console.log('debug:', [...arguments].join(' '))}\n global.write = this.write || require('lol-io').write\n global.readline = this.readline || require('lol-io').readline\n main();\n}\nelse\n{\n const rl = require('readline').createInterface({ input: process.stdin,\n output: process.stdout });\n global.print = console.log\n global.debug = ()=>{};\n global.write = (...args) => {\n process.stdout.write(args.join(' '));\n }\n const lines = []\n rl.on('line', line =>{\n lines.push(line);\n });\n rl.on('close', main)\n let rli = 0;\n global.readline = ()=>lines[rli++];\n}\n\n///////////// CODE\n\nfunction main(){\n let D = [];\n\n let s = readline();\n let t = readline();\n\n function test(i, m)\n {\n debug('test ', i, m)\n let is = 0, it = 0;\n if (is==i)\n is += m;\n while (it {\n while (b !== 0n) {\n let temp = a;\n a = b;\n b = temp % b;\n }\n\n return a;\n};\n\nrl.on('line', (d) => {\n let [a, b] = d.split(' ').map(BigInt);\n console.log(gcd(a, b).toString());\n});\n", "lang": "Node.js", "bug_code_uid": "6082190bca4ddc3651e86a1e21d62e7e", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "1e9211c337589c3f6f56f75569b8267f", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8677966101694915, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf-8')\n\nvar arr = ''\nprocess.stdin.on('data', (i) => {\n arr += i\n})\n\n\nprocess.stdin.on('end', () => {\n arr = arr.split('\\n')\n const ax = arr[0].split(' ')\n const a1 = parseInt(ax[0])\n const a2 = parseInt(ax[1])\n const a3 = parseInt(ax[2])\n const a4 = parseInt(ax[3])\n\n var f = false\n\n if(a1 + a2 == a3 + a4) f = true\n else if(a1 + a3 == a2 + a4) f = true\n else if(a1 + a4 == a3 + a2) f = true\n\n if(f) console.log('YES')\n else console.log('NO')\n}) ", "lang": "Node.js", "bug_code_uid": "ed90b5f29b818446a3e36ff1da617e57", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "86979a85f0c599f094f4d43bf397a8fe", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9512411347517731, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n');\n var start = Date.now();\n Main();\n var end = Date.now() - start;\n myerr('time : ' + end + 'ms');\n myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n if((one[0] + one[1] == one[2] + one[3]) || \n (one[0] + one[2] == one[1] + one[3]) || \n (one[0] + one[3] == one[2] + one[1])){\n myout(\"YES\");\n }else{\n myout(\"NO\");\n }\n}\n", "lang": "Node.js", "bug_code_uid": "17bf6f647f8ac356a40368daaedff93d", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "5228dc382fd85e4a621e146905fbbfbf", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7123287671232876, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "process.stdin.on('data', data => {\n data = data.toString().trim().split(\" \");\n \n process.stdout.write(Math.ceil(parseInt(data[0]) * parseInt(data[1]) / parseInt(data[2]) / parseInt(data[2])));\n});", "lang": "Node.js", "bug_code_uid": "2bb4c1f85eeda7c8b48ee45d471a73b2", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e586f5e834a5e15fc4f2b02210a25076", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9389788293897883, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on(\"line\", (input) => {\n const [m, n, a] = input.split(/\\s+/).map((n) => parseInt(n));\n //\n const rows = Math.ceil(m, a);\n const columns = Math.ceil(n, a);\n const total = rows * columns;\n //\n console.log(total);\n process.exit();\n //\n}).on(\"close\", () => {\n process.exit();\n});", "lang": "Node.js", "bug_code_uid": "df13668338f8187f199d3ad329b98598", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "93166770798cfd86188545d077f0adf2", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.964824120603015, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.on('data',c=>{[n,m,a]=c.toString().split(' ')m=Math.ceil;console.log(m(n/a)*m(m/a))})", "lang": "Node.js", "bug_code_uid": "745e30622830967bd41c80dbfa56515a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "c20b7348b1f221f32bfd7e163abc939a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9360730593607306, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "function main(stdin) {\n const [n, m, a] = stdin.split(\" \").map(v => parseInt(v));\n console.log({ n, m, a });\n console.log(Math.ceil(n / a) * Math.ceil(m / a));\n}\n\nmain(\n require(\"fs\")\n .readFileSync(0, \"utf-8\")\n .trim()\n);\n", "lang": "Node.js", "bug_code_uid": "6520e546e34e339a00acb5318d32b71e", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "7ae78feb5e1fd482e7e53eea88d2ba4a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9955357142857143, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.on('data', input => {\n input = String(input).split(' ');\n\n n = input[0];\n m = input[1];\n a = input[2];\n\n n_neded = 0;\n m_neded = 0;\n\n if (n % a != 0) {\n n_neded = Math.floor(n / a) + 1;\n } else {\n n_neded = Math.floor(n / a);\n }\n\n if (m % a != 0) {\n m_neded = Math.floor(n / a) + 1;\n } else {\n m_neded = Math.floor(n / a);\n }\n\n console.log(n_neded * m_neded);\n\n }\n)", "lang": "Node.js", "bug_code_uid": "1f3bfb8cb051bb7b4c84c65a77abcd5a", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "cfe9d51b7b67e0e83b86d7803d6c1996", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.15927189988623436, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "\"use strict\";\nexports.__esModule = true;\nvar fs_1 = require(\"fs\");\nvar lines = fs_1[\"default\"].readFileSync('/dev/stdin').toString();\nvar a = lines.split(\" \").map(function (x) { return parseInt(x); });\n// let a = readline().split(' ');\nconsole.log(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]));\n// print(\"Hello World\")\n", "lang": "Node.js", "bug_code_uid": "92840bcc9127e7da5c23544ae4e3ab77", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "79b332d369c7c5445c1d8290c6a0aa41", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9838998211091234, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "'use strict';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = \"\";\nlet lines = [];\nlet currentLine = 0;\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\nprocess.stdin.on('end', _ => {\n lines = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n main();\n});\nfunction readline() {\n return inputString[currentLine++];\n}\nfunction main() {\n const a = readline().split(\" \").map(x => parseInt(x));\n console.log(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]));\n}\n", "lang": "Node.js", "bug_code_uid": "de5ec56303fb454e61673e98ce4b1eb3", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "79b332d369c7c5445c1d8290c6a0aa41", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5023640661938534, "equal_cnt": 20, "replace_cnt": 17, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 21, "bug_source_code": "define(\"input\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n const doSuff = () => {\n console.log(\"DOING STUFF!\");\n };\n exports.default = doSuff;\n});\ndefine(\"main\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n process.stdin.resume();\n process.stdin.setEncoding(\"utf-8\");\n let inputString = \"\";\n let lines = [];\n let currentLine = 0;\n process.stdin.on(\"data\", (inputStdin) => {\n inputString += inputStdin;\n });\n process.stdin.on(\"end\", (_) => {\n lines = inputString\n .trim()\n .split(\"\\n\")\n .map((string) => {\n return string.trim();\n });\n main();\n });\n function readline() {\n return inputString[currentLine++];\n }\n function main() {\n const a = readline()\n .split(\" \")\n .map((x) => parseInt(x));\n console.log(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]));\n // doSuff()\n }\n});\n", "lang": "Node.js", "bug_code_uid": "029835c8c7460ea2d84b57a1f1281114", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "79b332d369c7c5445c1d8290c6a0aa41", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.11476389719067544, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "var __importDefault =\n (this && this.__importDefault) ||\n function (mod) {\n return mod && mod.__esModule ? mod : { default: mod }\n }\ndefine(\"input\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\"\n Object.defineProperty(exports, \"__esModule\", { value: true })\n const doSuff = () => {\n console.log(\"DOING STUFF!\")\n }\n exports.default = doSuff\n})\ndefine(\"main\", [\"require\", \"exports\", \"input\"], function (require, exports, input_1) {\n \"use strict\"\n Object.defineProperty(exports, \"__esModule\", { value: true })\n input_1 = __importDefault(input_1)\n process.stdin.resume()\n process.stdin.setEncoding(\"utf-8\")\n let inputString = \"\"\n let lines = []\n let currentLine = 0\n process.stdin.on(\"data\", (inputStdin) => {\n inputString += inputStdin\n })\n process.stdin.on(\"end\", (_) => {\n lines = inputString\n .trim()\n .split(\"\\n\")\n .map((string) => {\n return string.trim()\n })\n main()\n })\n function readline() {\n return inputString[currentLine++]\n }\n function main() {\n const a = readline()\n .split(\" \")\n .map((x) => parseInt(x))\n console.log(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]))\n input_1.default()\n }\n})\n", "lang": "Node.js", "bug_code_uid": "2967b62408cd1f3ada1cd019f907a452", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "79b332d369c7c5445c1d8290c6a0aa41", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9916467780429594, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "(()=>{\"use strict\";var e={312:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0});let n=\"\",r=[],s=0;function o(){return r[s++]}t.default={runMain:e=>{process.stdin.resume(),process.stdin.setEncoding(\"utf-8\"),process.stdin.on(\"data\",(e=>{n+=e})),process.stdin.on(\"end\",(e=>{r=n.trim().split(\"\\n\").map((e=>e.trim()))})),e()},readline:o,nextNumbers:function(){return o().split(\" \").map((e=>parseFloat(e)))}}},965:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,\"__esModule\",{value:!0});const s=r(n(312));s.default.runMain((function(){const e=s.default.nextNumbers();console.log(Math.ceil(e[0]/e[2])*Math.ceil(e[1]/e[2]))}))}},t={};!function n(r){if(t[r])return t[r].exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}(965)})();", "lang": "Node.js", "bug_code_uid": "d734b260fc2b1a96a3857ecd6ed3d36f", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "79b332d369c7c5445c1d8290c6a0aa41", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.927536231884058, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "'use strict'\nprocess.stdin.on('data', data => {\n const [n, m, a] = data.split(' ').map(a => parseInt(a))\n console.log(Math.ceil(n / a) * Math.ceil(m / a))\n})\n", "lang": "Node.js", "bug_code_uid": "1fe8956667f59f86a10dcf509e69f4ae", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "35b9675b3a0adba32aab3f539db7de89", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9375, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "var readline = require('readline');\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', function(line){\n\tif(!line) {\n\t\tprocess.exit()\n\t}\n const ancho, largo, baldoza = line.split(\" \").map(n => Number(n));\n const cantidadVertical = Math.floor(largo / baldoza) + 1\n const cantidadHorizontal = Math.floor(ancho / baldoza) + 1\n\n return cantidadVertical * cantidadHorizontal;\n})\n", "lang": "Node.js", "bug_code_uid": "5fc339db18d3fbafc4971c87f03a538d", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "a71ead4fc1286e483b10583b96bc2c89", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4909437559580553, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "'use strict';\n\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(str => str.trim());\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n // const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n\t\tconst g = parseInt(readLine(), 10);\n\t\t\n\t\tconsole.log(g);\n\n for (let gItr = 0; gItr < g; gItr++) {\n const nmx = readLine().split(' ');\n\n const n = parseInt(nmx[0], 10);\n\n const m = parseInt(nmx[1], 10);\n\n const x = parseInt(nmx[2], 10);\n\n const a = readLine().split(' ').map(aTemp => parseInt(aTemp, 10));\n\n const b = readLine().split(' ').map(bTemp => parseInt(bTemp, 10));\n\n // let result = twoStacks(x, a, b);\n\n // ws.write(result + \"\\n\");\n }\n\n // ws.end();\n}\n", "lang": "Node.js", "bug_code_uid": "397e7eab6fda64ae1b53f7b5c7618988", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "3bf6ee621cf441605eb4209064d1545c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4594882729211087, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "function solve(n) {\n let rest = n;\n let count = 0;\n while (rest > 0) {\n rest -= Math.max(...rest.toString().split(\"\"));\n count += 1;\n }\n return count;\n}\n\nfunction* main() {\n const n = parseInt(yield);\n const r = solve(n);\n console.log(r);\n process.exit(0);\n}\n\nif (!module.parent) {\n (() => {\n const q = main();\n q.next();\n require(\"readline\")\n .createInterface({\n input: process.stdin,\n output: null\n })\n .on(\"line\", line => q.next(line));\n })();\n}\n\nexports.solve = solve;\n", "lang": "Node.js", "bug_code_uid": "b65ee66b2cd06dcfe86c3e2eefd2ec1a", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "02c6afb06e0f0dc3a059755f03167f19", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.3805774278215223, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "function check9(n) {\n const ns = n.toString();\n const indexOf9 = ns.indexOf(\"9\");\n if (indexOf9 < 0) {\n return 0;\n }\n const rest = n % 10 ** (ns.length - indexOf9 - 1);\n const count = Math.floor(rest / 9);\n return count + 1;\n}\n\nfunction solve(n) {\n let rest = n;\n let count = 0;\n while (rest > 9) {\n const count9 = check9(rest);\n if (count9 > 0) {\n rest -= count9 * 9;\n count += count9;\n } else {\n rest -= Math.max(...rest.toString().split(\"\"));\n count += 1;\n }\n\n // console.log(rest, count, count9)\n }\n return count + 1;\n}\n\nfunction* main() {\n const n = parseInt(yield);\n const r = solve(n);\n console.log(r);\n process.exit(0);\n}\n\nif (!module.parent) {\n (() => {\n const q = main();\n q.next();\n require(\"readline\")\n .createInterface({\n input: process.stdin,\n output: null\n })\n .on(\"line\", line => q.next(line));\n })();\n}\n\nexports.solve = solve;\n", "lang": "Node.js", "bug_code_uid": "eefb09228faa065671ac1cfbe4063072", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "02c6afb06e0f0dc3a059755f03167f19", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5762312002359186, "equal_cnt": 34, "replace_cnt": 24, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 33, "bug_source_code": "let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];\n\nfunction checkDigit(n, dig) {\n if (dig === 0 && n === 0) {\n return { count: 0, decrement: 0 };\n }\n return {\n count: 1,\n decrement: Math.max(n, dig) - n\n };\n}\n\nfunction splitNumber(n) {\n const digitsPow = 10 ** Math.floor(Math.log10(n));\n let first = Math.floor(n / digitsPow);\n let tail = n % digitsPow;\n return [first, tail];\n}\n\nfunction solveCore(n, dig = 0) {\n if (store[dig][n]) {\n return store[dig][n];\n }\n if (n < 10) {\n return (store[dig][n] = checkDigit(n, dig));\n }\n\n let rest = n;\n let [first, tail] = splitNumber(rest);\n let count = 0;\n\n while (rest > 0) {\n const r = solveCore(tail, Math.max(first, dig));\n count += r.count;\n rest -= tail + r.decrement;\n [first, tail] = splitNumber(rest);\n }\n\n return (store[dig][n] = { count, decrement: -rest });\n}\nfunction solve(n) {\n store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];\n const r = solveCore(n, 0);\n return r.count;\n}\n\nfunction* main() {\n const n = parseInt(yield);\n const r = solve(n);\n console.log(r);\n process.exit(0);\n}\n\nif (!module.parent) {\n (() => {\n const q = main();\n q.next();\n require(\"readline\")\n .createInterface({\n input: process.stdin,\n output: null\n })\n .on(\"line\", line => q.next(line));\n })();\n}\n\nexports.solve = solve;\n", "lang": "Node.js", "bug_code_uid": "e613e772bc9fb375c9daf07dee25b993", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "02c6afb06e0f0dc3a059755f03167f19", "difficulty": 2500, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9768109012670332, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];\n\nfunction checkDigit(n, dig) {\n if (dig == 0) {\n return { count: int(n == 0 ? 0 : 1), decrement: 0 };\n }\n if (dig > n) {\n return {\n count: int(1),\n decrement: dig - n\n };\n }\n return {\n count: int(2),\n decrement: dig\n };\n}\n\nfunction getNumString(arr) {\n const joined = arr.join(\"\");\n const trimmed = joined.replace(/0/g, \" \").trimLeft();\n return trimmed.replace(/\\s/g, \"0\") || \"0\";\n}\n\nfunction solveCore(n, dig = 0) {\n if (store[dig][n]) {\n return store[dig][n];\n }\n if (n.length === 1) {\n return (store[dig][n] = checkDigit(n, dig));\n }\n\n let first = n[0];\n let tailArr = n.substring(1).split(\"\");\n let total = int();\n\n while (first >= 0) {\n const r = solveCore(getNumString(tailArr), Math.max(first, dig));\n total = plus(total, r.count);\n first -= 1;\n tailArr = tailArr.map(() => \"9\");\n tailArr.pop();\n tailArr.push(`${(10 - r.decrement) % 10}`);\n }\n\n return (store[dig][n] = { count: total, decrement: 10 - tailArr.pop() });\n}\n\nfunction solve(n) {\n store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];\n const r = solveCore(n, 0);\n console.log(\n n,\n store.map(o => Object.keys(o).length).reduce((acc, c) => acc + c)\n );\n return bintToString(r.count);\n}\n\nfunction* main() {\n const n = yield;\n const r = solve(n);\n console.log(r);\n process.exit(0);\n}\n\nif (!module.parent) {\n (() => {\n const q = main();\n q.next();\n require(\"readline\")\n .createInterface({\n input: process.stdin,\n output: null\n })\n .on(\"line\", line => q.next(line));\n })();\n}\n\nfunction int(n = 0) {\n return [\n n,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0\n ];\n}\nfunction plus(int1, int2) {\n let z = 0;\n return int1.map((_, i) => {\n z = z + int1[i] + int2[i];\n const r = z % 10;\n z = Math.floor(z / 10);\n return r;\n });\n}\n\nfunction bintToString(i) {\n return getNumString(Array.from(i).reverse());\n}\n\nexports.solve = solve;\n", "lang": "Node.js", "bug_code_uid": "f79dfe9e55c390d8807003d79fd6003c", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "02c6afb06e0f0dc3a059755f03167f19", "difficulty": 2500, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9475465313028765, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const DEBUG = false;\nconst { EOL } = require('os');\nconst fs = require('fs');\n\nlet r = process.stdin;\nif (DEBUG) {\n r = fs.createReadStream('input');\n}\nlet data = '';\nr.on('data', c => (data += c));\nr.on('end', () => {\n const lines = data.split(EOL);\n const arr = [];\n let d;\n [arr[0], arr[1], arr[2], d] = lines[0].split(' ');\n arr[0] = parseInt(arr[0]);\n arr[1] = parseInt(arr[1]);\n arr[2] = parseInt(arr[2]);\n d = parseInt(d);\n arr.sort();\n let res = Math.max(0, d - (arr[1] - arr[0]));\n res += Math.max(0, d - (arr[2] - arr[1]));\n console.log(res);\n});\n", "lang": "Node.js", "bug_code_uid": "adfc45954fdec2c3c1d220fe740b1e74", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3", "apr_id": "5e054b6ebc2f8b3d8cc53c77b7a85d82", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8980392156862745, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "const DEBUG = false;\nconst { EOL } = require('os');\nconst fs = require('fs');\n\nlet r = process.stdin;\nif (DEBUG) {\n r = fs.createReadStream('input');\n}\nlet data = '';\nr.on('data', c => (data += c));\nr.on('end', () => {\n const lines = data.split(EOL);\n const arr = [];\n let d;\n [arr[0], arr[1], arr[2], d] = lines[0].split(' ').map(parseInt);\n arr.sort(function(a, b) {\n return a - b;\n });\n let res = Math.max(0, d - (arr[1] - arr[0]));\n res += Math.max(0, d - (arr[2] - arr[1]));\n console.log(res);\n});\n", "lang": "Node.js", "bug_code_uid": "498d621aa0be8a58966d1a9898fd35bf", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3", "apr_id": "5e054b6ebc2f8b3d8cc53c77b7a85d82", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5503472222222222, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "function main(input) {\n \n let a,b,c;\n let d =[];\n var x=[];\n input =input.split(/\\n/g);\n var arr = input[0].split(' ');\n \n x[0]=arr[0];\n x[1]=arr[1];\n x[2]=arr[2];\n //console.log(x);\n var dis=arr[3];\n \n x.sort(function(a, b){return a - b});\n //console.log(x);\n\n d[0]=Math.abs(x[0]-x[1]);\n d[1]=Math.abs(x[0]-x[2]);\n d[2]=Math.abs(x[1]-x[2]);\n //console.log(d);\n var m = Math.min(...d);\n //console.log(m)\n if(m>=dis){\n console.log(0);\n }\n \n var time=0;\n while(d[0]=dis){\n console.log(0);\n }\n \n var time=0;\n if(d[0] {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nconst store = {};\n\nfunction main() {\n\tlet [n, a, b] = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\tlet m = n - a;\n\n\tif (m > b) {\n\t\tconsole.log(b + 1);\n\t} else {\n\t\tconsole.log(b);\n\t}\n}\n", "lang": "Node.js", "bug_code_uid": "645b6fd83731423ef32b77e1f3f2e29a", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "dcf9a8eae790438aef6c01a6946844c9", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9869451697127938, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let input ='';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data',(data)=>input+=data)\nprocess.stdin.on('end',()=>{\n let count = 0;\n let tmp = input.split('\\n');\n let arr = tmp[1].split(' ').map((val)=>+val).sort();\n \n for(let i = 0; i < arr.length; i+=2){\n count+=Math.abs(arr[i]-arr[i+1])\n }\n console.log(count)\n})\n", "lang": "Node.js", "bug_code_uid": "d75c41b3e2d58e4f124edc61f09a35ed", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "b2cecbc681dd0fe25d38173ca9fc0be2", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.841927303465765, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n let l=0;\n rl.on('line', (input) => {\n if (l==0) {l++}\n else {\n rl.close(); \n let s = input.split(\" \")\n s.sort()\n let res=0;\n for(let i=0;i0) {\n res+=d\n }\n }\n console.log(res)\n return 0;\n}\n});\n", "lang": "Node.js", "bug_code_uid": "81fbb13c6c9bf56c263d37be830c5870", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "0bdebac8943e648a97f85284f9213633", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9070034443168772, "equal_cnt": 24, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 21, "fix_ops_cnt": 24, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n console.log(lines);\n})\n\nconst input = i.split('\\n')[1];\nconst vector = input.split(' ').map(\n n => parseInt(n)\n);\n\nconst insertionSort = (vector) => {\n let res = 0;\n\n for (let i = 0; i < vector.length; i++) {\n let minIndex = i;\n\n for (let j = i + 1; j < vector.length; j++) {\n if (vector[j] < vector[minIndex]) {\n minIndex = j;\n }\n }\n\n let temp = vector[i];\n vector[i] = vector[minIndex];\n vector[minIndex] = temp;\n\n if (i !== 0 && i % 2 === 1) {\n res += vector[i] - vector[i -1]\n }\n }\n\n console.log(res);\n};\n\ninsertionSort(vector);", "lang": "Node.js", "bug_code_uid": "425c860d79ce50461a8b40e8998a96cf", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "ad15615e530658492bbd7ea29d745834", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9843225083986562, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n\n const input = lines[1];\n const vector = input.split(' ').map(\n n => parseInt(n)\n );\n\n const insertionSort = (vector) => {\n let res = 0;\n\n for (let i = 0; i < vector.length; i++) {\n let minIndex = i;\n\n for (let j = i + 1; j < vector.length; j++) {\n if (vector[j] < vector[minIndex]) {\n minIndex = j;\n }\n }\n\n let temp = vector[i];\n vector[i] = vector[minIndex];\n vector[minIndex] = temp;\n\n if (i !== 0 && i % 2 === 1) {\n res += vector[i] - vector[i -1]\n }\n }\n\n console.log(res);\n };\n});\n\n//////\n\n\n", "lang": "Node.js", "bug_code_uid": "21d7d0c228469548fb1412e7b987d3e9", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "ad15615e530658492bbd7ea29d745834", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7786438035853468, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "\nfunction main() {\n const is = new Scanner();\n const [n, m] = is.nextArray().map(Number);\n const word = is.nextLine().split('');\n word.forEach((item, index, array) => {\n array[index] = item.charCodeAt(0) - 'a'.charCodeAt(0) + 1;\n });\n word.sort((a, b) => a - b);\n\n let answer = Infinity;\n\n function calc(i, accum, number) {\n if (number === m) {\n answer = Math.min(answer, accum);\n }\n if (i === n || number > m) {\n return;\n }\n\n if (Math.abs(word[i] - word[i + 1]) >= 2) {\n calc(i + 1, accum + word[i + 1], number + 1);\n }\n calc(i + 1, accum, number);\n }\n\n calc(0, word[0], 1);\n console.log(answer === Infinity ? -1 : answer);\n}\n\n/*\n * Api Scanner\n */\n\nclass Scanner {\n constructor() {\n this.index = 0;\n this.lines = stdinInput.trim().split('\\n'); // eslint-disable-line\n }\n\n nextLine() {\n return this.lines[this.index++]; // eslint-disable-line\n }\n\n nextInt() {\n return parseInt(this.nextLine(), 10);\n }\n\n nextDouble() {\n return parseFloat(this.nextLine());\n }\n\n nextArray() {\n return this.nextLine().split(' ');\n }\n\n hasNext() {\n return this.index < this.lines.length;\n }\n}\n\nlet stdinInput = '';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', (input) => { stdinInput += input; });\nprocess.stdin.on('end', () => { main(); });\n", "lang": "Node.js", "bug_code_uid": "de4e57713ad75ce02f486ca82849d95c", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "ab67d89bc797930b0d8e349dd99c3ef6", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.998422712933754, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nfunction main() {\n const is = new Scanner();\n const [n, m] = is.nextArray().map(Number);\n const word = is.nextLine().split('');\n word.forEach((item, index, array) => {\n array[index] = item.charCodeAt() - 'a'.charCodeAt() + 1;\n });\n word.sort((a, b) => a - b);\n\n function theFor(i, j, accum, number) {\n if (m === number) {\n return accum;\n }\n if (j + 1 === n) {\n return -1;\n }\n\n if (word[j] - word[i] > 1) {\n return theFor(j, j + 1, accum + word[j], number + 1);\n }\n return theFor(i, j + 1, accum, number);\n }\n\n console.log(theFor(0, 1, word[0], 1));\n}\n\n/*\n * Api Scanner\n */\n\nclass Scanner {\n constructor() {\n this.index = 0;\n this.lines = stdinInput.trim().split('\\n'); // eslint-disable-line\n }\n\n nextLine() {\n return this.lines[this.index++]; // eslint-disable-line\n }\n\n nextInt() {\n return parseInt(this.nextLine(), 10);\n }\n\n nextDouble() {\n return parseFloat(this.nextLine());\n }\n\n nextArray() {\n return this.nextLine().split(' ');\n }\n\n hasNext() {\n return this.index < this.lines.length;\n }\n}\n\nlet stdinInput = '';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', (input) => { stdinInput += input; });\nprocess.stdin.on('end', () => { main(); });\n", "lang": "Node.js", "bug_code_uid": "3a60462f5a89811d494537552816b36a", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "ab67d89bc797930b0d8e349dd99c3ef6", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8329601433049709, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "function main() {\n var n = +nxt(), m = +nxt(), k = +nxt() - 1;\n function ok(val) {\n var a = [];\n a[k] = val;\n var i;\n for (i = k + 1; i < n; ++i) a[i] = Math.max(a[i - 1] - 1, 1);\n for (i = k - 1; i >= 0; --i) a[i] = Math.max(a[i + 1] - 1, 1);\n return a.reduce((x, y) => x + y, 0) <= m;\n }\n var l = 1, r = m;\n while (l < r) {\n var mid = l + ((r - l + 1) >> 1);\n if (ok(mid)) l = mid;\n else r = mid - 1;\n }\n print(l);\n}\n\nvar line = null, linepos = 0;\nfunction nxt() {\n if (!line || linepos === line.length) {\n line = readline().split(' ');\n linepos = 0;\n }\n return line[linepos++];\n}\n\nif (typeof readline == 'undefined') {\n process.stdin.resume();\n process.stdin.setEncoding('ascii');\n \n var input_stdin = \"\";\n process.stdin.on('data', function (data) { input_stdin += data; });\n process.stdin.on('end', function () {\n // input_stdin = input_stdin.split(/\\s/);\n input_stdin = input_stdin.split('\\n');\n var curline = 0;\n readline = () => input_stdin[curline++];\n if (typeof print === 'undefined') print = console.log;\n main();\n });\n} else main();\n", "lang": "JavaScript", "bug_code_uid": "7cc48270f6d0625db749370c021f0fe7", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "129abeddfc0a7cb466c0116b9c81441a", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9958734525447043, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "let stdin = process.stdin;\nstdin.setEncoding('utf8');\nstdin.on('data', function (data) {\n let input = data.split('\\n');\n console.log(solution(input[0]; input[1]));\n});\n\nconst solution = (cardOnTable, cardsInHand) => {\n if (cardsInHand.indexOf(cardOnTable[0]) >= 0 || cardsInHand.indexOf(cardOnTable[1]) >= 0){\n\treturn \"YES\";\n } else {\n\treturn \"NO\";\n }\n};", "lang": "Node.js", "bug_code_uid": "b5fec4e9130637e666c6b458f7b79050", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "76a64336a8559e59e94a947be71a5ce7", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.48031496062992124, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nlet hand = []\nrl.on('line', (input) => {\n rl.close();\n let n = parseInt(input)\n if((n-2)%3===0)\n console.log(1,2,n-3) \n else\n console.log(1,1,n-2) \n return\n})\n", "lang": "Node.js", "bug_code_uid": "09a9c9df96c0f077a1143bd14ed990c8", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "9a5bc071cb93674b1e32ae202b846574", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9938236945536215, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', function (line1) {\n let cardOnTable = line1;\n rl.on('line', function (line2) { \n let cardsInHand = line2;\n doIt(cardOnTable, cardsInHand)\n rl.close();\n });\n});\n\nfunction doIt(cardOnTable, cardsInHand) {\n const splitedCardOnTable = splitCard(cardOnTable);\n\n let ret = 'NO';\n for (let i = 0 ;i < cardsInHand.length; i++) {\n const splited = splitCard(cardsInHand[i]);\n if (splited[0] === splitedCardOnTable[0] || splited[1] === splitedCardOnTable[1]) {\n ret ='YES';\n break;\n }\n }\n\n console.log(ret);\n\n function splitCard(card) {\n const rank = card.substring(0,1);\n const suit = card.substring(1,2);\n return [rank, suit];\n };\n}", "lang": "Node.js", "bug_code_uid": "75939e40975ea01bf852b39f2639121d", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "f11ab8a50bf3d8c5cdc10dd937935f97", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9029315960912052, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "\n\n const readline = require('readline');\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n rl.question('', (value) => {\n let s = value;\n let isPalindrome = true;\n let oneLetter = true;\n console.log(Math.floor(s.length/2));\n for(let idx = 0; idx < Math.floor(s.length/2) && isPalindrome; idx += 1){\n console.log('aa',idx);\n if(s.charAt(idx) != s.charAt(s.length-idx-1)){\n console.log('bb');\n isPalindrome = false;\n }\n if(s[idx] !== s[idx+1] && oneLetter){\n oneLetter = false;\n }\n }\n if(!isPalindrome){\n console.log(s.length);\n }else if(oneLetter) {\n console.log(0);\n }else {\n console.log(s.length-1);\n }\n rl.close();\n\n });\n", "lang": "Node.js", "bug_code_uid": "9438817fa241878e933ef78092eb6210", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "95dc8600f9320529a30e90660c9633ab", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.7859569648924122, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\nrl.on('line', function(line){\n console.log(solve(line))\n })\n\nfunction solve(line){\n n = parseInt(line)\n var cnt = 0;\n while(n != 0){\n var d = n%10\n n = Math.floor(n / 10)\n if(d == 7 || d == 4)\n cnt++\n }\n if(cnt == 7 || cnt == 4)\n return 'YES'\n else\n return 'NO'\n}", "lang": "Node.js", "bug_code_uid": "bace7bd85067788874ba24528b64ed41", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "1e80b3ccce69a3a9d8056888173de2ef", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9993571887722306, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "var line_number = 0;\nconst cs = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nvar lines = {};\ncs.on(\"line\", (input) => {\n if (input == \"\") {\n cs.close();\n }\n lines[line_number] = input.split(\" \");\n line_number += 1;\n}).on(\"close\", () => {\n main();\n process.exit();\n});\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/);\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}\nfunction isInt(str) {\n return str.length === 1 && str.match(/[0-9*]/);\n}\n\nfunction print(str) {\n console.log(str);\n}\n\nfunction exit(status = 0) {\n process.exit(status);\n}\n\nfunction predict(test) {\n let op = \"\";\n let ops = [];\n let opVariables = [];\n let limits = [];\n for (let t of test) {\n // console.log(t);\n for (let i = 0; i < t.length; i++) {\n if (isOp(t[i])) {\n op = t[i];\n if (isOp(t[i + 1])) {\n op += t[i + 1];\n i += 1;\n }\n ops.push(op);\n op = \"\";\n } else if (isChr(t[i])) {\n // console.log(t[i])\n op = t[i];\n for (var j = i + 1; j < t.length; j++) {\n if (isChr(t[j]) || isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n opVariables.push(op);\n op = \"\";\n } else {\n if (i == 0 || (i > 0 && isOp(t[i - 1]))) {\n op = t[i];\n let j = i + 1;\n for (; j < t.length; j++) {\n if (isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n limits.push(op);\n op = \"\";\n }\n }\n }\n }\n\n let min = limits[0];\n let max = limits[1];\n\n let pvs = ops.map((o, i) => [o, opVariables[i]]);\n\n for (let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max;\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1];\n } else {\n print(\"input error\");\n exit();\n }\n }\n}\n\nvar n;\nfunction main() {\n n = BigInt(lines[0][0])\n predict([\"1<=n<=10**18\"]);\n print(n);\n let c = 0\n do {\n x = n % 10n;\n if (x == 4 || x == 7) {\n c += 1;\n }\n } while ((n = BigInt(n / 10n)) != 0);\n\n if( c == 4 || c == 7) {\n print(\"YES\")\n }\n else{\n print(\"NO\")\n }\n}\n", "lang": "Node.js", "bug_code_uid": "0114e0e71f741c8d6ab3882679b16f99", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "4b57c935f33d6f36c8d081e02377d782", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7654320987654321, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\n\nrl.on('line', (line) => {\n console.log(solution(line));\n});\n\nfunction solution(input) {\n for (let i = 0 ; i < input.length; i++) {\n if (!(input[i] === '4' || input[i] === '7')) {\n return 'NO';\n }\n }\n\n // default\n return 'YES';\n \n}", "lang": "Node.js", "bug_code_uid": "798c4048924939458f1e08a72732a87d", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "245d484b6dd9f587b499182de93258bd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9729064039408867, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let ans = 'NO';\n let count = 0;\n\n for (let i = 0; i < d.length; i++) {\n if (d[i] === '7' || d[i] === '4') {\n count++;\n }\n }\n\n if (count === d.length || count === 7 || count === 4) {\n ans = 'YES';\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "2ffd4a1212a1b3f2ce91cec45066ebdb", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "0c36dd9f51de3f9b8f99e4dff983f1e8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.7699018538713195, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nfunction tester(num) {\n let strs = String(num);\n let countHappyNumbers = 0;\n \n for (let i = 0; i < strs.length; i++) {\n let str = strs.charAt(i);\n\n isHappyNumber(str) && countHappyNumbers++;\n }\n \n console.log(isHappyNumber(countHappyNumbers) ? 'YES' : 'NO');\n}\n\nfunction isHappyNumber(n) {\n return Number(n) === 4 || Number(n) === 7; \n}\n\nmodule.exports = tester;", "lang": "Node.js", "bug_code_uid": "0e1c71817ebf1dcb855bdbb0d2503e89", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "a3dff5724212cb62bdef9f46c9c4a941", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9179646936656283, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n \nrl.on('line', (input) => {\n lucky = 0;\n for(let i = 0; i < input.length; i++) {\n if(input[i] == 4 || input[i] == 7) {\n lucky +=1;\n } else {\n console.log('NO');\n return rl.close();\n }\n }\n if(lucky == 4 || lucky == 7) {\n console.log('YES');\n } else {\n console.log('NO');\n }\n \n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "4b89decec175d78f05e1b6bca4c71b57", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "a94a113e187c1c386bd381f80556483d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9988505747126437, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let numberString = readLine();\n let numberArray = numberString.split('');\n let luckyDigits = [];\n for (let i = 0; i < numberArray.length; i++) {\n if (numberArray[i] === '7' || numberArray[i] === 4) {\n luckyDigits.push(numberArray[i]);\n }\n }\n if (luckyDigits.length === 7 || luckyDigits.length === 4) {\n console.log('YES');\n } else {\n console.log('NO');\n }\n}\n", "lang": "Node.js", "bug_code_uid": "37e340546c87d0e8db088aab3f527037", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "d00904d682005f6de8805aeb30ab10d1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9231738035264484, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction readAsInt(){\n return parseInt(readline());\n}\n\nfunction readAsIntList(){\n return readline().split(' ').filter(i => i).map(i => parseInt(i));\n}\n\n\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n let s = readline();\n console.log(s.match(/^[47]+$/i) && s.includes('7') && s.includes('4') ? 'YES' : 'NO' );\n}\n \n\n\n", "lang": "Node.js", "bug_code_uid": "ad9e39f92280434bacb4d812c85ac133", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "46c9e88d5c24286937f454502b6035c9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7773000859845228, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "let fs = require(\"fs\");\n\nlet txt = fs.readFileSync(0, \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0\n})\nfor (let index = 0; index < txt.length; index++) {\n doit(txt[index].split(\"\").map(data => {\n return data * 1\n }))\n}\n\nfunction doit(tab) {\n let t = tab.filter(data => {\n return data != 7 && data != 4;\n }).length;\n if (t == 0) {\n console.log(\"YES\");\n } else {\n t = tab.length - t\n if ((t % 4 == 0 || t % 7 == 0 )&& t!=0) {\n console.log(\"YES\");\n } else {\n console.log(\"NO\");\n }\n }\n\n}", "lang": "Node.js", "bug_code_uid": "aa8f56cd65720ef27ebdcb26b145d8be", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "6b8cfa973f7475442078d46452c3adfb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7725421756835369, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n// Write your code here\nfunction nameLookUp(str) {\n let input = str.trim();\n let luckyNumber = ['4', '7'];\n let strFlag = 'YES';\n for (let str of input) {\n if (luckyNumber.indexOf(str) === -1) {\n strFlag = 'No';\n break;\n }\n }\n return strFlag.toString();\n}\n", "lang": "Node.js", "bug_code_uid": "17beb1bf7106d9e78464c357ec39f4a5", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "36edd4ca2d68380c2f86f7df8faf60a8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9849315068493151, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let num = readLine()\n .split('')\n .map(value => parseInt(value));\n let only7and4 = num.filter((value) => {\n return value == 7 || value == 4;\n })\n if (only7and4.length == num.length) {\n console.log('YES');\n } else console.log('NO');\n}", "lang": "Node.js", "bug_code_uid": "755ff3ee6a624dc688f6d90ab3050211", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "c525dd2dccae26bebac13f076d49f641", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9989159891598915, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let number = parseInt(readLine());\n // let number = parseInt(numberString);\n // let n = numberString.length;\n // let result = (2 * (Math.pow(2, n) - 1)) / (2 - 1);\n // if (numberString[n - 1] === '4') {\n // result = result - 1;\n // }\n // let count = 0;\n // for (let i = 4; i <= number; i++) {\n // let iThstring = i.toString();\n // // console.log(iThstring);\n // if (\n // iThstring.includes('1') ||\n // iThstring.includes('2') ||\n // iThstring.includes('3') ||\n // iThstring.includes('5') ||\n // iThstring.includes('6') ||\n // iThstring.includes('8') ||\n // iThstring.includes('9') ||\n // iThstring.includes('0')\n // ) {\n // continue;\n // // console.log(i);\n // // count++;\n // } else {\n // count++;\n // }\n // }\n // console.log(count);\n let limit = 1000000000;\n let luckydigits = [];\n function generate(curr) {\n if (curr > limit) return;\n // if (curr) {\n luckydigits.push(curr);\n // }\n curr = curr * 10;\n generate(curr + 4);\n generate(curr + 7);\n }\n generate(0);\n delete luckydigits[0];\n luckydigits.sort((a, b) => {\n return a - b;\n });\n // generate(7);\n console.log(luckydigits.indexOf(number));\n}\n", "lang": "Node.js", "bug_code_uid": "6b7041ce1176e64e85c694a01e2304c4", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "c5fed1baae1c6336983dc9d5feddd5c8", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7780233659614777, "equal_cnt": 25, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 21, "fix_ops_cnt": 25, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let numberString = readLine();\n let number = parseInt(numberString);\n let n = numberString.length;\n // let result = (2 * (Math.pow(2, n) - 1)) / (2 - 1);\n // if (numberString[n - 1] === '4') {\n // result = result - 1;\n // }\n let count = 0;\n for (let i = 4; i <= number; i++) {\n let iThstring = i.toString();\n // console.log(iThstring);\n if (\n iThstring.includes('1') ||\n iThstring.includes('2') ||\n iThstring.includes('3') ||\n iThstring.includes('5') ||\n iThstring.includes('6') ||\n iThstring.includes('8') ||\n iThstring.includes('9') ||\n iThstring.includes('0')\n ) {\n continue;\n // console.log(i);\n // count++;\n } else {\n count++;\n }\n }\n console.log(count);\n}\n", "lang": "Node.js", "bug_code_uid": "e8c80e4fe3ecce41415bc93e63f1d019", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "c5fed1baae1c6336983dc9d5feddd5c8", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6818181818181818, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": " var str = readline().split(' ').map(x=>parseInt(x));\n var L = str[0];\n var P = str[1];\n var N = str[2];\n var F = N>0?true:false;\n for(var i = 1;i<=Math.abs(N);i++){\n if(F){\n P += 1;\n P = P<=L?P:1;\n }else{\n P -= 1;\n P = P>0?P:6;\n }\n }\n print(P);", "lang": "Node.js", "bug_code_uid": "450eed51ab5f3afb05a944222df32e20", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "c211cff6f2330106e729c6523c0aeef6", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9900090826521344, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\n \n function main() {\n var str = stdin[0].split(' ').map(x=>parseInt(x));\n var L = str[0];\n var P = str[1];\n var N = str[2];\n var F = N>0?true:false;\n for(var i = 1;i<=Math.abs(N);i++){\n if(F){\n P += 1;\n P = P<=L?P:1;\n }else{\n P -= 1;\n P = P>0?P:6;\n }\n }\n console.log(P);\n}\n\nconst readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nvar stdin = [];\nrl.on('line', function (line) {stdin.push(line);});\nrl.on('close', main);", "lang": "Node.js", "bug_code_uid": "29b24edc0b67866bd051f1eaba8d2618", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "c211cff6f2330106e729c6523c0aeef6", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6616362192216044, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction checkLuckyNumber(n) {\n let check = 1;\n for (var i = 0; i <= 9; i++) {\n if (String(n).indexOf(i) != -1 && i != 4 && i != 7) {\n check = 0;\n break;\n }\n }\n if (check == 1) return true;\n else return false;\n}\n\nfunction main() {\n let i = parseInt(readLine());\n while (true) {\n if (checkLuckyNumber(i)) {\n let p1 = String(i).split('').map(value => parseInt(value)).filter(value => value == 4)\n let p2 = String(i).split('').map(value => parseInt(value)).filter(value => value == 7)\n if (p1.length == p2.length && p1.length != 0) {\n console.log(i);\n break;\n }\n i++;\n } else i++;\n }\n}", "lang": "Node.js", "bug_code_uid": "3be1dc8db7837020e3b4e602b0c56c26", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "5756e92714c18b37e67497795041879a", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.28738431563565514, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 9, "insert_cnt": 1, "fix_ops_cnt": 22, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n inputs.push(lineInput)\n})\n\nrl.on('close', () => {\n\n let string = inputs[0];\n let words = [];\n\n search(string, 0)\n\n function search(string, start) {\n\n for (let i = start; i < string.length; i++) {\n\n let next = string[i + 1] + string[i + 2] + string[i + 3];\n\n if (string[i] == 'B' && !nextIsWUB(next)) {\n let word = '';\n\n do {\n\n i++;\n word += string[i];\n\n } while (!nextIsWUB(string[i + 1] + string[i + 2] + string[i + 3]))\n\n words.push(word);\n console.log(words)\n }\n\n if (i <= string.length) {\n return search(string, i + 1)\n }\n\n return console.log(words)\n }\n\n }\n\n\n\n // while (!nextIsWUB(next)) {\n // i++;\n // word += string[i];\n // resumeFrom = i + 1;\n // }\n\n // words.push(word);\n\n // if (resumeFrom == string.length) {\n // return console.log(words.join(' '))\n // }\n\n // return search(string)\n\n\n\n function nextIsWUB(next) {\n return next === \"WUB\"\n }\n\n})", "lang": "Node.js", "bug_code_uid": "029108625147b089421235b697585112", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "21734ce32368faa5806738936c46bcdd", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.958273381294964, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline')\n\nlet inputs = []\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n// Read Inputs\nrl.on('line', lineInput => {\n let s = lineInput\n let sentence = []\n let words = []\n\n for (let i = 0; i < s.length; i++) {\n while (s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B') {\n i += 3\n }\n let word = s[i]\n while (nextNotWUB(s, i) && i < s.length - 1) {\n i++\n word += s[i]\n }\n words.push(word)\n i += 3\n }\n\n\n console.log(words.join(' '))\n\n function nextNotWUB(s, i) {\n return s[i + 1] != 'W' && s[i + 1] != 'U' && s[i + 2] != 'B'\n }\n})\n\nrl.on('close', () => {})", "lang": "Node.js", "bug_code_uid": "694339d41fb4b22e5ed492aeb43d1a14", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "21734ce32368faa5806738936c46bcdd", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9979879275653923, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "var stdin = process.openStdin();\n\nstdin.addListener(\"data\", function(d) {\n // note: d is an object, and when converted to a string it will\n // end with a linefeed. so we (rather crudely) account for that \n // with toString() and then trim() \n d = d.toString().trim();\n var arr = d.split('DUB');\n for( var i = 0; i < arr.length; i++){ \n if ( arr[i] === '') {\n arr.splice(i, 1); \n i--;\n }\n }\n \n console.log(arr.join(' '));\n \n });", "lang": "Node.js", "bug_code_uid": "a977e9ca2030f8fa1ee40d21bfd2ad71", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "515d408641e884d6367d93854b6dd2df", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8978328173374613, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', (input) => {\n let len=input.length;\n let met=false;\n for(let i=0;i {\n var N = input.length;\n var meet = false;\n for (let i = 0; i < N - 1; i++) {\n if (input[i] == '/' && input[i + 1] != '/')\n rl.write(\"/\");\n\n else if (input[i] != '/') {\n rl.write(input[i]);\n meet = true;\n }\n }\n if (input[N - 1] != '/' || !meet)\n rl.write(input[N - 1]);\n\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "74080d357f93c2896aaa82a78328ed13", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "edc625d70267bf846d468483aa4a24d4", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9670821348673697, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n// utils\nconst MOD = 1e9 + 7;\nconst mod = (n) => ((n % MOD) + MOD) % MOD;\nconst add = (a, b) => mod(mod(a) + mod(b));\nfunction mul() {\n for (var a = arguments, r = a[0], i = a.length; --i; )\n r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;\n return r;\n}\nfunction inv(b) {\n for (var a = MOD, u = 0, v = 1, t; b; v = t)\n (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);\n u %= MOD;\n return u < 0 ? u + MOD : u;\n}\n\nfunction main() {\n const n = +readLine();\n\n function countAlmostPrimes(n) {\n const primes = getAllPrimesUpto(n);\n let almostPrimeCount = 0;\n\n for (let i = 1; i <= n; i++) {\n let count = 0;\n let j = 0;\n while (primes[j] < i && j <= n) {\n if (i % primes[j] === 0) count++;\n if (count >= 2) {\n almostPrimeCount++;\n break;\n }\n j++;\n }\n }\n return almostPrimeCount;\n }\n\n console.log(countAlmostPrimes(n));\n}\n\nfunction getAllPrimesUpto(n) {\n const primes = [];\n for (let i = 2; i <= n; i++) {\n let isPrime = true;\n for (let j = 2; j <= Math.floor(Math.sqrt(i)); j++) {\n if (i % j === 0) {\n isPrime = false;\n break;\n }\n }\n if (isPrime) primes.push(i);\n }\n\n return primes;\n}\n", "lang": "Node.js", "bug_code_uid": "6406d2acd62f750f03f1bd4dc78da974", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "96566807dec5c196a547a34b4586e3d6", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9644225506294472, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nconst getPrimes = () => {\n const maxN = 25;\n const arr = new Array(maxN + 1).fill(1);\n arr[0] = 0;\n arr[1] = 0;\n\n for (let i = 2; i*i <= maxN; i++) {\n if (arr[i]) {\n for (let j = i*i; j <= maxN; j += i) {\n arr[j] = 0;\n }\n }\n }\n\n const primes = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]) {\n primes.push(i);\n }\n }\n\n return primes;\n}\n\nrl.on('line', (d) => {\n const primes = getPrimes();\n\n let ans = 0;\n\n for (let i = 6; i <= +d; i++) {\n let primeDivisors = 0;\n for (let p = 0; p < primes.length; p++) {\n if (primes[p] > i) {\n break;\n }\n\n if (i % primes[p] === 0) {\n primeDivisors++;\n }\n }\n\n if (primeDivisors === 2) {\n ans++;\n }\n }\n\n console.log(ans);\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "2924ffe8a68a641e400f003a14ee2224", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "15ef05c173e40b9136156a693c2e892f", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7669773635153129, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n operate(lines); \n});\n\n\nfunction operate(lines){\n line1=lines[0].split(' ');\n console.log(line1[0]);\n console.log(line1[1]);\n}\n", "lang": "Node.js", "bug_code_uid": "b48e9b7a246c82ef992fd3f797978be6", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "2f14245023fa58542d6296c6c37722dc", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9125840537944284, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nconst isVowel = (char) => {\n return [\"a\", \"o\", \"u\", \"i\", \"e\"].includes(char);\n}\n\nrl.on('line', (str) => {\n let ans = 'YES';\n\n for (let i = 1; i < str.length; i++) {\n if (!isVowel(str[i]) && !isVowel(str[i - 1]) && str[i - 1] !== 'n') {\n ans = 'NO';\n break;\n }\n }\n\n console.log(ans);\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "81abacf723ca63a18a5479e5c5f0c1be", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "25780bf9415c7d080f7c1ca3cff01e51", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9602233077459874, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "var readline = require('readline');\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\n// 자음\nvar j = [ 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z' ];\n\n// 모음\nvar m = [ 'a', 'o', 'u', 'i', 'e', 'n' ];\n\n// 반드시 자음 + 모음\n// 모음 + (자 or 모), n + (자 or 모)\n\nrl.on('line', function(line) {\n\tif(!line) {\n\t\tprocess.exit()\n }\n\n var w = line;\n var v = true;\n\n for(var i = 0; i < w.length; i++) {\n if(j.indexOf(w[i]) > -1) {\n // w[i]가 자음\n if(m.indexOf(w[i + 1]) === -1) {\n v = false;\n break;\n }\n\n continue;\n }\n\n }\n\n console.log(v ? 'YES' : 'NO');\n})\n", "lang": "Node.js", "bug_code_uid": "039f8041586b6ef63af6543b93f391d5", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "eb35734364cb9f4d27d6993601217b03", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9915254237288136, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "//4A\nconst readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.question('', (answer) => {\n rl.close()\n let word = answer.toLowerCase()\n let noVowel = word.replace(/a|e|i|o|u/gi, \"\")\n let wordArray = noVowel.split(\"\")\n let finishedArray = []\n wordArray.forEach(function(word) {\n finishedArray.push(`.${word}`)\n })\n let finalword = finishedArray.join(\"\")\n console.log(finalword)\n});", "lang": "Node.js", "bug_code_uid": "75cb4e222c725771281b6c9decee7087", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "b1ea60a834f61a1939f8abfbbe731550", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9843659525188188, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nlet inputString = \"\";\nlet currentLine = 0;\n\nprocess.stdin.on('data', (data) => {\n inputString += data;\n});\n\nprocess.stdin.on('end', () => {\n inputString = inputString.trim().split(\" \");\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction getChange(string) {\n string = string.toLowerCase();\n resStr = \"\";\n for(let i=0; i { \n if( !character.match(/[aeiou]/gi) ){\n newString += `.${character}`;\n }\n};\nprocess.stdin.once('data', (input) => {\n Array.from( input.toString().trim().toLowerCase() ).map( ( char ) => transformString( char ) ); \n console.log(newString);\n process.exit();\n});\n", "lang": "Node.js", "bug_code_uid": "b9c9dc48c52f61fb0a0539de62cd41c1", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "a40d3d3a610c23a3db4d27696e954229", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9745308310991957, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n \n function process(str) {\n str = str.toLowerCase();\n var arr = str.split(\"\");\nvar value = \"i\";\n var value2 = \"a\";\n var value3 = \"u\";\n var value4 = \"o\";\n var value5 = \"y\";\n arr = arr.filter(function(item) {\n return (item !== value && item!== value2 && item!== value3 && item!== value4 && item!== value5);\n \n});\n \n \n arr.forEach(function(element,index,array) {\n array[index] = \".\" + element;\n })\n \n var newString = arr.join(\"\");\n console.log(newString);\n \n \n \n \n \n }\n \nprocess(lines[0]);\n \n \n})", "lang": "Node.js", "bug_code_uid": "36550a279210ef66198e11a0378a341e", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "b886d2b7f17458c717d2ce2acf9c71db", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9703903095558546, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n \n function process(str) {\n str = str.toLowerCase();\n var arr = str.split(\"\");\nvar value = \"i\";\n var value2 = \"a\";\n var value3 = \"u\";\n var value4 = \"o\";\n var value5 = \"y\";\n arr = arr.filter(function(item) {\n return (item !== value && item!== value2 && item!== value3 && item!== value4 && item!== value5);\n \n});\n\n \n arr.forEach(function(element,index,array) {\n array[index] = \".\" + element;\n })\n\n var newString = arr.join(\"\");\n console.log(newString);\n \n \n \n \n \n }\n\nprocess(lines);\n \n \n})", "lang": "Node.js", "bug_code_uid": "07ed5ee28cfb46b6758e412ab8acbd14", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "b886d2b7f17458c717d2ce2acf9c71db", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9959016393442623, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\nfunction main() {\n let w = readline();\n let result =\"\";\n const vow = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n for(const letter of w){\n const lowerTerm = letter.toLowerCase();\n if(vow.indexOf(lowerTerm) == -1){\n result += `.${lowerTerm}`;\n }\n }\n console.log(result);\n}\n", "lang": "Node.js", "bug_code_uid": "32e786d4f13762f15d4cf02c4b5aab7a", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "4b820f9476747754737e1f505976be4c", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.995483288166215, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\n\nlet inputs = [];\nconst vowels = ['a', 'o', 'e', 'u', 'i'];\n\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\nrl.on('line', lineInput => {\n inputs.push(lineInput);\n rl.close();\n})\n\n\nrl.on('close', () => {\n\n let word = inputs[0];\n \n word = word.split('').filter(char => {\n if (!vowels.includes( char.toLowerCase() ))\n return char\n }).map(char => {\n return `.${char}`\n }).join('').toLowerCase()\n\n console.log(word)\n})", "lang": "Node.js", "bug_code_uid": "aef5f3333097b2882199716031ef5eb8", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "6e4fbc03059dab53d5890147c2981613", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7923076923076923, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nconst solution = (input) => {\n const str = input;\n const vowels = [\"A\", \"O\", \"Y\", \"E\", \"U\", \"I\"];\n const vowelsLowerCase = vowels.map((item) => {\n return item.toLowerCase();\n });\n\n const arr = Array.from(str);\n\n for(let i = 0; i {\n solution(input);\n});", "lang": "Node.js", "bug_code_uid": "f2462dffd64c55633e9d4239595a8876", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "7b380d05ecac66ded31d3545c422e87a", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6978785662033651, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const { stderr } = require(\"process\");\n\nconst readline = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nreadline.on(\"line\", (line) => {\n const str = line.split(\" \")[0];\n readline.close();\n main(str);\n return;\n});\n\nconst main = (str) => {\n const string = str.toLowerCase();\n const vowelSet = new Set([\"a\", \"o\", \"y\", \"e\", \"u\", \"i\"]);\n let result = \"\";\n const stringArr = [...string];\n\n stringArr.forEach((val, index) => {\n const prevChar = result[result.length - 1];\n if (vowelSet.has(val)) {\n if (!prevChar || (prevChar && prevChar !== \".\")) {\n result += \".\";\n }\n } else {\n if ((prevChar && prevChar !== \".\") || index === 0) {\n result += \".\";\n }\n result += val;\n }\n });\n};\n", "lang": "Node.js", "bug_code_uid": "d4b4418169c2c247e5924da2f51a4d0a", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "2c5a2f8ee78752da8ed7695c286cffca", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8269410664172123, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"ascii\");\n_input = \"\";\nprocess.stdin.on(\"data\", function (input) {\n _input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n processData(_input);\n});\n\nfunction processData(input) {\n let vowels = \"aeiouy\"\n let result = \"\"\n for(let i=0;i ipt += s)\nprocess.stdin.on('end', () => {\n const [a, b] = ipt.split(EOL).slice(0, -1)[0].split(' ').map(v => parseInt(v))\n\n let [x, y] = [0, 0]\n for (let i = 1; i <= a * b; i++) {\n if (!(i % a) && !(i % b)) {\n if (a > b) x++\n else y++\n continue\n }\n if (!(i % a)) x++\n if (!(i % b)) y++\n }\n\n console.log(x < y ? 'Masha' : x > y ? 'Dasha' : 'Equal')\n})", "lang": "Node.js", "bug_code_uid": "175bfd034c8a330c48cb3b0986721c2c", "src_uid": "06eb66df61ff5d61d678bbb3bb6553cc", "apr_id": "d2c3957e5cc36db083abdb3b739cfc3f", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6908051453072892, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "'use strict'\n\nconst {EOL} = require('os')\n\nlet ipt = ''\nprocess.stdin.on('data', s => ipt += s)\nprocess.stdin.on('end', () => {\n const [a, b] = ipt.split(EOL)[0].split(' ').map(v => parseInt(v))\n\n const da = []\n const db = []\n\n let [c, d] = [a, b]\n let i = 2\n while (c > 1) {\n while (!(c % i)) {\n c /= i\n da.push(i)\n }\n i++\n }\n i = 2\n while (d > 1) {\n while (!(d % i)) {\n d /= i\n db.push(i)\n }\n i++\n }\n\n let p = 1\n if (a > b) {\n for (let i = 0; i < db.length; i++) {\n const ioa = da.indexOf(db[i])\n if (~ioa) da.splice(ioa, 1)\n }\n p = a / da.reduce((p, v) => p * v, 1)\n console.log(a - p > b ? 'Masha' : a - p < b ? 'Dasha' : 'Equal')\n } else if (a < b) {\n for (let i = 0; i < da.length; i++) {\n const iob = da.indexOf(db[i])\n if (~iob) db.splice(iob, 1)\n }\n p = b / db.reduce((p, v) => p * v, 1)\n console.log(b - p > a ? 'Dasha' : b - p < a ? 'Masha' : 'Equal')\n }\n\n // if (a - b > 1) console.log('Masha')\n // else if (b - a > 1) console.log('Dasha')\n // else console.log('Equal')\n})", "lang": "Node.js", "bug_code_uid": "acf55f372f40815083ea671728a4f70e", "src_uid": "06eb66df61ff5d61d678bbb3bb6553cc", "apr_id": "d2c3957e5cc36db083abdb3b739cfc3f", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6766798418972332, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet n, k;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n [n, k] = d.split(' ').map(Number);\n return;\n }\n\n const arr = d.split(' ').map(Number);\n let ans = 0;\n let stopIndex = 0;\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] <= k) {\n ans++;\n }\n else {\n stopIndex = i;\n break;\n }\n }\n\n if (stopIndex !== 0) {\n for (let j = arr.length - 1; j > stopIndex; j--) {\n if (arr[j] <= k) {\n ans++;\n }\n else {\n break;\n }\n }\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "ad4e4bdd262f6066188e83bc7877fb89", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "7bafbb5620da28f81a48f0490edb4ce0", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.42237586423632933, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "const math = require('mathjs')\nconst readline = require('readline');\n\nlet inputs = [];\nconst mod = 10 ** 7;\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', inputLine => {\n let seq = [];\n let odds = [];\n let evens = [];\n const num = inputLine.split(' ').map(num => parseInt(num))[0];\n const x = inputLine.split(' ')[1];\n\n\n for (let i = 1; i <= num; i++) {\n if (i % 2 == 0)\n evens.push(i)\n else\n odds.push(i)\n }\n\n seq = [...seq, ...odds, ...evens]\n console.log(seq[parseInt(x - 1)])\n})\n\n\n// Exec\nrl.on('close', data => {\n\n})\n\n\n", "lang": "Node.js", "bug_code_uid": "fab3db89f4a58d81bc757a144dc8274b", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "4c3a5484f764424596572ef83fdbd5bc", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4425249169435216, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\n// Read Inputs\nrl.on('line', inputLine => {\n let seq = [];\n let odds = [];\n let evens = [];\n const num = inputLine.split(' ').map(num => parseInt(num))[0];\n const x = inputLine.split(' ')[1];\n\n\n for (let i = 1; i <= num; i++) {\n if (i % 2 === 0)\n evens.push(i);\n else\n odds.push(i);\n }\n\n seq = [...seq, ...odds, ...evens];\n console.log(seq[parseInt(x - 1)]);\n});\n", "lang": "Node.js", "bug_code_uid": "2638122c367022cd476561dbd9c0e3aa", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "4c3a5484f764424596572ef83fdbd5bc", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5135467980295566, "equal_cnt": 19, "replace_cnt": 17, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\n// Read Inputs\nrl.on('line', inputLine => {\n let seq = [];\n const max = parseInt(inputLine.split(' ')[0]);\n const oddEnd = Math.floor(max / 2)\n const idx = parseInt(inputLine.split(' ')[1]);\n\n if (idx === 1 && max == 1)\n return console.log(1);\n\n if (idx <= oddEnd) {\n return console.log(((idx - 1) * 2) + 1)\n } else if (idx > oddEnd && idx <= max) {\n if (max % 2 === 0)\n return console.log((idx - oddEnd) * 2)\n else\n return console.log(((idx - oddEnd) * 2) - 2)\n }\n\n\n});\n", "lang": "Node.js", "bug_code_uid": "13d048b693fd1d6876600b2eb0950a0f", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "4c3a5484f764424596572ef83fdbd5bc", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5138248847926268, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const [n, k] = d.split(' ').map(Number);\n let ans = 0;\n let inc = 1;\n\n for (let i = 1; i <= n; i += 2) {\n\n if (inc === k) {\n ans = i;\n break;\n }\n\n inc++;\n }\n\n if (inc !== k) {\n for (let i = 2; i <= n; i += 2) {\n if (inc === k) {\n ans = i;\n break;\n }\n inc++;\n }\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "3f522163d6aa3fd5b4b62a822ce39c82", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "5536f0bd3b7e1b9b65c9d8ce8caa9626", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6412429378531074, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let [n, k] = d.split(' ').map(Number);\n let ans = 1;\n\n while (k > 1) {\n if (ans + 2 <= n) {\n ans += 2;\n }\n else {\n ans = 2;\n }\n k--;\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "83c4a2e27d2c63fa4bf6284f9d151b40", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "5536f0bd3b7e1b9b65c9d8ce8caa9626", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6879562043795621, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n let answer = 0;\n let [n, k] = input[0].split(' ').map(x => parseInt(x));\n \n if (k >= n) {\n k -= Math.ceil(n/2);\n if (k === 0) console.log(2);\n else console.log(k*2);\n } else {\n console.log(k*2 - 1);\n }\n});", "lang": "Node.js", "bug_code_uid": "4c4b76b416722c2feffecfe5945c1f9b", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "10ecb0de03bdb5ddc6dcdb519789c7a5", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9064935064935065, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction multiply(a, b) {\n\ta = a.toString(10).split('').reverse();\n\tb = b.toString(10).split('').reverse();\n\n\tif (a.length < b.length) {\n\t\t[a, b] = [b, a];\n\t}\n\n\tlet res = Array(a.length + b.length).fill(0);\n\tfor (let i = 0, lb = b.length; i < lb; ++i) {\n\t\tlet carry = 0;\n\t\tlet scarry = 0;\n\t\tfor (let j = 0, la = a.length; j < la; ++j) {\n\t\t\tlet m = b[i] * a[j];\n\t\t\tm += carry;\n\n\t\t\tif (m > 9) {\n\t\t\t\tlet [c, d] = m.toString(10).split('');\n\t\t\t\tres[i + j] += (scarry >> 0) + (d >> 0);\n\t\t\t\tcarry = c >> 0;\n\t\t\t} else {\n\t\t\t\tres[i + j] += (scarry >> 0) + m;\n\t\t\t\tcarry = 0;\n\t\t\t}\n\n\t\t\tif (res[i + j] > 9) {\n\t\t\t\tlet [c, d] = res[i + j].toString(10).split('');\n\t\t\t\tres[i + j] = d >> 0;\n\t\t\t\tscarry = c;\n\t\t\t} else {\n\t\t\t\tscarry = 0;\n\t\t\t}\n\t\t}\n\t\tif (carry > 0) res[a.length + i] = carry;\n\t\tif (scarry > 0) res[a.length + i] = scarry;\n\t}\n\n\tres.reverse();\n\tlet mulVal = '';\n\tlet flag = false;\n\tres.forEach(d => {\n\t\tif (!flag && d !== 0) flag = true;\n\t\tif (flag) mulVal += d;\n\t});\n\treturn mulVal;\n}\n\nfunction main() {\n\tlet [n, k] = readLine()\n\t\t.split(' ')\n\t\t.map(x => parseInt(x));\n\tlet s = {};\n\tlet op = Math.ceil(n / 2);\n\tlet x = 1;\n\tfor (let i = 1; i <= n; i++) {\n\t\tif ((i & 1) === 1) {\n\t\t\ts[x++] = i;\n\t\t} else {\n\t\t\ts[op + x - 1] = i;\n\t\t}\n\t}\n\tconsole.log(s[k]);\n}\n", "lang": "Node.js", "bug_code_uid": "406b9017b446fb2c8662c14ea1a200de", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "977f66c86f1e1995044514ebba0a3a42", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.747866563227308, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [n, position] = readLine().split(' ').map(Number);\n // let odds = [];\n // let evens = [];\n let result = [];\n for (let i = 1; i <= n; i++) {\n // if (i % 2 === 0) {\n // evens.push(i);\n // } else {\n // odds.push(i);\n // }\n if (i % 2 !== 0) {\n result.push(i);\n } else {\n continue;\n }\n }\n for (let i = 1; i <= n; i++) {\n if (i % 2 === 0) {\n result.push(i);\n } else {\n continue;\n }\n }\n // let final = [...odds, ...evens];\n console.log(result[position - 1]);\n}\n", "lang": "Node.js", "bug_code_uid": "16b8c21ef8cb52dc2d7095c2c9ef2cb9", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "dc299845fe8e08b62a1e6517cf326db7", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7087268605969022, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 20, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n // let [n, position] = //readLine().split(' ').map(Number);\n // let odds = [];\n // let evens = [];\n let result = [];\n for (let i = 1; i <= readLine().split(' ').map(Number)[0]; i++) {\n // if (i % 2 === 0) {\n // evens.push(i);\n // } else {\n // odds.push(i);\n // }\n if (i % 2 !== 0) {\n result.push(i);\n } else {\n continue;\n }\n }\n for (let i = 1; i <= n; i++) {\n if (i % 2 === 0) {\n result.push(i);\n } else {\n continue;\n }\n }\n // let final = [...odds, ...evens];\n console.log(result[readLine().split(' ').map(Number)[1] - 1]);\n}\n", "lang": "Node.js", "bug_code_uid": "d6e39a77b57fe04b46d1dd23a720ab6b", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "dc299845fe8e08b62a1e6517cf326db7", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9855946398659966, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [n, position] = readLine().split(' ').map(Number);\n // let odds = [];\n // let evens = [];\n // let result = [];\n // for (let i = 1; i <= n; i++) {\n // // if (i % 2 === 0) {\n // // evens.push(i);\n // // } else {\n // // odds.push(i);\n // // }\n // if (i % 2 !== 0) {\n // result.push(i);\n // } else {\n // continue;\n // }\n // }\n // for (let i = 1; i <= n; i++) {\n // if (i % 2 === 0) {\n // result.push(i);\n // } else {\n // continue;\n // }\n // }\n // // let final = [...odds, ...evens]; // [1,3,5,7,9,11,13,2,4,6,8,10,12]\n // console.log(result[position - 1]); [1,3,5,7,2,4,6,8]\n let partition;\n if (n % 2 === 0) {\n partition = n / 2;\n } else {\n partition = n / 2 + 1;\n }\n let final;\n if (position <= partition) {\n final = position * 2 - 1;\n } else {\n final = (position - partition) * 2;\n }\n console.log(final);\n}\n", "lang": "Node.js", "bug_code_uid": "acb51e4e13ed96724f68ff437411b488", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "dc299845fe8e08b62a1e6517cf326db7", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7752525252525253, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadline.on('line', line => input.push(line));\n\nreadline.on('close', () => {\n const [n, k] = Array.from(input[0].split(' '), v => parseInt(v));\n if (k <= ((n / 2) + n % 2)) console.log(k * 2 - 1);\n else console.log((k - (n / 2) + n % 2) * 2);\n});\n", "lang": "Node.js", "bug_code_uid": "5f49b499d72a7745b9a777519cb2c394", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "5185ce28eb96d8c397eb05b9bc69b160", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6453943407585792, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf8')\n\nlet currentLine = 0\nlet inputString = ''\n\nprocess.stdin.on('data', chunk => {\n inputString += chunk\n})\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(line => {\n return line.trim()\n })\n main()\n})\n\nfunction readLine() {\n return inputString[currentLine++]\n}\n\nfunction main() {\n const [n, m] = readLine().trim().split(' ').map(Number)\n const middle = +(n/2);\n\n if(n % 2 === 0) {\n if(m <= middle) {\n console.log(m * 2 - 1);\n } else {\n console.log(m * 2 - m);\n }\n } else if(n % 2 !== 0) {\n if(m <= middle) {\n console.log(m * 2 - 1);\n } else {\n console.log((m*2) - (m+1));\n }\n }\n\n}", "lang": "Node.js", "bug_code_uid": "01dc6d7e4ded0af3a4d19ba4e749a5d0", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "28f5c05dcf667d728031b39fc9189f1d", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5710659898477157, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf8')\n\nlet currentLine = 0\nlet inputString = ''\n\nprocess.stdin.on('data', chunk => {\n inputString += chunk\n})\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(line => {\n return line.trim()\n })\n main()\n})\n\nfunction readLine() {\n return inputString[currentLine++]\n}\n\nfunction main() {\n const [n, m] = readLine().trim().split(' ')\n arr = []\n for (let i = 1; i <= n; i++) {\n if (i % 2 !== 0) {\n arr.push(i)\n }\n }\n for (let i = 2; i <= n; i++) {\n if (i % 2 === 0) {\n arr.push(i)\n }\n }\n // console.log(arr)\n console.log(arr[m-1])\n}", "lang": "Node.js", "bug_code_uid": "4c0b9e3394e34c1cb1733baed70237d8", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "28f5c05dcf667d728031b39fc9189f1d", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5204918032786885, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "let fs = require(\"fs\");\n\nlet txt = fs.readFileSync(0, \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0;\n});\nfor (let i = 0; i < txt.length; i++) {\n let info = txt[i].split(\" \");\n doit(info[0] * 1, info[1] * 1);\n}\n\nfunction doit(m, a) {\n let odd=[],even=[];\n for (let i = 1; i <= m; i++) {\n if(i%2==1){\n odd.push(i);\n }else{\n even.push(i);\n }\n \n }\n odd=odd.concat(even);\n console.log(odd[a-1]);\n\n}", "lang": "Node.js", "bug_code_uid": "9245fa6715f61f6fbe41b02bf86077a3", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "8e5306d8a0abd6e0d5fd4acc9a3344c9", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7695800227014756, "equal_cnt": 32, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 23, "fix_ops_cnt": 31, "bug_source_code": "let fs=require('fs');\n\nlet txt=fs.readFileSync(0,\"utf-8\").split(\"\\r\\n\").filter(data=>{return data.length>0});\n\nfor (let i = 0; i < txt.length; i++) {\n let info=txt[i].split(\" \").filter(data=>{return data.length>0});\n}\n\nfunction doit(n,index){\n if(index{return data.length>0});\n\nfor (let i = 0; i < txt.length; i++) {\n let info=txt[i].split(\" \").filter(data=>{return data.length>0});\n doit(info[0]*1,info[1]*1-1);\n}\n\nfunction doit(n,index){\n if(index {\n console.log(doit(numbers.split(' ')));\n rl.close();\n});\n\nrl.on(\"close\", () => {\n process.exit(0);\n});\n\nconst doit = (numbers) => ((+numbers[0] / +numbers[1]) > 1) && ((+numbers[0] / +numbers[2]) > 1) ? \"Yes\" : \"No\";\n\n", "lang": "Node.js", "bug_code_uid": "dc962ff2c174dd4862ff7fef074551c6", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "3a251158beb55db3bbf8c238c05d1dec", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8660351826792964, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "function main() {\n // write code here:\n var arr=stdin[0].split(' '),s;\n s=(arr[0] {\n input.push(parseInt(line));\n});\n\nRL.on('close', () => {\n let {0:n, 1:m, 2:k} = {...input[0].split(' ')};\n n = parseInt(n); m = parseInt(m); k = parseInt(k);\n\n if(m >= n && k >= n)\n console.log('Yes');\n else\n console.log('No');\n});\n\n", "lang": "Node.js", "bug_code_uid": "edce4ebaad8b68bb6a4ac434a62e7296", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "ef0ecc3242277b3cc338cbdf8017b502", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9991204925241864, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "/**\n * Created by ishanarora on 25/11/18.\n */\n\nconst stdin = process.openStdin();\nlet content = ``;\nstdin.addListener('data', d => {\n content += d.toString();\n});\n\nstdin.addListener('end', () => {\n content = content.split(\"\\n\");\n let content_one = content[0].split(\" \");\n let total_cities = parseInt(content_one[0]);\n let a = parseInt(content_one[1]);\n let array = content[1].split(\" \");\n console.log(totalCriminalCatch(total_cities, a, array));\n});\n\n\n\n\nfunction totalCriminalCatch(totalCities, a, ti) {\n\n ti = ti.map(Number);\n let count = 0;\n\n for (var i = 0; i < 100; i++) {\n\n let a1 = (a - 1 - i >= 0 && ti[a - 1 - i] > 0) || a - 1 - i < 0;\n let a2 = (a - 1 + i < totalCities && ti[a - 1 + i] > 0) || a - 1 + i > totalCities\n\n if (a1 && a2) {\n if (i == 0) {\n count += 1;\n } else {\n\n if ((a - 1 - i >= 0 && ti[a - 1 - i] > 0)) {\n count++;\n }\n\n if ((a - 1 + i < totalCities && ti[a - 1 + i] > 0)) {\n count++;\n }\n }\n }\n }\n\n return count;\n}\n\n", "lang": "Node.js", "bug_code_uid": "da1b4f6633d34896d74ae95992557761", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "2d4ac50f3e0247d503628c8e6856240b", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.43407310704960833, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "let i = ''\n\nprocess.stdin.on('data',c => {\n i += c\n})\n\nprocess.stdin.on('end', () => {\n const { EOL } = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n\n\n let citiesCount = parseInt(lines[0].split(\" \")[0])\n let limakCity = parseInt(lines[0].split(\" \")[1])\n\n let criminals = lines[1].split(\" \").map( value => {\n return parseInt(value)\n })\n\n let distanceCount = 0\n let caughtCriminalsCount = 0\n for(i = limakCity - 1; i < citiesCount ; i++){\n let leftNumberOfCriminals = 0\n let rightNumberOfCirminals = criminals [ i ]\n \n if (i - distanceCount > 0) {\n leftNumberOfCriminals = criminals[i - distanceCount]\n }\n\n if(rightNumberOfCirminals + leftNumberOfCriminals == 2) {\n if (i === limakCity - 1) {\n caughtCriminalsCount++\n } else {\n caughtCriminalsCount = caughtCriminalsCount + 2\n }\n }\n\n distanceCount++\n }\n console.log(caughtCriminalsCount)\n})", "lang": "Node.js", "bug_code_uid": "8c10c3c491762f8376590dc7def8735a", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "6362dd2d66e337b22fdbc0495e248fb7", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9426751592356688, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let n = +d;\n\n const soroban = {\n 0: 'O-|-OOOO',\n 1: 'O-|O-OOO',\n 2: 'O-|OO-OO',\n 3: 'O-|OOO-O',\n 4: 'O-|OOOO-',\n 5: '-O|-OOOO',\n 6: '-O|O-OOO',\n 7: '-O|OO-OO',\n 8: '-O|OOO-O',\n 9: '-O|OOOO-',\n };\n\n while (n > 0) {\n const digit = n % 10;\n n = Math.floor(n / 10);\n\n console.log(soroban[digit]);\n }\n\n});\n", "lang": "Node.js", "bug_code_uid": "7dcf51b6750c163c7984dd5c3d7addfd", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "2e17721815da4eb56ae9acc7879f83ac", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9544468546637744, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\nconst sol = () => {\n let num = Number(data.split(/\\n/g)[0]);\n let result = [];\n while (num > 0) {\n let d = num%10;\n num = Math.trunc(num/10);\n result.push(((d >= 5)?'-O':'O-') + \n '|' +\n ['-OOOO', 'O-OOO', 'OO-OO', 'OOO-O', 'OOOO-'][d%5]);\n \n }\n console.log(result.join('\\n'));\n};\nprocess.stdin.on('end', sol);", "lang": "Node.js", "bug_code_uid": "677d86113b2639d498df0ad2f83eefeb", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "bbfbc6addafc526900e4ad07f4bc6222", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6671270718232044, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "const readline = require(\"readline\")\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet arrOfShoes\nlet similarCounter = 0\n\nrl.on(\"line\", (input) => {\n if (!arrOfShoes) {\n arrOfShoes = input.split(\" \").map(Number)\n }\n if (arrOfShoes) {\n arrOfShoes.forEach((element1, index1) => {\n arrOfShoes.forEach((element2, index2) => {\n if (element1 === element2 && index1 != index2)\n similarCounter++\n })\n });\n switch (similarCounter) {\n case 12:\n console.log(12/4)\n rl.close();\n break;\n case 6 :\n console.log(6/3)\n rl.close();\n break;\n case 2 :\n console.log(2/2) \n rl.close(); \n default:\n break;\n }\n }\n})", "lang": "Node.js", "bug_code_uid": "3d5a09c91bccad4647735fd2cec5a8f8", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "36c792457d1f43f4e9e21baf8f452042", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9884169884169884, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let shoesArray = readLine().split(' ').map(Number);\n let selecTed = [];\n for (let i = 0; i < shoesArray.length; i++) {\n if (selecTed.indexOf(shoesArray[i] === -1)) {\n selecTed.push(shoesArray[i]);\n }\n }\n let result = shoesArray.length - selecTed.length;\n console.log(result);\n}\n", "lang": "Node.js", "bug_code_uid": "9e8a1caff3ed9af751352d0b17582bed", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "051eee2cfb27990e53f86649bae30fbf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9877641824249166, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nlet cups = []\nlet medals = []\n\nrl.on('line', (input) => {\n if (l === 0) {\n cups = input.split(' ').map(function (item) {\n return parseInt(item, 10);\n });\n } else if (l === 1) {\n medals = input.split(' ').map(function (item) {\n return parseInt(item, 10);\n });\n } else {\n function add(a, b) {\n return a + b;\n }\n rl.close();\n let shelfs = parseInt(input)\n var cupsSum = cups.reduce(add, 0);\n var medalsSum = medals.reduce(add, 0);\n shelfs-=cupsSum/5\n shelfs-=medalsSum/10\n if(shelfs>=0){\n console.log(\"YES\")\n return 0\n }\n console.log(\"NO\")\n\n return 0;\n }\n l++\n});\n", "lang": "Node.js", "bug_code_uid": "302890117e5a243aecbebf9797006bab", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "630943ee7fa15290a7376e01fa549c93", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9954954954954955, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require(\"readline\")\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet pointToCompare;\nlet dot_prob;\n\nrl.on(\"line\", (input) => {\n if (!pointToCompare) {\n let temparr = input.split(\" \").map(Number)\n if (temparr[0] > temparr[1])\n pointToCompare = temparr[0]\n else pointToCompare = temparr[1]\n }\n if (pointToCompare) {\n dot_prob = (6 - pointToCompare + 1)\n\n let gcdd = gcd(dot_prob, 6)\n console.log(dot_prob / gcdd, \"/\", 6/gcdd)\n rl.close();\n }\n})\n\n\n\nvar gcd = function (a, b) {\n if (!b) return a;\n\n return gcd(b, a % b);\n};", "lang": "Node.js", "bug_code_uid": "87b8036145788f4f9d7de033228df4cf", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "86f135bf8e83950eed368ad49da22e0e", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9968304278922345, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let [y, w] = d.split(' ').map(Number);\n let start = Math.max(y, w);\n let count = 0;\n\n for (let i = start; i <= 6; i++) {\n count++;\n }\n\n if (count === 1) {\n console.log('0/1');\n }\n else if (count === 6) {\n console.log('1/1');\n }\n else {\n if (count % 2 === 0) {\n console.log(`${count / 2}/3`);\n }\n else if (count % 3 === 0) {\n console.log(`${count / 3}/2`);\n }\n else {\n console.log(`${count}/6`);\n }\n }\n});\n", "lang": "Node.js", "bug_code_uid": "f21c0c953212801557f91f48a046a3ef", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "8dbbd9c24189e47868fa22755411eb82", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.18974358974358974, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "var fs=require(\"fs\");\n\nvar data=fs.readFileSync('data');\nvar[n,m,a]=data.toString().split(' ');\nconsole.log(Math.ceil(n/a)*Math.ceil(m/a));", "lang": "Node.js", "bug_code_uid": "e70a05474b7d2e756e103b830089636d", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "b06b1968ceee58d6a2f142c00ba436af", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9238900634249472, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\n\n\nrl.on('line', (input) => {\n\n // console.log(`Received: ${input}`);\n\n var temp = input.split(' ');\n var m = parseInt(temp[0]);\n var n = parseInt(temp[1]);\n var a = parseInt(temp[2]);\n\n var x = parseInt(m/a) + !!(m%a);\n var y = parseInt(n/a) + !!(n%a);\n console.log(x+y);\n rl.close();\n });", "lang": "Node.js", "bug_code_uid": "e4a65d944d1212491f138f0db7cfde69", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6da0839cd5fba7f38b38211b5d682578", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7051671732522796, "equal_cnt": 21, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "let fs = require('fs')\n\nlet txt = fs.readFileSync(\"input.txt\", \"utf-8\").split(\"\\r\\n\").filter((data)=>{\n return data.length>0;\n});\n\ntxt.forEach(data1 => {\n let data = data1.split(\" \");\n square(data[0] * 1, data[1] * 1, data[2] * 1)\n})\n\nfunction square(a, b, c) {\n console.log(Math.ceil(a / c) + Math.ceil(b / c));\n}", "lang": "Node.js", "bug_code_uid": "87807d5e7c3e1a51cad415d485c872bc", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "6fd7f1fdf5110eaff933c41be32acbe4", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9955357142857143, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const rl = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', (line) => {\n const [n, m, a] = line.split(' ').map(i => parseInt(i));\n\n let x;\n if (a >= n) {\n x = a;\n } else {\n x = Math.floor(n / a) + (n % a ? 1 : 0);\n }\n\n let y;\n if (a >= m) {\n y = a;\n } else {\n y = Math.floor(m / a) + (m % a ? 1 : 0);\n }\n\n console.log(x * y);\n});", "lang": "Node.js", "bug_code_uid": "f21dc75d938ee414247ec00a0ca7c304", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "2c1cffa326b19f9a1559ed84d278d74e", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6918489065606361, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let t = +readLine();\n while (t--) {\n const num = +readLine();\n if (num % 2 === 0) {\n const [a, b] = [num / 2, num / 2];\n console.log(`${a} ${b}`);\n } else {\n let n = (num + 1) / 2;\n for (let i = n; i <= num; i++) {\n const [b, a] = [i, num - i];\n if (b % a === 0) {\n console.log(`${a} ${b}`);\n break;\n }\n }\n }\n }\n}\n", "lang": "Node.js", "bug_code_uid": "d46c73e072c372fe92738ee2ec2ff68d", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "aa96ba8b7b0f5050bb4aefddd89e11ac", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9974587039390089, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let t = +readLine();\n while (t--) {\n const num = +readLine();\n let found = false;\n if (num % 2 === 0) {\n console.log(`${num / 2} ${num / 2}`);\n continue;\n } else {\n for (let i = 2; i * i <= num; i++) {\n if (num % i === 0) {\n let [a, b] = [num / i, num - num / i];\n console.log(`${a} ${b}`);\n found = true;\n break;\n }\n }\n }\n !found && console.log(`${1} ${num}`);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "e8a68bc9c6ba883b07fdeb665d0a8500", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "aa96ba8b7b0f5050bb4aefddd89e11ac", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.975268315445637, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "// node template.js < A-small.in > A-small.out\n\nfunction main() {\n var tests = 1;\n tests = nextInt();\n\n for (let t = 1; t <= tests; t++) {\n let N = nextInt();\n\n let result = -1;\n for(let i = 2; i*i <= N; i++) {\n if (N % i === 0) {\n result = i;\n break;\n }\n }\n let b = (result-1)*(N/result);\n let a = N-b;\n\n print(a + \" \" + b);\n }\n}\n\n// ------- Template ------------------\nfunction newTensor(dimensions, value) {\n let res = [];\n let dim = dimensions[0], subdim = dimensions.slice(1);\n if (subdim.length == 0) {\n for(let i = 0; i < dim; i++) {\n res.push(value);\n }\n } else {\n for(let i = 0; i < dim; i++) {\n res.push(newTensor(subdim, value));\n }\n }\n return res;\n}\n\nif (!String.prototype.startsWith) {\n Object.defineProperty(String.prototype, 'startsWith', {\n value: function(search, rawPos) {\n var pos = rawPos > 0 ? rawPos|0 : 0;\n return this.substring(pos, pos + search.length) === search;\n }\n });\n}\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(search, this_len) {\n if (this_len === undefined || this_len > this.length) {\n this_len = this.length;\n }\n return this.substring(this_len - search.length, this_len) === search;\n };\n}\n\nvar curTokens = [], curToken = 0;\n\nfunction next() {\n while (curToken >= curTokens.length) {\n curTokens = readline().split(/[\\s]+/);\n curToken = 0;\n }\n return curTokens[curToken++];\n}\n\nfunction nextInt() {\n return parseInt(next());\n}\n\n// code for nodejs\nvar inputBuffer = '', curLine = 0;\n\nfunction readline() {\n return inputBuffer[curLine++];\n}\n\nfunction print(data) {\n process.stdout.write(data + '\\n');\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nprocess.stdin.on('data', function (chunk) {\n inputBuffer += chunk;\n});\n\nprocess.stdin.on('end', function () {\n inputBuffer = inputBuffer.split(/[\\s]+/);\n main();\n});", "lang": "Node.js", "bug_code_uid": "41a22cb41b29ee655dce68cea36e2586", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "af7843f2b97270d0703b7df7f5c72e89", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6742630666336389, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n B();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction pi(a) {\n return parseInt(a);\n}\n\nfunction ti(a){\n for(let i = 0; i < a.length; i++)\n a[i] = pi(a[i]);\n\n return a;\n}\n\nfunction A(){\n let t = pi(readline());\n while(t > 0){\n t--;\n let n = pi(readline());\n let ans = '';\n for(let i = 0; i < n; i++){\n ans += '1 ';\n }\n console.log(ans);\n }\n}\n\nfunction B(){\n let t = pi(readline());\n while(t > 0){\n t--;\n let n = pi(readline());\n\n if(n%2===0){\n console.log(n/2, n/2);\n continue;\n }\n\n let sq = Math.floor(Math.sqrt(n));\n let min = 9999999999999;\n let minPair = [];\n for(let i = 1; i <= sq; i++){\n if(n % i === 0){\n let x = n/i;\n let b = (x-1)*i;\n if(i+b === n){\n if(min > b){\n min = b;\n minPair = [i,b];\n }\n }\n }\n }\n console.log(minPair[0], minPair[1]);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "8d9e10b7cec8b1015bcdc57ed1dd0ce7", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "30af778d5837f8ccaf65ee6caa606c49", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.984689766317486, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 9, "bug_source_code": "process.stdin.setEncoding('utf8');\nlet input = [];\nprocess.stdin.on('readable', () => {\n const chunk = process.stdin.read();\n if (chunk !== null) {\n let re = /\\n| /;\n input = chunk.split(re).slice(0, -1);\n let myinput = input.map(value => parseInt(value));\n console.log(snowball.apply(null, myinput));\n process.exit(0);\n }\n});\n\nfunction snowball(weight, height, u1, d1, u2, d2) {\n let w = weight, h = height;\n for (; h >= 0; h--) {\n w += h;\n if (h == d1) w = w - u1 ? w - u1 : 0;\n if (h == d2) w = w - u2 ? w - u2 : 0;\n }\n return w;\n}", "lang": "Node.js", "bug_code_uid": "189a888fa1ddaae9580465a126273e84", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "ef6a093e56a4d4a8494b30ef876b16bb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9859851607584501, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.setEncoding('utf8');\nlet input = [];\nprocess.stdin.on('readable', () => {\n const chunk = process.stdin.read();\n if (chunk !== null) {\n let re = /\\n\\s*| /;\n input = chunk.split(re).slice(0, -1);\n let myinput = input.map(value => parseInt(value));\n console.log(snowball.apply(null, myinput));\n process.exit(0);\n }\n});\n\nfunction snowball(weight, height, u1, d1, u2, d2) {\n let w = weight, h = height;\n for (; h >= 0; h--) {\n w += h;\n if (h == d1) w -= u1;\n if (h == d2) w -= u2;\n if (!w) w = 0;\n }\n return w;\n}", "lang": "Node.js", "bug_code_uid": "c4b814c5778eee5c41b8af171e52c370", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "ef6a093e56a4d4a8494b30ef876b16bb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8162939297124601, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet w, h;\nlet u1, u2, d1, d2;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n [w, h] = d.split(' ').map(Number);\n return;\n }\n\n if (c === 1) {\n c++;\n [u1, d1] = d.split(' ').map(Number);\n return;\n }\n\n [u2, d2] = d.split(' ').map(Number);\n\n c++;\n});\n\nrl.on('close', () => {\n let ans = w;\n\n ans += h*(h+1) / 2;\n ans -= u1;\n ans -= u2;\n ans = Math.max(0, ans);\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "34d22d819464c54e149c0196336b9b97", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "2198c1f840f50014a3036f5e8eb7e291", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7283387622149837, "equal_cnt": 27, "replace_cnt": 6, "delete_cnt": 18, "insert_cnt": 2, "fix_ops_cnt": 26, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nlet w = []\nlet h = []\n\nrl.on('line', (input) => {\n if (l === 0) {\n let inp = input.split(\" \").map(x => parseInt(x))\n w.push(inp[0])\n h.push(inp[1])\n } else if (l === 1) {\n let inp = input.split(\" \").map(x => parseInt(x))\n w.push(inp[0])\n h.push(inp[1])\n } else {\n rl.close();\n let inp = input.split(\" \").map(x => parseInt(x))\n let wg = w[0]\n let hg = h[0]\n w.push(inp[0])\n h.push(inp[1])\n if (h[1] > h[2]) {\n for (let i = h[0]; i >= h[1]; i--) {\n wg += i\n hg--\n }\n wg -= w[1]\n if (wg < 0)\n wg = 0\n if (hg <= 0) {\n console.log(wg)\n return\n }\n for (let i = h[1] - 1; i >= h[2]; i--) {\n wg += i\n hg--\n }\n wg -= w[2]\n if (wg < 0)\n wg = 0\n\n if (hg > 0)\n wg += hg\n console.log(wg)\n } else {\n for (let i = h[0]; i >= h[2]; i--) {\n wg += i\n hg--\n }\n wg -= w[2]\n if (wg < 0)\n wg = 0\n if (hg <= 0) {\n console.log(wg)\n return\n }\n for (let i = h[2] - 1; i >= h[1]; i--) {\n wg += i\n hg--\n }\n wg -= w[1]\n if (wg < 0)\n wg = 0\n if (hg > 0)\n wg += hg\n console.log(wg)\n }\n }\n l++\n});\n", "lang": "Node.js", "bug_code_uid": "303341143c0af60b81fb770f5fa77aae", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "a05fed2177643db44841a3ab7ed2cce8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9778642666018, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n↑入力 ↓出力');\n\tMain();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n\t};\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n\tvar N = nextInt();\n\tvar max = 0;\n\tvar maxIndex = {\n\t\tx : 0,\n\t\ty : 0\n\t}\n\tfor(var i = 1; i < N; i++){\n\t\tvar x = i;\n\t\tvar y = N - i;\n\t\tif(x < y && max < (x / y)){\n\t\t\tmax = x / y;\n\t\t\tmaxIndex.x = x;\n\t\t\tmaxIndex.y = y;\n\t\t}\n\t}\n\tmyout(maxIndex.x + \" \" + maxIndex.y);\n}\n", "lang": "Node.js", "bug_code_uid": "8b291f85d07f0c895a62565f808e18e6", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "98a75383bca30af305070a8a7f2037de", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5356725146198831, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const n = +d;\n\n if (n % 2 === 1) {\n console.log(Math.floor(n / 2), Math.ceil(n / 2));\n }\n else {\n const mid = n / 2;\n console.log(mid - 1, mid + 1);\n }\n});\n", "lang": "Node.js", "bug_code_uid": "1950b877e4061294f3a5f8c3de5da65b", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "4ee84ed5aea28a2e96df182b33bc812f", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9131718842291789, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "\nfunction processData(input) {\n //Enter your code here\n let res=input.split(\"\\n\"), n=+(res[0]),\n arr=res[1].split(\"\").filter((x)=>x!==\"\"),\n cnt=dvsr(n);\n //console.log(cnt,arr)\n cnt.forEach((d)=>{\n let temp=\"\";\n while(d>0){\n temp+=arr.shift();\n d--\n }\n //console.log(arr,temp)\n temp=[...temp].reverse();\n arr=[...temp,...arr];\n \n })\n console.log(arr.reverse().join(\"\"))\n} \n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"ascii\");\n_input = \"\";\nprocess.stdin.on(\"data\", function (input) {\n _input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n processData(_input);\n});\nfunction dvsr(n){\n let v=Math.sqrt(n),cnt=[]\nfor(let i=2;i<=v;i++){\n if(n%i===0){\n cnt.push(i);\n cnt.push(n/i)\n }\n // cnt.push(i)\n}\nreturn cnt.sort((a,b)=>a-b)\n}", "lang": "Node.js", "bug_code_uid": "312a5c0e3ee4cefb02840f29f84a714c", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "6f00923e797a451773309313fc069eea", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8091831641989685, "equal_cnt": 20, "replace_cnt": 16, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "let input = '';\nlet inputResolve;\nlet inputPromise = new Promise(resolve => inputResolve = resolve);\nprocess.stdin.on('data', c => input += c);\nprocess.stdin.on('end', () => inputResolve());\n\nfunction For(a, b, fn) {\n let res;\n if (a < b) {\n for (let i = a; i <= b; i++) {\n if ((res = fn(i)) !== undefined) return res;\n }\n } else {\n for (let i = a; i >= b; i--) {\n if ((res = fn(i)) !== undefined) return res;\n }\n }\n}\n\nfunction Arr(a, b, fn, prev) {\n let p = prev || 0;\n if (a < b) return Array(b - a + 1).fill(0).map((v, i) => fn ? (p = fn(a + i, p)) : a + i);\n return Array(a - b + 1).fill(0).map((v, i) => fn ? (p = fn(a - i, p)) : a - i);\n}\n\nObject.defineProperty(Object.prototype, '$k', {\n value: function () { return Object.keys(this) }\n});\nObject.defineProperty(Object.prototype, '$v', {\n value: function () { return Object.values(this) }\n});\nObject.defineProperty(Object.prototype, '$kv', {\n value: function () { return Object.entries(this) }\n});\nArray.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }\nArray.prototype.uniq = function (fn) {\n var set = new Set();\n return this.filter(v => {\n var newValue = !set.has(fn ? fn(v) : v);\n set.add(fn ? fn(v) : v);\n return newValue;\n });\n}\nArray.prototype.toObj = function (fn) {\n return this.map(v => fn(v)).reduce((p, v) => {\n p[v[0]] = v[1];\n return p;\n }, {})\n}\nArray.prototype.min = function (fn) {\n let min = Math.min(...this.map((v, i) => fn ? fn(v, i) : v));\n let i = this.findIndex((v, i) => fn ? fn(v, i) == min : v == min);\n return [this[i], i, min];\n}\nArray.prototype.max = function (fn) {\n let max = Math.max(...this.map((v, i) => fn ? fn(v, i) : v));\n let i = this.findIndex((v, i) => fn ? fn(v, i) == max : v == max);\n return [this[i], i, max];\n}\n\nfunction gcd(a, b) {\n if (!b) return a;\n return gcd(b, a % b);\n}\nfunction mod(a, n, m) {\n if (n == 0n) return 1n;\n if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);\n return a * mod(a, n - 1n, m) % m;\n}\nfunction extendedEuclid(a, b) {\n if (!b) return [1, 0];\n else {\n let [x, y] = extendedEuclid(b, a % b);\n return [y, x - (a / b | 0) * y];\n }\n}\n// [m] = extendedEuclid(a, 998244353);\n\n(async () => {\n await inputPromise;\n let inp = input.split(/\\s+/); r = 0;\n let [n, k, s, t] = inp;\n n = +n;\n k = +k;\n let count = s => Arr(0, n - 2, i => Arr(i + 1, n - 1, j => s[i] == t[0] && s[j] == t[1]).sum()).sum();\n let max = count(s);\n For(0, k, i => {\n let s0 = [...s];\n let remain = i;\n For(0, n - 1, j => {\n if (remain <= 0) return 1;\n if (s0[j] != t[0]) {\n s0[j] = t[0];\n remain--;\n }\n });\n remain = k - i;\n For(n -1, 0, j => {\n if (remain <= 0) return 1;\n if (s0[j] != t[1]) {\n s0[j] = t[1];\n remain--;\n }\n })\n max = Math.max(max, count(s0));\n });\n console.log(max);\n})();", "lang": "Node.js", "bug_code_uid": "da2f9003995caba56a4713d386cfe305", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "4c70b189f790fd93a97959aff91bc599", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6524173027989821, "equal_cnt": 23, "replace_cnt": 18, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "let input = '';\nlet inputResolve;\nlet inputPromise = new Promise(resolve => inputResolve = resolve);\nprocess.stdin.on('data', c => input += c);\nprocess.stdin.on('end', () => inputResolve());\n\nfunction For(a, b, fn) {\n let res;\n if (a < b) {\n for (let i = a; i <= b; i++) {\n if ((res = fn(i)) !== undefined) return res;\n }\n } else {\n for (let i = a; i >= b; i--) {\n if ((res = fn(i)) !== undefined) return res;\n }\n }\n}\n\nfunction Arr(a, b, fn, prev) {\n let p = prev || 0;\n if (a < b) return Array(b - a + 1).fill(0).map((v, i) => fn ? (p = fn(a + i, p)) : a + i);\n return Array(a - b + 1).fill(0).map((v, i) => fn ? (p = fn(a - i, p)) : a - i);\n}\n\nObject.defineProperty(Object.prototype, '$k', {\n value: function () { return Object.keys(this) }\n});\nObject.defineProperty(Object.prototype, '$v', {\n value: function () { return Object.values(this) }\n});\nObject.defineProperty(Object.prototype, '$kv', {\n value: function () { return Object.entries(this) }\n});\nArray.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }\nArray.prototype.uniq = function (fn) {\n var set = new Set();\n return this.filter(v => {\n var newValue = !set.has(fn ? fn(v) : v);\n set.add(fn ? fn(v) : v);\n return newValue;\n });\n}\nArray.prototype.toObj = function (fn) {\n return this.map(v => fn(v)).reduce((p, v) => {\n p[v[0]] = v[1];\n return p;\n }, {})\n}\nArray.prototype.min = function (fn) {\n let min = Math.min(...this.map((v, i) => fn ? fn(v, i) : v));\n let i = this.findIndex((v, i) => fn ? fn(v, i) == min : v == min);\n return [this[i], i, min];\n}\nArray.prototype.max = function (fn) {\n let max = Math.max(...this.map((v, i) => fn ? fn(v, i) : v));\n let i = this.findIndex((v, i) => fn ? fn(v, i) == max : v == max);\n return [this[i], i, max];\n}\n\nfunction gcd(a, b) {\n if (!b) return a;\n return gcd(b, a % b);\n}\nfunction mod(a, n, m) {\n if (n == 0n) return 1n;\n if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);\n return a * mod(a, n - 1n, m) % m;\n}\nfunction extendedEuclid(a, b) {\n if (!b) return [1, 0];\n else {\n let [x, y] = extendedEuclid(b, a % b);\n return [y, x - (a / b | 0) * y];\n }\n}\n// [m] = extendedEuclid(a, 998244353);\n\n(async () => {\n await inputPromise;\n let inp = input.split(/\\s+/); r = 0;\n let [n, k, s, t] = inp;\n n = +n;\n k = +k;\n if (t[0] == t[1]) {\n let x = Math.min([...s].filter(c => c == t[0]).length + k, n);\n console.log(x * (x - 1) / 2);\n return;\n }\n let t0 = Arr(0, n - 1, (i, p) => p + (s[i] == t[0]));\n let t1 = Arr(0, n - 1, (i, p) => p + (s[n - 1 - i] == t[1])).reverse();\n let max = Arr(0, n - 2, i => s[i] == t[0] ? t1[i + 1] : 0).sum();\n\n For(0, Math.min(k, n - t0[n - 1] - t1[0]), i => {\n let ss = [...s];\n let remain = i;\n For(0, n - 1, i => {\n if (remain <= 0) return 0;\n if (ss[i] != t[0] && ss[i] != t[1]) { ss[i] = t[0]; remain-- }\n })\n For(0, Math.min(k - i, t1[0]), j => {\n let s0 = [...ss];\n let remain = j;\n For(0, n - 1, i => {\n if (remain <= 0) return 0;\n if (s0[i] == t[1]) { s0[i] = t[0]; remain-- }\n })\n\n For(0, Math.min(k - i - j, n - t0[n - 1] - t1[0]), z => {\n let s1 = [...s0];\n let remain = z;\n For(n - 1, 0, i => {\n if (remain <= 0) return 0;\n if (s1[i] != t[1] && s1[i] != t[0]) { s1[i] = t[1]; remain-- }\n });\n remain = k - i - j - z;\n For(n - 1, 0, i => {\n if (remain <= 0) return 0;\n if (s1[i] == t[0]) { s1[i] = t[1]; remain-- }\n });\n let tt = Arr(0, n - 1, (i, p) => p + (s1[i] == t[0]));\n max = Math.max(max, Arr(1, n - 1, i => s1[i] == t[1] ? tt[i - 1] : 0).sum())\n })\n\n // console.log(i, j, s0.join(''));\n // remain = k - i - j;\n // let t00 = Arr(0, n - 1, (i, p) => p + (s0[i] == t[0]));\n // let j1 = n - 1;\n // let j2 = n - 1;\n // let sum2 = 0;\n // while (remain > 0 && (j1 >= 0 || j2 >= 0)) {\n // while (j1 >= 0 && (s0[j1] == t[0] || s0[j1] == t[1])) j1--;\n // while (j2 >= 0 && s0[j2] != t[0]) {\n // if (s0[j2] == t[1]) sum2++;\n // j2--;\n // }\n // if ((t00[j1 - 1] || 0) > (t00[j2 - 1] || 0) - sum2) {\n // s0[j1--] = t[1];\n // remain--;\n // } else if ((t00[j2 - 1] || 0) - sum2 >= 0) {\n // s0[j2--] = t[1];\n // sum2++;\n // remain--;\n // } else break;\n // }\n // t00 = Arr(0, n - 1, (i, p) => p + (s0[i] == t[0]));\n // // console.log(i, j, k - i - j, s0.join(''), Arr(1, n - 1, i => s0[i] == t[1] ? t00[i - 1] : 0).sum());\n // max = Math.max(max, Arr(1, n - 1, i => s0[i] == t[1] ? t00[i - 1] : 0).sum())\n })\n })\n console.log(max);\n})();", "lang": "Node.js", "bug_code_uid": "c2df4b0220cec64e0630a9adbf28a93d", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "4c70b189f790fd93a97959aff91bc599", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9924337957124842, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "'use strict';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n\n let number = readline();\n var res= number.replaceAll(\"144\",\"\").replaceAll(\"14\",\"\").replaceAll(\"1\",\"\");\n if(res.length > 0)\n {\n console.log(\"NO\");\n }\n else{\n console.log(\"YES\");\n }\n}\n\nString.prototype.replaceAll = function(search, replacement) {\n var target = this;\n return target.split(search).join(replacement);\n};", "lang": "Node.js", "bug_code_uid": "24ef3331fcf4415055626a520482f19a", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "3b528f9775115007b15a7ac024e27132", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8793388429752066, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let numberString = readLine();\n if (numberString.indexOf('4') === -1 && numberString.indexOf('1') === -1) {\n console.log('NO');\n return;\n }\n if (numberString[0] !== '1') {\n console.log('NO');\n return;\n }\n if (numberString.includes('444')) {\n console.log('NO');\n return;\n }\n console.log('YES');\n}\n", "lang": "Node.js", "bug_code_uid": "3d2865808f2655fae7aade42b82e82dd", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "aa184d1d03c01ea69b8180b4aca2e866", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9754152823920266, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\n\nfunction* nextLine() {\n\tlet lines = data.trim().split(/\\n/g);\n\tfor(let l of lines){\n\t\tyield l.trim();\n\t}\n}\n\nlet nl = nextLine();\n\nnl.elem = function(funParse) {\n\t\treturn funParse(this.next().value);\t\n\t};\n\nnl.array = function(funParse) {\n\t\treturn this.next().value.split(/\\s/g).map(funParse||(x => x));\n\t};\n\t\nnl.num = function() {\n\t\treturn nl.elem(Number);\n\t};\n\t\nnl.nums = function() {\n\t\treturn nl.array(Number);\n\t};\n\t\nnl.line = function() {\n\t\treturn this.next().value;\n\t};\n\t\nconst sol = () => {\n\tlet s = nl.line();\n\tlet flag = s.split('1').every(x => x.length < 3 && (x.length == 0 || x == '4' || x == '44'));\n\tconsole.log(flag?'YES':'NO');\n\n};\n\nprocess.stdin.on('end', sol);\n", "lang": "Node.js", "bug_code_uid": "fef575c317be31fb72eab2a83d52d7de", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "02d0cd7546f236e5a220033cf813ac59", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9307875894988067, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n const [n, m] = d.split(' ').map(Number);\n let ans = m;\n let iter = 1;\n\n while (ans > iter) {\n ans -= iter;\n iter++;\n\n if (iter > n) {\n iter = 1;\n }\n\n if (iter === 1 && ans === 1) {\n ans = 0;\n }\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "f34942925a1410a2753edfd3f67ab3d7", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "46ccc1ad23be1ed9c96c9f17e7d34bc2", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9515981735159817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nconst isPrime = (n) => {\n let ans = true;\n\n for (let i = 2; i*i <= n; i++) {\n if (n % i === 0) {\n return false;\n }\n }\n\n return ans;\n}\n\nrl.on('line', (d) => {\n const [n, m] = d.split(' ').map(Number);\n let ans = 'NO';\n\n for (let i = n + 1; i <= m; i++) {\n if (isPrime(i) && i === m) {\n ans = 'YES';\n break;\n }\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "962c06797c5a7b8088d6feb5f47747da", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "7169ddec5b1cd6d408f8c1bbf2d20087", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8527363184079602, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let nums = readLine().split(' ').map(Number);\n let [n, m] = nums;\n\n for (let j = n + 1; j <= m; j++) {\n if (isPrime(j) && j === m) {\n console.log('YES');\n return;\n }\n }\n console.log('NO');\n}\n\nfunction isPrime(number) {\n if (number <= 1) {\n return;\n }\n for (let i = 2; i < number; i++) {\n if (number % i === 0) {\n return false;\n }\n }\n return true;\n}\n", "lang": "Node.js", "bug_code_uid": "524aed9a038d47b2a12e64fec4eed5be", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "a21ec9e8a0c2fc70d5a3e953bcb906e5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8167420814479638, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const [n, m] = d.split(' ').map(Number);\n let ans = 0;\n ans += n;\n let add = Math.floor(n / m);\n ans += add;\n let secondAdd = Math.floor(ans / m);\n\n if (add !== secondAdd) {\n ans += secondAdd - add;\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "efc86c5866bceff66ce084d466e51d3a", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "66ae443e5000cb1499cf47d5a30bcb81", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9799072642967542, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on(\"line\", (line) => {\n let n = \"\";\n let m = \"\";\n [n, m] = line;\n for (let index = 1; index <= n; index++) if (index % m == 0) n++;\n console.log(n);\n});\nrl.on(\"close\", () => {});\n", "lang": "Node.js", "bug_code_uid": "ec71f8bdadba95855702fc4c11bd5b9d", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "f36127ffb88d70ab9eac5f664c4e3214", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9971671388101983, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction multiply(a, b) {\n\ta = a.toString(10).split('').reverse();\n\tb = b.toString(10).split('').reverse();\n\n\tif (a.length < b.length) {\n\t\t[a, b] = [b, a];\n\t}\n\n\tlet res = Array(a.length + b.length).fill(0);\n\tfor (let i = 0, lb = b.length; i < lb; ++i) {\n\t\tlet carry = 0;\n\t\tlet scarry = 0;\n\t\tfor (let j = 0, la = a.length; j < la; ++j) {\n\t\t\tlet m = b[i] * a[j];\n\t\t\tm += carry;\n\n\t\t\tif (m > 9) {\n\t\t\t\tlet [c, d] = m.toString(10).split('');\n\t\t\t\tres[i + j] += (scarry >> 0) + (d >> 0);\n\t\t\t\tcarry = c >> 0;\n\t\t\t} else {\n\t\t\t\tres[i + j] += (scarry >> 0) + m;\n\t\t\t\tcarry = 0;\n\t\t\t}\n\n\t\t\tif (res[i + j] > 9) {\n\t\t\t\tlet [c, d] = res[i + j].toString(10).split('');\n\t\t\t\tres[i + j] = d >> 0;\n\t\t\t\tscarry = c;\n\t\t\t} else {\n\t\t\t\tscarry = 0;\n\t\t\t}\n\t\t}\n\t\tif (carry > 0) res[a.length + i] = carry;\n\t\tif (scarry > 0) res[a.length + i] = scarry;\n\t}\n\n\tres.reverse();\n\tlet mulVal = '';\n\tlet flag = false;\n\tres.forEach(d => {\n\t\tif (!flag && d !== 0) flag = true;\n\t\tif (flag) mulVal += d;\n\t});\n\treturn mulVal;\n}\n\nfunction main() {\n\tlet [n, m] = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\tlet q = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\tq = q.map(x => (x <= m ? 0 : Math.floor(x / m)));\n\n\tlet max = 0,\n\t\tv = 0;\n\tfor (let i = 0; i < n; ++i) {\n\t\tif (q[i] >= max) {\n\t\t\tmax = q[i];\n\t\t\tv = i + 1;\n\t\t}\n\t}\n\tconsole.log(v);\n}\n", "lang": "Node.js", "bug_code_uid": "70dde28a419e7ede4911b444f59d663d", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "2e97f00d497970b4e8009938520dba87", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9663732791694877, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [Numberofstudents, initialCandyValue] = readLine()\n .split(' ')\n .map(Number);\n // let home = [];\n // let more = [];\n\n let students = readLine().split(' ').map(Number); // [1 3 1 4 2]\n // for (let i = 0; i < students.length; i++) {\n // if (students[i] <= initialCandyValue) {\n // let t = students[i];\n // home[t] = i;\n // } else {\n // let test = students[i];\n // more[test] = i;\n // }\n // }\n // let highest = 0;\n // let vagfol = 0;\n // if (more.length !== 0) {\n // for (let i = 0; i < more.length; i++) {\n // // if (more[i] > highest) {\n // // highest = more[i];\n // // }\n // let iThVagfol = Math.ceil(more[i] / initialCandyValue);\n // if (iThVagfol > vagfol) {\n // vagfol = iThVagfol;\n // } else if (vagfol === iThVagfol) {\n // highest = more[i];\n // }\n // }\n // } else if (more.length === 0) {\n // for (let i = 0; i < home.length; i++) {\n // if (home[i] > highest) {\n // highest = home[i];\n // }\n // }\n // }\n\n let highest = 0;\n let vagfol = 0;\n // if (more.length !== 0) {\n for (let i = 0; i < students.length; i++) {\n // if (more[i] > highest) {\n // highest = more[i];\n // }\n let iThVagfol = Math.ceil(students[i] / initialCandyValue);\n if (iThVagfol > vagfol) {\n vagfol = iThVagfol;\n } else if (vagfol === iThVagfol) {\n highest = students.lastIndexOf(students[i]);\n }\n }\n console.log(highest + 1);\n // console.log(Math.max.apply(null, more));\n}\n", "lang": "Node.js", "bug_code_uid": "ce899b4f62b09fb7a65dd2ddeae61b49", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "e9a54bd8f89e5cf778701f8b3f44dc8d", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9875986471251409, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n\nlet s = \"\";\n\nprocess.stdin.on(\"data\", function(chunk) {\n s += chunk;\n});\n\nprocess.stdin.on(\"end\", function() {\n console.log(solve(s));\n});\n\nfunction solve(s) {\n const [x, y, z] = s.split(\" \").map(Number);\n\n if (x - y == z) {\n return '0';\n }\n if (Math.abs(x - y) < z) {\n return '?';\n }\n if (x - y > 0) {\n return '+';\n }\n if (x - y < 0) {\n return '-';\n }\n}\n", "lang": "Node.js", "bug_code_uid": "32145157fdb982f39a02a8fa6d906cf4", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "0ed0e165099a0dccb712b0ec5d22c326", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9441233140655106, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\nconst solution = () => {\n\tlet line = data.split('\\n');\n\tlet n = parseInt(line[0], 10);\n\tlet a = line[1].replace(\"RU\",\"D\").replace(\"UR\",\"D\");\n\tconsole.log(a.length);\n\t\n};\n\n\nprocess.stdin.on('end', solution);", "lang": "Node.js", "bug_code_uid": "e0dbcd8992d39224ff02c986053c9fc5", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "fb3366fddb2002252391b073e5647dd3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9903685092127303, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nlet count = 0;\nlet r, c;\n// let matrix = [];\n// const cake = [];\n\n// const makeRowPoison = (c, cake) => {\n// for (let i = 0; i < matrix.length; i++) {\n// let safe = 1;\n// for (let j = 0; j < matrix[i].length; j++) {\n// if(cake[i][j] === 'S') {\n// safe = 0;\n// }\n// }\n\n// if (!safe) {\n// matrix[i][c] = 0;\n// }\n// }\n// }\n\n// const makeColPoison = (r, cake) => {\n// for (let i = 0; i < matrix[r].length; i++) {\n// let safe = 1;\n// for (let j = 0; j < matrix.length; j++) {\n// if (cake[j][i] === 'S') {\n// safe = 0;\n// }\n// }\n\n// if (!safe) {\n// matrix[r][i] = 0;\n// }\n// }\n// }\n\nlet row = [];\nlet col = [];\nconst cake = [];\n\nrl.on('line', (d) => {\n if (count === 0) {\n count++;\n [r, c] = d.split(' ').map(Number);\n // matrix = new Array(r).fill(1).map(x => new Array(c).fill(1));\n\n row = new Array(r).fill(1);\n col = new Array(c).fill(1);\n return;\n }\n\n const cakeLine = d.split('');\n cake.push(cakeLine);\n\n count++;\n});\n\nrl.on('close', () => {\n let ans = 0;\n\n for (let i = 0; i < cake.length; i++) {\n for (let j = 0; j < cake.length; j++) {\n if (cake[i][j] === 'S') {\n row[i] = 0;\n col[j] = 0;\n }\n }\n }\n\n for (let i = 0; i < row.length; i++) {\n for (let j = 0; j < col.length; j++) {\n if (cake[i][j] === '.' && (row[i] === 1 || col[j] === 1)) {\n ans++;\n }\n }\n }\n\n console.log(ans);\n});\n\n// rl.on('close', () => {\n// let ans = 0;\n\n// for (let row = 0; row < cake.length; row++) {\n// for (let col = 0; col < cake[row].length; col++) {\n// if (cake[row][col] === 'S') {\n// makeRowPoison(col, cake);\n// makeColPoison(row, cake);\n// }\n// }\n// }\n\n// for (let i = 0; i < matrix.length; i++) {\n// for (let j = 0; j < matrix[i].length; j++) {\n// if (matrix[i][j]) {\n// ans++;\n// }\n// }\n// }\n\n// console.log(ans);\n// });", "lang": "Node.js", "bug_code_uid": "0000396f384ec6c5c950cce834bba437", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "a2b33a7e816a0130f258cd9a3e849280", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8117489986648865, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const [n, k, t] = d.split(' ').map(Number);\n let ans = 0;\n\n if(t < k) {\n ans = t;\n }\n else if (t > k && t < n - k + k) {\n ans = k;\n }\n else {\n ans = k - Math.floor(t / k);\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "94801b4e9d0523c71f319c42d90c03aa", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "d796e803895cd36c86a53c56293a3771", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5124760076775432, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "'use strict'\n\nconst {EOL} = require('os')\n\nlet ipt = ''\nprocess.stdin.on('data', s => ipt += s)\nprocess.stdin.on('end', () => {\n const [ils] = ipt.split(EOL).slice(0, -1)\n const [a, b, c, d, e, f] = ils.split(' ')\n\n if (c == 0 && d > 0) return console.log('Ron')\n if (b == 0 || d == 0 || f == 0) return console.log('Hermione')\n if (a == 0 || c == 0 || e == 0) return console.log('Ron')\n console.log(1 / a * b / c * d / e * f <= 1 ? 'Hermione' : 'Ron')\n})", "lang": "Node.js", "bug_code_uid": "55c2cb3ccb1434716711d588c5acae49", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "a72b8f1ee3d33007c2bf2489438e6653", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9992576095025983, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "function main() {\n // write code here:\n var game = {\n 'rock': 'scissors',\n 'scissors ': 'paper',\n 'paper': 'rock'\n };\n var F = stdin[0],\n M = stdin[1],\n S = stdin[2];\n if (game[F] === M && game[F] === S) {\n console.log('F');\n } else if (game[M] === F && game[M] === S) {\n console.log('M');\n } else if (game[S] === F && game[S] === M) {\n console.log('S');\n } else {\n console.log('?');\n }\n}\n\nconst readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nvar stdin = [];\nrl.on('line', function (line) {\n stdin.push(line);\n});\nrl.on('close', main);", "lang": "Node.js", "bug_code_uid": "7d1de0efb0bee4d3863f6ba7a43653e9", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "aa7388c3c3c44f10baaed84655c0cffb", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9605963791267306, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\n\nconst solution = () => {\n\tlet a = data.trim().split(/\\n/g).map(v => v[0]).join('');\n\tlet f = ['rss', 'prr', 'spp'];\n\tlet m = ['srs', 'rpr', 'psp'];\n\tlet s = ['ssr', 'rrp', 'pps'];\n\tlet ans = '';\n\tswitch(true) {\n\t\tcase f.includes(a): ans = \"F\";\n\t\t\tbreak;\n\t\tcase m.includes(a): ans = \"M\";\n\t\t\tbreak;\n\t\tcase s.includes(a): ans = \"S\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tans = \"?\";\n\t}\n\tconsole.log(ans);\n\t\n\t\n};", "lang": "Node.js", "bug_code_uid": "1cfc17297ae9651b083343cb2d697596", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "91a9506d81b5492aac6b116191d9925b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6474396703943496, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 8, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "declare const process: any;\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet input: string = '';\nprocess.stdin.on('data', (line) => {\n input += line;\n});\n\nprocess.stdin.on('end', () => {\n const lines: string[] = input.split('\\n');\n\n const k = parseInt(lines.shift(), 10);\n\n const occur: number[] = Array(10).fill(1);\n let count: number = 1;\n let index: number = 0;\n\n while (count < k) {\n occur[index]++;\n count = occur.reduce((acc, value) => acc * value, 1);\n index++;\n if (index === 10) {\n index = 0;\n }\n }\n\n const word: string = \"codeforces\";\n const ans: string = occur\n .map((value, index) => word[index].repeat(value))\n .join('');\n\n console.log(ans);\n});\n\n// input helper\n\nfunction lineToNumArray(line: string): number[] {\n return line.split(' ').map(element => parseInt(element, 10));\n}\n", "lang": "Node.js", "bug_code_uid": "64778ddd9e5798c637e0a7d8fc8b5a6a", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "5348f263952d3247307fadbb2b21fb0a", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9851116625310173, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet input = '';\nprocess.stdin.on('data', (line) => {\n input += line;\n});\nprocess.stdin.on('end', () => {\n const lines = input.split('\\n');\n const k = BigInt(lines.shift());\n const occur = Array(10).fill(1n);\n let count = 1n;\n let index = 0;\n while (count < k) {\n occur[index]++;\n count = occur.reduce((acc, value) => acc * value, 1n);\n index++;\n if (index === 10) {\n index = 0;\n }\n }\n const word = \"codeforces\";\n const ans = occur\n .map((value, index) => word[index].repeat(Number(value)))\n .join('');\n console.log(ans);\n console.log(count);\n});\n// input helper\nfunction lineToNumArray(line) {\n return line.split(' ').map(element => parseInt(element, 10));\n}\n", "lang": "Node.js", "bug_code_uid": "bda94ae57948a84747ef4896dead415f", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "5348f263952d3247307fadbb2b21fb0a", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9845599588265569, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n/**\n6\n6 1\n100010\n6 2\n000000\n5 1\n10101\n3 1\n001\n2 2\n00\n1 1\n0\n\n\n**/\n\nfunction gcd(a, b) {\n if (!b) {\n return a;\n }\n\n return gcd(b, a % b);\n};\n\nfunction main() { \n let n = parseInt(readline());\n\n // for(let i=0;i count && i < n) {\n if(i === 1 && a[i-1] === '0' && a[i] === '0') {\n count++;\n a[i-1] = \"1\";\n continue;\n }\n\n if(a[i + 1] === n) {\n if(a[i] === \"0\" && a[i-1] === \"0\") {\n count++;\n }\n\n continue;\n }\n\n if(a[i] === \"0\" && a[i-1] === \"0\" && a[i+1] === \"0\") {\n count++;\n a[i] = \"1\";\n }\n\n i++;\n }\n\n console.log(count);\n}\n\n", "lang": "Node.js", "bug_code_uid": "7dddbe8039c33c4767a9810c5d14d8ec", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "f07bcec003cc873ef1b736695ec2a04f", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.43564356435643564, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "let input = [];\n \nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n\nRL.on('line', (line) => {\n input.push(line);\n});\n\nRL.on('close', () => {\n let n = parseInt(input[0]);\n let code = [...input[1]];\n \n if(code.length == 1){\n console.log(code[0]); process.exit();\n }\n let asnwer = [];\n let same = false, len = 1, count = 0;\n for(let i = 1; i < code.length; i++){\n if(code[i] === code[i-1]){\n len++;\n same = true;\n if(i+1 == code.length){\n if(len > count + 1)\n for(let j = 0; j < len-(count+1); j++) asnwer.push(code[i-1])\n else\n for(let j = 0; j < len; j++) asnwer.push(code[i-1])\n }\n } else {\n if(len > count+1){\n count += 1;\n for(let j = 0; j < len-count; j++) asnwer.push(code[i-1])\n } else {\n for(let j = 0; j < len; j++) asnwer.push(code[i-1])\n }\n \n \n same = false; len = 1;\n }\n }\n let str_answer = ''; asnwer.forEach( s => str_answer+=s );\n console.log(str_answer)\n});\n\n", "lang": "Node.js", "bug_code_uid": "8c507f90af83741d22568c8f5909fa97", "src_uid": "08e8c0c37b223f6aae01d5609facdeaf", "apr_id": "bd49179014076fdaf16b74c1ddf15f43", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6707224334600761, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n inputs.push(lineInput)\n})\n\nrl.on('close', () => {\n\n const nums = inputs.map(num => parseInt(num));\n let maxValue = (nums[0] * nums[1]) + nums[2];\n\n if (nums[0] * nums[1] * nums[2] > maxValue)\n maxValue = nums[0] * nums[1] * nums[2]\n\n if ((nums[0] + nums[1]) * nums[2] > maxValue)\n maxValue = (nums[0] + nums[1]) * nums[2]\n\n if (nums[0] + nums[1] + nums[2] > maxValue)\n maxValue = nums[0] + nums[1] + nums[2]\n\n console.log(maxValue)\n})", "lang": "Node.js", "bug_code_uid": "f314f7cdd21a7ba2e633bd07b163e411", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "f32cf92253084399514499807b2cda86", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6603624901497241, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction main() {\n\tconst a = readLine() >> 0;\n\tconst b = readLine() >> 0;\n\tconst c = readLine() >> 0;\n\n\tlet value = 0;\n\n\tif (a === 1) {\n\t\tvalue = (a + b) * c;\n\t} else if (b === 1) {\n\t\tif (a > c) {\n\t\t\tvalue = (b + c) * a;\n\t\t} else {\n\t\t\tvalue = (a + b) * c;\n\t\t}\n\t} else if (c === 1) {\n\t\tvalue = a * (b + c);\n\t} else {\n\t\tvalue = a * b * c;\n\t}\n\n\tconsole.log(value);\n}\n", "lang": "Node.js", "bug_code_uid": "285a96f673a5d66719b3872028ad98e0", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "c4e1eee11aab8eaff8521dbd57563f96", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.618925831202046, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadline.on('line', line => input.push(line));\n\nreadline.on('close', () => {\n const ints = input.map(v => parseInt(v));\n if (ints[0] === 1 && ints[1] === 1 && ints[2] === 1) console.log(ints[0] + ints[1] + ints[2]);\n else if (ints.every(v => v > 2)) console.log(ints[0] * ints[1] * ints[2]);\n else if ((ints[0] + ints[1]) >= ints[2]) console.log((ints[0] + ints[1]) * ints[2]);\n else console.log(ints[0] * (ints[1] + ints[2]));\n});", "lang": "Node.js", "bug_code_uid": "6b4f80ffff08b8cb2597718a5d002b64", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "7f351512e41b8b656b503abce90629f6", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9866190900981266, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const a = parseInt(readLine());\n const b = parseInt(readLine());\n const c = parseInt(readLine());\n const maxN = Math.max(Math.max(a+b+c, a + (b * c), (a * b) + c), Math.max(a * b * c, (a + b) * c));\n console.log(maxN);\n}\n", "lang": "Node.js", "bug_code_uid": "0b9bcd65ce2804eeb3ed84a2acfb1ec5", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "31bfdf7a5fc29b780f0c738e247efc63", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9817893903404592, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet stickLength;\nlet lines=0;\nrl.on('line', (input,index) => {\n let res=input.split(\" \");\n\n stickLength=Number(res[0]);\n\n lines++;\n}).on('close', () => {\n getRectangleStick(stickLength);\n});\n\n\n\nfunction getRectangleStick(stickLength) {\n if(stickLength<=2000000000){\n if(stickLength%4===0){\n console.log(Math.trunc((stickLength-1)/4));\n }else{\n console.log(Math.trunc(stickLength/4));\n }\n }else{\n console.log(0);\n }\n}", "lang": "Node.js", "bug_code_uid": "a297aa864f2014239c5d0e87fd47f289", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "2a2ba917f04e633bd048e630029cadb4", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8873038516405135, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "let i = '';\nprocess.stdin.on('data', (c) => {\n i += c;\n});\n\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n const lines = i.split(EOL);\n const tiles = lines[0].split(' ');\n console.log(minTiles(tiles));\n});\n\nfunction minTiles(arr) {\n const set = new Set([...arr]);\n if (set.size === 1) return 0;\n if (set.size === 2) return 1;\n\n let min = 2;\n set.forEach(tile => {\n if (set.has(`${Number(tile.split('')[0]) + 1}${tile.split('')[1]}`)) {\n if (set.has(`${Number(tile.split('')[0]) + 2}${tile.split('')[1]}`)) {\n min = 0;\n } else {\n min = Math.min(min, 1);\n }\n }\n });\n\n return min;\n}\n", "lang": "Node.js", "bug_code_uid": "6167f55139c3590cb5ea643b075a45e2", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "2e963d54d2c248d75dcdf24b7820ce9e", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8286189683860233, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n const arr = d.split(' ').map(Number);\n const sum = arr.reduce((a, b) => a + b, 0);\n const obj = {0: 0};\n let best = 0;\n\n for (let i = 0; i < arr.length; i++) {\n if (obj[arr[i]]) {\n best = Math.max(best, arr[i]);\n obj[arr[i]] = Math.min(3, obj[arr[i]] + 1);\n }\n else {\n obj[arr[i]] = 1;\n }\n }\n\n console.log(sum - best * obj[best]);\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "3d437aead0fe36ecfb3ececeb6fc8a7e", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "d31283ee8b4ac5b9fa3005a54ce6b871", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9989440337909187, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "var readline = require('readline');\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar templateString = \"\"\n\nvar c = 0;\nrl.on('line', function (line) {\n c += 1;\n if (c == 1) {\n templateString = line;\n rl.close();\n var _p = parse(templateString, 2)\n console.log(result(parseInt(_p[0]), parseInt(_p[1])));\n }\n});\n\nfunction parse(template, iLoop) {\n var out=[]\n var regex = /\\d+/gm;\n var str = template;\n var m;\n var c = 0;\n while ((m = regex.exec(str)) !== null) {\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n if (c==iLoop) {break}\n out[c] = m[0];\n c+=1;\n }\n return out;\n}\n\nfunction result(n,k) {\n var min = n>k ? k : n;\n min = n==k ? min - 1 : min;\n var start = k - n;\n start = start <= 0 ? 1 : start >= n ? n : start;\n return Math.floor((min - start + 1) / 2);\n}\n\n", "lang": "Node.js", "bug_code_uid": "1ace1f262a408067f58ebcf9dc396e14", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "b9c3a476ee709d007cdf80fd78b42dff", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9537953795379538, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', input => {\n let sum = 0\n input = +input\n for (let i = 0; i < input; i++) {\n sum += input - i\n }\n console.log(sum)\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "cf758abb07b96d37d7f4ac61cdc4e9ae", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "89d005fe94d1c3e9780b44613ae0ea35", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9977578475336323, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const input = [];\n\nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', (line) => {\n input.push(line);\n});\n\nRL.on('close', () => {\n let [n] = input[0].split(' ').map(x => parseInt(x));\n\n if (n === 1) { console.log(1); return; }\n if (n === 2) { console.log(2); return; }\n \n let sum = n;\n for (let i = 1; i < n; i += 1) {\n sum += (n-i)*i;\n }\n\n console.log(sum);\n});", "lang": "Node.js", "bug_code_uid": "41b6382dd8963bd3177242a7e108dd0f", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "98afe0e2ac61c4e4dc655af77ec397e6", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7644171779141105, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nfunction checkT(x, y, z) {\n if (x + y > z && x + z > y && y + z > x)\n return \"T\";\n if (x + y == z || x + z == y || y + z == x)\n return \"S\";\n return \"I\";\n}\n\nrl.on('line', (input) => {\n let temp = input.split(' ').map(item => parseInt(item));\n let a = temp[0], b = temp[1], c = temp[2], d = temp[3];\n if (checkT(a, b, c) == \"T\" || checkT(b, c, d) == \"T\" || checkT(a, c, d) == \"T\" || checkT(a, b, d) == \"T\")\n console.log(\"Triangle\");\n else if (checkT(a, b, c) == \"S\" || checkT(b, c, d) == \"S\" || checkT(a, c, d) == \"S\" || checkT(a, b, d) == \"S\")\n console.log(\"Segment\");\n else\n console.log(\"Impossible\");\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "8c8e3b0bc453f2a0f0a2b75882e640c9", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "f85cbee7912bbecc086fb0ad4b1a2b8b", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.971240755957272, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n//const lineReader = require('fs');\n//const scanner = lineReader.createReadStream('main.in');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n}); \n\nfunction reverse(str) {\n return str.split(\"\").reverse().join(\"\");\n}\n\nrl.on('line', (input) => {\n x = input;\n x = reverse(x);\n let an = 0, one = 0;\n for (let i = 0; i < x.length; i++){\n if (i % 2 === 0)an++;\n if (x.charAt(i) === '1')one++;\n }\n if (one === 1 && x.length % 2 === 1)an--;\n console.log(an);\n rl.close(); \n});", "lang": "Node.js", "bug_code_uid": "5ec55c72dd4dd1c2fcc4786582a12c36", "src_uid": "d8ca1c83b431466eff6054d3b422ab47", "apr_id": "25c531c857cafb4d0931c177eff6aeb2", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.4988009592326139, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "let i = '';\nprocess.stdin.on('data', (c) => {\n i += c;\n});\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n const lines = i.split(EOL);\n const time = parseInt(lines[0], 2);\n if (time === 0) {\n console.log(0);\n } else {\n console.log(Math.ceil(Math.log(time) / Math.log(4)));\n }\n});\n", "lang": "Node.js", "bug_code_uid": "505a68a690f8d0c6c59c97ec36b60a55", "src_uid": "d8ca1c83b431466eff6054d3b422ab47", "apr_id": "a1f3414752f8bccbd9897e932f18faff", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6920529801324503, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const [n] = [d].map(BigInt);\n let total = 0n;\n\n for (let i = 1n; i <= n; i++) {\n total += i;\n }\n\n console.log((total % 2n).toString());\n});\n", "lang": "Node.js", "bug_code_uid": "8fdf526a08bc2cee98f6539d47683761", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "efd5adea9a254354baccdaf8ee56efb5", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9641693811074918, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "const readline = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nfunction test(t, k,min = 0, max = 100) {\n// console.log(`t=${t}, k=${k}`)\n if ((t < min || t > max) || (k < min || k > max) || t {\n if (argc == 0) {\n // test(input);\n var [n,k] = input.split(' ').map(i => parseInt(i, 10));\n test(n,k,min=1,max=50)\n } else {\n // this my code belong place\n a = input.split(' ').map(i => parseInt(i,10))\n ak = a.filter(x => x >= a[k-1] && x !== 0 )\n }\n\n if (argc == 1) \n {\n // console.log(ak)\n console.log(ak.length)\n readline.close();\n }\n else argc += 1;\n});\n", "lang": "Node.js", "bug_code_uid": "1f7579b0263b7c447c6769c077fedb9c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "4c89463c890e32b620e235eae6528101", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9657320872274143, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "const readline = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nfunction test(t, k,min = 0, max = 100) {\n// console.log(`t=${t}, k=${k}`)\n if ((t < min || t > max) || (k < min || k > max) || t {\n if (argc == 0) {\n // test(input);\n [n,k] = input.split(' ').map(i => parseInt(i, 10));\n test(n,k,min=1,max=50)\n // console.log(k)\n } else {\n // this my code belong place\n a = input.split(' ').map(i => parseInt(i,10))\n ak = a.reduce((x,y) => (x >= a[k+1] && x !== 0)+y )\n// console.log(n)\n }\n\n if (argc == 1) \n {\n // console.log(ak)\n console.log(ak)\n readline.close();\n }\n else argc += 1;\n});\n", "lang": "Node.js", "bug_code_uid": "6e56fca9c4e4ee48722c529c532543f2", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "4c89463c890e32b620e235eae6528101", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9959514170040485, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let readline = require('readline');\nlet rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout,\n\tterminal: false\n});\n\nlet input = [];\nrl.on('line', function(line) {\n\tinput.push(line);\n\tif (input.length === 2) {\n\t\tnextRound(input);\n\t\trl.close();\n\t}\n});\n\nlet nextRound = (array) => {\n\tlet kth = array[1].split(' ')[array[0].split(' ')[1] * 1];\n\tlet result = array[1].split(' ').filter((el) => {\n\t\treturn el * 1 >= kth && el * 1 > 0;\n\t});\n\tconsole.log(result.length);\n};\n", "lang": "Node.js", "bug_code_uid": "5c909b62f07e10e00da31029eaa158f5", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "14fcca8d30226f1026400352f15527a1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.99812382739212, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\"use strict\";\nlet input = [];\nconst readline=require('readline');\nconst RL=readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nRL.on('line', (line)=>{\n input.push(line.trim());\n});\nRL.on('close', ()=>{\n let [n, k]=input[0].split(\" \");\n const arr=input[1].split(\" \");\n const scores=arr.map((str)=>{\n return Number(str);\n });\n\n let answer=0;\n const Kth=Number(k);\n scores.forEach(element => {\n if(element>0 && element>=scores[Kth]){\n answer++;\n }\n });\n console.log(answer);\n});\n", "lang": "Node.js", "bug_code_uid": "23d7adb9511d7d255af6a9937c1780a8", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "a4377f03726972362874a5570fe8297d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.994498297091957, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "// author: Oscar Ramos\n\n/// Source Code\n// const input = require('competitive-programming-js').inputReader\n// const { forn } = require('../utils/utils')\n// \n// const [n, k] = input.readNumberArray()\n// \n// const a = input.readNumberArray()\n// \n// a.sort((x, y) => y-x)\n// \n// let cnt = 0\n// forn(k+1, idx => {\n// if(a[idx] > 0)\n// cnt++\n// })\n// \n// console.log(cnt)\n// \n\n!function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&\"object\"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,\"default\",{enumerable:!0,value:t}),2&n&&\"string\"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,\"a\",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p=\"\",r(r.s=1)}([function(t,n){t.exports=function(t){return null!=t&&\"object\"==typeof t&&!0===t[\"@@functional/placeholder\"]}},function(t,n,r){t.exports=r(2)},function(t,n,r){let e,o=0,u={readNumberArray:function(){return e[o++].split(\" \").map(t=>Number(t))}};var i=\"\";process.stdin.resume(),process.stdin.setEncoding(\"utf8\"),process.stdin.on(\"data\",(function(t){i+=t})).on(\"end\",(function(){e=i.trim().split(\"\\n\").map(t=>t.trim());const{forn:t}=r(3),[n,o]=u.readNumberArray(),c=u.readNumberArray();c.sort((t,n)=>n-t);let f=0;t(o+1,t=>{c[t]>0&&f++}),console.log(f)}))},function(t,n,r){const e=r(4);t.exports={forn:(t,n)=>e(0,t).map(t=>n(t)),fornm:(t,n,r)=>e(0,t).map(t=>e(0,n).map(n=>r(t,n))),matrix:(t,n,r)=>e(0,t).map(()=>e(0,n).map(()=>r))}},function(t,n,r){var e=r(5),o=r(7),u=e((function(t,n){if(!o(t)||!o(n))throw new TypeError(\"Both arguments to range must be numbers\");for(var r=[],e=t;e {\n stdinInput += input;\n})\n\nprocess.stdin.on('end', () => {\n main(stdinInput);\n})\n\nmain(data) => {\n stdinInput = data.split('\\n');\n const contestant = data[0].split(' ');\n const score = data[1].split(' ');\n const kScore = +contestant[1];\n let count = 0;\n for (let i = 0; i < score.length; i += 1) {\n if (+score[i] < 1 || +score[i] < kScore) break;\n count += 1;\n }\n process.stdout.write(count + '');\n}", "lang": "Node.js", "bug_code_uid": "c8f3f4bfe495d5cbf51ec08b6234ef21", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c0e5ccc289fbadfdaa8d371350328a7e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8812131423757371, "equal_cnt": 23, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 17, "fix_ops_cnt": 23, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet stdinInput = '';\n\nprocess.stdin.on('data', input => {\n stdinInput += input;\n})\n\nprocess.stdin.on('end', () => {\n main(stdinInput);\n})\n\nfunction main(data) {\n stdinInput = data.split('\\n');\n const contestant = data[0].split(' ');\n const score = data[1].split(' ');\n const kScore = +contestant[1];\n let count = 0;\n for (let i = 0; i < score.length; i += 1) {\n if (+score[i] < 1 || +score[i] < kScore) break;\n count += 1;\n }\n process.stdout.write(count + '');\n}", "lang": "Node.js", "bug_code_uid": "b9ca528a0306b403abda0cd4cc6baf4d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c0e5ccc289fbadfdaa8d371350328a7e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9809384164222874, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar count = 0;\nvar k;\nvar places;\n\nrl.on('line', line => {\n if (count === 0) {\n k = line.split(' ')[1];\n count++;\n return;\n }\n\n if (count === 1) {\n places = line.split(' ').map(item => parseInt(item));\n rl.close();\n }\n});\n\nrl.on('close', () => {\n var targetScore = places[k-1];\n var result = 0;\n\n while(result !== places.length) {\n var manScore = places[result];\n\n if (manScore === 0 || manScore < targetScore) break;\n\n result ++;\n }\n\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "cabc9ba8c47668f3cc6544d98cd1872b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "242e489d25c37a8009a597f91d42f7fd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9515570934256056, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "'use strict'\nconst readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin\n});\nvar sec, fst, win = 0,\n arr = [],\n i, n, k;\nrl.question('', (fst) => {\n rl.on('line', (sec) => {\n n = Number(fst[0]);\n k = Number(fst[2]);\n arr = sec.split(' ');\n for (i = 0; i < k; i++) {\n if (arr[i] > 0) {\n win++;\n }\n }\n while ((arr[k - 1] === arr[k]) && (k < n) && (arr[k - 1] != 0)) {\n if (arr[k] > 0) {\n k++;\n win++;\n }\n }\n console.log(win);\n rl.close();\n });\n});\n", "lang": "Node.js", "bug_code_uid": "69c85297efbd000e2771913a0acb1db7", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "df76b9183fbb093cd738e4f1252e0a91", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9586983729662077, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const [data, results] = i.split(EOL).map((x) => {return x.split(\" \").map((y) => { return parseInt(y)})})\n \n if (Math.max(...results) >= results[data[1] - 1]){\n console.log(results.filter(i => i >= results[data[1] -1]).length);\n } else {console.log(0)}\n\n});\n", "lang": "Node.js", "bug_code_uid": "b0e05181918b4a93c69cfe81884b995c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "10785d7bb991a76b1325795dd6577d84", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8084358523725835, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet data = [];\nrl.on('line', (input) => {\n data.push(input);\n});\n\nrl.on('close', () => {\n solve(data);\n});\n\nfunction solve(data) {\n\n [n, k] = data[0].split(\" \").map(x => parseInt(x));\n // console.log(n);\n // console.log(k);\n a = data[1].split(\" \").map(x => parseInt(x));\n cutoff = a[k-1];\n advance = a.lastIndexOf(cutoff) + 1;\n console.log(advance);\n\n}\n", "lang": "Node.js", "bug_code_uid": "769088a615f8080811bec1c044175827", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "26146ba43cd51de52c92670985da2cf6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9979296066252588, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const input = [];\n \nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', (line) => {\n input.push(line);\n});\n\nRL.on('close', () => {\n const balls = input.pop().split(' ').map(x => parseInt(x));\n const params = input.pop().split(' ').map(x => parseInt(x));\n\n const [n, k] = params;\n\n let answer = 0;\n balls.forEach((b, i) => {\n if (b >= balls[k] && b > 0) { answer += 1 }\n });\n\n console.log(answer)\n});", "lang": "Node.js", "bug_code_uid": "d3419341cc9908789c4c1dad98f11027", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "20e2e7bd969598e328d698cea8a7ec73", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9815712900096993, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n\t input: process.stdin,\n\t output: process.stdout,\n\tterminal : false\n});\n\n\nrl.on(\"line\", main)\nlet i = 1\nlet n = 0\nlet k = 0\nlet w = 0\nlet score = 0\nfunction main(input){\n\tif(n == 0 ){\n\t\tlet arr = input.split(' ')\n\t\tn = arr[0]\n\t\tk = arr[1]\n\t\treturn\n\t}\n\n\n\tconst arr = input.split(' ')\n\tscore = arr[k]\n\tfor(var i = 0; i < n; i++){\n\t\tlet a = arr[i]\n\t\tif( parseInt(a) >= parseInt(score) && a > 0){\n\t\t\tw++\n\t\t}\n\t}\n\tconsole.log(w)\n}\n", "lang": "Node.js", "bug_code_uid": "ce9b28e0b88e67938b479f7dd0f15ada", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "b7c9669a99901d04b09ccc7ff6d6a42f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9730700179533214, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inp = 0\nprocess.stdin.on(\"data\",input=>{\n inp = input\n})\nprocess.stdin.on(\"end\",input=>{\n inp = inp.replace(/\\s*$/, '').split(\"\\n\").map(str => str.replace(/\\s*$/, ''));\n \n \n main();\n \n})\n\n\n\n\nfunction main(){\n n = inp[0].split(\" \")[0]\n k = inp[0].split(\" \")[1]\n \n let allscores = inp[1].split(\" \").map(item=>{return parseInt(item)})\n \n let gecen = allscores.filter((item)=>{return item >= allscores[k-1]})\n console.log(gecen.length)\n \n}", "lang": "Node.js", "bug_code_uid": "2e883f4231bdec4145ab503852761cc6", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "43c0f2ec7931be7645b8fe6ad77cfd6a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9874476987447699, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', line => {input.push(line.trim());\n}).on('close', main);\n\nfunction main() {\n let [n, k] = input[0].split(' ');\n const stdin = input[1].split(' ');\n\n const scores = stdin.map((stdin) => {\n return Number(stdin);\n });\n let count = 0;\n const thK = Number(k);\n scores.forEach(elm => {\n if (elm > 0 && elm >= scores[thK - 1]) {\n count++;\n }\n });\n console.log(count);\n}", "lang": "Node.js", "bug_code_uid": "3d11f2985121b7ca51cc56ae2fa20013", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "92e3103e0354c0ec8e435d53ab2be99b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7434094903339191, "equal_cnt": 19, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 19, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet n,k;\nrl.on('line', line => {\n [n, k] = line.split(' ');\n);\n}).on('close', () => {\n const stdin=input[1].split(' ');\n\n const scores=stdin.map((stdin)=>{\n return Number(stdin);\n });\n let count=0;\n const thK=Number(k);\n scores.forEach(elm=>{\n if(elm>0 && elm>=scores[thK-1]){\n count++;\n }\n });\n console.log(count);\n});", "lang": "Node.js", "bug_code_uid": "95672bfde291f7d55becdc20823784ef", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "92e3103e0354c0ec8e435d53ab2be99b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9155693261037955, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "process.stdin.on('data', input => {\n const inputs = input.toString().split('\\n');\n const cutOffIndex = inputs[0].split(' ')[1];\n const test = inputs[1];\n const result = getNumberOfCrossedThreshold(test.split(' '), Number(cutOffIndex));\n console.log(result);\n});\n\nfunction getNumberOfCrossedThreshold(arr, cutOffIndex) {\n // Check if the cutoff Indey should be less than array length;\n // array length should be of 1 length;\n const cutOff = arr[cutOffIndex];\n return arr.reduce((acc, curr) => {\n if (Number(curr) >= Number(cutOff)) {\n ++acc;\n }\n\n return acc;\n }, 0);\n}", "lang": "Node.js", "bug_code_uid": "21601f4ce29e1570bd32e64da26bedbb", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "d20b820e558e61bb946946c7df6e3084", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9858657243816255, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction readAsInt(){\n return parseInt(readline());\n}\n\nfunction readAsIntList(){\n return readline().split(' ').filter(i => i).map(i => parseInt(i));\n}\n\n\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n const [n, k] = readAsIntList();\n const list = readAsIntList().filter(x => x > 0);\n console.log(list.slice(k).filter(x => x === list[k]).length + k);\n}\n\n", "lang": "Node.js", "bug_code_uid": "6055f91a90def7b288fd7eceffa2cc46", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "dfd92a7a47e28ef4bdaffaa4c07e256e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8349875930521092, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar idx = 0;\nvar out = 0;\nvar totalScores = 0;\nvar passScore = 0;\nrl.on(\"line\", (theLine) => {\n if (idx === 0) {\n var lines = theLine.split(\" \");\n totalScores = parseInt(lines[0]);\n passScore = parseInt(lines[1])-1;\n } \n else {\n var scores = theLine.split(\" \");\n var currentCount = 0;\n if ((parseInt(scores[passScore]) > 0) && (totalScores > 0)) {\n scores.forEach(element => {\n if (parseInt(element) >= parseInt(scores[passScore]))\n out++;\n });\n } \n }\n idx++;\n if (idx > 1) \n {\n rl.close();\n console.log(out.toString());\n }\n \n})", "lang": "Node.js", "bug_code_uid": "dc73454e06c341c092968cad5c201def", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "fcb3e4d09861f02c9678d76198cad9a4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9866529774127311, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n\n// Write your code here\nfunction nameLookUp(arr) {\n let nLines = arr.split('\\n');\n let contestantArr = nLines[0].trim().split(' ');\n let scoresArr = nLines[1].trim().split(' ');\n let kScore = scoresArr[+contestantArr[1]];\n let count = 0;\n for (let i = 0; i < scoresArr.length; i++) {\n\n if (+scoresArr[i] > 0 && +scoresArr[i] >= kScore) {\n count++;\n }\n }\n return count;\n\n}", "lang": "Node.js", "bug_code_uid": "b0a2d940569a660cc3e324e78ff8e507", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "06a20f1838aab8764b49cd8d23e018c8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7884108867427568, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet arr1, arr2;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n return;\n }\n\n if (c === 1) {\n c++;\n arr1 = d.split(' ').map(Number);\n return;\n }\n\n arr2 = d.split(' ').map(Number);\n const sum = arr1.reduce((a, b) => a + b, 0) + arr2.reduce((a, b) => a + b, 0);\n\n if (sum % 2 === 0) {\n console.log('YES');\n }\n else {\n console.log('NO');\n }\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "f6753206ca7deb283fc6f5f3888dd3e4", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "25ef78d45a7628abae889375b54905d2", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6606860158311345, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "\n'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n// Complete the coins function below.\nfunction coins(n) {\nvar ans=[];\nvar div=[];\nvar g=0;\nfor(var i=0;i<=n;i++){\n if(n%i==0) div.push(i);\n}\nfor(var k=0;k {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n// Complete the coins function below.\nfunction coins(n) {\nvar pri=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103];\nvar ans=[];\nvar pridiv=[];\nvar div =[];\nvar g=0;\nvar t=1;\nfor(var i=0;i<=pri.length;i++){\n if(n%pri[i]==0) pridiv.push(pri[i]);\n}\nfor(var k=0;k {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n// Complete the extraLongFactorials function below.\nfunction extraLongFactorials(n) {\n var ans = [];\n var num = n;\n for (var i = num - 1; i >= 1; i--) {\n if (num % i === 0) {ans.push(i);\n num = i;\n }\n }\n console.log(ans.join(' '));\n return ans; \n}\nfunction main() {\n // const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n const n = parseInt(readLine(), 10);\n\n const result = extraLongFactorials(n);\n // ws.write(result.join(' ') + '\\n');\n\n // ws.end();\n}\n", "lang": "Node.js", "bug_code_uid": "379c6ac244115b737751b660e538d1d2", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "0981f5e051fbf5f55934ba44765eeee5", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5350389321468298, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "'use strict';\n\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n////\n\nFunction coins(n){\n\tvar coins =[];\n\tcoins.push(n);\n\twhile(n!=1){\n\t\tif(n%2 ==1){\n\t\t\tn=1;\n\t\t\tcoins.push(n);\n\t\t}\n\t\telse{\n\t\t\tn=n/2;\n\t\t\tcoins.push(n);\n\t\t}\n\t}\n\treturn coins.join(\" \");\n}\n\n\n/////\nfunction main() {\n const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n const n = parseInt(readLine(), 10);\n\n /* for (let tItr = 0; tItr < t; tItr++) {\n const nms = readLine().split(' ');\n\n const n = parseInt(nms[0], 10);\n\n const m = parseInt(nms[1], 10);\n\n const s = parseInt(nms[2], 10);\n\n \n\n \n }*/\n\tlet result = coins(n);\n\tws.write(result + \"\\n\");\n\n ws.end();\n}", "lang": "Node.js", "bug_code_uid": "004f93996258bce928bf88b268bf8d42", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "f509e4bc114e3292306e9fad34f1e341", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6752688172043011, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "'use strict';\n\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n// Complete the saveThePrisoner function below.\nfunction coins(n) {\n var coins = [];\n coins.push(n);\n for (var i = n - 1; i > 0; i--) {\n if ((n % i) == 0) {\n coins.push(i);\n n = i;\n }\n }\n return coins;\n}\n\nfunction main() {\n const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n const n = parseInt(readLine(), 10);\n\n /* for (let tItr = 0; tItr < t; tItr++) {\n const nms = readLine().split(' ');\n\n const n = parseInt(nms[0], 10);\n\n const m = parseInt(nms[1], 10);\n\n const s = parseInt(nms[2], 10);\n\n\n }*/\n let result = coins(n);\n\n ws.write(result.join(\" \") + \"\\n\");\n ws.end();\n}\n", "lang": "Node.js", "bug_code_uid": "546244a55bdbb0fd9b8d35b43cb89cf1", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "f509e4bc114e3292306e9fad34f1e341", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.413135593220339, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 15, "bug_source_code": "function main(){\nvar n = parseInt(readLine(), 10);\nvar coins = [];\ncoins.push(n);\nfor (var i = n - 1; i > 0; i--) {\n if ((n % i) == 0) {\n coins.push(i);\n n = i;\n }\n}\nconsole.log( coins.join(\" \") );\n}\n", "lang": "Node.js", "bug_code_uid": "94f0ddf7a59dcb1266223d44df92137f", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "f509e4bc114e3292306e9fad34f1e341", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9916434540389972, "equal_cnt": 13, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 13, "bug_source_code": "'use strict';\n// const fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction bCoins(n) {\n var arr = [n];\n var i,k,max = n;\n for (i = n-1; i > 1; i--){\n if(max % i === 0){\n arr.push(i);\n max = i;\n }\n }\n arr.push(1)\n console.log(arr.join(' '))\n}\nfunction main() {\n // const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n const n = parseInt(readLine(), 10);\n\n var res = bCoins(n);\n\n // ws.write(res.join(' ') + '\\n');\n\n // ws.end();\n}\n", "lang": "Node.js", "bug_code_uid": "33307864dfc8981a592760cf1dbdb3a4", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "5c0076c5f275dd862943612b1d6dd8df", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5642480745845156, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 10, "fix_ops_cnt": 17, "bug_source_code": "'use strict';\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction bCoins(n) {\n var arr = [n,1];\n var i,k;\n for (i = 2; i < Math.sqrt(n); i++){\n k = n / i;\n if (n % i == 0) { arr.push(i); if (i != k) arr.push(k);}\n }\n if (Math.sqrt(n) == Math.ceil(Math.sqrt(n))) arr.push(Math.sqrt(n));\n arr = arr.sort((a, b) => b - a);\n console.log(arr)\n var narr = [0];\n var count = 1, j;\n for (i = 1; i < arr.length; i++){\n for (j = 1; j < arr[i]; j++) {\n if (arr[i] % j == 0) { count++; }\n }\n narr.push(count);\n count = 1;\n }\n var max = 0,index;\n narr.map((nar, i) => { if (max < nar) { max = nar; index = i;}})\n max = arr[index];\n arr = [n]\n console.log(max);\n for (i = 1; i < Math.ceil(Math.sqrt(max)); i++) {\n if (max % i == 0) { arr.push(i); if (i!=max / i) arr.push(max / i); }\n }\n arr = arr.sort((a, b) => b - a);\n return arr;\n // console.log(arr);\n}\nfunction main() {\n const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n const n = parseInt(readLine(), 10);\n\n var res = bCoins(n);\n\n ws.write(res.join(' ') + '\\n');\n\n ws.end();\n}\n", "lang": "Node.js", "bug_code_uid": "8481e6898e595d0e3dccf21d4c4fc915", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "5c0076c5f275dd862943612b1d6dd8df", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9878738884397736, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nlet secondLine = false;\n\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet inputs = [];\n\n\n\nrl.on('line', lineInput => {\n inputs.push(lineInput);\n})\n\n// Read Inputs\nrl.on('close', () => {\n inputs = inputs[0].split(' ');\n const n = parseInt(inputs[0]);\n const m = parseInt(inputs[1]);\n let moves = 0;\n\n if (n < m)\n return console.log(-1)\n\n moves = Math.floor(n / 2) + n % m;\n while (moves%m !== 0 && moves < n) {\n moves +=1;\n }\n console.log(moves)\n\n});", "lang": "Node.js", "bug_code_uid": "762e8988f89c906c382aedcd51b062f4", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "305eb19bbf3014557e885f2d8d7ffc1a", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9990719257540603, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n↑入力 ↓出力');\n Main();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n var x = one[0];\n var y = one[1];\n var z = one[2];\n one = nextIntArray();\n var a = one[0];\n var b = one[1];\n var c = one[2];\n if(a < x){\n myout(\"NO\");\n return;\n }\n a -= x;\n if(a + c < y){\n myout(\"NO\");\n return;\n }\n var ac = a + c;\n ac -= y;\n if(ac + b < z){\n myout(\"NO\");\n return;\n }else{\n myout(\"YES\");\n return;\n }\n}\n", "lang": "Node.js", "bug_code_uid": "5f345aaec3ef7e6196b94a1ae55e5229", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "1ddc2845bf2a14534b54a90de51ce55b", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8204570184983678, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "const readline = require(\"readline\")\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet word;\nlet currentChar = \"a\".charCodeAt(0)\nlet rotations = 0;\n\nrl.on(\"line\", (input) => {\n if (!word) {\n word = input.split(\" \").toString();\n }\n if (word) {\n for (let index = 0; index < word.length; index++) {\n let temp = Math.abs((word.charCodeAt(index) - currentChar))\n if (temp > 13) {\n rotations += (25 - (temp - 1))\n currentChar = word.charCodeAt(index)\n }\n if (temp < 13) {\n currentChar = word.charCodeAt(index)\n rotations += temp\n }\n\n }\n\n\n console.log( rotations)\n rl.close()\n }\n})", "lang": "Node.js", "bug_code_uid": "e461164f65c3abf3f71f9a48158d1286", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "48f812a50b38ba180e8cf86e858afe00", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9772410589874594, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "function giaiBai(data) {\n let temp = 0\n if(data.length === 1) {\n return\n }\n for(var i = 0; i < data.length; i++) {\n let count = 0\n if(i === 0) {\n count = Math.abs(data.charCodeAt(0) - 97)\n } else {\n count = Math.abs(data.charCodeAt(i) - data.charCodeAt(i - 1))\n }\n if (count > 13) {\n count = 26 - count\n }\n temp = temp + count\n }\n console.log(temp)\n}\n\n// Get process.stdin as the standard input object.\nvar standard_input = process.stdin;\n\n// Set input character encoding.\nstandard_input.setEncoding('utf-8');\n\n// Prompt user to input data in console.\n// console.log(\"Please input text in command line.\");\n\n// When user input data and click enter key.\nstandard_input.on('data', function (data) {\n\n // User input exit.\n if(data === 'exit\\n'){\n // Program exit.\n console.log(\"User input complete, program exit.\");\n process.exit();\n }else\n {\n // Print user input in console.\n data = data.trim()\n giaiBai(data)\n process.exit();\n }\n});", "lang": "Node.js", "bug_code_uid": "f7b84b4e6fff1507708a45cd7950e421", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "4aace7495c8eeafeb6aa527088d80e1d", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.6117775354416576, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "const readline = require(\"readline\")\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet shovelPrice;\nlet unlimitedBudget = 10;\nlet r = 0;\nlet flag = true;\nlet counter = 1;\n\nrl.on(\"line\", (input) => {\n if (!shovelPrice) {\n let tempArr = input.split(\" \").map(Number)\n shovelPrice = tempArr[0]\n r = tempArr[1]\n }\n if (shovelPrice) {\n while (flag) {\n let temp = 1;\n let temp2 = 0;\n temp = (((unlimitedBudget * counter) + r) / shovelPrice)\n temp2 = (((unlimitedBudget * counter)) / shovelPrice)\n if (temp === Math.round(temp)) {\n console.log(temp)\n flag = false\n rl.close();\n } else if (temp2 === Math.round(temp2)) {\n console.log(temp2)\n flag = false\n rl.close();\n } else {\n counter++\n }\n\n }\n }\n\n\n})", "lang": "Node.js", "bug_code_uid": "567dbd23313b3ebbd102b4705798067d", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "66d12ca1ee2c9b14c6748fc4c44d60cc", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7223812249570692, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "const readline = require(\"readline\")\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet shovelPrice;\nlet unlimitedBudget = 10;\nlet r = 0;\nlet flag = true;\nlet counter = 1;\n\nrl.on(\"line\", (input) => {\n if (!shovelPrice) {\n let tempArr = input.split(\" \").map(Number)\n shovelPrice = tempArr[0]\n r = tempArr[1]\n }\n if (shovelPrice) {\n while (flag) {\n if(shovelPrice===r){\n console.log(counter)\n flag = false\n rl.close(); \n break;\n }\n if (shovelPrice % unlimitedBudget * counter === 0 || shovelPrice * counter % 10 === r) {\n console.log(counter)\n flag = false\n rl.close(); \n break;\n } else {\n counter++\n }\n }\n }\n\n\n})", "lang": "Node.js", "bug_code_uid": "48f2cbad65ee5ba2347d4715f640764f", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "66d12ca1ee2c9b14c6748fc4c44d60cc", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9892617449664429, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\"use strict\";\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet inputString = \"\";\nlet currentLine = 0;\n\nprocess.stdin.on(\"data\", (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\nfunction main() {\n const x = readline().split(\" \");\n \n \n buyAShovel(x[0],x[1]);\n}\n\nfunction buyAShovel(k, r) {\n let n = 1;\n\n while (!((n * k) % 10 === 0 || (n * k) % 10 === r)) {\n n++;\n }\n console.log(n);\n\n return n;\n}\n\n\n", "lang": "Node.js", "bug_code_uid": "8c9d79fd681e40d01f7bbad9cf855556", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "5d2430085829afd664add99d720f4204", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9990684676292502, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error(\"\\n\");\n var start = Date.now();\n Main();\n var end = Date.now() - start;\n myerr(\"time : \" + (end) + \"ms\");\n myerr(\"memory : \" + Math.round(process.memoryUsage().heapTotal / 1024) + \"KB\");\n});\nfunction makeClone(obj){return JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw \"ArrayIndexOutOfBoundsException ‚There is no more input\";}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error(\"debug:\" + require(\"util\").inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map(Number);case 6:return i.split(\"\");case 7:return i.split(\"\").map(Number);case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var K = nextInt();\n var L = nextInt();\n var M = nextInt();\n var D = nextInt();\n var N = nextInt();\n var output = 0;\n for(var i = 1; i <= N; i++){\n if(i % K == 0 || i % L == 0 || i % K == M || i % D == 0){\n output++;\n }\n }\n myout(output);\n}\n", "lang": "Node.js", "bug_code_uid": "fb8f441f3775fdfa06ac336697121a5d", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "efd5cf34dadf80f70701068ce5d17ffb", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9305675597810429, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "//Insomnia cure\n\nconst {EOL} = require('os');\n\nlet inp = '';\n\nprocess.stdin.on('data', c => inp += c);\n\nprocess.stdin.on('end', () => {\n let lines = inp.split(EOL).map(c => +c);\n \n let gcd = (a, b) => {\n \tif(b == 0) {\n \t\treturn a;\n \t}\n \treturn gcd(b, a % b);\n };\n\n let lcm = (a, b) => (a * b) / gcd(a, b);\n\n let thr = lines.slice(0, 4);\n\n let flg = true;\n for(let i in thr) {\n if(thr[i] < lines[4]) {\n flg = false;\n }\n }\n if(flg) {\n process.stdout.write('0');\n return;\n }\n\n let thrx = [];\n\n for(let i = 0; i < thr.length; i++) {\n \tlet addflg = true;\n \tfor(let j = 0; j < thrx.length; j++) {\n \t\tif(thr[i] % thrx[j] == 0) {\n \t\t\taddflg = false;\n \t\t\tbreak;\n \t\t}\n \t\tif(thrx[j] % thr[i] == 0) {\n \t\t\tthrx[j] = thr[i];\n \t\t\taddflg = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\t\tif(addflg) {\n\t\t\tthrx.push(thr[i]);\n\t\t}\n }\n\n let thrf = [thrx, [], [], []];\n for(let i = 0; i < thrx.length; i++) {\n \tfor(let j = i + 1; j < thrx.length; j++) {\n \t\tlet l1 = lcm(thrx[i], thrx[j]);\n \t\tfor(let k = j + 1; k < thrx.length; k++) {\n \t\t\tlet l2 = lcm(l1, thrx[k]);\n \t\t\tfor(let l = k + 1; l < thrx.length; l++) {\n \t\t\t\tthrf[3].push(lcm(l3, thrx[l]));\n \t\t\t}\n \t\t\tthrf[2].push(l2);\n \t\t}\n \t\tthrf[1].push(l1);\n \t}\n }\n\n let calc = (i) => Math.floor(lines[4] / i);\n\n let res = 0;\n\n for(let i = 0; i < thrf.length; i++) {\n \tlet sum = 0;\n \tfor(let j in thrf[i]) {\n \t\tsum += calc(thrf[i][j]);\n \t}\n \tres += (1 - ((i % 2) * 2)) * sum;\n }\n\n process.stdout.write(res + '');\n\n return;\n});", "lang": "Node.js", "bug_code_uid": "590ec8879988e5849157554c9c45ab70", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "8e05199b639895012e4716111bbc60e6", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9311437626044368, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "//Insomnia cure\n\nconst {EOL} = require('os');\n\nlet inp = '';\n\nprocess.stdin.on('data', c => inp += c);\n\nprocess.stdin.on('end', () => {\n let lines = inp.split(EOL).map(c => +c);\n \n let gcd = (a, b) => {\n \tif(b == 0) {\n \t\treturn a;\n \t}\n \treturn gcd(b, a % b);\n };\n\n let lcm = (a, b) => (a * b) / gcd(a, b);\n\n let thr = lines.slice(0, 4);\n\n let flg = true;\n for(let i in thr) {\n if(thr[i] < lines[4]) {\n flg = false;\n }\n }\n if(flg) {\n process.stdout.write('0');\n return;\n }\n\n let thrx = [];\n\n for(let i = 0; i < thr.length; i++) {\n \tlet addflg = true;\n \tfor(let j = 0; j < thrx.length; j++) {\n \t\tif(thr[i] % thrx[j] == 0) {\n \t\t\taddflg = false;\n \t\t\tbreak;\n \t\t}\n \t\tif(thrx[j] % thr[i] == 0) {\n \t\t\tthrx[j] = thr[i];\n \t\t\taddflg = true;\n \t\t\tbreak;\n \t\t}\n \t}\n\t\tif(addflg) {\n\t\t\tthrx.push(thr[i]);\n\t\t}\n }\n\n let thrf = [thrx, [], [], []];\n for(let i = 0; i < thrx.length; i++) {\n \tfor(let j = i + 1; j < thrx.length; j++) {\n \t\tlet l1 = lcm(thrx[i], thrx[j]);\n \t\tfor(let k = j + 1; k < thrx.length; k++) {\n \t\t\tlet l2 = lcm(l1, thrx[k]);\n \t\t\tfor(let l = k + 1; l < thrx.length; l++) {\n \t\t\t\tthrf[3].push(lcm(l2, thrx[l]));\n \t\t\t}\n \t\t\tthrf[2].push(l2);\n \t\t}\n \t\tthrf[1].push(l1);\n \t}\n }\n\n let calc = (i) => Math.floor(lines[4] / i);\n\n let res = 0;\n\n for(let i = 0; i < thrf.length; i++) {\n \tlet sum = 0;\n \tfor(let j in thrf[i]) {\n \t\tsum += calc(thrf[i][j]);\n \t}\n \tres += (1 - ((i % 2) * 2)) * sum;\n }\n\n process.stdout.write(res + '');\n\n return;\n});", "lang": "Node.js", "bug_code_uid": "a343e0d42811c9e15af33c6fd3af381b", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "8e05199b639895012e4716111bbc60e6", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6044393853158794, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet k, l, m, n, d;\n\nrl.on('line', (data) => {\n if (c === 0) {\n k = +data;\n c++;\n return;\n }\n\n if (c === 1) {\n l = +data;\n c++;\n return;\n }\n\n if (c === 2) {\n m = +data;\n c++;\n return;\n }\n\n if (c === 3) {\n n = +data;\n c++;\n return;\n }\n\n if (c === 4) {\n d = +data;\n c++;\n }\n\n let ans = Math.ceil(d / k) + Math.ceil(d / l) + Math.ceil(d / m) + Math.ceil(d / n) - Math.ceil(d / (k * l)) - Math.ceil(d / (k * m)) - Math.ceil(d / (k * n)) - Math.ceil(d / (l * m)) - Math.ceil(d / (l * n)) - Math.ceil(d / (m * n)) + Math.ceil(d / (k * l * m)) + Math.ceil(d / (k * l * n)) + Math.ceil(d / (l * m * n)) - Math.ceil(d / (k * l * m * n));\n\n if (k === 1 || l === 1 || m === 1 || n === 1) {\n ans = d;\n }\n\n console.log(ans);\n // for (let i = 1; i <= d; i++) {\n // if (i % k === 0 || i % l === 0 || i % m === 0 || i % n === 0) {\n // ans++;\n // }\n // }\n\n // console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "9bfefad2a16dfed5c326eb1b13d10e26", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "8ec2c0f046f214e468346aa0655a51c9", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9858889934148636, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n const k = parseInt(input[0]);\n const l = parseInt(input[1]);\n const m = parseInt(input[2]);\n const n = parseInt(input[3]);\n const d = parseInt(input[4]);\n\n let answ = 0;\n for (let i = 1; i <= d; i += 1) {\n if (i % k === 0 || i % l === 0 || i % m === 0 || i % n === 0 || i % d === 0) answ += 1;\n }\n\n console.log(answ);\n});", "lang": "Node.js", "bug_code_uid": "a556142dc3945929ca9028420c2c2642", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "8026cde3df78923546853c74911185f1", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9841095890410959, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let k = parseInt(readLine());\n let l = parseInt(readLine());\n let m = parseInt(readLine());\n let n = parseInt(readLine());\n let d = parseInt(readLine());\n\n let result = d;\n\n if (k == 1 || l == 1 || m == 1 || n == 1) {\n console.log(result);\n return;\n }\n for (let i = 1; i <= d; i++) {\n if (k % i !== 0 && l % i !== 0 && m % i !== 0 && n % i !== 0) {\n result--;\n }\n }\n console.log(result);\n}\n", "lang": "Node.js", "bug_code_uid": "66dfcb5846fd5960aa2236b6f27eb8b5", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "63e1ea0483d6f75e21296f8323a24e40", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9773355444997236, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 12, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let k = parseInt(readLine());\n let l = parseInt(readLine());\n let m = parseInt(readLine());\n let n = parseInt(readLine());\n let d = parseInt(readLine());\n if (k == 1 || l == 1 || m == 1 || n == 1) {\n console.log(d);\n } else {\n for (var i = 1; i <= d; i++) {\n if (i % k != 0 && i % l != 0 && i % m != 0 && i % n != 0) {\n d--;\n }\n }\n console.log(d);\n }\n}", "lang": "Node.js", "bug_code_uid": "d402b5b400fa9fba336d88295936aff7", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "622452a0c463b3fd55ebf8030e71a0cc", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6592, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "let i = '';\nprocess.stdin.on('data', c => i += c);\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL)\n const count = lines[0];\n\n if (count % 2 == 1) {\n console.log(2);\n } else {\n console.log(1);\n }\n});", "lang": "Node.js", "bug_code_uid": "16c0822b4f070e84c0c20f64017cefb6", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "a3479cbc68faa94d6bf22aadbfcf26c2", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9902370990237099, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n const count = lines[0];\n\n let putted = 0;\n\n\twhile (count > 0) {\n\t if (count % 2 == 1) {\n\t putted += 1;\n\t }\n\t count = parseInt(count / 2)\n\t}\n\n\tconsole.log(putted);\n})\n\n", "lang": "Node.js", "bug_code_uid": "fa1337433dc915cb0ac8b633d7c474f6", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "a3479cbc68faa94d6bf22aadbfcf26c2", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9880478087649402, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let [n, k] = d.split(' ').map(Number);\n\n let mid = Math.ceil(n / 2);\n let x = mid % (k + 1);\n let a = (mid - x) / (k + 1);\n let b = a * k;\n let c = n - a - b;\n\n console.log(`${a} ${b} ${c}`);\n});\n", "lang": "Node.js", "bug_code_uid": "7ccc215b6d34da7c3a55a4ea4d715811", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "75bc28a844bafbfd7e0658e266085b66", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5909533073929961, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let brain = readLine();\n while (brain.includes('>')) {\n brain = brain.replace('>', '1000');\n }\n while (brain.includes('<')) {\n brain = brain.replace('<', '1001');\n }\n while (brain.includes('+')) {\n brain = brain.replace('+', '1010');\n }\n while (brain.includes('-')) {\n brain = brain.replace('-', '1011');\n }\n while (brain.includes('.')) {\n brain = brain.replace('.', '1100');\n }\n while (brain.includes(',')) {\n brain = brain.replace(',', '1101');\n }\n while (brain.includes('[')) {\n brain = brain.replace('[', '1110');\n }\n while (brain.includes(']')) {\n brain = brain.replace(']', '1111');\n }\n // console.log(brain);\n let ans = parseInt(brain, 2);\n let final = ans % 1000003;\n console.log(final);\n}\n", "lang": "Node.js", "bug_code_uid": "88a4ae1380992760dae332438d9f6c99", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "2d6bec53f7aecca9159a6a93085a61dd", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9323463590979515, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let brain = readLine();\n while (brain.includes('>')) {\n brain = brain.replace('>', '1000');\n }\n while (brain.includes('<')) {\n brain = brain.replace('<', '1001');\n }\n while (brain.includes('+')) {\n brain = brain.replace('+', '1010');\n }\n while (brain.includes('-')) {\n brain = brain.replace('-', '1011');\n }\n while (brain.includes('.')) {\n brain = brain.replace('.', '1100');\n }\n while (brain.includes(',')) {\n brain = brain.replace(',', '1101');\n }\n while (brain.includes('[')) {\n brain = brain.replace('[', '1110');\n }\n while (brain.includes(']')) {\n brain = brain.replace(']', '1111');\n }\n // console.log(brain);\n let ans = convertBase(brain, 2, 10);\n // let ansString = ans.toString();\n // let final = ans % 1000003;\n let final = 0;\n let length = ans.toString().length;\n for (let i = 0; i < length; i++) {\n final = (final * 10 + (ansString[i] - 0)) % 1000003;\n }\n console.log(final);\n}\nfunction parseBigInt(bigint, base) {\n //convert bigint string to array of digit values\n for (var values = [], i = 0; i < bigint.length; i++) {\n values[i] = parseInt(bigint.charAt(i), base);\n }\n return values;\n}\n\nfunction formatBigInt(values, base) {\n //convert array of digit values to bigint string\n for (var bigint = '', i = 0; i < values.length; i++) {\n bigint += values[i].toString(base);\n }\n return bigint;\n}\n\nfunction convertBase(bigint, inputBase, outputBase) {\n //takes a bigint string and converts to different base\n var inputValues = parseBigInt(bigint, inputBase),\n outputValues = [], //output array, little-endian/lsd order\n remainder,\n len = inputValues.length,\n pos = 0,\n i;\n while (pos < len) {\n //while digits left in input array\n remainder = 0; //set remainder to 0\n for (i = pos; i < len; i++) {\n //long integer division of input values divided by output base\n //remainder is added to output array\n remainder = inputValues[i] + remainder * inputBase;\n inputValues[i] = Math.floor(remainder / outputBase);\n remainder -= inputValues[i] * outputBase;\n if (inputValues[i] == 0 && i == pos) {\n pos++;\n }\n }\n outputValues.push(remainder);\n }\n outputValues.reverse(); //transform to big-endian/msd order\n return formatBigInt(outputValues, outputBase);\n}\n", "lang": "Node.js", "bug_code_uid": "020867598081986ebecc1797a5531233", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "2d6bec53f7aecca9159a6a93085a61dd", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9977494373593399, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nfunction is_unique(str) {\n var obj = {};\n for(var z=0; z < str.length; z++) {\n var ch = str[z];\n if(obj[ch]) return false; else obj[ch] = true;\n }\n return true;\n}\n\nrl.question('', (inputLine) => {\n let obj = {};\n let distinct = 1;\n let loopIndex = parseInt(inputLine) + 1;\n \n for(let i = loopIndex; i <= 9000; i++) {\n let year = i + '';\n // console.log(year);\n if(is_unique(year)){\n console.log(year);\n break;\n }\n }\n \n rl.close();\n});\n", "lang": "Node.js", "bug_code_uid": "602f29bd5cddea9bd2c9ded5b69706aa", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "6f4a71f113313452dc72f8aa28ecbec2", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9565217391304348, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let givenYear = readLine();\n let givenYearNumber = parseInt(givenYear);\n while (true) {\n givenYearNumber++;\n let firstDigit = givenYearNumber / 1000;\n let SecondDigit = (givenYearNumber / 100) % 10;\n let ThirdDigit = (givenYearNumber / 10) % 10;\n let LastDigit = givenYearNumber % 10;\n if (\n firstDigit !== SecondDigit &&\n firstDigit !== ThirdDigit &&\n firstDigit !== LastDigit &&\n SecondDigit !== ThirdDigit &&\n SecondDigit !== LastDigit &&\n ThirdDigit !== LastDigit\n ) {\n break;\n }\n }\n console.log(givenYearNumber);\n}\n", "lang": "Node.js", "bug_code_uid": "97a8166a1890136331e04affdeced22e", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "abc39a32a69e6015cefea5170f510b66", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9973021582733813, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let givenYear = parseInt(readLine());\n while (true) {\n givenYearNumber++;\n let firstDigit = parseInt(givenYearNumber / 1000);\n let SecondDigit = parseInt((givenYearNumber / 100) % 10);\n let ThirdDigit = parseInt((givenYearNumber / 10) % 10);\n let LastDigit = givenYearNumber % 10;\n if (\n firstDigit !== SecondDigit &&\n firstDigit !== ThirdDigit &&\n firstDigit !== LastDigit &&\n SecondDigit !== ThirdDigit &&\n SecondDigit !== LastDigit &&\n ThirdDigit !== LastDigit\n ) {\n break;\n }\n }\n console.log(givenYearNumber);\n}\n", "lang": "Node.js", "bug_code_uid": "193a157e4fbb384438b316df5adfa504", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "abc39a32a69e6015cefea5170f510b66", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9122970145784213, "equal_cnt": 28, "replace_cnt": 16, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 27, "bug_source_code": "function ProblemSolver() {\n this.HAS_TEST_CASES = false;\n this.INPUT_FILE_NAME = \"test.in\";\n this.OUTPUT_FILE_NAME = \"out.txt\";\n this.DO_OUTPUT_TO_FILE = false;\n this.CLEAR_ARRAY_PER_CASE = false;\n \n this.rec = function( arr , brr , firstFlag ) {\n \tvar res , r1 , newArr , newBrr , fl , sz , i , sz1 , sz2 ;\n \tif( firstFlag == false && arr.length == this.baseCaseArr.length && brr.length == this.baseCaseBrr.length ) {\n \t\tfl = 1 ;\n \t\tsz = arr.length ;\n \t\tfor( i = 0 ; i < sz ; i++ ) {\n \t\t\tif( arr[ i ] != this.baseCaseArr[ i ] ) {\n \t\t\t\tfl = 0 ;\n \t\t\t\tbreak ;\n \t\t\t}\n \t\t}\n \t\tsz = brr.length ;\n \t\tfor( i = 0 ; i < sz ; i++ ) {\n \t\t\tif( brr[ i ] != this.baseCaseBrr[ i ] ) {\n \t\t\t\tfl = 0 ;\n \t\t\t\tbreak ;\n \t\t\t}\n \t\t}\n \t\tif( fl == 1 ) {\n \t\t\treturn -1 ;\n \t\t}\n \t}\n \tif( firstFlag == false && arr.length == this.baseCaseBrr.length && brr.length == this.baseCaseArr.length ) {\n \t\tfl = 1 ;\n \t\tsz = arr.length ;\n \t\tfor( i = 0 ; i < sz ; i++ ) {\n \t\t\tif( arr[ i ] != this.baseCaseBrr[ i ] ) {\n \t\t\t\tfl = 0 ;\n \t\t\t\tbreak ;\n \t\t\t}\n \t\t}\n \t\tsz = brr.length ;\n \t\tfor( i = 0 ; i < sz ; i++ ) {\n \t\t\tif( brr[ i ] != this.baseCaseArr[ i ] ) {\n \t\t\t\tfl = 0 ;\n \t\t\t\tbreak ;\n \t\t\t}\n \t\t}\n \t\tif( fl == 1 ) {\n \t\t\treturn -1 ;\n \t\t}\n \t}\n \tif( arr.length == 0 ) {\n \t\tthis.winner = 2 ;\n \t\treturn 0 ;\n \t}\n \tif( brr.length == 0 ) {\n \t\tthis.winner = 1 ;\n \t\treturn 0 ;\n \t}\n \tnewArr = [] ;\n \tnewBrr = [] ;\n \tsz1 = arr.length ;\n \tsz2 = brr.length ;\n \tfor( i = 1 ; i < sz1 ; i++ ) {\n\t\t\tnewArr.push( arr[ i ] ) ;\n\t\t}\n\t\tfor( i = 1 ; i < sz2 ; i++ ) {\n\t\t\tnewBrr.push( brr[ i ] ) ;\n\t\t}\n \tif( arr[ 0 ] > brr[ 0 ] ) {\n \t\tnewArr.push( brr[ 0 ] ) ;\n \t\tnewArr.push( arr[ 0 ] ) ;\n \t}\n \telse {\n \t\tnewBrr.push( arr[ 0 ] ) ;\n \t\tnewBrr.push( brr[ 0 ] ) ;\n \t}\n \tr1 = this.rec( newArr , newBrr , false ) ;\n \tif( r1 == -1 ) {\n \t\tres = -1 ;\n \t}\n \telse {\n \t\tres = r1 + 1 ;\n \t}\n \treturn res ;\n } ;\n\n this.solveCase = function() {\n var res , i , j , fl , cn , temp ;\n res = 0 ;\n this.baseCaseArr = [] ;\n for( i = 0 ; i < this.k1 ; i++ ) {\n \tthis.baseCaseArr.push( this.arr[ i ] ) ;\n }\n this.baseCaseBrr = [] ;\n for( i = 0 ; i < this.k2 ; i++ ) {\n \tthis.baseCaseBrr.push( this.brr[ i ] ) ;\n }\n this.winner = -1 ;\n res = this.rec( this.arr , this.brr , true ) ;\n if( res == -1 ) {\n \tprint( res );\n }\n else {\n \tprint( res + ' ' + this.winner );\n }\n };\n\n this.init = function() {\n this.lim1 = 100010;\n this.lim2 = 110;\n this.cc = 1;\n this.ind = 1;\n this.n = 0;\n this.cn = 0;\n this.declareAndFillArrays();\n };\n\n this.getInput = function( irObj ) {\n var hasMoreInput , i;\n hasMoreInput = true;\n try {\n this.n = irObj.nextInt();\n this.k1 = irObj.nextInt();\n this.arr = [] ;\n for( i = 0 ; i < this.k1 ; i++ ) {\n this.arr.push( irObj.nextInt() ) ;\n }\n this.brr = [] ;\n this.k2 = irObj.nextInt();\n for( i = 0 ; i < this.k2 ; i++ ) {\n this.brr.push( irObj.nextInt() ) ;\n }\n }\n catch( ex ) {\n hasMoreInput = false;\n }\n return hasMoreInput;\n };\n\n this.clearArraysPerCase = function() {\n var i;\n this.arr = new Array();\n this.adj_list = new Array();\n for( i = 0 ; i < this.lim1 ; i++ ) {\n this.arr.push( 0 );\n this.adj_list.push( new Array() );\n }\n };\n\n this.clearPerCase = function() {\n this.cn = 0;\n this.cc++;\n if( this.CLEAR_ARRAY_PER_CASE == true ) {\n this.clearArraysPerCase() ;\n }\n };\n\n this.declareAndFillArrays = function() {\n var i , j;\n this.srr = new Array();\n this.vis = new Array();\n this.arr = new Array();\n this.brr = new Array();\n this.memo = new Array();\n this.done = new Array();\n this.adj_list = new Array();\n for( i = 0 ; i < this.lim1 ; i++ ) {\n this.srr.push( \"\" );\n this.vis.push( 0 );\n this.arr.push( 0 );\n this.brr.push( 0 );\n this.adj_list.push( new Array() );\n }\n for( i = 0 ; i < this.lim2 ; i++ ) {\n this.memo.push( new Array() );\n this.done.push( new Array() );\n for( j = 0 ; j < this.lim2 ; j++ ) {\n this.memo[ i ].push( -1 );\n this.done[ i ].push( 0 );\n }\n }\n };\n\n this.init();\n}\n\nfunction InputReader() {\n var self = this ;\n this.allLines = new Array();\n this.currrentLineNumber = 0;\n this.currrentCharacterIndex = 0;\n this.callBackFunction = null ;\n this.parentContext = null ;\n\n this.readAllLines = function() {\n var singleLine;\n while( true ) {\n try {\n singleLine = readline();\n if( singleLine == null ) {\n break;\n }\n }\n catch( ex ) {\n break;\n }\n this.allLines.push( singleLine );\n }\n };\n \n this.readAllLinesFromRhino = function() {\n var brObj , line ;\n importPackage( java.io ) ;\n importPackage( java.lang ) ;\n brObj = new BufferedReader( new InputStreamReader( System[ 'in' ] ) ) ;\n this.allLines = [] ;\n while( true ) {\n line = brObj.readLine() ;\n if( line == null ) {\n break;\n }\n this.allLines.push( line ) ;\n }\n };\n \n this.readSingleLinesFromNodeJsJudgeServer = function( chunk ) {\n self.chunkData += chunk ;\n };\n\n this.readEndFromNodeJsJudgeServer = function() {\n self.parseRawData( self.chunkData ) ;\n self.parentContext.runCases() ;\n };\n \n this.readAllLinesFromNodeJsJudgeServer = function( parentContext ) {\n this.parentContext = parentContext ;\n process.stdin.resume() ;\n process.stdin.setEncoding( 'utf8' ) ;\n this.chunkData = '' ;\n process.stdin.on( 'data' , this.readSingleLinesFromNodeJsJudgeServer ) ;\n process.stdin.on( 'end' , this.readEndFromNodeJsJudgeServer ) ;\n };\n\n this.parseRawData = function( data ) {\n var len , i , currentString;\n len = data.length;\n currentString = \"\";\n this.allLines = [] ;\n for( i = 0 ; i < len ; i++ ) {\n if( data[ i ] == '\\r' ) {\n }\n else if( data[ i ] == '\\n' ) {\n this.allLines.push( currentString );\n currentString = \"\";\n }\n else {\n currentString += data[ i ];\n }\n }\n if( currentString != \"\" ) {\n this.allLines.push( currentString );\n }\n };\n\n this.readAllLinesFromFile = function( inputFileName ) {\n var currentDirectory , fsObj , inputFilePath , rawData;\n fsObj = require( 'fs' );\n currentDirectory = __dirname;\n inputFilePath = currentDirectory + \"\\\\\" + inputFileName;\n rawData = fsObj.readFileSync( inputFilePath , \"utf8\" );\n this.parseRawData( rawData );\n };\n\n this.next = function( flag ) {\n var len , i , startIdx , res , endIdx;\n if( flag == 0 ) {\n if( this.currrentCharacterIndex != 0 ) {\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n }\n res = \"\";\n len = this.allLines[ this.currrentLineNumber ].length;\n if( typeof( len ) == 'function' ) {\n len = this.allLines[ this.currrentLineNumber ].length() ;\n }\n for( i = this.currrentCharacterIndex ; i < len ; i++ ) {\n res += '' + this.allLines[ this.currrentLineNumber ].charAt( i ) ;\n }\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n return res;\n }\n while( true ) {\n if( this.currrentLineNumber >= this.allLines.length ) {\n throw new Error( \"No more tokens available!\" );\n }\n startIdx = -1;\n len = this.allLines[ this.currrentLineNumber ].length;\n if( typeof( len ) == 'function' ) {\n len = this.allLines[ this.currrentLineNumber ].length() ;\n }\n for( i = this.currrentCharacterIndex ; i < len ; i++ ) {\n if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != ' '.charCodeAt( 0 ) ) {\n startIdx = i;\n break;\n }\n }\n if( startIdx == -1 ) {\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n continue;\n }\n res = \"\";\n endIdx = len - 1 ;\n for( i = startIdx ; i < len ; i++ ) {\n if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == ' '.charCodeAt( 0 ) ) {\n endIdx = i;\n break;\n }\n if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) >= 48 && this.allLines[ this.currrentLineNumber ].charCodeAt( i ) <= 57 ) {\n res += '' + ( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) - 48 ) ;\n }\n else {\n res += '' + this.allLines[ this.currrentLineNumber ].charAt( i );\n }\n }\n this.currrentCharacterIndex = endIdx;\n if( endIdx == len - 1 ) {\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n }\n return res;\n }\n };\n\n this.nextInt = function() {\n return parseInt( this.next( 1 ) );\n };\n\n this.nextDouble = function() {\n return parseFloat( this.next( 1 ) );\n };\n\n this.nextString = function() {\n return this.next( 1 );\n };\n\n this.nextLine = function() {\n return this.next( 0 );\n };\n}\n\nfunction FileOutputHandler() {\n this.resultantStringArray = new Array();\n\n this.addNewLine = function( newString ) {\n this.resultantStringArray.push( newString );\n };\n\n this.clearPercase = function() {\n this.resultantStringArray = new Array();\n };\n\n this.flushOutOutputToFile = function( outputFileName ) {\n var i , sz , res , currentDirectory , fsObj , outputFilePath;\n res = \"\";\n sz = this.resultantStringArray.length;\n for( i = 0 ; i < sz ; i++ ) {\n if( i != 0 ) {\n res += \"\\n\";\n }\n res += this.resultantStringArray[ i ];\n }\n fsObj = require( 'fs' );\n currentDirectory = __dirname;\n outputFilePath = currentDirectory + \"\\\\\" + outputFileName;\n fsObj.writeFileSync( outputFilePath , res );\n this.clearPercase();\n };\n}\n\nfunction CodeExecutioner() {\n this.irObj = new InputReader();\n this.psObj = new ProblemSolver();\n this.fohObj = new FileOutputHandler();\n\n this.runCases = function() {\n if( this.psObj.HAS_TEST_CASES == true ) {\n testCases = this.irObj.nextInt();\n for( i = 0 ; i < testCases ; i++ ) {\n this.psObj.clearPerCase();\n this.psObj.getInput( this.irObj );\n this.psObj.solveCase();\n }\n }\n else {\n while( true ) {\n this.psObj.clearPerCase();\n hasMoreTestCases = this.psObj.getInput( this.irObj );\n if( hasMoreTestCases == false ) {\n break;\n }\n this.psObj.solveCase();\n }\n }\n if( this.psObj.DO_OUTPUT_TO_FILE == true ) {\n this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME );\n }\n };\n\n this.detectEnvironmentType = function() {\n var environmentType = null ;\n try {\n if( importPackage != null ) {\n environmentType = 'rhino' ;\n }\n }\n catch( ex1 ) {\n try {\n //for nodejs local server check\n if( __dirname != null && readline != null && typeof( readline ) != 'function' ) {\n environmentType = 'local-node-js' ;\n }\n }\n catch( ex2 ) {\n try {\n if( readline == null || typeof( readline ) != 'function' ) {\n environmentType = 'server-node-js' ;\n }\n else {\n try {\n if( Map != null ) {\n environmentType = 'spider-monkey' ;\n }\n else {\n environmentType = 'javascript-v8' ;\n }\n }\n catch( ex3 ) {\n environmentType = 'javascript-v8' ;\n }\n }\n }\n catch( ex3 ) {\n environmentType = 'server-node-js' ;\n }\n }\n }\n return environmentType ;\n };\n\n this.configureStreamsAndReadInput = function() {\n var testCases , i , hasMoreTestCases , isLocal , localContext , isNodeJsJudgeServer , environmentType ;\n isNodeJsJudgeServer = false ;\n environmentType = this.detectEnvironmentType() ;\n if( environmentType == 'local-node-js' ) {\n try {\n if( print == null || typeof( print ) != 'function' ) {\n print = console.log;\n }\n }\n catch( ex ) {\n print = console.log;\n }\n if( this.psObj.DO_OUTPUT_TO_FILE == true ) {\n localContext = this.fohObj;\n print = function() {\n localContext.addNewLine.apply( localContext , arguments );\n }\n }\n this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME );\n this.runCases() ;\n }\n else if( environmentType == 'server-node-js' ) {\n try {\n if( print == null || typeof( print ) != 'function' ) {\n print = console.log;\n }\n }\n catch( ex ) {\n print = console.log;\n }\n this.irObj.readAllLinesFromNodeJsJudgeServer( this ) ;\n }\n else if( environmentType == 'javascript-v8' ) {\n this.irObj.readAllLines();\n this.runCases() ;\n }\n else if( environmentType == 'rhino' ) {\n this.irObj.readAllLinesFromRhino();\n this.runCases() ;\n }\n else if( environmentType == 'spider-monkey' ) {\n this.irObj.readAllLines();\n this.runCases() ;\n }\n };\n \n this.configureStreamsAndReadInput();\n}\n\nnew CodeExecutioner();\n", "lang": "JavaScript", "bug_code_uid": "beb4fd312dd73d82e86d08d4d5f27492", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "c644728847423fe4ac2bbb55c53ec952", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5167883211678832, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "'use strict'\n\nconst {EOL} = require('os')\n\nlet ipt = ''\nprocess.stdin.on('data', s => ipt += s)\nprocess.stdin.on('end', () => {\n let n = +ipt.split(EOL)[0]\n\n const H = ['Sheldon', 'Leonard', 'Penny', 'Rajesh', 'Howard']\n for (let i = 0; i < n; i++) {\n H.push(H[i], H[i])\n }\n console.log(H[n - 1])\n})", "lang": "Node.js", "bug_code_uid": "72e30e217df0f34e74a6db88bb7e298e", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "a10445cd31e87591ae3f52b7559ccdac", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9732793522267207, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nreadline.on('line', input => {\n const seq = ['Sheldon', 'Leonard', 'Penny', 'Rajesh', 'Howard'];\n let segment = 0;\n let segmentFloor = 1;\n let segmentCeiling = 5;\n\n while (!(input >= segmentFloor && input <= segmentCeiling)) {\n segment++;\n segmentFloor = segmentCeiling + 1;\n segmentCeiling = segmentCeiling + (Math.pow(2, segment) * 5);\n }\n\n const nthAfterFloor = input - segmentFloor + 1;\n\n const pointer = Math.ceil(nthAfterFloor / (segment + 1)) - 1;\n\n console.log(seq[pointer]);\n});", "lang": "Node.js", "bug_code_uid": "e69b8f929746502a66d97d44795c18bb", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "036a2cb5b6f3a9f82ee34061d0fa1bae", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.07937540663630449, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "const input = [];\n \nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', (line) => {\n input.push(line);\n});\n\nRL.on('close', () => {\n const n = parseInt(input[0]);\n let queue = 5, iteration = 1;\n let low, high;\n\n const map = {\n 1: 'Sheldon',\n 2: 'Leonard',\n 3: 'Penny',\n 4: 'Rajesh',\n 5: 'Howard',\n }\n\n if (n <= 5) { console.log(map[n]); return; }\n\n while (queue <= n) {\n low = queue;\n queue *= 2;\n high = queue;\n }\n iteration = (high - low) / 5;\n let pos = n - low;\n console.log( map[ parseInt(Math.ceil(pos / iteration)) ] );\n});", "lang": "Node.js", "bug_code_uid": "d9527ac7f59d01e6b5ff467d9c2405e5", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "a5c13c77199c1f922391a560aa64a19a", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7417322834645669, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "const input = [];\n\nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', (line) => {\n input.push(line);\n});\n\nRL.on('close', () => {\n const [param] = input[0].split(\" \").map(x => parseInt(x));\n const pattern = \"qwertyuiopasdfghjkl;zxcvbnm,./\";\n \n const answer = [];\n for (let i = 0; i < input[1].length; i += 1) {\n let k = pattern.indexOf(input[1][i]);\n if (param === 'R') {\n if (k === pattern.length-1) answer.push(pattern[0]);\n else answer.push(pattern[k+1]);\n } else {\n if (k === 0) answer.push(pattern[pattern.length-1]);\n else answer.push(pattern[k-1]);\n }\n }\n console.log(answer.join(''))\n});", "lang": "Node.js", "bug_code_uid": "24ce80f1dea347bb58a783e43a66d2e5", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "0d36411e46942588257cda89411f6711", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9984732824427481, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet n, m, k;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n [n, m, k] = d.split(' ').map(Number);\n return;\n }\n\n const arr = [0, ...d.split(' ').map(Number)];\n let ans = 0;\n let L = m - 1;\n let R = m + 2;\n while (L > 0 || R < arr.length) {\n if (arr[L] !== 0 && arr[L] <= k) {\n ans = 10 * Math.abs(m - L);\n break;\n }\n\n if (arr[R] !== 0 && arr[R] <= k) {\n ans = 10 * Math.abs(m - R);\n break;\n }\n\n L--;\n R++;\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "17809fb208d7f977d9d1cee34c4eb1ab", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "22b035562496d7dd9cc486764a2d8919", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9966162869388676, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n↑入力 ↓出力');\n\tMain();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n\t};\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n var N = one[0];\n var D = one[1];\n var list = next();\n var dp = new Array(N).fill(-1);\n dp[0] = 0;\n for(var i = 0; i < N; i++){\n if(list[i] == \"1\"){\n for(var j = 1; j <= D; j++){\n if(list[i + j] == \"1\"){\n if(dp[i + j] == -1){\n dp[i + j] = dp[i] + 1;\n }else{\n dp[i + j] = Math.min(dp[i] + 1, dp[i + j]);\n }\n }\n }\n }\n }\n myout(dp[N - 1]);\n}", "lang": "Node.js", "bug_code_uid": "312e1d946b8395934600fc18469fab0c", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "b609541916f487bc595749cac6ec00d6", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8873379860418744, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (str) => {\n let L = 0;\n let R = str.length - 1;\n let ans = '';\n\n while (L <= R) {\n if (L !== R) {\n ans += str[R];\n ans += str[L];\n }\n else {\n ans += str[L];\n }\n\n L++;\n R--;\n }\n\n console.log([...ans].reverse().join(''));\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "1a9cc54ba2ed0dbdf52d867b3826ce97", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "4c69de4481a17a586b2df3871f47c3af", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7351129363449692, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n if (+d <= 2) {\n console.log(1);\n }\n else {\n console.log(Math.floor(+d / 2) + 1);\n }\n});\n", "lang": "Node.js", "bug_code_uid": "42c08b64ea507bb4c53a67a671db9eb4", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "319dc3963e12b434eeb6e1c8cae4386a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.948905109489051, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nconst store = {};\n\nfunction main() {\n\tlet n = readLine() >> 0;\n\tlet map = { 1: 8, 2: 4, 3: 2, 4: 6 };\n\tn = n % 4;\n\tif (n === 0) n = 4;\n\tconsole.log(map[n]);\n}\n", "lang": "Node.js", "bug_code_uid": "e597fa0295d10ac6bc572c358603bc15", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "b78b711a737fe6e68407deafc7b16016", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9687786960514233, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "function funkyNumbers(n) { \n\n var funkyNumber = 'NO';\n\n if(n == 1) return funkyNumber;\n\n var maxTriangle = maxTrianglePossible(n);\n\n for(let i = maxTriangle; i > 0; i--) {\n var firstTriangle = triangleNumbers(i);\n var rem = n - firstTriangle;\n\n var secFactor = maxTrianglePossible(rem);\n var secTriangle = triangleNumbers(secFactor);\n\n var triangles = firstTriangle + secTriangle;\n\n if(triangles == n) {\n funkyNumber = 'YES';\n break;\n } \n \n }\n \n return funkyNumber; \n} \n\nfunction maxTrianglePossible(n) {\n //k(k+1) / 2 = n where n is an integer\n //k(k+1) = n*2\n //k^2 + k - n*2 = 0 -> factors\n\n var k = Math.floor( Math.sqrt(n*2) );\n\n return k;\n\n}\n\nfunction triangleNumbers(x) {\n \n var f = ( x * (x + 1) ) / 2;\n\n return f;\n}\n\n//stdin → stdout\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreadline.on('line', n => {\n readline.close();\n \n let res = funkyNumbers(n);\n console.log(res);\n});", "lang": "Node.js", "bug_code_uid": "5cf73e8843731e1847dee7b97b87557f", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "89f4dadc2c99e8f43bf25cc0c31e65fd", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.980224478888295, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const funkyNumbers = n => {\n let funkyNumber = 'NO';\n\n let maxTriangle = maxTrianglePossible(n);\n\n for(let i = maxTriangle; i > 0; i--) {\n let firstTriangle = triangleNumbers(i);\n let rem = n - firstTriangle;\n\n if(rem === 0) continue;\n\n let secFactor = maxTrianglePossible(rem);\n let secTriangle = triangleNumbers(secFactor);\n\n let triangles = firstTriangle + secTriangle;\n\n if(triangles == n) {\n funkyNumber = 'YES';\n break;\n } \n \n }\n \n return funkyNumber; \n}\n\nconst maxTrianglePossible = n => Math.floor( Math.sqrt(n*2) );\n\nconst triangleNumbers = x => ( x * (x + 1) ) / 2;\n\n//stdin → stdout\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n \nreadline.on('line', n => {\n readline.close();\n \n let res = funkyNumbers(n);\n console.log('Is ' + n + ' a Funky Number? -> ' + res);\n});", "lang": "Node.js", "bug_code_uid": "cecd0b61529ccefb88976b92881a83a6", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "89f4dadc2c99e8f43bf25cc0c31e65fd", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9229098805646037, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "let i = '';\nprocess.stdin.on('data', (c) => {\n i += c;\n});\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n const lines = i.split(EOL);\n const b = parseInt(lines[0], 10);\n const g = parseInt(lines[1], 10);\n const n = parseInt(lines[2], 10);\n console.log(badges(b, g, n));\n});\n\n\nfunction badges(b, g, n) {\n if (n === b + g) return 1;\n const min = Math.min(b, g);\n return min >= n ? 1 + n : 1 + min;\n}", "lang": "Node.js", "bug_code_uid": "e18fd3de68c924172db505bf0109dc39", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "161bcd7cc15ff9c91f72536344348f80", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9987397605545053, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/**\n * Codeforces Challenge #1204B\n * @ennukee\n * \n * Time Elapsed: 5.64ms (test cases)\n */\n\nconst MODE = \"SUBMIT\";\nconst CF_1204_B = (n, l, r) => {\n /**\n * n, n-1, ..., n-l, 2^1, ..., 2^(l-1)\n * 2^1, ..., 2^(r-1), 2^(r-1), ..., 2^(r-1)\n * \n * 5, 2, 3\n * => 1, 1, 1, 2\n * => 1, 2, 4, 4, 4 \n */\n const low_bound = 1 * (n - l + 1) + [...Array(l).keys()].slice(1).reduce((a, c) => a + Math.pow(2, c), 0);\n const high_bound = [...Array(r).keys()].reduce((a, c) => a + Math.pow(2, c), 0) + (n - r) * Math.pow(2, n - r - 1);\n return `${low_bound} ${high_bound}`;\n}\n\n/**\n * \n * Submission standard input read-in\n * \n */\n\nif (MODE === \"SUBMIT\") {\n var readline = require('readline');\n\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n rl.question(\"\", function(answer) {\n const parsed = answer.split(' ').map(i => parseInt(i));\n console.log(CF_1204_B(...parsed));\n rl.close();\n });\n}\n\n/**\n * \n * Test cases and benchmarking code below this point\n * \n * Unrelated to the solution code\n * \n */\n\nif (MODE === \"TEST\") {\n const { performance } = require('perf_hooks');\n let timer = performance.now();\n\n // Assumptions:\n // 1 <= n <= 1000\n // 1 <= l <= r <= min(n, 20)\n // [n, l, r]\n const test_cases = [\n [4, 2, 2],\n [5, 1, 5]\n ]\n test_cases.forEach(( v ) => {\n console.log( CF_1204_B( ...v ) );\n });\n\n timer = performance.now() - timer;\n console.log(`Time elapsed for test case: ${timer.toFixed(2)}ms`)\n}", "lang": "Node.js", "bug_code_uid": "abbedc8927f136b389fbe92d72036473", "src_uid": "ce220726392fb0cacf0ec44a7490084a", "apr_id": "2221a52b7222519288e91984fd39af80", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9789739276703112, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.setEncoding('utf8');\n\nprocess.stdin.on('readable', () => {\n let input = process.stdin.read();\n input = input.trim();\n\n if (input !== null) {\n let lowerCase = 0;\n let upperCase = 0;\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] == input[i].toUpperCase()) upperCase++;\n else lowerCase++;\n }\n\n if (upperCase > lowerCase) input = input.toUpperCase();\n if (lowerCase > upperCase || lowerCase == upperCase) input = input.toLowerCase();\n\n process.stdout.write(`${input}\\n`);\n }\n});", "lang": "Node.js", "bug_code_uid": "f7a29d5f272cfa028668c8b9a130d0ed", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "a4fddc38420b2766866248e2746d5dd5", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.3581575548859234, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let num = readLine()\n .split(\"\")\n .map((n) => parseInt(n));\n const map = {};\n for (let i = 0; i < num.length; i++) {\n if (!map[num[i]]) map[num[i]] = 1;\n else map[num[i]]++;\n }\n function isLucky(num) {\n if (!num) return false;\n while (num) {\n if (num % 10 !== 4 && num % 10 !== 7) return false;\n num = parseInt(num / 10);\n }\n return true;\n }\n let [four, seven] = [map[\"4\"] || 0, map[7] || 0];\n const total = four + seven;\n if (isLucky(total)) console.log(\"YES\");\n else console.log(\"NO\");\n}\n", "lang": "Node.js", "bug_code_uid": "8c5cc0a3697070e0364c3d2c19b7d68b", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "ef0b5a4d07baa06cade79c7cdf279234", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6492537313432836, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 16, "bug_source_code": "var str = \"AAAAdel\"; \n var res = (str.replace(/[^A-Z]/g, \"\").length);\n var reslow = (str.replace(/[^a-z]/g, \"\").length);\n if(reslow >= res){\n var up = str.replace(str , str.toLowerCase() );\n console.log(up);\n }else{\n var low = str.replace(str , str.toUpperCase() ); \n console.log(low);\n }", "lang": "Node.js", "bug_code_uid": "8a68761f447b7a080e282f1920cb805a", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "0b2dbee630cc47229bd2cd23a059678f", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.640625, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n \nrl.on('line', (input) => {\n console.log(input.toLowerCase());\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "681b30130ccc9d66da0e65a2ad1e77ef", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "16300edddd102122303fdc779ee084e7", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8362068965517241, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n inputs.push(lineInput)\n})\n\nrl.on('close', () => {\n\n const n = inputs[0].split(' ').map(num => parseInt(num))[0];\n let puzzles = inputs[1].split(' ').map(num => parseInt(num)).sort((a, b) => a - b).splice(0, n)\n const minimumDiffer = puzzles[puzzles.length - 1] - puzzles[0];\n\n console.log(minimumDiffer)\n\n\n})", "lang": "Node.js", "bug_code_uid": "28fbb645332d06251548edfcaef54814", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "f0a07022c5497d6c95045db100c19765", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6314935064935064, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet n, m;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n [n, m] = d.split(' ').map(Number);\n return;\n }\n\n const arr = d.split(' ').map(Number);\n arr.sort((a, b) => a - b);\n const diff = new Array(arr.length).fill(0);\n\n for (let i = 1; i < arr.length; i++) {\n diff[i] = arr[i] - arr[i - 1];\n }\n\n let ans = Infinity;\n\n for (let i = 0; i < diff.length - n + 1; i++) {\n let sum = 0;\n\n let idx = i;\n while (idx < i + n) {\n sum += diff[idx];\n idx++;\n }\n\n ans = Math.min(sum, ans);\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "82190ccb0c4895d0cdcc7c687460181a", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "67988aade78bf4e29048effac9d50616", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8942486085343229, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction main() {\n\tlet [n, m] = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\n\tlet arr = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\n\tarr.sort((a, b) => a - b);\n\tconsole.log(arr[n - 1] - arr[0]);\n}\n", "lang": "Node.js", "bug_code_uid": "e0f66347bf4fd6d7645b3279e55de536", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "4747fd0a7b3db606bf274321198ef43f", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.988081507112649, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [n, m] = readLine().split(' ').map(Number);\n let puzzles = readLine().split(' ').map(Number);\n // let sorted = [];\n // for (let i = 0; i < n; i++) {\n // sorted.push(puzzles[i]);\n // }\n // sorted.sort((a, b) => a - b);\n // console.log(sorted[sorted.length - 1] - sorted[0]);\n puzzles.sort((a, b) => a - b);\n\n let min = 10000000000;\n // for (let i = 0; i < puzzles.length; i++) {\n // for (j = 0; j < puzzles.length; j++) {\n // if (i === j) {\n // continue;\n // }\n // let diff = Math.abs(puzzles[i] - puzzles[j]);\n // if (diff < min) {\n // min = diff;\n // }\n // }\n // }\n for (let i = 1; i < m - n; i++) {\n min = Math.min(min, puzzles[i + n - 1] - puzzles[i]);\n }\n console.log(min);\n}\n", "lang": "Node.js", "bug_code_uid": "693187b90cd3c74358b2a5d14517d0cf", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "3471c17e9ac95558c280f64c847e2200", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.994748687171793, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let str = readLine()\n let arr = []\n \n str.split(\"\").forEach(s => {\n if (arr.indexOf(s) === -1) arr.push(s)\n })\n \n if (arr.length % 2 === 0) console.log(\"CHAT WITH HER\")\n else console.log(\"IGNORE HIM\")\n \n}", "lang": "Node.js", "bug_code_uid": "855529e07546e09c7bc21c04cd74036a", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "9c3fca3f822cbd09a1a877432eb5397d", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9640102827763496, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n const n = +d;\n const weeks = Math.floor(n / 7);\n const remainder = n % 7;\n const min = weeks * 2;\n const max = (weeks * 2) + Math.min(2, remainder);\n\n console.log(min, max);\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "bf4f7c1d95d65a244a5d58286894f285", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "9df740550b89487336278091905ebf10", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9943019943019943, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.on('data', async data => {\n\tlet result = 0\n\tconst dataarr = data.toString().trim().split('');\n\tawait Promise.all(dataarr.reverse().map(datum => new Promise(resolve => {\n\t\tresult += (10 - (+datum + 1)%10)%10;\n\t\tresolve()\n\t})))\n\tif (dataarr.reverse()[0] == 0) result+=10\n\tresult += +dataarr[0] + +!!dataarr.length\n\tconsole.log(result)\n})", "lang": "Node.js", "bug_code_uid": "80dc03ae1aceed86d8b16bed2cdb3c11", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "342ca194ae3d3d544d03adf4b571f7d0", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9999227262189939, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\"use strict\";var readline=require(\"readline\"),extendStatics=function(r,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n])})(r,t)};\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */function __extends(r,t){function n(){this.constructor=r}extendStatics(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function isFunction(r){return\"function\"==typeof r}var _enable_super_gross_mode_that_will_cause_bad_things=!1,config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(r){r&&(new Error).stack;_enable_super_gross_mode_that_will_cause_bad_things=r},get useDeprecatedSynchronousErrorHandling(){return _enable_super_gross_mode_that_will_cause_bad_things}};function hostReportError(r){setTimeout((function(){throw r}),0)}var empty={closed:!0,next:function(r){},error:function(r){if(config.useDeprecatedSynchronousErrorHandling)throw r;hostReportError(r)},complete:function(){}},isArray=function(){return Array.isArray||function(r){return r&&\"number\"==typeof r.length}}();function isObject(r){return null!==r&&\"object\"==typeof r}var UnsubscriptionErrorImpl=function(){function r(r){return Error.call(this),this.message=r?r.length+\" errors occurred during unsubscription:\\n\"+r.map((function(r,t){return t+1+\") \"+r.toString()})).join(\"\\n \"):\"\",this.name=\"UnsubscriptionError\",this.errors=r,this}return r.prototype=Object.create(Error.prototype),r}(),UnsubscriptionError=UnsubscriptionErrorImpl,Subscription=function(){function r(r){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,r&&(this._unsubscribe=r)}return r.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this._parentOrParents,e=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof r)n.remove(this);else if(null!==n)for(var i=0;ithis.total&&this.destination.next(r)},t}(Subscriber);readStdin().pipe(skip(1),take(1),map((function(r){return r.split(\" \").map((function(r){return+r}))}))).subscribe((function(r){for(var t=0,n=0,e=0,o=[],i=0;i0&&r[i-1]>0&&r[i-1]%2!=r[i]%2&&(e+=1);var p=Math.round(r.length/2),h=Math.floor(r.length/2),b=p-t,f=h-n,l=function(r,t){\"any\"===r?e+=1===t?0:1:\"even\"===r?f>=t?f-=t:e+=1:b>=t?b-=t:e+=1},d=function(r){var t=r.left,n=r.right,e=r.distance;return\"any\"===t||\"any\"===n?e+1e4:e};o.sort((function(r,t){return d(r)-d(t)})).forEach((function(r){var t=r.left,n=r.right,o=r.distance;\"even\"===t&&\"odd\"===n||\"odd\"===t&&\"even\"===n?e+=1:\"any\"===t?l(n,o):\"any\"===n?l(t,o):\"even\"===t?f>o?f-=o:e+=2:\"odd\"===t&&(b>o?b-=o:e+=2)})),console.log(e)}));\n", "lang": "Node.js", "bug_code_uid": "419c208ecf10e1fc357b921d8ea41f0f", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "af0a889e7dd6009b32a081df70df8608", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5089605734767025, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "function main() {\n let t = readLine()\n let str = readLine()\n let count = 0\n \n for (let i = 0; i < str.length-1; i++) {\n if (str[i+1] === str[i]) count += 1\n }\n \n console.log(count)\n \n}", "lang": "Node.js", "bug_code_uid": "3a5de9948806340ed5662c38cef020f1", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "9e9e4df0d70077b7a642e6022d61adf1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9111470113085622, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\n\nvar inp = [];\n\nfunction main() {\n\trl.question('', (answer) => {\n\t\tif (answer.length) {\n\t\t\tinp.push(answer);\n\t\t\tmain();\n\t\t} else {\n\t\t\trl.close(); solve();\n\t\t}\n\t});\n}\nfunction solve() {\n\tvar n = inp[0]*1;\n\tvar s = inp[1];\n\tvar cont1=0, cont2=0;\n\tvar a = ['R','B'];\n\tfor(var i=0; i cont2) cont1 = cont2;\n\tconsole.log(cont1);\n}\nmain();", "lang": "Node.js", "bug_code_uid": "420e4782dafe4eb105039888bb73dc21", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "63e2f003d14e4d9b4c0ab1237c6f5015", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.980330448465775, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\n\nconst runMain = () => {\n inputString = inputString.trim().split('\\n').map(string => string.trim());\n main();\n process.exit();\n}\nconst readLine = () => inputString[currentLine++];\n\nprocess.stdin.on('data', inputStdin => inputString += inputStdin);\nprocess.stdin.on('end', runMain);\nprocess.on('SIGINT', runMain);\n\nfunction main() {\n const n = readLine();\n const str1 = readLine();\n let pred = '';\n let str2 = ''; \n for (let i = 0; i < n; i++) {\n if (str1[i] !== pred) {\n str2 += str1[i];\n pred = str1[i];\n console.log('aa');\n }\n }\n console.log(str1.length - str2.length);\n}\n", "lang": "Node.js", "bug_code_uid": "5acb782d024856698cd708679c13cf1a", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "8a4b2761fa61dbcc9a14c07b26c89093", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9937219730941704, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n\t input: process.stdin,\n\t output: process.stdout,\n\tterminal : false\n});\n\n\nrl.on(\"line\", main)\nlet n = 0\nlet s = \"\"\nlet count = 0\nfunction main(input){\n\tif(n === 0){\n\t\tn = parseInt(input)\n\t\treturn\n\t}\n\n\ts = input\n\n\tfor(var j = 0; j < s.length; j++){\n\t\t\n\t\tif(s.charAt(j) === s.charAt(j+1)){\n\t\t\tif(s.charAt(j) === s.charAt(j+2) && s.charAt(j) !== s.charAt(j+3)){\n\t\t\t\tcount++\n\t\t\t\tj = j + 3\n\t\t\t}\n\t\t}\n\t\tif(s.charAt(j) === s.charAt(j+1)){\n\t\t\tcount++\n\t\t}\n\t}\n\tconsole.log(count)\n}\n\n", "lang": "Node.js", "bug_code_uid": "a2454f7e57bc787047c6e8aa3533a5fa", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "6e07b8d1f4b6003de9a2007661858c65", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.935656836461126, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet stdin = '';\n\nprocess.stdin.on('data', (input) => {\n stdin += input;\n});\n\nprocess.stdin.on('end', () => {\n const stdin = '5\\nBRBG';\n const data = stdin.split('\\n')[1];\n\n let counter = 0;\n\n for (let i = 0; i < data.length; i++) if (data[i] === data[i + 1]) counter++;\n\n process.stdout.write(String(counter));\n\n});\n", "lang": "Node.js", "bug_code_uid": "63f440b3eb8164d6d8797a9624b606f3", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "196d9e4508c28a64ab17f2d3ce891809", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.984869325997249, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n const obj = {\n 0: 0,\n 1: 4,\n 2: 4,\n 3: 4,\n 4: 4,\n 5: 4,\n 6: 4,\n 7: 4,\n 8: 4,\n 9: 4,\n 10: 15\n };\n\n const r = +d - 10;\n console.log(obj[r] || 0);\n});\n", "lang": "Node.js", "bug_code_uid": "f9a582228a98ada5d895667af3ed8e17", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "adb7c47fce13d09dafcabfbcdaac0b00", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.998589562764457, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let data = '';\nprocess.stdin.on('data', c => data += c);\nconst sol = () => {\n let n = Number(data);\n let ans = 0; //[0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 15, 4];\n if (n - 10 < 0 || n - 10 > 11) {\n ans = 0;\n } else if (n - 10 === 10){\n ans = 15\n } else {\n ans = 4;\n }\n console.log(ans);\n}\n \nprocess.stdin.on('end', sol);", "lang": "Node.js", "bug_code_uid": "47d8419cfba0784b0512c5fdcbe9f994", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "13aa4930e36889f4973e44df39791755", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5798319327731093, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "process.stdin.on('data', function(chunk){\n\tvar lns = chunk.toString().replace(/\\r/g, \"\").split(/\\n/);\n\tvar hs = [], gs = [], r = 0;\n\tfor(var i = 0, l = lns.splice(0, 1)[0]; i -1) {\n\t\t\tr++;\n\t\t}\n\t\tif (gs.indexOf(ln[0]) > -1) {\n\t\t\tr++;\n\t\t}\n\t\ths.push(ln[0]);\n\t\tgs.push(ln[1]);\n\t}\n\tconsole.log(r);\n});", "lang": "Node.js", "bug_code_uid": "0ed90fa9bf117ce148f8c353a379cd80", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "019569da04b3da849e99c1489d5c6595", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.991304347826087, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n↑入力 ↓出力');\n\tMain();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n\t};\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var s = next();\n var ok = new Set([\"a\",\"e\",\"i\",\"o\",\"u\",\"0\",\"2\",\"4\",\"6\",\"8\"]);\n var count = 0;\n for(var i = 0; i < s.length; i++){\n if(ok.has(s[i])){\n count++;\n }\n }\n myout(count);\n}", "lang": "Node.js", "bug_code_uid": "af068a583406da0f9fded14e7eb5f21c", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "f25cd623c2599b12a23c04f536a6febb", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9070796460176991, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const input = [];\n \nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n\nRL.on('line', (line) => {\n input.push(line);\n});\n\nfunction fact(num)\n{\n if(num === 0)\n return 1;\n return num * fact(num-1);\n}\n\nRL.on('close', () => {\n const check = new Set(); check.add('a'); check.add('e');\n check.add('i'); check.add('o'); check.add('u');\n const str = input[0];\n let answer = 0;\n for(let i = 0; i < str.length; i += 1) {\n \n if(check.has(str.charAt(i))) {\n answer += 1;\n }\n }\n console.log(answer);\n});\n\n", "lang": "Node.js", "bug_code_uid": "dc6cab9343cce935dc452d2d9e0219af", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "30b6ded081f9aaea7add93408192513f", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9778558875219684, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', (_) => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\n// Make a Snippet for the code above this and then write your logic in main()\nfunction main() {\n const numOfInterestingMinutes = readline();\n const interestingMinutes = readline();\n\n countNumberOfMinutes(\n parseInt(numOfInterestingMinutes),\n interestingMinutes.split(' ')\n );\n}\n\nfunction countNumberOfMinutes(numOfInterestingMinutes, interestingMinutes) {\n const firstInterestingMinute = parseInt(interestingMinutes[0])\n if (firstInterestingMinute >= 16) {\n console.log(15);\n return;\n }\n\n if (numOfInterestingMinutes === 1) {\n console.log(firstInterestingMinute + 15);\n return;\n }\n\n let watchMinutes = firstInterestingMinute;\n\n for (let i = 1; i < numOfInterestingMinutes; i++) {\n const diff =\n parseInt(interestingMinutes[i]) - parseInt(interestingMinutes[i - 1]);\n if (diff >= 16) {\n watchMinutes += 15;\n break;\n } else {\n watchMinutes += diff;\n }\n }\n\n console.log(watchMinutes >= 90 ? 90 : watchMinutes);\n}\n", "lang": "Node.js", "bug_code_uid": "4e7d0d43efeb267c2fd38447edcee5c9", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "2c51559cd66b23fdbc3355e1f129f3c7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8682464454976303, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n return;\n }\n\n const arr = d.split(' ').map(Number);\n let watchedTime = 15;\n\n for (let i = 0; i < arr.length; i++) {\n if (watchedTime < arr[i]) {\n break;\n }\n else {\n watchedTime = arr[i];\n\n if (i !== arr.length - 1) {\n watchedTime += 15;\n }\n }\n }\n\n console.log(watchedTime);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "764698f9bc094150e13d8a5ac2af5263", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "c093b232021a1e094e9197d1b9d45010", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.7538343558282209, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "\"use strict\";\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet inputString = \"\";\nlet currentLine = 0;\n\nprocess.stdin.on(\"data\", (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\nfunction main() {\n \n const x = readline()\n .split(\" \")\n .map((x) => +x);\n \n \n\n \n \n \n carrotCakes(x[0],x[1],x[2],x[3]);\n}\n\nfunction carrotCakes(n, t, k, d) {\n let t1 = (n * t) / k;\n\n let t2 = t1 / 2 + d - Math.abs(t - d);\n\n // let k1 = Math.floor(d * k) / t;\n\n let k1 = (d * k) / t;\n\n // let t2 = ((n - k1) * t) / (2 * k) + d;\n\n // let t2 = d < t ? ((n - k1) * t) / (2 * k) + d : t1 / 2 + d;\n // console.log(t1, t1);\n\n console.log(t2 < t1 ? \"YES\" : \"NO\");\n}\n", "lang": "Node.js", "bug_code_uid": "69c7df6723fed5218e97a4140cef1600", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "b480f66b74461958bbf4bba978a77506", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.728492501973165, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " let t1 = (n * t) / k;\n\n let tt1 = 0;\n let cakesBox2 = 0;\n let ovenTimer11 = 0;\n\n while (cakesBox2 < n) {\n if (ovenTimer11 === t - 1) {\n ovenTimer11 = 0;\n cakesBox2 += k;\n } else {\n ovenTimer11++;\n }\n\n tt1++;\n }\n\n // let t2 = t1 / 2 + d - Math.abs(t - d);\n\n // let k1 = Math.floor(d * k) / t;\n\n // let k1 = (d * k) / t;\n\n // let t2 = ((n - k1) * t) / (2 * k) + d;\n\n // let t2 = d < t ? ((n - k1) * t) / (2 * k) + d : t1 / 2 + d;\n // console.log(t1, t1);\n\n let t2 = 0;\n let cakesBox = 0;\n let ovenTimer1 = 0;\n let ovenTimer2 = 0;\n\n while (cakesBox < n) {\n if (ovenTimer1 === t - 1) {\n ovenTimer1 = 0;\n cakesBox += k;\n } else {\n ovenTimer1++;\n }\n\n if (t2 >= d) {\n if (ovenTimer2 === t - 1) {\n ovenTimer2 = 0;\n cakesBox += k;\n } else {\n ovenTimer2++;\n }\n }\n t2++;\n }\n\n console.log(t2 < tt1 ? \"YES\" : \"NO\");", "lang": "Node.js", "bug_code_uid": "600ab597d91f49229cf9ea1caf083684", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "b480f66b74461958bbf4bba978a77506", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9679358717434869, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction readint() {\n let line = readline().split(' ').map(function(num) {\n return parseInt(num);\n });\n return line;\n}\n\nfunction readfloat() {\n let line = readline().split(' ').map(function(num) {\n return parseFloat(num);\n });\n return line;\n}\n\nfunction print(x) {\n console.log(x);\n}\n\nfunction write(x) {\n process.stdout.write(x);\n}\nfunction main() {\n let [n,t,k,d] = readint(); \n let times = d / t + 1;\n let qoldi = n - times * k;\n if(qoldi > 0) {\n print('YES');\n } else {\n print(\"NO\");\n }\n\n \n\n\n}", "lang": "Node.js", "bug_code_uid": "b60b913a1a7afb686a526e0a0f6d6feb", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "d30db1982962d96d18ca517125dd96c3", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.996268656716418, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.setEncoding('utf8');\n\nprocess.stdin.on('readable', () => {\n let input = process.stdin.read();\n input = input.trim();\n\n input = input.split('+');\n input = input.sort((a, b) => a - b);\n\n console.log(input.join('+'));\n process.exit(1);\n});", "lang": "Node.js", "bug_code_uid": "fa59202d3180ef4c92136b3422de837d", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "f2cbe53d4838569aae0680eb6a3b1311", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.79041248606466, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n}); \nfunction sort(array) {\n // use custom compare function that sorts numbers ascending\n alert(ary.sort(function(a, b) {\n return a - b;\n }));\n}\n\n\nvar array =[];\nvar newarr = [];\nrl.question(``, (count) => {\n var a = '';\n for (let index = 0; index < count.length; index++) {\n if(count[index]!='+'){\n a =a+count[index];\n }else{\n array.push(a);\n a='';\n }\n if(count.length-index == 1){\n array.push(a);\n }\n\n }\n array = array.sort(function(a, b) {\n return a - b;\n });\n console.log(array);\n insert_a(array);\n console.log(newarr);\n rl.close();\n })\n\nfunction insert_a(array) {\n var count=0;\n for (let index = 0; index a - b);\n\n string = string.map((num, i) => {\n if (i < string.length - 1) {\n return num.concat('+');\n }\n });\n\n console.log(string);\n});\n", "lang": "Node.js", "bug_code_uid": "dea07825693d2ac6cd93d88f49772c1b", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "a1b00e3af2dfed85db3b46d6e2bf39ea", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.982532751091703, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "function helpfulMaths(str) {\n let arr = str.split(\"+\");\n arr.sort(function (a, b) {\n return a - b;\n });\n return console.log(arr.join(\"+\"));\n}\n\n// read file\nconst readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet input = \"\";\n// read each line\nrl.on(\"line\", (lineInput) => {\n input = lineInput;\n});\n\n// when all file readed\nrl.on(\"close\", () => {\n bautifulMartix(input);\n});\n", "lang": "Node.js", "bug_code_uid": "11ffad4ed96c0582e0bf0b5adad0f24f", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "72270563c319277395cb64a040c5e22b", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9988249118683902, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', inputStd => inputString += inputStd);\nprocess.stdin.on('end', () => {\n inputString = inputString.trim().split('\\n').map(str => str.trim());\n solve();\n});\nlet readLine = () => inputString[currentLine++];\n\nfunction solve(){\n const n = +(readLine());\n let str = readLine();\n let arr = [], arr2 = [];\n\n for(let i = 0; i < 2*n; i++){\n if(i < n)\n arr.push(+(str[i]));\n else\n arr2.push(+(str[i]));\n }\n arr.sort((a, b) => a-b);\n arr2.sort((a, b) => a-b);\n let a = true, b = true;\n\n for(let i = 0; i < n; i++){\n if(arr[i] < arr2[i])\n a = false;\n if(arr[i] > arr2[i])\n b = false;\n }\n console.log(a ^ b ? \"YES\" : \"NO\");\n}\n", "lang": "Node.js", "bug_code_uid": "93a5481f4df07b113b9a9ecef0760b46", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "61f44874a25533e1c078f997a405c4f4", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9891826923076923, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nrl.on('line', (input) => {\n rl.close();\n let inp = input.split(\"\")\n let res = \"\"\n if (inp.length >= 2 && inp.length % 2 === 1) {\n res += inp[Math.floor((inp.length / 2))]\n } else if (inp.length >= 2 && inp.length % 2 === 0) {\n res += inp[Math.floor((inp.length / 2) - 1)]\n }\n let ln = inp.length % 2 === 1 ? inp.length / 2 : inp.length / 2\n ln = Math.floor(ln)\n let inc = inp.length % 2 === 1 ? 0 : 1\n for (let i = 1; i < ln; i++) {\n res += inp[ln + i - inc]\n res += inp[ln - i - inc]\n }\n res += inp[inp.length - 1]\n if (inp.length % 2 == 1) {\n res += inp[0]\n }\n console.log(res)\n return 0;\n});\n", "lang": "Node.js", "bug_code_uid": "d6ad97ce3b74da7d18842bcfe0b17ba1", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "ad824d49b91e2a8643bdb988c18f23cd", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9759403592002711, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let n = parseInt(readLine());\n let pagesInWeekDays = readLine().split(' ').map(Number);\n // while (result < 100) {\n // result = result +\n // }\n function recursion(totalpagesPerWeak) {\n // console.log(totalpagesPerWeak);\n // let [\n // monday,\n // tuseday,\n // wednessday,\n // thursday,\n // friday,\n // saturday,\n // sunday,\n // ] = pagesInWeekDays;\n\n for (let i = 0; i < pagesInWeekDays.length; i++) {\n totalpagesPerWeak = totalpagesPerWeak + pagesInWeekDays[i];\n if (totalpagesPerWeak >= n) {\n console.log(totalpagesPerWeak);\n console.log(i + 1);\n return;\n }\n }\n if (!(totalpagesPerWeak >= n)) {\n console.log(n);\n console.log(totalpagesPerWeak);\n totalpagesPerWeak = n - totalpagesPerWeak;\n recursion(totalpagesPerWeak);\n }\n }\n recursion(0);\n}\n", "lang": "Node.js", "bug_code_uid": "ea8d822f772c024ef9ab88b00e0c9a8b", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "778d0e86a500ee80553d2d8081d4aa12", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9819819819819819, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "var readline = require(\"readline\");\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.on(\"line\", function(line){\n var k = line.split(' ')[0];\n var n = line.split(' ')[1];\n var w = line.split(' ')[2];\n var price = 0;\n for(var i= 1; i<= w; i++){\n price += k * i;\n \n }\n if (price > 0 ){\n console.log(price-n);\n } else {\n console.log(0);\n }\n});", "lang": "Node.js", "bug_code_uid": "594f7dd2511463d9bac91ecbd1e3a86e", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "31313cd19c423a30b8f84663674c7fd9", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.996607294317218, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "var line_number = 0;\nconst cs = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nvar lines = {};\ncs.on(\"line\", (input) => {\n if (input == \"\") {\n cs.close();\n }\n lines[line_number] = input.split(\" \");\n line_number += 1;\n}).on(\"close\", () => {\n main();\n process.exit();\n});\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/);\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}\n// function isInt(str) {\n// return str.length === 1 && !isNaN(str);\n// }\nfunction isInt(str) {\n return str.length === 1 && str.match(/[0-9*]/);\n}\n\nfunction print(str) {\n console.log(str);\n}\n\nfunction exit(status = 0) {\n process.exit(status);\n}\n\nfunction predict(test) {\n let op = \"\";\n let ops = [];\n let opVariables = [];\n let limits = [];\n for (let t of test) {\n // console.log(t);\n for (let i = 0; i < t.length; i++) {\n if (isOp(t[i])) {\n op = t[i];\n if (isOp(t[i + 1])) {\n op += t[i + 1];\n i += 1;\n }\n ops.push(op);\n op = \"\";\n } else if (isChr(t[i])) {\n // console.log(t[i])\n op = t[i];\n for (var j = i + 1; j < t.length; j++) {\n if (isChr(t[j]) || isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n opVariables.push(op);\n op = \"\";\n } else {\n if (i == 0 || (i > 0 && isOp(t[i - 1]))) {\n op = t[i];\n let j = i + 1;\n for (; j < t.length; j++) {\n if (isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n limits.push(op);\n op = \"\";\n }\n }\n }\n }\n\n let min = limits[0];\n let max = limits[1];\n\n let pvs = ops.map((o, i) => [o, opVariables[i]]);\n\n for (let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max;\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1];\n } else {\n print(\"input error\");\n exit();\n }\n }\n}\n\nvar k,n,w\nfunction main() {\n [k,n,w] = lines[0].map(x => parseInt(x,10))\n// print(w)\n predict([\"1<=k<=1000\"])\n predict([\"1<=w<=1000\"])\n predict([\"0<=n<=10**9\"])\n\n let s = 0\n for(let i=1; i<=w; i++) {\n s += k*i\n }\n\n print(s-n)\n}\n", "lang": "Node.js", "bug_code_uid": "af43726b1192f8e0053fd3c1a3748e96", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "5bc33afadfcc13a856ee693b34aef408", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9032258064516129, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n\t input: process.stdin,\n\t output: process.stdout,\n\tterminal : false\n});\n\n\nrl.on(\"line\", main)\nlet s = \"\" \nfunction main(input){\n\tlet arr = input.split(' ')\n\n\tlet k = arr[0]\n\tlet n = arr[1]\n\tlet w = arr[2]\n\n\tlet c = 0\n\tfor(var i = 0; i < w; i++){\n\t\tif( i == 0 ){\n\t\t\tn = n - k\n\t\t\tcontinue\n\t\t}\n\n\t\tn = n - ((i+1)*k)\n\t}\n\n\tconsole.log(Math.abs(n))\n}\n", "lang": "Node.js", "bug_code_uid": "0fe07856a016b65261a51aa297eed541", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "7834c0aa52625db0b0d064224c72c844", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9769713886950454, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nconst readLine=()=> inputString[currentLine++];\n/* ================================================ \n Main Solution Starts Here \n===================================================*/\n\nconst main=()=>{\n\tlet [k,n,w]=readLine().split(\" \").map(n=>+n)\n\tlet price=0\n\tfor(let i=1;i<=w;i++)\n\t\tprice+=(i*k)\n\n\tprice<0 ? console.log(0) : console.log(price-n)\n}", "lang": "Node.js", "bug_code_uid": "5485c0dc91a9b1568f95c005a1bfea80", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "8c7b71dab11ee2d947989fc3a953bf2a", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8243398392652124, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n})\nlet n\nlet c = 0\nrl.prompt()\nrl.on('line', (cmd) => {\n\tc++\n\t//if (c == 1) n = cmd\n\tif (c == 1) {\n\t\tprocess.stdout.write(test(cmd.split(\" \")))\n\t\trl.close()\n\t}\n})\nfunction test(list) {\n\tlet cost = 0\n\tfor (let i = 1; i <= list[2]; i++) {\n\t\tcost += i * list[0]\n\t}\n\treturn cost - list[1] > 0 ? String(cost - list[1]) : \"0\"\n}", "lang": "Node.js", "bug_code_uid": "dd50db70bd15cd3429dfa5fe0a3f33dc", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "3140a4417eb49ae7afcdea68011d81fd", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6568181818181819, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n})\nlet n\nlet c = 0\nrl.prompt()\nrl.on('line', (cmd) => {\n\tc++\n\t//if (c == 1) n = cmd\n\tif (c == 1) {\n\t\tprocess.stdout.write(test(cmd.split(\" \")))\n\t\trl.close()\n\t}\n})\nfunction test(list) {\n\tconsole.log(list)\n\tlet cost = 0\n\tfor (let i = 1; i <= list[2]; i++) {\n\t\tcost += i * list[0]\n\t}\n\treturn cost - list[1] > 0 ? cost - list[1] : 0\n}", "lang": "Node.js", "bug_code_uid": "c8641ff824d524ef1d5c37c5b89f8cd6", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "3140a4417eb49ae7afcdea68011d81fd", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9920391916717698, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction readAsInt(){\n return parseInt(readline());\n}\n\nfunction readAsIntList(){\n return readline().split(' ').filter(i => i).map(i => parseInt(i));\n}\n\n\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n let [k,n,w] = readAsIntList();\n let total = 0;\n for(let i = 1; i <= w; i++) {\n total += k * i;\n }\n console.log(total - n);\n}\n\n", "lang": "Node.js", "bug_code_uid": "f91e5341130b74c7cca9d6a643bfe5df", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "925d7a1e421b8a2f393495fd2db363dc", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9566495224099927, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet inputString = \"\";\n\nprocess.stdin.on(\"data\", (raw_data) => {\n inputString += raw_data;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((line) => {\n return line.trim();\n });\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n/******** Main function*************/\n\nfunction main() {\n var [k, n, w] = readLine().split(\" \").map(Number);\n\n var totalPrice = 0;\n\n for (var i = 1; i <= w; i++) {\n totalPrice += k * i;\n }\n var borrow = totalPrice - n;\n console.log(borrow);\n}\n", "lang": "Node.js", "bug_code_uid": "bdce9f1733f84e6a604a596c78eadcc6", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "2563e07e842dbe5afcef26b5f415cf17", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9988738738738738, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n\n// Write your code here\nfunction nameLookUp(str) {\n let nNames = str.trim().split(' ');\n let sum = 0;\n for (let i = 1; i <= nNames[2]; i++) {\n sum = sum + (i * nNames[0]);\n }\n let borrowedMoney = sum - parseInt(nNames[1]);\n if (borrowedMoney == 0) {\n borrowedMoney = 0;\n }\n return borrowedMoney.toString();\n}", "lang": "Node.js", "bug_code_uid": "936e8fc18e7476e0f33c04070577b6aa", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "33736edcaaa2721ff3eef45e0d0078a6", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9076305220883534, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n var strArr = readLine().split(\" \").map(Number);\n var arr1 = strArr[0];\n var arr2 = strArr[1];\n var arr3 = strArr[2];\n var result = arr1;\n for (let i = 1; i < arr3; i++) {\n arr1 = arr1 * i;\n result += arr1;\n }\n if (result > arr2) {\n console.log(result - arr2);\n } else {\n console.log(0);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "5e8214f9bacc4afdbeaa007ccd2a8054", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "18828fa93c2cfd234c53860722107c42", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9173399627097576, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\n\n// const fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n const arr = readLine().split(' ');\n const k = Number(arr[0]);\n const n = Number(arr[1]);\n const w = Number(arr[2]);\n var total = 0;\n for (var i = 1; i <= w; i++) {\n total += (i * k);\n }\n console.log(k, n, w, total);\n if (total <= n) {\n console.log(0);\n } else {\n console.log(total - n);\n }\n}", "lang": "Node.js", "bug_code_uid": "e6c99c96ceb206c6aa1f5c7ecac86d86", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "17cca7d16602d9dee5698291c356825e", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9821428571428571, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n var T = readLine();\n var Tarr = T.split(\" \");\n var t1 = parseInt(Tarr[0]);\n var t2 = parseInt(Tarr[1]);\n var count = 0;\n var scores = readLine();\n var scoresArr = scores.split(\" \");\n scoresArr = scoresArr.map(Number);\n var passScore = scoresArr[t2 - 1];\n for (let i = 0; i < t1; i++) {\n if (scoresArr[i] >= passScore && passScore != 0) {\n count++;\n }\n }\n console.log(count);\n}\n", "lang": "Node.js", "bug_code_uid": "f4e4a3d5d370a16831261571dd9b0422", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "043a7b2037301b3547dccb54f05fbe68", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.44807849550286183, "equal_cnt": 24, "replace_cnt": 16, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 24, "bug_source_code": "let i = '';\nprocess.stdin.on('data', (c) => {\n i += c;\n});\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n const lines = i.split(EOL);\n let nums = lines[1].split(' ');\n nums = nums.map(num => parseInt(num, 10));\n const k = lines[0].split(' ')[1];\n console.log(minOperations(nums, parseInt(k, 10)));\n});\n\nfunction minOperations(nums, k) {\n nums = nums.sort((a, b) => a - b);\n\n let totalMin = Number.MAX_VALUE;\n for (let i = -1; i <= nums.length - k; i++) {\n if (i > 0 && nums[i] === nums[i - 1]) continue;\n\n let index;\n let numToMake;\n\n if (i === -1) {\n index = 0;\n numToMake = 1;\n } else {\n index = i;\n numToMake = nums[index];\n }\n\n let operations = 0;\n let matches = 0;\n while (index < nums.length) {\n let currNumber = nums[index];\n let currOperations = 0;\n while (currNumber > numToMake) {\n currNumber = Math.floor(currNumber / 2);\n currOperations++;\n }\n if (currNumber === numToMake) {\n matches++;\n operations += currOperations;\n }\n\n if (matches === k) {\n totalMin = Math.min(operations, totalMin);\n break;\n }\n index++;\n }\n }\n return totalMin;\n}\n", "lang": "Node.js", "bug_code_uid": "82158b23dc213d2e02c87a0ce4e5afa5", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "90c23bcef4d261278398d787e690cc21", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6576250753465943, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "let i = '';\nprocess.stdin.on('data', c => i += c);\nprocess.stdin.on('end', () => {\n const {EOL} = require('os');\n const lines = i.split(EOL) ;/*your input text, split by lines*/\n const k = lines[0];\n const arr = lines.slice(1, lines.length).filter(l => l).map(l => parseInt(l));\n\n if (arr.reduce((a, v) => a + v, 0) === 360) {\n \tconsole.log(\"YES\");\n \treturn;\n }\n\n \tfunction subseqs(arr, k) {\n\t\t\tconst n = arr.length;\n\t\t\tconst res = [];\n\t\t\tlet j = 0;\n\n\t\t\tfor (let mask = 0; mask < (1 << n); mask++) {\n\t\t\t\tlet num = 0;\n\n\t\t\t\tfor (let i = 0; i < n; i++) {\n\t\t\t\t\tif (mask & (1 << i)) {\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (num === k) {\n\t\t\t\t\tres[j] = [0, 0];\n\n\t\t\t\t\tfor (let i = 0; i < n; i++) {\n\t\t\t\t\t\tif (mask & (1 << i)) {\n\t\t\t\t\t\t\tres[j][0] = (res[j][0] + arr[i]) % 360;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tres[j][1] = (res[j][1] + arr[i]) % 360;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\tfor (let i = 1; i < arr.length / 2 + 1; i++) {\n\t\tfor (const ss of subseqs(arr, i)) {\n\t\t\tif (ss[0] === ss[1]) {\n\t\t\t\tconsole.log(\"YES\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(\"NO\");\n});\n\n", "lang": "Node.js", "bug_code_uid": "0337f0aa217d072e97f5a8380550f352", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "5898f20bdfdf2d3b40a48cee8566c856", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.17011787193373687, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n const k = lines[0];\n const arr = lines.slice(1.lines.length - 1);\n\n console.log(arr);\n\n \tfunction subseqs(arr, k) {\n\t const n = arr.length;\n\t const res = [];\n\t let j = 0;\n\n\t for (let mask = 0; mask < (1 << n); mask++) {\n\t let num = 0;\n\n\t for (let i = 0; i < n; i++) {\n\t if (mask & (1 << i)) {\n\t num++;\n\t }\n\t }\n\n\t if (num === k) {\n\t res[j] = [0, 0]\n\n\t for (let i = 0; i < n; i++) {\n\t if (mask & (1 << i)) {\n\t res[j][0] += arr[i]\n\t } else {\n\t res[j][1] += arr[i];\n\t }\n\t }\n\n\t j++;\n\t }\n\t }\n\n\t return res;\n\t}\n\n\tfor (let i = 1; i < arr.length; i++) {\n\t subseqs(arr, i).map(ss => console.log(ss[0] == ss[1] ? \"YES\" : \"NO\"));\n\t}\n});\n", "lang": "Node.js", "bug_code_uid": "896b853b058a64f234b2fea0a8022229", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "5898f20bdfdf2d3b40a48cee8566c856", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9794117647058823, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n});\n\nconst lines = [];\n\nreadline.on('line', (line) => {\n lines.push(Number(line));\n});\n\nconst processAngles = (n, angles) => {\n for (let i = 0; i < 2 ** (n - 1); i += 1) {\n const bitbask = i.toString(2).padStart(angles.length, '0');\n const rotation = angles.reduce((acc, angle, idx) => {\n if (bitbask[idx] === '0') {\n return acc + angle;\n }\n\n return acc - angle;\n }, 0);\n\n if (rotation === 0 || rotation === 360) {\n return 'YES';\n }\n }\n\n return 'NO';\n};\n\nreadline.on('close', () => {\n const [n, ...angles] = lines;\n\n console.log(processAngles(n, angles));\n});\n", "lang": "Node.js", "bug_code_uid": "67f414bb75ce928461336b8ed5e29a06", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "af89aaaf055aba2c4a777fc242004696", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.3748894783377542, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "const n = process.argv[2];\nlet k = parseInt(process.argv[3]);\nlet x = `${n}`.split('');\nconsole.log(n, k);\nfor (let i=0;i {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\n// thats all what you have to write to get input from stdin, using readLine.\n\n\n// Main code runs in main();\n\n\nfunction main() {\nconst num = readline().split(\" \").map(x => parseInt(x))\nlet k = parseInt(num[1]);\nlet x = `${num[0]}`.split('');\nconsole.log(n, k);\nfor (let i=0;i {\n res = n;\n const getLastDigit = (d) => {\n last = d%10;\n return +last;\n };\n\n for (i = 0; i < k; i++){\n let lastDigit = getLastDigit(res);\n //if the last digit of the number is non-zero, she decreases the number by one;\n // the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).\n if (lastDigit !== 0) {\n res--;\n } else {\n res = res/10;\n }\n }\n return res;\n};", "lang": "Node.js", "bug_code_uid": "519749f5fa4862da2a9deb7cc0daaaa9", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "9d3b9c450843def05cafbf41e27342b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9043869516310461, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nlet stdin = [];\nrl.on('line', function (line) {stdin.push(line);});\nrl.on('close', solution(stdin));\n\n\nvar solution = function(str) {\n var line = str.split(' ');\n var n = parseInt(line[0]);\n var k = parseInt(line[1]);\n\n var main = function(n, k){\n res = n;\n var getLastDigit = function(d){\n last = d%10;\n return +last;\n };\n\n for (i = 0; i < k; i++){\n var lastDigit = getLastDigit(res);\n //if the last digit of the number is non-zero, she decreases the number by one;\n // the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).\n if (lastDigit !== 0) {\n res--;\n } else {\n res = res/10;\n }\n }\n return res;\n };\n\n var result = main(n, k);\n console.log(result);\n return result;\n\n};", "lang": "Node.js", "bug_code_uid": "62bde6309c3009029a81bbb6b2b00fc4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "9d3b9c450843def05cafbf41e27342b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.6643356643356644, "equal_cnt": 28, "replace_cnt": 12, "delete_cnt": 14, "insert_cnt": 2, "fix_ops_cnt": 28, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nlet str = [];\nrl.on('line', function (line) {str.push(line);});\nrl.on('close', solution(str));\n\n\nfunction solution(str) {\n let line = str[0].split(' ');\n var n = parseInt(line[0]);\n var k = parseInt(line[1]);\n\n var main = function(n, k){\n res = n;\n var getLastDigit = function(d){\n last = d%10;\n return +last;\n };\n\n for (i = 0; i < k; i++){\n var lastDigit = getLastDigit(res);\n //if the last digit of the number is non-zero, she decreases the number by one;\n // the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).\n if (lastDigit !== 0) {\n res--;\n } else {\n res = res/10;\n }\n }\n return res;\n }\n\n var result = main(n, k);\n console.log(result);\n return result;\n}", "lang": "Node.js", "bug_code_uid": "34c591f4f90beaa2973f01381af042fe", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "9d3b9c450843def05cafbf41e27342b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9863842662632375, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const {EOL} = require('os')\n\nlet input = ''\nprocess.stdin.on('data', s => input += s)\nprocess.stdin.on('end', () => {\n let [number, times] = input.split(\" \").forEach(element => parseInt(element));\n for(let i = 0; i < times; i++) {\n number = number % 10 == 0 ? number / 10 : number - 1;\n }\n console.log(number);\n})", "lang": "Node.js", "bug_code_uid": "deec7e4289c4a796c5630385b330027d", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "11fd202dfaa272a17fbfdcb9a1066aff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5927505330490405, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const {EOL} = require('os')\n\nlet input = ''\nprocess.stdin.on('data', s => input += s)\nprocess.stdin.on('end', () => {\n console.log(1);\n})", "lang": "Node.js", "bug_code_uid": "2b52276d8efbfb5cb202c2e2e2c01bff", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "11fd202dfaa272a17fbfdcb9a1066aff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9649737302977233, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\nreadline.question(`Input your numbers: `, (numbers) => {\n [num1, num2] = numbers.split(' ');\n let result = wrongSubstraction(num1, num2);\n console.log(result);\n readline.close()\n})\n\nlet wrongSubstraction = (num1, num2) => {\n // revisar en python si vale comprar dos numeros \n if (num1 <= 0 || num2 <= 0) return;\n\n for(let i = 0; i < num2; i++){\n if(num1%10==0){\n num1 /= 10;\n } else {\n num1 -= 1;\n }\n // console.log(num1);\n }\n\n return num1;\n};", "lang": "Node.js", "bug_code_uid": "900b1baa30db3d328073d3e718f11418", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "79014da252a397d19f15bc8c0b91b8f4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9986945169712794, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map(string => {\n return string.trim();\n });\n\n process.stdout.write(main(inputString));\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nconst main = ([inputString]) => {\n const [n, k] = inputString.split(' ');\n let ans = n;\n for (let i = 0; i < k; i += 1) {\n const str = String(ans);\n const endingDigit = str[str.length - 1];\n if (endingDigit === 0) {\n ans = ans / 10;\n } else {\n ans -= 1;\n }\n }\n return String(ans);\n};\n", "lang": "Node.js", "bug_code_uid": "7b60b8c5d0b471ca538d8cbccf54c25a", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "196069ec89484ac689a4adec5908b7bf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "function Tanya(input) {\n\tlet num = input[0];\n\tlet k = input[1];\n\tfor (let i = 0; i < k; i++) {\n\t\tlet numToStr = num.toString();\n\t\tif (numToStr[numToStr.length - 1] == 0) {\n\t\t\tnumToStr = numToStr.slice(0, numToStr.length - 1);\n\t\t\tnum = Number(numToStr);\n\t\t} else {\n\t\t\tnum = num - 1\n\t\t}\n\t}\n\treturn num\n}\nconsole.log(Tanya([1000000000, 9]))\n", "lang": "Node.js", "bug_code_uid": "588b58b42ba89d79aa221dde7337fea4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "fd3a6fc7fa165ee10061c16554e84558", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6483790523690773, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 14, "bug_source_code": "let num = input[0];\nlet k = input[1];\nfor (let i = 0; i < k; i++) {\n\tlet numToStr = num.toString();\n\tif (numToStr[numToStr.length - 1] == 0) {\n\t\tnumToStr = numToStr.slice(0, numToStr.length - 1);\n\t\tnum = Number(numToStr);\n\t} else {\n\t\tnum = num - 1\n\t}\n}\nconsole.log(num)\n", "lang": "Node.js", "bug_code_uid": "c1b3e89c04532f2d7ea0ed1b0a2f74f6", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "fd3a6fc7fa165ee10061c16554e84558", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.3415559772296015, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "[n, k] = readline().split(' ').map(n => parseInt(n));\n\nfor (let i = 0; i < k; i++) {\n if (n % 10 === 0) n /= 10;\n else n -= 1;\n}\n\nprint(n);", "lang": "Node.js", "bug_code_uid": "38126e4bba596bad27c9d03f441f7db0", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "121cce6ab43c0a39117ec5b4bcd203ec", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.990990990990991, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "function main(input) {\n //Enter your code here\n let [target, counter] = input.split(' ');\n for(let i = 0; i <4; i++ ) {\n if(target % 10 === 0) {\n target /= 10;\n } else {\n target -= 1;\n }\n }\n console.log(target);\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n", "lang": "Node.js", "bug_code_uid": "9bffe4357b4f4cba832a12174dee68b8", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "9ac2d461049fa5e0797b5de6f32bb35b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7517509727626459, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\nasync function getN() {\n\tlet str = 'enter n' \n\treturn new Promise((res,rej)=>{\n\t\trl\n\t\t.question(str,ans=>res(ans))\n\t})\n}\n\nasync function getK() {\n\tlet str = 'enter k'\n\treturn new Promise((res,rej)=>{\n\t\trl\n\t\t.question(str,ans=>res(ans))\n\t})\n}\n\nfunction subtraction(n,k){\n\t\n\tif(k == 0)return n\n\n\tlet resedue = n%10\n\n\tif( resedue > 0 ){\n\t\t--n\n\t\t--k\n\t\treturn subtraction(n,k)\n\t}\n\telse{\n\t\t--k\n\t\treturn subtraction(n/10,k)\n\t}\n\n}\nasync function main() {\n\tlet n = await getN()\n\tlet k = await getK()\n\trl.close()\n\n\tconsole.log(`n:${n}, k:${k}`)\n\tconsole.log(subtraction(n,k))\n\t\n}\n\nmain()", "lang": "Node.js", "bug_code_uid": "a95b31008a1ab27f4ae4cc6630fe76bc", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "8ca37bfe328c61b218071600031f8130", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.4604651162790698, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "var x = readline();\nx = parseInt(x);\nvar arr = [4,7,47,74,44,444,447,474,477,777,774,744];\nvar flag = false;\nfor(var i = 0; i < arr.length; i++) {\n if(x % arr[i] === 0) {\n flag = true;\n }\n}\nif(flag === true) {\n console.log(\"YES\\n\");\n} else {\n console.log(\"NO\\n\");\n}", "lang": "JavaScript", "bug_code_uid": "6dc07edadfc928ee33d764f32f8b48fa", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "bf85cc5e8dab8557e39af3e35bae2dbd", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9725363489499192, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.question(\"\", loop =>{\n getUserInput(loop);\n})\n\n\nfunction totalPressedDigit(number){\n let digit = number[0];\n let length = number.length;\n console.log( (digit-1) * 10 + length*(length+1)/2);\n}\n\nfunction getUserInput(n) {\n rl.question('', (number) => {\n totalPressedDigit(number)\n if (n > 1) {\n getUserInput(n-1);\n } else {\n rl.close();\n }\n }); \n}\n\nrl.on(\"close\", function() {\n console.log(\"\\nBYE BYE !!!\");\n process.exit(0);\n});", "lang": "Node.js", "bug_code_uid": "c2b492d5df9d7dcf3c9430cfede5593d", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "3a8abf1a3ed1014661a25ce401ec66c0", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9831475239823697, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nconst { reset } = require(\"nodemon\");\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n // const x = readline();\n\n\n var x = readline(); // first line of input usually gives the no. of test cases,i.e, the no. of lines ahead.\n var inp; // declaring the variable outside the loop\n for (var i = 0; i < x; i++) {\n inp = readline();\n console.log(foo(inp))\n }\n\n // for (let i = 1; i <= x; i++) {\n // var line2 = readline();\n // console.log(foo(line2))\n // }\n // foo(x);\n // foo(line2);\n}\n\nfunction test_same_digit(num) {\n const first = num % 10;\n while (num) {\n if (num % 10 !== first) return false;\n num = Math.floor(num / 10);\n }\n return true\n}\n\n\n\nfunction foo(n) {\n\n\n let result = new Set();\n let b = false;\n for (let i = 1; i <= n; i++) {\n let res = i;\n let index = 1;\n let d = i;\n\n if (b) {\n\n break\n }\n while (res < 10000) {\n if (res == n) {\n result.add(`${res}`)\n b = true;\n break\n }\n if (test_same_digit(Number(res)) && !result.has(res)) {\n result.add(`${res}`)\n\n }\n res = `${d}`.repeat(index);\n index++\n }\n }\n\n let d = Array.from(result);\n\n let sum = 0;\n for (let i = 0; i < d.length; i++) {\n let f = d[i].split(\"\").length || 0;\n sum += Number(f)\n }\n return sum\n}\n\n// console.log(foo(9999))", "lang": "Node.js", "bug_code_uid": "152ab86b579b65ee254e7fe204efb7c3", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "f0faba9baa3decec8d67d1d2c77432ff", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8087855297157622, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "var readline = require('readline');\nvar rl = readline.createInterface(process.stdin, process.stdout);\nrl.question('', (arg)=>{\n\tlet sum = 0;\n\tif(arg>10){let a = arg - (arg%10) - 1;\n\t\t\tlet b= arg - a;\n\t\t\twhile(a!=0|| b!=0){\n\t\t\t\tsum = sum + a%10 +b%10;\n\t\t\t\ta= Math.floor(a/10);\n\t\t\t\tb= Math.floor(b/10);\n\t\t\t}\n\t\t}else{\n\t\t\tsum = arg;\n\t\t}\n\tconsole.log(sum);\n\trl.close();\n});", "lang": "Node.js", "bug_code_uid": "fbd9c63228df2974250dc0b45ba8490f", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "25a4dce718ed5654ce484b88253cd316", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9483960948396095, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "function countMarkers(w1, h1, w2, h2){\n let totalBoxes2 = ((w2+2) * (h2+1)) - (w2 * h2);\n let totalBoxes1 = ((w1+2) * (h1+1)) - (w1 * h1);\n let rightAllOff = w1 - w2;\n return totalBoxes1 + totalBoxes2 + rightAllOff;\n\n}\n\nfunction processData(input) {\n //Enter your code here\n // const readline = require('readline');\n var numbers = input.split(\" \").map(function(x) { return +x; });\n\n console.log(countMarkers(numbers[0], numbers[1], numbers[2], numbers[3]))\n\n} \n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"ascii\");\n_input = \"\";\nprocess.stdin.on(\"data\", function (input) {\n _input += input;\n});\n\nprocess.stdin.on(\"end\", function () {\n processData(_input);\n});", "lang": "Node.js", "bug_code_uid": "cfee8e03842f2a1070319981864e7c0d", "src_uid": "b5d44e0041053c996938aadd1b3865f6", "apr_id": "d0b9b414b5be939175239b1417d260af", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9791921664626683, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n let [a, b] = input[0].split(' ').map(x => parseInt(x));\n let answ = a;\n\n let ost = a;\n while (ost > 0) {\n answ += parseInt(ost/b);\n ost = parseInt(ost/b);\n }\n\n console.log(answ);\n}); \n", "lang": "Node.js", "bug_code_uid": "37b9e3fbed83081df2bc24e645e94092", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "cd31428520006f339afe24d763899b6a", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9758812615955473, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction main() {\n\tlet [a, b] = readLine()\n\t\t.split(' ')\n\t\t.map(x => parseInt(x));\n\tlet s = a;\n\tlet hours = 0;\n\n\twhile (Math.floor(a / b) !== 0) {\n\t\thours += Math.floor(a / b);\n\t\ta = Math.floor(a / b);\n\t}\n\n\tconsole.log(s + hours);\n}\n", "lang": "Node.js", "bug_code_uid": "51aee10ad42ea634fd82f423b6058e0c", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "b3a782369235b7fb43e103dc5b2b3ccb", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6167097329888027, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " var n = readline();\n var a = readline().split(\" \").map(x=> parseInt(x));\n a.sort((x,y) => x-y);\n \n let c = 0;\n for(let i=0;i {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [x, y] = readLine().split(' ').map(Number);\n let n = parseInt(readLine());\n\n let third = y - x;\n let fourth = third - y;\n let fifth = fourth - third;\n let sixth = fifth - fourth;\n if (n % 6 === 1) {\n if (Math.sign(x) !== -1) {\n console.log(x % 1000000007);\n } else {\n console.log(1000000007 + x);\n }\n } else if (n % 6 === 2) {\n if (Math.sign(y) !== -1) {\n console.log(y % 1000000007);\n } else {\n console.log(1000000007 + y);\n }\n } else if (n % 6 === 3) {\n if (Math.sign(third) !== -1) {\n console.log(third % 1000000007);\n } else {\n console.log(1000000007 + third);\n }\n } else if (n % 6 === 4) {\n if (Math.sign(fourth) !== -1) {\n console.log(fourth % 1000000007);\n } else {\n console.log(1000000007 + fourth);\n }\n } else if (n % 6 === 5) {\n if (Math.sign(fifth) !== -1) {\n console.log(fifth % 1000000007);\n } else {\n console.log(1000000007 + fifth);\n }\n } else if (n % 6 === 0) {\n if (Math.sign(sixth) !== -1) {\n console.log(sixth % 1000000007);\n } else if (Math.sign(sixth) === -1) {\n console.log(1000000007 + sixth);\n }\n }\n}\n", "lang": "Node.js", "bug_code_uid": "558a91f9f1d943dfbb8bb3498eab5d5a", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "23b7e72f3b5271e6db5b97cd203d0d0e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9757127771911299, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n const banknotes = [1, 5, 10, 20, 100];\n\n let min = 0;\n\n for (let i = banknotes.length - 1; i >= 0; --i) {\n min += Math.floor(n / banknotes[i]);\n\n n -= Math.floor(n / banknotes[i]) * banknotes[i];\n }\n console.log( min);\n \n\n \n});\n", "lang": "Node.js", "bug_code_uid": "2925083ce9f3fca46691a765593ef4fe", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "e35b00195b45458d823d0f1bbcb8d041", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9991364421416234, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n getMinNumber(lines[0])\n})\n\nfunction getMinNumber(input) {\n let avaialbleBankNotes = [1, 5, 10, 20, 100];\n let output = 0;\n let bankNotesCount = 0;\n let reaminingInput = input\n\n avaialbleBankNotes.reverse().forEach(element => {\n if (input === element) {\n // console.log('Input === Element');\n output = element;\n bankNotesCount = 1;\n return;\n }\n\n if (reaminingInput >= element) {\n do {\n output = output + element;\n reaminingInpu50t = reaminingInput - element;\n bankNotesCount = bankNotesCount + 1;\n\n // console.log(\"Bank Note used: \" + element);\n // console.log(\"Remaining Amount:\" + reaminingInput);\n // console.log(\"Current Output: \" + output);\n } while(output + element <= input)\n }\n });\n // console.log('Final Output is: ' + output);\n console.log(bankNotesCount);\n}", "lang": "Node.js", "bug_code_uid": "9c18a4bc020b7844420ca22e0cb55128", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "8bb63fff105a84d20743126ecaeb1c2c", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9426268373636795, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n');\n var start = Date.now();\n Main();\n var end = Date.now() - start;\n myerr('time : ' + end + 'ms');\n myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n myout(Math.min(one[0] + one[0] + one[1] + one[1]), (one[0] + one[1] + one[2]));\n}\n", "lang": "Node.js", "bug_code_uid": "7dc099a3d02d0912b3fda8442209d885", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "2f51ca2a3451c192f3ff6a793084d930", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9976415094339622, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false,\n});\n\nrl.on(\"line\", (d) => {\n const [start, shop1, shop2] = d.split(\" \").map(Number);\n\n console.log(\n Math.min(\n start * 2 + shop1 + shop2,\n start * 2 + shop1 * 2,\n start * 2 + shop2 * 2,\n shop1 * 2 + shop2 * 2,\n start + shop2 + shop2\n )\n );\n});\n", "lang": "Node.js", "bug_code_uid": "9de1bb1efd38dc1ac6ac21d7bc5b491f", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "e92304003dec6aedc12803bf61b1fe96", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.061457418788410885, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "const prompt = require('prompt');\n\nprompt.start();\n\nconst arr = [];\n\nprompt.get(['d1', 'd2', 'd3'], function (err, result) {\n if (err) { console.log(err); }\n arr.push(Number(result.d1), Number(result.d2), Number(result.d3))\n console.log(calculateMinDis(arr));\n});\n\nfunction calculateMinDis(a) {\n console.log(a)\n miniCor = a[0] + a[1]\n mid = a[2] > miniCor ? miniCor : a[2]\n firstSol = miniCor + mid\n secSol = 2*a[2] + 2*a[0]\n thirdSol = 2*a[2] + 2*a[1]\n return Math.min(firstSol, secSol, thirdSol)\n}", "lang": "Node.js", "bug_code_uid": "063d0342e23cb61b574ed6138ec36072", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "79fe861bf2d5a73846423dcce5102ccf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.32338653712699517, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question(\"\", function(input) {\n arrOfInp = input.split(' ')\n // rl.question(\"\", function(d2) {\n // rl.question(\"\", function(d3) {\n // console.log(calculateMinDis([Number(d1), Number(d2), Number(d3)]));\n \n // });\n // });\n console.log(calculateMinDis([Number(arrOfInp[0]), Number(arrOfInp[1]), Number(arrOfInp[2])]));\n rl.close();\n});\n\nrl.on(\"close\", function() {\n process.exit(0);\n});\n\nfunction calculateMinDis(a) {\n console.log(a)\n miniCor = a[0] + a[1]\n mid = a[2] > miniCor ? miniCor : a[2]\n firstSol = miniCor + mid\n secSol = 2*a[2] + 2*a[0]\n thirdSol = 2*a[2] + 2*a[1]\n return Math.min(firstSol, secSol, thirdSol)\n}", "lang": "Node.js", "bug_code_uid": "1c7fcb942bd05ebf2b35235b88a8542b", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "79fe861bf2d5a73846423dcce5102ccf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.3127413127413127, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\nrl.question('', ans => {\n rl.close()\n\n let n = Number(ans)\n\n function closest (n) {\n let closest = ''\n while (true) { \n if (n <= 9) {\n\t\t\tclosest = n + closest\n\t\t\tbreak\n }\n \n\t\tclosest = 9 + closest\n n = ~~((n - 9) / 10)\n }\n \n return Number(closest)\n }\n\n function nirvana (n) {\n const c = closest(n)\n const sC = String(c).split('')\n let grtst = Number(sC.reduce((i, acc = 1) => Number(i) * acc))\n\n for (let i = c + 1; i <= n; i++) {\n const sI = String(i).split('')\n let dMult = Number(sI.reduce((i, acc = 1) => i * acc))\n grtst = dMult > grtst ? dMult : grtst\n }\n \n return grtst\n }\n\n console.log(nirvana(n))\n})", "lang": "Node.js", "bug_code_uid": "08abfd38564a807154d726a59e95bab5", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "73235ffc99dac7a94999f1fe4c64a715", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9098250336473755, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "function distToCenter(lines) {\n for (var i = 0; i < lines.length; i++) {\n var j = lines[i].indexOf(\"1\");\n if (j !== -1) {\n return Math.abs(j - 2) + Math.abs(i - 2);\n }\n }\n}\nfunction main(stdin) {\n console.log(distToCenter(stdin.split(\"\\n\")));\n}\nmain(require(\"fs\")\n .readFileSync(0, \"utf-8\")\n .trim());\n", "lang": "Node.js", "bug_code_uid": "9bff0e02d805ff19e4a93723b31f609f", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "129f813974d935e9c36d0f02ec4c51f1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9232192414431082, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet matrix = [], location = [];\n\nrl.on('line', n => {\n matrix.push(n.split(' ').map(Number));\n if (matrix.length === 5) {\n for (let i = 0; i < matrix.length; i++) {\n if (matrix[i].includes(1)) {\n location.push(i, matrix[i].indexOf(1));\n break;\n }\n }\n\n const yShift = Math.abs(location[0] - 2);\n const xShift = Math.abs(location[1] - 2);\n console.log(Math.max(xShift, yShift));\n rl.close();\n }\n});", "lang": "Node.js", "bug_code_uid": "efc27fdfc24a29491d3fb5dd3b66e013", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "bfaaf9d5ce5607153b12e40937de2069", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9991334488734835, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Generated by CoffeeScript 2.5.1\nvar find, lines, mainAux, print, readline, rl, rli, sum, write;\n\nrl = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nprint = console.log;\n\nwrite = function(...args) {\n return process.stdout.write(args.join(' '));\n};\n\nlines = [];\n\nrl.on('line', function(line) {\n return lines.push(line);\n});\n\nrl.on('close', main);\n\nrli = 0;\n\nreadline = function() {\n return lines[rli++];\n};\n\nsum = function(items) {\n return items.reduce((function(a, b) {\n return a + b;\n }), 0);\n};\n\nfind = function(input) {\n return [\n input.find((inp) => {\n return inp.includes('1');\n }).split(' ').findIndex((str) => {\n return str === '1';\n }),\n input.findIndex((inp) => {\n return inp.includes('1');\n })\n ];\n};\n\nmainAux = function() {\n var input;\n input = [];\n input.push(readline());\n input.push(readline());\n input.push(readline());\n input.push(readline());\n input.push(readline());\n return print(sum(find(input).map(function(v) {\n return Math.abs(3 - v);\n })));\n};\n\n\n function main() {\n return mainAux();\n }\n;\n\n//# sourceMappingURL=matrix.js.map\n", "lang": "Node.js", "bug_code_uid": "0ca7836920dd67fcdef847d4887a2a5b", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "435a9e62182fd6aaf11b20ec2f56f280", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9991769547325103, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Generated by CoffeeScript 2.5.1\nvar find, lines, mainAux, numMoves, print, readline, rl, rli, sum, write;\n\nrl = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nprint = console.log;\n\nwrite = function(...args) {\n return process.stdout.write(args.join(' '));\n};\n\nlines = [];\n\nrl.on('line', function(line) {\n return lines.push(line);\n});\n\nrl.on('close', main);\n\nrli = 0;\n\nreadline = function() {\n return lines[rli++];\n};\n\nsum = function(items) {\n return items.reduce((function(a, b) {\n return a + b;\n }), 0);\n};\n\nfind = function(input) {\n return [\n input.find((inp) => {\n return inp.includes('1');\n }).split(' ').findIndex((str) => {\n return str === '1';\n }),\n input.findIndex((inp) => {\n return inp.includes('1');\n })\n ];\n};\n\nnumMoves = function(v) {\n return Math.abs(3 - v);\n};\n\nmainAux = function() {\n var input;\n input = [];\n input.push(readline());\n input.push(readline());\n input.push(readline());\n input.push(readline());\n input.push(readline());\n return print(sum(find(input).map(function(v) {\n return numMoves(v);\n })));\n};\n\n\n function main() {\n return mainAux();\n }\n;\n\n//# sourceMappingURL=matrix.js.map\n", "lang": "Node.js", "bug_code_uid": "1fe8fa7699b06b603d66650e6232523e", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "435a9e62182fd6aaf11b20ec2f56f280", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7600518806744487, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet i = 0;\nlet point;\nrl.on('line', (line) => {\n\n let row = line.split(' ').map(Number);\n if (!point) {\n for (let j = 0; j < row.length; j++) {\n if (row[j] === 1) {\n point = {i, j};\n }\n }\n }\n i++\n if (i === 5) {\n let moves = 0;\n if (point.i > 2) {\n moves += point.i - 2;\n } else if (point.i > 2) {\n moves += 2 - point.i;\n }\n if (point.j > 2) {\n moves += point.j - 2;\n } else if (point.j > 2) {\n moves += 2 - point.j;\n }\n console.log(moves);\n }\n});\n", "lang": "Node.js", "bug_code_uid": "3761fa83c6327d450bdb07fd0dcb81f1", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "9db7c77750c732343dccfe3581d25b94", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9733924611973392, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet matrix = [];\nrl.on(\"line\",(input)=>{\n let row = input.split(\" \").map(Number)\n matrix.push(row)\n if(matrix[4]){\n rl.close();\n let perfectRow = 3;\n let perfectCol = 3;\n let steps = null ;\n let currentRow = null\n let currentCol = null\n matrix.forEach((row,index) => {\n if(row.includes(1)){\n currentRow = index+1; \n row.forEach((col,index)=>{\n if(col==1) currentCol = index+1;\n })\n\n }\n if (currentRow!=perfectRow || currentCol!=perfectCol ) {\n steps = Math.abs(currentCol - perfectCol)+Math.abs(currentRow-perfectRow);\n }\n\n });\n console.log(steps)\n\n }\n})", "lang": "Node.js", "bug_code_uid": "097e23a10a530c52245ce0c78ee37f4d", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "99a10fb45bca611b25b50e18290b85f0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9694041867954911, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const str = readLine();\n let count_4_7 = 0;\n\n str.split(\"\").forEach((char) => {\n if (char === \"4\" || char === \"7\") count_4_7++;\n });\n\n if (count_4_7 === str.length || +str % 4 === 0 || +str % 7 === 0) {\n console.log(\"YES\");\n } else {\n console.log(\"NO\");\n }\n}\n", "lang": "Node.js", "bug_code_uid": "a5cf32623b337cb6b1c64347002464c8", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "e3691a90b07530fe607d19c9316cbf1c", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9328914664457332, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\n\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n check(lineInput)\n})\n\n\nfunction check(num) {\n\n if (num % 7 == 0 || num % 4 == 0)\n return console.log(\"YES\")\n else {\n\n const nums = num.split('');\n\n for (let i = 0; i < nums.length; i++) {\n\n if (nums[i] != 4 && nums[i] != 7)\n return console.log(\"NO\")\n }\n\n return console.log(\"YES\")\n\n }\n\n}", "lang": "Node.js", "bug_code_uid": "b06057fb1eb5bd45df0ca567597ac2a2", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "b5bb4bc39ed8410fca9b64de15e52c77", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9494712103407755, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n let num = parseInt(input[0]);\n\n if (num % 7 === 0 || num % 4 === 0 || num % 47 === 0 || num % 74 === 0 || num % 44 === 0 || num % 77 === 0)\n console.log(`YES`);\n else\n console.log('NO');\n});", "lang": "Node.js", "bug_code_uid": "6f34e470ff36688bafd4e970a337014e", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "1c70f86930c0ed3cfdb3d4f63a768c5d", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8779465688842326, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet standardInputString = '';\nlet currentLine = 0;\n\nfunction readLine() {\n return standardInputString[currentLine++];\n}\n\nprocess.stdin.on('data', rawData=> {\n standardInputString += rawData;\n})\n\nprocess.stdin.on('end', _ => {\n standardInputString = standardInputString.trim().split('\\n').map(line=> {\n return line.trim();\n })\n main();\n})\n\nfunction main() {\n let number = Array.from(readLine());\n\n if((1*number.join(\"\")) % 4 === 0 || (1*number.join(\"\"))%7 === 0) {\n console.log('YES');\n return;\n }\n\n let match = number.filter(n => {\n if(n === '4' || n === '7') {\n return true;\n } else {\n return false;\n }\n })\n\n if(number.length === match.length) { \n console.log('YES');\n } else {\n console.log(\"NO\");\n }\n}", "lang": "Node.js", "bug_code_uid": "b9f79230644817917c59d2b42eff96b7", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "9741c02caa7f1b1d7c89f074eca8bff0", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8025276461295419, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "let fs = require(\"fs\");\n\nlet txt = fs.readFileSync(0, \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0\n});\n// txt.shift();\nfor (let index = 0; index < txt.length; index++) {\n\n doit(txt[index]*1);\n\n}\n\nfunction doit(num) {\n let tab = String(num).split(\"\").filter(data => {\n if (data != 4 && data != 7) {\n return data;\n }\n }).length;\n if(tab==0){\n console.log(\"YES\");\n }else if(num%4==0 || num%7==0){\n console.log(\"YES\");\n }else{\n console.log(\"NO\");\n }\n}", "lang": "Node.js", "bug_code_uid": "e71638c48c76cf8a45df54949dd72be8", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "d823f33fd85f344abece2f20336cf84d", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9961330239752514, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const input = [];\n\nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', (line) => {\n input.push(line);\n});\n\nfunction solver(n, m) {\n let first = 0, second = 0, copyN = n;\n let point = (m % 2 === 0) ? m : m + 1;\n\n while (copyN !== point/2) {\n if (copyN > point/2) {\n first += copyN - (point/2);\n copyN = point/2;\n }\n if (copyN < point/2) { copyN *= 2; first += 1; }\n }\n first += (m % 2 === 0) ? 1 : 2;\n\n copyN = n;\n while (copyN !== m) {\n if (copyN < m) copyN *= 2;\n else {\n second += copyN - m;\n break;\n }\n second += 1;\n }\n \n return Math.min(first, second);\n}\n\nRL.on('close', () => {\n let [n, m] = input[0].split(' ').map(x => parseInt(x));\n if (n > m) {\n console.log(n - m); return;\n }\n let data = {};\n data[n] = n;\n \n let find = 0;\n while (true) {\n const map = {};\n for (const i of Object.keys(data)) {\n let x = parseInt(i)\n if (x - 1 >= (m/2) - 100 ) {\n map[x - 1] = x-1;\n if (x - 1 === m) {\n console.log(find+1); return;\n }\n }\n if (x*2 <= m*1.5) {\n map[x * 2] =x*2;\n if (x*2 === m) {\n console.log(find+1); return;\n }\n }\n }\n data = map;\n \n find += 1;\n }\n});", "lang": "Node.js", "bug_code_uid": "61512692b8f2f29c480a3685956cebe8", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "376acda94c5e683fa89647b47b0e0cd6", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8552580519984478, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "const input = [];\n\nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', (line) => {\n input.push(line);\n});\n\nfunction solver(n, m) {\n let first = 0, second = 0, copyN = n;\n let point = (m % 2 === 0) ? m : m + 1;\n\n while (copyN !== point/2) {\n if (copyN > point/2) {\n first += copyN - (point/2);\n copyN = point/2;\n }\n if (copyN < point/2) { copyN *= 2; first += 1; }\n }\n first += (m % 2 === 0) ? 1 : 2;\n\n copyN = n;\n while (copyN !== m) {\n if (copyN < m) copyN *= 2;\n else {\n second += copyN - m;\n break;\n }\n second += 1;\n }\n \n return Math.min(first, second);\n}\n\nRL.on('close', () => {\n let [n, m] = input[0].split(' ').map(x => parseInt(x));\n if (n > m) {\n console.log(n - m); return;\n }\n let arr = [n];\n \n let find = 0;\n while (true) {\n const newArr = [];\n for (let i = 0; i < arr.length; i += 1) {\n let x = arr[i];\n if (x - 1 >= parseInt(m/3) ) {\n newArr.push(x - 1);\n if (x - 1 === m) {\n console.log(find+1); return;\n }\n }\n if (x*2 <= m*2) {\n newArr.push(x*2);\n if (x*2 === m) {\n console.log(find+1); return;\n }\n }\n }\n arr = newArr;\n find += 1;\n }\n});", "lang": "Node.js", "bug_code_uid": "30c103afc4e99ed77a1f8f68babf510f", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "376acda94c5e683fa89647b47b0e0cd6", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9760239760239761, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\nlet nums = readline().split(' ');\nlet n = parseInt(nums[0]);\nlet m = parseInt(nums[1]);\n\nminClicks(n, m);\n}\n\n\nfunction minClicks(n, m) {\n let queue = [n];\n let distance = new Map();\n distance.set(n, 0);\n // BFS \n while (queue[0] != m) {\n let cur = queue.shift();\n\n let curDist = distance.get(cur) + 1;\n if (!distance.get(cur - 1) && cur > 0 ) {\n distance.set(cur - 1, curDist);\n queue.push(cur - 1);\n }\n if (!distance.get(cur * 2) && cur < 10000) {\n distance.set(cur * 2, curDist);\n queue.push(cur * 2);\n }\n }\n return distance.get(m);\n}", "lang": "Node.js", "bug_code_uid": "4a1d6fcd8308724cfd8671bd800ce87a", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "f6f1b5d451b192c3c859d795e38fe75f", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7991803278688525, "equal_cnt": 25, "replace_cnt": 15, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 25, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let nums = readline().split(' ');\n let n = parseInt(nums[0]);\n let m = parseInt(nums[1]);\n\n minClicks(n, m);\n}\n\n\nfunction minClicks(n, m){\n\tlet queue = [n];\n\tlet distance = new Map();\n\tdistance.set(n, 0);\n\t// BFS \n\twhile(queue[0] != m){\n\t\tlet cur = queue.shift();\n\tif(!distance.get(cur -1)){\n\tdistance.set(cur - 1, distance.get(cur) + 1);\n\tqueue.push(cur - 1);\n } \n if(!distance.get(cur * 2)){\n\tdistance.set(cur * 2, distance.get(cur) + 1);\n\tqueue.push(cur * 2);\n }\n }\n console.log(distance.get(m));\n}\n", "lang": "Node.js", "bug_code_uid": "e532af7020db9d1972345ae4efc108bc", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "f6f1b5d451b192c3c859d795e38fe75f", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9053030303030303, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "/**\n * Created by ishanarora on 30/11/18.\n */\n\nconst stdin = process.openStdin();\nlet content = ``;\nstdin.addListener('data', d => {\n content += d.toString();\n});\n\nstdin.addListener('end', () => {\n content = content.split(\"\\n\");\n console.log(countrySide(parseInt(content[0]), (content[1].split(\" \"))));\n});\n\nfunction countrySide(count, samples) {\n\n samples.map(Number)\n \n let lastElement = samples.pop();\n\n if (lastElement == 0) {\n return 'UP'\n }\n\n if (lastElement == 15) {\n return 'DOWN'\n }\n\n let secondLast = samples.pop();\n if (secondLast === undefined) {\n return -1;\n }\n\n let initialDecision = 'DOWN'\n\n if (lastElement > secondLast) {\n initialDecision = 'UP';\n }\n\n return initialDecision;\n}\n\n\n", "lang": "Node.js", "bug_code_uid": "16330f1435f40797856ae4b136f17ac6", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "d1c63806286fdb1e0521938837ad5eed", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9620253164556962, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar input= '', readline, print;\n\nprocess.stdin.on('data', function(chunk) {\n input+=chunk;\n});\n\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n print = function(data) {process.stdout.write(data+'\\n')};\n var inputLineIndex = 0;\n readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};\n\n process.exit(main(...input) || 0);\n});\n\nconst even = ['a', 'o', 'u', 'i', 'e'];\n\nfunction minPrice(n, v) {\n var currentPrice = Math.min(v, n - 1);\n var currentLiters = Math.min(v, n - 1);\n\n for(var i = 2; i < n; i++) {\n if(currentLiters > n - i) break;\n\n currentLiters++;\n currentPrice += i;\n }\n\n return currentPrice;\n}\n\nfunction main(n, v) {\n arr = n.split(' ');\n console.log(minPrice(+arr[0], +arr[1]));\n}\n\n// main(\"ninja\");", "lang": "Node.js", "bug_code_uid": "0184d0c4c77810e83276f54aa8d48c0a", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "581fb1d487b59229c571d04ddb32a551", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9894736842105263, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n let [n, v] = d.split(' ').map(Number);\n let ans = Math.min(n, v);\n let price = 1;\n n -= v + 1;\n\n while (n) {\n price++;\n ans += price;\n\n n--;\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "51576fccab82c496a1762d5c0b081bb4", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "87046093e6c67bf282fe60eace7de26b", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9947643979057592, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n let [n, v] = d.split(' ').map(Number);\n let ans = Math.min(n, v);\n let price = 1;\n n -= v + 1;\n\n while (n > 0) {\n price++;\n ans += price;\n\n n--;\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "cdf4b57d1ce2e2995b32a48fc0dad30a", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "87046093e6c67bf282fe60eace7de26b", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8518518518518519, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "readline = require('readline')\nrl = readline.createInterface({\n input: process.stdin\n})\n\nlet lineNum = 0;\nlet n, v;\nrl.on('line', (l) => {\n lineNum++;\n [n, v] = l.split(\" \").map(x => parseInt(x));\n let cost = v;\n let d = v+1;\n let perunitCost = 1;\n while (d < n) {\n perunitCost++;\n cost += perunitCost\n d++\n }\n console.log(cost)\n rl.close()\n})", "lang": "Node.js", "bug_code_uid": "6d2de4898bfc7819e7243796881de07e", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "065704d879facc40f4dfece906183db5", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9969496695475343, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n↑入力 ↓出力');\n\tMain();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n\t};\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var N = nextInt();\n var s = next();\n var ei = 0;\n for(var i = 0; i < N; i++){\n if(s[i] == \"8\"){\n ei++;\n }\n }\n if(ei > 0){\n myout(Math.min(ei, N / 11));\n }else{\n myout(0);\n }\n \n}\n", "lang": "Node.js", "bug_code_uid": "af349679e23f48de3dcde02006346418", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "4e0d53e006b42ea25481cef416da2299", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9954853273137697, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// 131A - cAPS lOCK\n// http://codeforces.com/problemset/problem/131/A\n\nfunction main() {\n let s = read();\n let ans = s;\n if (s.length === 1 || s.substring(1, s.length - 1) === s.substring(1, s.length - 1).toUpperCase()) {\n ans = \"\";\n for (let i = 0; i < s.length; i++) {\n if (s[i] === s[i].toUpperCase()) {\n ans += s[i].toLowerCase();\n } else {\n ans += s[i].toUpperCase();\n }\n }\n }\n writeline(ans);\n return 0;\n}\n\nvar input = \"\";\nvar read;\nvar writeline = (x) => process.stdout.write(x + \"\\n\");\nvar write = (x) => process.stdout.write(x);\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\nprocess.stdin.on(\"data\", (chunk) => input += chunk);\nprocess.stdin.on(\"end\", () => {\n input = input.trim().split(/\\s+/);\n read = () => input.shift();\n process.exit(main() || 0);\n});\n", "lang": "Node.js", "bug_code_uid": "d5e19a281720e153695d23e0b6e910f9", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "111e9f04ec9b96b7ef993ffec6097c22", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8250497017892644, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "let readline = require('readline');\nlet rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\n\nrl.on('line', function(line) {\n\tcapsLock(line);\n\trl.close();\n});\n\nlet capsLock = (input) => {\n\tif (checkStr(input.substring(1))) {\n\t\tconsole.log(input.charAt(0).toUpperCase() + '' + input.substring(1).toLowerCase());\n\t} else {\n\t\tconsole.log(input);\n\t}\n};\n\nlet checkStr = (str) => {\n\treturn str === str.toUpperCase();\n};\n", "lang": "Node.js", "bug_code_uid": "26572be5c7e30b1dacf95cfb51ac2309", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "99bbf30f3828302cf68011a744f474b7", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.98989898989899, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreadline.on('line', line => {\n readline.close(), console.log(capsLocks(line));\n});\nconst capsLocks = (word) => {\n const upperCase = /^[A-ZÑ]+$/g;\n\n if (word.length > 1)\n if (upperCase.test(word))\n return word.toLowerCase();\n else if (upperCase.test(word.slice(1)) && !upperCase.test(word.charAt(0)))\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n else\n return word;\n else\n if (!upperCase.test(word))\n return word.toUpperCase();\n else\n return word;\n}", "lang": "Node.js", "bug_code_uid": "3c3ca9c36085397a483e1d096919ced4", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "5d7e701d1cb4c866679a46a62f4ae8ff", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6315007429420505, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nconst isCapitalize = ch => ch === ch.toUpperCase();\n\nreadLine.on('close', () => {\n const str = input[0];\n let flag = true;\n\n if (str.length === 1) {console.log(str); return}\n\n for (let i = 1; i < str.length; i += 1) if(!isCapitalize(str[i])) flag = false;\n \n if (flag) {\n console.log(str[0].toUpperCase() + str.slice(1).toLowerCase());\n return;\n }\n \n console.log(str);\n});", "lang": "Node.js", "bug_code_uid": "3a626850df4affb5c98e23c86608ae0d", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "0f51423d5114c9d61cd1cf0fb48b78f6", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9179784589892295, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 12, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet inputString = \"\";\n\nprocess.stdin.on(\"data\", (raw_data) => {\n inputString += raw_data;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((line) => {\n return line.trim();\n });\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n/******** Main function*************/\n\nfunction isLowerCase(str) {\n return str == str.toLowerCase() && str != str.toUpperCase();\n}\n\nfunction main() {\n var str = readLine().split(\"\");\n var string = str.join(\"\");\n var Fstr = str[0];\n var EFstr = str.join(\"\").slice(1);\n\n var count = 0;\n\n for (var i = 0; i < str.length; i++) {\n if (isLowerCase(str[i]) == false) {\n count++;\n }\n }\n if (isLowerCase(EFstr) == false && isLowerCase(Fstr)) {\n console.log(Fstr.toUpperCase() + EFstr.toLowerCase());\n } else if (count === str.length) {\n console.log(string.toLowerCase());\n } else {\n console.log(string);\n }\n}\n\n// either it only contains uppercase letters;\n// or all letters except for the first one are uppercase.\n", "lang": "Node.js", "bug_code_uid": "fc4c83c7ae3df64c1fc8dabe79c7a4e1", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "baf13221d9502f2bc8d99e199e026884", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9901768172888016, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet inputString = \"\";\n\nprocess.stdin.on(\"data\", (raw_data) => {\n inputString += raw_data;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((line) => {\n return line.trim();\n });\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n/******** Main function*************/\n\nfunction isLowerCase(str) {\n return str == str.toLowerCase() && str != str.toUpperCase();\n}\n\nfunction main() {\n var str = readLine().split(\"\");\n var string = str.join(\"\");\n var Fstr = str[0];\n var EFstr = str.slice(1);\n\n var count = 0;\n var eFstrCount = 0;\n\n for (var i = 0; i < EFstr.length; i++) {\n if (isLowerCase(EFstr[i]) == false) {\n eFstrCount++;\n }\n }\n\n for (var i = 0; i < str.length; i++) {\n if (isLowerCase(str[i]) == false) {\n count++;\n }\n }\n\n if (eFstrCount == str.length - 1 && isLowerCase(Fstr)) {\n console.log(Fstr.toUpperCase() + EFstr.toLowerCase());\n } else if (count === str.length) {\n console.log(string.toLowerCase());\n } else {\n console.log(string);\n }\n}\n\n// either it only contains uppercase letters;\n// or all letters except for the first one are uppercase.\n", "lang": "Node.js", "bug_code_uid": "be4b729214463fdcc7359546622bdfb4", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "baf13221d9502f2bc8d99e199e026884", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9514563106796117, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let a = readLine();\n if (a.toUpperCase() === a || a[0].toLowerCase() + a.substring(1).toUpperCase() === a) {\n console.log(a[0].toUpperCase() + a.substring(1).toLowerCase());\n } else {\n console.log(a);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "1ba3287c06accc9b386e5b8782cd9fa0", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "f5fb51d0e93c0d7467d42cbf3d416114", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8404533565823888, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.on('line', (inputString) => {\n let numberOfSquares = parseInt(inputString);\n console.log(findTheNumberOfLinesForLady(numberOfSquares));\n process.exit();\n});\n\nfunction findTheNumberOfLinesForLady(forTheNumberOfSquaress) {\n let a = Math.sqrt(forTheNumberOfSquaress);\n if (a * a == forTheNumberOfSquaress) return (a + a);\n let b = Math.trunc(a);\n if (b * (b + 1) >= forTheNumberOfSquaress) return b + b + 1;\n return b + b + 2;\n}", "lang": "Node.js", "bug_code_uid": "f4c61e4ecf806189734d530c8a46f007", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "7755e153fcb875ddd1b08b9c5d5de739", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9972144846796658, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "var input = ''\nprocess.stdin.on('data', c => input += c)\nprocess.stdin.on('end', () => {\n console.log('.' + input.toLowerCase().replace(/[aeiou]|\\W/g, '').replace(/\\B/g, '.'))\n})", "lang": "Node.js", "bug_code_uid": "ac96381018b7d1597f6de4553c44de51", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "d4b49e8d08cc16ab2708b4aa6dcc3281", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9310344827586207, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', line => {\n input.push(line.trim());\n}).on('close', () => {\n const str = line.toLowerCase().slice(' ');\n // console.log(str);\n const remove = 'aoyeui';\n let res = ' ';\n for (let i = 0; i < str.length; i++) {\n if (remove.indexOf(str[i]) < 0) {\n res += '.' + str[i];\n }\n }\n console.log(res);\n});", "lang": "Node.js", "bug_code_uid": "228953727654085c3dc88bd2329bc1f5", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "1bc0565fc371807731748555f80a4efc", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9978118161925602, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction main() {\n\tconst str = readLine()\n\t\t.toLowerCase()\n\t\t.replace(/[aeiou]/gi, '')\n\t\t.split('')\n\t\t.map(char => `.${char}`)\n\t\t.join('');\n\tconsole.log(str);\n}\n", "lang": "Node.js", "bug_code_uid": "22d52995b3e034383985713b176195b8", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "52134f322a70968af8945d448a9e8c2a", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.637883008356546, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "\nprocess.stdin.on('data', input => {\n console.log(formatString(input.trim()));\n});\n\nfunction formatString(str) {\n const vowels = ['a', 'e', 'i', 'o', 'u'];\n const arr = Array.from(str);\n return arr.reduce((acc, curr) => {\n if (!vowels.includes(curr.toLowerCase())) {\n acc.push('.', curr);\n }\n\n return acc;\n }, []).join('')\n}\n", "lang": "Node.js", "bug_code_uid": "963085231751df5b1777d366b4e07dfe", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "0ab28f42a29f995b6226557dec1d41f5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9932705248990579, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const vowels = ['a', 'e', 'i', 'o', 'u'];\nprocess.stdin.on('data', input => {\n console.log(formatString(input.toString().trim()));\n});\n\nfunction formatString(str) {\n const arr = Array.from(str);\n\n return arr.reduce((acc, curr) => {\n curr = curr.toLowerCase();\n if (!vowels.includes(curr)) {\n acc.push('.', curr);\n }\n\n return acc;\n }, []).join('')\n}", "lang": "Node.js", "bug_code_uid": "bd22aa2a409bac0b87ef5ccad3fbb44f", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "0ab28f42a29f995b6226557dec1d41f5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9897435897435898, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet standardInputString = '';\nlet currentLine = 0;\n\nfunction readLine() {\n return standardInputString[currentLine++];\n}\n\nprocess.stdin.on('data', rawData=> {\n standardInputString += rawData;\n})\n\nprocess.stdin.on('end', _ => {\n standardInputString = standardInputString.trim().split('\\n').map(line=> {\n return line.trim();\n })\n main();\n})\n\nfunction main() {\n let line = '';\n line = readLine().toLowerCase();\n const li = Array.from(line).filter(char=> {\n if(char === 'o' || char === 'e' || char === 'i' || char === 'a' || char === 'u') {\n return false;\n } else {\n return true;\n }\n })\n console.log(li.map(char=> '.'+char).join(\"\"));\n}", "lang": "Node.js", "bug_code_uid": "458af9135e3509e05c604f63034a5229", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "b201239c615c51d242bd040b34a61744", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9993777224642191, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet inputString = \"\";\n\nprocess.stdin.on(\"data\", (raw_data) => {\n inputString += raw_data;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((line) => {\n return line.trim();\n });\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n/******** Main function*************/\n\nfunction main() {\n var str = readLine().toLowerCase().split(\"\");\n if (str.length < 100) {\n var strWithoutVowels = [];\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\n for (var i = 0; i < str.length; i++) {\n if (vowels.indexOf(str[i]) < 0) {\n strWithoutVowels.push(\".\" + str[i]);\n }\n }\n console.log(strWithoutVowels.join(\"\"));\n }\n}\n", "lang": "Node.js", "bug_code_uid": "71b284089aecc4b03fa90c6b135f6edd", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "e6e0008503c38fec9cd340a07e3c22e8", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.35603996366939145, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "const stdin = process.openStdin();\n\nprocess.stdin.on('data', function (chunk) {\n lines = chunk.toString().split('\\n');\n lines.map((line, i) => processLine(line, i));\n});\n\nlet meta;\nlet scores;\nlet output = 0;\nfunction processLine(text, i) {\n if (i === 0) {\n meta = text.toString().trim().split(' ');\n } else if (i === 1) {\n scores = text.toString().trim().split(' ').map(each => parseInt(each, 10));\n const border = scores[meta[1] - 1];\n scores.forEach(score => {\n if (score && score >= border) {\n output += 1;\n }\n })\n console.log(output);\n }\n}", "lang": "Node.js", "bug_code_uid": "501cf76eeaa0ad66f3a7fb9b5ecee819", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "1a8b3422dd07bbfe312ba5802a065a9b", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9929453262786596, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let str = readLine().toLowerCase();\n const vowels = { a: \"\", o: \"\", y: \"\", e: \"\", y: \"\", i: \"\" };\n str = str\n .split(\"\")\n .filter((s) => {\n return vowels[s] == undefined;\n })\n .join(\".\");\n console.log(\".\" + str);\n}\n", "lang": "Node.js", "bug_code_uid": "c77a507444b7c271d1bb3ae8aafd00bc", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "739c7fad2fbd14133a7180309155ba85", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5714285714285714, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nprocess.stdin.on('data', (input) => {\n for (const c of input)\n if (!['a', 'o', 'y', 'e', 'u', 'i'].includes(c)) {\n result += `.${c.toLowerCase()}`;\n }\n\n process.stdout.write(result);\n});\n", "lang": "Node.js", "bug_code_uid": "536153465984e21522be1f6e91be2a43", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "2efaf8e09cf9540ac8a34b770ea5c1e5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7205882352941176, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nprocess.stdin.on('data', (input) => {\n let result = '';\n\n for (const c of input.trim())\n if (!['a', 'o', 'y', 'e', 'u', 'i'].includes(c)) {\n result += `.${c.toLowerCase()}`;\n }\n\n process.stdout.write(result);\n});", "lang": "Node.js", "bug_code_uid": "5b77d709d79ff41a969269a7758de2ad", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "2efaf8e09cf9540ac8a34b770ea5c1e5", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7013513513513514, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\n// listCount = new Array(1001).fill(0);\nconst obj = {};\nlet a;\nlet b;\nlet c;\n\nfunction solve(n) {\n if (obj[n]) {\n return obj[n];\n }\n let sum = 0;\n if (n - a >= 0) {\n sum = Math.max(solve(n - a) + 1, sum);\n }\n if (n - b >= 0) {\n sum = Math.max(solve(n - b) + 1, sum);\n }\n if (n - c >= 0) {\n sum = Math.max(solve(n - c) + 1, sum);\n }\n obj[n] = sum;\n return sum;\n}\n\nrl.on('line', (line) => {\n const [n, aa, bb, cc] = line.split(' ').map(Number);\n a = aa;\n b = bb;\n c = cc;\n solve(n);\n console.log(obj[n]);\n});\n", "lang": "Node.js", "bug_code_uid": "278d8eb3708a231cc677d6d684bd3188", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "55b26dcdd3cffc425049813d55ed9d7a", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6198830409356725, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "const mainFunction = (lines) => {\n let n, a, b, c;\n [n, a, b, c] = lines[0].split(\" \").map(Number)\n if (a + b + c == n) console.log(3)\n else if (a + b == n || b + c == n || a + c == n) console.log(2)\n else if ([a, b, c].includes(n)) console.log(1)\n}\n\nconst { EOL } = require('os')\nif (__filename.substr(9, 4) != \"azer\") {\n let yourInputData = ''\n process.stdin.on('data', i => yourInputData += i)\n process.stdin.on('end', () => mainFunction(yourInputData.split(EOL)))\n} else {\n const fileSystem = require(\"fs\");\n mainFunction(fileSystem.readFileSync('input.txt', 'utf8').split(EOL))\n}", "lang": "Node.js", "bug_code_uid": "77c421ff96fe5143f7dab40a33c8a7e7", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "143da7ecbe7cfdc16fd803b1127c19ca", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7711138310893513, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "const mainFunction = (lines) => {\n let n, a, b, c, ans = -1;\n [n, a, b, c] = lines[0].split(\" \").map(Number)\n for (let i = 0; i <= 10e4; i++) {\n for (let j = 0; j <= 10e4; j++) {\n let qwe = n - a * i - b * j;\n ans = (qwe > 0 && qwe % c === 0) ? Math.max(i + j + qwe / c, ans) : ans;\n }\n }\n console.log(ans)\n}\n\nconst { EOL } = require('os')\nif (__filename.substr(9, 4) != \"azer\") {\n let yourInputData = ''\n process.stdin.on('data', i => yourInputData += i)\n process.stdin.on('end', () => mainFunction(yourInputData.split(EOL)))\n} else {\n const fileSystem = require(\"fs\");\n mainFunction(fileSystem.readFileSync('input.txt', 'utf8').split(EOL))\n}", "lang": "Node.js", "bug_code_uid": "328b643af3e081d994118ea4625e8074", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "143da7ecbe7cfdc16fd803b1127c19ca", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9375, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n const [n, a, b, c] = input[0].split(' ').map(x => parseInt(x));\n \n let max = 0;\n for (let i = 0; i <= 4000; i += 1) {\n for (let j = 0; j <= 4000; j += 1) {\n let ax = i*a, by = j*b;\n let z = (n - ax - by);\n\n if (z > 0 && z % c === 0) {\n z /= c;\n if (i + j + z > max) max = i + j + z;\n } \n }\n }\n\n console.log(max);\n \n}); ", "lang": "Node.js", "bug_code_uid": "4eab5f79fd2fba7fa174952db8533924", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "4f19c4395239f0026de2774b00f896bb", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5067087608524072, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "const readline = require('readline')\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nlet input = ''\nrl.on('line', (line) => {\n input += line\n input = input.split(' ').map(x => parseInt(x))\n\n let n = input[0]\n let arr = input.slice(0)\n let memo = {}\n let recur = function (n) {\n if(memo[n] != null) return memo[n]\n if (n < 0) return Number.MIN_SAFE_INTEGER\n if (n === 0) return 0\n let max = 0\n for (let j of arr) {\n max = Math.max(max, 1 + recur(n - j))\n }\n memo[n] = max\n return max\n }\n\n console.log(recur(n))\n})", "lang": "Node.js", "bug_code_uid": "63f1b9618293d74e0b6f694fe054abc1", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "455589c32882ccafb9277eeb2aff1acc", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.45098039215686275, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "let fs = require(\"fs\");\n\n\nlet txt = fs.readFileSync(0, \"utf-8\").split(/[\\r\\n]/).filter(data => data.length > 0);\nfor (let i = 0; i < txt.length; i ++) {\n let info=txt[i].split(\" \").filter(data => data.length > 0).map(data => data * 1);\n doit(info.shift(),info.sort((a,b)=>a-b));\n}\n\nfunction doit(n,tab) {\n let sum=0;\n let m=0;\n while (sum!=n) {\n sum+=tab.shift();\n ++m;\n }\n console.log(sum);\n \n\n}", "lang": "Node.js", "bug_code_uid": "c188f10f89c782e8dcb6dc4fec25f7cd", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "619182ba51aa3fa192186df37b9beb1b", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5677233429394812, "equal_cnt": 21, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 20, "bug_source_code": "let fs = require('fs');\nlet txt = fs.readFileSync(0, \"utf-8\").split(/[\\n\\r]/).filter(data => data.length > 0);\nlet tab;\nfor (let i = 0; i < txt.length; i ++) {\n tab=-Infinity;\n let data=txt[i].split(\" \").filter(data => data.length > 0).map(data => data * 1);\n doit(data.shift(),...data.sort((a,b)=>b-a));\n}\nfunction doit(n,a,b,c) {\n calc(n,a,b,c,0);\n console.log(tab);\n}\nfunction calc(n,a,b,c,index){\n if(n===0){\n if(index>tab)tab=index;\n return;\n }\n ++index;\n if(n>=a)calc(n-a,a,b,c,index);\n if(n>=b)calc(n-b,a,b,c,index);\n if(n>=c)calc(n-c,a,b,c,index);\n}", "lang": "Node.js", "bug_code_uid": "cef499580ab600f5b9290c7aaf95ace8", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "619182ba51aa3fa192186df37b9beb1b", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4186413902053712, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "let fs = require(\"fs\");\n\n\nlet txt = fs.readFileSync(\"input.txt\", \"utf-8\").split(/[\\r\\n]/).filter(data => data.length > 0);\nfor (let i = 0; i < txt.length; i ++) {\n let info=txt[i].split(\" \").filter(data => data.length > 0).map(data => data * 1);a\n doit(info.shift(),info.sort((a,b)=>a-b));\n}\n\nfunction doit(n,tab) {\n let sum=0;\n let m=0;\n while (sum!=n) {\n sum+=tab.shift();\n ++m;\n if(tab.length===0)break;\n }\n console.log(m);\n \n\n}", "lang": "Node.js", "bug_code_uid": "9458f26f6a38e25f857fce32560be4f4", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "619182ba51aa3fa192186df37b9beb1b", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4578478409869774, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "let fs = require('fs');\nlet txt = fs.readFileSync(0, \"utf-8\").split(/[\\n\\r]/).filter(data => data.length > 0);\nlet tab;\nfor (let i = 0; i < txt.length; i ++) {\n tab=[];\n let data=txt[i].split(\" \").filter(data => data.length > 0).map(data => data * 1);\n doit(data.shift(),...data.sort((a,b)=>b-a));\n}\nfunction doit(n,a,b,c) {\n calc(n,a,b,c,0);\n console.log(Math.max(...tab.filter(data=>data[0]===0).map(data=>data[1])));\n}\nfunction calc(n,a,b,c,index){\n if(n=a)calc(n-a,a,b,c,index);\n if(n>=b)calc(n-b,a,b,c,index);\n if(n>=c)calc(n-c,a,b,c,index);\n}", "lang": "Node.js", "bug_code_uid": "e46b11d3b6f446af9d7efc0270d7566b", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "619182ba51aa3fa192186df37b9beb1b", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7577981651376147, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 23, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n const nn = readline();\n var n = nn[0];\n let arr = readline().split(' '); \n n = parseInt(n);\n \n arr = arr.map(ele => parseInt(ele))\n \n console.log(cutRibbon(n, arr));\n}\n\n\nfunction cutRibbon(ribbon, piecesLength){\n let ways = new Array(ribbon + 1).fill(0);\n ways[0] = 1;\n\n for(let piece of piecesLength){\n for(let amt = 1; amt < ribbon + 1; amt++){\n if(piece <= amt){\n ways[amt] += ways[amt - piece];\n }\n }\n }\n return ways[ribbon];\n\n}", "lang": "Node.js", "bug_code_uid": "35088e0146e1a168594b3b0d163211f7", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "207ee66343fd1e104de53bbe5eeb8ec8", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9902335456475584, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n const nn = readline();\n var n = nn[0];\n let arr = nn.split(' ').slice(1); \n n = parseInt(n);\n \n arr = arr.map(ele => parseInt(ele))\n \n console.log(cutRibbon(n, arr));\n}\n\n\nfunction cutRibbon(ribbon, piecesLength) {\n let cuts = new Array(ribbon + 1).fill(0);\n cuts[0] = 0;\n piecesLength.forEach(ele => {\n cuts[ele] = 1;\n });\n\n for(let i = 1; i <= ribbon; i ++) {\n let cur = cuts[i]; \n for(let piece of piecesLength){\n\n \tif(piece <= i){\n \t if(cuts[i - piece] > 0){\n cur = Math.max(cur, 1 + cuts[i - piece]);\t\n \t }\n \t}\n } \n \n cuts[i] = cur;\n } \n return cuts[ribbon];\n\n}\n", "lang": "Node.js", "bug_code_uid": "ad6dcff7eb4fef0e0e662ff9c88870b8", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "207ee66343fd1e104de53bbe5eeb8ec8", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.965587734241908, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n let [m, s] = input[0].split(' ').map(x => parseInt(x));\n if (s === 0 || m*9 < s) {\n if (m === 1 && s === 0)\n console.log(`0 0`);\n else\n console.log(`-1 -1`);\n } else {\n let bigAnswer = [];\n let smallAnswer = [1];\n let smallSumm = s - 1;\n \n if (s <= 9 && m === 1) {\n console.log(`${s} ${s}`); return;\n }\n\n if (s <= 9) {\n bigAnswer.push(s);\n bigAnswer = bigAnswer.concat(Array(m-1).fill(0));\n } else {\n while (s !== 0) {\n if (s - 9 < 0) {\n bigAnswer.push(s); break;\n }\n \n bigAnswer.push(9);\n s -= 9;\n }\n bigAnswer = bigAnswer.concat(Array(m - bigAnswer.length).fill(0));\n }\n\n let smallTmpNums = [];\n while (smallSumm !== 0) {\n if (smallSumm - 9 < 0) {\n smallTmpNums.push(smallSumm); break;\n }\n \n smallTmpNums.push(9);\n smallSumm -= 9;\n }\n\n if (smallTmpNums.length + 1 < m) {\n smallAnswer = smallAnswer.concat(Array( m - (smallTmpNums.length + 1) ).fill(0)).concat(smallTmpNums.reverse());\n } else {\n smallAnswer = smallAnswer.concat(smallTmpNums.reverse());\n }\n \n console.log(`${smallAnswer.join('')} ${bigAnswer.join('')}`)\n }\n}); ", "lang": "Node.js", "bug_code_uid": "a004888aad20c4776f2df1b9735d19f4", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "99f55da9359de28e52707af12c2dc51d", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9978632478632479, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "function main(input) {\n const lines = input.split(EOL);\n const line1 = lines[0].split(' ');\n let n = line1[0] * 1;\n let k = line1[1] * 1;\n \n while (k--) {\n if (n < 3) break;\n n % 10 === 0 ? n /= 10 : --n;\n }\n\n console.log(n);\n}\n\nconst { EOL } = require('os')\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"ascii\");\n_input = \"\";\nprocess.stdin.on(\"data\", (input) => _input += input);\nprocess.stdin.on(\"end\", () => main(_input));", "lang": "Node.js", "bug_code_uid": "29b6ffb5107aa0e26487ca63fb866d78", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "9583021d3e1b89ce5431830d099c39aa", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.3662613981762918, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "// http://codeforces.com/problemset/problem/977/A\nfunction solve(line) {\n let [n, minus] = line.split(' ');\n while (minus--) {\n if(n % 10) n--;\n else n = ~~(n/10);\n }\n return n;\n}\n\n\nif (readline !== undefined) {\n print(solve(readline()));\n} else {\n const assert = require('assert').strict;\n const cases = [\n { in: '512 4', out: '50' },\n { in: '1000000000 9', out: '1' },\n ];\n\n let failed = 0;\n cases.forEach(c => {\n const res = solve(c.in);\n try {\n assert(res.toString() === c.out, 'Expected ' + res + ' to equal ' + c.out);\n } catch (e) { \n failed++;\n print(e.message); }\n });\n if(failed) {\n print(failed + ' failed');\n }else {\n print(\"pass\");\n }\n}\n\nfunction print() {\n console.log(...arguments);\n // process.stdout.write(...args);\n}", "lang": "Node.js", "bug_code_uid": "b21d69d091f8b37c15f7b05d107d71ff", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "316e7a1faad2565fe5a523c72a9cd632", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9962121212121212, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nlet cin='';\nprocess.stdin.on(\"data\",d=>{\n\tcin+=d;\n}).on('end',()=>{\n\tcin = cin.split(\" \");\n\tcin[0] *= 1;\n\tcin[1]*=1;\n\tfor(let i=0;i<(cin[1]);i++){\n\t\tif(cin[0]%10==0)cin[0]/=10;\n\t\telse cin[0]-=1;\n\t\t\n\t\t//if(i==(cin[1])-1)\n\t\t\tprocess.stdout.write(cin[0]+'\\n');\n\n\t}\n})", "lang": "Node.js", "bug_code_uid": "b91ded3ce86e009fa5984854394a5e19", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "117b7683be7f003e2686a958a72a8c9e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8598130841121495, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n\nprocess.stdin.on(\"data\", function(chunk) {\n main(chunk.toString().split(\"\\n\"));\n});\n\nfunction main(stdIn = []) {\n let [num, k] = stdIn[0].split(\" \");\n while (k > 0) {\n k = num % 10 == 0 ? k - 1 : k - (num % 10);\n num = num % 10 == 0 ? num / 10 : num - (num % 10);\n }\n console.log(num);\n}\n", "lang": "Node.js", "bug_code_uid": "fc4d2eca63cfbcdfc341da1602cb1c39", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "2800126f8c219e6014ec474c0727dc0f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.671201814058957, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "function solve(n, k){\n for(var i=0; i {\n input = line.split(' ').map(x => parseInt(x))\n const output = solution(...input)\n console.log(output)\n})\n\nrl.on('close', () => {\n console.log(input)\n})\n\nfunction solution(num, times) {\n let numStr = num.toString()\n for (let i=0; i{\n const input = process.stdin.read().toString().trim();\n let startValue = +input.split(\" \")[0];\n let iterations = +input.split(\" \")[1];\n\n for(let i = 0; i < iterations; i++){\n if(startValue % 10 === 0){\n startValue /= 10;\n }else{\n startValue-=1;\n }\n }\n console.log(startValue);\n\n})", "lang": "Node.js", "bug_code_uid": "62b84928e87be4d512a2c6e787f5792d", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "2e93c3a37f9bb0a60c75666aa2e634e9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8578016910069177, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "var readline = require('readline');\nvar rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\n\nrl.on('line', function(line) {\n var l = line.split(' ');\n var num = l[0];\n var count = +l[1];\n function ws(num, c) {\n if (c === 0) {\n console.log(num);\n } else {\n var n = (''+num).split('');\n if (n[n.length-1] == 0) {\n n[n.length-1] = ''\n } else if (n[n.length-1] == 1){\n n[n.length-1] = '0';\n } else {\n n[n.length-1] = 1;\n }\n ws(n.join(''), c-1);\n }\n }\n ws(num, count);\t\n\trl.close();\n});\n", "lang": "Node.js", "bug_code_uid": "b478b157fcfd05886dec4d7d58a5cbd2", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "fddbd0319c4088760d8ce78f19246125", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9396984924623115, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n logic(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction output(x) {\n process.stdout.write(x); // without auto '\\n' (newline)\n //console.log(x); // with auto '\\n' (newline)\n}\n\n\nfunction logic() {\n const line = readline();\n \n const params = line.split(' ');\n const number = parseInt(params[0]);\n const iterations = parseInt(params[1]);\n \n let result = number;\n for (let i=1; i <= iterations; i++) {\n let lastNum = parseInt(String(result)[result.length-1]);\n if (lastNum > 0) {\n result--;\n }\n else {\n result /= 10;\n }\n }\n\n output(result);\n}", "lang": "Node.js", "bug_code_uid": "50cbf27c38e075f4b0921123b81455d3", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "19a9f3017c9176b82cc2c9f30a244385", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8997020854021847, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "let fs = require('fs');\nlet txt = fs.readFileSync(0, 'utf-8').split(\"\\r\\n\").filter(data => {\n return data.length > 0\n});\ntxt.shift()\nfor (let index = 0; index < txt.length; index ++) {\n let info=txt[index].split(\" \")\n subs(info[0]*1,info[1]*1)\n\n}\nfunction subs(num,count){\n let tab=String(num).split(\"\");\n while (count>0) {\n if(tab[tab.length-1]==0){\n tab.pop();\n }else{\n --tab[tab.length-1];\n }\n --count;\n }\n console.log(tab.join(\"\")); \n}", "lang": "Node.js", "bug_code_uid": "1d4ce33f902b24f1ba72eaa53d0a4c88", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "53481b13f88f5f3c64111141bda6af62", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8004895960832313, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "var input='';\n\nprocess.stdin.on('data',givenInput=>{\n input+=givenInput;\n})\n\nprocess.stdin.on('end',()=>{\n main(input);\n})\n\nconst main=(input)=>{\n let num=Number(input.split(' ')[0]);\n const k=Number(input.split(' ')[1]);\n \n for(let i=0;i {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n var [n, k] = readLine().split(\" \").map(Number);\n if (n % 10 === 0) {\n for (let i = 0; i < k; i++) {\n n = n / 10;\n // console.log(\"n1\", n);\n }\n } else {\n for (let i = 0; i < k; i++) {\n if (n % 10 === 0) {\n n = n / 10;\n } else {\n n = n - 1;\n }\n }\n }\n console.log(n);\n}\n", "lang": "Node.js", "bug_code_uid": "31f707291c52c88955c55dcefe9a567b", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "2188c58e3b236c34610585150c8d7a1c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5648021828103683, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "\"use strict\";\n\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n// single line input\nreadline.on('line', line => {\n const arr = line.split(' ').map(el => Integer.parseInt(el));\n\n readline.close(), console.log(arr);\n});\n\n", "lang": "Node.js", "bug_code_uid": "d12a52750cac9e63800936fe2d7b04d2", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "081bba1abc1b045f419dd7939c8b6306", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9977728285077951, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\n\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n// single line input\nreadline.on('line', line => {\n readline.close();\n const arr = line.split(' ').map(Number);\n let n = arr[0];\n let k = arr[1];\n while (--k) {\n const rem = n % 10;\n if (rem != 0) { \n --n; \n } else {\n n /= 10;\n }\n }\n console.log(n);\n});\n", "lang": "Node.js", "bug_code_uid": "5bca56f383b900e03d7a78f67a35781c", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "081bba1abc1b045f419dd7939c8b6306", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.978328173374613, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question('Provide the arguments', (answer) => {\n const argumentsArray = answer.split(' ');\n let number = argumentsArray[0];\n const times = argumentsArray[1];\n\n for(i = 0; i < times; i++){\n if(number % 10 == 0) {\n number /= 10;\n } else {\n number--;\n }\n }\n\n console.log(number);\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "843b877055b6b56d9db152ff71154936", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "5bd18613c9265be6e5350ccb5920250d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9973333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadline.on('line', line => input.push(line));\n\nreadline.on('close', () => {\n const [year] = input;\n \n for (i = parseInt(year) + 1; i < 9000; i++) {\n let y = i.toString();\n let l = y.length;\n\n let ll = y.split('').filter((val, index, arr) => {\n return arr.indexOf(val) === index;\n }).length;\n\n if(l === ll) {\n console.log(i);\n break;\n }\n }\n});", "lang": "Node.js", "bug_code_uid": "fab2ce6d07195f0e5e200220f7dd9cb3", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "03059d1abba8613100403dde366105c4", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9422512234910277, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\nvar debug = typeof v8debug === 'object' || /--debug|--inspect/.test(process.execArgv.join(' '));\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n // if(Array.isArray(inputString)) inputString = inputString.join('\\n');\n inputString += inputStdin;\n // inputString = inputString.trim().split('\\n').map(string => {\n // return string.trim();\n // });\n \n // main(); \n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction readAsInt(){\n return parseInt(readline());\n}\n\nfunction readAsIntList(){\n return readline().trim().split(' ').filter(i => i).map(i => parseInt(i));\n}\n\n\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n let year = readline().trim().split('').filter(i => i).map(i => parseInt(i));\n const Year1 = [...year].join('') * 1;\n const getNextYear = (y,x, list) => {\n for(let i = y[x]; i<=9; i++) {\n if(!list.includes(i)){\n y[x] = i;\n if(x<3){\n let yy = getNextYear(y,x+1,[...list, i]);\n if(yy) {\n return yy;\n }else{\n y[x+1] = 0;\n }\n }else if(y.join('') * 1 > Year1){\n return y.join('') * 1;\n }\n }\n }\n }\n console.log(getNextYear(year,0,[]));\n}\n \n\n\n", "lang": "Node.js", "bug_code_uid": "635cd8b43915083b329c917af19c225c", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "42c0ba224fb8d06ada394c53a0d278d3", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9934282584884995, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet inputString = \"\";\n\nprocess.stdin.on(\"data\", (raw_data) => {\n inputString += raw_data;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((line) => {\n return line.trim();\n });\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n/******** Main function*************/\n\nfunction main() {\n var n = +readLine();\n\n function isDistinctDigits(year) {\n var arr = (\"\" + year).split(\"\");\n if (\n arr[0] !== arr[1] &&\n arr[0] !== arr[2] &&\n arr[0] !== arr[3] &&\n arr[1] !== arr[2] &&\n arr[1] !== arr[3] &&\n arr[2] !== arr[3]\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n for (var i = n + 1; i <= 9000; i++) {\n if (isDistinctDigits(i)) {\n console.log(i);\n break;\n }\n }\n}\n", "lang": "Node.js", "bug_code_uid": "0a23622cc711eef23e3b818270943c5a", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "f5291d446f22051fa177f3e15e7c7ef1", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7441860465116279, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 18, "bug_source_code": "let fs = require('fs');\n \nlet txt = fs.readFileSync(0, \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0;\n});\nfor (let index = 0; index < txt.length; index++) {\n doit(String(txt[index]*1+1));\n}\n \nfunction doit(num) {\n while (true) {\n let test=false;\n for (let i =num.length-1 ; i>0; i--) {\n if(num[i]==num[i-1]){\n test=true;\n num=String(++num);\n break;\n }\n \n }\n if(!test){\n break;\n }\n }\n console.log(num);\n \n}", "lang": "Node.js", "bug_code_uid": "000e097882695652159fa643794faad0", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "61aeff41ce2fef86b4013fc3deb9d51c", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7361319340329835, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "let fs = require('fs');\n\nlet txt = fs.readFileSync(\"input.txt\", \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0;\n});\nfor (let index = 0; index < txt.length; index++) {\n doit(txt[index]*1+1);\n}\n\nfunction doit(num) {\n let tab = String(num).split(\"\");\n while (true) {\n let test = true;\n for (let index = tab.length - 1; index >= 0; index--) {\n if (tab.indexOf(tab[index]) != index) {\n test = false;\n tab = String(tab.join(\"\") * 1 + Math.pow(10, tab.length - index - 1)).split(\"\");\n break;\n }\n }\n if (test) {\n break;\n }\n }\n console.log(tab.join(\"\"));\n}", "lang": "Node.js", "bug_code_uid": "8c448603c8a6a251e028fb6af0cd974c", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "61aeff41ce2fef86b4013fc3deb9d51c", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9881710646041856, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n input: process.stdin\n})\n\nrl.on('line', line => {\n const [a, b] = line.split(' ').map(v => parseInt(v, 10))\n solve(a, b)\n})\n\nfunction solve(a, b) {\n if (a == b) { console.log(0); return; }\n\n const m = {}\n if (b > a) {\n const t = a; a = b; b = t;\n }\n const ma = { [a]: 0 }\n const mb = { [b]: 0 }\n\n const qa = [[a, 0]]\n const qb = [[b, 0]]\n\n let min = Infinity;\n while (true) {\n if (qa.length) {\n const [aa, sa] = qa.shift()\n\n for (const d of [2,3,5]) {\n if (aa%d == 0) {\n const r = aa/d\n if (mb[r]) { min = Math.min(mb[r]+sa+1, min); } \n if (!ma[r]) { qa.push([r, sa+1]) }\n ma[r] = ma[r] || (sa+1); \n }\n }\n }\n\n if (qb.length) {\n\n const [bb, sb] = qb.shift()\n for (const d of [2,3,5]) {\n if (bb%d == 0) {\n const r = bb/d\n if (ma[r]) { min = Math.min(ma[r]+sb+1, min); }\n if (!mb[r]) { qb.push([r, sb+1]) }\n mb[r] = mb[r] || (sb+1);\n }\n }\n }\n\n if (isFinite(min)) { console.log(min); return; }\n\n if (!qa.length && !qb.length) { console.log(-1); return; }\n\n }\n}\n\n", "lang": "Node.js", "bug_code_uid": "ee14e6f89755297ab9210f95643d7710", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "6b1ab5095def1ca5cb12db1a15c567c4", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9956140350877193, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on(\"line\", (answer) => {\n\trl.close();\n\tconsole.log(/[QR9]/g.test(answer) ? \"YES\" : \"NO\");\n});\n", "lang": "Node.js", "bug_code_uid": "10864003a17d097a6c8ac582b7559a53", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "757dce8d1d0652aba7ac69330f8da58e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9785932721712538, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const str = readLine();\n let countPlus = 0;\n const nums = str.split(\"\").reduce((obj, char) => {\n if (char - char === 0) obj[char] = char;\n return obj;\n }, {});\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === \"+\") countPlus++;\n }\n\n Object.keys(nums).forEach((key) => {\n nums[key] = +nums[key] + countPlus;\n });\n\n if (str.includes(\"H\") || str.includes(\"Q\") || str.includes(\"9\") || Object.values(nums).includes(9)) {\n console.log(\"YES\");\n } else {\n console.log(\"NO\");\n }\n}\n", "lang": "Node.js", "bug_code_uid": "2a3679cd1bb478abadc11e2ca330322b", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "a72fd5842d50931d28d4c523c4366ddf", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9962962962962963, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (str) => {\n if (/[HQ0-9]/.test(str)) {\n console.log('YES');\n }\n else {\n console.log('NO');\n }\n});\n", "lang": "Node.js", "bug_code_uid": "1c2f72b88b64555bd177b5016770d0c3", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "0d3322e27153cc63a3919d0cc8db6d9f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9785714285714285, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\nreadLine.on('close', () => {\n let str = input[0];\n\n for (let i = 0; i < str.length; i += 1) {\n if (str[i] === 'H' || str[i] === 'Q' || str[i] === '9' || str[i] === '+') {\n console.log('YES'); process.exit();\n }\n }\n\n console.log('NO');\n});", "lang": "Node.js", "bug_code_uid": "53df5ea817964775923facfbd628adf5", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "8963de0708356a5e8760805d4111f54d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.992822966507177, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nlet secondLine = false;\n\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet inputs = [];\n\n\n\nrl.on('line', lineInput => {\n inputs.push(lineInput);\n})\n\n// Read Inputs\nrl.on('close', () => {\n const line1 = inputs[0].split(' ');\n const songs = inputs[1].split(' ');\n const D = parseInt(line1[1].split(' ')[0]);\n let spareTime = 0;\n let neededDurationForSongs = 0;\n for (let i = 0; i < songs.length; i++) {\n neededDurationForSongs += parseInt(songs[i]);\n }\n\n spareTime = (songs.length - 1) * 10;\n\n if (neededDurationForSongs + spareTime > D)\n return console.log(-1)\n\n let durationsForJokes = D - neededDurationForSongs;\n\n return console.log(durationsForJokes / 5)\n});", "lang": "Node.js", "bug_code_uid": "e7f34fc478bbd08b7ef4ee2773afe97c", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "a15d3624f44351b96c25f3132c6e26de", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9990059642147118, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\"use strict\";\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet inputString = \"\";\nlet currentLine = 0;\n\nprocess.stdin.on(\"data\", (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\nfunction main() {\n let matrix = [];\n for(let i=0;i<5;i++){\n matrix.push(readline()\n .split(\"\")\n .map((x) => +x));\n }\n\n \n \n beautifulMatrix(matrix);\n}\n\nfunction beautifulMatrix(matrix) {\n for (let row = 0; row < matrix.length; row++) {\n for (let column = 0; column < matrix[row].length; column++) {\n if (matrix[row][column] == 1) {\n console.log(Math.abs(2 - row) + Math.abs(2 - column));\n return Math.abs(2 - row) + Math.abs(2 - column);\n }\n }\n }\n}", "lang": "Node.js", "bug_code_uid": "4e5abaccca36fc0bde1601d82dc951e0", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "0f24d73c4376262fb9a2d69efcebf98a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.952112676056338, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\n// Read Inputs\nrl.on('line', lineInput => {\n inputs.push(lineInput)\n})\n\nrl.on('close', () => {\n\n let arr = [];\n let bestPosition = [2, 2];\n\n for (let i = 0; i < inputs.length; i++) {\n const subArr = inputs[i].split(' ');\n arr.push(subArr);\n }\n\n // Get The position of 1\n let currentPositon = [];\n for (let i = 0; i < arr.length; i++) {\n\n for (let j = 0; j < arr[i].length; j++) {\n if (arr[i][j] == 1)\n currentPositon.push(i, j);\n }\n }\n\n // Get the max number that needs minimum steps\n\n let minimumSteps = 0\n\n if (currentPositon.toString() != bestPosition.toString()) {\n const rowSteps = currentPositon[0] - bestPosition[0];\n const colSteps = currentPositon[1] - bestPosition[1];\n minimumSteps = Math.abs(rowSteps + colSteps);\n }\n\n console.log(minimumSteps);\n\n})", "lang": "Node.js", "bug_code_uid": "a51a5381aafe4e2d61852bd0550c48b9", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "fc877ea16fc1a1f8406f2ff0f80051c1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8248062015503876, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "const readline = require('readline')\n \nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet count = 0;\nconst matrix = [];\n\n\nrl.on('line', line => {\n makeMatrix(line);\n count ++;\n l(count);\n if (count >= 5) {\n console.log(solution(matrix));\n }\n});\n\n\nfunction makeMatrix(line) {\n const row = line.split(' ').map(char => Number(char));\n matrix.push(row);\n}\n\n\nfunction solution(matrix) {\n// Get the matrix from the input and put it into a data structure\n// Count the minimum number needed to make the matrix beautiful\n const index = getIndex(matrix);\n return (Math.abs(2 - index[0]) + Math.abs(2 - index[1]));\n\n}\n\n\n// Finds and returns the index of '1'\nfunction getIndex(matrix) {\n let x = 0, y = 0;\n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix.length; j++) { \n if (matrix[i][j] === 1) {\n return [i, j];\n }\n }\n }\n}\n", "lang": "Node.js", "bug_code_uid": "f10fc093dde10b83550cb1978c02459f", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "642ab68cebc4cfa6036e5bcd8bcb17b0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8394793926247288, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "// Interface of codeforces.com\nlet stdin = process.stdin;\nstdin.setEncoding('utf8');\n\n\nstdin.on('line', line => {\n makeMatrix(line);\n count ++;\n if (count >= 5) {\n console.log(solution(matrix));\n }\n});\n\n\nfunction makeMatrix(line) {\n const row = line.split(' ').map(char => Number(char));\n matrix.push(row);\n}\n\n\nfunction solution(matrix) {\n// Get the matrix from the input and put it into a data structure\n// Count the minimum number needed to make the matrix beautiful\n const index = getIndex(matrix);\n return (Math.abs(2 - index[0]) + Math.abs(2 - index[1]));\n\n}\n\n\n// Finds and returns the index of '1'\nfunction getIndex(matrix) {\n let x = 0, y = 0;\n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix.length; j++) { \n if (matrix[i][j] === 1) {\n return [i, j];\n }\n }\n }\n}\n", "lang": "Node.js", "bug_code_uid": "46c3392dca60793c39b95500d2ce210b", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "642ab68cebc4cfa6036e5bcd8bcb17b0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9602385685884692, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n\t input: process.stdin,\n\t output: process.stdout,\n\tterminal : false\n});\n\n\nrl.on(\"line\", main)\nlet i = 0;\nlet n = 0;\nlet m = []\nfunction main(input){\n\t\n\tm.push(input.split(' '))\n\ti++\n\tif(i < 5){\n\t\treturn\n\t}\n\n\tconsole.log(m)\n\tconsole.log(m[1][4])\n\t\n\tlet x = 0\n\tlet y = 0\n\tfor(var j = 0; j < 5; j++){\n\t\tfor(var k = 0 ; k < 5; k++){\n\t\t\tif(m[j][k] === \"1\"){\n\t\t\t\ty = j\n\t\t\t\tx = k\n\t\t\t}\n\t\t}\n\t}\n\t\n\tconsole.log(Math.abs((x+1)-3) + Math.abs((y+1)-3))\n}\n", "lang": "Node.js", "bug_code_uid": "63686b15045b25be9affb12b479bb9ff", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "8e684e61a80910811a6c35813e6782cf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.97789566755084, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "// https://codeforces.com/problemset/problem/263/A\n\nfunction main(stdin) {\n const matrix = stdin.map(row => row.split(' ').map(Number))\n let y = 0; let x = 0\n\n while(matrix[y][x] !== 1)\n if(x < 5) { x++ }\n else { x = 0; y++ }\n\n process.stdout.write(Math.abs(((y - 2) * -1) + (x - 2)) + '')\n}\n\n// Handle standard input\nprocess.stdin.resume()\nprocess.stdin.setEncoding('utf-8')\n\nlet inputString = ''\n\nprocess.stdin.on('data', (inputStdin) => inputString += inputStdin)\nprocess.stdin.on('end', () =>\n main(inputString.trim().split('\\n').map(s => s.trim())))\n", "lang": "Node.js", "bug_code_uid": "41ea7a4e24fce9865a4e7ba52b3fc478", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "aa31b0a5dbb01f842902143b86d73426", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9902222222222222, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\nconst matrix = () => {\n let oneStringRow;\n let oneColumn;\n let steps;\n for (let i = 0; i < input.length; i++) {\n if (input[i].includes('1')) {\n oneStringRow = i;\n oneColumn = input[i].indexOf('1') / 2;\n }\n }\n steps = Math.abs(2 - oneStringRow) + Math.abs(2 - oneColumn);\n console.log(steps);\n readLine.on('close', matrix);\n\n};", "lang": "Node.js", "bug_code_uid": "1d0bab130893db30285b0a70f2680600", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "a229f836d7e10da065b0cad66993bc5a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9467787114845938, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "var stdin = process.openStdin();\n\nstdin.addListener(\"data\", function(d) {\n const arr = d.toString().trim().split(\" \");\n console.log(findg(parseInt(arr[0]), parseInt(arr[1])));\n });\n \n function findg(n, m){\n if(n === m){\n return 0;\n } else if(m === 0){\n return 1;\n }\n m--;\n let gcount = 1;\n for(let i = 0; i < m; i++){\n if(n === 0 || n === 1){\n gcount--;\n } else {\n gcount++;\n n-=2;\n }\n }\n return gcount;\n }", "lang": "Node.js", "bug_code_uid": "2c0e19c6e466221613c7d306549c8315", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "ce8df17ff915e9c5fad1fa84a68dd057", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.910699919549477, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar SumOfBase = function (N, base) {\n ans = 0;\n while (N != 0) {\n ans += N % base;\n num = parseInt(N / base);\n }\n return ans;\n}\n\nvar GCD = function (a, b) {\n if (a == 0)\n return b;\n return GCD(a, b % a);\n}\n\nrl.on('line', (input) => {\n var n = parseInt(input);\n var ans = 0;\n \n for (let i = 2; i < n; i++)\n ans += SumOfBase(n, i);\n \n console.log(\"%d/%d\",ans / GCD(ans, n - 2), n - 2 / GCD(ans, n - 2));\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "51d1fa214e5705bf26ca85b1cb7d68bb", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "fb4f932c36472eeca1a7bf67cdfea1d2", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8756641870350691, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar counter = 0;\nvar n = 0;\n\nrl.on(\"line\", input => {\n n = parseInt(input);\n for (var i = 2; i < n; i++) {\n var item = n;\n while (n != 0) {\n counter += n % i;\n n = parseInt(n / i);\n }\n n = item;\n }\n console.log(counter + \"/\" + (n - 2));\n rl.close();\n});\n", "lang": "Node.js", "bug_code_uid": "812d1fb089d2f265c21faa18d2d80c23", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "2b3ba60dc933cd57bc35f104a4d69421", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8055077452667814, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "function main() {\n // write code here:\n\n}\n\nconst readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nvar stdin = [];\nrl.on('line', function (line) {stdin.push(line);});\nrl.on('close', main);", "lang": "Node.js", "bug_code_uid": "3e64f4c64a259094f8424e3f66f48d43", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "9aa52fb237c27c28ab8052c2c1980823", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8275862068965517, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n let ans = [0, 1, 5];\n let inc = 3;\n\n for (let i = 3; i <= +d; i++) {\n inc += 2;\n let v = inc * inc - i * 4;\n ans[i] = v;\n }\n\n console.log(ans[+d]);\n});\n", "lang": "Node.js", "bug_code_uid": "b85ae4b8d64471d07b813ddbc17a315c", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "9db8ab1776e2ac5d74c7149c45b7ad09", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9944954128440368, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', (employees) => {\n let teamLeaders = ways = 0;\n for (let index = 1; index < employees; index++) {\n if (teamLeaders >= employees) {\n console.log(ways);\n return rl.close();\n } else if ((employees - index) % (teamLeaders + index) === 0) {\n teamLeaders += index;\n employees -= index;\n ways += 1;\n index -= 1;\n }\n }\n console.log(ways);\n return rl.close();\n});", "lang": "Node.js", "bug_code_uid": "f703095abeab39793436934aeae0c2e2", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "cd4d0fe30f271fc2a5d4dd6bb675282e", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9439601494396015, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\nreadLine.on('line', line => input.push(line));\n\n\nreadLine.on('close', () => {\n const [n] = input[0].split(' ').map(x => parseInt(x));\n let answer = 1;\n\n for (let i = 1; i < n/2; i += 1) {\n let ost = n - i;\n\n if (ost % i === 0) answer += 1;\n }\n\n console.log(answer)\n}); ", "lang": "Node.js", "bug_code_uid": "f760431aa9c4921b5ed8a07777c2d378", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "33bc36a81de748bfeb433e677b90dc25", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6959669079627715, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "const readline = require('readline');\n\nlet inputs = [];\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\n// Read Inputs\nrl.on('line', inputLine => {\n const n = parseInt(inputLine);\n\n if (n >= 0) {\n return console.log(n)\n } else {\n let digits = Math.abs(n).toString().split('');\n const lastNum = digits[digits.length - 1];\n const numBeforeLast = digits[digits.length - 2];\n if (lastNum > numBeforeLast) {\n digits = digits.splice(0, digits.indexOf(lastNum))\n } else {\n const temp = digits.slice(0);\n const idxBeforeLast = temp.length - 2;\n temp.splice(idxBeforeLast, 1)\n return console.log(`-${temp.join('')}`)\n }\n\n return console.log(`-${digits.join('')}`)\n\n }\n\n});", "lang": "Node.js", "bug_code_uid": "6ad6bc182f4a666c79bd21eacd4cae3a", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "dcec5c33b70f22ff74a8b5e40c2cc5f8", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.4548422198041349, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (d) => {\n if (d === '-10') {\n console.log('0');\n return;\n }\n\n const n = [...d];\n const a = +d;\n const b = +(n.slice(0, n.length - 2).join('') + n.slice(n.length - 1).join(''));\n const c = +(n.slice(0, n.length - 1).join(''));\n const ans = Math.max(a, b, c);\n\n console.log(ans);\n\n});\n", "lang": "Node.js", "bug_code_uid": "4cbfff44201ef451e4a375321ff91a6d", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "2d18e0a7e030bcf7715948a3a96ec7c5", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9884704073789393, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on(\"line\", (line) => {\n if (line > 0) console.log(parseInt(line));\n else {\n line = line.split(\"\");\n if (line.length == 2) console.log(0);\n else {\n if (line[line.length - 1] > line[line.length - 2]) {\n line.pop();\n line = line.join(\"\");\n console.log(parseInt(line));\n } else {\n let save = line.pop();\n line.pop();\n line.push(save);\n line = line.join(\"\");\n console.log(parseInt(line));\n }\n }\n }\n});\n\nrl.on(\"close\", () => {});\n", "lang": "Node.js", "bug_code_uid": "56a97a867aeda53b8bc9c5d420f830cc", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "d2dc23b578eee9acb149003ba5099748", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9965317919075144, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "//96A\nconst readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.question('', (answer) => {\n rl.close()\n let team1 = 0\n let team2 = 0\n let array = answer.split(\"\")\n let i = 1\n array.forEach(function(player) {\n \n if (player == 0) {\n team2 = 0\n team1++\n if (team1 == 7) {\n if (!i == 0) {\n console.log(\"YES\")\n i == 0\n\n }\n }\n } else {\n team2 ++\n team1 = 0\n if (team2 == 7) {\n if (!i == 0) {\n console.log(\"YES\")\n i==0\n }\n \n \n }\n }\n })\n if (!i == 0) {\n console.log(\"NO\")\n }\n \n});", "lang": "Node.js", "bug_code_uid": "02afe04b68eacf8016e76552c0661f5e", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "ba1e5d880c1b5ec82ccfcf2779ebf3d6", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.35706462212486306, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "const readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\nreadline.question(\"\",(ans)=>{\n var teamA=0; //team 0\n var teamB=0; //team 1\n var lastWord=ans[0];\n for (let i = 1; i < ans.length; i++) {\n const word=ans[i];\n word!=lastWord\n ? (ResetTeam(),word==0?++teamA:++teamB)\n : word==0\n ? ++teamA\n : ++teamB;\n\n lastWord=word;\n\n if(teamA>=7||teamB>=7){\n break;\n }\n }\n\n teamA>=7||teamB>=7\n ? console.log(\"YES\")\n : console.log(\"NO\");\n readline.close();\n \n function ResetTeam(){\n teamA=0;\n teamB=0;\n }\n})", "lang": "Node.js", "bug_code_uid": "08239f3403db949c55e9bd9c15cd08cb", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "7fe322591532c46de93cd2b1c4418d84", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9527458492975734, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const str = readLine();\n let [count0, count1] = [0, 0];\n let [max0, max1] = [0, 0];\n\n for (let i = 0; i < str.length; i++) {\n const num = +str[i];\n\n if (num === 0) {\n count0++;\n max1 = Math.max(count1, max1);\n count1 = 0;\n } else {\n count1++;\n max0 = Math.max(count0, max0);\n count0 = 0;\n }\n }\n if (max0 >= 7 || max1 >= 7) console.log(\"YES\");\n else console.log(\"NO\");\n}\n", "lang": "Node.js", "bug_code_uid": "f1c16455314afa784df79bb8d3ca9a34", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "f2648554dc768f923e6e69fb9674c923", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7754189944134078, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (str) => {\n let count = 1;\n let ans = 'NO';\n\n for (let i = 1; i < str.length; i++) {\n if (str[i] === str[i - 1]) {\n count++;\n }\n else {\n if (count >= 7) {\n ans = 'YES';\n break;\n }\n\n count = 1;\n }\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang": "Node.js", "bug_code_uid": "61185bd47b36a69081f770b4e18df31b", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "4f08d8d4a49102be9a236e6f99648384", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5719882468168462, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "//var print = require('lol-io').print\n//var readline = require('lol-io').readline\n\nlet input = readline();\nlet counter = 0;\nlet result = \"NO\";\n\nfor (let i = 0; i < input.length; i++) {\n if (input[i] === input[i + 1]) {\n counter++;\n } else if (input[i] !== input[i + 1]) {\n counter = 0;\n } \n \n if (counter === 7) {\n result = 'YES';\n break;\n } else {\n result = 'NO';\n }\n}\n\nprint(result);", "lang": "Node.js", "bug_code_uid": "64b7e5ab7a0760f5387d3cf963177bc7", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "3ce6f03ac3bc7faa05d49e1ffcf4fef7", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9965337954939342, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline').createInterface({input: process.stdin})\nconst assert = require('assert')\n\nreadline.on(\"line\", line => {\n let counter = 0;\n let result = \"NO\";\n let input = line;\n for (let i = 0; i < input.length; i++) {\n if (input[i] === input[i + 1]) {\n counter++;\n } else if (input[i] !== input[i + 1]) {\n counter = 0;\n } \n \n if (counter === 7) {\n result = 'YES';\n break;\n } else {\n result = 'NO';\n }\n }\n console.log(result);\n});\n", "lang": "Node.js", "bug_code_uid": "c92fc9c4087fe81bd6507a8c575679f4", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "3ce6f03ac3bc7faa05d49e1ffcf4fef7", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9641833810888252, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf-8')\nlet inputs = \"\"\nprocess.stdin.on('data', rawData => inputs += rawData)\nprocess.stdin.on('end', _ => {\n inputs = inputs.trim().split('').map(line => parseInt(line))\n main()\n})\nfunction main() {\n let playersNumber = 0\n let team = 0\n let shouldExit = false\n let result = \"NO\"\n inputs.map(i => {\n if (playersNumber === 7) {\n result = \"YES\"\n shouldExit = true\n return;\n }\n if (shouldExit)\n return;\n if (i !== team){\n team = i\n playersNumber = 0\n }\n playersNumber++\n })\n console.log(result)\n}\n", "lang": "Node.js", "bug_code_uid": "c32d127e414dce492f3879b8001bd212", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "6b19697481665f83da423e3ab0baf894", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.967032967032967, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nprocess.stdin.on('data', (input) => {\n const isDanger = () => {\n let team, count;\n\n for (let i = 0; i < input.length; i++) {\n team = input[i];\n count = 1;\n\n while (input[++i] === team && i < input.length - 1) count++;\n\n if (count > 6) return 'YES';\n }\n\n return 'NO';\n };\n\n process.stdout.write(isDanger());\n});", "lang": "Node.js", "bug_code_uid": "e5163e852e5e1d34482f0e158fcb9917", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "3d722de3ff561b086e2289a88ef6f464", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9944491887275833, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n');\n var start = Date.now();\n Main();\n var end = Date.now() - start;\n myerr('time : ' + end + 'ms');\n myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var N = nextInt();\n var list = nextIntArray();\n var map = {0:[list[0]]};\n for(var i = 1; i < N; i++){\n \tvar key = Object.keys(map);\n \tvar isOK = false;\n \tfor(var j = 0; j < key.length; j++){\n \t\tif(map[key[j]].indexOf(list[i]) == -1){\n \t\t\tisOK = true;\n \t\t\tmap[key[j]].push(list[i]);\n \t\t}\n \t}\n \tif(!isOK){\n \t\tmap[key.length] = [list[i]];\n \t}\n }\n myout(Object.keys(map).length);\n}", "lang": "Node.js", "bug_code_uid": "f6ce8781efcf5d125c4d9ebc97c59bb7", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "1fff0e9808ac3b83e113fb1ff5cfd88e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9975261655566128, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "var line_number = 0\nconst cs = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar lines = {}\ncs.on(\"line\", (input) => {\n if (input == '') {\n cs.close()\n }\n lines[line_number] = input.split(\" \")\n line_number += 1\n}).on('close', () => {\n main()\n process.exit()\n})\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/)\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i)\n}\nfunction isInt(str) {\n return str.length === 1 && !isNaN(str)\n}\n\nfunction print(str) {\n console.log(str)\n}\n\nfunction predict(test) {\n let op=''\n let ops=[]\n let opVariables = [];\n let limits = []\n for (let t of test) {\n // console.log(t);\n for(let i=0; i0 && isOp(t[i-1])) ) {\n op = t[i]\n let j = i + 1\n for(; j [o, opVariables[i]])\n\n for(let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1]\n } else {\n print(\"input error\");\n process.exit();\n }\n }\n}\n\nvar m;\nvar n;\nfunction main() {\n m = parseInt(lines[0][0], 10)\n n = parseInt(lines[0][1], 10)\n\n predict([\"1<=m {\n if (input == '') {\n cs.close()\n }\n}).on('close', () => {\n main()\n process.exit()\n})\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/)\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i)\n}\nfunction isInt(str) {\n return str.length === 1 && !isNaN(str)\n}\n\nfunction print(str) {\n console.log(str)\n}\n\nfunction predict(test) {\n let op=''\n let ops=[]\n let opVariables = [];\n let limits = []\n for (let t of test) {\n // console.log(t);\n for(let i=0; i0 && isOp(t[i-1])) ) {\n op = t[i]\n let j = i + 1\n for(; j [o, opVariables[i]])\n\n for(let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1]\n } else {\n print(\"input error\");\n process.exit();\n }\n }\n}\n\nvar m;\nvar n;\nfunction main() {\n m = parseInt(lines[0][0], 10)\n n = parseInt(lines[0][1], 10)\n\n predict([\"1<=m {\n\tlet M = line.charAt(0) * 1;\n\tlet N = line.charAt(2) * 1;\n\t// 2*1\n\tlet num1 = M % 2 === 0 ? M / 2 : (M - 1) / 2;\n\tif (num1 === M / 2) {\n\t\tconsole.log(num1 * N);\n\t} else {\n\t\tconsole.log(num1 * N + Math.floor(N / 2));\n\t}\n};\n", "lang": "Node.js", "bug_code_uid": "5f6a66ef52e9e2c105a4345cb81c650f", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "ef9eebdbd2607159e1c6380f71613f57", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9976689976689976, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// http://codeforces.com/problemset/problem/977/A\nmodule.exports = solve;\nfunction solve(line) {\n let [a, b] = line.split(' ').map(n => parseInt(n, 10));\n return ~~(a * b / 2);\n}\n\n\nconst rl = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nlet i = 0;\nrl.on('line', (line) => {\n if (i++) {\n console.log(solve(line))\n rl.close();\n }\n});", "lang": "Node.js", "bug_code_uid": "a31abbcf73cd536be8e798c31fdaea84", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "10eea26773b8fd8cfe7a5bfd1af75c3d", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9797191887675507, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n// read each line\nrl.on(\"line\", (lineInput) => {\n let params = lineInput.split(\" \");\n Math.floor((params[0] * params[1]) / 2);\n});\n\n// when all file readed\nrl.on(\"close\", () => {});\n", "lang": "Node.js", "bug_code_uid": "e7094ce4797acb7588f65218c7c3fd8d", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "ffd499bda4bcc71758259925df494e0f", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9872340425531915, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "if (process.argv[2] === \"test\") {\n solve([\"3 7\"]);\n} else {\n let i = \"\";\n process.stdin.on(\"data\", (c) => (i += c));\n process.stdin.on(\"end\", () => {\n const { EOL } = require(\"os\");\n const lines = i.split(EOL);\n\n solve(lines);\n });\n}\n\nfunction solve(lines) {\n const [m, n] = lines[0].split(\" \");\n console.log(Math.ceil((m * n) / 2));\n}\n", "lang": "Node.js", "bug_code_uid": "9bd95a4994a858b621a01bc2353ee03b", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "ea0028a9737789c9d68c65c8157eb84d", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9903691813804173, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let input1 = readline().split(' ');\n let m = parseInt(input1[0]);\n let n = parseInt(input[1]);\n\n maxNumDominoes(m, n)\n};\n\nfunction maxNumDominoes(n, m){\n\n console.log(Math.floor(n * m ) / 2)\n}", "lang": "Node.js", "bug_code_uid": "72b19754c5a2dbcfa80715c92ecf6817", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "670f11dae5016d3aea6b81b26208a668", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9976057462090981, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let input1 = readline().split(' ');\n let m = parseInt(input1[0]);\n let n = parseInt(input1[1]);\n \n maxNumDominoes(m, n)\n};\n\nfunction maxNumDominoes(n, m){\n\n console.log(Math.floor(n * m ) / 2);\n}", "lang": "Node.js", "bug_code_uid": "6c8ae44cd93a0e573eeaeaa69a724800", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "670f11dae5016d3aea6b81b26208a668", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9984567901234568, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n↑入力 ↓出力');\n Main();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n var a = one[0];\n var b = one[1];\n var c = one[2];\n var output = a * 2 + Math.min(b, c) * 2;\n if(b != c){\n output++;\n }\n myout(output);\n}\n", "lang": "Node.js", "bug_code_uid": "9181c977955b0bcb52268cfe8cfac9dd", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "ec18ec2003635983bdf20ddef915a9d4", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9568106312292359, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', inputStd => inputString += inputStd);\nprocess.stdin.on('end', () => {\n inputString = inputString.trim().split('\\n').map(str => str.trim());\n main();\n});\nlet readLine = () => inputString[currentLine++];\n\nfunction solve(){\n let a,b, ans = \"\";\n a = readLine();\n b = readLine();\n for(let i = 0; i < a.length; i++){\n if(a[i] === b[i])\n ans = '0' + ans;\n else ans = '1' + ans;\n }\n console.log(ans);\n}\n\nfunction main(){\n solve();\n}\n\n\n", "lang": "Node.js", "bug_code_uid": "6a130688c9447915f00e286902378c2f", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "7a6061c06b1d2d5676e22d258d5ce514", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9811320754716981, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction isPrime(x) {\n\tlet s = Math.sqrt(x);\n\tlet i = 2;\n\twhile (i <= s) {\n\t\tif (x % i === 0) {\n\t\t\treturn false;\n\t\t}\n\t\ti++;\n\t}\n\treturn true;\n}\n\nfunction main() {\n\tlet s1 = readLine().split(''),\n\t\ts2 = readLine().split(''),\n\t\tres = s1.map((d, i) => (d === '1' || s2[i] === '1' ? '1' : '0'));\n\tconsole.log(res.join(''));\n}\n", "lang": "Node.js", "bug_code_uid": "b9b849d31d6dcf2b9c97b36609297bce", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "f0fe9a76fe0719edf03b31b0078d09ca", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9934711643090316, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let firstNumberString = readLine();\n let secondNumberString = readLine();\n let finalStringArray = [];\n for (let i = 0; i < firstNumberString.length; i++) {\n if (firstNumberString[i] !== secondNumberString[i]) {\n finalStringArray.push('1');\n } else {\n finalStringArray.push('0');\n }\n }\n let finalString = finalStringArray.map(Number);\n let finalNumber = finalString.join('');\n console.log(finalString);\n}\n", "lang": "Node.js", "bug_code_uid": "fbc4daf3a0e6a653e61a909a903c8a8a", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "4a4714a8f308c99cc9e66729fa2d9627", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8093023255813954, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n// Write your code here\nfunction nameLookUp(str) {\n let inputs = str.trim().split('\\n');\n let num = Number('0b' + inputs[0].trim() ^ '0b' + inputs[1].trim()).toString(2);\n let zeros = inputs[0].trim().length - num.length;\n num = '0'.repeat(zeros) + num;\n return num.toString();\n}\n", "lang": "Node.js", "bug_code_uid": "f1414d8b29b7bfc68eb01c45b479574c", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "c44959e0d9188bb3f067f01b8bd15ec5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.3894878706199461, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "var data = [];\n\ndata.push(readline());\n\nfunction sum(n) {\n return n.split('').map(function (d) {\n return parseInt(d);\n }).reduce(function (s, d) {\n return s + d;\n });\n}\n\nfunction solve() {\n var n1 = data[0];\n var s1 = sum(n1);\n var first = parseInt(n1[0]) - 1;\n var l = n1.length - 1;\n var newN = '9'.repeat(l);\n if (first !== 0) {\n newN = first + newN;\n }\n var s2 = sum(newN);\n print(s2 > s1 ? newN : n1);\n}\n\nsolve();", "lang": "JavaScript", "bug_code_uid": "242399223956806221c31eb494fbbe30", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "bc82015d1381c08e15bbf39e48c895a2", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.4510693454309786, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "var data = [];\n\ndata.push(readline());\n\nfunction sum(n) {\n return n.split('').map(function (d) {\n return parseInt(d);\n }).reduce(function (s, d) {\n return s + d;\n });\n}\n\nfunction solve() {\n var n1 = data[0];\n if (n1.length === 1) {\n return print(n1);\n }\n var s1 = sum(n1);\n var first = parseInt(n1[0]) - 1;\n var l = n1.length - 1;\n var newN = '9'.repeat(l);\n if (first !== 0) {\n newN = first + newN;\n }\n var s2 = sum(newN);\n print(s2 > s1 ? newN : n1);\n}\n\nsolve();", "lang": "JavaScript", "bug_code_uid": "7f0a6264ec09762a69175e2918ad0a41", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "bc82015d1381c08e15bbf39e48c895a2", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.39198218262806234, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "var x = +readline();\n\nfunction findMax(n) {\n\tvar digits = (\"\" + n).split(\"\"),\n\t\tcurrentSum = getDigitsSum(digits),\n\t\tnextNumber = +((digits[0] - 1) + (new Array(digits.length)).join(\"9\")),\n\t\tnextSum = getDigitsSum(nextNumber);\n\n\tif(currentSum > nextSum) return n;\n\tif(currentSum < nextSum) return nextNumber;\n\treturn Math.max(n, nextNumber);\n}\n\nfunction getDigitsSum(digits) {\n\tif(!Array.isArray(digits)) digits = (\"\" + digits).split(\"\");\n\treturn digits.reduce(function (sum, n) {\n\t\treturn sum + 1*n;\n\t}, 0);\n}\n\nprint(findMax(x));", "lang": "JavaScript", "bug_code_uid": "376b90c62a72aba51582a51ff7829ad4", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "da403aaa011b9eeceb115afcd875fe3b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9989769820971867, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar check = function (s) {\n var n = s.length;\n if (n == 0 || n > 16)\n return false;\n console.log(\"inside function s=%s n=%d\",s,n);\n for (let i = 0; i < n; i++) {\n if (!(s[i] >= 'A' && s[i] <= 'Z' ||\n s[i] >= 'a' && s[i] <= 'z' ||\n s[i] >= '0' && s[i] <= '9' ||\n s[i] == '_'))\n return false;\n }\n return true;\n}\n\nvar CheckHostName = function (HostName) {\n var N = HostName.length\n if (N == 0 || N > 32)\n return false;\n\n var Host = HostName.split(\".\");\n for (let i = 0; i < Host.length; i++) {\n if (!check(Host[i]))\n return false;\n }\n \n /*\n HostName.split('.').forEach(element => {\n if (!check(element))\n return false;\n });\n */\n\n return true;\n}\n\nrl.on('line', (input) => {\n let IsUser = false, IsHost = false, IsResource = false;\n let AtIndex = input.indexOf('@');\n if (AtIndex != -1) {\n var UserName = input.substring(0, AtIndex);\n IsUser = check(UserName);\n var SlashIndex = input.indexOf(\"/\");\n /*\n if (SlashIndex != -1)\n var HostName = input.substring(AtIndex + 1, SlashIndex - AtIndex - 1);\n else\n var HostName = input.substring(AtIndex + 1);\n */\n var HostName = (SlashIndex != -1)? input.substring(AtIndex + 1, SlashIndex): input.substring(AtIndex + 1);\n IsHost = CheckHostName(HostName);\n if (SlashIndex == -1)\n IsResource = true;\n else{\n var Resource = input.substring(SlashIndex + 1);\n IsResource = check(Resource);\n }\n }\n console.log(\"input=%s IsUser=%s IsHost=%s IsResource=%s\",input, IsUser , IsHost , IsResource)\n console.log((IsUser && IsHost && IsResource) ? \"YES\" : \"NO\");\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "3b68110b20a56fb6add3595ca76f481b", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "49e86d157d10dfd5cda0f2069544a7ad", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9712351945854484, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\nfunction check(s) {\n let sLen = s.length;\n if (sLen == 0 || sLen > 16)\n return false;\n\n for (let i = 0; i < sLen; i++) {\n if (!(s[i] >= 'a' && s[i] <= 'z' ||\n s[i] >= 'A' && s[i] <= 'Z' ||\n s[i] >= '0' && s[i] <= '9' ||\n s[i] == '_')) return false;\n }\n\n return true;\n}\n\nfunction checkHost(hostName) {\n let hostLen = hostName.length;\n if (hostLen == 0 || hostLen > 32)\n return false;\n var tokens = hostName.split('.');\n for (let i = 0; i < tokens.length; i++)\n if (!check(tokens[i])) return false;\n\n return true;\n}\n\n\n\nvar isUser = false, ishost = false, isResource = false;\nrl.on('line', (input) => {\n\n\n let atIndx = input.indexOf('@');\n if (atIndx != -1) {\n let userName = input.substring(0, atIndx);\n isUser = check(userName);\n let slashIndx = input.indexOf('/');\n let hostName = (slashIndx != -1) ? input.substring(atIndx + 1, slashIndx) : input.substring(atIndx);\n ishost = checkHost(hostName);\n\n if (slashIndx == -1) isResource = true;\n else {\n let resource = input.substring(slashIndx + 1);\n isResource = check(resource);\n }\n\n }\n\n\n console.log((isUser && ishost && isResource) ? \"YES\" : \"NO\");\n rl.close();\n});", "lang": "Node.js", "bug_code_uid": "5666c368b6a0ed225321aeefbb9a86ea", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "f6e87067ddde023a530c82dc0290a6b8", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9997446047758907, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/* big.js v3.1.1 https://github.com/MikeMcl/big.js/LICENCE */\n (function(global){\"use strict\";var DP=20,RM=1,MAX_DP=1e6,MAX_POWER=1e6,E_NEG=-7,E_POS=21,P={},isValid=/^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Big;function bigFactory(){function Big(n){var x=this;if(!(x instanceof Big)){return n===void 0?bigFactory():new Big(n)}if(n instanceof Big){x.s=n.s;x.e=n.e;x.c=n.c.slice()}else{parse(x,n)}x.constructor=Big}Big.prototype=P;Big.DP=DP;Big.RM=RM;Big.E_NEG=E_NEG;Big.E_POS=E_POS;return Big}function format(x,dp,toE){var Big=x.constructor,i=dp-(x=new Big(x)).e,c=x.c;if(c.length>++dp){rnd(x,i,Big.RM)}if(!c[0]){++i}else if(toE){i=dp}else{c=x.c;i=x.e+i+1}for(;c.length1?c[0]+\".\"+c.join(\"\").slice(1):c[0])+(i<0?\"e\":\"e+\")+i:x.toString()}function parse(x,n){var e,i,nL;if(n===0&&1/n<0){n=\"-0\"}else if(!isValid.test(n+=\"\")){throwErr(NaN)}x.s=n.charAt(0)==\"-\"?(n=n.slice(1),-1):1;if((e=n.indexOf(\".\"))>-1){n=n.replace(\".\",\"\")}if((i=n.search(/e/i))>0){if(e<0){e=i}e+=+n.slice(i+1);n=n.substring(0,i)}else if(e<0){e=n.length}for(i=0;n.charAt(i)==\"0\";i++){}if(i==(nL=n.length)){x.c=[x.e=0]}else{for(;n.charAt(--nL)==\"0\";){}x.e=e-i-1;x.c=[];for(e=0;i<=nL;x.c[e++]=+n.charAt(i++)){}}return x}function rnd(x,dp,rm,more){var u,xc=x.c,i=x.e+dp+1;if(rm===1){more=xc[i]>=5}else if(rm===2){more=xc[i]>5||xc[i]==5&&(more||i<0||xc[i+1]!==u||xc[i-1]&1)}else if(rm===3){more=more||xc[i]!==u||i<0}else{more=false;if(rm!==0){throwErr(\"!Big.RM!\")}}if(i<1||!xc[0]){if(more){x.e=-dp;x.c=[1]}else{x.c=[x.e=0]}}else{xc.length=i--;if(more){for(;++xc[i]>9;){xc[i]=0;if(!i--){++x.e;xc.unshift(1)}}}for(i=xc.length;!xc[--i];xc.pop()){}}return x}function throwErr(message){var err=new Error(message);err.name=\"BigError\";throw err}P.abs=function(){var x=new this.constructor(this);x.s=1;return x};P.cmp=function(y){var xNeg,x=this,xc=x.c,yc=(y=new x.constructor(y)).c,i=x.s,j=y.s,k=x.e,l=y.e;if(!xc[0]||!yc[0]){return!xc[0]?!yc[0]?0:-j:i}if(i!=j){return i}xNeg=i<0;if(k!=l){return k>l^xNeg?1:-1}i=-1;j=(k=xc.length)<(l=yc.length)?k:l;for(;++iyc[i]^xNeg?1:-1}}return k==l?0:k>l^xNeg?1:-1};P.div=function(y){var x=this,Big=x.constructor,dvd=x.c,dvs=(y=new Big(y)).c,s=x.s==y.s?1:-1,dp=Big.DP;if(dp!==~~dp||dp<0||dp>MAX_DP){throwErr(\"!Big.DP!\")}if(!dvd[0]||!dvs[0]){if(dvd[0]==dvs[0]){throwErr(NaN)}if(!dvs[0]){throwErr(s/0)}return new Big(s*0)}var dvsL,dvsT,next,cmp,remI,u,dvsZ=dvs.slice(),dvdI=dvsL=dvs.length,dvdL=dvd.length,rem=dvd.slice(0,dvsL),remL=rem.length,q=y,qc=q.c=[],qi=0,digits=dp+(q.e=x.e-y.e)+1;q.s=s;s=digits<0?0:digits;dvsZ.unshift(0);for(;remL++remL?1:-1}else{for(remI=-1,cmp=0;++remIrem[remI]?1:-1;break}}}if(cmp<0){for(dvsT=remL==dvsL?dvs:dvsZ;remL;){if(rem[--remL]digits){rnd(q,dp,Big.RM,rem[0]!==u)}return q};P.eq=function(y){return!this.cmp(y)};P.gt=function(y){return this.cmp(y)>0};P.gte=function(y){return this.cmp(y)>-1};P.lt=function(y){return this.cmp(y)<0};P.lte=function(y){return this.cmp(y)<1};P.sub=P.minus=function(y){var i,j,t,xLTy,x=this,Big=x.constructor,a=x.s,b=(y=new Big(y)).s;if(a!=b){y.s=-b;return x.plus(y)}var xc=x.c.slice(),xe=x.e,yc=y.c,ye=y.e;if(!xc[0]||!yc[0]){return yc[0]?(y.s=-b,y):new Big(xc[0]?x:0)}if(a=xe-ye){if(xLTy=a<0){a=-a;t=xc}else{ye=xe;t=yc}t.reverse();for(b=a;b--;t.push(0)){}t.reverse()}else{j=((xLTy=xc.length0){for(;b--;xc[i++]=0){}}for(b=i;j>a;){if(xc[--j]0){ye=xe;t=yc}else{a=-a;t=xc}t.reverse();for(;a--;t.push(0)){}t.reverse()}if(xc.length-yc.length<0){t=yc;yc=xc;xc=t}a=yc.length;for(b=0;a;){b=(xc[--a]=xc[a]+yc[a]+b)/10|0;xc[a]%=10}if(b){xc.unshift(b);++ye}for(a=xc.length;xc[--a]===0;xc.pop()){}y.c=xc;y.e=ye;return y};P.pow=function(n){var x=this,one=new x.constructor(1),y=one,isNeg=n<0;if(n!==~~n||n<-MAX_POWER||n>MAX_POWER){throwErr(\"!pow!\")}n=isNeg?-n:n;for(;;){if(n&1){y=y.times(x)}n>>=1;if(!n){break}x=x.times(x)}return isNeg?one.div(y):y};P.round=function(dp,rm){var x=this,Big=x.constructor;if(dp==null){dp=0}else if(dp!==~~dp||dp<0||dp>MAX_DP){throwErr(\"!round!\")}rnd(x=new Big(x),dp,rm==null?Big.RM:rm);return x};P.sqrt=function(){var estimate,r,approx,x=this,Big=x.constructor,xc=x.c,i=x.s,e=x.e,half=new Big(\"0.5\");if(!xc[0]){return new Big(x)}if(i<0){throwErr(NaN)}i=Math.sqrt(x.toString());if(i===0||i===1/0){estimate=xc.join(\"\");if(!(estimate.length+e&1)){estimate+=\"0\"}r=new Big(Math.sqrt(estimate).toString());r.e=((e+1)/2|0)-(e<0||e&1)}else{r=new Big(i.toString())}i=r.e+(Big.DP+=4);do{approx=r;r=half.times(approx.plus(x.div(approx)))}while(approx.c.slice(0,i).join(\"\")!==r.c.slice(0,i).join(\"\"));rnd(r,Big.DP-=4,Big.RM);return r};P.mul=P.times=function(y){var c,x=this,Big=x.constructor,xc=x.c,yc=(y=new Big(y)).c,a=xc.length,b=yc.length,i=x.e,j=y.e;y.s=x.s==y.s?1:-1;if(!xc[0]||!yc[0]){return new Big(y.s*0)}y.e=i+j;if(ai;){b=c[j]+yc[i]*xc[j-i-1]+b;c[j--]=b%10;b=b/10|0}c[j]=(c[j]+b)%10}if(b){++y.e}if(!c[0]){c.shift()}for(i=c.length;!c[--i];c.pop()){}y.c=c;return y};P.toString=P.valueOf=P.toJSON=function(){var x=this,Big=x.constructor,e=x.e,str=x.c.join(\"\"),strL=str.length;if(e<=Big.E_NEG||e>=Big.E_POS){str=str.charAt(0)+(strL>1?\".\"+str.slice(1):\"\")+(e<0?\"e\":\"e+\")+e}else if(e<0){for(;++e;str=\"0\"+str){}str=\"0.\"+str}else if(e>0){if(++e>strL){for(e-=strL;e--;str+=\"0\"){}}else if(e1){str=str.charAt(0)+\".\"+str.slice(1)}return x.s<0&&x.c[0]?\"-\"+str:str};P.toExponential=function(dp){if(dp==null){dp=this.c.length-1}else if(dp!==~~dp||dp<0||dp>MAX_DP){throwErr(\"!toExp!\")}return format(this,dp,1)};P.toFixed=function(dp){var str,x=this,Big=x.constructor,neg=Big.E_NEG,pos=Big.E_POS;Big.E_NEG=-(Big.E_POS=1/0);if(dp==null){str=x.toString()}else if(dp===~~dp&&dp>=0&&dp<=MAX_DP){str=format(x,x.e+dp);if(x.s<0&&x.c[0]&&str.indexOf(\"-\")<0){str=\"-\"+str}}Big.E_NEG=neg;Big.E_POS=pos;if(!str){throwErr(\"!toFix!\")}return str};P.toPrecision=function(sd){if(sd==null){return this.toString()}else if(sd!==~~sd||sd<1||sd>MAX_DP){throwErr(\"!toPre!\")}return format(this,sd-1,2)};Big=bigFactory();if(typeof define===\"function\"&&define.amd){define(function(){return Big})}else if(typeof module!==\"undefined\"&&module.exports){module.exports=Big}else{global.Big=Big}})(this);\n\nvar tmp = readline().split(' ');\nvar n = new Big(tmp[0]);\nvar m = new Big(tmp[1]);\nif(n.lte(m)) {\n print(n);\n} else {\n n.RM = 3;\n print(n.minus(m).minus(1).times(8).plus(9).sqrt().times(0.5).minus(1.5).round().plus(1).plus(m).toString());\n}", "lang": "JavaScript", "bug_code_uid": "03851879f9090c16d5993df8c20bac75", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "a197ec6b01e59256af48f28d5c2e14e0", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.04799801044516289, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "var n = new Big(tmp[0]);\nvar m = new Big(tmp[1]);\nif(n.lte(m)) {\n print(n);\n} else {\n n.RM = 3;\n print(n.minus(m).minus(1).times(8).plus(9).sqrt().times(0.5).minus(1.5).round().plus(1).plus(m).toString());\n}", "lang": "JavaScript", "bug_code_uid": "0d0a10267e634b00b4066dce788ccdba", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "a197ec6b01e59256af48f28d5c2e14e0", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.996520226185298, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "var line_number = 0;\nconst cs = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nvar lines = {};\ncs.on(\"line\", (input) => {\n if (input == \"\") {\n cs.close();\n }\n lines[line_number] = input.split(\" \");\n line_number += 1;\n}).on(\"close\", () => {\n main();\n process.exit();\n});\n\nfunction isOp(str) {\n return str.length === 1 && str.match(/[<=>]/);\n}\nfunction isChr(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}\nfunction isInt(str) {\n return str.length === 1 && str.match(/[0-9*]/);\n}\n\nfunction print(str) {\n console.log(str);\n}\n\nfunction exit(status = 0) {\n process.exit(status);\n}\n\nfunction predict(test) {\n let op = \"\";\n let ops = [];\n let opVariables = [];\n let limits = [];\n for (let t of test) {\n // console.log(t);\n for (let i = 0; i < t.length; i++) {\n if (isOp(t[i])) {\n op = t[i];\n if (isOp(t[i + 1])) {\n op += t[i + 1];\n i += 1;\n }\n ops.push(op);\n op = \"\";\n } else if (isChr(t[i])) {\n // console.log(t[i])\n op = t[i];\n for (var j = i + 1; j < t.length; j++) {\n if (isChr(t[j]) || isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n opVariables.push(op);\n op = \"\";\n } else {\n if (i == 0 || (i > 0 && isOp(t[i - 1]))) {\n op = t[i];\n let j = i + 1;\n for (; j < t.length; j++) {\n if (isInt(t[j])) {\n op += t[j];\n i = j;\n } else break;\n }\n limits.push(op);\n op = \"\";\n }\n }\n }\n }\n\n let min = limits[0];\n let max = limits[1];\n\n let pvs = ops.map((o, i) => [o, opVariables[i]]);\n\n for (let pv of pvs) {\n if (pv[1] == undefined) {\n pv[1] = max;\n }\n // print(`${min} ${pv[0]} ${pv[1]} ?`)\n if (eval(`${min}${pv[0]}${pv[1]}`)) {\n // print(` ${min} ${pv[0]} ${pv[1]} true`)\n min = pv[1];\n } else {\n print(\"input error\");\n exit();\n }\n }\n}\n\nvar n;\nfunction main() {\n x = BigInt(lines[0][0])\n predict([\"1<=x<=10**15\"]);\n\n let S=0,e=0,o=0\n if (x%2n == 0) {\n e = (x*x+2n*x)/4n\n o = (x*x)/4n\n }\n else\n {\n e = ((x-1n)*(x-1n)+2n*(x-1n))/4n\n o = ((x+1n)*(x+1n))/4n\n }\n\n print(e-o)\n\n}\n", "lang": "Node.js", "bug_code_uid": "3be1a4dddfe02d0eade4847b8196cfc9", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "0a8c47c732802e6eaba78a717a1f8b03", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6677115987460815, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nlet ans = 0;\n\nrl.on('line', (d) => {\n for (let i = 1; i <= +d; i++) {\n if (i % 2 !== 0) {\n ans -= i;\n }\n else {\n ans += i;\n }\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "45dc239280900bf77f4483a0fcdb4e26", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "b19a84008d44859ce5c36289f2aa2b57", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9853181076672104, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nlet ans = 0;\n\nrl.on('line', (d) => {\n let n = +d;\n\n if (n % 2 === 0) {\n ans = n / 2;\n }\n else {\n ans = - (n / 2);\n }\n\n console.log(ans);\n});\n", "lang": "Node.js", "bug_code_uid": "ef984e042b92b78c4bf7e6e27a66fe25", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "b19a84008d44859ce5c36289f2aa2b57", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8961593172119487, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "const readLine = require('readline')\nconst rl = readLine.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n\nrl.question('', (line) => {\n n = parseInt(line) \n main()\n})\n\nlet wynik = 0\n\nfunction main() {\n for (let i = 1; i<=n; i++) {\n if (i % 2 === 0){\n wynik += i \n } else\n wynik += -1*i\n }\n console.log(wynik)\n rl.close()\n}", "lang": "Node.js", "bug_code_uid": "177dd269f17c793501658900a4f817cb", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "f35d5a9fa44347c40e8e62e29344148b", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7629955947136564, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf8')\n\nlet currentLine = 0\nlet inputString = ''\n\nprocess.stdin.on('data', chunk => {\n inputString += chunk\n})\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(line => {\n return line.trim()\n })\n main()\n})\n\nfunction readLine() {\n return inputString[currentLine++]\n}\n\nfunction main() {\n const n = parseInt(readLine());\n let sum = 0\n for(let i = 1; i <= n; i++) {\n if(i % 2 === 0) {\n sum += i\n } else if(i % 2 !== 0) {\n sum -= i\n }\n }\n\n console.log(sum)\n}", "lang": "Node.js", "bug_code_uid": "d4e215c3520eaf59b29433ed8e469937", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "25d7881527e63d9e6c3488be0d21dbcb", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6175637393767706, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf8')\n\nlet currentLine = 0\nlet inputString = ''\n\nprocess.stdin.on('data', chunk => {\n inputString += chunk\n})\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(line => {\n return line.trim()\n })\n main()\n})\n\nfunction readLine() {\n return inputString[currentLine++]\n}\n\nfunction main() {\n const x = parseInt(readLine());\n let odd = 0\n let even = 0\n let tEven = 0\n let tOdd = 0\n\n if (x % 2 === 0) {\n tEven = parseInt(x / 2)\n tOdd = parseInt(x / 2)\n } else if (x % 2 !== 0) {\n tOdd = parseInt(x / 2) + 1\n tEven = parseInt(x / 2)\n }\n\n odd = seriesSum(tOdd, -1, -2)\n even = seriesSum(tEven, 2, 2)\n\n console.log(even + odd)\n}\n\nfunction seriesSum(n, a, d) {\n return (n * ((2 * a) + ((n - 1) * d))) / 2\n}", "lang": "Node.js", "bug_code_uid": "647d79cf524ec91e6b2579cd9c6e65f6", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "25d7881527e63d9e6c3488be0d21dbcb", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6656298600311042, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "let fs = require('fs');\n\nlet txt = fs.readFileSync(0, \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0;\n});\n\nfor (let i = 0; i < txt.length; i++) {\n doit(txt[i]*1);\n}\n\nfunction doit(n) {\n let pnt=-1,sum=0;\n for (let i = 1; i <= n; i++) {\n sum+=i*pnt;\n pnt*=-1;\n }\n console.log(sum);\n \n}", "lang": "Node.js", "bug_code_uid": "ae5616d4dd92463dc459bceeed13b745", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "d436ee666dcb7284405d7b38e3a28f89", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9807692307692307, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "let fs = require('fs');\n\nlet txt = fs.readFileSync(\"input.txt\", \"utf-8\").split(\"\\r\\n\").filter(data => {\n return data.length > 0;\n});\n\nfor (let i = 0; i < txt.length; i++) {\n doit(txt[i]*1);\n}\n\nfunction doit(n) {\n if(n%2===0){\n console.log(n/2);\n }else{\n console.log((n+1)/2*-1);\n }\n \n}", "lang": "Node.js", "bug_code_uid": "b42ee52b5e57e7d4aa6d4e024ba25c29", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "d436ee666dcb7284405d7b38e3a28f89", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8031306441902468, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n// Write your code here\nfunction nameLookUp(str) {\n let inputs = +str.trim();\n let sum = 0;\n for (let i = 1; i < inputs; i++) {\n sum += (i % 2 === 0 ? i : -i);\n }\n sum += Math.pow(-1, inputs) * inputs;\n return sum.toString();\n}\n", "lang": "Node.js", "bug_code_uid": "ae905271597a416a580cf9c754851c0a", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "8c9253ecb5eb61d1c2ec128c916c1aa6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8545150501672241, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let n = parseInt(readLine());\n let ans = 0;\n for (var i = 1; i <= n; i++) {\n ans += Math.pow(-1, i) * i\n }\n console.log(ans);\n}", "lang": "Node.js", "bug_code_uid": "47b977dc497cda65cd1c71b7cfb12bdf", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "2da01d94fb02448fb1afcb81e8ad1909", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.609271523178808, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout,\n\tterminal: false\n});\n\nrl.on('line', function(line){\n\tconst b = parseInt(line);\n\tlet counter = 0;\n\tfor (let i = 1; i <= b / 2; i++) {\n\t\tif (b % i === 0) { counter++ }\n\t}\n\tconsole.log(counter + 1);\n\trl.close();\n});\n", "lang": "Node.js", "bug_code_uid": "c4d464896b851e2a8215d144ef36b79e", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "fa1efe0248aa2513759b532b2d229a11", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9829268292682927, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout,\n\tterminal: false\n});\n\nrl.on('line', function(line){\n\tconst b = parseInt(line);\n\tlet counter = 0;\n\tconst sqrt = Math.sqrt(b)\n\tfor (let i = 2; i < sqrt; i++) {\n\t\tif (b % i === 0) { counter += 2; }\n\t}\n\tif (sqrt % 1 === 0) { counter++; }\n\tconsole.log(counter + 2);\n\trl.close();\n});\n", "lang": "Node.js", "bug_code_uid": "b931b4a965877759a188b4020326cbfb", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "fa1efe0248aa2513759b532b2d229a11", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9985443959243085, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf-8')\n\nvar arr = ''\nprocess.stdin.on('data', (i) => {\n arr += i\n})\n\nprocess.stdin.on('end', () => {\n const n = parseInt(arr)\n const sq = Math.sqrt(n)\n let k = 0\n for(let i = 1; i < sq; i++) {\n if(n % i == 0) {\n if(n / i == i) k ++\n else k +=2\n }\n }\n console.log(k)\n\n})", "lang": "Node.js", "bug_code_uid": "50f3685148a75751009cff17d18d5513", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "7a3d5087f749330f8cee088c1d0d74c0", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9989440337909187, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar idx = 0;\n\nvar line1 = \"\";\nvar line2 = \"\";\n\nrl.on(\"line\", (theLine) => {\n if (idx == 0)\n line1 = theLine.toString().toUpperCase()\n else \n line2 = theLine.toString().toUpperCase();\n idx++\n if (idx > 1)\n {\n rl.close();\n console.log(line1 < line2 ? \"-1\":(line1 === line2 ? \"0\": \"-1\"));\n }\n }\n);", "lang": "Node.js", "bug_code_uid": "dfb374bc3cd2ff4d002421843533ff11", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "f9e0300f2db553d88d24ffa95ffc4de8", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.5836575875486382, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "const stdin = process.openStdin();\nlet n;\nlet i = 0;\nlet output = 0;\n\nprocess.stdin.on('data', function (chunk) {\n lines = chunk.toString().split('\\n');\n lines = lines.map(a => a.trim().toLowerCase());\n for (let i = 0; i < lines[0].length; i+= 1) {\n if (lines[0].charAt(i) > lines[1].charAt(i)) { output += 1; }\n if (lines[0].charAt(i) < lines[1].charAt(i)) { output -= 1; }\n }\n console.log(output);\n});", "lang": "Node.js", "bug_code_uid": "1e784778dca470deeba7ffd08586238c", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "3529ce690a3fab71e05bc70ae931bf09", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8657047724750278, "equal_cnt": 42, "replace_cnt": 23, "delete_cnt": 13, "insert_cnt": 7, "fix_ops_cnt": 43, "bug_source_code": "'use strict';\n\n// const fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let s1 = readLine().toLowerCase();\n let s2 = readLine().toLowerCase();\n let ans1 = s1.split('').reduce((sum, value) => {\n return sum + value.charCodeAt(0);\n }, 0)\n\n let ans2 = s2.split('').reduce((sum, value) => {\n return sum + value.charCodeAt(0);\n }, 0)\n if (ans1 < ans2) {\n console.log(-1);\n } else if (ans1 > ans2)\n console.log(1);\n else if (ans1 == ans2)\n console.log(0);\n}", "lang": "Node.js", "bug_code_uid": "0e3e752ddd40d1c22eb6f38504c9ca8c", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "f9301ab26666a5a28a4d1b2acad1d2a3", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9308035714285714, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.question(\"\", (firstLine) => {\n const [n, k] = firstLine.split(\" \").map((numStr) => parseInt(numStr));\n\n rl.question(\"\", (scopeListString) => {\n let result = 0;\n const scopeList = scopeListString\n .split(\" \")\n .map((numStr) => parseInt(numStr));\n const scopesOfWinners = scopeList.slice(0, k);\n\n if (scopesOfWinners[0] > 0) {\n const scopesOfAdditionalParticipans = scopeList.slice(k);\n\n scopesOfAdditionalParticipans.forEach((scope) => {\n if (scope !== scopesOfWinners[scopesOfWinners.length - 1]) {\n return;\n }\n scopesOfWinners.push(scope);\n });\n\n result = scopesOfWinners.length;\n }\n\n console.log(result);\n rl.close();\n });\n});\n", "lang": "Node.js", "bug_code_uid": "59e56dc3a99ac546c94d9e4bd39b968e", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "e9e6e4d719b3036988b0ee9c979415f8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.972972972972973, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "const readLine = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nconst input = [];\n\nfunction splitAndParseInt(line) {\n return line.split(\" \").map((x) => parseInt(x));\n}\n\nreadLine.on(\"line\", (line) => input.push(line));\nreadLine.on(\"close\", () => {\n const array = splitAndParseInt(input[0])\n const items = splitAndParseInt(input[1])\n const length = array[0];\n const max = array[1]\n let answer = 0;\n for(let i = 0; i <= length; i++){\n if(items[i] > max){\n answer++;\n }\n }\n console.log(answer)\n});", "lang": "Node.js", "bug_code_uid": "2b59feb83cf754de9853ace6f455afc0", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "48f2c49771d96a57f9974aad13c56193", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9811320754716981, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nlet input = [];\n\nrl.on(\"line\", (line) => {\n input.push(line);\n});\n\nrl.on(\"close\", () => {\n console.log(solution(input[0].split(\" \"), input[1]));\n});\n\nconst solution = ([n, k], numbers) => {\n let res = 0;\n numbers = numbers.split(\" \").map((num) => parseInt(num));\n n = parseInt(n);\n k = parseInt(k);\n for (let i = 0; i < n; i++) {\n if (numbers[i] >= numbers[k]) {\n res += 1;\n } else {\n break;\n }\n }\n return res;\n};\n", "lang": "Node.js", "bug_code_uid": "61e7a8ae7933985b613cc80111d7c6f9", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "c06a0063e0b54c6fc4c0260129543a06", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9729404690318701, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// Generated by CoffeeScript 2.5.1\nvar lines, mainAux, print, readline, rl, rli, write;\n\nrl = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nprint = console.log;\n\nwrite = function(...args) {\n return process.stdout.write(args.join(' '));\n};\n\nlines = [];\n\nrl.on('line', function(line) {\n return lines.push(line);\n});\n\nrl.on('close', main);\n\nrli = 0;\n\nreadline = function() {\n return lines[rli++];\n};\n\nmainAux = function() {\n var ff, finishers, k, n, passing;\n [n, k] = readline().split(' ');\n finishers = readline().split(' ');\n passing = parseInt(finishers[k]);\n ff = finishers.filter(function(f) {\n return f > 0;\n }).filter(function(f) {\n return f >= passing;\n });\n return print(ff.length);\n};\n\nfunction main() {\n return mainAux();\n};\n\n//# sourceMappingURL=ith-place-finishers.js.map\n", "lang": "Node.js", "bug_code_uid": "d81a377d611a9d326fefcc42f69690f4", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "499f8ab12e6fc75c82cb41bf6e5aaa8e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9605114704776232, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString\n .trim()\n .split('\\n')\n .map(string => {\n return string.trim();\n });\n\n process.stdout.write(String(main(inputString)));\n process.exit();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nconst main = inputArray => {\n const [\n numberOfParticipants,\n numberOfAdvancingScores,\n ] = inputArray[0].split(' ');\n const participantScores = inputArray[1].split(' ');\n if (numberOfAdvancingScores === numberOfParticipants)\n return participantScores.filter(score => !!score).length;\n\n const winners = participantScores.slice(0, numberOfAdvancingScores - 1);\n const lastWinningScore = winners[winners.length - 1];\n if (lastWinningScore === '0')\n return winners.filter(score => score !== '0').length;\n if (participantScores[numberOfAdvancingScores] !== lastWinningScore)\n return winners.length;\n for (let i = winners.length; i < participantScores.length; i += 1) {\n if (participantScores[i] === lastWinningScore) {\n winners.push(lastWinningScore);\n } else {\n break;\n }\n }\n\n return winners.length;\n};\n", "lang": "Node.js", "bug_code_uid": "bb05ea449bcf4be65bddea3f74049d46", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "446574e6b525e691226c92bf89c42180", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9828641370869033, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let inp = readline().split(\" \");\n\n let n = Number(inp[0]) || 0;\n let k = Number(inp[1]) || 0;\n\n let out = 0;\n if (n > k) {\n let scores = readline().split(\" \");\n for (let i = 0; i < scores.length; i++) {\n if (Number(scores[i]) >= Number(scores[k])) {\n if (Number(scores[i])> 0)\n out++\n } else {\n break;\n }\n }\n }\n console.log(out)\n\n}", "lang": "Node.js", "bug_code_uid": "86c792ef1641c50d413b58adc3053ad3", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "9c943543e75fe2bc5c53d485c751909e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.5173160173160173, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "const readline = require('readline');\n \nconst rl = readline.createInterface({\n input: process.stdin\n});\n \nlet lines = [];\nrl.on('line', (line) => {\n lines.push(line);\n}).on('close', () => {\n const [ln, c] = lines[0].split(' ');\n const us = lines[1].split(' ').filter(v => +v > +c);\n\n process.stdout.write(`${us.length}\\n`);\n});", "lang": "Node.js", "bug_code_uid": "87462d7809a9a26750ae46f332e2e33d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "7457ab917b045d70ed8ecdb3b6943383", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9923076923076923, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "function main() {\n // write code here:\n var arr = stdin[0].match(/[a]/gi);\n var sLen = stdin[0].length;\n var aLen = arr.length;\n console.log(aLen > sLen / 2 ? sLen : aLen + 1);\n}\n\nconst readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nvar stdin = [];\nrl.on('line', function (line) {\n stdin.push(line);\n});\nrl.on('close', main);\n", "lang": "Node.js", "bug_code_uid": "d7d7c7d7fa34516c7672f910ea98c99a", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "1621d8c5de77217d87e7fb107607191a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9896193771626297, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n \nconst input = [];\nreadLine.on('line', line => input.push(line));\n \nreadLine.on('close', () => {\nlet charA = input[0].match(/(a)/g)\ncharA = charA ? charA.length : 1\nconst allChars = input[0].length\nconst anyCars = allChars - charA\nlet _result = 0\nif (anyCars >= charA)\n _result = (charA * 2) - 1\nconsole.log(_result)\n})", "lang": "Node.js", "bug_code_uid": "fc57bf7ce6f653ed9272df265ed98726", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "3f2d8a54e07ee0701a6e519a469f97bf", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9997462572951028, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n↑入力 ↓出力');\n Main();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var s = next();\n var count = 0;\n for(var i = 0; i < s.length; i++){\n count += (s[i] == 'a') ? 1 : 0;\n }\n if(count < s.length / 2){\n myout(count * 2 - 1);\n }else{\n myout(s.length);\n }\n}\n", "lang": "Node.js", "bug_code_uid": "a39d4f06792ea8446bf172d0e80e1494", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "69015bd8e1a7e6e3813da13c5a0e3c1e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9760191846522782, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', (str) => {\n let a = 0;\n let x = 0;\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === 'a') {\n a++;\n }\n else {\n x++;\n }\n }\n\n if (a < x) {\n console.log(x - a);\n }\n else {\n console.log(str.length);\n }\n});\n", "lang": "Node.js", "bug_code_uid": "77f811a26e9ea8b430b17ef071f75136", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "fb61471a7ff5f56977bdeb0a149373da", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9648711943793911, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "let input = [];\n \nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n\nRL.on('line', (line) => {\n let count_a = 0; [...line].forEach( i => {if(i === 'a') count_a++} );\n console.log(count_a)\n if(count_a > line.length - count_a)\n console.log(line.length);\n else\n console.log( line.length - ( line.length-count_a - count_a - 1) )\n});\n\nRL.on('close', () => {\n});\n\n", "lang": "Node.js", "bug_code_uid": "9fc37b9067ffa9b30899159508e676f1", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "1f408b212a2256b2d71c77e76066129e", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.5078101071975498, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "// https://codeforces.com/problemset/problem/596/A\n// Big O:\n// Time complexity:\n// Space complexity:\n\n// Read input\nvar readline = require(\"readline\");\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet numberOfVertices;\nlet vertices = [];\nrl.on('line', (input) => {\n if (!numberOfVertices) {\n numberOfVertices = parseInt(input);\n return;\n }\n\n const verticesArray = input.split(\" \").map(Number)\n const x = verticesArray[0];\n const y = verticesArray[1];\n vertices.push({ x, y });\n\n if (vertices.length === numberOfVertices) {\n console.log(findRectangleArea(numberOfVertices, vertices));\n rl.close();\n }\n\n});\n\n// Problem\nfunction findRectangleArea(numberOfVertices, vertices) {\n if (numberOfVertices === 1) {\n return -1;\n }\n\n if (numberOfVertices === 2) {\n return findRectangleAreaWithTwoVertices(vertices);\n }\n\n // if (numberOfVertices === 3) {\n return findRectangleAreaWithThreeVertices(vertices);\n // }\n\n // return 0;\n}\n\nfunction findRectangleAreaWithTwoVertices(vertices) {\n const firstVertex = vertices[0];\n const secondVertex = vertices[1];\n const x1 = firstVertex.x;\n const x2 = secondVertex.x;\n const y1 = firstVertex.y;\n const y2 = secondVertex.y;\n\n if (x1 === x2) {\n return x1 * Math.abs(y1 - y2);\n } else if (y1 === y2) {\n return y1 * Math.abs(x1 - x2);\n } else {\n return Math.abs(x1 - x2) * Math.abs(y1 - y2);\n }\n}\n\nfunction findRectangleAreaWithThreeVertices(vertices) {\n const firstVertex = vertices[0];\n const secondVertex = vertices[1];\n const thirdVertex = vertices[2];\n const x1 = firstVertex.x;\n const x2 = secondVertex.x;\n const x3 = thirdVertex.x;\n const y1 = firstVertex.y;\n const y2 = secondVertex.y;\n const y3 = thirdVertex.y;\n\n const y = y1 === y2 ? Math.abs(y1 - y3) : Math.abs(y1 - y2);\n const x = x1 === x2 ? Math.abs(x1 - x3) : Math.abs(x1 - x2);\n\n return x * y;\n}\n", "lang": "Node.js", "bug_code_uid": "f3d65d5c16e68b630c45b095700cf8d3", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "15a5e0956ad28e2b49f375bd6b1bdad3", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9946107784431137, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "'use strict';\n\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++].split(' ');\n}\n\nfunction readInt(s) {\n return parseInt(s, 10);\n}\n\nfunction readIntArray(a) {\n return a.map(e => parseInt(e, 10));\n}\n\nfunction solve(n) {\n let a = [0, 1, 2, 0, 2, 1, 0];\n let max = 0;\n for (let i = 0; i < 7; i++) {\n let korm = n.slice(0);\n let days = 0;\n let ok = true;\n for (let j = i; j < 7; j++) {\n if (korm[a[j]] > 0) {\n korm[a[j]]--;\n days++;\n } else {\n ok = false;\n break;\n }\n }\n if (!ok) {\n if (days > max) max = days;\n continue;\n }\n let weeks = Math.min(Math.floor(a[0] / 3), Math.floor(a[1] / 2), Math.floor(a[2] / 2));\n days += weeks * 7;\n korm[0] -= 3 * weeks;\n korm[1] -= 2 * weeks;\n korm[2] -= 2 * weeks;\n for (let j = 0; j < 7; j++) {\n if (korm[a[j]] > 0) {\n korm[a[j]]--;\n days++;\n } else {\n break;\n }\n }\n if (days > max) max = days;\n }\n return max;\n}\n\nfunction main() {\n\n const a = readIntArray(readLine());\n\n\n let result = solve(a);\n console.log(result);\n}\n", "lang": "Node.js", "bug_code_uid": "138667060db99fa1500b6c557cf314e2", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "8bb59347dfca15ea35d3e86889420925", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8167832167832167, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on(\"line\", (line) => {\n let params = line.split(\" \");\n if ((input[0] * input[1]) % 2 == 0) console.log(\"Malvika\");\n else console.log(\"Akshat\");\n});\nrl.on(\"close\", () => {});\n", "lang": "Node.js", "bug_code_uid": "3b2712552eed652896e9bfd998f9f1b3", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "bf016e91d820ac6a41a3a7df2fe2ecea", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9432534678436317, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on(\"line\", (line) => {\n let params = line.split(\" \");\n let smaller = params[0];\n // ger min\n if (params[1] <= params[0]) smaller = params[1];\n if (smaller % 2 == 0) console.log(\"Malvika\");\n else console.log(\"Akshat\");\n});\n\nrl.on(\"close\", () => {});\n", "lang": "Node.js", "bug_code_uid": "447abd7fc97254b26d9aef3063967c29", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "bf016e91d820ac6a41a3a7df2fe2ecea", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9159733777038269, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "let fs = require('fs');\n\nlet txt = fs.readFileSync(0, \"utf-8\").split(\"\\n\").filter(data => data.length > 0);\nfor (let i = 0; i < txt.length; i++) {\n let info = txt[i].split(\" \").filter(data => data.length > 0).map(data => data * 1);\n doit(info[0], info[1]);\n}\n\nfunction doit(x, y) {\n let player = 1;\n let grid = new Array(y).fill(0);\n grid.forEach((data, index) => {\n grid[index] = new Array(x).fill(true);\n });\n while (true) {\n let test = true;\n for (let i1 = 0; i1 < y; i1++) {\n for (let i = 0; i < x; i++) {\n if (grid[i][i1] === true) {\n grid[i][i1] = false;\n test = false;\n player *= -1;\n for (let i3 = 0; i3 < x; i3++) {\n grid[i3][i1] = false;\n }\n for (let i4 = 0; i4 < y; i4++) {\n grid[i][i4] = false;\n }\n break;\n }\n }\n if (!test) break;\n\n }\n\n if (test) break;\n }\n if (player * -1 == 1) {\n console.log(\"Akshat\");\n } else {\n console.log(\"Malvika\");\n\n }\n\n\n\n\n}", "lang": "Node.js", "bug_code_uid": "8e13ea5f0b65f3e858d610a929260644", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "f6c69926c0e1461b8c9e9903cd9ea0e9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7763157894736842, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "const mainFunction = (lines) => {\n [a, b, c] = lines[0].split(\" \").map(Number);\n if (b + c < a) {\n console.log(-1);\n } else {\n console.log(a);\n }\n}\n\nconst { EOL } = require('os')\nconst fs = require(\"fs\");\nif (__filename.substr(9, 4) != \"azer\") {\n let yourInput = ''\n process.stdin.on('data', i => yourInput += i)\n process.stdin.on('end', () => mainFunction(yourInput.split(EOL)))\n} else {\n mainFunction(fs.readFileSync('input.txt', 'utf8').split(EOL))\n}", "lang": "Node.js", "bug_code_uid": "2e8c68c130cc780ab161e0ff3b1f1af0", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "7c40f863c81b606ec42911df644c7cf4", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9875835721107927, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "//'use strict';\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet i = '';\nprocess.stdin.on('data', c => {\n i += c;\n});\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n i = i.trim()\n .split(' ' || EOL)\n .map(string => {\n return string.trim();\n });\n main();\n});\n\nfunction readLine() {\n return i[currentLine++];\n}\nfunction main() {\n var x = readLine();\n var res = x / 5;\n if (x % 5 === 0) {\n console.log(res);\n }\n else console.log(res + 1);\n}", "lang": "Node.js", "bug_code_uid": "19d072df6fcbcb2cd6c607b5e79338c8", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "47bd39c41558320c0085f5a56f6c2b46", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6789772727272727, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n// Write your code here\nfunction nameLookUp(str) {\n let frnLocation = str.trim();\n let moves = [1, 2, 3, 4, 5];\n let steps = stepsToTake(moves, +frnLocation);\n return steps.toString();\n}\n\nfunction stepsToTake(moves = [], frnLocation, steps = 0) {\n\n let newNum = 1;\n for (let row of moves) {\n if (row < frnLocation) {\n newNum = row;\n }\n }\n\n frnLocation = frnLocation - newNum;\n if (frnLocation !== 0) {\n steps++;\n return stepsToTake(moves, frnLocation, steps);\n }\n else {\n return steps;\n }\n}", "lang": "Node.js", "bug_code_uid": "95dcca69426e7bfd6a1520eee63fac32", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "022ef8df1d09e49e03b7fffb0950f332", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9471585244267199, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "let inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', data => {\n\tinputString += data;\n});\nprocess.stdin.on('end', function () {\n\tinputString = inputString\n\t\t.trim()\n\t\t.split('\\n')\n\t\t.map(str => str.trim());\n\tmain();\n});\n\nfunction readLine() {\n\treturn inputString[currentLine++];\n}\n\nfunction multiply(a, b) {\n\ta = a.toString(10).split('').reverse();\n\tb = b.toString(10).split('').reverse();\n\n\tif (a.length < b.length) {\n\t\t[a, b] = [b, a];\n\t}\n\n\tlet res = Array(a.length + b.length).fill(0);\n\tfor (let i = 0, lb = b.length; i < lb; ++i) {\n\t\tlet carry = 0;\n\t\tlet scarry = 0;\n\t\tfor (let j = 0, la = a.length; j < la; ++j) {\n\t\t\tlet m = b[i] * a[j];\n\t\t\tm += carry;\n\n\t\t\tif (m > 9) {\n\t\t\t\tlet [c, d] = m.toString(10).split('');\n\t\t\t\tres[i + j] += (scarry >> 0) + (d >> 0);\n\t\t\t\tcarry = c >> 0;\n\t\t\t} else {\n\t\t\t\tres[i + j] += (scarry >> 0) + m;\n\t\t\t\tcarry = 0;\n\t\t\t}\n\n\t\t\tif (res[i + j] > 9) {\n\t\t\t\tlet [c, d] = res[i + j].toString(10).split('');\n\t\t\t\tres[i + j] = d >> 0;\n\t\t\t\tscarry = c;\n\t\t\t} else {\n\t\t\t\tscarry = 0;\n\t\t\t}\n\t\t}\n\t\tif (carry > 0) res[a.length + i] = carry;\n\t\tif (scarry > 0) res[a.length + i] = scarry;\n\t}\n\n\tres.reverse();\n\tlet mulVal = '';\n\tlet flag = false;\n\tres.forEach(d => {\n\t\tif (!flag && d !== 0) flag = true;\n\t\tif (flag) mulVal += d;\n\t});\n\treturn mulVal;\n}\n\nfunction main() {\n\tlet n = readLine() >> 0;\n\tlet f = readLine()\n\t\t.split(' ')\n\t\t.map(x => x >> 0);\n\n\tlet s = f.reduce((a, c) => a + c);\n\tlet t = n + 1;\n\tlet r = s % t;\n\tr = r === 0 ? (r += 2) : r++;\n\tconsole.log(r);\n}\n", "lang": "Node.js", "bug_code_uid": "113b39497e3d00af433b05acdac7841a", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "5b57c1fd79c1e9e608124d7400b28ede", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9962640099626401, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let n = parseInt(readLine());\n let fingersArray = readLine().split(' ').map(Number);\n let sum = 0;\n for (let i = 0; i < fingersArray.length; i++) {\n sum = sum + fingersArray[i];\n }\n let ways = 0;\n for (let i = 1; i <= 5; i++) {\n if ((sum + i) % (n + 1)) {\n ways++;\n }\n }\n console.log(ways);\n}\n", "lang": "Node.js", "bug_code_uid": "511c6250024e1645ea379f4514f10bde", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "4924aa2b128a48f0517b3aa20c794a6a", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9942028985507246, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n↑入力 ↓出力');\n\tMain();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n\t};\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n\tvar one = nextIntArray();\n\tvar x = one[0];\n\tvar y = one[1];\n\tvar z = one[2];\n\tvar t1 = one[3];\n\tvar t2 = one[4];\n\tvar t3 = one[5];\n\tvar work = Math.abs(x - y) * t1;\n\tvar eleve = (Math.abs(x - z) * t2) + (t3 * 3) + (Math.abs(x - y) * t2);\n\tif(eleve < work){\n\t\tmyout(\"YES\");\n\t}else{\n\t\tmyout(\"NO\");\n\t}\n}\n", "lang": "Node.js", "bug_code_uid": "7a6456fb050c6885057bec04e50c7b77", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "27c6a7e39b7d177e9ee40e8807fff4bb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.3854389721627409, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "const elevatorOrStairs = (argv) => {\n let x = argv[2],\n y = argv[3],\n z = argv[4],\n t1 = argv[5],\n t2 = argv[6],\n t3 = argv[7];\n\n let stairs = Math.abs((x - y) * t1);\n let elevator = Math.abs(x - z) * t2 + 3 * t3 + Math.abs(x - y) * t2;\n \n return elevator <= stairs ? 'YES':'NO';\n}\n\nlet result = elevatorOrStairs(process.argv);\n\nconsole.log(result);", "lang": "Node.js", "bug_code_uid": "3cfd93b42f67db33889e93f7fc24649b", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "5682ed52283f0fa08c41ab3edf62d5e3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9747899159663865, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "let input;\nprocess.stdin.on('data', c => input = c);\nprocess.stdin.on('end', sol);\n\nfunction f(x) {\n ++x;\n while (x % 10 === 0) {\n x /= 10;\n }\n return x;\n}\n\nfunction sol() {\n const visited = {};\n let x = Number(input);\n let count = 1;\n while (!visited[f(x)]) {\n x = f(x);\n visited[x] = true;\n ++count;\n }\n process.stdout.write(count.toString(), 'utf8', () => process.stdout.end());\n}\n", "lang": "Node.js", "bug_code_uid": "6efcb73d3a6a2f38d4a7d3d7af82e3ef", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "e7b95e957749e69cd561eaec4786d2c9", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9973190348525469, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "var standard_input = process.stdin;\n\n// Set input character encoding.\nstandard_input.setEncoding('utf-8');\n\n// When user input data and click enter key.\nstandard_input.on('data', function (s) {\ns=s.trim().split()\n const n = s.reduce((a,c)=> \n{\n//console.log(a,c);\nreturn a + 9-Number(c)\n}\n,(1 < s.length || s[0] === '0' ? 1 : 0) + Number(s[0]));\n console.log(n);\n});", "lang": "Node.js", "bug_code_uid": "50635c9f493a75d3136cfbd41d66119b", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "c0c86e8384e078c91beb451e33f26e01", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9950372208436724, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "\nlet _inputLines;\nlet _lineNumber = 0;\nlet inputReader = _inputReader ();\n\nfunction _main() {\n\t\n\t_inputLines = _inputData.trim().split('\\n').map((string) => {\n\t\treturn string.trim();\n\t});;\n\tlet [s, v1, v2, t1, t2] = inputReader.readNumberArray();\n\t\n\tlet res1 = s * t1 + v1 * s;\n\tlet res2 = s * t2 + v2 * s;\n\tif (res1 > res2) {\n\t\tconsole.log(\"First\");\n\t} else if (res1 < res2) {\n\t\tconsole.log(\"Second\");\n\t} else {\n\t\tconsole.log(\"Friendship\");\n\t}\n\n}\n\nvar _inputData = '';\nfunction cacheInput(data) {\n\t_inputData += data;\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', cacheInput).on('end', _main);\n\nfunction _inputReader () {\n\tfunction readNumberArray(){\n\t\treturn _inputLines[_lineNumber++].split(' ').map(val => Number(val));\n\t}\n\t\t\n\t\n\treturn {\n\t\treadNumberArray,\n\t}\n}", "lang": "Node.js", "bug_code_uid": "143e9efce358bcf746659b72b44ae2e5", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "70149ac596c5e865b3364a47fd7ecf5a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9711751662971175, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "function main() {\n // write code here:\n var arr = stdin[0].split(' ').map(Number);\n const n = arr.splice(0, 1)[0];\n var arrLen = arr.length;\n var v1 = arr[0], v2 = arr[1], t1 = arr[2], t2 = arr[3];\n var second1 = (arrLen - 2) * v1 + (v1 + t1) * 2;\n var second2 = (arrLen - 2) * v2 + (v2 + t2) * 2;\n if (second1 < second2) {\n console.log('First');\n } else if (second1 > second2) {\n console.log('Second');\n } else {\n console.log('Friendship');\n }\n}\n\nconst readline = require('readline');\nconst rl = readline.createInterface({input: process.stdin});\nvar stdin = [];\nrl.on('line', function (line) {\n stdin.push(line);\n});\nrl.on('close', main);", "lang": "Node.js", "bug_code_uid": "ce4f1061025a7048c8ceadeab0b5d8f7", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "f3db0e936ca6198fcd6c0e9d97d7ee76", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9992638036809816, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/**\nPolycarp has just invented a new binary protocol for data transmission. He is encoding positive integer decimal number to binary string using following algorithm:\n\nEach digit is represented with number of '1' characters equal to the value of that digit (for 0 it is zero ones).\nDigits are written one by one in order corresponding to number and separated by single '0' character.\nThough Polycarp learnt how to encode the numbers, he has no idea how to decode them back. Help him calculate the decoded number.\n\nInput\nThe first line contains one integer number n (1 ≤ n ≤ 89) — length of the string s.\n\nThe second line contains string s — sequence of '0' and '1' characters, number in its encoded format. It is guaranteed that the number corresponding to the string is positive and doesn't exceed 109. The string always starts with '1'.\n\nOutput\nPrint the decoded number.\n\nExamples\ninput\n3\n111\noutput\n3\ninput\n9\n110011101\noutput\n2031\n\n */\n\nlet inputString = '';\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n let lengthOfString = Number(inputString[0]);\n let string = inputString[1];\n\n solution(lengthOfString, string);\n\n});\n\nfunction solution(lengthOfString, string) {\n\n let onesCount = 0;\n let zeorCount = '';\n let digit = [];\n\n for (let index = 0; index < lengthOfString; index++) {\n\n if (string[index] == '1') {\n\n onesCount++;\n\n if (zeorCount.length > 1)\n digit.push(zeorCount.substring(0, zeorCount.length - 1));\n\n zeorCount = '';\n }\n\n if (string[index] == '0') {\n\n zeorCount += '0';\n\n if (onesCount)\n digit.push(onesCount.toString());\n\n onesCount = 0;\n }\n }\n\n if (onesCount)\n digit.push(onesCount.toString());\n\n if (zeorCount.length > 1)\n digit.push(zeorCount);\n\n console.log(digit.join(\"\"));\n\n}", "lang": "Node.js", "bug_code_uid": "6e2bb149222ec9de6f347d04c329f116", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "a9ca4cd8c8f889c6327adbb4320ee33a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.6308370044052863, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "/**\n * Created by bhavyaagg on 09/06/18.\n */\n\nconst readline = require('readline');\n\nr1 = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nr1.on('line', (data) => {\n let x = data.split(\" \")[0];\n let y = data.split(\" \")[1];\n\n if (x == y) {\n console.log(\"=\");\n } else if (x < y) {\n console.log(\">\")\n } else {\n console.log(\"<\")\n }\n\n r1.close();\n})\n", "lang": "Node.js", "bug_code_uid": "ca22292135857ed609f04bb94e31cbab", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "df0e2e1f1f84a14fe7d60e40ef13fc42", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8676607642124884, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n// utils\nconst MOD = 1e9 + 7;\nconst mod = (n) => ((n % MOD) + MOD) % MOD;\nconst add = (a, b) => mod(mod(a) + mod(b));\nfunction mul() {\n for (var a = arguments, r = a[0], i = a.length; --i; )\n r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;\n return r;\n}\nfunction inv(b) {\n for (var a = MOD, u = 0, v = 1, t; b; v = t)\n (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);\n u %= MOD;\n return u < 0 ? u + MOD : u;\n}\n\nfunction main() {\n let [count0, count1] = [0, 0];\n const str = readLine();\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === \"0\") count0++;\n else count1++;\n }\n\n if (count0 >= 6 && count1 >= 1) console.log(\"yes\");\n else console.log(\"no\");\n}\n", "lang": "Node.js", "bug_code_uid": "14269577be95009d035d5a0b39064aeb", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "23d3b20a9d2d8eda64723b677aadb9bc", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.3645894001164822, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 21, "bug_source_code": "const solve = () => {\n const vk = (s.match(/VK/g) || []).length\n const vv = (s.match(/VV/g) || []).length > 0\n const kk = (s.match(/KK/g) || []).length > 0\n\n print(vk + (vv || kk ? 1 : 0))\n}\n\nsolve()\n// I/O Functions\nconst __lines = require('fs')\n .readFileSync('/dev/stdin', 'utf8')\n .split('\\n')\nlet __lineIndex = 0\nconst line = () => __lines[__lineIndex++]\nconst words = () => line().split(' ')\nconst int = () => parseInt(line())\nconst ints = () => words().map(x => parseInt(x))\nconst float = () => parseFloat(line())\nconst floats = () => words().map(x => parseFloat(x))\n\nconst print = console.log\n", "lang": "Node.js", "bug_code_uid": "5531c242fbf417d4f4037c01c7eda014", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "c0f99968449b7305d39d17fb6ca55e0c", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9995493465525012, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "async function solve() {\n let s = await line()\n const vk = (s.match(/VK/g) || []).length\n s = s.split('VK').join('')\n const vv = (s.match(/VV/g) || []).length > 0\n const kk = (s.match(/KK/g) || []).length > 0\n\n print(vk + (vv || kk ? 1 : 0))\n}\n\n// read the input\nconst readline = require('readline')\nconst _lines = []\nlet _lineIndex = 0\nlet _ended = false\nconst _rl = readline.createInterface(process.stdin)\n_rl.on('line', line => _lines.push(line))\n_rl.on('end', () => (ended = true))\nconst wait = ms => new Promise(resolve => setTimeout(resolve, ms))\nconst line = async () => {\n while (!_ended && _lines.length <= _lineIndex) await wait(10)\n const result = _lines[_lineIndex].trim()\n _lines[_lineIndex] = null\n _lineIndex++\n return result\n}\nconst words = async () => (await line()).split(' ')\nconst chars = async () => (await line()).split('')\nconst int = async () => parseInt(await line())\nconst ints = async () => (await words()).map(x => parseInt(x))\nconst big = async () => BigInt(await line())\nconst bigs = async () => (await words()).map(x => BigInt(x))\n\nconst print = console.log\n\nsolve()\n", "lang": "Node.js", "bug_code_uid": "059fad6c19c41d69e7f880802e7d00a2", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "c0f99968449b7305d39d17fb6ca55e0c", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9150326797385621, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "const readline = require(\"readline\");\n\nlet inputs = [];\n\nconst rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\n\nrl.on(\"line\", line => inputs.push(line));\n\nrl.on(\"close\", () => console.log(solution(inputs)));\n\nfunction solution([_, data]) {\n\tconst columns = data.split(\" \").map(Number);\n\tconst ans = columns.sort((a, b) => a - b);\n\treturn ans;\n};\n", "lang": "Node.js", "bug_code_uid": "4a55e07859fe3b0c4428f955fae4e87c", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "dc19d5314a3cb65d700720e8ec12b22f", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9815602836879432, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\"use strict\";\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet inputString = \"\";\nlet currentLine = 0;\n\nprocess.stdin.on(\"data\", (inputStdin) => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((string) => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\nfunction main() {\n const x = readline().split(\" \");\n\n const x2 = readline()\n .split(\" \")\n .map((x) => +x);\n \n fn(x2);\n}\n\nfunction fn(arr) {\n console.log(arr.sort().join(\" \"))\n}\n", "lang": "Node.js", "bug_code_uid": "d115e8b6b65b40b164b00177cd8771b7", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "4ba1134d9859153d6f5c688f4365ec6a", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9774011299435028, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction print(s) {\n process.stdout.write(`${s}`);\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\nfunction main() {\n // input\n let n = readline();\n const numbers = readline().split(' ').map(x => parseInt(x)).sort();\n\n // output\n print(numbers.join(' '));\n}\n\n", "lang": "Node.js", "bug_code_uid": "41044f686df2e6a4346835c1a14ba229", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "130f682145e5366a8f6658206b485429", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9927113702623906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "'use strict';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nconst readLine=()=> inputString[currentLine++];\n/* ================================================ \n Main Solution Starts Here \n===================================================*/\n\nconst main=()=>{\n\tlet x=parseInt(readLine())\n\tlet blocks=readLine().split(\" \").map(n=>+n)\n\tblocks.sort()\n\tconsole.log(...blocks)\n}", "lang": "Node.js", "bug_code_uid": "1a75fffffae8271569ae0b4c52289937", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "e5f91b62b47fa92c0d4c0bde282cfcc2", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9476439790575916, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n\nlet currentLine = 0;\nlet inputString = \"\";\n\nprocess.stdin.on(\"data\", (raw_data) => {\n inputString += raw_data;\n});\n\nprocess.stdin.on(\"end\", (_) => {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((line) => {\n return line.trim();\n });\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\n/******** Main function*************/\n\nfunction main() {\n var n = +readLine();\n var m = readLine().split(\" \").map(Number);\n\n console.log(m.sort().join(\" \"));\n}\n", "lang": "Node.js", "bug_code_uid": "d0192c197d0667209552b1e002a8436b", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "e1ba6f03266be4e6fbfd33bc043f0281", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9946018893387314, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet length;\nlet t;\n\nfunction transform(data, j) {\n for (let i = j; i < length - 1; i++) {\n if (data[i] === 'B' && data[i + 1] === 'G') {\n const temp = data[i];\n data[i] = data[i + 1];\n data[i + 1] = temp;\n i++;\n }\n }\n return data;\n}\n\nfunction solve(data) {\n for (let i = 0; i < t; i++) {\n data = transform(data, i);\n }\n return data;\n\n}\n\nrl.on('line', (line) => {\n if (!length) {\n [length, t] = line.split(' ').map(Number);\n return\n }\n console.log(solve(line.split('')).join(''));\n});\n", "lang": "Node.js", "bug_code_uid": "018a6e16dd0dc9678f808966aa29981f", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "e683668f61a60d7b586f2e6c888ce6d8", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.7880116959064327, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n let [len, time] = readLine()\n .split(\" \")\n .map((n) => parseInt(n));\n let arr = readLine().split(\"\");\n\n for (let i = 0, j = 0; i < len - 1; i++) {\n if (arr[i] === \"B\" && arr[i + 1] === \"G\") {\n j++;\n if (j <= time) {\n [arr[i], arr[i + 1]] = [arr[i + 1], arr[i]];\n } else j = 0;\n } else j = 0;\n }\n console.log(arr.join(\"\"));\n}\n", "lang": "Node.js", "bug_code_uid": "c924bc747673b3e89a5c6603918dfc6a", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "9e8fbc9b094d0eeddf7c7f54a3a6f9dd", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9874529485570891, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "const readLine = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n \nconst input = [];\nreadLine.on('line', line => input.push(line));\n \nreadLine.on('close', () => {\n let [first, second] = input\n let [people, seconds] = first.split(' ')\n let arrOrder = second.split('')\n for (let a = 0; a < seconds; a++) {\n for (let b = 0; b < people; b++) {\n const el = arrOrder[b]\n if (el === 'G') {\n arrOrder[b] = el\n } else if (el === 'B') {\n const checkNext = arrOrder[b + 1]\n if (checkNext === 'G') {\n arrOrder[b] = 'G'\n arrOrder[b + 1] = 'BG'\n } else {\n arrOrder[b] = el\n }\n } else {\n arrOrder[b] = 'B'\n }\n }\n }\n console.log(arrOrder.toString())\n});", "lang": "Node.js", "bug_code_uid": "b339264d3b146cc227ff6fa70a7e8183", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "debd1c53e22dc1f059651fed6a567246", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9686147186147186, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nlet inputString = '';\nlet currentLine = 0;\nprocess.stdin.on('data', (inputStd) => {\n inputString += inputStd;\n});\nprocess.stdin.on('end', function () {\n inputString = inputString\n .trim()\n .split('\\n')\n .map((str) => {\n return str.trim();\n });\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let nums = readLine().split(' ').map(Number);\n let [studentNums, seconds] = nums;\n let studentOrder = readLine();\n for (let i = 0; i < seconds; i++) {\n // [BGGBG]\n for (let j = 0; j < studentOrder.length; j++) {\n if (studentOrder[j] === 'B' && studentOrder[j + 1] === 'G') {\n studentOrder[j] = 'G';\n studentOrder[j + 1] = 'B';\n j++;\n }\n }\n }\n console.log(studentOrder);\n}\n", "lang": "Node.js", "bug_code_uid": "a50a1e492a94d7a8c9fce86128563b1b", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "005f1b8bca379f513149d237770809f3", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.995910949568378, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "// Sample code to perform I/O:\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\nvar stdin_input = \"\";\n\nprocess.stdin.on(\"data\", function (input) {\n stdin_input += input; // Reading input from STDIN\n});\n\nprocess.stdin.on(\"end\", function () {\n main(stdin_input);\n});\n\nfunction main(input) {\n let output = nameLookUp(input);\n process.stdout.write(output); // Writing output to STDOUT\n}\n\n// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail\n\n// Write your code here\nfunction nameLookUp(str) {\n let input = str.trim().split('\\n');\n let numeric = input[0].split(' ');\n let seconds = +numeric[1];\n let bg = input[1].split('');\n let newbg = [...bg];\n for (let i = 0; i < seconds; i++) {\n\n for (let i = 1; i < bg.length; i++) {\n if (bg[i - 1] < bg[i]) {\n let temp = bg[i - 1];\n newbg[i - 1] = bg[i];\n newbg[i] = temp;\n }\n }\n bg = newbg;\n newbg = [...bg];\n }\n return bg.toString();\n}\n", "lang": "Node.js", "bug_code_uid": "4035d4803939dcdf425713f9399f5df4", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "81a4e8cbf9de5110d1c65bf8dacd095a", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9529837251356239, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "\nlet _inputLines;\nlet _lineNumber = 0;\nlet inputReader = _inputReader ();\n\nfunction _main() {\n\t\n\t_inputLines = _inputData.trim().split('\\n').map((string) => {\n\t\treturn string.trim();\n\t});;\n\tlet [n, k] = inputReader.readNumberArray();\n\tlet arr = inputReader.readNumberArray();\n\tlet total = 0,\n\t\textra = 0,\n\t\tflag = false,\n\t\tdays = 0;\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (arr[i] >= 8) {\n\t\t\ttotal += 8;\n\t\t\textra += arr[i] - 8;\n\t\t\tdays++;\n\t\t} else {\n\t\t\ttotal += arr[i];\n\t\t\tif (extra > 0) {\n\t\t\t\tlet temp = 8 - arr[i];\n\t\t\t\textra -= temp;\n\t\t\t\ttotal += temp;\n\t\t\t}\n\t\t\tdays++;\n\t\t}\n\t\tif (total >= k) {\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t\t//console.log(total, extra);\n\t}\n\tif (flag) console.log(days);\n\telse console.log(-1);\n\n}\n\nvar _inputData = '';\nfunction cacheInput(data) {\n\t_inputData += data;\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', cacheInput).on('end', _main);\n\nfunction _inputReader () {\n\tfunction readNumberArray(){\n\t\treturn _inputLines[_lineNumber++].split(' ').map(val => Number(val));\n\t}\n\t\t\n\t\n\treturn {\n\t\treadNumberArray,\n\t}\n}", "lang": "Node.js", "bug_code_uid": "e5326ffa6028126e843a638406734d74", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "f09f93a4062dff97fbd456aafb7f4208", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.22259136212624583, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c);\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n run(parseInt(lines[0]),lines[0].length); \n});\n\nfunction run(x,n)\n{\n let table = [0];\n let j = \"\";\n for(let i=0;i0)\n {\n n = x.toString().length;\n let v1 = Math.abs(table[n+1]-x);\n let v2 = Math.abs(table[n]-x);\n if (v1 lines.push(line));\nrl.on('close', main);\nlet rli = 0;\nfunction readline() {\n return lines[rli++];\n}\n\nconst ra = ()=>readline().split(' ').map(a=>+a);\n\n/*---------------------------------------------------*/\n\nfunction div(val, by){\n return (val - val % by) / by;\n}\n\nconst getDigits = (x) => {\n let digits = new Array(10).fill(false);\n let len = 0;\n while (x) {\n len++;\n digits[x % 10n] = true;\n x /= 10n;\n }\n return [digits, len];\n}\n\nconst getLen = (x) => {\n let str = x.toString(10);\n return str.length;\n}\n\nconst calc = (t)=>{\n /* read */\n let [n, x] = readline().split(' ');\n n = +n;\n x = BigInt(x);\n\n let arr = new Array(10).fill(x);\n\n let q = [BigInt(x)];\n\n for (let steps = 1; steps <= 1000000; steps++) {\n let maxlen = 0;\n let newq = [];\n for (const num of q) {\n let [digits, len] = getDigits(num);\n if (len === n) return steps - 1;\n if (len > maxlen) maxlen = len;\n if (len < maxlen - 1) continue;\n for (let i = 9; i > 1; i--) {\n if (!digits[i]) continue;\n let newNum = num * BigInt(i);\n if (getLen(newNum) < maxlen) continue;\n newq.push(newNum);\n }\n }\n\n if (newq.length === 0) return -1;\n // if (q.length === 1 && newq.length === 1 && q[0] === newq[0]) return -1;\n newq.sort((x, y) => {\n if (y > x) return 1;\n if (x > y) return -1;\n return 0;\n });\n q = newq;\n\n // let newarr = new Array(10).fill(0);\n // for (let i = 1; i < 10; i++) {\n // let digits = getDigits(arr[i]);\n // for (let j = 1; j < 10; j++) {\n // if (!digits[j]) continue;\n // for\n // }\n // }\n }\n \n\n return -1;\n};\n\nfunction main() {\n // let T = +readline();\n let out = [];\n // for (let t = 1; t <= T; t++){\n out.push(calc());\n // process.stdout.write(`${calc(n, a)}\\n`);\n // }\n // process.stdout.write(`${calc()}\\n`);\n process.stdout.write(out.join('\\n')+'\\n');\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Node.js", "bug_code_uid": "2269b4e6ab03fac7c0252d8525395910", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "2b5f4c2468c1b6fb83b317bc51ea279c", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7503799392097265, "equal_cnt": 34, "replace_cnt": 9, "delete_cnt": 24, "insert_cnt": 0, "fix_ops_cnt": 33, "bug_source_code": "const lines = [];\nconst rl = require('readline').createInterface({ input: process.stdin, output: process.stdout });\nrl.on('line', line => lines.push(line));\nrl.on('close', main);\nlet rli = 0;\nfunction readline() {\n return lines[rli++];\n}\n\nconst ra = ()=>readline().split(' ').map(a=>+a);\n\n/*---------------------------------------------------*/\n\nfunction div(val, by){\n return (val - val % by) / by;\n}\n\nconst getDigits = (x) => {\n let digits = new Array(10).fill(false);\n let len = 0;\n while (x) {\n len++;\n digits[x % 10n] = true;\n x /= 10n;\n }\n return [digits, len];\n}\n\nconst getLen = (x) => {\n let str = x.toString(10);\n return str.length;\n}\n\nconst calc = (t)=>{\n /* read */\n let [n, x] = readline().split(' ');\n n = +n;\n x = BigInt(x);\n\n let arr = new Array(10).fill(x);\n\n let result = -1;\n\n\n const dfs = (num, depth = 0) => {\n if (result > -1) return;\n if (depth > 25) return;\n let next = [];\n let [digits, len] = getDigits(num);\n if (len === n) {\n result = depth;\n return;\n }\n for (let i = 9; i > 1; i--) {\n if (!digits[i]) continue;\n let newNum = num * BigInt(i);\n next.push(newNum);\n }\n next.sort((x, y) => {\n if (y > x) return 1;\n if (x > y) return -1;\n return 0;\n });\n // console.log('DEBUG next', next);\n for (let nx of next) {\n dfs(nx, depth + 1);\n }\n }\n\n dfs(x);\n\n // let q = [BigInt(x)];\n\n // for (let steps = 1; steps <= 1000000; steps++) {\n // let maxlen = 0;\n // let newq = [];\n // for (const num of q) {\n // let [digits, len] = getDigits(num);\n // if (len === n) return steps - 1;\n // if (len > maxlen) maxlen = len;\n // if (len < maxlen - 1) continue;\n // for (let i = 9; i > 1; i--) {\n // if (!digits[i]) continue;\n // let newNum = num * BigInt(i);\n // if (getLen(newNum) < maxlen) continue;\n // newq.push(newNum);\n // }\n // }\n\n // if (newq.length === 0) return -1;\n // // if (q.length === 1 && newq.length === 1 && q[0] === newq[0]) return -1;\n // newq.sort((x, y) => {\n // if (y > x) return 1;\n // if (x > y) return -1;\n // return 0;\n // });\n // q = newq;\n\n // // let newarr = new Array(10).fill(0);\n // // for (let i = 1; i < 10; i++) {\n // // let digits = getDigits(arr[i]);\n // // for (let j = 1; j < 10; j++) {\n // // if (!digits[j]) continue;\n // // for\n // // }\n // // }\n // }\n \n\n return result;\n};\n\nfunction main() {\n // let T = +readline();\n let out = [];\n // for (let t = 1; t <= T; t++){\n out.push(calc());\n // process.stdout.write(`${calc(n, a)}\\n`);\n // }\n // process.stdout.write(`${calc()}\\n`);\n process.stdout.write(out.join('\\n')+'\\n');\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Node.js", "bug_code_uid": "f4bc6b92d6224f8fe41b8a5277e3c99c", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "2b5f4c2468c1b6fb83b317bc51ea279c", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.9735503560528993, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "const rl = require(\"readline\").createInterface({\r\n input: process.stdin,\r\n output: process.stdout,\r\n});\r\n\r\nlet input = [];\r\nrl.on(\"line\", function (line) {\r\n input.push(line);\r\n}).on(\"close\", function () {\r\n solution(input);\r\n process.exit();\r\n});\r\n\r\nfunction solution(input) {\r\n const [N, X] = input[0].split(\" \").map(Number);\r\n const dist = new Map();\r\n dist.set(X, 0);\r\n queue = [X];\r\n while (queue.length > 0) {\r\n const val = queue.shift();\r\n const str = String(val);\r\n let splited = new Set(str.split(\"\"));\r\n\r\n if (str.length === N) {\r\n console.log(dist.get(val));\r\n return;\r\n }\r\n\r\n splited.delete(\"0\");\r\n if (splited.has(1) && splited.size === 1) {\r\n break;\r\n }\r\n splited.delete(\"1\");\r\n\r\n for (const s of splited) {\r\n const nextVal = val * Number(s);\r\n if (!dist.has(nextVal)) {\r\n dist.set(nextVal, dist.get(val) + 1);\r\n queue.push(nextVal);\r\n }\r\n }\r\n }\r\n console.log(-1);\r\n}\r\n", "lang": "Node.js", "bug_code_uid": "f68f75b7208c58a958ff8e4ddb76c1eb", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "7b2cee9c0d7560a821d6d2f1b334cb4c", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9833857207004939, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "'use strict';\r\n\r\nfunction solve(n, m) {\r\n const target = 10n ** (n - 1n);\r\n const queue = [[BigInt(m), 0]],\r\n cache = new Set();\r\n for (let [num, step] of queue) {\r\n const st = [];\r\n let tmp = num;\r\n while (num) {\r\n let cur = num % 10n;\r\n num = num / 10n;\r\n if (cur < 2n || st[cur]) continue;\r\n st[cur] = 1;\r\n let next = tmp * cur;\r\n if (cache.has(next)) continue;\r\n if (next >= target) {\r\n console.log(queue.length)\r\n return step + 1;\r\n }\r\n cache.add(next);\r\n queue.push([next, step + 1]);\r\n }\r\n }\r\n return -1;\r\n}\r\n\r\nasync function main(read) {\r\n try {\r\n let res = [];\r\n const [n, m] = (await read()).split(' ').map(BigInt);\r\n res.push(solve(n, m));\r\n console.log(res.join('\\n'));\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\n\r\nlet inputs,\r\n str = '';\r\nfunction read() {\r\n return inputs.next().value.trim();\r\n}\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf8');\r\nprocess.stdin.on('data', input => str += input);\r\nprocess.stdin.on('end', () => {\r\n inputs = str.split('\\n').values();\r\n main(read);\r\n});\r\n", "lang": "Node.js", "bug_code_uid": "7f11291966dd05e6983bb0572df7cea5", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "e0a9a944dafe1a8998c78144e2f7acc5", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.7633668607728957, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "const fs = require(\"fs\");\n\nconst input = fs.readFileSync(0, \"utf8\").trim().split(\"\\n\");\n\nconst testCases = [];\n\nfunction parseInput() {\n let index = 0;\n\n const [n, m] = input[index].split(\" \").map((item) => BigInt(item));\n const testCase = {\n n,\n m,\n };\n\n testCases.push(testCase);\n}\n\nfunction solution(testCase) {\n const { n, m } = testCase;\n\n const modulo = 998244353n;\n\n let result = 0n;\n let toRemove = m;\n const primes = [];\n let primeProd = 1n;\n let exp = m;\n\n for (let l = 2n; l <= n; l++) {\n if (!primes.find((p) => l % p == 0)) {\n primes.push(l);\n primeProd *= l;\n }\n if (toRemove) {\n toRemove *= m / primeProd;\n }\n exp = exp * m;\n result = (result + exp - toRemove + modulo) % modulo;\n }\n\n console.log((result % modulo).toString());\n}\n\nparseInput();\n\ntestCases.forEach(solution);\n", "lang": "Node.js", "bug_code_uid": "fc46f452896f2b7d5aca89d859b7c687", "src_uid": "0fdd91ed33431848614075ebe9d2ee68", "apr_id": "c30d0971c9f451f9b09308eaad47ed16", "difficulty": 1900, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Javascript"} {"similarity_score": 0.8923832923832924, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "const fs = require(\"fs\");\n\nconst input = fs.readFileSync(0, \"utf8\").trim().split(\"\\n\");\n\nconst testCases = [];\n\nfunction parseInput() {\n // T = parseInt(input[0]);\n // let index = 0;\n\n // for (let i = 0; i < T; i++) {\n // index++;\n const [n, m] = input[index].split(\" \").map((item) => BigInt(item));\n const testCase = {\n n,\n m,\n };\n testCases.push(testCase);\n // }\n}\n\nfunction solution(testCase) {\n const { n, m } = testCase;\n\n const modulo = 998244353n;\n\n let result = 0n;\n let toRemove = m;\n const primes = [];\n let primeProd = 1n;\n\n result = ((m ** (n + 1n) - 1n) / (m - 1n) - m - 1n) % modulo;\n\n for (let l = 2n; l <= n; l++) {\n if (!primes.find((p) => l % p == 0)) {\n primes.push(l);\n primeProd *= l;\n }\n if (toRemove) {\n toRemove *= m / primeProd;\n }\n if (toRemove == 0) break;\n result = (result - toRemove) % modulo;\n }\n\n console.log(((result + modulo) % modulo).toString());\n}\n\nparseInput();\n\ntestCases.forEach(solution);\n", "lang": "Node.js", "bug_code_uid": "be9fed0a3decb5fa403a651ce4ba51af", "src_uid": "0fdd91ed33431848614075ebe9d2ee68", "apr_id": "c30d0971c9f451f9b09308eaad47ed16", "difficulty": 1900, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.6853265479219678, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "const fs = require('fs');\r\nconst input = fs.readFileSync(0, 'utf8').trim().split('\\n');\r\nlet currentline = 0;\r\nfunction readline(){\r\n return input[currentline++];\r\n}\r\nvar T = readline();\r\nfor(var q=1;q<=T;q++) {\r\n let a = readline();\r\n var r = []\r\n var count = 0;\r\n for(var i=1;i*i<=a;i++) {\r\n \tif(r[i*i] === undefined) count++; r[i*i] = true;\r\n \tif(r[i*i*i] === undefined && (i*i) <= a/i) count++; r[i*i*i] = true;\r\n }\r\n console.log(count)\r\n}", "lang": "Node.js", "bug_code_uid": "96dfde8f77f119d9b21e9d65e256a6e3", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "13c07e9fc21272df82ca378e6db1068d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.8359592215013901, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "var len = readline();\r\nfor(var i=0;i<+len;i++)\r\n{\r\n var inputData = readline();\r\n var count = 0;\r\nfor(var j=1;j<=+inputData;j++)\r\n{\r\n if((Math.floor(Math.sqrt(j)) == Math.ceil(Math.sqrt(j)))\r\n && (Math.floor(Math.cbrt(j)) == Math.ceil(Math.cbrt(j))))\r\n {\r\n count++;\r\n }\r\n else if (Math.floor(Math.sqrt(j)) == Math.ceil(Math.sqrt(j)))\r\n count++;\r\n else if (Math.floor(Math.cbrt(j)) == Math.ceil(Math.cbrt(j)))\r\n count++;\r\n}\r\nprint(count);\r\n}\r\n", "lang": "JavaScript", "bug_code_uid": "5e3ac69c00bda22b03de1ccb0f266685", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "90bcd65c750f56ad0388a38e795ef431", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8381128584643849, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "var len = readline();\r\nfor(var i=0;i<+len;i++)\r\n{\r\n var inputData = readline();\r\n var count = 0;\r\nfor(var j=1;j*j<=+inputData;j++)\r\n{\r\n if((Math.floor(Math.sqrt(j)) == Math.ceil(Math.sqrt(j)))\r\n && (Math.floor(Math.cbrt(j)) == Math.ceil(Math.cbrt(j))))\r\n {\r\n count++;\r\n }\r\n else if (Math.floor(Math.sqrt(j)) == Math.ceil(Math.sqrt(j)))\r\n count++;\r\n else if (Math.floor(Math.cbrt(j)) == Math.ceil(Math.cbrt(j)))\r\n count++;\r\n}\r\nprint(count);\r\n}\r\n", "lang": "JavaScript", "bug_code_uid": "a152dd625bc404ca5b1e6a423fd86ca1", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "90bcd65c750f56ad0388a38e795ef431", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.602829162132753, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "let buf='';\r\n\r\nprocess.stdin.on('readable',function(){\r\n let chunk=process.stdin.read();\r\n if(chunk) buf+=chunk.toString();\r\n})\r\n\r\nprocess.stdin.on('end',function(){\r\n let line=buf.split(' ');\r\n let n=parseInt(line[0]),m=parseInt(line[1]);\r\n if(m!==1) console.log(n*(m-1));\r\n else console.log(n-1);\r\n})", "lang": "Node.js", "bug_code_uid": "142d7785ac77a0f02777bc4a1ea069a9", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "c79da7a4d5a21acfefdb07f88ca145d4", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9533333333333334, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "'use strict';\r\n\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf-8');\r\n\r\nlet inputString = '';\r\nlet currentLine = 0;\r\n\r\nprocess.stdin.on('data', stdin => inputString += stdin);\r\n\r\nprocess.stdin.on('end', _ => {\r\n inputString = inputString.trim().split('\\n').map(s => s.trim());\r\n main(); \r\n});\r\n\r\nfunction readline() {\r\n return inputString[currentLine++];\r\n}\r\n\r\nfunction output(x) {\r\n if (typeof x !== 'string') {\r\n x = x.toString();\r\n }\r\n //process.stdout.write(x); // without auto '\\n' (newline)\r\n console.log(x); // with auto '\\n' (newline)\r\n}\r\n\r\nfunction main() {\r\n /*let N = readline();\r\n\r\n for (let test = 0; test < N; test++) {*/\r\n let [r, c] = readline().split(' ').map(Number);\r\n if (c == 1) {\r\n output(r - 1);\r\n } else {\r\n output((c - 1) * r);\r\n }\r\n /*}*/\r\n}\r\n", "lang": "Node.js", "bug_code_uid": "3fd1c6d4408e974e3d6ecb40bb34f014", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "4142d43e5967e68673db0f491de2646f", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9980750721847931, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "'use strict';\r\n\r\nvar readline = require('readline');\r\n\r\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\r\n\r\nvar readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);\r\n\r\nasync function solve(r) {\r\n const rbs = async () => {\r\n return (await r()).split(' ').filter(s => s !== '').map(BigInt);\r\n };\r\n const [n, m] = await rbs();\r\n if (n === 1n) return m - 1n;\r\n return n * (m - 1n);\r\n}\r\n\r\nasync function main(r) {\r\n try {\r\n let t = 1;\r\n let res = new Array(t);\r\n for (let i = 0; i < t; i++) {\r\n res[i] = await solve(r);\r\n }\r\n return res.join('\\n');\r\n } catch (error) {\r\n console.log('zdebug' + error);\r\n }\r\n}\r\n\r\nconst rl = readline__default[\"default\"].createInterface({\r\n input: process.stdin,\r\n output: process.stdout\r\n});\r\nconst it = rl[Symbol.asyncIterator]();\r\nasync function read() {\r\n return (await it.next()).value;\r\n}\r\nvoid async function () {\r\n const output = await main(read);\r\n process.stdout.write(output);\r\n}();\r\n", "lang": "Node.js", "bug_code_uid": "798e92f9478b3c10af4fb56299d7bf67", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "68d0b6de90560a49c613b5c44723f0be", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8061401336964595, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "'use strict'\r\nObject.defineProperty(exports, '__esModule', { value: !0 })\r\nvar os = require('os')\r\nconst stdin = process.stdin,\r\n stdout = process.stdout,\r\n integerRegex = /-?\\d+/g,\r\n decimalRegex = /-?\\d+(?:\\.\\d+)?/g\r\nclass InputAndOutput {\r\n lineIndex = 0\r\n lines = []\r\n dried() {\r\n return this.lineIndex >= this.lines.length\r\n }\r\n readLine() {\r\n const e = this.lines[this.lineIndex]\r\n return (this.lineIndex += 1), e\r\n }\r\n readIntegersOfLine() {\r\n const e = this.readLine().match(integerRegex)\r\n return null == e ? [] : e.map(e => Number(e))\r\n }\r\n readNumsOfLine() {\r\n const e = this.readLine().match(decimalRegex)\r\n return null == e ? [] : e.map(e => Number(e))\r\n }\r\n print(e) {\r\n stdout.write(e)\r\n }\r\n async init() {\r\n const e = await this.readLines()\r\n this.lines = e\r\n }\r\n readLines() {\r\n const e = []\r\n return new Promise(n => {\r\n stdin.on('data', n => e.push(n)),\r\n stdin.on('end', function () {\r\n const t = e.join('').split(os.EOL)\r\n n(t)\r\n })\r\n })\r\n }\r\n}\r\nasync function __main__(e) {\r\n const n = new InputAndOutput()\r\n await n.init(), e(n)\r\n}\r\nconst MOD = BigInt(1000000007),\r\n MAX_N = 200010,\r\n f = new Array(MAX_N)\r\nfunction solve(e, n) {\r\n if (0 === n) return 1n\r\n const t = f[e - 1]\r\n let s = fastPower((t + MOD) % MOD, BigInt(n), MOD)\r\n if (0 == (1 & e)) return s\r\n let i = 1n\r\n for (let e = 1; e <= n; ++e) (s += i * f[n - e]), (i = (i * t) % MOD)\r\n return s\r\n}\r\nfunction fastPower(e, n, t) {\r\n let s = 1n\r\n for (let i = n, r = e; i > 0; i /= 2n, r = (r * r) % t)\r\n i % 2n === 1n && (s = (s * r) % t)\r\n return s\r\n}\r\n__main__(function (e) {\r\n f[0] = 1n\r\n for (let e = 1; e < MAX_N; ++e) f[e] = (2n * f[e - 1]) % MOD\r\n const n = Number(e.readLine())\r\n for (let t = 1; t <= n; ++t) {\r\n const [n, t] = e.readIntegersOfLine(),\r\n s = ((solve(n, t) % MOD) + MOD) % MOD\r\n e.print(s + '\\n')\r\n }\r\n})\r\n", "lang": "Node.js", "bug_code_uid": "2f6a8ba0a0479b92d9b9de1fccfbeb61", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "719d9bedca066c1330bb3c2137705f41", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7083438366523821, "equal_cnt": 26, "replace_cnt": 20, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 25, "bug_source_code": "'use strict'\r\nObject.defineProperty(exports, '__esModule', { value: !0 })\r\nvar os = require('os')\r\nconst stdin = process.stdin,\r\n stdout = process.stdout,\r\n integerRegex = /-?\\d+/g,\r\n decimalRegex = /-?\\d+(?:\\.\\d+)?/g\r\nclass InputAndOutput {\r\n lineIndex = 0\r\n lines = []\r\n dried() {\r\n return this.lineIndex >= this.lines.length\r\n }\r\n readLine() {\r\n const e = this.lines[this.lineIndex]\r\n return (this.lineIndex += 1), e\r\n }\r\n readIntegersOfLine() {\r\n const e = this.readLine().match(integerRegex)\r\n return null == e ? [] : e.map(e => Number(e))\r\n }\r\n readNumsOfLine() {\r\n const e = this.readLine().match(decimalRegex)\r\n return null == e ? [] : e.map(e => Number(e))\r\n }\r\n print(e) {\r\n stdout.write(e)\r\n }\r\n async init() {\r\n const e = await this.readLines()\r\n this.lines = e\r\n }\r\n readLines() {\r\n const e = []\r\n return new Promise(n => {\r\n stdin.on('data', n => e.push(n)),\r\n stdin.on('end', function () {\r\n const t = e.join('').split(os.EOL)\r\n n(t)\r\n })\r\n })\r\n }\r\n}\r\nasync function __main__(e) {\r\n const n = new InputAndOutput()\r\n await n.init(), e(n)\r\n}\r\nconst MOD = BigInt(1000000007)\r\nfunction solve(e, n) {\r\n if (0 === n) return 1n\r\n const t = fastPower(2n, BigInt(e - 1), MOD)\r\n let s = fastPower((t + MOD) % MOD, BigInt(n), MOD)\r\n if (0 == (1 & e)) return s\r\n for (let e = 1; e <= n; ++e)\r\n s += fastPower(t, BigInt(e - 1), MOD) * fastPower(2n, BigInt(n - e), MOD)\r\n return s\r\n}\r\nfunction fastPower(e, n, t) {\r\n let s = 1n\r\n for (let i = n, r = e; i > 0; i /= 2n, r = (r * r) % t)\r\n i % 2n === 1n && (s = (s * r) % t)\r\n return s\r\n}\r\n__main__(function (e) {\r\n const n = Number(e.readLine())\r\n for (let t = 1; t <= n; ++t) {\r\n const [n, t] = e.readIntegersOfLine(),\r\n s = ((solve(n, t) % MOD) + MOD) % MOD\r\n e.print(s + '\\n')\r\n }\r\n})\r\n", "lang": "Node.js", "bug_code_uid": "a2668917fbb4593a68a0bd931e84016b", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "719d9bedca066c1330bb3c2137705f41", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9997003296373989, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\"use strict\";\r\nconst fs = require(\"fs\");\r\n/let filename = \"0.txt\";\r\nlet filename = 0;\r\nconst input = fs.readFileSync(filename, \"utf8\").trim().split(\"\\n\");\r\nlet line = 0;\r\nfunction readline() {\r\n return input[line++];\r\n}\r\nfunction iInpArr() {\r\n return readline()\r\n .trim()\r\n .split(\" \")\r\n .map((cur) => parseInt(cur));\r\n}\r\nfunction BInpArr() {\r\n return readline()\r\n .trim()\r\n .split(\" \")\r\n .map((cur) => BigInt(cur));\r\n}\r\nfunction string() {\r\n return readline().trim();\r\n}\r\nfunction stringArr() {\r\n return readline().trim().split(\"\");\r\n}\r\n\r\nfunction stringArr1() {\r\n return readline().trim().split(\" \");\r\n}\r\nfunction getValue() {\r\n return parseInt(readline());\r\n}\r\nfunction iInpArr1() {\r\n return readline()\r\n .trim()\r\n .split(\"\")\r\n .map((cur) => parseInt(cur));\r\n}\r\nlet mod = 1e9 + 7;\r\nmod = BigInt(mod);\r\nconst pow = (num, exp, mod) => {\r\n if (exp === BigInt(0)) return BigInt(1);\r\n let x = pow(num, exp / BigInt(2), mod);\r\n if (exp % BigInt(2)) return (((x * x) % mod) * num) % mod;\r\n else return (x * x) % mod;\r\n};\r\nconst inverse = (num, exp) => {\r\n return pow(BigInt(num), BigInt(exp), BigInt(mod));\r\n};\r\nconst sqrt = (n) => {\r\n let low = 1n,\r\n high = n,\r\n ans;\r\n while (low <= high) {\r\n let mid = (low + high) / 2n;\r\n if (mid * mid <= n) {\r\n ans = mid;\r\n low = mid + 1n;\r\n } else high = mid - 1n;\r\n }\r\n return ans;\r\n};\r\n\r\nconst solve = () => {\r\n let t = 1;\r\n while (t--) {\r\n let n = getValue();\r\n let ans = 6n,\r\n k = 4n;\r\n for (let i = 2; i <= n; i++) {\r\n ans = (ans * ((k * k) % mod)) % mod;\r\n k = (k * k) % mod;\r\n }\r\n console.log(ans + \"\");\r\n }\r\n};\r\nsolve();\r\n", "lang": "Node.js", "bug_code_uid": "7a505d4dd59b35cdbbf5dd8dc3e9faa2", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "fb7b038fce0533e4afd0dde44a3994d4", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9167015487651737, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\nconst lines = []\nrl.on('line', (input) => {\n lines.push(input);\n})\nrl.on('close', () => {\n// (function() {\n // const lines = require('fs').readFileSync('test.in', 'utf8').split('\\n')\n let l = 0;\n let t = 1//+lines[l++]\n for (let i = 0; i < t; i++) {\n const n = +lines[l++]\n console.log(solve(n))\n }\n// })()\n})\n\nfunction solve(n) {\n let ans = 6\n let base = 4\n let count = 1\n for (let i = 2; i <= n; i++) {\n // base = mul(base, 4)\n count = mul(count, 2)\n ans = mul(ans, pow(base, count))\n }\n return ans\n}\nfunction add(a, b) {\n return (a + b) % (1e9 + 7)\n}\nfunction mul(a, b) {\n let r = 0\n let base = a\n while (b) {\n if (b & 1) {\n r = add(r, base)\n }\n b >>= 1\n base = add(base, base)\n }\n return r\n}\nfunction pow(a, b) {\n let r = 1\n let base = a\n while (b) {\n if (b & 1) {\n r = mul(r, base)\n }\n b >>= 1\n base = mul(base, base)\n }\n return r\n}\n", "lang": "Node.js", "bug_code_uid": "2922d30c7a83a245ffc9094eb649bb84", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "b5da8fe364d47d7303126566c6e22d14", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6981132075471698, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "let i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL)\n\n for(let i=0;i<3;i++) {\n const bitCount = 0;\n const line = i*2;\n let numbers = [...lines[line], ...lines[line + 1]].split(\" \");\n numbers = numbers.filter(num => num == '1')\n console.log(Math.ceil(numbers.length / 2));\n }\n})", "lang": "Node.js", "bug_code_uid": "6fa114a3fd15fb05f557bc333adda779", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "b0d2fbdaa0741223c972280db90576d7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.887144259077527, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "let input = ''\nprocess.stdin.on('data', c => input += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = input.split(EOL)\n const testCount = parseInt(lines[0]);\n lines.shift();\n\n for(let i=0;i num == '1');\n console.log(Math.ceil(numbers.length / 2));\n }\n})", "lang": "Node.js", "bug_code_uid": "8b8e3459aca3d7bda7e83761540d1068", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "b0d2fbdaa0741223c972280db90576d7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9644607843137255, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "var readline = require('readline');\n \nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nvar lines = [];\nrl.on('line', function(input) {\n lines.push(input);\n});\nrl.on('close', function() {\n var l = 0;\n var t = +lines[l++]\n for (var i = 0; i < t; i++) {\n var arr = lines[l++].trim().split(' ').map(Number)\n console.log(solve(arr) ? 'YES' : 'NO')\n }\n});\n\nfunction solve([n, m, k]) {\n if (n & 1) {\n const least = m / 2\n if (k < least) return false\n\n if (n === 1) return true\n const r = (k - least) % (n - 1)\n // console.log(n, m, k, r)\n return !(r & 1)\n } else {\n if (m & 1) {\n return !(k & 1)\n } else {\n return !(k & 1)\n }\n }\n}\n", "lang": "Node.js", "bug_code_uid": "4c83dd37a4b61407b32939833e8a3585", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "bfa2d2aa28b7dd361ba5426e2dd16932", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.9996988858777477, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "'use strict';\r\nconst readline = require('readline');\r\nconst util = require('util');\r\nconst rl = readline.createInterface({\r\n input: process.stdin,\r\n});\r\nlet pos = 0;\r\nconst words = [];\r\nrl.on('line', (line) => {\r\n words.push.apply(words, line.split(' ').filter(s => s != ''));\r\n});\r\nrl.on('close', main);\r\nfunction check(b) {\r\n if (!b) {\r\n process.stderr.write(`${new Error().stack}\\n`);\r\n process.exit(-1);\r\n }\r\n}\r\nfunction printf(...args) {\r\n process.stdout.write(util.format(...args));\r\n}\r\nfunction nextInt() {\r\n return Math.trunc(Number(words[pos++]));\r\n}\r\nfunction nextStr() {\r\n return words[pos++];\r\n}\r\nfunction af(l) {\r\n return Array.from({ length: l });\r\n}\r\nconst INIT = -1;\r\nlet n;\r\nlet m;\r\nlet k;\r\nfunction solve() {\r\n let meven = (m % 2) == 0;\r\n let neven = (n % 2) == 0;\r\n let keven = (k % 2) == 0;\r\n if (meven && neven) {\r\n // necessary and sufficient that there are pairs of horiz to create 4x4 blocks\r\n return keven;\r\n }\r\n else if (meven) {\r\n // need at least one row of horiz, and remainder are even\r\n let rem = k - Math.trunc(m / 2);\r\n let remeven = (rem % 2) == 0;\r\n return k * 2 > m && remeven;\r\n }\r\n else {\r\n let lim = (m - 1) * n;\r\n let used = k * 2;\r\n if (used > lim) {\r\n return false;\r\n }\r\n return keven;\r\n }\r\n}\r\nfunction main() {\r\n let tc = nextInt();\r\n while (tc-- > 0) {\r\n n = nextInt();\r\n m = nextInt();\r\n k = nextInt();\r\n if (solve()) {\r\n printf(\"YES\\n\");\r\n }\r\n else {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}\r\n", "lang": "Node.js", "bug_code_uid": "87784bbf9c75e5d998de0a0a596aa6f8", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "c28e8c599af4e2b06744e23bef4ceaff", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"} {"similarity_score": 0.7581120943952803, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "\nprocess.stdin.on('data', c => i += c);\nprocess.stdin.on('end', () => {\n const {EOL} = require('os');\n const lines = i.split(EOL);\n var t = lines[0]\n for(j = 1; j <= t; j++){\n var n = lines[j]\n if(n == 1){\n console.log(1)\n }else if(n == 3){\n console.log(7)\n }\n }\n});\n ", "lang": "Node.js", "bug_code_uid": "5b06787cb15506cc5a96514b3ad2dace", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "09c7c86f5cd849f79375777ebd32bf3f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.7797101449275362, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "let i = '';\n\nprocess.stdin.on('data', c => i += c);\nprocess.stdin.on('end', () => {\n const {EOL} = require('os');\n const lines = i.split(EOL);\n var t = lines[0]\n for(j = 1; j <= t; j++){\n var n = lines[j]\n if(n == 1){\n console.log(1)\n }else if(n == 3){\n console.log(7)\n }\n }\n});\n ", "lang": "Node.js", "bug_code_uid": "dcf52fa403bfff4e80aebd72c065a218", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "09c7c86f5cd849f79375777ebd32bf3f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.34896233666410453, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "let stepeni = [1, 2]\r\nlet stepen = function (n) {\r\n if (stepeni[n]) return stepeni[n];\r\n let l = stepeni.length - 1;\r\n while (l < n) {\r\n stepeni.push(2 * stepeni[l++]);\r\n }\r\n return stepeni[n];\r\n}\r\n\r\nlet i = ''\r\nprocess.stdin.on('data', c => i += c)\r\nprocess.stdin.on('end', () => {\r\n const { EOL } = require('os')\r\n const lines = i.split(EOL) /*your input text, split by lines*/\r\n lines.slice(1).map(e => console.log((stepen(parseInt(e)) - 1)))\r\n})", "lang": "Node.js", "bug_code_uid": "f77a2b7c8114be0dc081659745e2c3f8", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "9a88246748c615020e73668fa010445c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9912826899128269, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "var readline = require('readline');\r\nvar rl = readline.createInterface({\r\n input: process.stdin,\r\n output: process.stdout,\r\n terminal: true\r\n});\r\n\r\nlet ls = [];\r\n\r\nfunction solve(){\r\n const len = parseInt(ls[0]);\r\n for (let i = 1; i <= len; i++){\r\n console.log(Math.pow(2, parseInt(ls[i])) - 1);\r\n }\r\n}\r\n\r\nrl.on('line', (l) => ls.push(`${l}`));\r\nrl.on('close', () => solve());", "lang": "Node.js", "bug_code_uid": "b050e2736f92195a67acbf52e2d690a1", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "b647b34682bb61b58ea2202a458100a1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.6851255634256278, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "var dataitr;\r\nvar stdin_input = \"\";\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding(\"ascii\");\r\nprocess.stdin.on(\"data\", function (input) { stdin_input += input; });\r\nprocess.stdin.on(\"end\", function () { dataitr = stdin_input.split('\\n').values(); main(); });\r\n\r\nconst rl = () => dataitr.next().value.trim();\r\nconst rn = () => Number(rl());\r\nconst ra = () => rl().split(' ');\r\nconst rna = () => ra().map(x => Number(x));\r\n\r\nconst MOD = 998244353;\r\n\r\nfunction countDivisors (n) {\r\n let cnt = 0; let i;\r\n for (i = 1; i*i < n; i++) \r\n if (n % i == 0)\r\n cnt += 2;\r\n cnt += i*i == n;\r\n return cnt;\r\n}\r\n\r\nfunction main () {\r\n\tconst n = rn();\r\n\r\n\tlet ans = 0;\r\n\tlet psm = 0;\r\n\tfor (let i = 1; i <= n ; i++) {\r\n\t\tans = countDivisors(i) + psm;\r\n\t\tpsm = (psm + ans) % MOD;\r\n\t}\r\n\r\n\tconsole.log(ans);\r\n}\r\n\r\n", "lang": "Node.js", "bug_code_uid": "b48cef9cdb7110b17832acd39447a822", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "46becd938ac73627c52454dafa6c9052", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9998939319428776, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "function _defineProperties(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var fs=require(\"fs\"),configPath=\"./compe.config.json\";function proc(t,e){if(global.MOD_=998244353,global.MOD_CUT=444595123,fs.existsSync(configPath)){if(!fs.existsSync(e))return void console.log(\"Input directory does not exist\");var r=fs.readFileSync(e,{encoding:\"utf-8\"}),n=0;r=r.split(/ |\\n|\\r/g);for(var i,o=[],s=_createForOfIteratorHelperLoose(r);!(i=s()).done;){var a=i.value;a.length>0&&o.push(a)}global.rnum=function(t){return t?o.slice(n,n+=t).map((function(t){return+t})):+o[n++]},global.rstr=function(t){return t?o.slice(n,n+=t):o[n++]},global.rbig=function(t){return t?o.slice(n,n+=t).map((function(t){return BigInt(t)})):BigInt(o[n++])},global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&n.push(o)}global.rnum=function(t){return t?n.slice(e,e+=t).map((function(t){return+t})):+n[e++]},global.rstr=function(t){return t?n.slice(e,e+=t):n[e++]},global.rbig=function(t){return t?n.slice(e,e+=t).map((function(t){return BigInt(t)})):BigInt(n[e++])};var s=\"\";global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}Object.defineProperty(exports,\"__esModule\",{value:!0});var ErrorGenerator,ForOfAdaptor=function(t){function e(t,e){this.it_=t,this.last_=e}var r=e.prototype;return r.next=function(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};var t=this.it_;return this.it_=this.it_.next(),{done:!1,value:t.value}},r[t]=function(){return this},e}(Symbol.iterator),Container=function(t){function e(){}var r=e.prototype;return r.empty=function(){return 0===this.size()},r.rbegin=function(){return this.end().reverse()},r.rend=function(){return this.begin().reverse()},r[t]=function(){return new ForOfAdaptor(this.begin(),this.end())},r.toJSON=function(){for(var t,e=[],r=_createForOfIteratorHelperLoose$1(this);!(t=r()).done;){var n=t.value;e.push(n)}return e},e}(Symbol.iterator),NativeArrayIterator=function(){function t(t,e){this.data_=t,this.index_=e}var e=t.prototype;return e.index=function(){return this.index_},e.prev=function(){return--this.index_,this},e.next=function(){return++this.index_,this},e.advance=function(t){return this.index_+=t,this},e.equals=function(t){return this.data_===t.data_&&this.index_===t.index_},e.swap=function(t){var e=[t.data_,this.data_];this.data_=e[0],t.data_=e[1];var r=[t.index_,this.index_];this.index_=r[0],t.index_=r[1]},_createClass$1(t,[{key:\"value\",get:function(){return this.data_[this.index_]}}]),t}(),SetContainer=function(t){function e(e){var r;return(r=t.call(this)||this).data_=e(_assertThisInitialized(r)),r}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(t,e)},r.clear=function(){this.data_.clear()},r.begin=function(){return this.data_.begin()},r.end=function(){return this.data_.end()},r.has=function(t){return!this.find(t).equals(this.end())},r.size=function(){return this.data_.size()},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r (index = \"+n+\").\")},t.excessive_index=function(t,r,n,i){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric index is equal or greater than size -> (index = \"+n+\", size: \"+i+\").\")},t.not_my_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is not this container's own.\")},t.erased_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator, it already has been erased.\")},t.negative_iterator=function(t,r,n){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is directing negative position -> (index = \"+n+\").\")},t.iterator_end_value=function(t,r){void 0===r&&(r=\"end\");var n=e(t);return new OutOfRange(\"Error on \"+n+\".Iterator.value: cannot access to the \"+n+\".\"+r+\"().value.\")},t.key_nout_found=function(t,r,n){throw new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): unable to find the matched key -> \"+n)}}(ErrorGenerator||(ErrorGenerator={}));var IAssociativeContainer,UniqueSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.count=function(t){return this.find(t).equals(this.end())?0:1},r.insert=function(){for(var e,r=arguments.length,n=new Array(r),i=0;i1?e-1:0),n=1;n=1&&r[0]instanceof Array?(i=function(){var e=r[0];t.push.apply(t,e)},o=r.slice(1)):r.length>=2&&r[0].next instanceof Function&&r[1].next instanceof Function?(i=function(){var e=r[0],n=r[1];t.assign(e,n)},o=r.slice(2)):(i=null,o=r),{ramda:i,tail:o}}}(IAssociativeContainer||(IAssociativeContainer={}));var is_node_=null;function is_node(){return null===is_node_&&(is_node_=\"object\"==typeof global&&\"object\"==typeof global.process&&\"object\"==typeof global.process.versions&&void 0!==global.process.versions.node),is_node_}function _Get_root(){return null===__s_pRoot&&void 0===(__s_pRoot=is_node()?global:self).__s_iUID&&(__s_pRoot.__s_iUID=0),__s_pRoot}var ITreeContainer,__s_pRoot=null;function get_uid(t){if(t instanceof Object){if(!1===t.hasOwnProperty(\"__get_m_iUID\")){var e=++_Get_root().__s_iUID;Object.defineProperty(t,\"__get_m_iUID\",{value:function(){return e}})}return t.__get_m_iUID()}return void 0===t?-1:0}function equal_to(t,e){return t=t?t.valueOf():t,e=e?e.valueOf():e,t instanceof Object&&t.equals instanceof Function?t.equals(e):t===e}function less(t,e){return t=t.valueOf(),e=e.valueOf(),t instanceof Object?t.less instanceof Function?t.less(e):get_uid(t)3?o-3:0),a=3;a=1&&(i=h.tail[0])}r(i),null!==n&&n()},t.emplacable=function(t,e,r){var n=e.prev(),i=n.equals(t.end())||t.value_comp()(n.value,r);return i=i&&(e.equals(t.end())||t.value_comp()(r,e.value))}}(ITreeContainer||(ITreeContainer={}));var INIT_VALUE=2166136261,MULTIPLIER=16777619,Pair=function(){function t(t,e){this.first=t,this.second=e}var e=t.prototype;return e.equals=function(t){return equal_to(this.first,t.first)&&equal_to(this.second,t.second)},e.less=function(t){return!1===equal_to(this.first,t.first)?less(this.first,t.first):less(this.second,t.second)},e.hashCode=function(){return hash(this.first,this.second)},t}(),UniqueTreeSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.find=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(t,e.value)?e:this.end()},r.equal_range=function(t){var e=this.lower_bound(t);return new Pair(e,!e.equals(this.end())&&this._Key_eq(t,e.value)?e.next():e)},r.value_comp=function(){return this.key_comp()},r._Key_eq=function(t,e){return!this.key_comp()(t,e)&&!this.key_comp()(e,t)},r._Insert_by_key=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(e.value,t)?new Pair(e,!1):(e=this.data_.insert(e,t),this._Handle_insert(e,e.next()),new Pair(e,!0))},r._Insert_by_hint=function(t,e){if(ITreeContainer.emplacable(this,t,e)){var r=this.data_.insert(t,e);return this._Handle_insert(r,r.next()),r}return this._Insert_by_key(e).first},e}(UniqueSet),ListIterator=function(){function t(t,e,r){this.prev_=t,this.next_=e,this.value_=r}t._Set_prev=function(t,e){t.prev_=e},t._Set_next=function(t,e){t.next_=e};var e=t.prototype;return e.prev=function(){return this.prev_},e.next=function(){return this.next_},e._Try_value=function(){if(void 0===this.value_&&!0===this.equals(this.source().end()))throw ErrorGenerator.iterator_end_value(this.source())},e.equals=function(t){return this===t},_createClass$1(t,[{key:\"value\",get:function(){return this._Try_value(),this.value_}}]),t}(),Repeater=function(){function t(t,e){this.index_=t,this.value_=e}var e=t.prototype;return e.index=function(){return this.index_},e.next=function(){return++this.index_,this},e.equals=function(t){return this.index_===t.index_},_createClass$1(t,[{key:\"value\",get:function(){return this.value_}}]),t}();function advance(t,e){if(0===e)return t;if(t.advance instanceof Function)return t.advance(e);var r;if(e<0){if(!(t.prev instanceof Function))throw new InvalidArgument(\"Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.\");r=function(t){return t.prev()},e=-e}else r=function(t){return t.next()};for(;e-- >0;)t=r(t);return t}var ListContainer=function(t){function e(){var e;return(e=t.call(this)||this).end_=e._Create_iterator(null,null),e.clear(),e}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(this.end(),t,e)},r.clear=function(){ListIterator._Set_prev(this.end_,this.end_),ListIterator._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0},r.resize=function(t){var e=t-this.size();e>0?this.insert(this.end(),e,void 0):e<0&&this.erase(advance(this.end(),-e),this.end())},r.begin=function(){return this.begin_},r.end=function(){return this.end_},r.size=function(){return this.size_},r.push_front=function(t){this.insert(this.begin_,t)},r.push_back=function(t){this.insert(this.end_,t)},r.pop_front=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_front\");this.erase(this.begin_)},r.pop_back=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_back\");this.erase(this.end_.prev())},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r=0;--o){var s=this.tryEntries[o],a=s.completion;if(\"root\"===s.tryLoc)return i(\"end\");if(s.tryLoc<=this.prev){var u=n.call(s,\"catchLoc\"),h=n.call(s,\"finallyLoc\");if(u&&h){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;k(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:z(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){\"object\"==typeof globalThis?globalThis.regeneratorRuntime=e:Function(\"r\",\"regeneratorRuntime = r\")(e)}})),Deque=function(t){function e(t){this.head=0,this.tail=0,this.mask=1,this.list=new Array(2),t&&this.extend(t)}var r=e.prototype;return r.extend=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.push(n)}return this},r.extendFront=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.pushFront(n)}return this},r._resize=function(t,e){var r=this.head,n=this.mask;if(this.head=0,this.tail=t,this.mask=e-1,0!==r){for(var i=new Array(e),o=0;o=r||t<-r)throw new RangeError(\"deque index out of range\");return i[(t>=0?e:n)+t&this.mask]},r.indexOf=function(t,e){void 0===e&&(e=0);for(var r=this.head,n=this.list,i=this.size,o=this.mask,s=e>=0?e:e<-i?0:i+e;s>>1&&this._resize(this.size,this.list.length>>>1),t},r.popFront=function(){if(this.head===this.tail)throw new RangeError(\"pop from an empty deque\");var t=this.list[this.head];return this.list[this.head]=void 0,this.head=this.head+1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),t},r.delete=function(t){if(t>=this.size||t<0)throw new RangeError(\"deque index out of range\");for(var e=this.head+t&this.mask;e!==this.tail;){var r=e+1&this.mask;this.list[e]=this.list[r],e=r}return this.tail=this.tail-1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),this},r.reverse=function(){for(var t=this.head,e=this.tail,r=this.size,n=this.mask,i=0;i<~~(r/2);i++){var o=e-i-1&n,s=t+i&n,a=this.list[o];this.list[o]=this.list[s],this.list[s]=a}return this},r.rotate=function(t){void 0===t&&(t=1);var e=this.head,r=this.tail;if(0===t||e===r)return this;if(this.head=e-t&this.mask,this.tail=r-t&this.mask,t>0)for(var n=1;n<=t;n++){var i=e-n&this.mask,o=r-n&this.mask;this.list[i]=this.list[o],this.list[o]=void 0}else for(var s=0;s>t;s--){var a=r-s&this.mask,u=e-s&this.mask;this.list[a]=this.list[u],this.list[u]=void 0}return this},r.entries=runtime_1.mark((function t(){var e,r,n,i,o;return runtime_1.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.head,r=this.size,n=this.list,i=this.mask,o=0;case 2:if(!(o=1){var e;if(\"object\"==typeof t)throw new Error(\"The value can not be object\");var r=[t,[]],n=0,i=1;r[0]=new Array((e=(arguments.length<=1?0:arguments.length-1)-1+1)<1||arguments.length<=e?void 0:arguments[e]);for(var o=0;o=0;s--){if(!Number.isInteger(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]))throw new Error(\"Please pass integer arguments for array size\");r[i]=new Array(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);for(var a=0;a<(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);a++)r[i][a]=r[n].slice();var u=[i,n];n=u[0],i=u[1]}return r[n]}},vectorArray=function(t){for(var e=new Array(t),r=0;rthis.p[e]){var r=[e,t];t=r[0],e=r[1]}return this.p[t]+=this.p[e],this.p[e]=t,!0},e.size=function(t){return t=this.group(t),-this.p[t]},t}(),PriorityQueue=function(){function t(t){this.comparator=t||function(t,e){return t0&&(r=e>>1,!this.comparator(this.elem[e],this.elem[r]));)this.swap(e,r),e=r},e.pop=function(){var t=this.top,e=this.elem.pop(),r=this.size;if(0==r)return t;this.elem[0]=e;for(var n=0,i=0,o=0,s=0;n=0;t=(t&t+1)-1)e=this.updateMethod(e,this.cont[t]);return e},e.update=function(t,e){for(;t<=this.elemCount;t|=t+1)this.cont[t]=this.updateMethod(this.cont[t],e)},t}(),SegmentTree=function(){function t(t,e,r,n){if(void 0===n&&(n=null),this.identityValue=e,this.merger=r,this.elemCount=t,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;o--)this.internalUpdate(o)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.set=function(t,e){t+=this.size,this.cont[t]=e;for(var r=1;r<=this.log;r++)this.internalUpdate(t>>r)},e.get=function(t){return t?this.cont[t+this.size]:this.cont.slice(this.size,this.size+this.elemCount)},e.query=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.elemCount-1),e++;var r=this.identityValue,n=this.identityValue;for(t+=this.size,e+=this.size;t>=1,e>>=1;return this.merger(r,n)},e.all=function(){return this.cont[1]},t}(),LazySegmentTree=function(){function t(t,e,r,n,i,o,s){if(void 0===s&&(s=null),this.identityValue=e,this.merger=r,this.identityLazy=n,this.pusher=i,this.modifier=o,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;u--)this.internalUpdate(u)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.internalModify=function(t,e){e!==this.identityLazy&&(this.cont[t]=this.modifier(this.cont[t],e),t=1;r--)this.internalPush(t>>r);this.cont[t]=e;for(var n=1;n<=this.log;n++)this.internalUpdate(t>>n)},e.get=function(t){t+=this.size;for(var e=this.log;e>=1;e--)this.internalPush(t>>e);return this.cont[t]},e.query=function(t,e){e++,t+=this.size,e+=this.size;for(var r=this.log;r>=1;r--)t>>r<>r),e>>r<>r);for(var n=this.identityValue,i=this.identityValue;t>=1,e>>=1;return this.merger(n,i)},e.all=function(){return this.cont[1]},e.update=function(t,e,r){e++,t+=this.size,e+=this.size;for(var n=this.log;n>=1;n--)t>>n<>n),e>>n<>n);for(var i=t,o=e;t>=1,e>>=1;t=i,e=o;for(var s=1;s<=this.log;s++)t>>s<>s),e>>s<>s)},t}(),defaultComparator=function(t,e){return t>>1)],e)?r=o+1:n=o;return r},upperBound=function(t,e,r,n,i){var o;for(void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=defaultComparator),n||(n=t.length);r>>1)])?n=o:r=o+1;return r},binarySearch=function(t,e,r){for(var n,i=null;t<=e;)r(n=t+e>>1)?(i=n,e=n-1):t=n+1;return i},ternarySearch=function(t,e,r,n,i){var o,s;if(void 0===n&&(n=!1),void 0===i&&(i=200),n)for(;i--;)s=e-(e-t)/3,r(o=t+(e-t)/3)>1),r(i-1)>1),r(a-1)>u?(h=u,t=a+1):e=a-1;return h},Graph=function(){function t(t){this.g=vectorArray(t+1),this.vis=multiArray(!1,t+1),this.par=multiArray(-1,t+1)}var e=t.prototype;return e.addEdge=function(t,e,r){this.g[t].push({to:e,prop:r})},e.addBiEdge=function(t,e,r){this.addEdge(t,e,r),this.addEdge(e,t,r)},e.reset=function(){this.vis=multiArray(!1,this.g.length),this.par=multiArray(-1,this.g.length)},t}(),dfs=function(t,e,r,n){var i=new Deque;for(i.push(e);i.size;){var o=i.back;if(t.vis[o])n(o,t),i.pop();else{t.vis[o]=!0,r(o,t);for(var s,a=_createForOfIteratorHelperLoose(t.g[o]);!(s=a()).done;){var u=s.value;t.vis[u.to]||(t.par[u.to]=o,i.push(u.to))}}}},bfs=function(t,e,r){var n=new Deque;if(n.push(e),Array.isArray(e))for(var i,o=_createForOfIteratorHelperLoose(e);!(i=o()).done;){var s=i.value;t.vis[s]=!0,n.push(s)}else t.vis[e]=!0,n.push(e);for(;n.size;){var a=n.pop();r(a,t);for(var u,h=_createForOfIteratorHelperLoose(t.g[a]);!(u=h()).done;){var l=u.value;t.vis[l.to]||(t.par[l.to]=a,n.push(l.to),t.vis[l.to]=!0)}}},mst=function(t){for(var e=0,r=[],n=[],i=0;ii[r]+f.prop.weight&&(i[f.to]=i[r]+f.prop.weight,t.par[f.to]=r,o[f.to]||(o[f.to]=!0,s.push(f.to)))}}return{parArray:t.par,distArray:i}},dijkstra=function(t,e){t.reset();var r=new PriorityQueue((function(t,e){return t.dist>e.dist})),n=Number.MAX_SAFE_INTEGER,i=multiArray(n,t.g.length);if(Array.isArray(e))for(var o,s=_createForOfIteratorHelperLoose(e);!(o=s()).done;){var a=o.value;r.push({node:a,dist:0}),i[a]=0}else r.push({node:e,dist:0}),i[e]=0;for(;r.size;){var u=r.pop();if(i[u.node]===u.dist)for(var h,l=_createForOfIteratorHelperLoose(t.g[u.node]);!(h=l()).done;){var c=h.value;i[c.to]>i[u.node]+c.prop.weight&&(i[c.to]=i[u.node]+c.prop.weight,t.par[c.to]=u.node,r.push({node:c.to,dist:i[c.to]}))}}return{parArray:t.par,distArray:i}},setMod=function(t){global.MOD_=t,global.MOD_CUT=1099511627776%t},add=function(){for(var t=arguments.length,e=new Array(t),r=0;r=1;n--)e[0]+=e[n],e[0]=e[0]>=global.MOD_?e[0]-global.MOD_:e[0];return e[0]},sub=function(t,e){return(t+=global.MOD_-e)>=global.MOD_?t-global.MOD_:t},mul=function(){for(var t=arguments.length<=0?void 0:arguments[0],e=1;e>20)*((e<0||arguments.length<=e?void 0:arguments[e])>>20)*global.MOD_CUT+(4293918720&t)*(1048575&(e<0||arguments.length<=e?void 0:arguments[e]))+(1048575&t)*(e<0||arguments.length<=e?void 0:arguments[e]))%global.MOD_;return t},pow=function(t,e){for(var r=1;e;)1&e&&(r=mul(r,t)),t=mul(t,t),e>>>=1;return r},inv=function(t){for(var e,r=1,n=0,i=global.MOD_;i;n=(o=[r,n-e*r])[0],r=o[1],o){var o,s;i=(s=[t,i-(e=i/t|0)*t])[0],t=s[1]}return r<0?r+global.MOD_:r},factSetup=function(t){void 0===t&&(t=2e5),global.factorial=Array(t+1).fill(1),global.invFactorial=Array(t+1).fill(1);for(var e=1;e<=t;e++)global.factorial[e]=mul(global.factorial[e-1],e);global.invFactorial[t]=inv(global.factorial[t]);for(var r=t-1;r>=1;r--)global.invFactorial[r]=mul(global.invFactorial[r+1],r+1)},binom=function(t,e){return e>t?0:mul(global.factorial[t],global.invFactorial[e],global.invFactorial[t-e])},fact=function(t){return global.factorial[t]},Tree=function(t){function e(e,r){var n;return(n=t.call(this,e)||this).root=1,n.root=r,n.childCount=Array(e+1).fill(1),n.distRoot=Array(e+1).fill(0),n.distance=Array(e+1).fill(0),n}_inheritsLoose(e,t);var r=e.prototype;return r.setupDist=function(){var t=this;dfs(this,this.root,(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(o.prop&&(t.distance[o.to]=t.distance[e]+o.prop.weight),t.distRoot[o.to]=t.distRoot[e]+1)}}),(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(t.childCount[e]+=t.childCount[o.to])}}))},r.setupLCA=function(){this.setupDist();var t=31-Math.clz32(this.g.length);this.log=t,this.parentLift=Array(t+1),this.parentLift[0]=this.par;for(var e=1;e<=t;e++){this.parentLift[e]=Array(this.g.length).fill(-1);for(var r=0;r=0;n--)this.distRoot[t]-(1<=this.distRoot[e]&&(t=this.parentLift[n][t]);if(t===e)return t;for(var i=this.log;i>=0;i--)this.parentLift[i][t]!=this.parentLift[i][e]&&(t=this.parentLift[i][t],e=this.parentLift[i][e]);return this.parentLift[0][t]},e}(Graph);\r\n\r\nfunction main() {\r\n // write your code from here\r\n let [n, x] = rnum(2);\r\n let dp = multiArray(0, n + 1, x + 1);\r\n let p = multiArray(0, n + 1, x + 1);\r\n dp[0][0] = 1;\r\n for (let i = 0; i <= n; i ++) {\r\n for (let j = 1; j <= x; j ++) {\r\n p[i][j] = pow(j, i);\r\n }\r\n }\r\n factSetup();\r\n for (let i = 2; i <= n; i ++) {\r\n for (let j = 1; j < i; j ++) {\r\n dp[i][j] = mul(binom(n, i), sub(p[i][j], p[i][j - 1]));\r\n }\r\n }\r\n for (let i = 2; i <= n; i ++) {\r\n for (let j = 1; j <= x; j ++) {\r\n for (let k = 0; i + k <= n && i + j + k - 1 <= x; k ++) {\r\n dp[i + k][i + j + k - 1] = add(dp[i + k][i + j + k - 1], dp[i][j] * binom(n - i, k) * p[k][i + k - 1]);\r\n }\r\n }\r\n }\r\n let ans = 0;\r\n for (let i = 1; i <= x; i ++)\r\n ans = add(ans, dp[n][i]);\r\n print(ans);\r\n}\r\nproc(main, 'input.txt');\r\n\r\n\r\n// Generated with compe.js - https://github.com/polarity-cf/compe.js", "lang": "Node.js", "bug_code_uid": "c1c18819dd07c2710e288b5952766cf7", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "4c47aa2f35674553afa036ba5954d881", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.999894707622211, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "function _defineProperties(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var fs=require(\"fs\"),configPath=\"./compe.config.json\";function proc(t,e){if(global.MOD_=998244353,global.MOD_CUT=444595123,fs.existsSync(configPath)){if(!fs.existsSync(e))return void console.log(\"Input directory does not exist\");var r=fs.readFileSync(e,{encoding:\"utf-8\"}),n=0;r=r.split(/ |\\n|\\r/g);for(var i,o=[],s=_createForOfIteratorHelperLoose(r);!(i=s()).done;){var a=i.value;a.length>0&&o.push(a)}global.rnum=function(t){return t?o.slice(n,n+=t).map((function(t){return+t})):+o[n++]},global.rstr=function(t){return t?o.slice(n,n+=t):o[n++]},global.rbig=function(t){return t?o.slice(n,n+=t).map((function(t){return BigInt(t)})):BigInt(o[n++])},global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&n.push(o)}global.rnum=function(t){return t?n.slice(e,e+=t).map((function(t){return+t})):+n[e++]},global.rstr=function(t){return t?n.slice(e,e+=t):n[e++]},global.rbig=function(t){return t?n.slice(e,e+=t).map((function(t){return BigInt(t)})):BigInt(n[e++])};var s=\"\";global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}Object.defineProperty(exports,\"__esModule\",{value:!0});var ErrorGenerator,ForOfAdaptor=function(t){function e(t,e){this.it_=t,this.last_=e}var r=e.prototype;return r.next=function(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};var t=this.it_;return this.it_=this.it_.next(),{done:!1,value:t.value}},r[t]=function(){return this},e}(Symbol.iterator),Container=function(t){function e(){}var r=e.prototype;return r.empty=function(){return 0===this.size()},r.rbegin=function(){return this.end().reverse()},r.rend=function(){return this.begin().reverse()},r[t]=function(){return new ForOfAdaptor(this.begin(),this.end())},r.toJSON=function(){for(var t,e=[],r=_createForOfIteratorHelperLoose$1(this);!(t=r()).done;){var n=t.value;e.push(n)}return e},e}(Symbol.iterator),NativeArrayIterator=function(){function t(t,e){this.data_=t,this.index_=e}var e=t.prototype;return e.index=function(){return this.index_},e.prev=function(){return--this.index_,this},e.next=function(){return++this.index_,this},e.advance=function(t){return this.index_+=t,this},e.equals=function(t){return this.data_===t.data_&&this.index_===t.index_},e.swap=function(t){var e=[t.data_,this.data_];this.data_=e[0],t.data_=e[1];var r=[t.index_,this.index_];this.index_=r[0],t.index_=r[1]},_createClass$1(t,[{key:\"value\",get:function(){return this.data_[this.index_]}}]),t}(),SetContainer=function(t){function e(e){var r;return(r=t.call(this)||this).data_=e(_assertThisInitialized(r)),r}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(t,e)},r.clear=function(){this.data_.clear()},r.begin=function(){return this.data_.begin()},r.end=function(){return this.data_.end()},r.has=function(t){return!this.find(t).equals(this.end())},r.size=function(){return this.data_.size()},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r (index = \"+n+\").\")},t.excessive_index=function(t,r,n,i){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric index is equal or greater than size -> (index = \"+n+\", size: \"+i+\").\")},t.not_my_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is not this container's own.\")},t.erased_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator, it already has been erased.\")},t.negative_iterator=function(t,r,n){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is directing negative position -> (index = \"+n+\").\")},t.iterator_end_value=function(t,r){void 0===r&&(r=\"end\");var n=e(t);return new OutOfRange(\"Error on \"+n+\".Iterator.value: cannot access to the \"+n+\".\"+r+\"().value.\")},t.key_nout_found=function(t,r,n){throw new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): unable to find the matched key -> \"+n)}}(ErrorGenerator||(ErrorGenerator={}));var IAssociativeContainer,UniqueSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.count=function(t){return this.find(t).equals(this.end())?0:1},r.insert=function(){for(var e,r=arguments.length,n=new Array(r),i=0;i1?e-1:0),n=1;n=1&&r[0]instanceof Array?(i=function(){var e=r[0];t.push.apply(t,e)},o=r.slice(1)):r.length>=2&&r[0].next instanceof Function&&r[1].next instanceof Function?(i=function(){var e=r[0],n=r[1];t.assign(e,n)},o=r.slice(2)):(i=null,o=r),{ramda:i,tail:o}}}(IAssociativeContainer||(IAssociativeContainer={}));var is_node_=null;function is_node(){return null===is_node_&&(is_node_=\"object\"==typeof global&&\"object\"==typeof global.process&&\"object\"==typeof global.process.versions&&void 0!==global.process.versions.node),is_node_}function _Get_root(){return null===__s_pRoot&&void 0===(__s_pRoot=is_node()?global:self).__s_iUID&&(__s_pRoot.__s_iUID=0),__s_pRoot}var ITreeContainer,__s_pRoot=null;function get_uid(t){if(t instanceof Object){if(!1===t.hasOwnProperty(\"__get_m_iUID\")){var e=++_Get_root().__s_iUID;Object.defineProperty(t,\"__get_m_iUID\",{value:function(){return e}})}return t.__get_m_iUID()}return void 0===t?-1:0}function equal_to(t,e){return t=t?t.valueOf():t,e=e?e.valueOf():e,t instanceof Object&&t.equals instanceof Function?t.equals(e):t===e}function less(t,e){return t=t.valueOf(),e=e.valueOf(),t instanceof Object?t.less instanceof Function?t.less(e):get_uid(t)3?o-3:0),a=3;a=1&&(i=h.tail[0])}r(i),null!==n&&n()},t.emplacable=function(t,e,r){var n=e.prev(),i=n.equals(t.end())||t.value_comp()(n.value,r);return i=i&&(e.equals(t.end())||t.value_comp()(r,e.value))}}(ITreeContainer||(ITreeContainer={}));var INIT_VALUE=2166136261,MULTIPLIER=16777619,Pair=function(){function t(t,e){this.first=t,this.second=e}var e=t.prototype;return e.equals=function(t){return equal_to(this.first,t.first)&&equal_to(this.second,t.second)},e.less=function(t){return!1===equal_to(this.first,t.first)?less(this.first,t.first):less(this.second,t.second)},e.hashCode=function(){return hash(this.first,this.second)},t}(),UniqueTreeSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.find=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(t,e.value)?e:this.end()},r.equal_range=function(t){var e=this.lower_bound(t);return new Pair(e,!e.equals(this.end())&&this._Key_eq(t,e.value)?e.next():e)},r.value_comp=function(){return this.key_comp()},r._Key_eq=function(t,e){return!this.key_comp()(t,e)&&!this.key_comp()(e,t)},r._Insert_by_key=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(e.value,t)?new Pair(e,!1):(e=this.data_.insert(e,t),this._Handle_insert(e,e.next()),new Pair(e,!0))},r._Insert_by_hint=function(t,e){if(ITreeContainer.emplacable(this,t,e)){var r=this.data_.insert(t,e);return this._Handle_insert(r,r.next()),r}return this._Insert_by_key(e).first},e}(UniqueSet),ListIterator=function(){function t(t,e,r){this.prev_=t,this.next_=e,this.value_=r}t._Set_prev=function(t,e){t.prev_=e},t._Set_next=function(t,e){t.next_=e};var e=t.prototype;return e.prev=function(){return this.prev_},e.next=function(){return this.next_},e._Try_value=function(){if(void 0===this.value_&&!0===this.equals(this.source().end()))throw ErrorGenerator.iterator_end_value(this.source())},e.equals=function(t){return this===t},_createClass$1(t,[{key:\"value\",get:function(){return this._Try_value(),this.value_}}]),t}(),Repeater=function(){function t(t,e){this.index_=t,this.value_=e}var e=t.prototype;return e.index=function(){return this.index_},e.next=function(){return++this.index_,this},e.equals=function(t){return this.index_===t.index_},_createClass$1(t,[{key:\"value\",get:function(){return this.value_}}]),t}();function advance(t,e){if(0===e)return t;if(t.advance instanceof Function)return t.advance(e);var r;if(e<0){if(!(t.prev instanceof Function))throw new InvalidArgument(\"Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.\");r=function(t){return t.prev()},e=-e}else r=function(t){return t.next()};for(;e-- >0;)t=r(t);return t}var ListContainer=function(t){function e(){var e;return(e=t.call(this)||this).end_=e._Create_iterator(null,null),e.clear(),e}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(this.end(),t,e)},r.clear=function(){ListIterator._Set_prev(this.end_,this.end_),ListIterator._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0},r.resize=function(t){var e=t-this.size();e>0?this.insert(this.end(),e,void 0):e<0&&this.erase(advance(this.end(),-e),this.end())},r.begin=function(){return this.begin_},r.end=function(){return this.end_},r.size=function(){return this.size_},r.push_front=function(t){this.insert(this.begin_,t)},r.push_back=function(t){this.insert(this.end_,t)},r.pop_front=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_front\");this.erase(this.begin_)},r.pop_back=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_back\");this.erase(this.end_.prev())},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r=0;--o){var s=this.tryEntries[o],a=s.completion;if(\"root\"===s.tryLoc)return i(\"end\");if(s.tryLoc<=this.prev){var u=n.call(s,\"catchLoc\"),h=n.call(s,\"finallyLoc\");if(u&&h){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;k(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:z(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){\"object\"==typeof globalThis?globalThis.regeneratorRuntime=e:Function(\"r\",\"regeneratorRuntime = r\")(e)}})),Deque=function(t){function e(t){this.head=0,this.tail=0,this.mask=1,this.list=new Array(2),t&&this.extend(t)}var r=e.prototype;return r.extend=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.push(n)}return this},r.extendFront=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.pushFront(n)}return this},r._resize=function(t,e){var r=this.head,n=this.mask;if(this.head=0,this.tail=t,this.mask=e-1,0!==r){for(var i=new Array(e),o=0;o=r||t<-r)throw new RangeError(\"deque index out of range\");return i[(t>=0?e:n)+t&this.mask]},r.indexOf=function(t,e){void 0===e&&(e=0);for(var r=this.head,n=this.list,i=this.size,o=this.mask,s=e>=0?e:e<-i?0:i+e;s>>1&&this._resize(this.size,this.list.length>>>1),t},r.popFront=function(){if(this.head===this.tail)throw new RangeError(\"pop from an empty deque\");var t=this.list[this.head];return this.list[this.head]=void 0,this.head=this.head+1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),t},r.delete=function(t){if(t>=this.size||t<0)throw new RangeError(\"deque index out of range\");for(var e=this.head+t&this.mask;e!==this.tail;){var r=e+1&this.mask;this.list[e]=this.list[r],e=r}return this.tail=this.tail-1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),this},r.reverse=function(){for(var t=this.head,e=this.tail,r=this.size,n=this.mask,i=0;i<~~(r/2);i++){var o=e-i-1&n,s=t+i&n,a=this.list[o];this.list[o]=this.list[s],this.list[s]=a}return this},r.rotate=function(t){void 0===t&&(t=1);var e=this.head,r=this.tail;if(0===t||e===r)return this;if(this.head=e-t&this.mask,this.tail=r-t&this.mask,t>0)for(var n=1;n<=t;n++){var i=e-n&this.mask,o=r-n&this.mask;this.list[i]=this.list[o],this.list[o]=void 0}else for(var s=0;s>t;s--){var a=r-s&this.mask,u=e-s&this.mask;this.list[a]=this.list[u],this.list[u]=void 0}return this},r.entries=runtime_1.mark((function t(){var e,r,n,i,o;return runtime_1.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.head,r=this.size,n=this.list,i=this.mask,o=0;case 2:if(!(o=1){var e;if(\"object\"==typeof t)throw new Error(\"The value can not be object\");var r=[t,[]],n=0,i=1;r[0]=new Array((e=(arguments.length<=1?0:arguments.length-1)-1+1)<1||arguments.length<=e?void 0:arguments[e]);for(var o=0;o=0;s--){if(!Number.isInteger(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]))throw new Error(\"Please pass integer arguments for array size\");r[i]=new Array(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);for(var a=0;a<(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);a++)r[i][a]=r[n].slice();var u=[i,n];n=u[0],i=u[1]}return r[n]}},vectorArray=function(t){for(var e=new Array(t),r=0;rthis.p[e]){var r=[e,t];t=r[0],e=r[1]}return this.p[t]+=this.p[e],this.p[e]=t,!0},e.size=function(t){return t=this.group(t),-this.p[t]},t}(),PriorityQueue=function(){function t(t){this.comparator=t||function(t,e){return t0&&(r=e>>1,!this.comparator(this.elem[e],this.elem[r]));)this.swap(e,r),e=r},e.pop=function(){var t=this.top,e=this.elem.pop(),r=this.size;if(0==r)return t;this.elem[0]=e;for(var n=0,i=0,o=0,s=0;n=0;t=(t&t+1)-1)e=this.updateMethod(e,this.cont[t]);return e},e.update=function(t,e){for(;t<=this.elemCount;t|=t+1)this.cont[t]=this.updateMethod(this.cont[t],e)},t}(),SegmentTree=function(){function t(t,e,r,n){if(void 0===n&&(n=null),this.identityValue=e,this.merger=r,this.elemCount=t,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;o--)this.internalUpdate(o)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.set=function(t,e){t+=this.size,this.cont[t]=e;for(var r=1;r<=this.log;r++)this.internalUpdate(t>>r)},e.get=function(t){return t?this.cont[t+this.size]:this.cont.slice(this.size,this.size+this.elemCount)},e.query=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.elemCount-1),e++;var r=this.identityValue,n=this.identityValue;for(t+=this.size,e+=this.size;t>=1,e>>=1;return this.merger(r,n)},e.all=function(){return this.cont[1]},t}(),LazySegmentTree=function(){function t(t,e,r,n,i,o,s){if(void 0===s&&(s=null),this.identityValue=e,this.merger=r,this.identityLazy=n,this.pusher=i,this.modifier=o,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;u--)this.internalUpdate(u)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.internalModify=function(t,e){e!==this.identityLazy&&(this.cont[t]=this.modifier(this.cont[t],e),t=1;r--)this.internalPush(t>>r);this.cont[t]=e;for(var n=1;n<=this.log;n++)this.internalUpdate(t>>n)},e.get=function(t){t+=this.size;for(var e=this.log;e>=1;e--)this.internalPush(t>>e);return this.cont[t]},e.query=function(t,e){e++,t+=this.size,e+=this.size;for(var r=this.log;r>=1;r--)t>>r<>r),e>>r<>r);for(var n=this.identityValue,i=this.identityValue;t>=1,e>>=1;return this.merger(n,i)},e.all=function(){return this.cont[1]},e.update=function(t,e,r){e++,t+=this.size,e+=this.size;for(var n=this.log;n>=1;n--)t>>n<>n),e>>n<>n);for(var i=t,o=e;t>=1,e>>=1;t=i,e=o;for(var s=1;s<=this.log;s++)t>>s<>s),e>>s<>s)},t}(),defaultComparator=function(t,e){return t>>1)],e)?r=o+1:n=o;return r},upperBound=function(t,e,r,n,i){var o;for(void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=defaultComparator),n||(n=t.length);r>>1)])?n=o:r=o+1;return r},binarySearch=function(t,e,r){for(var n,i=null;t<=e;)r(n=t+e>>1)?(i=n,e=n-1):t=n+1;return i},ternarySearch=function(t,e,r,n,i){var o,s;if(void 0===n&&(n=!1),void 0===i&&(i=200),n)for(;i--;)s=e-(e-t)/3,r(o=t+(e-t)/3)>1),r(i-1)>1),r(a-1)>u?(h=u,t=a+1):e=a-1;return h},Graph=function(){function t(t){this.g=vectorArray(t+1),this.vis=multiArray(!1,t+1),this.par=multiArray(-1,t+1)}var e=t.prototype;return e.addEdge=function(t,e,r){this.g[t].push({to:e,prop:r})},e.addBiEdge=function(t,e,r){this.addEdge(t,e,r),this.addEdge(e,t,r)},e.reset=function(){this.vis=multiArray(!1,this.g.length),this.par=multiArray(-1,this.g.length)},t}(),dfs=function(t,e,r,n){var i=new Deque;for(i.push(e);i.size;){var o=i.back;if(t.vis[o])n(o,t),i.pop();else{t.vis[o]=!0,r(o,t);for(var s,a=_createForOfIteratorHelperLoose(t.g[o]);!(s=a()).done;){var u=s.value;t.vis[u.to]||(t.par[u.to]=o,i.push(u.to))}}}},bfs=function(t,e,r){var n=new Deque;if(n.push(e),Array.isArray(e))for(var i,o=_createForOfIteratorHelperLoose(e);!(i=o()).done;){var s=i.value;t.vis[s]=!0,n.push(s)}else t.vis[e]=!0,n.push(e);for(;n.size;){var a=n.pop();r(a,t);for(var u,h=_createForOfIteratorHelperLoose(t.g[a]);!(u=h()).done;){var l=u.value;t.vis[l.to]||(t.par[l.to]=a,n.push(l.to),t.vis[l.to]=!0)}}},mst=function(t){for(var e=0,r=[],n=[],i=0;ii[r]+f.prop.weight&&(i[f.to]=i[r]+f.prop.weight,t.par[f.to]=r,o[f.to]||(o[f.to]=!0,s.push(f.to)))}}return{parArray:t.par,distArray:i}},dijkstra=function(t,e){t.reset();var r=new PriorityQueue((function(t,e){return t.dist>e.dist})),n=Number.MAX_SAFE_INTEGER,i=multiArray(n,t.g.length);if(Array.isArray(e))for(var o,s=_createForOfIteratorHelperLoose(e);!(o=s()).done;){var a=o.value;r.push({node:a,dist:0}),i[a]=0}else r.push({node:e,dist:0}),i[e]=0;for(;r.size;){var u=r.pop();if(i[u.node]===u.dist)for(var h,l=_createForOfIteratorHelperLoose(t.g[u.node]);!(h=l()).done;){var c=h.value;i[c.to]>i[u.node]+c.prop.weight&&(i[c.to]=i[u.node]+c.prop.weight,t.par[c.to]=u.node,r.push({node:c.to,dist:i[c.to]}))}}return{parArray:t.par,distArray:i}},setMod=function(t){global.MOD_=t,global.MOD_CUT=1099511627776%t},add=function(){for(var t=arguments.length,e=new Array(t),r=0;r=1;n--)e[0]+=e[n],e[0]=e[0]>=global.MOD_?e[0]-global.MOD_:e[0];return e[0]},sub=function(t,e){return(t+=global.MOD_-e)>=global.MOD_?t-global.MOD_:t},mul=function(){for(var t=arguments.length<=0?void 0:arguments[0],e=1;e>20)*((e<0||arguments.length<=e?void 0:arguments[e])>>20)*global.MOD_CUT+(4293918720&t)*(1048575&(e<0||arguments.length<=e?void 0:arguments[e]))+(1048575&t)*(e<0||arguments.length<=e?void 0:arguments[e]))%global.MOD_;return t},pow=function(t,e){for(var r=1;e;)1&e&&(r=mul(r,t)),t=mul(t,t),e>>>=1;return r},inv=function(t){for(var e,r=1,n=0,i=global.MOD_;i;n=(o=[r,n-e*r])[0],r=o[1],o){var o,s;i=(s=[t,i-(e=i/t|0)*t])[0],t=s[1]}return r<0?r+global.MOD_:r},binomSetup=function(t,e){void 0===t&&(t=2e5),void 0===e&&(e=!1),global.factorial=Array(t+1).fill(1),global.invFactorial=Array(t+1).fill(1);for(var r=1;r<=t;r++)global.factorial[r]=mul(global.factorial[r-1],r);global.invFactorial[t]=inv(global.factorial[t]);for(var n=t-1;n>=1;n--)global.invFactorial[n]=mul(global.invFactorial[n+1],n+1);if(e){if(t>5e3)throw new Error(\"Fast Binomial is only available for under 5000 range\");global.fastBinomEnabled=!0,global.fastBinom=multiArray(0,t+1,t+1);for(var i=0;i<=t;i++){global.fastBinom[i][0]=1;for(var o=1;o<=i;o++)global.fastBinom[i][o]=add(global.fastBinom[i-1][o-1],global.fastBinom[i-1][o])}}},binom=function(t,e){return e>t?0:global.fastBinomEnabled?global.fastBinom[t][e]:mul(global.factorial[t],global.invFactorial[e],global.invFactorial[t-e])},fact=function(t){return global.factorial[t]},Tree=function(t){function e(e,r){var n;return(n=t.call(this,e)||this).root=1,n.root=r,n.childCount=Array(e+1).fill(1),n.distRoot=Array(e+1).fill(0),n.distance=Array(e+1).fill(0),n}_inheritsLoose(e,t);var r=e.prototype;return r.setupDist=function(){var t=this;dfs(this,this.root,(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(o.prop&&(t.distance[o.to]=t.distance[e]+o.prop.weight),t.distRoot[o.to]=t.distRoot[e]+1)}}),(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(t.childCount[e]+=t.childCount[o.to])}}))},r.setupLCA=function(){this.setupDist();var t=31-Math.clz32(this.g.length);this.log=t,this.parentLift=Array(t+1),this.parentLift[0]=this.par;for(var e=1;e<=t;e++){this.parentLift[e]=Array(this.g.length).fill(-1);for(var r=0;r=0;n--)this.distRoot[t]-(1<=this.distRoot[e]&&(t=this.parentLift[n][t]);if(t===e)return t;for(var i=this.log;i>=0;i--)this.parentLift[i][t]!=this.parentLift[i][e]&&(t=this.parentLift[i][t],e=this.parentLift[i][e]);return this.parentLift[0][t]},e}(Graph);\r\n\r\nfunction main() {\r\n // write your code from here\r\n let [n, x] = rnum(2);\r\n let dp = multiArray(0, n + 1, x + 1);\r\n let p = multiArray(0, n + 1, x + 1);\r\n dp[0][0] = 1;\r\n for (let i = 0; i <= n; i ++) {\r\n for (let j = 1; j <= x; j ++) {\r\n p[i][j] = pow(j, i);\r\n }\r\n }\r\n binomSetup(500, true);\r\n for (let i = 2; i <= n; i ++) {\r\n for (let j = 1; j < i; j ++) {\r\n dp[i][j] = mul(binom(n, i), sub(p[i][j], p[i][j - 1]));\r\n }\r\n }\r\n for (let i = 2; i <= n; i ++) {\r\n for (let j = 1; j <= x; j ++) {\r\n for (let k = 0; i + k <= n && i + j + k - 1 <= x; k ++) {\r\n dp[i + k][i + j + k - 1] = add(dp[i + k][i + j + k - 1], dp[i][j] * binom(n - i, k) * p[k][i + k - 1]);\r\n }\r\n }\r\n }\r\n let ans = 0;\r\n for (let i = 1; i <= x; i ++)\r\n ans = add(ans, dp[n][i]);\r\n print(ans);\r\n}\r\nproc(main, 'input.txt');\r\n\r\n\r\n// Generated with compe.js - https://github.com/polarity-cf/compe.js", "lang": "Node.js", "bug_code_uid": "1a2250870e78a7b09815e50520983b98", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "4c47aa2f35674553afa036ba5954d881", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5161290322580645, "equal_cnt": 876, "replace_cnt": 847, "delete_cnt": 13, "insert_cnt": 15, "fix_ops_cnt": 875, "bug_source_code": "function _defineProperties(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var fs=require(\"fs\"),configPath=\"./compe.config.json\";function proc(t,e){if(global.MOD_=998244353,global.MOD_CUT=444595123,fs.existsSync(configPath)){if(!fs.existsSync(e))return void console.log(\"Input directory does not exist\");var r=fs.readFileSync(e,{encoding:\"utf-8\"}),n=0;r=r.split(/ |\\n|\\r/g);for(var i,o=[],s=_createForOfIteratorHelperLoose(r);!(i=s()).done;){var a=i.value;a.length>0&&o.push(a)}global.rnum=function(t){return t?o.slice(n,n+=t).map((function(t){return+t})):+o[n++]},global.rstr=function(t){return t?o.slice(n,n+=t):o[n++]},global.rbig=function(t){return t?o.slice(n,n+=t).map((function(t){return BigInt(t)})):BigInt(o[n++])},global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&n.push(o)}global.rnum=function(t){return t?n.slice(e,e+=t).map((function(t){return+t})):+n[e++]},global.rstr=function(t){return t?n.slice(e,e+=t):n[e++]},global.rbig=function(t){return t?n.slice(e,e+=t).map((function(t){return BigInt(t)})):BigInt(n[e++])};var s=\"\";global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}Object.defineProperty(exports,\"__esModule\",{value:!0});var ErrorGenerator,ForOfAdaptor=function(t){function e(t,e){this.it_=t,this.last_=e}var r=e.prototype;return r.next=function(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};var t=this.it_;return this.it_=this.it_.next(),{done:!1,value:t.value}},r[t]=function(){return this},e}(Symbol.iterator),Container=function(t){function e(){}var r=e.prototype;return r.empty=function(){return 0===this.size()},r.rbegin=function(){return this.end().reverse()},r.rend=function(){return this.begin().reverse()},r[t]=function(){return new ForOfAdaptor(this.begin(),this.end())},r.toJSON=function(){for(var t,e=[],r=_createForOfIteratorHelperLoose$1(this);!(t=r()).done;){var n=t.value;e.push(n)}return e},e}(Symbol.iterator),NativeArrayIterator=function(){function t(t,e){this.data_=t,this.index_=e}var e=t.prototype;return e.index=function(){return this.index_},e.prev=function(){return--this.index_,this},e.next=function(){return++this.index_,this},e.advance=function(t){return this.index_+=t,this},e.equals=function(t){return this.data_===t.data_&&this.index_===t.index_},e.swap=function(t){var e=[t.data_,this.data_];this.data_=e[0],t.data_=e[1];var r=[t.index_,this.index_];this.index_=r[0],t.index_=r[1]},_createClass$1(t,[{key:\"value\",get:function(){return this.data_[this.index_]}}]),t}(),SetContainer=function(t){function e(e){var r;return(r=t.call(this)||this).data_=e(_assertThisInitialized(r)),r}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(t,e)},r.clear=function(){this.data_.clear()},r.begin=function(){return this.data_.begin()},r.end=function(){return this.data_.end()},r.has=function(t){return!this.find(t).equals(this.end())},r.size=function(){return this.data_.size()},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r (index = \"+n+\").\")},t.excessive_index=function(t,r,n,i){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric index is equal or greater than size -> (index = \"+n+\", size: \"+i+\").\")},t.not_my_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is not this container's own.\")},t.erased_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator, it already has been erased.\")},t.negative_iterator=function(t,r,n){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is directing negative position -> (index = \"+n+\").\")},t.iterator_end_value=function(t,r){void 0===r&&(r=\"end\");var n=e(t);return new OutOfRange(\"Error on \"+n+\".Iterator.value: cannot access to the \"+n+\".\"+r+\"().value.\")},t.key_nout_found=function(t,r,n){throw new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): unable to find the matched key -> \"+n)}}(ErrorGenerator||(ErrorGenerator={}));var IAssociativeContainer,UniqueSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.count=function(t){return this.find(t).equals(this.end())?0:1},r.insert=function(){for(var e,r=arguments.length,n=new Array(r),i=0;i1?e-1:0),n=1;n=1&&r[0]instanceof Array?(i=function(){var e=r[0];t.push.apply(t,e)},o=r.slice(1)):r.length>=2&&r[0].next instanceof Function&&r[1].next instanceof Function?(i=function(){var e=r[0],n=r[1];t.assign(e,n)},o=r.slice(2)):(i=null,o=r),{ramda:i,tail:o}}}(IAssociativeContainer||(IAssociativeContainer={}));var is_node_=null;function is_node(){return null===is_node_&&(is_node_=\"object\"==typeof global&&\"object\"==typeof global.process&&\"object\"==typeof global.process.versions&&void 0!==global.process.versions.node),is_node_}function _Get_root(){return null===__s_pRoot&&void 0===(__s_pRoot=is_node()?global:self).__s_iUID&&(__s_pRoot.__s_iUID=0),__s_pRoot}var ITreeContainer,__s_pRoot=null;function get_uid(t){if(t instanceof Object){if(!1===t.hasOwnProperty(\"__get_m_iUID\")){var e=++_Get_root().__s_iUID;Object.defineProperty(t,\"__get_m_iUID\",{value:function(){return e}})}return t.__get_m_iUID()}return void 0===t?-1:0}function equal_to(t,e){return t=t?t.valueOf():t,e=e?e.valueOf():e,t instanceof Object&&t.equals instanceof Function?t.equals(e):t===e}function less(t,e){return t=t.valueOf(),e=e.valueOf(),t instanceof Object?t.less instanceof Function?t.less(e):get_uid(t)3?o-3:0),a=3;a=1&&(i=h.tail[0])}r(i),null!==n&&n()},t.emplacable=function(t,e,r){var n=e.prev(),i=n.equals(t.end())||t.value_comp()(n.value,r);return i=i&&(e.equals(t.end())||t.value_comp()(r,e.value))}}(ITreeContainer||(ITreeContainer={}));var INIT_VALUE=2166136261,MULTIPLIER=16777619,Pair=function(){function t(t,e){this.first=t,this.second=e}var e=t.prototype;return e.equals=function(t){return equal_to(this.first,t.first)&&equal_to(this.second,t.second)},e.less=function(t){return!1===equal_to(this.first,t.first)?less(this.first,t.first):less(this.second,t.second)},e.hashCode=function(){return hash(this.first,this.second)},t}(),UniqueTreeSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.find=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(t,e.value)?e:this.end()},r.equal_range=function(t){var e=this.lower_bound(t);return new Pair(e,!e.equals(this.end())&&this._Key_eq(t,e.value)?e.next():e)},r.value_comp=function(){return this.key_comp()},r._Key_eq=function(t,e){return!this.key_comp()(t,e)&&!this.key_comp()(e,t)},r._Insert_by_key=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(e.value,t)?new Pair(e,!1):(e=this.data_.insert(e,t),this._Handle_insert(e,e.next()),new Pair(e,!0))},r._Insert_by_hint=function(t,e){if(ITreeContainer.emplacable(this,t,e)){var r=this.data_.insert(t,e);return this._Handle_insert(r,r.next()),r}return this._Insert_by_key(e).first},e}(UniqueSet),ListIterator=function(){function t(t,e,r){this.prev_=t,this.next_=e,this.value_=r}t._Set_prev=function(t,e){t.prev_=e},t._Set_next=function(t,e){t.next_=e};var e=t.prototype;return e.prev=function(){return this.prev_},e.next=function(){return this.next_},e._Try_value=function(){if(void 0===this.value_&&!0===this.equals(this.source().end()))throw ErrorGenerator.iterator_end_value(this.source())},e.equals=function(t){return this===t},_createClass$1(t,[{key:\"value\",get:function(){return this._Try_value(),this.value_}}]),t}(),Repeater=function(){function t(t,e){this.index_=t,this.value_=e}var e=t.prototype;return e.index=function(){return this.index_},e.next=function(){return++this.index_,this},e.equals=function(t){return this.index_===t.index_},_createClass$1(t,[{key:\"value\",get:function(){return this.value_}}]),t}();function advance(t,e){if(0===e)return t;if(t.advance instanceof Function)return t.advance(e);var r;if(e<0){if(!(t.prev instanceof Function))throw new InvalidArgument(\"Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.\");r=function(t){return t.prev()},e=-e}else r=function(t){return t.next()};for(;e-- >0;)t=r(t);return t}var ListContainer=function(t){function e(){var e;return(e=t.call(this)||this).end_=e._Create_iterator(null,null),e.clear(),e}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(this.end(),t,e)},r.clear=function(){ListIterator._Set_prev(this.end_,this.end_),ListIterator._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0},r.resize=function(t){var e=t-this.size();e>0?this.insert(this.end(),e,void 0):e<0&&this.erase(advance(this.end(),-e),this.end())},r.begin=function(){return this.begin_},r.end=function(){return this.end_},r.size=function(){return this.size_},r.push_front=function(t){this.insert(this.begin_,t)},r.push_back=function(t){this.insert(this.end_,t)},r.pop_front=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_front\");this.erase(this.begin_)},r.pop_back=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_back\");this.erase(this.end_.prev())},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r=0;--o){var s=this.tryEntries[o],a=s.completion;if(\"root\"===s.tryLoc)return i(\"end\");if(s.tryLoc<=this.prev){var u=n.call(s,\"catchLoc\"),h=n.call(s,\"finallyLoc\");if(u&&h){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;k(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:z(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){\"object\"==typeof globalThis?globalThis.regeneratorRuntime=e:Function(\"r\",\"regeneratorRuntime = r\")(e)}})),Deque=function(t){function e(t){this.head=0,this.tail=0,this.mask=1,this.list=new Array(2),t&&this.extend(t)}var r=e.prototype;return r.extend=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.push(n)}return this},r.extendFront=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.pushFront(n)}return this},r._resize=function(t,e){var r=this.head,n=this.mask;if(this.head=0,this.tail=t,this.mask=e-1,0!==r){for(var i=new Array(e),o=0;o=r||t<-r)throw new RangeError(\"deque index out of range\");return i[(t>=0?e:n)+t&this.mask]},r.indexOf=function(t,e){void 0===e&&(e=0);for(var r=this.head,n=this.list,i=this.size,o=this.mask,s=e>=0?e:e<-i?0:i+e;s>>1&&this._resize(this.size,this.list.length>>>1),t},r.popFront=function(){if(this.head===this.tail)throw new RangeError(\"pop from an empty deque\");var t=this.list[this.head];return this.list[this.head]=void 0,this.head=this.head+1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),t},r.delete=function(t){if(t>=this.size||t<0)throw new RangeError(\"deque index out of range\");for(var e=this.head+t&this.mask;e!==this.tail;){var r=e+1&this.mask;this.list[e]=this.list[r],e=r}return this.tail=this.tail-1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),this},r.reverse=function(){for(var t=this.head,e=this.tail,r=this.size,n=this.mask,i=0;i<~~(r/2);i++){var o=e-i-1&n,s=t+i&n,a=this.list[o];this.list[o]=this.list[s],this.list[s]=a}return this},r.rotate=function(t){void 0===t&&(t=1);var e=this.head,r=this.tail;if(0===t||e===r)return this;if(this.head=e-t&this.mask,this.tail=r-t&this.mask,t>0)for(var n=1;n<=t;n++){var i=e-n&this.mask,o=r-n&this.mask;this.list[i]=this.list[o],this.list[o]=void 0}else for(var s=0;s>t;s--){var a=r-s&this.mask,u=e-s&this.mask;this.list[a]=this.list[u],this.list[u]=void 0}return this},r.entries=runtime_1.mark((function t(){var e,r,n,i,o;return runtime_1.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.head,r=this.size,n=this.list,i=this.mask,o=0;case 2:if(!(o=1){var e;if(\"object\"==typeof t)throw new Error(\"The value can not be object\");var r=[t,[]],n=0,i=1;r[0]=new Array((e=(arguments.length<=1?0:arguments.length-1)-1+1)<1||arguments.length<=e?void 0:arguments[e]);for(var o=0;o=0;s--){if(!Number.isInteger(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]))throw new Error(\"Please pass integer arguments for array size\");r[i]=new Array(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);for(var a=0;a<(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);a++)r[i][a]=r[n].slice();var u=[i,n];n=u[0],i=u[1]}return r[n]}},vectorArray=function(t){for(var e=new Array(t),r=0;rthis.p[e]){var r=[e,t];t=r[0],e=r[1]}return this.p[t]+=this.p[e],this.p[e]=t,!0},e.size=function(t){return t=this.group(t),-this.p[t]},t}(),PriorityQueue=function(){function t(t){this.comparator=t||function(t,e){return t0&&(r=e>>1,!this.comparator(this.elem[e],this.elem[r]));)this.swap(e,r),e=r},e.pop=function(){var t=this.top,e=this.elem.pop(),r=this.size;if(0==r)return t;this.elem[0]=e;for(var n=0,i=0,o=0,s=0;n=0;t=(t&t+1)-1)e=this.updateMethod(e,this.cont[t]);return e},e.update=function(t,e){for(;t<=this.elemCount;t|=t+1)this.cont[t]=this.updateMethod(this.cont[t],e)},t}(),SegmentTree=function(){function t(t,e,r,n){if(void 0===n&&(n=null),this.identityValue=e,this.merger=r,this.elemCount=t,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;o--)this.internalUpdate(o)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.set=function(t,e){t+=this.size,this.cont[t]=e;for(var r=1;r<=this.log;r++)this.internalUpdate(t>>r)},e.get=function(t){return t?this.cont[t+this.size]:this.cont.slice(this.size,this.size+this.elemCount)},e.query=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.elemCount-1),e++;var r=this.identityValue,n=this.identityValue;for(t+=this.size,e+=this.size;t>=1,e>>=1;return this.merger(r,n)},e.all=function(){return this.cont[1]},t}(),LazySegmentTree=function(){function t(t,e,r,n,i,o,s){if(void 0===s&&(s=null),this.identityValue=e,this.merger=r,this.identityLazy=n,this.pusher=i,this.modifier=o,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;u--)this.internalUpdate(u)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.internalModify=function(t,e){e!==this.identityLazy&&(this.cont[t]=this.modifier(this.cont[t],e),t=1;r--)this.internalPush(t>>r);this.cont[t]=e;for(var n=1;n<=this.log;n++)this.internalUpdate(t>>n)},e.get=function(t){t+=this.size;for(var e=this.log;e>=1;e--)this.internalPush(t>>e);return this.cont[t]},e.query=function(t,e){e++,t+=this.size,e+=this.size;for(var r=this.log;r>=1;r--)t>>r<>r),e>>r<>r);for(var n=this.identityValue,i=this.identityValue;t>=1,e>>=1;return this.merger(n,i)},e.all=function(){return this.cont[1]},e.update=function(t,e,r){e++,t+=this.size,e+=this.size;for(var n=this.log;n>=1;n--)t>>n<>n),e>>n<>n);for(var i=t,o=e;t>=1,e>>=1;t=i,e=o;for(var s=1;s<=this.log;s++)t>>s<>s),e>>s<>s)},t}(),defaultComparator=function(t,e){return t>>1)],e)?r=o+1:n=o;return r},upperBound=function(t,e,r,n,i){var o;for(void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=defaultComparator),n||(n=t.length);r>>1)])?n=o:r=o+1;return r},binarySearch=function(t,e,r){for(var n,i=null;t<=e;)r(n=t+e>>1)?(i=n,e=n-1):t=n+1;return i},ternarySearch=function(t,e,r,n,i){var o,s;if(void 0===n&&(n=!1),void 0===i&&(i=200),n)for(;i--;)s=e-(e-t)/3,r(o=t+(e-t)/3)>1),r(i-1)>1),r(a-1)>u?(h=u,t=a+1):e=a-1;return h},Graph=function(){function t(t){this.g=vectorArray(t+1),this.vis=multiArray(!1,t+1),this.par=multiArray(-1,t+1)}var e=t.prototype;return e.addEdge=function(t,e,r){this.g[t].push({to:e,prop:r})},e.addBiEdge=function(t,e,r){this.addEdge(t,e,r),this.addEdge(e,t,r)},e.reset=function(){this.vis=multiArray(!1,this.g.length),this.par=multiArray(-1,this.g.length)},t}(),dfs=function(t,e,r,n){var i=new Deque;for(i.push(e);i.size;){var o=i.back;if(t.vis[o])n(o,t),i.pop();else{t.vis[o]=!0,r(o,t);for(var s,a=_createForOfIteratorHelperLoose(t.g[o]);!(s=a()).done;){var u=s.value;t.vis[u.to]||(t.par[u.to]=o,i.push(u.to))}}}},bfs=function(t,e,r){var n=new Deque;if(n.push(e),Array.isArray(e))for(var i,o=_createForOfIteratorHelperLoose(e);!(i=o()).done;){var s=i.value;t.vis[s]=!0,n.push(s)}else t.vis[e]=!0,n.push(e);for(;n.size;){var a=n.pop();r(a,t);for(var u,h=_createForOfIteratorHelperLoose(t.g[a]);!(u=h()).done;){var l=u.value;t.vis[l.to]||(t.par[l.to]=a,n.push(l.to),t.vis[l.to]=!0)}}},mst=function(t){for(var e=0,r=[],n=[],i=0;ii[r]+f.prop.weight&&(i[f.to]=i[r]+f.prop.weight,t.par[f.to]=r,o[f.to]||(o[f.to]=!0,s.push(f.to)))}}return{parArray:t.par,distArray:i}},dijkstra=function(t,e){t.reset();var r=new PriorityQueue((function(t,e){return t.dist>e.dist})),n=Number.MAX_SAFE_INTEGER,i=multiArray(n,t.g.length);if(Array.isArray(e))for(var o,s=_createForOfIteratorHelperLoose(e);!(o=s()).done;){var a=o.value;r.push({node:a,dist:0}),i[a]=0}else r.push({node:e,dist:0}),i[e]=0;for(;r.size;){var u=r.pop();if(i[u.node]===u.dist)for(var h,l=_createForOfIteratorHelperLoose(t.g[u.node]);!(h=l()).done;){var c=h.value;i[c.to]>i[u.node]+c.prop.weight&&(i[c.to]=i[u.node]+c.prop.weight,t.par[c.to]=u.node,r.push({node:c.to,dist:i[c.to]}))}}return{parArray:t.par,distArray:i}},setMod=function(t){global.MOD_=t,global.MOD_CUT=1099511627776%t},add=function(){for(var t=arguments.length,e=new Array(t),r=0;r=1;n--)e[0]+=e[n],e[0]=e[0]>=global.MOD_?e[0]-global.MOD_:e[0];return e[0]},sub=function(t,e){return(t+=global.MOD_-e)>=global.MOD_?t-global.MOD_:t},mul=function(){for(var t=arguments.length<=0?void 0:arguments[0],e=1;e>20)*((e<0||arguments.length<=e?void 0:arguments[e])>>20)*global.MOD_CUT+(4293918720&t)*(1048575&(e<0||arguments.length<=e?void 0:arguments[e]))+(1048575&t)*(e<0||arguments.length<=e?void 0:arguments[e]))%global.MOD_;return t},pow=function(t,e){for(var r=1;e;)1&e&&(r=mul(r,t)),t=mul(t,t),e>>>=1;return r},inv=function(t){for(var e,r=1,n=0,i=global.MOD_;i;n=(o=[r,n-e*r])[0],r=o[1],o){var o,s;i=(s=[t,i-(e=i/t|0)*t])[0],t=s[1]}return r<0?r+global.MOD_:r},binomSetup=function(t,e){void 0===t&&(t=2e5),void 0===e&&(e=!1),global.factorial=Array(t+1).fill(1),global.invFactorial=Array(t+1).fill(1);for(var r=1;r<=t;r++)global.factorial[r]=mul(global.factorial[r-1],r);global.invFactorial[t]=inv(global.factorial[t]);for(var n=t-1;n>=1;n--)global.invFactorial[n]=mul(global.invFactorial[n+1],n+1);if(e){if(t>5e3)throw new Error(\"Fast Binomial is only available for under 5000 range\");global.fastBinomEnabled=!0,global.fastBinom=Array(t+1).fill(0).map((function(){return Array(t+1).fill(0)}));for(var i=0;i<=t;i++){global.fastBinom[i][0]=1;for(var o=1;o<=i;o++)global.fastBinom[i][o]=add(global.fastBinom[i-1][o-1],global.fastBinom[i-1][o])}}},binom=function(t,e){return e>t?0:global.fastBinomEnabled?global.fastBinom[t][e]:mul(global.factorial[t],global.invFactorial[e],global.invFactorial[t-e])},fact=function(t){return global.factorial[t]},Tree=function(t){function e(e,r){var n;return(n=t.call(this,e)||this).root=1,n.root=r,n.childCount=Array(e+1).fill(1),n.distRoot=Array(e+1).fill(0),n.distance=Array(e+1).fill(0),n}_inheritsLoose(e,t);var r=e.prototype;return r.setupDist=function(){var t=this;dfs(this,this.root,(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(o.prop&&(t.distance[o.to]=t.distance[e]+o.prop.weight),t.distRoot[o.to]=t.distRoot[e]+1)}}),(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(t.childCount[e]+=t.childCount[o.to])}}))},r.setupLCA=function(){this.setupDist();var t=31-Math.clz32(this.g.length);this.log=t,this.parentLift=Array(t+1),this.parentLift[0]=this.par;for(var e=1;e<=t;e++){this.parentLift[e]=Array(this.g.length).fill(-1);for(var r=0;r=0;n--)this.distRoot[t]-(1<=this.distRoot[e]&&(t=this.parentLift[n][t]);if(t===e)return t;for(var i=this.log;i>=0;i--)this.parentLift[i][t]!=this.parentLift[i][e]&&(t=this.parentLift[i][t],e=this.parentLift[i][e]);return this.parentLift[0][t]},e}(Graph);\r\n\r\nfunction main() {\r\n // write your code from here\r\n binomSetup(5000, true);\r\n}\r\nproc(main, 'input.txt');\r\n\r\n\r\n// Generated with compe.js - https://github.com/polarity-cf/compe.js", "lang": "Node.js", "bug_code_uid": "58e0df266d354bdba8c6bd40dc63b06c", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "4c47aa2f35674553afa036ba5954d881", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.5267164066621448, "equal_cnt": 908, "replace_cnt": 858, "delete_cnt": 36, "insert_cnt": 13, "fix_ops_cnt": 907, "bug_source_code": "function _defineProperties(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var fs=require(\"fs\"),configPath=\"./compe.config.json\";function proc(t,e){if(global.MOD_=998244353,global.MOD_CUT=444595123,fs.existsSync(configPath)){if(!fs.existsSync(e))return void console.log(\"Input directory does not exist\");var r=fs.readFileSync(e,{encoding:\"utf-8\"}),n=0;r=r.split(/ |\\n|\\r/g);for(var i,o=[],s=_createForOfIteratorHelperLoose(r);!(i=s()).done;){var a=i.value;a.length>0&&o.push(a)}global.rnum=function(t){return t?o.slice(n,n+=t).map((function(t){return+t})):+o[n++]},global.rstr=function(t){return t?o.slice(n,n+=t):o[n++]},global.rbig=function(t){return t?o.slice(n,n+=t).map((function(t){return BigInt(t)})):BigInt(o[n++])},global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&n.push(o)}global.rnum=function(t){return t?n.slice(e,e+=t).map((function(t){return+t})):+n[e++]},global.rstr=function(t){return t?n.slice(e,e+=t):n[e++]},global.rbig=function(t){return t?n.slice(e,e+=t).map((function(t){return BigInt(t)})):BigInt(n[e++])};var s=\"\";global.print=function(){for(var t=arguments.length,e=new Array(t),r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}Object.defineProperty(exports,\"__esModule\",{value:!0});var ErrorGenerator,ForOfAdaptor=function(t){function e(t,e){this.it_=t,this.last_=e}var r=e.prototype;return r.next=function(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};var t=this.it_;return this.it_=this.it_.next(),{done:!1,value:t.value}},r[t]=function(){return this},e}(Symbol.iterator),Container=function(t){function e(){}var r=e.prototype;return r.empty=function(){return 0===this.size()},r.rbegin=function(){return this.end().reverse()},r.rend=function(){return this.begin().reverse()},r[t]=function(){return new ForOfAdaptor(this.begin(),this.end())},r.toJSON=function(){for(var t,e=[],r=_createForOfIteratorHelperLoose$1(this);!(t=r()).done;){var n=t.value;e.push(n)}return e},e}(Symbol.iterator),NativeArrayIterator=function(){function t(t,e){this.data_=t,this.index_=e}var e=t.prototype;return e.index=function(){return this.index_},e.prev=function(){return--this.index_,this},e.next=function(){return++this.index_,this},e.advance=function(t){return this.index_+=t,this},e.equals=function(t){return this.data_===t.data_&&this.index_===t.index_},e.swap=function(t){var e=[t.data_,this.data_];this.data_=e[0],t.data_=e[1];var r=[t.index_,this.index_];this.index_=r[0],t.index_=r[1]},_createClass$1(t,[{key:\"value\",get:function(){return this.data_[this.index_]}}]),t}(),SetContainer=function(t){function e(e){var r;return(r=t.call(this)||this).data_=e(_assertThisInitialized(r)),r}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(t,e)},r.clear=function(){this.data_.clear()},r.begin=function(){return this.data_.begin()},r.end=function(){return this.data_.end()},r.has=function(t){return!this.find(t).equals(this.end())},r.size=function(){return this.data_.size()},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r (index = \"+n+\").\")},t.excessive_index=function(t,r,n,i){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric index is equal or greater than size -> (index = \"+n+\", size: \"+i+\").\")},t.not_my_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is not this container's own.\")},t.erased_iterator=function(t,r){return new InvalidArgument(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator, it already has been erased.\")},t.negative_iterator=function(t,r,n){return new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): parametric iterator is directing negative position -> (index = \"+n+\").\")},t.iterator_end_value=function(t,r){void 0===r&&(r=\"end\");var n=e(t);return new OutOfRange(\"Error on \"+n+\".Iterator.value: cannot access to the \"+n+\".\"+r+\"().value.\")},t.key_nout_found=function(t,r,n){throw new OutOfRange(\"Error on \"+e(t)+\".\"+r+\"(): unable to find the matched key -> \"+n)}}(ErrorGenerator||(ErrorGenerator={}));var IAssociativeContainer,UniqueSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.count=function(t){return this.find(t).equals(this.end())?0:1},r.insert=function(){for(var e,r=arguments.length,n=new Array(r),i=0;i1?e-1:0),n=1;n=1&&r[0]instanceof Array?(i=function(){var e=r[0];t.push.apply(t,e)},o=r.slice(1)):r.length>=2&&r[0].next instanceof Function&&r[1].next instanceof Function?(i=function(){var e=r[0],n=r[1];t.assign(e,n)},o=r.slice(2)):(i=null,o=r),{ramda:i,tail:o}}}(IAssociativeContainer||(IAssociativeContainer={}));var is_node_=null;function is_node(){return null===is_node_&&(is_node_=\"object\"==typeof global&&\"object\"==typeof global.process&&\"object\"==typeof global.process.versions&&void 0!==global.process.versions.node),is_node_}function _Get_root(){return null===__s_pRoot&&void 0===(__s_pRoot=is_node()?global:self).__s_iUID&&(__s_pRoot.__s_iUID=0),__s_pRoot}var ITreeContainer,__s_pRoot=null;function get_uid(t){if(t instanceof Object){if(!1===t.hasOwnProperty(\"__get_m_iUID\")){var e=++_Get_root().__s_iUID;Object.defineProperty(t,\"__get_m_iUID\",{value:function(){return e}})}return t.__get_m_iUID()}return void 0===t?-1:0}function equal_to(t,e){return t=t?t.valueOf():t,e=e?e.valueOf():e,t instanceof Object&&t.equals instanceof Function?t.equals(e):t===e}function less(t,e){return t=t.valueOf(),e=e.valueOf(),t instanceof Object?t.less instanceof Function?t.less(e):get_uid(t)3?o-3:0),a=3;a=1&&(i=h.tail[0])}r(i),null!==n&&n()},t.emplacable=function(t,e,r){var n=e.prev(),i=n.equals(t.end())||t.value_comp()(n.value,r);return i=i&&(e.equals(t.end())||t.value_comp()(r,e.value))}}(ITreeContainer||(ITreeContainer={}));var INIT_VALUE=2166136261,MULTIPLIER=16777619,Pair=function(){function t(t,e){this.first=t,this.second=e}var e=t.prototype;return e.equals=function(t){return equal_to(this.first,t.first)&&equal_to(this.second,t.second)},e.less=function(t){return!1===equal_to(this.first,t.first)?less(this.first,t.first):less(this.second,t.second)},e.hashCode=function(){return hash(this.first,this.second)},t}(),UniqueTreeSet=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose$1(e,t);var r=e.prototype;return r.find=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(t,e.value)?e:this.end()},r.equal_range=function(t){var e=this.lower_bound(t);return new Pair(e,!e.equals(this.end())&&this._Key_eq(t,e.value)?e.next():e)},r.value_comp=function(){return this.key_comp()},r._Key_eq=function(t,e){return!this.key_comp()(t,e)&&!this.key_comp()(e,t)},r._Insert_by_key=function(t){var e=this.lower_bound(t);return!e.equals(this.end())&&this._Key_eq(e.value,t)?new Pair(e,!1):(e=this.data_.insert(e,t),this._Handle_insert(e,e.next()),new Pair(e,!0))},r._Insert_by_hint=function(t,e){if(ITreeContainer.emplacable(this,t,e)){var r=this.data_.insert(t,e);return this._Handle_insert(r,r.next()),r}return this._Insert_by_key(e).first},e}(UniqueSet),ListIterator=function(){function t(t,e,r){this.prev_=t,this.next_=e,this.value_=r}t._Set_prev=function(t,e){t.prev_=e},t._Set_next=function(t,e){t.next_=e};var e=t.prototype;return e.prev=function(){return this.prev_},e.next=function(){return this.next_},e._Try_value=function(){if(void 0===this.value_&&!0===this.equals(this.source().end()))throw ErrorGenerator.iterator_end_value(this.source())},e.equals=function(t){return this===t},_createClass$1(t,[{key:\"value\",get:function(){return this._Try_value(),this.value_}}]),t}(),Repeater=function(){function t(t,e){this.index_=t,this.value_=e}var e=t.prototype;return e.index=function(){return this.index_},e.next=function(){return++this.index_,this},e.equals=function(t){return this.index_===t.index_},_createClass$1(t,[{key:\"value\",get:function(){return this.value_}}]),t}();function advance(t,e){if(0===e)return t;if(t.advance instanceof Function)return t.advance(e);var r;if(e<0){if(!(t.prev instanceof Function))throw new InvalidArgument(\"Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.\");r=function(t){return t.prev()},e=-e}else r=function(t){return t.next()};for(;e-- >0;)t=r(t);return t}var ListContainer=function(t){function e(){var e;return(e=t.call(this)||this).end_=e._Create_iterator(null,null),e.clear(),e}_inheritsLoose$1(e,t);var r=e.prototype;return r.assign=function(t,e){this.clear(),this.insert(this.end(),t,e)},r.clear=function(){ListIterator._Set_prev(this.end_,this.end_),ListIterator._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0},r.resize=function(t){var e=t-this.size();e>0?this.insert(this.end(),e,void 0):e<0&&this.erase(advance(this.end(),-e),this.end())},r.begin=function(){return this.begin_},r.end=function(){return this.end_},r.size=function(){return this.size_},r.push_front=function(t){this.insert(this.begin_,t)},r.push_back=function(t){this.insert(this.end_,t)},r.pop_front=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_front\");this.erase(this.begin_)},r.pop_back=function(){if(!0===this.empty())throw ErrorGenerator.empty(this.end_.source().constructor.name,\"pop_back\");this.erase(this.end_.prev())},r.push=function(){for(var t=arguments.length,e=new Array(t),r=0;r=0;--o){var s=this.tryEntries[o],a=s.completion;if(\"root\"===s.tryLoc)return i(\"end\");if(s.tryLoc<=this.prev){var u=n.call(s,\"catchLoc\"),h=n.call(s,\"finallyLoc\");if(u&&h){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var i=n.arg;k(r)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:z(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){\"object\"==typeof globalThis?globalThis.regeneratorRuntime=e:Function(\"r\",\"regeneratorRuntime = r\")(e)}})),Deque=function(t){function e(t){this.head=0,this.tail=0,this.mask=1,this.list=new Array(2),t&&this.extend(t)}var r=e.prototype;return r.extend=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.push(n)}return this},r.extendFront=function(t){for(var e,r=_createForOfIteratorHelperLoose(t);!(e=r()).done;){var n=e.value;this.pushFront(n)}return this},r._resize=function(t,e){var r=this.head,n=this.mask;if(this.head=0,this.tail=t,this.mask=e-1,0!==r){for(var i=new Array(e),o=0;o=r||t<-r)throw new RangeError(\"deque index out of range\");return i[(t>=0?e:n)+t&this.mask]},r.indexOf=function(t,e){void 0===e&&(e=0);for(var r=this.head,n=this.list,i=this.size,o=this.mask,s=e>=0?e:e<-i?0:i+e;s>>1&&this._resize(this.size,this.list.length>>>1),t},r.popFront=function(){if(this.head===this.tail)throw new RangeError(\"pop from an empty deque\");var t=this.list[this.head];return this.list[this.head]=void 0,this.head=this.head+1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),t},r.delete=function(t){if(t>=this.size||t<0)throw new RangeError(\"deque index out of range\");for(var e=this.head+t&this.mask;e!==this.tail;){var r=e+1&this.mask;this.list[e]=this.list[r],e=r}return this.tail=this.tail-1&this.mask,this.size>>1&&this._resize(this.size,this.list.length>>>1),this},r.reverse=function(){for(var t=this.head,e=this.tail,r=this.size,n=this.mask,i=0;i<~~(r/2);i++){var o=e-i-1&n,s=t+i&n,a=this.list[o];this.list[o]=this.list[s],this.list[s]=a}return this},r.rotate=function(t){void 0===t&&(t=1);var e=this.head,r=this.tail;if(0===t||e===r)return this;if(this.head=e-t&this.mask,this.tail=r-t&this.mask,t>0)for(var n=1;n<=t;n++){var i=e-n&this.mask,o=r-n&this.mask;this.list[i]=this.list[o],this.list[o]=void 0}else for(var s=0;s>t;s--){var a=r-s&this.mask,u=e-s&this.mask;this.list[a]=this.list[u],this.list[u]=void 0}return this},r.entries=runtime_1.mark((function t(){var e,r,n,i,o;return runtime_1.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.head,r=this.size,n=this.list,i=this.mask,o=0;case 2:if(!(o=1){var e;if(\"object\"==typeof t)throw new Error(\"The value can not be object\");var r=[t,[]],n=0,i=1;r[0]=new Array((e=(arguments.length<=1?0:arguments.length-1)-1+1)<1||arguments.length<=e?void 0:arguments[e]);for(var o=0;o=0;s--){if(!Number.isInteger(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]))throw new Error(\"Please pass integer arguments for array size\");r[i]=new Array(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);for(var a=0;a<(s+1<1||arguments.length<=s+1?void 0:arguments[s+1]);a++)r[i][a]=r[n].slice();var u=[i,n];n=u[0],i=u[1]}return r[n]}},vectorArray=function(t){for(var e=new Array(t),r=0;rthis.p[e]){var r=[e,t];t=r[0],e=r[1]}return this.p[t]+=this.p[e],this.p[e]=t,!0},e.size=function(t){return t=this.group(t),-this.p[t]},t}(),PriorityQueue=function(){function t(t){this.comparator=t||function(t,e){return t0&&(r=e>>1,!this.comparator(this.elem[e],this.elem[r]));)this.swap(e,r),e=r},e.pop=function(){var t=this.top,e=this.elem.pop(),r=this.size;if(0==r)return t;this.elem[0]=e;for(var n=0,i=0,o=0,s=0;n=0;t=(t&t+1)-1)e=this.updateMethod(e,this.cont[t]);return e},e.update=function(t,e){for(;t<=this.elemCount;t|=t+1)this.cont[t]=this.updateMethod(this.cont[t],e)},t}(),SegmentTree=function(){function t(t,e,r,n){if(void 0===n&&(n=null),this.identityValue=e,this.merger=r,this.elemCount=t,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;o--)this.internalUpdate(o)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.set=function(t,e){t+=this.size,this.cont[t]=e;for(var r=1;r<=this.log;r++)this.internalUpdate(t>>r)},e.get=function(t){return t?this.cont[t+this.size]:this.cont.slice(this.size,this.size+this.elemCount)},e.query=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.elemCount-1),e++;var r=this.identityValue,n=this.identityValue;for(t+=this.size,e+=this.size;t>=1,e>>=1;return this.merger(r,n)},e.all=function(){return this.cont[1]},t}(),LazySegmentTree=function(){function t(t,e,r,n,i,o,s){if(void 0===s&&(s=null),this.identityValue=e,this.merger=r,this.identityLazy=n,this.pusher=i,this.modifier=o,this.log=Math.ceil(Math.log2(t)),this.size=1<=1;u--)this.internalUpdate(u)}}var e=t.prototype;return e.internalUpdate=function(t){this.cont[t]=this.merger(this.cont[t<<1],this.cont[t<<1|1])},e.internalModify=function(t,e){e!==this.identityLazy&&(this.cont[t]=this.modifier(this.cont[t],e),t=1;r--)this.internalPush(t>>r);this.cont[t]=e;for(var n=1;n<=this.log;n++)this.internalUpdate(t>>n)},e.get=function(t){t+=this.size;for(var e=this.log;e>=1;e--)this.internalPush(t>>e);return this.cont[t]},e.query=function(t,e){e++,t+=this.size,e+=this.size;for(var r=this.log;r>=1;r--)t>>r<>r),e>>r<>r);for(var n=this.identityValue,i=this.identityValue;t>=1,e>>=1;return this.merger(n,i)},e.all=function(){return this.cont[1]},e.update=function(t,e,r){e++,t+=this.size,e+=this.size;for(var n=this.log;n>=1;n--)t>>n<>n),e>>n<>n);for(var i=t,o=e;t>=1,e>>=1;t=i,e=o;for(var s=1;s<=this.log;s++)t>>s<>s),e>>s<>s)},t}(),defaultComparator=function(t,e){return t>>1)],e)?r=o+1:n=o;return r},upperBound=function(t,e,r,n,i){var o;for(void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=defaultComparator),n||(n=t.length);r>>1)])?n=o:r=o+1;return r},binarySearch=function(t,e,r){for(var n,i=null;t<=e;)r(n=t+e>>1)?(i=n,e=n-1):t=n+1;return i},ternarySearch=function(t,e,r,n,i){var o,s;if(void 0===n&&(n=!1),void 0===i&&(i=200),n)for(;i--;)s=e-(e-t)/3,r(o=t+(e-t)/3)>1),r(i-1)>1),r(a-1)>u?(h=u,t=a+1):e=a-1;return h},Graph=function(){function t(t){this.g=vectorArray(t+1),this.vis=multiArray(!1,t+1),this.par=multiArray(-1,t+1)}var e=t.prototype;return e.addEdge=function(t,e,r){this.g[t].push({to:e,prop:r})},e.addBiEdge=function(t,e,r){this.addEdge(t,e,r),this.addEdge(e,t,r)},e.reset=function(){this.vis=multiArray(!1,this.g.length),this.par=multiArray(-1,this.g.length)},t}(),dfs=function(t,e,r,n){var i=new Deque;for(i.push(e);i.size;){var o=i.back;if(t.vis[o])n(o,t),i.pop();else{t.vis[o]=!0,r(o,t);for(var s,a=_createForOfIteratorHelperLoose(t.g[o]);!(s=a()).done;){var u=s.value;t.vis[u.to]||(t.par[u.to]=o,i.push(u.to))}}}},bfs=function(t,e,r){var n=new Deque;if(n.push(e),Array.isArray(e))for(var i,o=_createForOfIteratorHelperLoose(e);!(i=o()).done;){var s=i.value;t.vis[s]=!0,n.push(s)}else t.vis[e]=!0,n.push(e);for(;n.size;){var a=n.pop();r(a,t);for(var u,h=_createForOfIteratorHelperLoose(t.g[a]);!(u=h()).done;){var l=u.value;t.vis[l.to]||(t.par[l.to]=a,n.push(l.to),t.vis[l.to]=!0)}}},mst=function(t){for(var e=0,r=[],n=[],i=0;ii[r]+f.prop.weight&&(i[f.to]=i[r]+f.prop.weight,t.par[f.to]=r,o[f.to]||(o[f.to]=!0,s.push(f.to)))}}return{parArray:t.par,distArray:i}},dijkstra=function(t,e){t.reset();var r=new PriorityQueue((function(t,e){return t.dist>e.dist})),n=Number.MAX_SAFE_INTEGER,i=multiArray(n,t.g.length);if(Array.isArray(e))for(var o,s=_createForOfIteratorHelperLoose(e);!(o=s()).done;){var a=o.value;r.push({node:a,dist:0}),i[a]=0}else r.push({node:e,dist:0}),i[e]=0;for(;r.size;){var u=r.pop();if(i[u.node]===u.dist)for(var h,l=_createForOfIteratorHelperLoose(t.g[u.node]);!(h=l()).done;){var c=h.value;i[c.to]>i[u.node]+c.prop.weight&&(i[c.to]=i[u.node]+c.prop.weight,t.par[c.to]=u.node,r.push({node:c.to,dist:i[c.to]}))}}return{parArray:t.par,distArray:i}},setMod=function(t){global.MOD_=t,global.MOD_CUT=1099511627776%t},add=function(){for(var t=arguments.length,e=new Array(t),r=0;r=1;n--)e[0]+=e[n],e[0]=e[0]>=global.MOD_?e[0]-global.MOD_:e[0];return e[0]},sub=function(t,e){return(t+=global.MOD_-e)>=global.MOD_?t-global.MOD_:t},mul=function(){for(var t=arguments.length<=0?void 0:arguments[0],e=1;e>20)*((e<0||arguments.length<=e?void 0:arguments[e])>>20)*global.MOD_CUT+(4293918720&t)*(1048575&(e<0||arguments.length<=e?void 0:arguments[e]))+(1048575&t)*(e<0||arguments.length<=e?void 0:arguments[e]))%global.MOD_;return t},pow=function(t,e){for(var r=1;e;)1&e&&(r=mul(r,t)),t=mul(t,t),e>>>=1;return r},inv=function(t){for(var e,r=1,n=0,i=global.MOD_;i;n=(o=[r,n-e*r])[0],r=o[1],o){var o,s;i=(s=[t,i-(e=i/t|0)*t])[0],t=s[1]}return r<0?r+global.MOD_:r},binomSetup=function(t,e){void 0===t&&(t=2e5),void 0===e&&(e=!1),global.factorial=Array(t+1).fill(1),global.invFactorial=Array(t+1).fill(1);for(var r=1;r<=t;r++)global.factorial[r]=mul(global.factorial[r-1],r);global.invFactorial[t]=inv(global.factorial[t]);for(var n=t-1;n>=1;n--)global.invFactorial[n]=mul(global.invFactorial[n+1],n+1);if(e){if(t>5e3)throw new Error(\"Fast Binomial is only available for under 5000 range\");global.fastBinomEnabled=!0,global.fastBinom=multiArray(0,t+1,t+1);for(var i=0;i<=t;i++){global.fastBinom[i][0]=1;for(var o=1;o<=i;o++)global.fastBinom[i][o]=add(global.fastBinom[i-1][o-1],global.fastBinom[i-1][o])}}},binom=function(t,e){return e>t?0:global.fastBinomEnabled?global.fastBinom[t][e]:mul(global.factorial[t],global.invFactorial[e],global.invFactorial[t-e])},fact=function(t){return global.factorial[t]},Tree=function(t){function e(e,r){var n;return(n=t.call(this,e)||this).root=1,n.root=r,n.childCount=Array(e+1).fill(1),n.distRoot=Array(e+1).fill(0),n.distance=Array(e+1).fill(0),n}_inheritsLoose(e,t);var r=e.prototype;return r.setupDist=function(){var t=this;dfs(this,this.root,(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(o.prop&&(t.distance[o.to]=t.distance[e]+o.prop.weight),t.distRoot[o.to]=t.distRoot[e]+1)}}),(function(e,r){for(var n,i=_createForOfIteratorHelperLoose(r.g[e]);!(n=i()).done;){var o=n.value;o.to!=r.par[e]&&(t.childCount[e]+=t.childCount[o.to])}}))},r.setupLCA=function(){this.setupDist();var t=31-Math.clz32(this.g.length);this.log=t,this.parentLift=Array(t+1),this.parentLift[0]=this.par;for(var e=1;e<=t;e++){this.parentLift[e]=Array(this.g.length).fill(-1);for(var r=0;r=0;n--)this.distRoot[t]-(1<=this.distRoot[e]&&(t=this.parentLift[n][t]);if(t===e)return t;for(var i=this.log;i>=0;i--)this.parentLift[i][t]!=this.parentLift[i][e]&&(t=this.parentLift[i][t],e=this.parentLift[i][e]);return this.parentLift[0][t]},e}(Graph);\r\n\r\nfunction main() {\r\n // write your code from here\r\n binomSetup(2000, true);\r\n // let [n, x] = rnum(2);\r\n // let dp = multiArray(0, n + 1, x + 1);\r\n // let p = multiArray(0, n + 1, x + 1);\r\n // dp[0][0] = 1;\r\n // for (let i = 0; i <= n; i ++) {\r\n // for (let j = 1; j <= x; j ++) {\r\n // p[i][j] = pow(j, i);\r\n // }\r\n // }\r\n // binomSetup(500, true);\r\n // for (let i = 2; i <= n; i ++) {\r\n // for (let j = 1; j < i; j ++) {\r\n // dp[i][j] = mul(binom(n, i), sub(p[i][j], p[i][j - 1]));\r\n // }\r\n // }\r\n // for (let i = 2; i <= n; i ++) {\r\n // for (let j = 1; j <= x; j ++) {\r\n // for (let k = 0; i + k <= n && i + j + k - 1 <= x; k ++) {\r\n // dp[i + k][i + j + k - 1] = add(dp[i + k][i + j + k - 1], mul(dp[i][j], binom(n - i, k), p[k][i + k - 1]));\r\n // }\r\n // }\r\n // }\r\n // let ans = 0;\r\n // for (let i = 1; i <= x; i ++)\r\n // ans = add(ans, dp[n][i]);\r\n // print(ans);\r\n}\r\nproc(main, 'input.txt');\r\n\r\n\r\n// Generated with compe.js - https://github.com/polarity-cf/compe.js", "lang": "Node.js", "bug_code_uid": "66fb0cc622cf7ccc2f7378d6e4dde776", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "4c47aa2f35674553afa036ba5954d881", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.9990442816183498, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "///////////////////////////////// pre-define /////////////////////////////////////\r\nconst pr = console.log;\r\nconst err = console.error;\r\nconst mi = Math.min;\r\nconst mx = Math.max;\r\nconst abs = Math.abs;\r\nconst fl = Math.floor;\r\nconst ce = Math.ceil;\r\nconst sq = Math.sqrt;\r\nconst gcd = (a, b) => b == 0 ? a : gcd(b, a % b);\r\nconst lcm = (a, b) => (a / gcd(a, b)) * b;\r\nconst powmod = (a, b, mod) => {\r\n let r = 1n;\r\n while (b > 0n) {\r\n if (b % 2n == 1) r = r * a % mod;\r\n b >>= 1n;\r\n a = a * a % mod;\r\n }\r\n return r;\r\n};\r\nconst counter = (a_or_s) => {\r\n let map = new Map();\r\n for (const i of a_or_s) map.set(i, map.get(i) + 1 || 1);\r\n return map;\r\n};\r\n///////////////////////////////////////////////////////////////////////////////////\r\n\r\nconst MOD = BigInt(1e9 + 7);\r\nconst solve = (n, k) => {\r\n pr(powmod(n, k, MOD).toString());\r\n};\r\n\r\nconst main = () => {\r\n const { performance } = require('perf_hooks');\r\n let t_begin = performance.now();\r\n const readline = require('readline');\r\n const rl = readline.createInterface({\r\n input: process.stdin,\r\n output: process.stdout\r\n });\r\n let input = [];\r\n rl.on('line', (line) => {\r\n input.push(line.split(\" \").map(x => BigInt(x)));\r\n });\r\n rl.on('close', () => {\r\n let t = input[0][0];\r\n let i = 1;\r\n while (t--) {\r\n solve(input[i][0], input[i][1]);\r\n i++;\r\n }\r\n let t_end = performance.now();\r\n pr(\"Run Time: \" + (t_end - t_begin) / 10 + \"ms\");\r\n });\r\n};\r\n\r\nmain()", "lang": "Node.js", "bug_code_uid": "9a5b95a07e2155bd9ee11413fd5a1d8d", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "7a42c490a7dbdcebe8ccf853edc5372e", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Javascript"} {"similarity_score": 0.8294314381270903, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "'use-strict'\r\n\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf8');\r\n\r\nlet data = '';\r\nlet currentLine = 0;\r\n\r\nprocess.stdin.on('data', chunk => {\r\ndata += chunk;\r\n});\r\n\r\nprocess.stdin.on('end', () =>{\r\n data = data.replace(/\\s*$/, '')\r\n .split('\\n')\r\n .map(str => str.replace(/\\s*$/, ''));\r\n\r\n let testCases = parseInt(data.shift());\r\n\r\n var mod = 1e9 + 7;\r\n\r\n while(testCases--) {\r\n\r\n const [n, k ] = get_ints();\r\n\r\n console.log(Math.pow(n,k) % mod);\r\n }\r\n});\r\n\r\nfunction get_ints() { \r\n return data.shift().split(' ').map(Number);\r\n}\r\n \r\nfunction readLine() { \r\n return data[currentLine++];\r\n}\r\n ", "lang": "Node.js", "bug_code_uid": "577b93dd63a2bf02156e808600488a0e", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "7aa2430d7ab851fa7a434be6e6181c97", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Javascript"}