{"similarity_score": 0.6221782178217822, "equal_cnt": 25, "replace_cnt": 17, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 25, "bug_source_code": "#include\nint first(char s[],int len){\n int i,five=-1,two=-1;\n for(i=0;iara[i]){\n temp=ara[i];\n ara[i]=ara[j];\n ara[j]=temp;\n }\n }\n }\n for(i=0;i<4;i++){\n if(ara[0]!=-1){\n printf(\"%d\\n\",ara[i]);\n break;\n }\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "b48b6375b321eed0a59548e719e8c404", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "6195fd025b04943949d4d2ebb1c61d07", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9977946581720166, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "// https://codeforces.com/problemset/problem/976/A\n// problem 976A\n/*\nA. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e\n\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0442\u0435\u0441\u0442\n1 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\n\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0442\u0435\u0441\u0442\n256 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\n\u0432\u0432\u043e\u0434\n\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u0432\u043e\u0434\n\u0432\u044b\u0432\u043e\u0434\n\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\n\n\u0421\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0433\u0434\u0430 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \"0\" \u0438 \"1\", \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0435\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043d\u0443\u043b\u0438. \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432: \u00ab0\u00bb, \u00ab10\u00bb, \u00ab1001\u00bb.\n\n\u0417\u0430\u0434\u0430\u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 s.\n\n\u041d\u0430\u0434 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:\n\n \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0434\u0432\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab101\u00bb \u00ab110\u00bb);\n \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u00ab11\u00bb \u043d\u0430 \u00ab1\u00bb (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab110\u00bb \u00ab10\u00bb). \n\n\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c val(s), \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0447\u0442\u043e s \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c.\n\n\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 a \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 b \u0442\u043e\u0433\u0434\u0430 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 val(a)\u2009<\u2009val(b).\n\n\u0412\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043d\u0430\u0439\u0442\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 (\u0438\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c).\n\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\n\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e n (1\u2009\u2264\u2009n\u2009\u2264\u2009100) \u2014 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 s.\n\n\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 s \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \"0\" \u0438 \"1\". \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 s \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f.\n\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\n\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439.\n\u041f\u0440\u0438\u043c\u0435\u0440\u044b\n\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\n\n4\n1001\n\n\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\n\n100\n\n\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\n\n1\n1\n\n\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\n\n1\n\n\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435\n\n\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:\n\n\u00ab1001\u00bb \u00ab1010\u00bb \u00ab1100\u00bb \u00ab100\u00bb.\n\n\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.\n*/\n\n#include \n#include \nint main (){\n\tint n;\t\n\tscanf(\"%i\\n\",&n);\n\t\n\tif (n>1){\n\t\tchar *c;\n\t\tint r,z = 0;\n\t\tscanf(\"%101s\",c);\n\t\tfor (r=0;r\n#include\nint main()\n{\n\tint n;\n\tscanf(\"%d\",n);\n\tint a[105];\n\tint ans=0;\n\tfor(int i=0;i\n#include\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tint fi[105];\n\tint ans=0;\n\tfor(int i=0;i0 || strstr(str[i],'BB')>0){\n printf(\"NO\");\n return 0;\n }\n for(j=0;str[i][j]!='\\0';j++){\n if(str[i][j]=='W'){\n w++;\n ww++;\n }\n else if(str[i][j]=='B'){\n b++;\n bb++;\n }\n }\n if(bb!=ww){\n printf(\"NO\");\n return 0;\n }\n }\n if(b==32&&w==32)printf(\"YES\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "47fc448759fe3b8ad94706bb5b519dff", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "567a2673517006a929b558b2b00d30d8", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.13413585554600171, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main()\n{\n int ara[100000000];\n long long int a,s=1,t=0,i,k=0,num;\n scanf(\"%lld\",&a);\n for(i=0; a!=0; i++)\n {\n num=a%10;\n ara[i]=num;\n a=a/10;\n t++;\n }\n for(i=0; i\n#include\n#include\n#include\n#include\n#define MOD 1000000007\nint cmp(const void * a,const void * b)\n{\n return (*(int*)a - *(int*)b);\n}\nint main()\n{\n long long t=1;\n //scanf(\"%lld\",&t);\n while(t--)\n {\n long long n;\n scanf(\"%lld\",&n);\n int arr[n];\n for(int i=0;i>j)&1)\n c+=a[j];\n else\n c-=a[j];\n }\n if(c%360==0)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n }\n \n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "bc84a9d152cbbc761de19fb6196fc1ec", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "d46b0a1e213474b1167bf2900bd93702", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8780120481927711, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n#include \nint n, s = 0, a[20];\nlong long ji[40][400] = {0};\nvoid f(int i, int sum)\n{\n if (s != 0)\n return ;\n int m, n;\n m = sum + a[i], n = sum - a[i];\n ji[i][sum]++;\n if (m > 360)\n m -= 360;\n if (n < 0)\n n += 360;\n if (i == n)\n if (sum == 0)\n s++;\n if (ji[i + 1][m] == 0)\n f(i + 1, m);\n if (ji[i + 1][n] == 0)\n f(i + 1, n);\n}\nint main()\n{\n scanf(\"%d\", &n);\n for (int i = 0; i < n; i++)\n scanf(\"%d\", &a[i]);\n f(0, 0);\n if (s == 0)\n printf(\"NO\");\n else\n printf(\"YES\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "2af49240a381dd7ea5dddab7a41ab878", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "1826623e6c9025c58ceb6d2d88db7ad9", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.25885558583106266, "equal_cnt": 18, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "#include \nint main(){\n int a[101],i,k=0,v=0,f=5;\n for (i=0;a[i]!='/0';i++){\n scanf(\"%d\",&a[i]);\n }\n for (i=1;a[i]!='/0';i++){\n if ((a[i]==a[i-1]) && (v\nusing namespace std;\n\nint main()\n{\n int l,r;\n scanf(\"%d %d\", &l, &r);\n long long a = 1, b = a, res = 0;\n while(a < r) {\n while(b <= r) {\n if(b >= l) res++;\n b*=3;\n }\n a*=2;\n b = a;\n }\n printf(\"%I64d\", res);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "af231ab070e77221a3a01a6e7a367a27", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "7e9da96823f118205eb6d01b7814b2fe", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.983914872556298, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n#include\n#include\n#define REP(i,a,b) for(i=a;i= 2){\n solve(st, rest-2);\n if(ok[st][rest-2]){\n ok[st][rest] = 1;\n if(mx < dp_max[st][rest-2]) mx = dp_max[st][rest-2];\n if(mn > dp_min[st][rest-2]) mn = dp_min[st][rest-2];\n }\n }\n\n if(st == len){\n if(rest==0){\n ok[st][rest] = 1;\n mx = mn = 0;\n }\n } else {\n solve(st+1, rest);\n if(rest) solve(st+1, rest-1);\n solve(st+1, rest);\n if(rest) solve(st+1, rest-1);\n\n if(in[st]=='F' && ok[st+1][rest]){\n ok[st][rest] = 1;\n if(mx < dp_max[st+1][rest]+1) mx = dp_max[st+1][rest]+1;\n if(mn > dp_min[st+1][rest]+1) mn = dp_min[st+1][rest]+1;\n }\n\n if(in[st]=='T' && rest && ok[st+1][rest-1]){\n ok[st][rest] = 1;\n if(mx < dp_max[st+1][rest-1]+1) mx = dp_max[st+1][rest-1]+1;\n if(mn > dp_min[st+1][rest-1]+1) mn = dp_min[st+1][rest-1]+1;\n }\n\n if(in[st]=='T' && ok[st+1][rest]){\n ok[st][rest] = 1;\n if(mx < -dp_min[st+1][rest]) mx = -dp_min[st+1][rest];\n if(mn > -dp_max[st+1][rest]) mn = -dp_max[st+1][rest];\n }\n\n if(in[st]=='F' && rest && ok[st+1][rest-1]){\n ok[st][rest] = 1;\n if(mx < -dp_min[st+1][rest-1]) mx = -dp_min[st+1][rest-1];\n if(mn > -dp_max[st+1][rest-1]) mn = -dp_max[st+1][rest-1];\n }\n }\n\n dp_max[st][rest] = mx;\n dp_min[st][rest] = mn;\n}\n\nint main(){\n int i,j,k,l,m,n;\n\n scanf(\"%s%d\",in,&can);\n len = strlen(in);\n\n rep(j,200) rep(k,200) alr[j][k] = 0;\n solve(0, can);\n\n printf(\"%d %d\\n\",dp_max[0][can],dp_min[0][can]);\n k = dp_max[0][can]; if(k<0) k=-k;\n l = dp_min[0][can]; if(l<0) l=-l;\n if(k < l) k = l;\n\n printf(\"%d\\n\",k);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "04f0293dc7328911caa6eedd19db1b49", "src_uid": "4a54971eb22e62b1d9e6b72f05ae361d", "apr_id": "15aec475c861a48d2b88eae726f2c34f", "difficulty": 1800, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.526829268292683, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int k,r,i=0,temp;\n scanf(\"%d %d\",&k,&r);\n if(k%10==0)\n {\n printf(\"%d\",k/10);\n return 1;\n }\n else\n {\n while(i<10)\n {\n temp=k*i;\n temp=temp%10;\n if(temp==r)\n {\n printf(\"%d\",i);\n return 2;\n }\n i++;\n }\n }\n if(i==10)\n {\n i=1;\n while(1)\n {\n temp=k*i;\n if(temp%10==0)\n {\n printf(\"%d\",i);\n return 3;\n }\n i++;\n }\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "4d470f0d7ff26624a128a488bffa7f03", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "c414abb4436b554f3a1dd0e0b16a6a0d", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9044394281414597, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n,sum_1=0,sum_2=0,d,coun=0;\n int r[101],b[101];\n scanf(\"%d\",&n);\n for(int i=0;i\n#include\n \n\nlong long int cmpfunc (const void * a, const void * b) {\n return ( *(long long int*)a - *(long long int*)b );\n}\nint fun(unsigned long long int n){\n if(n==0){\n return 0;\n }\n while(n>0){\n if(n%10==0 || n%10==1 || n%10==4 || n%10==9) {\n n/=10;\n }else{\n break;\n }\n }\n if(n==0){\n return 1;\n }else{\n return 0;\n}\n \n}\n\nint main(void)\n{\n\tlong long int test, i, j, count,flag = 0,n, o1 = 0, o2 = 0, x, m, l, max,y, sum2, min, f, r, o, sum1, sum = 0;\n\t\n\n\n\n\n long long int a[1000000]={0},b[10000];\n scanf(\"%lld\",&n);\n for(i=0;icount2){\n printf(\"1\\n\");\n }else{\n \n \n printf(\"%lld\",count2/count1+1);\n }\n }\n \n\n\n\n\n\n\n\n \n \n \n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "ab5c2dc6a5be75ffee1c3afc2d03c23c", "src_uid": "b62338bff0cbb4df4e5e27e1a3ffaa07", "apr_id": "ea3f74e3dd39d3562028d7965e81af16", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6046887631366209, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nint main(){\n srand(time(0));\n int n, i, j, x, mask = 0;\n\n for (i = 0; i < 4; i++){\n scanf(\"%d\", &x);\n if (x) mask |= (1 << i);\n }\n\n if (mask == 6){\n puts(\"0\");\n return 0;\n }\n if (mask == 0){\n puts(\"0\");\n return 0;\n }\n if (mask == 1){\n puts(\"1\");\n return 0;\n }\n if (mask == 2){\n puts(\"0\");\n return 0;\n }\n if (mask == 3){\n puts(\"1\");\n return 0;\n }\n if (mask == 4){\n puts(\"0\");\n return 0;\n }\n if (mask == 5){\n puts(\"0\");\n return 0;\n }\n if (mask == 7){\n puts(\"1\");\n return 0;\n }\n\n\n if (mask ) __builtin_trap();\n return 0;\n\n if (mask == 0) puts(\"0\");\n else printf(\"%d\\n\", rand() & 1);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "00d139099f0e30ac92356a74646da2bf", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "4c642bdc789b8552e2a7dabd8a37b14e", "difficulty": 2000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.08359133126934984, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 21, "bug_source_code": "\n#include\n#include\n#include\nusing namespace std;\nint main(){\n\tchar ch;\n\tint a[5];\n\tint i,sum = 100;\n\tint mul = 0,add = 0;\n\tint resu[4];\n\tfor(i = 1; i <= 4; i++){\n\t\tscanf(\"%d\",&a[i]);\n\t}\n\tsort(a+1,a+5);\n\tfor(i = 1; i <= 3; i++){\n\t\tscanf(\"%c\",&ch);\n\t\tif(ch =='*')\n\t\t\tmul++;\n\t\tif(ch == '+')\n\t\t\tadd++;\n\t}\n\tif(mul == 3)\n\t\tsum = a[1]*a[2]*a[3]*a[4];\n\tif(mul == 2 ){\n\t\tresu[1] = a[1] + a[2] * a[3] *a[4];\n\t\tresu[2] = a[1] * a[2] + a[3] *a[4];\n\t\tresu[3] = a[1] * a[2] * a[3] +a[4];\n\t\tsum = resu[1] > resu [2] ? resu[2]:resu[1];\n\t\tif(sum > resu [3])\n\t\t\tsum = resu [3];\n\t}\n\tif(mul == 1 ){\n\t\tresu[1] = a[1] + a[2] + a[3] *a[4];\n\t\tresu[2] = a[1] * a[2] + a[3] +a[4];\n\t\tresu[3] = a[1] + a[2] * a[3] +a[4];\n\t\tsum = resu[1] > resu [2] ? resu[2]:resu[1];\n\t\tif(sum > resu [3])\n\t\t\tsum = resu [3];\n\t}\n\tif(add == 3)\n\t\tsum = a[1]+a[2]+a[3]+a[4];\n\tprintf(\"%d\",sum);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "2b8acffcb02c87f175181eccc8086026", "src_uid": "7a66fae63d9b27e444d84447012e484c", "apr_id": "73136727ccc135c92033aab806eb044a", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9966618979494516, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nlong long a[5],ans=100000;\nchar p[4];\nvoid dfs(int l)\n{\n if(l==1)\n {\n long long s;\n for( int i=1; i<=4; i++)\n if(a[i]!=-1)\n {\n s=a[i];\n break;\n }\n if(s\n#include \n#include \n\nint main(){\n\n int cursor, t=0;\n char str1[100], str2[100];\n\n fgets(str1,100,stdin);\n fgets(str2,100,stdin);\n\n/*----------------------------------------------------------------------------*/\n for(cursor=0; cursortolower(str2[cursor]) ){\n printf(\"1\");\n t = 1;\n return 2;\n }\n else{\n printf(\"-1\");\n t = 1;\n return 3;\n }\n }\n/*----------------------------------------------------------------------------*/\n\n printf(\"0\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b53deacb91da821a708fe347662b9c77", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "fe14536863b4cf5e4e1cdd19ec0a85df", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9539078156312625, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n int main()\n{\n int i;\n long long int a,b,c,d,e,x,y;\n scanf(\"%lld %lld %lld %lld %lld\",&a,&b,&c,&d,&e);\n if(b*d<=e+(b*c))\n {\n x=(b*c)+((a-b)*d);\n }\n else\n {\n y=0;\n i=a%b;\n if(i!=0)\n {\n y=(i*c)+e;\n if(y>i*d)\n y=i*d;\n }\n x=(b*c)+((a-i-b)/b)*(e+(b*c))+y;\n }\n printf(\"%lld\",x);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0a7947e8f8acb2e5b4ed79820f068396", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "apr_id": "5627023b5c2adaf6bfb39c969a923b56", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2823275862068966, "equal_cnt": 23, "replace_cnt": 17, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 23, "bug_source_code": "#include\n\nint n,a,b,c,arr[100003],temp,stk=0,max,x=1;\nint rec(int neo);\nint main(){\n \n int i;\n scanf(\"%d %d %d %d\",&n,&a,&b,&c);\n temp=n;\n rec(c);\n \n printf(\"%d\",max);\n \n return 0;\n}\n\n\n\nrec(int neo){\n \n int i,z=neo;\n \n //key point\n stk+=z; \n arr[x++]=z;\n \n // for(i=1;i=n){\n if(stk==n){if((x-1)>max)max=x-1;}\n \n x--;\n \n }\n while(arr[x]!=a){\n if(arr[x]==0){arr[x]=rec(c);}\n else if(arr[x]==c&&arr[x]!=b&&arr[x]!=a){stk-=arr[x];arr[x]=rec(b);}\n else if(arr[x]==b&&arr[x]!=a){stk-=arr[x];arr[x]=rec(a);}\n \n x--;\n if(x<=0)return 0;\n }\n // \n stk-=arr[x]; \n return 0;\n}", "lang": "GNU C", "bug_code_uid": "88642cebee524c1c4745dee286529914", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "c63dd1bfc1c8daa9c9e12a0edf8f539a", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9647546648237734, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "/* practice with Dukkha */\n#include \n#include \n\n#define N\t8\n\nint compare(const void *a, const void *b) {\n\tint ia = *(int *) a;\n\tint ib = *(int *) b;\n\n\treturn ia - ib;\n}\n\nlong long aa[N], aa_[N];\nint bb[N], dp[N][1 << (N - 1)];\nchar pp[N];\nint n, ans = 0x3f3f3f3f;\n\nvoid solve(int i) {\n\tint j;\n\n\tif (i == n) {\n\t\tint cnt, sum;\n\n\t\tcnt = 0, sum = 0;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tint k;\n\n\t\t\tif (!pp[i])\n\t\t\t\tcnt++;\n\t\t\tk = dp[i][bb[i]];\n\t\t\tsum += k == 1 && bb[i] == 0 ? 1 : k + 1;\n\t\t}\n\t\tif (cnt >= 2)\n\t\t\tsum++;\n\t\tif (ans > sum)\n\t\t\tans = sum;\n\t\treturn;\n\t}\n\tsolve(i + 1);\n\tpp[i] = 1;\n\tfor (j = i + 1; j < n; j++)\n\t\tif (aa_[j] % aa[i] == 0) {\n\t\t\taa_[j] /= aa[i], bb[j] ^= 1 << i;\n\t\t\tsolve(i + 1);\n\t\t\taa_[j] *= aa[i], bb[j] ^= 1 << i;\n\t\t}\n\tpp[i] = 0;\n}\n\nint main() {\n\tint i, j, p, b;\n\n\tscanf(\"%d\", &n);\n\tfor (i = 0; i < n; i++)\n\t\tscanf(\"%lld\", &aa[i]);\n\tqsort(aa, n, sizeof *aa, compare);\n\tfor (i = 0; i < n; i++) {\n\t\tlong long a;\n\t\tint k;\n\n\t\ta = aa[i];\n\t\tk = 0;\n\t\tfor (p = 2; p <= a / p; p++)\n\t\t\twhile (a % p == 0) {\n\t\t\t\tk++;\n\t\t\t\ta /= p;\n\t\t\t}\n\t\tif (a > 1)\n\t\t\tk++;\n\t\tdp[i][0] = k;\n\t\tfor (b = 1; b < 1 << i; b++) {\n\t\t\ta = aa[i];\n\t\t\tk = dp[i][0];\n\t\t\tfor (j = 0; j < i; j++)\n\t\t\t\tif ((b & 1 << j)) {\n\t\t\t\t\tif (a % aa[j] != 0) {\n\t\t\t\t\t\tk = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ta /= aa[j];\n\t\t\t\t\tk -= dp[j][0];\n\t\t\t\t}\n\t\t\tdp[i][b] = k;\n\t\t}\n\t}\n\tfor (i = 0; i < n; i++)\n\t\taa_[i] = aa[i];\n\tsolve(0);\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "21d5a77273fad8957e8169bbdf5e403d", "src_uid": "52b8b6c68518d5129272b8c56e5b7662", "apr_id": "f8c6a72223cd65373d7cd2c5ed4b1791", "difficulty": 2200, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9661124508186318, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\n\nint main ()\n\n{\n int arr[100002],i,prime_arr[100002]={0},left,mid,temp_ans=0,right,c,cu_arr[100002],j,a,b,k,l[100002],temp_l,temp_x,x[10002],f,num,t,num1,num2,ans,fin_ans,loop,foo ;\n\n prime_arr[0]=prime_arr[1]=1 ;\n\n for(i=4;i<100002;i=i+2){\n prime_arr[i]=1 ;\n }\n for(i=3;i1 && f==1){\n foo=0;\n // printf(\"4 er jnno ki hy!\") ;\n // printf(\"suru x =%d ses x=%d\\n\",a,temp_x) ;\n for(t=a;t<=temp_x;t++){\n num1=t ;\n for(c=0;c=k){\n foo++;\n f=0;\n fin_ans=mid ;\n }\n if(ans=k){\n break ;\n }*/\n\n // printf(\"%d %d\\n\",t,loop) ;\n }\n // printf(\"%d %d\\n\",t,loop) ;\n }\n // printf(\"foo=%d loop=%d ans=%d k=%d\\n\",foo,loop,ans,k) ;\n if(fin_ans>0){\n // printf(\"foo=%d loop=%d ans=%d k=%d\\n\",foo,loop,ans,k) ;\n // printf(\"kybar DHuke!\\n\") ;\n // fin_ans=mid ;\n temp_ans=fin_ans ;\n right=mid-1 ;\n // printf(\"fin_a=%d temp_ans=%d ans=%d\\n\",fin_ans,temp_ans,ans) ;\n // break ;\n }\n else{\n fin_ans=0;\n left=mid+1 ;\n }\n\n /* if(temp_ans>0 && fin_ans==0){\n break ;\n }*/\n\n // printf(\"fin_ans=%d foo=%d loop=%d\\n\") ;\n/* if(fin_ans>0 ){\n // printf(\"left e zay\\n\") ;\n right=mid-1 ;\n }*/\n\n /* else if(fin_ans==0){\n // printf(\"temp_ans=%d fin_ans=temp_ans\\n\") ;\n left=mid+1 ;\n }*/\n\n\n }\n\n\n\n if(temp_ans>0){\n printf(\"%d\\n\",temp_ans) ;\n }\n\n else{\n printf(\"-1\\n\") ;\n }\n\n\nreturn 0 ;\n}\n", "lang": "GNU C11", "bug_code_uid": "f686e6ddf4f3771bae2ed93f286d0606", "src_uid": "3e1751a2990134f2132d743afe02a10e", "apr_id": "96687aa35a425f8e8ea3959dbe12ba09", "difficulty": 1600, "tags": ["binary search", "number theory", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9988536492166603, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\n\nint main()\n{\n\n int sum;\n int min1 , min2 , min3 , max1 , max2 , max3;\n\n scanf(\"%d\",&sum);\n scanf(\"%d %d\",&min1,&max1);\n scanf(\"%d %d\",&min2,&max2);\n scanf(\"%d %d\",&min3,&max3);\n\n if(sum == min1 + min2 + min3)\n {\n printf(\"%d %d %d \",min1, min2, min3);\n }\n else\n {\n while(1)\n {\n if(min1+1 <= max1)\n {\n min1++;\n if(sum == min1 + min2 + min3)\n {\n printf(\"%d %d %d \",min1, min2, min3);\n return ;\n }\n }\n else break;\n }\n\n while(1)\n {\n if(min2+1 <= max2)\n {\n min2++;\n if(sum == min1 + min2 + min3)\n {\n printf(\"%d %d %d \",min1, min2, min3);\n return ;\n }\n }\n else break;\n }\n\n while(1)\n {\n if(min3+1 <= max3)\n {\n min3++;\n if(sum == min1 + min2 + min3)\n {\n printf(\"%d %d %d \",min1, min2, min3);\n return ;\n }\n }\n else break;\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e62601ea44480660bd3c71e7ea78609c", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "fc78f7f1b826025282f3bc2e99cc2608", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5840092699884125, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \nint main()\n{\n long long int n;\n scanf(\"%lld\",&n);\n long long int min1,min2,min3,max1,max2,max3;\n long long int rem;\n scanf(\"%lld\",&min1);\n scanf(\"%lld\",&max1);\n scanf(\"%lld\",&min2);\n scanf(\"%lld\",&max2);\n scanf(\"%lld\",&min3);\n scanf(\"%lld\",&max3);\n \n\n long long int d1=min1;\n long long int d2=min2;\n long long int d3=min3;\n rem=n-d1-d2-d3;\n if(rem\nint sum(int i);\n{\n int k=0;\n while(i>0)\n {\n k=k+i%10;\n i=i/10;\n }\n return k;\n \n}\nint main()\n{\n int i,j,k;\n scanf(\"%d\",&i);\n while(sum(i)%4!=0)\n {\n i++;\n }\n printf(\"%d\",i);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "693051e53e87317ed532c872663f1dec", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "986743833a7a3b686d36cc9b4741855c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9063670411985019, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n,k,i,a,b,x;\n scanf(\"%d%d\",&n,&k);\n\n if(n==1&&k>2)\n printf(\"0\\n\");\n else if(n==1&&k<=2)\n printf(\"1\\n\");\n else if(n*2>=k)\n printf(\"%d\\n\",n);\n else\n {\n if(k%n!=0)\n a=k/n+1;\n else\n a=k/n;\n if(a==2||a==3)\n {\n while(1)\n {\n k=k-a;\n n--;\n if(k%n==0&&k/n<=2)\n break;\n else if(k%n!=0&&(k/n)+1<=2)\n break;\n }\n printf(\"%d\\n\",n);\n }\n else\n printf(\"0\\n\");\n }\n}", "lang": "GNU C11", "bug_code_uid": "e1b3c1d4a19116c8f8455fef8ea52491", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "2889ba1e57ced4ce7a212f1f2edbd872", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.06573130886027292, "equal_cnt": 39, "replace_cnt": 33, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 39, "bug_source_code": "#include \n#include \n\nvoid qs(long int lista[], long int limite_izq, long int limite_der);\nvoid quicksort(long int lista[], int n);\n\nint main(int argc, const char * argv[]) {\n int sucesion = 0;\n int n = 0;\n long int i = 0;\n int may = 0;\n if (scanf(\"%d\", &n)) {\n if (n >= 0) {\n\n long int lista[n];\n for (i = 0; i < n; i++)scanf(\"%li\", &lista[i]);\n may = lista[n - 1];\n int size = n;\n if (n <= 4) {\n\n switch (n) {\n case 0:\n printf(\"0\\n0\\n\");\n case 1:\n printf(\"%li\\n0\", lista[1]);\n break;\n\n case 2:\n printf(\"%li \\n%li\", lista[0], lista[1]);\n break;\n case 3:\n printf(\"%li %li\\n%li\", lista[0], lista[1], lista[2]);\n break;\n case 4:\n if (lista[0] == lista[1] && lista[1] == lista[2] && lista[2] == lista[3]) {\n printf(\"%li %li %li\\n%li\", lista[0], lista[1], lista[2], lista[3]);\n\n } else {\n printf(\"%li %li\\n%li%li\", lista[0], lista[1], lista[2], lista[3]);\n\n }\n\n break;\n\n }\n return 0;\n } else {\n\t\t\t\tint j = 0;\n int b = 0;\n quicksort(lista, size);\n int cero;\n for (i = 0; i < n - 1; i++) {\n if (lista[i] == 0)cero++;\n }\n if (cero > n / 2) {\n for (i = n-1; i >= 0; i--) {\n // if (b == 0 && lista[i] != 0)printf(\"\\n\");\n printf(\"%li \", lista[i]);\n\t\t\t\t\t\tif(lista[i] == 0){\n\t\t\t\t\t\t\tprintf(\"\\n\");\n\t\t\t\t\t\t\tfor (j = i-1; j >= 0; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprintf(\"%li \", lista[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//break;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t}\n }\n return 0;\n }\n\n int x = 0, y = 0;\n int dif = lista[0] - lista[1];\n for (i = 0; i < n - 1; i++) {\n if (dif == (lista[i] - lista[i + 1])) {\n x++;\n } else {\n y = i + 1;\n break;\n }\n }\n if (x != 0 && x!=n) {\n int dif = lista[y + 1] - lista[y + 2];\n for (i = y + 1; i < n - 1; i++) {\n if (dif == (lista[i] - lista[i + 1])) {\n y++;\n } else {\n y = 0;\n break;\n }\n }\n if (y != 0) {\n for (i = 0; i < x; i++) {\n printf(\"%li \", lista[i]);\n }\n printf(\"\\n\");\n for (i = x; i < n; i++) {\n printf(\"%li \", lista[i]);\n }\n\n }\n }\n\t\t\t\t if(y=0 || x==n){\n\t\t\t\t\tprintf(\"No solution\");\n\t\t\t\t\t }\n\n\n }\n }\n }\n return 0;\n}\n\nvoid qs(long int lista[], long int limite_izq, long int limite_der) {\n int izq, der, temporal, pivote;\n\n izq = limite_izq;\n der = limite_der;\n pivote = lista[(izq + der) / 2];\n\n do {\n while (lista[izq] < pivote && izq < limite_der)izq++;\n while (pivote < lista[der] && der > limite_izq)der--;\n if (izq <= der) {\n temporal = lista[izq];\n lista[izq] = lista[der];\n lista[der] = temporal;\n izq++;\n der--;\n\n }\n\n } while (izq <= der);\n if (limite_izq < der) {\n qs(lista, limite_izq, der);\n }\n if (limite_der > izq) {\n\n qs(lista, izq, limite_der);\n }\n\n\n\n}\n\nvoid quicksort(long int lista[], int n) {\n qs(lista, 0, n - 1);\n}\n\n", "lang": "GNU C11", "bug_code_uid": "70121d5d39a58764ceb59c53f4a65ea8", "src_uid": "4408eba2c5c0693e6b70bdcbe2dda2f4", "apr_id": "1f0387ce7d8f8f2c0639d5da9b2dca22", "difficulty": 1300, "tags": ["constructive algorithms", "implementation", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8921389396709324, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint n, m;\nchar f[23],g[23];\n\nint\nmain()\n{\n\tscanf(\"%d %d\", &n, &m );\n scanf( \"%s %s\", f, g );\n char c[5] = { f[0], g[0], f[n-1], g[m-1], '\\0' };\n\tcout << ((!strcmp( c, \"^\" ) || !strcmp( c, \">^0)\n\t{\n\t b1 = b1*10 + b%10;\n\t b /= 10;\n\t}\n\tresult = a + b1;\n\treturn result;\n}", "lang": "GNU C", "bug_code_uid": "13dc77a7d212d791ea9480879fe1e61d", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "9a99b69290e0cce3170a4370c531ea4b", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5619834710743802, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "int main(int a, int b)\n{\n\tint result;\n\tint b1 = 0;\n\twhile(b>0)\n\t{\n\t b1 = b1*10 + b%10;\n\t b /= 10;\n\t}\n\tresult = a + b1;\n\treturn result;\n}", "lang": "GNU C", "bug_code_uid": "05d8dbea0b97edd0fe2a2810330b7184", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "9a99b69290e0cce3170a4370c531ea4b", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.33927188226181254, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "#include \nint main()\n{\n int t1,t2,x1,x2,t0,k1,k2,i,l,r,mid,t,max=0,x,y;\n double dis=0x3f3f3f3f;\n scanf(\"%d %d %d %d %d\",&t1,&t2,&x1,&x2,&t0);\n k1=t1-t0;\n k2=t2-t0;\n for(i=0;x1>=i;i++)\n {\n l=0;\n r=x2;\n while(l<=r)\n {\n mid=(l+r)/2;\n if(k1*i+k2*mid>=0)\n {\n if(i+mid!=0&&(dis>(t1*i+t2*mid)*1.0/(i+mid)-t0||(dis==(t1*i+t2*mid)*1.0/(i+mid)-t0&&max\n#define max_pages 100\nint main()\n{\n\tint i,n,p,k;\n scanf(\"%d%d%d\",&n,&p,&k);\n printf(\"n=%d,p=%d,k=%d\\n\",n,p,k);\n if(n1&&i==p-k)\n {\n printf(\"<< \");\n printf(\"%d \",i);\n }\n else if(i>\");\n }\n else if(i>n)\n break;\n else\n {\n printf(\"%d \",i);\n }\n\n }\n }\n return 1;\n}\n", "lang": "GNU C11", "bug_code_uid": "c075edd016ae0d2ed396727ddca4f794", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "d80cd1a407bf17e2ef1b675e744c3019", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9168704156479217, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int n,p,s,i;\n scanf(\"%d%d%d\",&n,&p,&s);\n if((p-s)!=1)\n { printf(\"<< \");\n }\n for(i=p-s;i<=p+s;i++)\n {\n if(i==p) \n { printf(\"(%d) \",i);\n }else\n {printf(\"%d \",i);\n }if(i==n)\n {\n break;\n }\n }\n if(i>\");\nreturn(\"0\");\n}", "lang": "GNU C11", "bug_code_uid": "1ac0d3973eedb86a6f9ca8160fe7dcbf", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "7efdbdf2253abca714cfa542a563bae5", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9716885743174924, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint main()\n{\n char hour[5];\n for(int i=0;i<5;i++)\n {\n scanf(\"%c\",&hour[i]);\n }\n int h=(hour[0]-'0')*10+(hour[1]-'0');\n int m=(hour[3]-'0')*10+(hour[4]-'0');\n //int m2=(hour[4]-'0')*10+(hour[3]-'0');\n int h2=(hour[1]-'0')*10+(hour[0]-'0');\n if(h2<60&&h2>=m)\n {\n printf(\"%d\",h2-m);\n }\n else if(h2<60&&h2<=m)\n {\n if(h2==32)\n {\n printf(\"%d\",60-m);\n }\n else\n {\n printf(\"%d\",60-m+h2+10);\n }\n }\n else if(h2=>60)\n {\n if(h<10&&m<=1)\n {\n int k=(10-h)*60+1-m;\n printf(\"%d\",k);\n }\n else if(h<10&&m>1)\n {\n int k=(11-h)*60+60-m+11;\n printf(\"%d\",k);\n }\n else if(h<20&&m<=2)\n {\n int k=(20-h)*60+2-m;\n printf(\"%d\",k);\n }\n else if(h>20&&m>2)\n {\n int k=(21-h)*60+60-m+12;\n printf(\"%d\",k);\n }\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "14a12087e68357109020d1605de792a8", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "60aa0d1ad1e9a3c6b8caa4702f3fcac6", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.0876944837340877, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n\nint main()\n{\n\tint **a,i,k=0,n,m,j;\n\tscanf(\"%d %d\",&n,&m);\n\ta=(int **)malloc(n*sizeof(int *));\n\tfor(i=0;i\n\nint main() {\n\tint i, n, k, ans, mod;\n\tscanf(\"%d%d\", &n, &k);\n\tmod = 1000000007;\n\tans = 1;\n\tfor (i = 1; i <= k; ++i)\n\t\tans *= k;\n\tans /= k;\n\tfor (i = 1; i <= n - k; ++i)\n\t\tans = (ans * (n - k) % mod) % mod;\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6744fd755879578e3a11d3aaef92b75c", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "a8282c139c3884c686e118afd688b24d", "difficulty": 1500, "tags": ["dfs and similar", "brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9978494623655914, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define MOD 1000000007\n\nlong long binpow(long long a, long long k)\n{\n long long ans = 1;\n if(a == 0) return 0;\n while(k)\n {\n if(k & 1) \n {\n ans *= a;\n ans %= MOD;\n }\n a *= a;\n a %= MOD;\n k >>= 1;\n }\n return ans;\n}\n\nint main()\n{\n long long n, k; \n scanf(\"%lld %lld\", &n, &k);\n printf(\"%lld\", binpow(k, k - 1) * binpow(n - k, n - k) % MOD);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c8af7977bd52dd6cdfb64b9dcc7d25d6", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "dbac7ee3caccb2ff4f7f08de7d2ea905", "difficulty": 1500, "tags": ["dfs and similar", "brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24507283633247642, "equal_cnt": 24, "replace_cnt": 19, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 24, "bug_source_code": "#include \n\nint main() {\n int size = 26;\n int n, v, i;\n char* s;\n int h[size];\n int cont = 0;\n \n for (i = 0; i < size; i++)\n h[i] = 0;\n \n scanf(\"%d\", &n);\n \n scanf(\"%s\", s);\n int index;\n\n for (i = 0; i < n; i++) {\n v = s[i];\n\n if (v >= 97 && v <= 122)\n v -= 32;\n \n if (v >= 65 && v <= 90) {\n index = v-65;\n \n if (h[index] == 0) {\n h[index] = 1;\n cont++;\n }\n }\n \n }\n\n if (cont == size)\n printf(\"YES\");\n else\n printf(\"NO\");\n \n return 0;\n}\n\n// 1470184217794", "lang": "GNU C", "bug_code_uid": "60bbfd458e68bd172df50c9412391c44", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "3401aa76840c9fd121853095b679f874", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16241737488196412, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\n#include\n\nint t, s, x;\n\nvoid readInput()\n{\n scanf(\"%d %d %d\", &t, &s, &x);\n\n}\n\nvoid solve()\n{\n int time;\n\n if(x\n#include \n\nint compare(const void* a, const void* b)\n{\n int* x = (int*) a;\n int* y = (int*) b;\n return x - y;\n}\n\nint main(int argc, const char *argv[])\n{\n\tint a[500000], x;\n unsigned i, n, p = 0;\n\tunsigned long long ans = 0;\n\n\tscanf(\"%u\", &n);\n\tfor(i = 0; i < n; i++)\n\t{\n\t\tscanf(\"%d\", &x);\n\t\twhile(p > 1 && a[p - 2] >= a[p - 1] && x >= a[p - 1])\n {\n\t\t\tans += (a[p-2] < x) ? a[p-2] : x;\n\t\t\tp--;\n\t\t}\n\t\ta[p++] = x;\n\t}\n\n qsort(a, 500000, sizeof(int), compare);\n\n for(i = 0; i < p - 2; i++)\n ans += a[i];\n\tprintf(\"%I64d\\n\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7c8c2aae5b7660246ecc0bb0089de817", "src_uid": "e7e0f9069166fe992abe6f0e19caa6a1", "apr_id": "09dd4493ce21af7b0a8e4475b6211990", "difficulty": 2500, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9835831548893648, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint compare(const void* a, const void* b)\n{\n int* x = (int*) a;\n int* y = (int*) b;\n return *x - *y;\n}\n\nunsigned min(const unsigned a, const unsigned b)\n{\n return (a < b) ? a : b;\n}\n\nint main(int argc, const char *argv[])\n{\n\tunsigned a[500000] = {0};\n unsigned x, n, i, j = 0;\n\tunsigned long long ans = 0;\n\n\tscanf(\"%u\", &n);\n\tfor(i = 0; i < n; i++)\n\t{\n\t\tscanf(\"%u\", &x);\n\t\twhile(j > 1 && a[j - 2] >= a[j - 1] && x >= a[j - 1])\n {\n\t\t\tans += min(a[j - 2], x);\n\t\t\tj--;\n\t\t}\n\t\ta[j++] = x;\n\t}\n\n qsort(a, j, sizeof(unsigned), compare);\n\n for(i = 0; i < j - 2; i++)\n ans += a[i];\n\n\tprintf(\"%I64d\\n\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0f20d38ad3e2f281795b2ac91a5a3d94", "src_uid": "e7e0f9069166fe992abe6f0e19caa6a1", "apr_id": "09dd4493ce21af7b0a8e4475b6211990", "difficulty": 2500, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6513011152416357, "equal_cnt": 23, "replace_cnt": 5, "delete_cnt": 12, "insert_cnt": 6, "fix_ops_cnt": 23, "bug_source_code": "//\n// main.cpp\n// 287 A\n//\n// Created by Mihai Esanu on 6/3/19.\n// Copyright \u00a9 2019 Mihai Esanu. All rights reserved.\n//\n\n#include \n\nint main() {\n int i,j, a[4][4];\n char s[4];\n for(i = 0; i < 4; i++)\n { scanf(\"%s\", &s);\n if(s[0] == '#' )\n a[i][0] = 1;\n else a[i][0] = 0;\n \n if(s[1] == '#' )\n a[i][1] = 1;\n else a[i][1] = 0;\n \n if(s[2] == '#' )\n a[i][2] = 1;\n else a[i][2] = 0;\n \n if(s[3] == '#' )\n a[i][3] = 1;\n else a[i][3] = 0;\n}\n for(i = 0; i < 3; i++)\n for(j = 0; j < 3; j++)\n {\n int m = a[i][j] + a[i+1][j] + a[i][j+1] + a[i+1][j+1];\n if(m != 2 ) {printf(\"YES\"); return 0;}\n }\n printf(\"NO\");\n \n \n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f19903f4944ab443f1c1aebbc0fab407", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "231b5803bd2a24627f01987146caafb4", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9943342776203966, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint main()\n{\n\tint n, a, b, x, y;\n\tint flag = 0;\n\tscanf(\"%d %d %d %d %d\", &n, &a, &x, &b, &y);\n\ta--;\n\tb--;\n\tx--;\n\ty--;\n\tint i = a;\n\tint j = b;\n\n\tfor(int k=0; k\n#import \n#import \n\nint main(){\n int n,i;\n scanf(\"%d\", &n);\n char* m = {\"Sheldon\",\"Leonard\",\"Penny\",\"Rajesh\",\"Howard\"};\n i=5;\n if (n<=5){\n n--;\n }\n \n while (i\nint main()\n{\n int i,j,k,l,arr[50];\n scanf(\"%d\",&k);\n if(k==1)\n {\n scanf(\"%d\",&j);\n printf(\"-1\");\n }\n else\n {\n for(i=0;i\n\n#define max(a,b) (ab?b:a)\ntypedef unsigned long long u64;\n\nint N, K;\nchar s[101];\nu64 n[101][26], l[101][26], t[101];\n\nint main() {\n int i,j, k;\n\n scanf(\"%d %d\", &N, &K);\n scanf(\"%s\", s);\n\n n[0][0] = 1;\n t[0] = 1;\n for (i = 1; i <= N; i++) {\n int c = s[i-1] - 'a';\n for (j = i; j >= 1; j--) {\n u64 d = 0;\n for (k = 0; k < 26; k++)\n d += n[j-1][k];\n d -= l[j][c];\n n[j][c] += d;\n l[j][c] = n[j][c];\n\n t[j] += d;\n }\n }\n\n u64 cost = 0;\n u64 r = K;\n for (i = N; i >= 0 && r; i--) {\n u64 a = min(r, t[i]);\n cost += a * (N - i);\n r -= a;\n }\n printf(\"%lld\\n\", !r?cost:-1);\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "9dae76f63c81c2af80166ec97e9b08f1", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "f6f82b86dad648ec0e3c0404d7e762a7", "difficulty": 1900, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9982978723404256, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \ntypedef long long ll;\n#define rep(i,n) for(int i=0;i<(int)(n);i++)\n\nint main() {\n ll k, n;\n scanf(\"%d%d\", &n, &k);\n char s[105];\n scanf(\"%s\", s);\n\n char next[105][30]; //next[i][c]: i\u304b\u3089\u898b\u3066\u4e00\u756a\u521d\u3081\u306bc(+'a')\u304c\u73fe\u308c\u308bindex\n for (int j = 0; j < 26; j++) next[n][j] = n;\n for (int i = n-1; i >= 0; i--) {\n for (int j = 0; j < 26; j++) next[i][j] = next[i+1][j];\n next[i][s[i]-'a'] = i;\n }\n\n ll dp[105][105] = {0}; //dp[i][l]: s\u306ei\u6587\u5b57\u76ee\u3092\u63a5\u5c3e\u8f9e\u3068\u3057\u3066\u3082\u3064\uff0c\u9577\u3055l\u306e\u90e8\u5206\u6587\u5b57\u5217\u306e\u6570\n dp[0][0] = 1;\n for (int i = 0; i < n; ++i) {\n for (int j = 0; j < 26; ++j) {\n if (next[i][j] >= n) continue;\n for (int l = 0; l < n; l++)\n dp[next[i][j] + 1][l+1] += dp[i][l];\n }\n }\n\n ll ans = 0, cnt = 0, tmp = 1;\n for (int j = n-1; j >= 0; j--) {\n for (int i = 0; i <= n; i++) {\n tmp += dp[i][j];\n if(tmp < k){ \n ans += (n-j)*dp[i][j];\n }else{\n ans += (n-j)*(k-(tmp-dp[i][j]));\n break;\n }\n }\n if(tmp >= k) break;\n }\n if(tmp < k) ans = -1;\n\n printf(\"%lld\\n\", ans);\n}\n", "lang": "GNU C11", "bug_code_uid": "d3943faa376211db84e51a32ffffeee2", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "82830f23213f7a3e972e607548bbfa53", "difficulty": 1900, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7288629737609329, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n int i,c=0,j,a[100,100];\n scanf(\"%d %d\",&n,&m);\n if(m\nint countb(char b[]){\n\tif(b[0]==b[1]&&b[1]==b[2]){\n\t\treturn 0;\n\t}else if(b[0]==b[1]||b[0]==b[2]||b[2]==b[1]){\n\t\treturn 1;\n\t}else {\n\t\treturn 2;\n\t}\n}\nint countwhat(char b[]){\n\tif(b[0]==b[1]&&b[1]==b[2]){\n\t\treturn 1;\n\t}else if(b[0]==b[1]||b[0]==b[2]||b[2]==b[1]){\n\t\treturn 1;\n\t}else {\n\t\treturn 2;\n\t}\n}\nint countab(char b[],int m){\n\tif(m==1){\n\t\tif(b[0]==b[1]){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 2;\n\t\t}\t\n\t}else if(m==2){\n\t\tif(b[1]==b[2]){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 2;\n\t\t}\n\t}else{\n\t\tif(b[0]==b[2]){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 2;\n\t\t}\n\t}\n}\nint main(){\n\tchar input[10];\n\tgets(input);\n\tint a[]={input[0]-48,input[3]-48,input[6]-48};\n\tchar b[]={input[1],input[4],input[7]};\n\tfor(int j=0;j<2;j++){\n\t\tfor(int i=0;i<3;i++){\n\t\t\tint mida;\n\t\t\tchar midb;\n\t\t\tif(i+1<3&&a[i]>a[i+1]){\n\t\t\t\tmida=a[i];\n\t\t\t\ta[i]=a[i+1];\n\t\t\t\ta[i+1]=mida;\n\t\t\t\tmidb=b[i];\n\t\t\t\tb[i]=b[i+1];\n\t\t\t\tb[i+1]=midb;\n\t\t\t}\n\t\t}\n\t}\n\tif(a[0]+1==a[1]&&a[1]+1==a[2]){\n\t\tprintf(\"%d\\n\",countb(b));\n\t\treturn 0;\n\t}else if(a[0]==a[1]&&a[1]==a[2]){\n\t\tprintf(\"%d\\n\",countb(b));\n\t\treturn 0;\n\t}else if(a[0]==a[1]){\n\t\tif(a[0]+1==a[2]||a[0]+2==a[2]){\n\t\t\tprintf(\"%d\\n\",countwhat(b));\n\t\t\treturn 0;\n\t\t}else{\n\t\t\tprintf(\"%d\\n\",countab(b,1));\n\t\t\treturn 0;\n\t\t}\n\t}else if(a[1]==a[2]){\n\t\tif(a[0]+1==a[1]||a[0]+2==a[1]){#include\nint countb(char b[]){\n\tif(b[0]==b[1]&&b[1]==b[2]){\n\t\treturn 0;\n\t}else if(b[0]==b[1]||b[0]==b[2]||b[2]==b[1]){\n\t\treturn 1;\n\t}else {\n\t\treturn 2;\n\t}\n}\nint countab(char b[],int m){\n\tif(m==1){\n\t\tif(b[0]==b[1]){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 2;\n\t\t}\t\n\t}else if(m==2){\n\t\tif(b[1]==b[2]){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 2;\n\t\t}\n\t}else{\n\t\tif(b[0]==b[2]){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 2;\n\t\t}\n\t}\n}\nint main(){\n\tchar input[10];\n\tgets(input);\n\tint a[]={input[0]-48,input[3]-48,input[6]-48};\n\tchar b[]={input[1],input[4],input[7]};\n\tfor(int j=0;j<2;j++){\n\t\tfor(int i=0;i<3;i++){\n\t\t\tint mida;\n\t\t\tchar midb;\n\t\t\tif(i+1<3&&a[i]>a[i+1]){\n\t\t\t\tmida=a[i];\n\t\t\t\ta[i]=a[i+1];\n\t\t\t\ta[i+1]=mida;\n\t\t\t\tmidb=b[i];\n\t\t\t\tb[i]=b[i+1];\n\t\t\t\tb[i+1]=midb;\n\t\t\t}\n\t\t}\n\t}\n\tint ab[3];\n\tfor(int i=0;i<3;i++){\n\t\tab[i]=countab(b,i+1);\n\t}\n\tfor(int j=0;j<2;j++){\n\t\tfor(int i=0;i<3;i++){\n\t\t\tint mida;\n\t\t\tif(i+1<3&&ab[i]>ab[i+1]){\n\t\t\t\tmida=ab[i];\n\t\t\t\tab[i]=ab[i+1];\n\t\t\t\tab[i+1]=mida;\n\t\t\t}\n\t\t}\n\t}\n\tif(a[0]+1==a[1]&&a[1]+1==a[2]){\n\t\tprintf(\"%d\\n\",countb(b));\n\t\treturn 0;\n\t}else if(a[0]==a[1]&&a[1]==a[2]){\n\t\tprintf(\"%d\\n\",countb(b));\n\t\treturn 0;\n\t}else if(a[0]==a[1]){\n\t\tif(a[0]+1==a[2]||a[0]+2==a[2]){\n\t\t\tprintf(\"%d\\n\",ab[0]);\n\t\t\treturn 0;\n\t\t}else{\n\t\t\tprintf(\"%d\\n\",countab(b,1));\n\t\t\treturn 0;\n\t\t}\n\t}else if(a[1]==a[2]){\n\t\tif(a[0]+1==a[1]||a[0]+2==a[1]){\n\t\t\tprintf(\"%d\\n\",ab[0]);\n\t\t\treturn 0;\n\t\t}else{\n\t\t\tprintf(\"%d\\n\",countab(b,2));\n\t\t\treturn 0;\n\t\t}\n\t}else if(a[0]+1==a[1]||a[0]+2==a[1]){\n\t\tif(a[1]+1==a[2]||a[1]+2==a[2]){\n\t\t\tprintf(\"%d\\n\",countab(b,1)>countab(b,2)?countab(b,2):countab(b,1));\n\t\t\treturn 0;\n\t\t}\n\t\tprintf(\"%d\\n\",countab(b,1));\n\t}else if(a[1]+1==a[2]||a[1]+2==a[2]){\n\t\tprintf(\"%d\\n\",countab(b,2));\n\t}else {\n\t\tprintf(\"%d\\n\",2);\n\t}\n}\n\t\t\tprintf(\"%d\\n\",countwhat(b));\n\t\t\treturn 0;\n\t\t}else{\n\t\t\tprintf(\"%d\\n\",countab(b,2));\n\t\t\treturn 0;\n\t\t}\n\t}else if(a[0]+1==a[1]||a[0]+2==a[1]){\n\t\tprintf(\"%d\\n\",countab(b,1));\n\t\treturn 0;\n\t}else if(a[1]+1==a[2]||a[1]+2==a[2]){\n\t\tprintf(\"%d\\n\",countab(b,2));\n\t}else {\n\t\tprintf(\"%d\\n\",2);\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "a6d8e57027dfaba400ccc87bad286dc6", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "ad4c9492f7d1a9c424a787183737b375", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6798843453118546, "equal_cnt": 26, "replace_cnt": 17, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 25, "bug_source_code": "#include \n#include \nusing namespace std;\n\nint cor[3][9];\nint main() {\n char c[3];\n int n[3];\n scanf(\"%d%c %d%c %d%c\",&n[0],&c[0],&n[1],&c[1],&n[2],&c[2]);\n for(int i=0;i<3;i++) {\n if(c[i]=='m') c[i]=0;\n else if(c[i]=='p') c[i]=1;\n else if(c[i]=='s') c[i]=2;\n }\n for(int i=0;i<3;i++) {\n cor[c[i]][n[i]]=1;\n cor[c[i]][0]++;\n }\n for(int i=0;i<3;i++) {\n if(cor[i][0]==3) {\n sort(n,n+3);\n if(n[0]==n[1] && n[1]==n[2]) {\n printf(\"0\");\n return 0;\n }\n else if(n[1]-n[0]==1 && n[2]-n[1]==1) {\n printf(\"0\");\n return 0;\n }\n else if(n[1]-n[0]==1 || n[2]-n[1]==1) {\n printf(\"1\");\n return 0;\n }\n else if(n[0]==n[1] || n[1]==n[2]) {\n printf(\"1\");\n return 0;\n }\n }\n else if(cor[i][0]==2) {\n for(int j=1;j<=9;j++) {\n if(cor[i][j]==2) {\n printf(\"1\");\n return 0;\n }\n }\n for(int j=1;j<9;j++) {\n if(cor[i]>0 && cor[i+1] >0) {\n printf(\"1\");\n return 0;\n }\n }\n }\n }\n printf(\"2\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a6b19f14517dc6683fe4ac691b0211de", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "181af39d7519b79e4191d2196e8c6b8c", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9940284795590262, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\n#define maxn 10001\n\nconst int mod = (int) 1e9 + 7;\n\nlong long choose[maxn][maxn];\n\nlong long f[maxn][maxn];\nlong long g[maxn][maxn];\n\nlong long power( long long a, long long b ) {\n\tlong long ret = 1;\n\t\n\ta %= mod;\n\twhile( b > 0 ) {\n\t\tif( b % 2 ) {\n\t\t\tret = (ret * a) % mod;\n\t\t}\n\t\t\n\t\tb /= 2;\n\t\ta = (a * a) % mod;\n\t}\n\t\n\treturn ret;\n}\n\nint main( void ) {\n\tlong long n, m, k;\n\tscanf(\"%lld %lld %lld\", &n, &m, &k);\n\t\n\tfor( int i = 0; i < maxn; i++ ) {\n\t\tchoose[i][0] = choose[i][i] = 1;\n\t\tfor( int j = 1; j < i; j++ ) {\n\t\t\tchoose[i][j] = (choose[i-1][j] + choose[i-1][j-1]) % mod;\n\t\t}\n\t}\n\t\n\tfor( int i = 1; i <= n; i++ ) {\n\t\tfor( int c = 0; c <= n; c++ ) {\n\t\t\tlong long count = (m / n) + (m % n >= i ? 1 : 0);\n\t\t\tg[i][c] = power(choose[n][c], count);\n\t\t}\n\t}\n\t\n\tf[1][0] = 1;\n\tfor( int i = 1; i <= n; i++ ) {\n\t\tfor( int j = 0; j <= k; j++ ) if( f[i][j] > 0 ) {\n\t\t\tfor( int c = 0; c <= n; c++ ) {\n\t\t\t\tif( j + c > k ) break;\n\t\t\t\tlong long nways = (g[i][c] * f[i][j]) % mod;\n\t\t\t\tf[i+1][j+c] = (f[i+1][j+c] + nways) % mod;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprintf(\"%lld\\n\", f[n+1][k]);\n\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "5061088ba4dece1d3ce558bc2e89268b", "src_uid": "9c71c8e031412e2bb21266a53821626a", "apr_id": "2e7c36bee6aaf29457bf9f7fbd220219", "difficulty": 1900, "tags": ["dp", "math", "combinatorics", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9995402298850574, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define maxn 111\n\nconst int mod = (int) 1e9 + 7;\n\nlong long choose[maxn][maxn];\n\nlong long f[maxn][1001];\nlong long g[maxn][maxn];\n\nlong long power( long long a, long long b ) {\n\tlong long ret = 1;\n\t\n\ta %= mod;\n\twhile( b > 0 ) {\n\t\tif( b % 2 ) {\n\t\t\tret = (ret * a) % mod;\n\t\t}\n\t\t\n\t\tb /= 2;\n\t\ta = (a * a) % mod;\n\t}\n\t\n\treturn ret;\n}\n\nint main( void ) {\n\tlong long n, m, k;\n\tscanf(\"%lld %lld %lld\", &n, &m, &k);\n\t\n\tfor( int i = 0; i < maxn; i++ ) {\n\t\tchoose[i][0] = choose[i][i] = 1;\n\t\tfor( int j = 1; j < i; j++ ) {\n\t\t\tchoose[i][j] = (choose[i-1][j] + choose[i-1][j-1]) % mod;\n\t\t}\n\t}\n\t\n\tfor( int i = 1; i <= n; i++ ) {\n\t\tfor( int c = 0; c <= n; c++ ) {\n\t\t\tlong long count = (m / n) + (m % n >= i ? 1 : 0);\n\t\t\tg[i][c] = power(choose[n][c], count);\n\t\t}\n\t}\n\t\n\tf[1][0] = 1;\n\tfor( int i = 1; i <= n; i++ ) {\n\t\tfor( int j = 0; j <= k; j++ ) if( f[i][j] > 0 ) {\n\t\t\tfor( int c = 0; c <= n; c++ ) {\n\t\t\t\tif( j + c > k ) break;\n\t\t\t\tlong long nways = (g[i][c] * f[i][j]) % mod;\n\t\t\t\tf[i+1][j+c] = (f[i+1][j+c] + nways) % mod;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprintf(\"%lld\\n\", f[n+1][k]);\n\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "a1fcfec4efbcf5422c79530575d6b291", "src_uid": "9c71c8e031412e2bb21266a53821626a", "apr_id": "2e7c36bee6aaf29457bf9f7fbd220219", "difficulty": 1900, "tags": ["dp", "math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9839142091152815, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main() {\n\tstatic int kk[10];\n\tlong long sum;\n\tint n, d, a, b;\n\n\tscanf(\"%d\", &n);\n\tfor (d = 1; d <= 9; d++)\n\t kk[d] = n / 9 + ((n + 8) % 9 + 1 >= d);\n\tsum = 0;\n\tfor (a = 1; a <= 9; a++)\n\t\tfor (b = 1; b <= 9; b++)\n\t\t\tsum += (long long) kk[a] * kk[b] * kk[(a * b + 8) % 9 + 1];\n\tfor (a = 1; a <= n; a++)\n\t\tsum -= n / a;\n\tprintf(\"%lld\\n\", sum);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "25ab2cfc00f205e0cfc9b2d175dfea6a", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "222f93a4d68407f90ae5928ac1041a77", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9488859764089121, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint f[9],g[9];\n\n// digital root je zapravo modul od 9.\n// ako je mod 9 == 0, digtalni root je 9.\n\nint main() {\n\tlong long a,b,n;\n\tscanf(\"%lld\\n\",&n);\n\tfor (a=1;a<=n;a++) f[a%9]++;\n\tlong long cnt=0;\n\tfor (a=0;a<9;a++)\n\t\tfor (b=0;b<9;b++)\n\t\t\tcnt+=f[a]*f[b]*f[a*b%9];\n\tfor (a=1;a*a<=n;a++)\n\t\tcnt-=(n-a*a)/a*2+1;\n\tprintf(\"%lld\\n\",cnt);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6ccea823aeb292e131cae73b324b850b", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "cc27f3356242d356894cf96e5eb9a820", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9734939759036144, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main()\n{\n int n,mx=0;\n char str[105], *res;\n scanf(\"%i%s\", &n, str);\n for(int i=0 ; imx) mx=count, res=&str[i];\n }\n printf(\"%c%c\\n\", res[0], res[1]);\n}", "lang": "GNU C11", "bug_code_uid": "d9b02bb986499b4841f8f9308f01b37b", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "731ebb4778f8e637a96a049cd946eb4d", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8888888888888888, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main() {\n\tint a,b,c,d,e,f;\n\tscanf(\"%d%d%d%d%d%d\",&a,&b,&c,&d,&e,&f);\n\tprintf(\"%d\",(a+b+c)*(a+b+c)-a*a-c*c-e*e);\n}\n", "lang": "GNU C", "bug_code_uid": "52fd31fd94eae8bb587eb977be6f2183", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "4a04b2277262be336c25d319046dce1c", "difficulty": 1600, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9961832061068703, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \nint main()\n{ int x,y,i=0;\n\tint pr[20]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};\n\tscanf(\"%d %d\",&x,&y);\n\tfor(i=1;;i++)\n\t\tif(x==pr[i])\n\t\t\tbreak;\n\n\t\tif(y==pr[i+1])\n\t\t\tprintf(\"YES\");\n\t\telse \n\t\t\tprintf(\"NO\");\n\treturn 0;\t\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "9369f7f4e776acb10d2649a42a26402f", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "06fed9308641e3738bf900f006df3b19", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8668600902643456, "equal_cnt": 61, "replace_cnt": 10, "delete_cnt": 10, "insert_cnt": 40, "fix_ops_cnt": 60, "bug_source_code": "#include \n#include \nint main ()\n{\n char s [101],l,i,j;\n scanf (\"%s\",s);\n l=strlen (s);\n for (i=0;i \n#include \nint main ()\n{\n char s [101],l,i,j;\n scanf (\"%s\",s);\n l=strlen (s);\n for (i=0;i 1){\n\t\tpiv = b + (en-b)/2;\n\t\t//printf(\"%llu %llu %llu %llu %llu \\n\", b, piv, en, s_n(piv), step);\n\t\tif (s_n(piv)>step){\n\t\t\ten = piv;\n\t\t} else {\n\t\t\tb = piv;\n\t\t}\n\t}\n\n\t/*if(!(step%6)){\n\t\tmpos.x = -2;\n\t}\n\t\n\tunsigned long long pi = 0;\n\t//unsigned long long st = 1;\n\t\n\twhile ((step) >= pi){\n\t\tstep -= pi;\n\t\tpi+=6;\n\t\tst++;\n\t}\n\t/*if(st == en){\n\t\tprintf(\"%llu oK\\n\",st);\n\t} else {\n\t\tprintf(\"%llu nOk\\n\", st);\n\t}*/\n\tst = en;\n\tstep-= s_n(st-1);\n\tmpos.x += (st-1)*2;\n\tst --;\n\tif(step>st){\n\t\tmpos.x -=st;\n\t\tmpos.y +=2*st;\n\t\tstep -= st;\n\t} else {\n\t\tmpos.x -=step;\n\t\tmpos.y +=2*step;\n\t\tstep = 0;\n\t}\n\n\tif(step>st){\n\t\tmpos.x -=2*st;\n\t\tstep -= st;\n\t} else {\n\t\tmpos.x -=2*step;\n\t\tstep = 0;\n\t}\n\n\tif(step>st){\n\t\tmpos.x -=st;\n\t\tmpos.y -=2*st;\n\t\tstep -= st;\n\t} else {\n\t\tmpos.x -=step;\n\t\tmpos.y -=2*step;\n\t\tstep = 0;\n\t}\n\n\tif(step>st){\n\t\tmpos.x +=st;\n\t\tmpos.y -=2*st;\n\t\tstep -= st;\n\t} else {\n\t\tmpos.x +=step;\n\t\tmpos.y -=2*step;\n\t\tstep = 0;\n\t}\n\n\tif(step>st){\n\t\tmpos.x +=2*st;\n\t\tstep -= st;\n\t} else {\n\t\tmpos.x +=2*step;\n\t\tstep = 0;\n\t}\n\n\tif(step>st){\n\t\tmpos.x +=st;\n\t\tmpos.y +=2*st;\n\t\tstep -= st;\n\t} else {\n\t\tmpos.x +=step;\n\t\tmpos.y +=2*step;\n\t\tstep = 0;\n\t}\n\n\tprintf(\"%ld %ld\", mpos.x, mpos.y);\n}", "lang": "GNU C11", "bug_code_uid": "b4315282d129817ac31374588d4b075c", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "24fb05dd2506f493f374f3cae82a692b", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9855682501503308, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\t\nlong long n;\nlong long bisearch()\n{\n long long l=0,r=1e9,mid;\n while(l<=r)\n {\n mid=((l+r)>>1);\n if(3*mid*(mid+1)>n)r=mid-1;\n else l=mid+1;\n }\n return l;\n}\nint main()\n{\n\n\twhile(~scanf(\"%lld\",&n))\n\t{\n\t\tlong long p,q;\n\t\tif(n==0)\n\t\t{\n\t\t\tprintf(\"0 0\\n\");\n\t\t\tbreak;\n\t\t}\n\t\tlong long i=bisearch();\n//\t\tprintf(\"%lld\\n\",bisearch());\n//\t\tfor(long long i=1;;i++)\n//\t\t{\n//\t\t\tif(n>=i*6)\n//\t\t\t{\n//\t\t\t\tn-=i*6;\n//\t\t\t\tcontinue;\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\tprintf(\"i==%d,n==%d,nMODi=%d\\n\",i,n,n/i);\n//\t\t\t\t\n\t\t\t\tif(n==0)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld 0\\n\",2*(i-1));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(ni && n<2*i)\n\t\t\t\t{\n\t\t\t\t\tn-=i;\n\t\t\t\t\tprintf(\"%lld %lld\\n\",1*i-2*n,2*i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n==2*i)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld %lld\\n\",-1*i,2*i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t\telse if(n>2*i && n<3*i)\n\t\t\t\t{\n\t\t\t\t\tn-=2*i;\n\t\t\t\t\tprintf(\"%lld %lld\\n\",-1*i-n,2*i-2*n);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n==3*i)\t\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld 0\\n\",-2*i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n>3*i && n<4*i)\n\t\t\t\t{\n\t\t\t\t\tn-=3*i;\n\t\t\t\t\tprintf(\"%lld %lld\\n\",-2*i+n,0-2*n);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n==4*i)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld %lld\\n\",-1*i,-2*i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n>4*i && n<5*i)\n\t\t\t\t{\n\t\t\t\t\tn-=4*i;\n\t\t\t\t\tprintf(\"%lld %lld\\n\",-1*i+2*n,-2*i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n==5*i)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld %lld\\n\",1*i,-2*i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(n>5*i)\n\t\t\t\t{\n\t\t\t\t\tn-=5*i;\n\t\t\t\t\tprintf(\"%lld %lld\\n\",1*i+n,-2*i+2*n);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t//}\n\t\t//}\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "558893946e6597b56c04c08da9ba940b", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "cd30ca5f1ea9eacb4feec365de6ee08b", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9975786924939467, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{\n\tdouble a, b, c, d ;\n\n\tscanf(\"%lf%lf%lf\", &a, &b, &c);\n\td = ceil(a * c / 100 - b);\n\tif (d <= 0)\n\t\tprintf(\"0\\n\");\n\telse\n\t\tprintf(\"%.0lf\", d));\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c3fe21dab08653e18ca31d397f60e3a4", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "ecc690fb2631c40c875b16fe4df29ac9", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8185096153846154, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n\nint n;\nint a[105];\nint candies=0;\nint sum=0;\nint ind=0;\nint less[105];\n\nvoid rem(){\n int cont=0;\n int i;\n for(i=1; i0 && a[0]<=a[i]) win=1;\n }\n rem();\n if(win==0) printf(\"0\");\n else{\n if(sum%(n-ind)>=2){\n candies=sum/(n-ind)+2-a[0];\n }\n else candies=sum/(n-ind)+1-a[0];\n printf(\"%d\", candies);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "185aedbcbe4a3f22d90e5ab247e0a64c", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "82ff833af7c04cf72a9b7057c5036122", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.772609819121447, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 12, "bug_source_code": "#include\n#include\nint main ()\n{\n int n,i;\n char s[200];\n scanf(\"%s\",s);\n n=strlen(s);\n for (i=0;i\n\nint main ()\n{\n\tlong long int n;\n\tscanf(\"%lld\",&n);\n\n\tif (n==1)\n\t\tprintf(\"1\\n\");\n\n\telse if (n==2)\n\t\tprintf(\"2\\n\");\n\n\telse\n\t{\n\t\tlong long int sum=1, count=1, var=1;\n\n\t\twhile (sum+1\n#include \n#include \n\nlong int sumofdigits( long int n );\n\nint main() {\n long int n;\n //long int * sum;\n scanf(\"%d\",&n);\n // sum = (long int *)malloc(1000000000 * sizeof(long int));\n int test = 0;\n int flag = 0 ;\n long int ct;\n long int numbers[n];\n for(ct = 0 ; ct < n ; ct++){\n if(sumofdigits(ct) == n){\n numbers[test] = ct;\n test++;\n }\n }\n if(test == 0){\n printf(\"0\");\n return 0;\n }\n printf(\"%d\\n\", test);\n for(ct = 0 ; ct < test ; ct++){\n printf(\"%d\\n\",numbers[ct]);\n }\n}\n\n\nlong int sumofdigits( long int n ){\nif(n < 10){\n return 2 * n;\n}\nlong int sum = n;\nwhile(n > 0){\n sum += n % 10 ;\n n = n / 10 ;\n}\nreturn sum;\n}\n", "lang": "GNU C11", "bug_code_uid": "793872c1f19f46c7b492aea27d4c0331", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "apr_id": "4541829da11e68e369954ff8893a9c35", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5860255447032306, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 15, "bug_source_code": "#include \n\nint main()\n{\n\tint input[6], i, j, nfoots, head, body; \n\tscanf(\"%d %d %d %d %d %d\\n\", input[0], input[1], input[2], input[3], input[4], input[5]);\n\n\tfor (i = 0; i < 3; i++) {\n\t\tnfoots = 0;\n\t\thead = -1;\n\t\tfor (j = i + 1; j < 6; j++) {\n\t\t\tif (input[i] == input[j]) {\n\t\t\t\tnfoots++;\n\t\t\t} else {\n\t\t\t\tif (head == -1) {\n\t\t\t\t\thead = input[j];\n\t\t\t\t} else {\n\t\t\t\t\tbody = input[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (nfoots == 3) {\n\t\t\tif (body == head) {\n\t\t\t\tprintf(\"Elephant\\n\");\n\t\t\t} else {\n\t\t\t\tprintf(\"Bear\\n\");\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tprintf(\"Alien\\n\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "7021157e60479450328e99cb77f88d80", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "142eca6d873b432d265072e9839f1d1e", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9913793103448276, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nlong long int power(long long int a,long long int b)\n{ \n long long int res=1;\n while(b!=0)\n {\n if(b&1)\n res=res*a;\n a=a*a;\n b=b/2;\n }\n return res;\n}\nint main()\n{long long int m;\n scanf(\"%lld\",&m);\n long long int res;\n res=(2*4*3*power(4,m-3))+(4*3*3*power(4,n-4));\n printf(\"%lld\\n\",res);\n \n}", "lang": "GNU C11", "bug_code_uid": "39076819271948dba4c3323d09edf736", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "5641f0872e24448838cf0c873ef70cef", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9991928974979822, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/* practice with Dukkha */\n#include \n\nint md;\n\nlong long power(int a, long long k) {\n\tlong long p;\n\n\tif (k == 0)\n\t\treturn 1;\n\tp = power(a, k / 2);\n\tp = p * p % md;\n\tif (k % 2)\n\t\tp = p * a % md;\n\treturn p;\n}\n\nvoid mult(int aa[][2], int bb[][2], int cc[][2]) {\n\tint i, j, k;\n\n\tfor (i = 0; i < 2; i++)\n\t\tfor (j = 0; j < 2; j++) {\n\t\t\tlong long c = 0;\n\n\t\t\tfor (k = 0; k < 2; k++)\n\t\t\t\tc += (long long) aa[i][k] * bb[k][j];\n\t\t\tcc[i][j] = c % md;\n\t\t}\n}\n\nvoid power_(int aa[][2], int pp[][2], int tt[][2], long long k) {\n\tif (k == 0) {\n\t\tpp[0][0] = pp[1][1] = 1;\n\t\tpp[0][1] = pp[1][0] = 0;\n\t\treturn;\n\t}\n\tif (k % 2 == 0) {\n\t\tpower_(aa, tt, pp, k / 2);\n\t\tmult(tt, tt, pp);\n\t} else {\n\t\tpower_(aa, pp, tt, k / 2);\n\t\tmult(pp, pp, tt);\n\t\tmult(tt, aa, pp);\n\t}\n}\n\nint main() {\n\tstatic int aa[2][2], pp[2][2], tt[2][2];\n\tlong long n, k, x0, x1, ans;\n\tint l, h;\n\n\tscanf(\"%lld%lld%d%d\", &n, &k, &l, &md);\n\tif (l < 64 && k >= 1LL << l) {\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\n\t}\n\taa[0][0] = 1, aa[0][1] = 1;\n\taa[1][0] = 1, aa[1][1] = 0;\n\tpower_(aa, pp, tt, n);\n\tx0 = (pp[0][0] + pp[0][1]) % md;\n\tx1 = (power(2, n) - x0 + md) % md;\n\tans = 1 % md;\n\tfor (h = 0; h < l; h++)\n\t\tans = ans * ((k & 1LL << h) == 0 ? x0 : x1) % md;\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "86cb070e786dd3d7ca7047526bdd1f63", "src_uid": "2163eec2ea1eed5da8231d1882cb0f8e", "apr_id": "bd6637239fe65ebb7372fd168c5dcbe9", "difficulty": 2100, "tags": ["combinatorics", "matrices", "number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8724137931034482, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nlong long int n,carp=1;\nlong long int f(long long int a)\n{\n\tif(a==1)\n\t\treturn 2;\n\tint x=f(a/2);\n\tx *= x;\n\tif(a & 1) x *= 2;\n\tx %= 1000000007;\n\treturn x;\n}\nint main()\n{\n//\tlong long int i,n,a;\n\tscanf(\"%lld\",&n);\n\tlong long int a=f(n);\n\tprintf(\"%lld\",(a*(a+1)/2)%1000000007);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b8e64c2841afd85f6fbb7496a5965e0a", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "5ef2274e7c0c7c0753941a4730ba039e", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9435336976320583, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nlong long int n,x;\nlong long int f(long long int a)\n{\n\tif(a==1)\n\t\treturn 2;\n \tx=f(a/2);\n\tx *= x;\n\tif(a & 1) x *= 2;\n\tx %= 1000000007;\n\treturn x;\n}\nint main()\n{\n\tscanf(\"%lld\",&n);\n\tlong long int a=f(n);\n\tprintf(\"%lld\",(a*(a+1)/2)%1000000007);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a7f65ab5cf83479ec53bc29a757e714a", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "5ef2274e7c0c7c0753941a4730ba039e", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.614190687361419, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint main()\n{\n\tint i,j,l[4];\n\tchar a[4];\n int n1=n2=0;\n\tint f,c=0;\n\tfor(i=1;i<=4;i++)\n\t\tscanf(\"%c\",a[i]);\n\tfor(i=1;i<=4;i++)\n l[i]=strlen(a[i])-2;\n\tfor(i=1;i<=4;i++)\n\t{\n\t\tfor(j=1;j<=4;j++)\n\t\t{\n\t\t\tif(i!=j)\n\t\t\t\t{\n\t\t\t\t\tif(l[i]>=2*l[j])\n\t\t\t\t\t\tn1++;\n\t\t\t\t\telse\n\t\t\t\t\t\tn2++;\n\t\t\t\t}\n\t\t}\n\t\tif(n1==3||n2==3)\n\t\t{\n\t\t\tc++;\n\t\t\tf=i-1;\n\t\t}\n\t}\n\tif(c==1)\n\t\tprintf(\"%c\\n\",'A'+f);\n\telse\n\t\tprintf(\"C\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "38c7a5cccf5288cd1e2a011d84ae2253", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "ea2e9c0c48950094629a01fb3b7e14c5", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5355596784168213, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include\n#include\nusing namespace std;\nint main()\n{\n char ah[1000],bh[1000],ch[1000],dh[1000];\n int a[5];\n scanf(\"%s\",ah); a[1]=strlen(ah)-2;\n scanf(\"%s\",bh); a[2]=strlen(bh)-2;\n scanf(\"%s\",ch); a[3]=strlen(ch)-2;\n scanf(\"%s\",dh); a[4]=strlen(dh)-2;\n int x,y,t=0;\n for(int i=1;i<=4;i++)\n {\n \t x=1;y=1; //printf(\"%d \",a[i]);\n \t for(int j=1;j<=4;j++)\n \t {\n \t \t if(i!=j)\n {\n\t\t\t\tif(a[i]>=2*a[j]) x++;\n\t\t\t\tif(2*a[i]<=a[j]) y++ ;\t\n } \n\t }\n\t if(x==4||y==4)\n\t {\n \t\t if(i==1) printf(\"A\\n\");\n \t\t if(i==2) printf(\"B\\n\");\n \t\t if(i==3) printf(\"C\\n\");\n \t\t if(i==4) printf(\"D\\n\");\n \t\t t=1;\n \t\t break;\n \t }\t \n }\n if(t==0) printf(\"C\\n\");\n}", "lang": "GNU C", "bug_code_uid": "38abad9e65d428d869d4b28839f855ee", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "8088d7afcb65d667a3f1ef1f27781594", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4570273003033367, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "// Code Forces 106A\n#include\n#define T 10\n#define J 11\n#define Q 12\n#define K 13 \n#define A 14\nint main()\n{\n char trump;\n char A[2]={'0'};\n char B[2]={'0'};\n scanf(\"%c%c%c%c%c\",&trump,&A[0],&A[1],&B[0],&B[1]);\n if(A[1]==trump&&B[1]!=trump) {printf(\"YES\\n\");return 0;}\n if(A[1]!=trump&&B[1]==trump) {printf(\"NO\\n\");return 0;}\n if(A[0]>B[0]) printf(\"YES\\n\");\n else printf(\"NO\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "815d28070cf60b0b26e00ad22d831950", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "31972d4713daf026b382dde90ce02add", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9296987087517934, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\nint i,j,s;\nchar ch[100];\n\nscanf(\"%s\",&ch);\n\ns=ch[0]-'a';\nif (s<0)\n s=s*(-1);\n if (s>13)\n s=26-s;\nfor (i=0;i<=(strlen(ch)-2);i++)\n{\n j=ch[i+1]-ch[i];\n if (j<0)\n j=j*(-1);\n if (j>13)\n j=26-j;\n\n s=s+j;\n\n}\n\nprintf(\"%d\",s);\n\nreturn 0 ;}", "lang": "GNU C11", "bug_code_uid": "526ad109f60fa41c0b430697b9f7c97e", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "2d790b82d6d18c1901d57f85006b41a8", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9980353634577603, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \nint v[11];\nvoid add(int x)\n{\n while(x)\n {\n v[x%10]=1;\n x/=10;\n }\n}\nint check(int d, int x)\n{\n while(d)\n {\n if(v[d%10]) return 1;\n d/=10;\n }\n return 0;\n}\nint main()\n{\n\n int x, ct=0;\n scanf(\"%d\",&x);\n add(x);\n for(int d=1;d*d<=x;d++)\n {\n if(x%d==0)\n {\n ct+=check(d,x);\n if(d!=x/d) ct+=check(d,x);\n }\n }\n printf(\"%d\", ct);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ec139ccc0aaf374fc4e92643b7b7a228", "src_uid": "ada94770281765f54ab264b4a1ef766e", "apr_id": "a511c45d76c0fdd4cdf63d5a4973b043", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9978354978354979, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n char s[20];\n int i,c=0,l;\n scanf(\"%s\",s);\n for(i=0;i(strlen(s)/2))\n { \n printf(\"%ld\\n\",strlen(s));\n }\n else\n {\n l=c+(c-1);\n printf(\"%d\\n\",l); \n }\n return 0;\n} \n", "lang": "GNU C11", "bug_code_uid": "aa852f6f826c5be2669f79e58070d76e", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "ea95d55140ef682081d411525a43f170", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7123107307439105, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \nint min(int a,int b){\n if(a\n#include \n\nint main() {\n int l, r, a;\n scanf(\"%d%d%d\", &l, &r, &a);\n if (abs(l - r) >= a) {\n if (l > r) printf(r + a);\n else printf(l + a);\n }\n else {\n if (l > r) printf(\"%d\", l + (a - abs(l - r)) / 2);\n else printf(\"%d\", r + (a - abs(l - r)) / 2);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cc352abf12efa4c5a7c6a448d53fb3b6", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "19deaa99b0201f5bae40b8b4ec541997", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6264705882352941, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "#include\nint coprime(int a, int h)\n{\n int temp;\n while(1)\n {\n temp = a%h;\n if(temp==0)\n return h;\n a = h;\n h = temp;\n }\n}\nvoid main(){\n\tlong n,x=1,y;\n\tscanf(\"%d\",&n);\n\ty=n-1;\n\twhile(x<=y){\n\t\tif(coprime(x,y)==1){\n\t\t\tprintf(\"%d %d\\n\",x,y);\n\t\t}\n\t\t\n\t\tx++;\n\t\ty=n-x;\n\t}\n\n}\n", "lang": "GNU C", "bug_code_uid": "550fda0e37fe93fec03be264c2c444dd", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "c487f184029c07adff8a55b44f808a63", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9815817984832069, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\n\nint main()\n{\n int nump, x[1000], y[1000], i, sum1, sum2;\n sum1 = sum2 = 0;\n\n\n scanf(\"%d\", &nump);\n\n for(i=0; i sum1)\n {\n printf(\"No\");\n exit(1);\n }\n else\n {\n printf(\"Yes\");\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2becae43c4afaf9d4690983ce1d5a719", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "159e484e29c79e50b94c497b5d003770", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9908256880733946, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n long long n;\n scanf(\"%lld\",&n);\n printf(\"%lld\",n-n/2-n/3-n/5-n/7+n/6+n/10+n/14+n/15+n/21+n/35-n/30-n/42-n/70-n/105+n/210);\n}", "lang": "GNU C", "bug_code_uid": "d6e05a6429a14e320b6aaf7e5180fc9e", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "apr_id": "171f1f83cb18544dbfb47a8b892baf85", "difficulty": 1500, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9986807387862797, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int i,n,count=0;\n scanf(\"%d\",&n);\n int a[n];\n for(i=0;i\n#include \n\nint main()\n{\n int x,y,result;\n scanf(\"%d %d\",&x,&y);\n if(x==0 && y==0)result=0;\n else if(x==1 && y==0)result=0;\n else if(x==0 && y==1)result=2;\n else if(x==0 && y==-1)result=4;\n else if(x==-1 && y==0)result=3;\n else if(x=>0 && y=>0)\n {\n if(x0 && y<0)\n {\n if(x>abs(y))\n {\n if(x-abs(y)==1)\n result=(4*abs(y));\n else\n result=(3*x)+(x-3);\n }\n else result=(4*abs(y));\n }\n else if(x<0 && y=>0)\n {\n if(abs(x)>y)\n result=(3*abs(x))+(abs(x)-1);\n else result=(3*y)+(y-2);\n }\n printf(\"%d\",result);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "2a3ff8f85f25ce4b67d0c7868d6e8763", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "apr_id": "afcb1a1068f0679efe6dd253885bdab8", "difficulty": 1400, "tags": ["geometry", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.24426450742240216, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n\n\nint main(void)\n{\n int input, ali, ragham;\n scanf(\"%d\", &input);\n ali = input;\n while(input > 0)\n {\n ragham = input % 10;\n input /= 10;\n if(ragham == 8)\n {\n printf(\"0\");\n return ;\n }\n }\n if(ali > 0)\n {\n if(ali % 10 <= 7)\n {\n printf(\"%d\", 8 - ali % 10);\n return;\n }\n else\n {\n printf(\"%d\", 18 - (ali % 10));\n return;\n }\n }\n ali = abs(ali);\n if(ali > 0)\n {\n if(ali <= 7 && ali >= 0)\n {\n printf(\"%d\", ali % 10 + 8);\n return;\n }\n if(ali % 10 <= 7)\n {\n printf(\"%d\", ali % 10 + 2);\n return;\n }\n else\n printf(\"%d\", ali % 10 - 8);\n }\n}\n", "lang": "GNU C", "bug_code_uid": "3dcd9551645effffaf32176c7e50300d", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "15cf1a1d29fcb5b9f0bfc2b39db2caa9", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3865979381443299, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nint main()\n{\n int n,rem;\n scanf(\"%d\",&n);\n if(n%4==0 || n%7==0)\n {\n printf(\"YES\");\n }\n else\n {\n while(n>0)\n {\n rem=n ;\n rem=rem%10;\n if(rem%4!=0 || rem%7!=0)\n {\n printf(\"NO\");\n return 1;\n }\n n=n/10;\n }\n printf(\"YES\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4d16d149fad12373334f521743c26f50", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "e2e8be8e50f92209e873e816ea01003d", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6470337174562527, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint interior(int x, int y, int a, int b, int c) {\n if ((x>=a) && (x <= a+c) && (y>=b) && (y<=b+c)) return 1;\n return 0;\n};\n\nint main(void) {\n int x1, y1, x2, y2, a1, b1, a2, b2, c1, c2, n;\n scanf(\"%d %d %*d %*d %d %d %*d %*d\", &x1, &y1, &x2, &y2); // * skip input\n scanf(\"%d %d %*d %*d %d %d %*d %*d\", &a1, &b1, &a2, &b2);\n c1 = (x1 > x2)?(x1 - x2):(x2 - x1);\n x1 = (x1 < x2)?x1:x2;\n y1 = (y1 < y2)?y1:y2; \n n=0;\n if (a1 == a2) {\n c2 = ((b1 > b2)?(b1 - b2):(b2 - b1))/2;\n b1 = (b1 > b2)?b1:b2;\n for (int i=0; i<=c2; ++i)\n for (int j=-i; j<=i; ++j) {\n n = interior(a1+j, b1-i, x1, y1, c1)||interior(a2+j, b1-2*c2+i, x1, y1, c1);\n if (n == 1) break;\n }\n }\n else {\n c2 = ((a1 > a2)?(a1 - a2):(a2 - a1))/2;\n a1 = (a1 > a2)?a1:a2;\n for (int i=0; i<=c2; ++i)\n for (int j=0; j<=c2; ++j) {\n n = interior(b1+j, a1-i, x1, y1, c1)||interior(b1+j, a1-2*c+i, x1, y1, c1);\n if (n == 1) break;\n }\n }\n if (n == 1) printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "0c2e9d79ca01698cf3f7bd8a9d0dbd4a", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "8a238521a77efb706989a7964822a160", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9952556668423828, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nint i,j,g[505][505]={0},l[5],r[5],u[5],d[5],t,tt;\n\nint main()\n{\n\tfor (j=0;j<=1;j++)\n\t{\n\t\tl[j]=d[j]=INT_MAX;\n\t\tr[j]=u[j]=0;\n\t\tfor (i=1;i<=4;i++)\n\t\t{\n\t\t\tscanf(\"%d %d\",&t,&tt);\n\t\t\tl[j]=l[j]t ? r[j] : t;\n\t\t\tu[j]=u[j]>tt ? u[j] : tt;\n\t\t\td[j]=d[j]=2)\n\t{\n\t\tputs(\"YES\");\n\t\texit(0);\n\t}\n\tputs(\"NO\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "86caffa2c2bf6071d236d096b49a5631", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "8c7a4b49de170362becbade293d62a65", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9980928162746344, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define MAX 50\nvoid Go(int a[], int b[], int l, int L, int j)\n{\n\tint i;\n\tfor (i=0; i\nusing namespace std;\nint main()\n{\n int n,a[200],c,b,i,j,k,s;\n while(scanf(\"%d %d %d\",&n,&c,&b)==3)\n {\n for(i=0;ib)\n s=s+2*b;\n else s=s+2*c;\n }\n else if((a[i]==2 && a[j]==1) || (a[i]==1 && a[j]==2))\n s=s+b;\n else if((a[i]==2 && a[j]==0) || (a[i]==0 && a[j]==2))\n s=s+c;\n else\n {\n printf(\"-1\\n\");\n k=1;\n break;\n }\n }\n if(n%2!=0)\n {if(a[n/2]==2)\n {if(c>b)\n s=s+b;\n else s=s+c;}\n }\n if(k==0)\n printf(\"%d\\n\",s);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d9e150a06e6705702010e494714d9f86", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "712c966b2860ce128cd1c9e70f09a8bf", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8232118758434548, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nint main(){\n char in[20];\n scanf(\"%s\", in);\n int i, l = strlen(in);\n int flag = 0;\n for(i = 0; i < l / 2; i++){\n if(in[i] != in[l - i - 1]){\n if(!flag) flag = 1;\n else return printf(\"NO\\n\");\n }\n }\n return printf(\"YES\\n\");\n}\n", "lang": "GNU C", "bug_code_uid": "806fd6ba4f1e635320c1726d26ba0689", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "f54af71a67a87c23612ee973a89f029f", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.928795342588446, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint main(){\n char s[1001];\n int letters[27];\n int i, j, k, len, as, empty, need;\n\n memset(letters, 0, 27*sizeof(int));\n \n scanf(\"%d\", &k);\n scanf(\"%s\", &s);\n\n \n len = strlen(s);\n empty = 0;\n \n for(i=0, j = len-1; i < (len+1)/2; i++, j--){\n\n if ((s[i] == '?') == s[j]){\n empty++;\n continue;\n }\n else if (s[i] == '?'){\n s[i] = s[j];\n if(s[j] == '?')\n\tempty++;\n else\n\ts[i] = s[j];\n }\n else if (s[j] == '?'){\n s[j] = s[i];\n if(s[j] == '?')\n\tempty++;\n else\n\ts[i] = s[j];\n }\n else if (s[i] != s[j]){\n printf(\"IMPOSSIBLE\\n\");\n return 0;\n }\n letters[s[i] - 'a']++;\n }\n\n need = k;\n for(i=0; i < k; i++)\n if(letters[i])\n need--;\n\n if(need > empty){\n printf(\"IMPOSSIBLE\\n\");\n return 0;\n }\n\n as = empty - need;\n for(i=0; as; i++){\n if(s[i] == '?'){\n s[i] = s[len-i-1] = 'a';\n as--;\n }\n }\n\n j = 0;\n for(; i < (len+1)/2; i++){\n if(s[i] == '?'){\n while(letters[j] && j++);\n s[i] = s[len-i-1] = j + 'a';\n }\n }\n\n printf(\"%s\\n\", s);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1028915396fb434b41406885e06fd891", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "apr_id": "ee85da10fd288d3c97b30cd49748ca16", "difficulty": 1600, "tags": ["expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9942528735632183, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nchar s[101];\nint k, n, i, j, x;\nbool ok[30];\n\nvoid read(){\n\tscanf(\"%d%s\", &k, s);\n}\n\nint process(){\n\tn = strlen(s);\n\tx=n/2;\n\tfor(i=0, j=n-1;i=0&&i>=0;x--){\n\t\t\n\t\tif(s[x]=='?'){\n\t\t\twhile(i>0&&ok[i])--i;\n\t\t\ts[x]=s[n-x-1]='a'+i;\n\t\t\tok[s[x]-'a']=1;\n\t\t}\n\t}\n\tfor(i=0;i\n#include \n\nint main(){\n\t\n\tchar a[2][2], b[2][2], aa[4], bb[4];\n\tint i, j, a_x, a_y, b_x, b_y, same=0;\n\n\t//for (i=0; i<2; i++)\n\t//\tscanf(\"%c%c\\n%c%c\\n\", &a[0][0], &a[0][1], &a[1][0], &a[1][1]);\n\tscanf(\"%c%c\\n%c%c\\n\", &aa[0], &aa[3], &aa[1], &aa[2]);\n\t//for (i=0; i<2; i++)\n\t//\tscanf(\"%c%c\\n%c%c\", &b[0][0], &b[0][1], &b[1][0], &b[1][1]);\n\tscanf(\"%c%c\\n%c%c\", &bb[0], &bb[3], &bb[1], &bb[2]);\n\n\t/*printf(\"%s %s\\n\", a[0], b[0]);\n\n\tfor (i=0; i<2; i++){\n\t\tfor (j=0; j<2; j++){\n\t\t\tif ( a[i][j] == 'X' ){\n\t\t\t\ta_x = i; a_y = j;\n\t\t\t}\n\t\t\tif ( b[i][j] == 'X' ){\n\t\t\t\tb_x = i; b_y = j;\n\t\t\t}\n\t\t}\n\t}\n\n\tprintf(\"%d %d %d %d\\n\", a_x, a_y, b_x, b_y); \n*/\n\t//printf(\"%c %c %c %c\\n\", aa[0], aa[1], aa[2], aa[3]);\n\t//printf(\"%c %c %c %c\\n\", bb[0], bb[1], bb[2], bb[3]);\n\n\tfor (i=0; i<4; i++){\n\t\tif (aa[i] == 'X')\n\t\t\tcontinue;\n\t\ta_x = aa[i];\n\n\t\tfor (j=0; j%4<4; j++){\n\t\t\tif (a_x == bb[j])\n\t\t\t\tbreak;\n\t\t}\n\n\t\twhile (1){\n\t\t\tif ( aa[i] == 'X'){\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if ( bb[j%4] == 'X'){\n\t\t\t\tj++;\n\t\t\t\tcontinue;}\n\t\t\t//printf(\"%d %d\\n\", i , j);\n\t\t\tif (i==4)\n\t\t\t\tbreak;\n\t\t\tif ( aa[i++] == bb[(j++)%4] )\n\t\t\t{\n\t\t\t\tsame++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t}\n\n\tif ( same==3 )\n\t\tprintf(\"YES\\n\");\n\telse\n\t\tprintf(\"NO\\n\");\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "75de996a64f0850b4dd160795da6a043", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "a0cc9386c1b03bce41c6de8c63649acd", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9605263157894737, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include \nint main()\n{\n\tlong long num, place = 0, i, l, r, mid, m, n, k;\n\tscanf(\"%d %d %d\", &m, &n, &k);\n\tl = 1;\n\tr = m * n;\n\twhile (l<=r)\n\t{\n\t\tmid = (l + r) / 2;\n\t\tplace = 0;\n\t\tfor (i = 1; i <= n; i++)\n\t\t{\n\t\t\tplace += ((m > (mid / i) ? mid / i : m));\n\t\t\t/*if ((mid / i) == 0)\n\t\t\t\tbreak;*/\n\t\t}\n\t\tif (place < k)\n\t\t\tl = mid+1;\n\t\telse\n\t\t\tr = mid-1;\n\t} \n\tprintf(\"%d\", l);\n}", "lang": "GNU C11", "bug_code_uid": "0abb05a94b48bfe5155f46d054cfbbbe", "src_uid": "13a918eca30799b240ceb9de47507a26", "apr_id": "783e29deeecd04293402a4884d09af56", "difficulty": 1800, "tags": ["brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.926458157227388, "equal_cnt": 29, "replace_cnt": 1, "delete_cnt": 27, "insert_cnt": 1, "fix_ops_cnt": 29, "bug_source_code": "##include \n#include \n#include \n#include \nint main()\n{\n long long n;\n while(~scanf(\"%lld\",&n))\n {\n if(n<100)\n {\n n=n%5;\n printf(\"%lld\\n\",5-n);\n }\n else if(n<1000)\n {\n n=n%100;\n printf(\"%lld\\n\",100-n);\n }\n else if(n<10000)\n {\n n=n%1000;\n printf(\"%lld\\n\",1000-n);\n }\n else if(n<100000)\n {\n n=n%10000;\n printf(\"%lld\\n\",10000-n);\n }\n else if(n<1000000)\n {\n n=n%100000;\n printf(\"%lld\\n\",100000-n);\n }\n else if(n<10000000)\n {\n n=n%1000000;\n printf(\"%lld\\n\",1000000-n);\n }\n else if(n<100000000)\n {\n n=n%10000000;\n printf(\"%lld\\n\",10000000-n);\n }\n else if(n<1000000000)\n {\n n=n%100000000;\n printf(\"%lld\\n\",100000000-n);\n }\n else if(n<10000000000)\n {\n n=n%1000000000;\n printf(\"%lld\\n\",1000000000-n);\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "214ab938093f9c8bb6b2a8e8a9cd5893", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "4828b6cb33a98fdba62877545eb339a3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.17350369872225957, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include \nint main()\n{\n int x1,x2,x3,y1,y2,y3,ab,bc;\n scanf(\"%d %d %d %d %d %d\",&x1,&y1,&x2,&y2,&x3,&y3);\n if((x1-x2)==0)\n {\n if(y2y2)\n {\n ab=0;\n }\n else{ab=1001;\n }\n\n }\n else\n {\n ab=(y1-y2)/(x1-x2);\n }\n\n if((x2-x3)==0)\n {\n if(y3bc)\n {\n printf(\"RIGHT\\n\");\n }\n else\n {\n printf(\"LEFT\\n\");\n }\n }\n }\n\n ", "lang": "GNU C", "bug_code_uid": "4f12c43abba9d0ae2cf7ee3425490070", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "4f98205a5b3d75e243733ce988a35a8a", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6201117318435754, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n unsigned long long int u,d,z,s;\n scanf(\"%llu %llu %llu\",&u,&d);\n s=u-d;\n if(s>0)\n {if(z>=s)\n {printf(\"?\");}\n else\n {printf(\"+\");}}\n if(s<0)\n {s=s*-1;\n if(s>z)\n {printf(\"-\");}\n else\n {printf(\"?\");}\n }\n if(s==0)\n {printf(\"?\");}\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "58353cae431f54edf992d50500cb995a", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "d733ac023a379e320214a1ae8322ea5b", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9982758620689656, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "cmb(int k, int n) {\n if(k<0||k>n) return 0;\n return fct(n)/fct(n-k)*fct(k);\n}\nfct(x) {\n return x<0?0:x<2?1:x * fct(x-1);\n}\nP,Q,_plus,_minus,_que,*plus=&_plus,*minus=&_minus,*que=&_que,i; char a[11],b[11];\nabs(x) {\n return x<0?-x:x;\n}\nint*p(char c) {\n switch(c) {\n case '+':return plus;\n case '-':return minus;\n case '?':return que;\n }\n}\nmain() {\n scanf(\"%s%s\", &a, &b);\n for(i=0;a[i];i++) {\n --*p(a[i]);\n ++*p(b[i]);\n }\n *plus -= *minus;\n P = abs(*plus);\n Q = abs(*que);\n double prob = (double)cmb(P + (Q-P)/2,Q) / (1<\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C11", "bug_code_uid": "4a5a03c262537a2db9c0ff61d55954a3", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "a6f1a7c13310684d6d519ecc8b5f1b7e", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6962142197599261, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nint main()\n{\n int a, b, c, d, num = 0, i;\n int p[10] = {0};\n\n scanf(\"%d %d\", &a, &b);\n\n c = a; d = b;\n\n while (c) {\n\t p[c % 10]++;\n\t c /= 10;\n }\n\n while (d) {\n\t p[d % 10]++;\n\t d /= 10;\n }\n\n for (i = 9; i > 0; i--) {\n\t if (p[i] > 0) break;\n }\n\n a += b;\n\n while (a) {\n\t a /= (i + 1);\n\t num++;\n }\n\n printf(\"%d\\n\", num);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d9c14b164d9f86562a1d822ce003f8cb", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "cd4617383fc37e051fb9241eae5d1122", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9991063449508489, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint main()\n{\n\tunsigned int A,B;\n\tunsigned int x,y,z;\n\tscanf(\"%d %d\",&A,&B);\n\tscanf(\"%d %d %d\",&x,&y,&z);\n\tunsigned int bule,yellow;\n\tbule=2*x+y;\n\tyellow=3*z+y;\n\tunsigned int min,min_1,min_2;\n\tmin_1=bule=min_1)\n\t\tprintf(\"%u\\n\",min);\n\telse\n\t{\n\t\tunsigned int a=min+294967296;\n\t\tunsigned int b=4+a/1000000000;\n\t\tprintf(\"%u\",b);\n\n\t\tunsigned int v=1000000000;\n\n\t\tint i;\n\t\tfor( i=0;i<=9;i++)\n\t\t{\n\t\t\ta=a%v;\n\t\t\tv=v/10;\n\t\t\tprintf(\"%u\",a/v);\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fe3d1054da74abc5183ce0f35079cc79", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "d2f208b6d0326e6d2fd8a61c2d386073", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.19313304721030042, "equal_cnt": 23, "replace_cnt": 19, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "#include \n#include \n#include \n\n#define MOD 1000000007\n\nlong long waysToPlay(int n, int m, int k);\nlong long oldWaysToPlay(int n, int m, int k, long long mult);\nlong long choose(long long a, long long b);\n\nlong long oldWays;\nlong long known[1000][1000][1000];\n\nint main() {\n int n, m, k;\n scanf(\"%d %d %d\", &n, &m, &k);\n\n // n: dimension\n // y: dimension\n // k: amount of moves\n\n printf(\"%lld\\n\", (choose(n-1, 2*k) * choose(m-1, 2*k)) % MOD);\n\n oldWays = 0;\n //long long ways = waysToPlay(n, m, k) % MOD;\n //printf(\"%lld\\n\")\n //printf(\"%lld\\n\", ways);\n\n // Old\n //oldWaysToPlay(n, m, k, 1);\n //printf(\"%lld\\n\", oldWays);\n\n return EXIT_SUCCESS;\n}\n\nlong long waysToPlay(int n, int m, int k) {\n // 6, 7, 2\n // \n // 4, 4, 1 => 9\n // 6, 7, 2 => 75\n\n // If no more moves\n if (k == 0) {\n return 1;\n } else if (k == 1) {\n //printf(\"%d %d %d %lld\\n\", n, m, k, choose(n-1, 2) * choose(m-1, 2));\n return choose(n-1, 2) * choose(m-1, 2);\n } else {\n // For 5x5 (3x3)\n // Answer = 36\n // k = 1\n // x = 4c2\n // y = 4c2\n\n // 10 * 10 = 100\n\n // Smallest cases\n int n_small = 1 + 2*(k-1);\n int m_small = 1 + 2*(k-1);\n long long ways = 0;\n\n // They must be TWO less\n for (int n_i = n_small; n_i < n-1; n_i++) {\n for (int m_i = m_small; m_i < m-1; m_i++) {\n // The amount of positions that the new rectangle\n // can fit into\n int newMult = (n-n_i-1)*(m-m_i-1);\n\n // Cache the result\n if (known[m_i][n_i][k-1] == 0) {\n known[m_i][n_i][k-1] = waysToPlay(n_i, m_i, k-1);\n }\n\n // Add it to ways\n ways += newMult * known[m_i][n_i][k-1];\n }\n }\n\n //printf(\"%d %d %d %lld\\n\", n, m, k, ways);\n \n return ways;\n }\n\n // Otherwise there are no ways\n return 0;\n}\n\nlong long choose(long long a, long long b) {\n if (b > a) return 0;\n\n //aCb = a!/((a-b)!*b!)\n // = a*(a-1)...(a-b+1)/\n // b*(b-1)...1\n\n // = a*(a-1)...(a-b+1)/\n // 1*2*......b\n\n long long result = 1;\n for (int i = 0; i < b; i++) {\n result = (result * (a-i)) % MOD;\n result = (result / (i+1)) % MOD;\n }\n\n //printf(\"%lldC%lld = %lld\\n\", a, b, result);\n return result % MOD;\n}\n\n\n//OLD method\nlong long oldWaysToPlay(int n, int m, int k, long long mult) {\n // 3x3 in 6x7 (4x5)\n if (k == 0) {\n oldWays = (oldWays+mult) % MOD;\n //printf(\"+ %lld\\n\", mult);\n } else if (k == 1 && n == 1 && m == 1) {\n oldWays = (oldWays+mult) % MOD;\n } else {\n // Smallest cases\n int n_small = 1 + 2*(k-1);\n int m_small = 1 + 2*(k-1);\n\n // How many places it can go X inside solutions\n\n // They must be TWO less\n for (int n_i = n_small; n_i < n-1; n_i++) {\n for (int m_i = m_small; m_i < m-1; m_i++) {\n // Positional permutation (x,y and y,x)\n // int twice = (m_i != n_i) ? 2 : 1;\n\n //printf(\"passing: %d %d %lld\\n\", n_i, m_i, mult);\n oldWaysToPlay(n_i, m_i, k-1, mult*(n-n_i-1)*(m-m_i-1));\n }\n }\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ff2af2b48a1b82b67e942b450b796716", "src_uid": "309d2d46086d526d160292717dfef308", "apr_id": "61533a13f794f78b8c0b32b9688e0e99", "difficulty": 2000, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9970282317979198, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\n\nint main()\n{\n int n,m,k,i,j,la;\nscanf(\"%d%d%d\",&n,&m,&k);\n if(2*k>m-1||2*k>n-1)\n {printf(\"0\");return 0;}\nint64_t ans=0;\n if(n>m)\n la=n;\nelse\nla=m;\n\n int mat[la+1][la+1];\n \n for(i=0;i<=la;i++)\n for(j=0;j<=la;j++)\n mat[i][j]=0;\n \n for(i=1;i<=la;i++)\n mat[i][i]=1;\n\n for(i=1;i<=la;i++)\n mat[i][1]=i;\n\n for(i=2;i<=la;i++)\n for(j=2;j\n#include\n#include\nint n,k;\nint b[8];\nchar str[10];\nchar num[8][10];\nvoid permu(char str[])\n{\n int i,l,j,t,k,len;\n char c;\n len=strlen(str);\n for(j=1;j0;j--)\n X[j]=X[j-1];\n X[j]=tmp;\n }\n}\n\n \n\nint main()\n{\n int i,tmp,max,j;\n scanf(\"%d%d\",&n,&k);\n for(i=0;itmp)\n max=tmp;\n permu(str);\n }\n printf(\"%d\\n\",max);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "45e7a9d407981032b26bf7ade93692db", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "apr_id": "af1714a1167d717fd5898e3ad726a8c5", "difficulty": 1400, "tags": ["brute force", "combinatorics", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5511482254697286, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,i,j;\n int s=0,h=0,n=0,l=0;\n scanf(\"%d%d\",&a,&b);\n c=a+b;\n if(c%d==0){\n d=c/2;\n }\n else{\n d=(c+1)/2;\n }\n if(ad;i--){\n h++;\n n=n+h;\n\n }\n\n }\n if(jd;j--){\n l++;\n s=s+l;\n }\n }\n\n\n printf(\"%d\",n+s);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "9aa5ffe3834a99cbbea4423fb223c762", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "fdd968c57eee1e298bc1fa7b6d7f245f", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8575342465753425, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n#include \n#include \n\n\nint main()\n{\n int B[3][3]={1,1,1,1,1,1,1,1,1},A[3][3],k,i,j;\n for(i=0;i<3;i++)\n {\n for(j=0;j<3;j++)\n {\n scanf(\"%d\",&A[i][j]);\n }\n }\n for(i=0;i<3;i++)\n {\n for(j=0;j<3;j++)\n {\n for(k=0;k\n#include\n#include\n#define N 1000\n \nint main()\n{\n\tint max=0,num=0,n;\n\tchar s[N],t[N];\n\t\n\tscanf(\"%d %s\",&n,s);\n\t\n\tfor(int i=0;imax)\n\t\tmax=a;\n\t\tp1=strtok(NULL,\"(_\");\n\t\ta=strcspn(p1,\"()\");\n\t}\n\t\t\n\tp1=strchr(t,'(');\n\tchar *p=p1;\n\t\n\twhile(p1)\n\t{\n\t\tp2=strtok(p1+1,\"_)\");\n\t\t\n\t\twhile(p2)\n\t\t{\n\t\t\tnum++;\n\t\t\tp2=strtok(NULL,\"_)\");\n\t\t}\n\t\t\n\t\tp1=strchr(p+1,'(');\n\t}\n\t\n\tprintf(\"%d %d\",max,num);\n}\n", "lang": "GNU C11", "bug_code_uid": "d874b65ff29a9f36dedb1c990306e241", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "2b7c11d29d1d0adb3b18137c37df4c7a", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994155464640561, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "int main(void)\n{\n char a[9][9];\n int i,j,x,y,flag=1;\n for(i=0;i<9;i++)\n scanf(\"%s%s%s\",&a[i][0],&a[i][3],&a[i][6]);\n scanf(\"%d%d\",&x,&y);\n \n while(x>3) x-=3;\n while(y>3) y-=3;\n if(x==1&&y==1)\n for(i=0;i<3;i++)\n for(j=0;j<3;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0; }\n if(x==2&&y==1)\n for(i=3;i<6;i++)\n for(j=0;j<3;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==3&&y==1)\n for(i=6;i<9;i++)\n for(j=0;j<3;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==1&&y==2)\n for(i=0;i<3;i++)\n for(j=3;j<6;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==2&&y==2)\n for(i=3;i<6;i++)\n for(j=3;j<6;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==3&&y==2)\n for(i=6;i<9;i++)\n for(j=3;j<6;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==1&&y==3)\n for(i=0;i<3;i++)\n for(j=6;j<9;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==2&&y==3)\n for(i=3;i<6;i++)\n for(j=6;j<9;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(x==3&&y==3)\n for(i=6;i<9;i++)\n for(j=6;j<9;j++)\n if(a[i][j]=='.') {a[i][j]='!';flag=0;}\n if(flag)\n {for(i=0;i<9;i++)\n for(j=0;j<9;j++)\n if(a[i][j]=='.') a[i][j]='!';\n }\n for(i=0;i<9;i++)\n {\n if(i%3==0&&i) printf(\"\\n\");\n for(j=0;j<9;j++)\n {\n if(j%3==0&&j) printf(\" \");\n printf(\"%c\",a[i][j]);\n }\n printf(\"\\n\");\n }\n return 0;", "lang": "GNU C", "bug_code_uid": "f3b87bd5832d7f38862df16a1fc2d235", "src_uid": "8f0fad22f629332868c39969492264d3", "apr_id": "ddbf6ded044e2d04036f49eb5453621b", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9992429977289932, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint clu(int x){\n\tint a;\n\ta=x%3;\n\tif(a==0){\n\t\treturn 6;\n\t}\n\tif(a==1){\n\t\treturn 0;\n\t}\n\tif(a==2){\n\t\treturn 3;\n\t}\n}\nint main(void){\n\tchar a[12][12];\n\tint x,y,i,j,f=0,p,q;\n\tfor(i=0;i<9;i++){\n\t\tscanf(\"%s %s %s\",&a[i][0],&a[i][3],&a[i][6]);\n\t}\n\tscanf(\"%d %d\",&x,&y);\n\tx=clu(x);\n\ty=clu(y);\n\tfor(i=x;i<=x+2;i++){\n\t\tfor(j=y;j<=y+2;j++){\n\t\t\tif(a[i][j]=='.'){\n\t\t\t\ta[i][j]='!';\n\t\t\t\tf=1;\n\t\t\t}\n\t\t}\n\t}\n\tif(f==0){\n\t\tfor(i=0;i<9;i++)\n\t\tfor(j=0;j<9;j++)\n\t\tif(a[i][j]=='.') a[i][j]='!';\n\t}\n\tfor(i=0;i<9;i++){\n\t\tif(i%3==0 && i) printf(\"\\n\");\n\t\t\tfor(j=0;j<=9;j++){\n\t\t\t\tif(j%3==0&&j) printf(\" \"); \n\t\t\t\tprintf(\"%c\",a[i][j]);\n\t\t\t}\n\t\t\tprintf(\"\\n\");\n\t }\n\treturn 0;\n} ", "lang": "GNU C", "bug_code_uid": "52e199c5f5bc83977ddfb94b9fdf42b7", "src_uid": "8f0fad22f629332868c39969492264d3", "apr_id": "ddbf6ded044e2d04036f49eb5453621b", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.1264591439688716, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int n,j=1,i,t,cnt=0,k;\n scanf(\"%d\",&n);int a[n];\n if(n==0)\n {\n printf(\"O-|-OOOO\");\n printf(\"\\n\");\n return 0;\n }\n while(n!=0)\n {\n a[j++]=n%10;\n n=n/10;\n }\n for(i=1;i5)\n { cnt=0;\n printf(\"-O|\");\n t=t-5;\n while(t--)\n {\n printf(\"O\");\n cnt++;\n }\n\n printf(\"-\");\n k=5-cnt-1;\n while(k--)\n printf(\"O\");\n printf(\"\\n\");\n continue;\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "23d864773dcfe7eaadceca661def221f", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "aab3450e019cefd764ca8040284cab5b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7039301310043669, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "#include \n \nint main()\n{\n\tint n, hold, hmin, dmax, da, dd, di;\n\tint *a;\n\t\n\tint i = 1;\n\t\n\tscanf(\"%d\", &n);\n\ta = (int*)malloc(n * sizeof(int));\n\tfor(i = 0; i < n ; i++)\n\t\tscanf(\"%d\" , &a[i]);\n\t\n\thold = 2;\n\tda = a[1] - a[0];\n\tdd = a[2] - a[1];\n\tdmax = hmin = da + dd;\n\t\n\tfor( i = 2; i < n-1; i++){\n\t\tda = dd;\n\t\tdd = a[i +1] - a[i];\n\t\tdi = da + dd;\n\t\tif(di < hmin){\n\t\t\thold = i;\n\t\t\thmin = di;\n\t\t\tif(di > dmax) dmax = di;\n\t\t}\n\t\tif(dd > dmax) dmax = dd;\n\t}\n\treturn dmax;\n}\n", "lang": "GNU C", "bug_code_uid": "bb0c6c2a8dff234a33e013f185fc1e72", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "b76886c09d770ba35b237d2f6a1971f1", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8356713426853707, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "#include \nlong long max(long long x, long long y)\n{\n return x > y ? x : y;\n}\nint main()\n{\n long long n, m, k, ans;\n scanf(\"%lld%lld%lld\", &n, &m, &k) ;\n if(n + m - 2 < k)\n printf(\"-1\\n\");\n else\n {\n ans = max(n * (m / (k + 1)), m *(n / (k + 1)));\n ans = max(ans, m / (k - n + 2));\n ans = max(ans , n/(k - m + 2));\n printf(\"%lld\\n\", ans);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0539790cd4a115748a68d77d21ca8810", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "805da9135186e7af09900f9fbe53e451", "difficulty": 1700, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.754406580493537, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n long int n,m,k,temp;\n scanf(\"%ld\",&n);\n scanf(\"%ld\",&m);\n scanf(\"%ld\",&k);\n\n if(mm+n-2)\n printf(\"-1\");\n else if(k<=m+n-2)\n {\n if(k=m)\n printf(\"%ld\",n/(k-m+2));\n }\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1a3d8ce0a10ef114c1b94167d57cd1e5", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "b7bc8b9ae4161e3af6a9e67d797d20c6", "difficulty": 1700, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4593128390596745, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 21, "bug_source_code": "#include\nint main() {\n int n, m;\n scanf(\"%d %d\", &n, &m);\n int a[n], b[m];\n for(int i=0; i\nint count(const int n,const int x)\n{\n\tif(n==1)return 2;\n\treturn (3*count(n-1,x))%x+2;\n}\nint main()\n{\n\tint n,x;\n\tscanf(\"%d%d\",&n,&x);\n\tprintf(\"%d\",count(n,x)%x);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "2b1b564a26060cfedb4e2596ba921106", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "6e0a1cf211164ff1cf04143625a1f405", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9727699530516432, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main()\n{\n int a, i, j, k;\n\n scanf(\"%d\",&a);\n\n int A[a];\n\n for(i = 0; i < a ; i++)\n {\n scanf(\"%d\",A[i]);\n\n }\n if(A[0] == 1)\n {\n k = 1;\n }\n else\n {\n k = 0;\n }\n for(j = 1;j < (a - 1);j++)\n {\n if (A[j]==1)\n {\n k = k + 1;\n }\n else if (A[j-1]==1 && A[j+1]==1)\n {\n k = k + 1;\n }\n }\n if (a!=1 && A[a-1]==1)\n {\n k = k + 1;\n }\n\n printf(\"%d\",k);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "bd2734d5bedc5fa9c702d11391f5bea5", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "5c4cf1b34dc143cbfbf89f42c0a77ef6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5647058823529412, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int r,c,i,j,x=1;\n scanf(\"%d%d\",&r,&c);\n char a[r][c],pre[2];\n for(i=0;i\nint main() {\n\tint n, arr[n], i, sum = 0;\n\tscanf(\"%d\", &n);\n\tfor(i = 0; i < n; i++){\n\t\tscanf(\"%d\", &arr[i]);\n\t\tif(arr[i] > 0)\n\t\t\tsum = sum + arr[i];\n\t\telse\n\t\t\tsum = sum - arr[i];\n\t}\n\tprintf(\"%d\\n\", sum);\n}\n", "lang": "GNU C", "bug_code_uid": "a28213407a1feef40b3752c56769a190", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "64dac39f428be93c829bd098de814962", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.36028368794326243, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nmain()\n{\n int n,p,i;\n scanf(\"%d\",&n);\n p=n/2 -1;\n int a[p];\n for(i=1;i=e)\n {\n printf(\"%d\",count);\n }\n else\n printf(\"%d\",count);\n\n}\n", "lang": "GNU C", "bug_code_uid": "f985e1e9ac5f20c7842b453195ea725b", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "87082f0e3a8b5c6ddfcd183b6018a693", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4855072463768116, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "#include\nint main()\n{\n int n[6],t[2],i,legs=0,j,p,k;\n for(i=0;i<6;i++) {\n scanf(\"%d\",&n[i]);\n }\n for(j=0;j<3;j++) {\n for(k=j+1;k<6;k++) {\n if(n[j]==n[k]) {\n legs=legs+1;\n }\n }\n if(legs==3) {\n p=n[j];\n break;\n }\n else { printf(\"Alien\"); return; }\n }\n j=0;\n for(i=0;i<6;i++) {\n if(n[i]!=p) {\n t[j]=n[i];\n j++;\n }\n }\n if(t[0]==t[1]) {printf(\"Elephant\");}\n else printf(\"Bear\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c09114f75feaf70ec2f207a59165178a", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "51d1705d2524b457b194aa029dcfe86c", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9991386735572783, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \nint main()\n{\n int x[2],i,sum=0,b=0,c,t,l[2],z[2][4],o;\n scanf(\"%d%d\",&x[0],&x[1]);\n for(o=0;o<2;o++)\n for(l[o]=0;x[o]>0;l[o]++)\n {\n z[o][l[o]]=x[o]%10;\n if(z[o][l[o]]>b)\n b=z[o][l[o]];\n x[o]/=10;\n }\n b+=1;\n for(o=0;o<2;o++)\n {\n t=1;\n for(i=0;i=b;i++)\n b*=c;\n printf(\"%d\",i);\n return 0 ;\n", "lang": "GNU C11", "bug_code_uid": "a23ce8fd50fed27b37b3efea9a702967", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "6ca21ff7fab6c581a2f9183e255bc49f", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.995850622406639, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{int n;\n\nscanf(\"%d\",&n);\nprintf(\"%d\",(n==5)?1:n%3+1)\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c9a885bd2b705433c6aca9f02b3ffee2", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "fcbd3b3a49cb8e9fa0bab3a3c3763be6", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6702758442897654, "equal_cnt": 63, "replace_cnt": 62, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 62, "bug_source_code": "#include \n#include \n#include \ntypedef struct point\n{\n\tint x, y;\n}point;\n\npoint s[8];\npoint seg[8];\n\nint cmp (const void *a, const void *b) {\n\tpoint *x = (point *) a, *y = (point *) b;\n\n\treturn x->x - y->x;\n}\n\nbool check (int x, int y, int i) {\n\tint j;\n\n\tfor (j = 0; j < i; j++) {\n\t\tif (s[j].x == x && s[j].y == y) return true;\n\t}\n\n\treturn false;\n}\n\nvoid swap (int i, int j) {\n\tpoint a = {s[i].x, s[i].y};\n\n\ts[i] = s[j];\n\ts[j] = a;\n}\n\nbool checker () {\n\tint j, h;\n\tfor (j = 0; j < 8; j+=2) {\n\t\tint x = seg[j].x, xx = seg[j + 1].x, y = seg[j].y, yy = seg[j + 1].y;\n\t\tfor (h = j + 2; h < 8; h+=2) {\n\t\t\tif (seg[h].x == x)\n\t\t\t\tif (seg[h].y == y && seg[h + 1].x == xx && seg[h + 1].y == yy)\n\t\t\t\t\treturn true;\n\t\t\tif (seg[h].x == xx)\n\t\t\t\tif (seg[h].y == yy && seg[h + 1].x == x && seg[h + 1].y == y)\n\t\t\t\t\treturn true;\n\t\t}\n\t}\n\t\n\treturn false;\n}\n\nint main (void) {\n\tint i, cnt, j;\n\n\tfor (i = 0, cnt = 0; cnt < 8; i++, cnt++) {\n\t\tscanf(\"%d %d\", &s[i].x, &s[i].y);\n\t\t\n\t\tseg[cnt].x = s[i].x;\n\t\tseg[cnt].y = s[i].y;\n\n\t\tif (check (s[i].x, s[i].y, i)) {\n\t\t\ti--;\n\t\t}\n\t}\n\t\n\tfor (j = 0; j < 8; j += 2) {\n\t\tif (seg[j].x != seg[j + 1].x && seg[j].y != seg[j + 1].y)\n\t\t{\n\t\t\tprintf(\"NO\\n\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\n\tif (checker()) {\n\t\tprintf(\"NO\\n\");\n\t\treturn 0;\n\t}\n\n\tif (i != 4){\n\t\tprintf(\"NO\\n\");\n\t\treturn 0;\n\t}\n\n\telse {\n\t\tqsort (s, 4, sizeof (point), cmp);\n\t\tif (s[0].y > s[1].y) swap (0, 1);\n\t\tif (s[2].y > s[3].y) swap (2, 3);\n\n\t\tif (s[0].x != s[1].x || s[2].x != s[3].x) {\n\t\t\tprintf(\"NO\\n\");\n\t\t\treturn 0;\n\t\t}\n\n\t\telse {\n\t\t\tif ((s[1].y - s[0].y) != (s[3].y - s[2].y)) {\n\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\telse printf(\"YES\\n\");\n\t\t}\n\t}\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "14f86635b4290395d90643851d976248", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "c3ad338601746cf9bca7cc9cd93913c5", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9512843224092117, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \nint main()\n{\n char s[12], res[12], in[12];\n int k = 1, found = 0, i, j, mem[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n scanf(\"%s\", &s);\n scanf(\"%s\", &in);\n for(i = 1; i < 10; i++)\n {\n for(j = 0; j < strlen(s); j++)\n {\n if(s[j] == i + '0')\n {\n res[0] = s[j];\n mem[j] = 1;\n found = 1;\n break;\n }\n }\n if(found == 1)\n break;\n }\n for(i = 0; i < 10; i++)\n {\n for(j = 0; j < strlen(s); j++)\n {\n if(s[j] == i + '0' && mem[j] != 1)\n {\n res[k] = s[j];\n mem[j] = 1;\n k++;\n }\n }\n }\n res[strlen(s)] = '\\0';\n printf(\"%s %s\\n\", res, in);\n if(strcmp(res, in) == 0)\n printf(\"OK\");\n else\n printf(\"WRONG_ANSWER\");\n system(\"Pause\"); \n return 0;\n}\n \n \n \n \n", "lang": "GNU C", "bug_code_uid": "a3ce9b7476e823028822f54b610385c0", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "ad2695dd910a78ca75ff949886d16dce", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.29364298366463293, "equal_cnt": 30, "replace_cnt": 24, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 31, "bug_source_code": "#include \n#include \n#include \n#define min(a,b) (a < b ? a : b)\ntypedef long long ll;\nll n, m, a[100000], l[200], vis[200], vist[200];\n\nbool solve(){\n\tll i, j;\n\tfor(i = 1; i < m; i++){\n\t\tif(l[i + 1] > l[i]){\n\t\t\tif(a[l[i]] && a[l[i]] != l[i + 1] - l[i]) return false;\n\t\t\ta[l[i]] = l[i + 1] - l[i];\n\t\t}\n\t\telse if(l[i + 1] == l[i]){\n\t\t\tif(a[l[i]] && a[l[i]] != n) return false;\n\t\t\ta[l[i]] = n;\n\t\t\t\n\t\t\tfor(j = 1; j <= n; j++)\tif(a[j]) vis[a[j]] = 1;\n\t\t\tfor(j = 1; j <= n; j++){\n\t\t\t\tif(!a[j]){\n\t\t\t\t\tfor(ll k = 1; k <= n; k++){\n\t\t\t\t\t\tif(!vis[k]){\n\t\t\t\t\t\t\ta[j] = k;\n\t\t\t\t\t\t\tvis[k] = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}// 1 2 3 4 5 \n\t\t\tbreak;\n\t\t}\n\t\telse{\n\t\t\tif(a[l[i]] && a[l[i]] != n - l[i] + l[i + 1]) return false;\n\t\t\ta[l[i]] = n - l[i] + l[i + 1];\n\t\t\t//vist[a[l[i]]] = l[i];\n\t\t}\n\t}\n\t\n\t//check:\n\tfor(i = 1; i <= n; i++) if(!a[i]) return false;\n\tfor(i = 1; i <= n; i++) \n\t\tfor(j = 1; j <= n; j++) if(i != j && a[j] == a[i]) return false;\n\tfor(i = 1;)\n\treturn true;\n}\n\nint main(void){\n\tll i, j, k;\n\tscanf(\"%lld%lld\", &n, &m);\n\tfor(i = 1; i <= m ; i++) scanf(\"%lld\", l + i);\n\tif (solve()) for(i = 1; i <= n; i++) printf(\"%lld \", a[i]);\n\telse puts(\"-1\\n\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "7690840e34b38718ae7850e7367e01ae", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "apr_id": "1c74e00f4a72cf18c56259a69d1e8079", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8802698145025295, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "int main(){\n int a,b,mod;\n char ans[10];\n scanf(\"%d%d%d\",&a,&b,&mod);\n int i,j;\n int p = 1;\n for(i=1;i<=9;i++) p = (p*10)%mod;\n for(i=0;i<=a;i++){\n int m = ((long long)i*p)%mod;\n m = (mod - m)%mod;\n if(m > b){\n //printf(\"I = %d\\n\",i);\n printf(\"1\");\n int k = 8;\n for(j=0;j<=8;j++) ans[j]='0';\n for(j=i;j;j/=10) ans[k--]=(j%10)+'0';\n ans[9]='\\0';\n printf(\" %s\\n\",ans);\n return 0;\n }\n }\n puts(\"2\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8d9210377d8b90c28777efdb04e3a1fc", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "ff08fc749b063290d613b0c2c291b6db", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.990791896869245, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n\nint main(){\n long i, j;\n long a, b, mod;\n scanf( \"%ld %ld %ld\", &a, &b, &mod );\n\n if( b >= mod - 1 ){\n printf( \"\\n%d\", 2 );\n return 0;\n }\n\n for( i=0; i<=a; i++ ){\n\n long long temp = i*1000000000LL;\n\n long remainder = temp % mod;\n if( remainder != 0 )\n remainder = mod - remainder;\n\n if( remainder > b ){\n printf( \"\\n%d %09ld\", 1, i );\n return 0;\n }\n\n }\n\n printf( \"\\n%d\", 2 );\n return 0;\n\n}\n\n", "lang": "GNU C", "bug_code_uid": "e8cc9607fef9325e36790b1f110092be", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "44fb1b1036643d2974ecb56f38c8a052", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.945011524530787, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n#include \n\nchar r[1 << 20];\n\nint box2mask(char b[5][5]) {\n\tint mask = 0, i, j, k = 0;\n\tfor (i = 0; i < 5; i++)\n\t\tfor (j = 0; j < 5-abs(2-i); j++) {\n\t\t\tif (b[i][j])\n\t\t\t\tmask |= 1 << k;\n\t\t\tk++;\n\t\t}\n\n\treturn mask;\n}\n\nint go(int mask) {\n\tif (r[mask] != -1)\n\t\treturn r[mask];\n\n\tchar b[5][5];\n\tmemset(b, 0, sizeof(b));\n\n\tint i, j, k = 0;\n\tfor (i = 0; i < 5; i++)\n\t\tfor (j = 0; j < 5-abs(2-i); j++) {\n\t\t\tif (mask & (1 << k))\n\t\t\t\tb[i][j] = 1;\n\t\t\tk++;\n\t\t}\n\n\tchar bb[5][5];\n\tfor (i = 0; i < 5; i++)\n\t\tfor (j = 0; j < 5-abs(2-i); j++) {\n\t\t\tmemcpy(bb, b, sizeof(bb));\n\t\t\tfor (k = i; k < 5 && j < 5-abs(2-k) && bb[k][j]; k++) {\n\t\t\t\tbb[k][j] = 0;\n\t\t\t\tif (!go(box2mask(bb)))\n\t\t\t\t\treturn r[mask] = 1;\n\t\t\t}\n\n\t\t\tmemcpy(bb, b, sizeof(bb));\n\t\t\tint l;\n\t\t\tfor (k = i, l = j; k < 5 && l < 5-abs(2-k) && bb[k][l]; k++, l++) {\n\t\t\t\tbb[k][l] = 0;\n\t\t\t\tif (!go(box2mask(bb)))\n\t\t\t\t\treturn r[mask] = 1;\n\t\t\t}\n\n\t\t\tmemcpy(bb, b, sizeof(bb));\n\t\t\tfor (k = j; k < 5-abs(2-i) && bb[i][k]; k++) {\n\t\t\t\tbb[i][k] = 0;\n\t\t\t\tif (!go(box2mask(bb)))\n\t\t\t\t\treturn r[mask] = 1;\n\t\t\t}\n\t\t}\n\n\treturn r[mask] = 0;\n}\n\nint main() {\n\tint i, mask = 0, j = 0;\n\tfor (i = 0; i < 5; i++) {\n\t\tchar s[100];\n\t\tgets(s);\n\n\t\tchar *t = s;\n\t\twhile (*t != '\\0') {\n\t\t\tif (*t == 'O')\n\t\t\t\tmask |= (1 << j);\n\t\t\tif (*t == 'O' || *t == '.')\n\t\t\t\tj++;\n\t\t\tt++;\n\t\t}\n\n\t}\n\t\n\tif (j != 19)\n\t\texit(1);\n\n\tmemset(r, -1, sizeof(r));\n\n\tif (go(mask))\n\t\tputs(\"Karlsson\");\n\telse\n\t\tputs(\"Lillebror\");\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "59be8447aaafac35fda8471cf24700e6", "src_uid": "eaa022cc7846c983a826900dc6dd919f", "apr_id": "74679986c4278147882db259d21173fd", "difficulty": 2000, "tags": ["dp", "games", "dfs and similar", "bitmasks", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5555555555555556, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int l,b,i;\n scanf(\"%d %d\",&l,&b);\n while(l<10&&b<10)\n {\n for(i=1;l<=b;i++)\n {\n l=l*3;\n b=b*2;\n if(l>b)\n {printf(\"%d\",i);break;}\n }\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "7ab48814fa97345f13a7c2f35756293d", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "696a81cb238418f164083a1821de7e6f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.989041095890411, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nmain()\n{\n int m,n,i,k;\n scanf(\"%d%d\",&m,&n);\n if (n==m)\n printf(\"0\");\n else\n {\n x:\n k=0;\n for (i=1;i<=m;i++)\n {\n if (n>=i)\n n=n-i;\n k++;\n if (n<=i)\n break;\n }\n if (k==m)\n goto x;\n else\n {\n if (n<=i)\n {\n printf(\"%d\",n);\n }\n else\n printf(\"0\");\n }\n }\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3867d153543b4b8c8517d9fabd379dc7", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "de69c3835cf07db08784d227ddac4e17", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4012539184952978, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n#include \nint main(void)\n{ int n,m,a,b=0,s;\nscanf(\"%d %d\",&n,&m);\nif (mn) printf(\"-1\");\nif (n==m) printf(\"%d\",m);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a57cca7d39858a70cdeda0aa60a01580", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "f7c9c76b14879128258e28813aaa0340", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4760076775431862, "equal_cnt": 24, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 11, "fix_ops_cnt": 23, "bug_source_code": "#include\n\nint main(void)\n{\n while(1){\n int n,i,res=1,s,e;\n char x[150],sc,ec;\n scanf(\"%d \",&n);\n for(i=1;i<=n;i++){\n scanf(\"%c\",&x[i]);\n\n if(i!=1){\n if(x[i-1]==x[i] && x[i]!='?'){\n res = 5;\n }\n if(x[i]=='?' && x[i-1]!='?'){\n s=i-1;\n sc=x[i-1];\n }\n if(x[i-1]=='?' && x[i]!='?'){\n e=i;\n ec=x[i];\n if(sc!=ec && e-s==2) res=5;\n }\n }\n }\n\n if(res==1) printf(\"Yes\\n\");\n else if(res==5) printf(\"No\\n\");\n\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c3cb29c6ef1581cdc8cb56ac64f2a450", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "cbe8120c1c14f069b47f47033c5e431d", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8972926514825956, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint solve(char *input, char pre, size_t idx) {\n int ret = 0;\n if (input[idx] == '\\0') return 1;\n switch (input[idx]) {\n case 'C':\n if (pre == 'C') return 0;\n ret += solve(input, 'C', idx+1);\n break;\n case 'M' :\n if (pre == 'M') return 0;\n ret += solve(input, 'M', idx+1);\n break;\n case 'Y' :\n if (pre == 'Y') return 0;\n ret += solve(input, 'Y', idx+1);\n break;\n case '?' :\n if (pre != 'C') ret += solve(input, 'C', idx+1);\n if (pre != 'M') ret += solve(input, 'M', idx+1);\n if (pre != 'Y') ret += solve(input, 'Y', idx+1);\n break;\n default :\n ret += solve(input, input[idx], idx+1);\n }\n if (ret > 1) {\n printf(\"YES\\n\");\n exit(EXIT_SUCCESS);\n }\n return ret;\n}\n\nint main(int argc, char const *argv[]) {\n int n;\n scanf(\"%d\", &n);\n char *str = malloc((n+1) * sizeof(char));\n scanf(\"%s\", str);\n solve(str, '.', 0);\n printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d84a9a6d88631c7d30767f5dc10f3251", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "5a2dba4cd2fcf49ae66576156659197e", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2605042016806723, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n#define MAX 1000\n\nvoid quick_sort(int *v, int size)\n{\n\tint aux;\n\tif(size<=1) return;\n\telse\n\t{\n\t\tint pivot = v[size/2];\n\t\tint a =0;\n\t\tint b= size-1;\n\t\twhile(apivot) b--;\n\t\t\tif(a<=b)\n\t\t\t{\n\t\t\t\taux = v[a];\n\t\t\t\tv[a] = v[b];\n\t\t\t\tv[b] = aux;\n\t\t\t\ta++;\n\t\t\t\tb--;\n\t\t\t}\n\t\t\tquick_sort(v,b);\n\t\t\tquick_sort(v+a, size-a);\n\t\t}\n\t}\n}\n\nint main()\n{\n\tint len, coins[MAX], pocket=1, index, bigger=0;\n\tscanf(\"%d\", &len);\n\tfor(index=0;index\nint main(){\n int i,a,b,j,k,c;\n int arr[100],var[100];\n scanf(\"%d%d\",&a,&b);\n i=0;\n for(j=a;j>=0;){\n k=j%10;\n j=j/10;\n for(;i<101;){\n arr[i]=k;\n break;\n }\n i=i+1;\n }\n c=0;\n i=0;\n for(j=b;j>=0;){\n k=j%10;\n j=j/10;\n c++;\n for(;i<101;){\n var[i]=k;\n break;\n }\n i=i+1;\n }\n for(i=0;i\nint main()\n{\n int n;\n int x,i;\n scanf(\"%d\",&n);\n for(i=1;i\n#include \nint main ()\n{\n int i,j,p=0,q=0,r=0,l;\n char a[101];\n gets(a);\n\n for (i=0;a[i]!='\\0';i=i+2)\n {\n\n if (a[i]=='1')\n {\n p++;\n\n }\n if (a[i]=='2')\n {\n q++;\n\n }\n if (a[i]=='3')\n {\n r++;\n\n }\n for (i=0;i\n\nlong long perm(int n, int i) {\n\tlong long sum = 1;\n\twhile (i--) sum = sum * n--;\n\treturn sum;\n}\n\nlong long comb(int n, int i) {\n\treturn perm(n, i) / perm(i, i);\n}\n\nint main() {\n\tint n, k, temp;\n\tscanf(\"%d %d\", &n, &k);\n\tlong long dp[5], sum, tt;\n\tdp[0] = 1;\n\tdp[1] = 1;\n\n\tfor (int i = 2; i <= k; i++) {\n\t\tsum = comb(n, i) * perm(i, i);\n\t\ttemp = 0;\n\t\tfor (int j = i - 1; j >= 0; j--) {\n\t\t\ttt = comb(n - j, n - i) - 1;\n\t\t\tsum -= (tt - temp) * dp[j];\n\t\t\ttemp += tt - temp;\n\t\t}\n\t\tdp[i] = sum;\n\t}\n\n\tprintf(\"%lld\", dp[k]);\n}", "lang": "GNU C", "bug_code_uid": "4f665a912402e93ec8933b5e67b2811f", "src_uid": "96d839dc2d038f8ae95fc47c217b2e2f", "apr_id": "e2a32f0738c43f76b0ca6dcf259171cf", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9538188277087034, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nlong long perm(int n, int i) {\n\tlong long sum = 1;\n\twhile (i--) sum = sum * n--;\n\treturn sum;\n}\n\nlong long comb(int n, int i) {\n\treturn perm(n, i) / perm(i, i);\n}\n\nint main() {\n\tint n, k;\n\tscanf(\"%d %d\", &n, &k);\n\tlong long dp[5], sum, tt, temp;\n\tdp[0] = 1;\n\tdp[1] = 1;\n\n\tif (n == 4 && k == 4) { printf(\"16\"); return 0; }\n\n\tfor (int i = 2; i <= k; i++) {\n\t\tsum = comb(n, i) * perm(i, i);\n\t\ttemp = 0;\n\t\tfor (int j = i - 1; j >= 0; j--) {\n\t\t\ttt = comb(n - j, i - j) - 1;\n\t\t\tsum -= (tt - temp) * dp[j];\n\t\t\ttemp += tt - temp;\n\t\t}\n\t\tdp[i] = sum;\n\t}\n\n\tprintf(\"%lld\", dp[k]);\n}", "lang": "GNU C", "bug_code_uid": "5c43067c364f05c885b582ec92cd9096", "src_uid": "96d839dc2d038f8ae95fc47c217b2e2f", "apr_id": "e2a32f0738c43f76b0ca6dcf259171cf", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9961783439490446, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main()\n{\n int n,j,i,posmin,posmax,d1,d2,d3,d4,T[100];\n \n scanf(\"%d\",&n);\n for(j=0;j=d2) && (d1>=d3) && (d1>=d4))\n printf(\"%d\",d1);\n else\n if ((d2>=d1)&&(d2>=d3)&&(d2>=d4))\n printf(\"%d\",d2);\n else\n if ((d3>=d4)&&(d3>=d1)&&(d3>=d2))\n printf(\"%d\",d3);\n else \n printf(\"%d\",d4);\n \n\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cc61756ff9316ae071c2b94f08fc2f72", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "245619bea2e9b5a00766fe7cf5b0ebe0", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.13290113452188007, "equal_cnt": 21, "replace_cnt": 17, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "#include\n#include\n#define abs(x) ((x<0)? -(x) : (x))\nint main()\n{\n unsigned long long int t, w, b, a, i, j, gcd, p, q, lcm, s=0;\n scanf(\"%lld %lld %lld\", &t, &w, &b);\n p=w;q=b;\n if(w==b) gcd=w;\n else if(p>q){\n a=q;\n while(a>0){\n a=p%q;\n if(a==1){\n p=1;\n break;\n }\n p=q;\n q=a;\n }\n gcd=p;\n }\n else{\n a=p;\n while(a>0){\n a=q%p;\n if(a==1){\n q=1;\n break;\n }\n q=p;\n p=a;\n }\n gcd=q;\n }\n lcm = (w/gcd)*b;\n a=0;\n if(wt){\n s=s-((j+a-1-t));\n break;\n }\n i++;\n }\n }\n gcd=1;\n i=s;\n j=t;\n if(i>j){\n i^=j;\n j^=i;\n i^=j;\n }\n else if(i==j){\n printf(\"1/1\");\n return 0;\n }\n while(gcd!=0){\n gcd= j%i;\n j=i;\n i=gcd;\n }\n printf(\"%lld/%lld\", s/j,t/j );\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "54748a24afefcb41288ea454fdeab0fa", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "aa40dceaf0c5ad23437cd00241ed1715", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.933993399339934, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int t,n,i,j,k,c=0,c1=0,pd=0,p1[4000],p2[4000],ans=0;\n for(j=0;j+2<=4000;j++)///sieve*************\n {\n p1[j]=2+j;\n }\n for(j=0;j+2<=4000;j++)\n {\n if(p1[j]==0)\n continue;\n p2[c]=p1[j];\n c++;\n for(k=j+1;k<=4000;k++)\n {\n if(p1[k]==0)\n continue;\n else if(p1[k]%p1[j]==0)\n {\n p1[k]=0;\n }\n\n }\n }///sieve ********************\n ///scanf(\"%d\",&t);\n ///for(k=0;k3)\n break;\n }\n }\n if(pd==2)\n {\n ///printf(\"%d \",i);///\n ans++;\n }\n }\n printf(\"%d\",ans);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "2044428478c2ce19b742aa31ac45b0ae", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "4f56b76f35b92a12bf48b58e4a835d03", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6990291262135923, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "//http://rextester.com c gcc 5.4.0\n#include\n#define a(a,b)(((a)>(b))?(a):(b))\nint main(){\n int a,b,c;scanf(\"%d%d\",&a,&b);\n if(a<1&b>0){printf(\"Impossible\");return;}\n c=a+b-1;if(b==0){c=a;}\n printf(\"%d %d\",a(a,b),c);\n}", "lang": "GNU C", "bug_code_uid": "62f578989dd855104ddca56ddfe0fbb9", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "c5aea199af6e0a85e122e01584956975", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9598593612657486, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 14, "bug_source_code": "\n#include \n#include \n#include \n\n#define N 5\n\nint main(void) {\n int arr[N][N];\n int i, j;\n int k[N];\n for (i = 0; i < N; i++)\n for (j = 0; j < N; j++)\n scanf(\"%d\", &arr[i][j]);\n int d = 0, good, ans = 0;\n for (k[d] = 0; k[d] < 5; k[d]++){\n good = 1;\n for (i = 0; good && i < d; i++)\n good = !(k[i] == k[d]);\n if (!good)\n continue;\n d++;\n for (k[d] = 0; k[d] < 5; k[d]++){\n good = 1;\n for (i = 0; good && i < d; i++)\n good = !(k[i] == k[d]);\n if (!good)\n continue;\n d++; \n for (k[d] = 0; k[d] < 5; k[d]++){\n good = 1;\n for (i = 0; good && i < d; i++)\n good = !(k[i] == k[d]);\n if (!good)\n continue;\n d++;\n for (k[d] = 0; k[d] < 5; k[d]++){\n good = 1;\n for (i = 0; good && i < d; i++)\n good = !(k[i] == k[d]);\n if (!good)\n continue;\n d++;\n for (k[d] = 0; k[d] < 5; k[d]++){\n good = 1;\n for (i = 0; good && i < d; i++)\n good = !(k[i] == k[d]);\n if (!good)\n continue;\n tans = (arr[k[1]][k[2]] + arr[k[2]][k[1]] + 2*arr[0][4]+ 2*arr[4][0] + 2*arr[3][4] + 2*arr[3][4] + arr[0][2] + arr[2][0]);\n if (tans > ans)\n ans = tans;\n }\n d--;\n }\n d--;\n }\n d--;\n }\n d--;\n }\n printf(\"%d\\n\", ans);\n return 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "ee107cfc06a52d72dc393a0eace013b1", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "apr_id": "1d628c666c80f036a8fd34bfc31a7a8f", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9781312127236581, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main(int argc, char const *argv[])\n{\n\tint n, *a, i, temp, amin = 2100, amax = 2010, x = 0;\n\tscanf(\"%d\", &n);\n\ta = (int *) malloc (sizeof(int) * n);\n\n\tfor (i = 0; i < n; i++) {\n\t\tscanf(\"%d\", &a[i]);\n\t}\t\n\n\tif (n < 2) {\n\t\treturn 0;\n\t}\n\t\n\tfor (i = 0; i < n; i++) {\n\t\tif (a[i] < amin)\n\t\t\tamin = a[i];\n\t\tif (a[i] > amax)\n\t\t\tamax = a[i];\n\t}\n\n\tx = amax - amin;\n\n\tif ((amin - x) < 2010)\n\t\tprintf(\"%d\", amin+x/2);\n\telse\n\t\tprintf(\"%d\", amax-x/2);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "3ab51865caff5370da897d9f8c4c1398", "src_uid": "f03773118cca29ff8d5b4281d39e7c63", "apr_id": "5b9e787cbed412381502c674896e80f4", "difficulty": 800, "tags": ["implementation", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6044340723453909, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\n\nint main(int argc, char *argv[]) {\n\t\n\tint n, i, j, max = 2010, min = 2100;\n\tscanf(\"%d\", &n);\n\tint a[n];\n\tfor (i = 0; i < n; i++) {\n\t\tscanf(\"%d\", &a[i]);\n\t}\n\t\n\tfor (i = 0; i < n; i++) {\n\t\tif (a[i] > max) {\n\t\t\tmax = a2[i];\n\t\t\t\n\t\t}\n\t\tif (a[i] < min) {\n\t\t\tmin = a[i];\n\t\t}\n\t}\n\t\n\tprintf (\"%d\", (min + max) / 2);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "95a3f7ec14d50426bab742fac86f4285", "src_uid": "f03773118cca29ff8d5b4281d39e7c63", "apr_id": "1d406ea8a555d041ff26ae0c85a1ae88", "difficulty": 800, "tags": ["implementation", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7909604519774012, "equal_cnt": 18, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 18, "bug_source_code": "#include\nint main(void)\n{\n int n,i,h;\n scanf(\"%d\",&n);\n\n while(i\nint main()\n{\n long long int x,k,i,j,n,l,num,sum,sumc;\n scanf(\"%lld\",&x);\n n=x;\n i=0;\n if(x>=1 && x<=9)\n printf(\"%lld\\n\",x);\n else\n {\n while(n>0)\n {\n k=n%10;\n n=n/10;\n i++;\n }\n sum=9*(i-1)+k-1;\n // printf(\"sum=%lld\\n\",sum);\n num=1;\n for(j=0;j<(i-1);j++)\n {\n num=num*10;\n }\n num=k*num;\n j=x;\n// printf(\"num=%lld\\n\",num);\n for(j=x;j>=num;j--)\n {\n sumc=0;\n l=j;\n while(l>0)\n {\n k=l%10;\n sumc=sumc+k;\n l=l/10;\n }\n if(sumc==sum)\n break;\n }\n\n printf(\"%lld\\n\",j);\n }\n return 0;\n }\n", "lang": "GNU C", "bug_code_uid": "7b95973d481442f14b066d1f9af9fceb", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "2729587cbb5ed6c77b5776bb33c00fd8", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8273132112815438, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \n\nint s1,s2;\n\nint val(char s[], char t[], int i, int j)\n{\n int max1 = -1,max = -1;\n for (int k = i; k < s1-(s2-j-1); k++){\n if(s[k]==t[j]){\n if(j < s2-1){\n int temp = val(s,t,k+1,j+1);\n if(temp!=-1){\n if(temp > k-i) max1 = temp;\n else max1 = k-i;\n }\n else break;\n if(max1> max) max = max1;\n }\n else{\n if(k - i > s1-k-1) max1 = k - i;\n else max1 = s1 -k -1;\n if (max1 > max) max = max1;\n }\n }\n if(max >= s1-s2) return max;\n }\n return max;\n}\n\nint main()\n{\n char s[201],t[201];\n scanf(\"%s\",s);\n scanf(\"%s\",t);\n s1= strlen(s);\n s2= strlen(t);\n if(!strcmp(s,t)) printf(\"0\");\n else printf(\"%d\",val(s,t,0,0));\n}", "lang": "GNU C11", "bug_code_uid": "310fa730bfefd7c7bd1383d90b5440bb", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "apr_id": "14b8e4a162fd33c5a8d7b42a9162f59b", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9958677685950413, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\n#define size 101\nint max_(int x,int y)\n{\n\treturn x>y?x:y;\n}\nmain()\n{\n\tchar s[size],t[size];\n\tscanf(\"%s\",s);\n\tscanf(\"%s\",t);\n\tint i,ans=0,j,p,pos,ss,tt;\n\tss=strlen(s);\n\ttt=strlen(t);\n\tfor(i=0;i\n#include \n \nstruct Pawns {\nint row[8];\nint coloumn[8];\nint count;\n};\n\n\nint main(void) {\n // your code goes here\n int i,j,min,max;\n char pos[8][8];\n struct Pawns White;\n struct Pawns Black;\n White.count=0;\n Black.count=0;\n for(i=0;i<9;i++)\n for(j=0;j<9;j++)\n scanf(\"%c\",&pos[i][j]);\n \n for(i=0;i<8;i++)\n for(j=0;j<8;j++)\n if(pos[i][j]=='W')\n {\n White.row[White.count]=i; \n White.coloumn[White.count]=j;\n White.count++;\n }else if(pos[i][j]=='B')\n {\n Black.row[Black.count]=i; \n Black.coloumn[Black.count]=j;\n Black.count++;\n } \n min=999;\n for(i=0;iWhite.row[i]){\n for(j=0;jBlack.row[j]){\n break;\n }\n }\n \n if(j>=Black.count){\n min=White.row[i];\n }\n \n }\n }\n max=-1;\n for(i=0;iBlack.row[i]){\n \n break;\n }\n }\n \n if(j>=White.count){\n max=Black.row[i];\n }\n \n }\n }\n \n if(min<=(7-max)){\n \n printf(\"A\");\n }\n else\n printf(\"B\");\n \n \n \n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0d0f3e5f47d74a4fb95b090e0316d754", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "f277d45cf505157fbf6a3e50f181cb0e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22674418604651161, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\nvoid main()\n{\nlong long k;long long p;long long z;long long count;long long d;long long i2;long long i;int t;long long s;long long ans;count=0;i=11;s=0;\n//int k,p,count,z,d,i2,i,t,s,ans;count=s=0;i=11;\nscanf(\"%lld %lld\",&k,&p);\n\nwhile(count\n#include\n\nint main()\n{\n long long int a, b, x, i ,c=0;\n scanf(\"%lld %lld\", &a, &b);\n if(b==a){\n printf(\"infinity\");\n return 0;\n }\n else if(b>a){\n printf(\"0\");\n return 0;\n }\n else{\n x=b+1;\n for(;x<=(a-b);x++){\n if(a%x==b) c++;\n }\n printf(\"%lld\", c);\n }\n\n\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "61c62254b3bb765c0df62754e6101e2c", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "73519f9c56c6c9b74a4f3aa3bb5b723e", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.10092961487383798, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nint main (void)\n{\n\tint pilas, i;\n\tint *numeros;\n\tscanf(\"%d\",&pilas);\n\tnumeros = (int*)malloc(pilas * sizeof(int));\n\tfor(i=0;i\n#include \n#include \nusing namespace std;\nint cmp(const void *a,const void *b)\n{\n return ( *(int*)b-*(int*)a);\n}\n\nint main()\n{\n int n,k,x,t[110],i,sum=0,j;\n scanf(\"%d%d%d\",&n,&k,&x);\n\n for (i=0;i\nint main()int n,k,x,i,j,a,sum;\n scanf(\"%d%d%d\",&n,&k,&x);\n int number[n];\n for(i=0;i\n#include\n\nint main(){\n\tchar a[10], b[10], x;\n\tint i, j = 0;\n\t\n\tfor(i = 0; i < 4; ++i){\n\t\tscanf(\" %c\", &a[i]);\n\t}\n\tfor(i = 0; i < 4; ++i){\n\t\tscanf(\" %c\", &b[i]);\n\t}\n\t\n\tx = a[2]; a[2] = a[3]; a[3] = x; \n\tx = b[2]; b[2] = b[3]; b[3] = x;\n\t\n\tj = 0;\n\tfor(i = 0; i < 4; ++i){\n\t\tif(a[i] != 'X'){\n\t\t\ta[j] = a[i];\n\t\t\tj++;\n\t\t}\n\t}\n\t\n\tj = 0;\n\tfor(i = 0; i < 4; ++i){\n\t\tif(b[i] != 'X'){\n\t\t\tb[j] = b[i];\n\t\t\tj++;\n\t\t}\n\t}\n\ta[3] = '\\0';\n\tb[3] = '\\0';\n\t\n\twhile(a[0] != b[0]){\n\t\tx = b[0];\n\t\tfor(i = 1; i < 3; ++i){\n\t\t\tb[i-1] = b[i];\n\t\t}\n\t\tb[2] = x;\n\t}\t\n\t\n\tif(strcmp(a, b) == 0){\n\t\tprintf(\"YES\");\n\t}else\n\t\tprintf(\"NO\");\n\t\t\nreturn 0;\t\n}", "lang": "GNU C", "bug_code_uid": "02e865ffc931bcc3cdbb87ad121049fa", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "28c0f66ba6d37ea0677e59cc104e9a32", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9754445385266723, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "\n#include\n\n\n\nint main()\n{\n int a,b,count=0,count1=0,count2=0;\n float m=0;\n int diffa=0;\n int diffb=0;\n scanf(\"%d %d\",&a,&b);\n //winning of a \n for(int i=1;i<=6;i++)\n {\n diffa=a-i;\n diffb=b-i;\n if(diffb<0)\n {\n diffb=diffb*(-1);\n \n }\n\n if(diffa<0)\n {\n diffa=diffa*(-1);\n }\n if(diffa\n\n\nint main()\n{\n\tint n1, n2, k1, k2;\n\n\tscanf(\"%d %d %d %d\", &n1, &n2, &k1, &k2);\n\n\tif (n1 > n2)\n\t{\n\t\tprintf(\"First\");\n\t}\n\telse\n\t{\n\t\tprintf(\"Second\");\n\t}\n\n\treturn 1;\n}", "lang": "GNU C", "bug_code_uid": "680eac8192a86f86f58ccea17ab1a060", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "285876382a3be91e1602837ca72f9370", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9262720664589823, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n char s[101];\n char a[3];\n int len,i,b,j,max=0;\n int ara[98];\n for(i=0;i<98;i++)\n ara[i]=0;\n scanf(\"%d\",&len);\n scanf(\"%s\",s);\n for(i=0;imax){\n max=ara[i];\n b=i;\n }\n }\n }\n printf(\"%c%c\\n\",s[b],s[b+1]);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "34859aaa5eead77822a59c2f0e30bcb8", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "0b58756c5497a9418ab81dc3deab165d", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7195357833655706, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nmain()\n{\n int i, n, m, sum= 2;\n scanf(\"%i%i\", &n, &m);\n\n for(i=n; i>1; --i){\n sum= sum+sum;\n }\n if(n>=m)\n printf(\"%i\\n\", m);\n else\n printf(\"%i\\n\", m%sum);\n}", "lang": "GNU C", "bug_code_uid": "d987e14d84211719404f55f1338bc777", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "5cdc36f9824d03b36d5bf53a45708ff5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.963579604578564, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#define MAX 10010\nint prime[MAX];\nint p[MAX];\n\nint main(){\n int i,j,k,n,c,x;\n prime[0]=-1;prime[1]=-1;p[0]=1;\n for(k=1,i=2;i1){\n\t\tfor(x=2;;x++){\n\t\t\tif(prime[x]>=0&&n%x==0){\n\t\t\t\tc+=n/x;\n\t\t\t\tn/=x;\n\t\t\t\t//printf(\"--%d\\n\",n);\n\t\t\t\tgoto next;\n\t\t\t}\n\t\t}\n\t\tnext:;\n\t}\n\tprintf(\"%d\\n\",c);\n //for(j=1;j\n#include\n#include\n#include\n#include\n#include\n\nusing namespace std;\nint max=10;\n//int arr[]={0,2,3,5,7,11,13,17,19,23,29,31,33,37,39,};\n\nint main(){\n int k;\n scanf(\"%d\",&k);\n int sum=k;\n int res=k;\n while(res!=1){\n for(int i=2;i<=res;i++)\n if(res%i==0){\n res=res/i;\n sum+=res;\n break;\n }\n }\n printf(\"%d\\n\",sum);\n}\n\n", "lang": "GNU C", "bug_code_uid": "3a8715fb69ef66e7fa5b6724f956747a", "src_uid": "821c0e3b5fad197a47878bba5e520b6e", "apr_id": "1494dfbf178341055820ed2d847016de", "difficulty": 1200, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9936275666745339, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/* practice with Dukkha */\n#include \n\n#define M\t150\n#define MD\t1000000007\n\nint query(int aa[][M + 1], int l0, int l1, int r0, int r1) {\n\treturn l0 > l1 || r0 > r1 ? 0 : ((long long) aa[l1][r1] - aa[l0 - 1][r1] - aa[l1][r0 - 1] + aa[l0 - 1][r0 - 1]) % MD;\n}\n\nvoid add(int aa[][M + 1], int l, int r, int a) {\n\taa[l][r] = (aa[l][r] + a) % MD;\n}\n\nint main() {\n\tstatic int dp00[M + 1][M + 1], dp01[M + 1][M + 1], dp10[M + 1][M + 1], dp11[M + 1][M + 1];\n\tstatic int dq00[M + 1][M + 1], dq01[M + 1][M + 1], dq10[M + 1][M + 1], dq11[M + 1][M + 1];\n\tint n, m, l, r, ans;\n\n\tscanf(\"%d%d\", &n, &m);\n\tans = 0;\n\twhile (n--) {\n\t\tfor (l = 1; l <= m; l++)\n\t\t\tfor (r = 1; r <= m; r++) {\n\t\t\t\tdp00[l][r] = (dp00[l][r] + dp00[l][r - 1]) % MD;\n\t\t\t\tdp01[l][r] = (dp01[l][r] + dp01[l][r - 1]) % MD;\n\t\t\t\tdp10[l][r] = (dp10[l][r] + dp10[l][r - 1]) % MD;\n\t\t\t\tdp11[l][r] = (dp11[l][r] + dp11[l][r - 1]) % MD;\n\t\t\t}\n\t\tfor (l = 1; l <= m; l++)\n\t\t\tfor (r = 1; r <= m; r++) {\n\t\t\t\tdp00[l][r] = (dp00[l][r] + dp00[l - 1][r]) % MD;\n\t\t\t\tdp01[l][r] = (dp01[l][r] + dp01[l - 1][r]) % MD;\n\t\t\t\tdp10[l][r] = (dp10[l][r] + dp10[l - 1][r]) % MD;\n\t\t\t\tdp11[l][r] = (dp11[l][r] + dp11[l - 1][r]) % MD;\n\t\t\t}\n\t\tfor (l = 1; l <= m; l++)\n\t\t\tfor (r = 1; r <= m; r++)\n\t\t\t\tdq00[l][r] = dq01[l][r] = dq10[l][r] = dq11[l][r] = 0;\n\t\tfor (l = 1; l <= m; l++)\n\t\t\tfor (r = l; r <= m; r++) {\n\t\t\t\tdq00[l][r] = 1;\n\t\t\t\tadd(dq00, l, r, query(dp00, l, m, 1, r));\n\t\t\t\tadd(dq01, l, r, query(dp01, l, r, r, m));\n\t\t\t\tadd(dq01, l, r, query(dp00, l, r, r + 1, m));\n\t\t\t\tadd(dq10, l, r, query(dp10, 1, l, l, r));\n\t\t\t\tadd(dq10, l, r, query(dp00, 1, l - 1, l, r));\n\t\t\t\tadd(dq11, l, r, query(dp11, 1, l, r, m));\n\t\t\t\tadd(dq11, l, r, query(dp01, 1, l - 1, r, m));\n\t\t\t\tadd(dq11, l, r, query(dp10, 1, l, r + 1, m));\n\t\t\t\tadd(dq11, l, r, query(dp00, 1, l - 1, r + 1, m));\n\t\t\t\tans = (ans + (long long) dq00[l][r] + dq01[l][r] + dq10[l][r] + dq11[l][r]) % MD;\n\t\t\t}\n\t\tfor (l = 0; l <= m; l++)\n\t\t\tfor (r = 0; r <= m; r++) {\n\t\t\t\tdp00[l][r] = dq00[l][r];\n\t\t\t\tdp01[l][r] = dq01[l][r];\n\t\t\t\tdp10[l][r] = dq10[l][r];\n\t\t\t\tdp11[l][r] = dq11[l][r];\n\t\t\t}\n\t}\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "77cb26e3e043de931527b2c834dd12ee", "src_uid": "740eceed59d3c6ac55c1bf9d3d4160c7", "apr_id": "ded13539a6e84ea27fb784fa22815464", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8945578231292517, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nusing namespace std;\nint f(int x,int y)\n{\n\tif(x/y==0)\n\treturn 1;\n\telse if(x%y!=0)\n\treturn x/y+1;\n\telse if(x%y==0)\n\treturn x/y;\n}\nint main()\n{\n\tint k,n,s,p;\n\twhile(~scanf(\"%d%d%d%d\",&k,&n,&s,&p))\n\t{\n\t\t long long int h,j;\n\t\t h=f(n,s)*k;\n\t\t j=f(h,p);\n\t\t cout<\n\n\nint main()\n{\n\n int n,i,max,min,j,k,c=0,a,b;\n\n scanf(\"%d\",&n);\n\n int x[n],y[n];\n\n for(i=0;ic) printf(\"%d\",y[0]);\n else printf(\"%d\",c);\n}\n", "lang": "GNU C11", "bug_code_uid": "764dc301883853e692c746fc83587999", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "d60f1716fc5f814bb4fda981ecb9ff5b", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5294117647058824, "equal_cnt": 12, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "#include \nint main()\n{\n int total_num,length_num,width_num,n,m,a;\n scanf(\"%hd %hd %hd\",&n,&m,&a);\n if(n%a==0){\n length_num=n/a;\n }\n else{\n length_num=(n/a)+1;\n }\n if(m%a==0){\n width_num=m/a;\n }\n else{\n width_num=(m/a)+1;\n }\n return width_num*length_num;\n}", "lang": "GNU C", "bug_code_uid": "25a8d11407eca12699ac43a4201e2263", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "e56f339f2bdaf02672d781f9740879e1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7474452554744525, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main() {\n\tlong long int i=0,j=0,k,l,n,m,a[100]={0},b[100]={0};\n\tscanf(\"%lld%lld\",&n,&m);\n\twhile(n) {\n\t\ta[i] = n%2;\n\t\tn /= 2;\n\t\ti++;\n\t}\n\twhile(m) {\n\t\tb[j] = m%2;\n\t\tm /= 2;\n\t\tj++;\n\t}\n\ti=99;\n\tm=1;\n\twhile(a[i]==b[i] && i+1)\n\t\ti--;\n\tfor(j=0;j\n#include \n\nint main()\n{\n int n , k , t ;\n\n scanf(\"%d %d\" , &n , &k ) ;\n\n int c = k ;\n int i = 0 ;\n for(i = 0 ; i< n ; i++)\n {\n scanf(\"%d\" , t) ;\n if(t==k)c++ ;\n if(t\n\n#define N\t100000\n#define MD\t1000000007\n\nlong long power(long long a, int k) {\n\tlong long p;\n\n\tif (k == 0)\n\t\treturn 1;\n\tp = power(a, k / 2);\n\tp = p * p % MD;\n\tif (k % 2)\n\t\tp = p * a % MD;\n\treturn p;\n}\n\nlong long cayley(int n, int k) {\n\treturn k == n ? 1 : k * power(n, n - k - 1) % MD;\n}\n\nint main() {\n\tstatic long long ff[N], gg[N];\n\tint n, m, a, b, k, i;\n\tlong long f, ans;\n\n\tscanf(\"%d%d%d%d\", &n, &m, &a, &b);\n\tf = 1;\n\tfor (i = 0; i < N; i++) {\n\t\tff[i] = f;\n\t\tgg[i] = power(f, MD - 2);\n\t\tf = f * (i + 1) % MD;\n\t}\n\tans = 0;\n\tfor (k = 0; k <= n - 2 && k < m; k++) {\n\t\t/* choose(n - 2, k) * factorial(k) */\n\t\tlong long path = ff[n - 2] * gg[n - 2 - k] % MD;\n\t\t/* choose(m - 1, k) * power(m, n - k - 2) */\n\t\tlong long edges = ff[m - 1] % MD * gg[k] % MD * gg[m - 1 - k] % MD\n\t\t\t* power(m, n - k - 2) % MD;\n\n\t\tans = (ans + path * cayley(n, k + 2) % MD * edges) % MD;\n\t}\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "50c4f3ac0bdf47ff5997be1b97a7e4a7", "src_uid": "728fe302b8b18e33f15f6e702e332cde", "apr_id": "dfdf64c60b62d80a203c9386422bcaa0", "difficulty": 2400, "tags": ["dp", "combinatorics", "math", "trees", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.444794952681388, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n\tlong long int n,a,b,c,ans=0;\n\tscanf(\"%lld%lld%lld%lld\",&n,&a,&b,&c);\n\twhile(n>0)\n\t{\n\t\tif(a>=b-c && n>=b)\n\t\t{\n\t\t\tif(n>=b)\n\t\t\t\tans++;\n\t\t\tn=n-b+c;\n\t\t}\n\t\telse if(n>=a)\n\t\t{\n\t\t\tn=n-a;\n\t\t\tans++;\n\t\t}\t\n\t\telse if(n\nlong long int Big(long long int x,long long int y);\nint main(void)\n{\n long long int n,a,b,c,A1=0,A2=0;\n for(;scanf(\"%I64d\\n%I64d\\n%I64d\\n%I64d\",&n,&a,&b,&c);)\n {\n if(n>=a) A2=n/a+Big(1+(n%a-b)/(b-c),(long long int)0);\n if(n>=b) A1=1+(n-b)/(b-c)+((n-b)%(b-c)+c)/a;\n printf(\"%I64d\\n\",Big(A1,A2));\n }\nreturn(0);\n}\n\nlong long int Big(long long int x,long long int y)\n{\n if(x>y) return(x);\n else return(y);\n}", "lang": "GNU C", "bug_code_uid": "77a441a8aa79b90e27177727474a87f2", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "93cd24b0af410b0b33c78388d0f4896a", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21370207416719045, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\nmain(){\n long long t,x,i;\n scanf(\"%d\",&x);\n t=0;\n for(i=0;i<=127;i++)\n {\n if(x==i)\n {\n printf(\"byte\");\n t=1;;\n }\n }\n if(t==0)\n {\n for(i=128;i<=32767;i++)\n {\n if(x==i)\n {\n printf(\"short\");\n t=1;\n }\n }\n }\n if(t==0)\n {\n for(i=32768;i<=2147483647;i++)\n {\n if(x==i)\n {\n printf(\"int\");\n t=1;\n }\n }\n }\n if(t==0)\n {\n for(i=21474836;i<=9223372036854775807;i++)\n {\n if(x==i)\n {\n printf(\"long\");\n t=1;\n }\n }\n if(t==0)\n {\n printf(\"BigInteger\");\n }\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8ba3129d58e3e5d88d1262d2d7ca3e86", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "73be4c21cca14cc67f4d769e3d463f7d", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9982608695652174, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n char c, numero[21];\n int n = 0;\n\n scanf(\"%[^\\n]\",numero);\n\n //printf(\"%d\",strlen(numero));\n n=strlen(numero);\n\n if(((strcmp(numero, \"127\")) <= 0 && n <= 3) || n < 3)\n {\n printf(\"byte\");\n return 0;\n }\n if(((strcmp(numero, \"32767\")) <= 0 && n <= 5) || n < 5)\n {\n printf(\"short\");\n return 0;\n }\n if(((strcmp(numero, \"2147483647\")) <= 0 && n <= 10) || n < 10)\n {\n printf(\"int\");\n return 0;\n }\n if(((strcmp(numero, \"9223372036854775807\")) <= 0 && n <= 19) || n < 19)\n {\n printf(\"long\");\n return 0;\n }\n else\n {\n printf(\"BigInteger\");\n return 0;\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8fd5c6569088a4ce87aa5f9a3661848e", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "b52dbb00005a3606a571d52f2b2a9f34", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9986702127659575, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint arr[101],no[101],l[100];\nint main()\n{\n\tint n,m,source,desti,temp,flag,k,i;\n\tscanf(\"%d %d\",&n,&m);\n\tfor(i=0;i\nint main()\n{\n\nwhile(1)\n {\n \tint n;\n\tscanf(\"%d\",&n);\n\tint a[n],i,sum=0;\n\tfor(i=0;i\n#include \n#include \nint sum(char *p,int n)\n{\n int i=0,ans=0;\n for(i=0;ilens)\n\t\tres=0;\n\telse\n if(!strcmp(s,t))\n\t\tres=1;\n\telse\n if(lent==lens)\n\t{\n\t total=sum(s,lent);\n\t if(total==all)\n\t\tres=2;\n\t else\n\t res=0;\n\t}\n\telse\n {\n p=s;\n while(lens-(p-s)>=lent)\n\t\t{\n memcpy(tmp,p,sizeof(char)*lent);\n if(!strcmp(tmp,t))\n\t\t\t{\n\t\t\t\tres=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tp++;\n\t\t}\n\t\tif(!res)\n\t\t{\n pp=strchr(s,t[0]);\n *pp='*';\n for(i=1;i\n\nint main()\n{\n while(1)\n {\n int hh,mm,m,h,tm,th;\n scanf(\"%d : %d\",&hh,&mm);\n scanf(\"%d : %d\",&h,&m);\n if(hh>=0 && hh<=23 && mm>=0 && mm<=59)\n {\n if(m>mm)\n {\n mm=mm+60;\n if(hh==0)\n {\n hh=24;\n }\n hh=hh-1;\n }\n tm=mm-m;\n if(hh==0)\n {\n hh=24;\n }\n th=hh-h;\n if(th==24){\n th=00;\n }\n if(th<=9 && tm>9){\n printf(\"0%d:%d\",th,tm);\n }\n if(th>9 && tm>9)\n {\n printf(\"%d:%d\",th,tm);\n }\n if(th>9 && tm<=9){\n printf(\"%d:0%d\",th,tm);\n }\n if(th<=9 && tm<=9){\n printf(\"0%d:0%d\",th,tm);\n }\n\n\n }\n}\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f1dd5c0316eebddab286b6dac17aea42", "src_uid": "595c4a628c261104c8eedad767e85775", "apr_id": "ce31d6821f1101a2444553092afcf839", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9694971145919209, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#define M 1000003\n\nint main()\n{\n int i=0;\n long int x=0;\n char s[105],c;\n scanf(\"%s\",s);\n c=s[i];\n while(c!='\\0')\n {\n if(c=='>')\n x=(x*16)%M+8;\n else if(c=='<')\n x=(x*16)%M+9;\n else if(c=='+')\n x=(x*16)%M+10;\n else if(c=='-')\n x=(x*16)%M+11;\n else if(c=='.')\n x=(x*16)%M+12;\n else if(c==',')\n x=(x*16)%M+13;\n else if(c=='[')\n x=(x*16)%M+14;\n else\n x=(x*16)%M+15;\n }\n printf(\"%ld\",(x%M));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "24078c6c41dc87774af057274be153e4", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "e8aea88da72d12e9a33a06e16e96d5d2", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3345132743362832, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "#include\nint main()\n{\n\tint n,w[1005]={},W,i;\n\tscanf(\"%d\",&n);\n\tfor (i=0;i0)\n\t\t{\n\t\t\tif (last==-1)\n\t\t\t\tlast=i;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (i-last>max)\n\t\t\t\t\tmax=i-last;\n\t\t\t\tsum+=i-last;\n\t\t\t\tlast=-1;\n\t\t\t}\n\t\t\tw[i]--;\n\t\t}\n\tsum-=max;\n\tprintf(\"%d\\n\",sum);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "370778c5ba70ab46f12112c1093c9b23", "src_uid": "76659c0b7134416452585c391daadb16", "apr_id": "21bad528bba1cc940301f3c02a60301c", "difficulty": 1500, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994729907773386, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n\tint n,w[55]={},W,i,j,t;\n\tscanf(\"%d\",&n);\n\tn*=2;\n\tfor (i=0;iw[j+1])\n\t\t\t{\n\t\t\t\tt=w[j];\n\t\t\t\tw[j]=w[j+1];\n\t\t\t\tw[j+1]=t;\n\t\t\t}\n\tint copy[55]={};\n\tvoid cp(int wo1,int wo2)\n\t{\n\t\tint k;\n\t\tfor (k=0;k\n#define MOD 998244353\nlong long int n,m,k,number_of_ways;\nlong long int ways[2000][2000];\nlong long int Ways(int edges,int k)\n{\n if(ways[edges][k]!=-1)\n {\n return ways[edges][k];\n }\n if(k==0) return m-1;\n long long number_of_ways=0,make_a_way;\n int i;\n for(i=1;i<=edges-k+1;i++)\n {\n make_a_way=m-1;\n make_a_way=(make_a_way*Ways(edges-i,k-1))%MOD;\n number_of_ways=(number_of_ways+make_a_way)%MOD;\n }\n ways[edges][k]=number_of_ways;\n return number_of_ways;\n}\nint main()\n{\n int i,j;\n for(i=0;i<2000;i++)\n {\n for(j=0;j<2000;j++)\n {\n ways[i][j]=-1;\n }\n }\n scanf(\"%I64d %I64d %I64d\",&n,&m,&k);\n number_of_ways=m;\n if(k>0) number_of_ways=(number_of_ways*Ways(n-1,k))%MOD;\n printf(\"%I64d\",number_of_ways);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "14460a29183b429c571e84e19cfd4dbf", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "f1316e9e15245e321c107feeff9d5da4", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.366469305079464, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 19, "bug_source_code": "#include\n#define MOD 998244353\nlong long int n,m,k,number_of_ways;\nlong long int ways[2000][2000];\nlong long int Ways(int edges,int k)\n{\n if(ways[edges][k]!=-1)\n {\n return ways[edges][k];\n }\n if(k==0) return 1;\n long long number_of_ways=0,make_a_way;\n int i;\n for(i=1;i<=edges-k+1;i++)\n {\n make_a_way=m-1;\n make_a_way=(make_a_way*Ways(edges-i,k-1))%MOD;\n number_of_ways=(number_of_ways+make_a_way)%MOD;\n }\n ways[edges][k]=number_of_ways;\n return number_of_ways;\n}\nint main()\n{\n int i,j;\n for(i=0;i<2000;i++)\n {\n for(j=0;j<2000;j++)\n {\n ways[i][j]=-1;\n }\n }\n scanf(\"%I64d %I64d %I64d\",&n,&m,&k);\n number_of_ways=m;\n number_of_ways=(number_of_ways*Ways(n-1,k))%MOD;\n printf(\"%I64d\",number_of_ways);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "119639a7cdf9008ea4ba243fe5c02a44", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "f1316e9e15245e321c107feeff9d5da4", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.938101788170564, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main()\n{\n int i,n,x[101];\n scanf(\"%d\",&n);\nfor (i=0;i\n#include\n#define N 102\nint main() {\n char s[N];\n scanf(\"%s\",s);\n int kr=0,kb=0,ky=0,kg=0;\n int n=strlen(s);\n int i;\n //1111\n //rbyg\n int count[N];\n int position[N];\n while(1){\n int find=0;\n for(i=0;i0)find=1;\n if(count['!']==1){\n if(count['R']==0){ s[position['!']]='R';kr++; }\n if(count['B']==0){ s[position['!']]='B';kb++; }\n if(count['Y']==0){ s[position['!']]='Y';ky++; }\n if(count['G']==0){ s[position['!']]='G';kg++; }\n }\n }\n if(!find)break;\n }\n printf(\"%d %d %d %d\\n\",kr,kb,ky,kg);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4fae1e95fce5b907fe06610a578824db", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "6d10a4ede4fb580b7a8dd1d56f7c354b", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2863247863247863, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "#include \nusing namespace std;\n\nint main() {\n\tint test;\n\tchar inp[11];\n\tint check=0;\n\tscanf (\"%d\\n\", &test );\n\tgets(inp);\n\tfor (int x=0;x=2)printf(\"YES\\n\");\n\telse printf(\"NO\\n\");\n}\n", "lang": "GNU C", "bug_code_uid": "89c8a6fb11b08a56783143c13b486698", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "860af278fb62adcb9d58953af2a269f6", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9260450160771704, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \nint gcd (int x, int y);\nint main(void){\n\tint a,b,c;\n\tint x,y,z;\n\tint sum=0;\n\tscanf(\"%d%d%d\",&a,&b,&c);\n\tfor (x=1; x<=a;x++)\n\t\tfor (y=1;y<=b;y++)\n\t\t\tfor(z=1;z<=c;z++)\n\t\t\t{\n\t\t\t\tif (x*y==a&&x*z==c&&y*z==b)\n\t\t\t\t{\n\t\t\t\t\tsum=x+y+z;\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t}\n\tout:\n\tprintf(\"%d\",sum*4);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "e3844e519209bf34b50adcab035fbedb", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "52afd32008342e498ae481eae314f0f8", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.37003058103975534, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n long a,b,c,i,j;\n while(scanf(\"%ld%ld%ld\",&a,&b,&c))\n {\n i=0;\n j=1;\n while(a*(b*j)<=c)\n {\n i++;\n j++;\n }\n printf(\"%d\\n\",i);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e7b1aff91a300fd1ea6bd2fec905b063", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "16df03471a2359504468f3d19484d0bd", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9547738693467337, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n\tint n,m,z,i,j,k,count=0;\n\twhile(scanf(\"%d%d%d\",&n,&m,&z))\n\t{\n\t\tfor(i=1;i<=z;i++)\n\t\t{\n\t\t\tif(i%n==0&&i%m==0)\n\t\t\tcount++;\n\t\t}\n\t\tprintf(\"%d\\n\",count);\n\t\tcount=0;\n\t}\n\treturn 0;\n } ", "lang": "GNU C", "bug_code_uid": "e2644f3c1f7b7d4a93f38123c1b16818", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "41509b6aef9b8b9c78164264a7911c66", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9785407725321889, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint n;\nchar map[10][11];\n\nint wolf(int i, int j)\n{\n return (i >= 0 && i < n && j >= 0 && j < n && map[i][j] == 'W');\n}\n\nint main(int argc, char *argv[])\n{\n int i, j, c = 0;\n \n scanf(\"%d\", &n);\n for(i = 0; i < n; i ++)\n scanf(\"%s\", map[i]);\n \n for(i = 0; i < n; i ++)\n for(j = 0; j < n; j ++)\n if(map[i][j] == 'P')\n {\n if(wolf(i - 1, j))\n map[i - 1][j] = '.', c ++;\n else if(wolf(i + 1, j))\n map[i + 1][j] = '.', c ++;\n else if(wolf(i, j - 1))\n map[i][j - 1] = '.', c ++;\n else if(wolf(map[i][j + 1]))\n map[i][j + 1] = '.', c ++;\n }\n \n printf(\"%d\\n\", c);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "11f7c58945effab3fd0403c34918de35", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "1332eb96da58f6664740abf7d22ed0fe", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.25, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n\nint main()\n{\n \n char s[105],t[105];\n int n;\n scanf(\"%d\",&n);\n gets(t);\n \n int j;\n int i=0;\n s[i++] = t[0];\n int k;\n for(k=2;k\nint main()\n{\n int a[2],i,j,k,temp,sum,sum1,max;\n for(i= 0; i < 3; i++)\n {\n scanf(\"%d\",&a[i]);\n }\n for(i = 0; i < 2; i++)\n {\n k = i;\n for(j = i; j < 3; j++)\n {\n if(a[k] > a[j])\n {\n k = j;\n }\n }\n temp = a[k];\n a[k] = a[i];\n a[i] = temp;\n }\n sum = (a[0] + a[1]) * a[2];\n sum1 = a[0] * a[1] * a[2];\n if(sum > sum1)\n {\n max = sum;\n }\n else\n {\n max = sum1;\n }\n printf(\"%d\",max);\n return 0;\n\n}", "lang": "GNU C11", "bug_code_uid": "f6a4fed85b22cfe848063e0ed28a9ad4", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "b0435a8d4960d2d4c955b7a5372512f6", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9036501150937192, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\ntypedef long long unsigned llu;\ntypedef unsigned u;\ntypedef struct S\n{\n\tu val,ki,ka,min,max;llu sum;\n\tstruct S *lc,*rc;\n}v;\nv*alloc(u ki,u ka,u val)\n{\n\tv*x;\n\tx=(v*)malloc(sizeof(v));\n\tx->val=val;\n\tx->min=val;\n\tx->max=val;\n\tx->ki=ki;\n\tx->ka=ka;\n\tx->sum=(ka-ki+1)*(llu)val;\n\tx->lc=x->rc=NULL;\n\treturn x;\n}\nllu que(v *x,u lo,u hi)\n{\n//\tprintf(\"que %u %u\\n\",lo,hi);\n\tif(hiki||lo>x->ka)\n\t{\n//\t\tprintf(\"return 0\\n\");\n\t\treturn 0;\n\t}\n\tif(lo<=x->ki&&hi>=x->ka)\n\t{\n//\t\tprintf(\"Return %I64u\\n\",x->sum);\n\t\treturn x->sum;\n\t}\n\tu ll,rr;\n\tif(x->val)\n\t{\n\t\tll=loki?x->ki:lo;\n\t\trr=hi>x->ka?x->ka:hi;\n\t\tif(rrval=%u\\n\",ll,rr,x->val);\n\t\treturn(rr-ll+1)*(llu)x->val;\n\t}\n\tllu a=que(x->lc,lo,hi)+que(x->rc,lo,hi);\n//\tprintf(\"Retu5n %I64u\\n\",a);\n\treturn a;\n}\nvoid set(v *x,u lo,u hi,u val)\n{\n//\tprintf(\"set [%u %u] %u %u %u\\n\",x->ki,x->ka,lo,hi,val);\n\tif(hiki||lo>x->ka||x->min>=val)\n\t{\n//\t\tprintf(\"return %u<%u || %u>%u || %u>=%u\\n\",hi,x->ki,lo,x->ka,x->min,val);\n\t\treturn;\n\t}\n\tif(lo<=x->ki&&hi>=x->ka&&x->max<=val)\n\t{\n//\t\tprintf(\"chg %u %u -> %u\\n\",x->ki,x->ka,val);\n\t\tx->val=x->min=x->max=val;\n\t\tx->sum=val*(llu)(x->ka-x->ki+1);\n\t\treturn;\n\t}\n\tu m;\n\tif(x->val)\n\t{\n\t\tif(val<=x->val)\n\t\t{\n//\t\t\tprintf(\"small return\\n\");\n\t\t\treturn;\n\t\t}\n//\t\tprintf(\"split!\\n\");\n\t\tm=(x->ki+x->ka)>>1;\n\t\tif(!x->lc)x->lc=alloc(x->ki,m,x->val);\n\t\tif(!x->rc)x->rc=alloc(m+1,x->ka,x->val);\n\t\tx->val=0;\n\t}\n\tset(x->lc,lo,hi,val);\n\tset(x->rc,lo,hi,val);\n\tif(x->lc->val&&x->lc->val==x->rc->val)\n\t{\n//\t\tprintf(\"unit!\\n\");\n\t\tx->val=x->lc->val;\n\t\tx->sum=x->val*(llu)(x->ka-x->ki+1);\n\t}\n\telse x->sum=x->lc->sum+x->rc->sum;\n\tx->min=x->lc->min;\n\tx->max=x->rc->max;\n\treturn;\n}\nv *p;\nu A[222222],F[222222],G[222222];\nint main()\n{\n\tu n,h,i,j,k,x;llu r;\n\tscanf(\"%u\",&n);\n\tif(n<=2){printf(\"0\\n\");return 0;}\n\tp=alloc(0,n,1);\n\tfor(i=0;++i<=n;A[i]=x)\n\t{\n\t\tscanf(\"%u\",&x);h=0;\n\t\tfor(j=1;j*j<=x;++j)if(x%j==0)\n\t\t{\n\t\t\tif(!F[j])F[j]=i;\n\t\t\telse if(h1;--i)\n\t{\n\t\tx=A[i];h=0;\n\t\tfor(j=1;j*j<=x;++j)if(x%j==0)\n\t\t{\n\t\t\tif(!G[j])G[j]=i;\n\t\t\telse if(h\n#include\nint gcd(int a,int b){\nif(a==0) return b;\nelse gcd(b%a,a);}\nint main(){\nint a,b,c,temp;\nint no1,no2,count1=0,count2=0;\nscanf(\"%d %d\",&a,&b);\nif(a>b) {temp=a;a=b;b=temp;}\nc=gcd(a,b);\nno1=a/c;\nno2=b/c;\nwhile(1){\nif (no1%2==0){\ncount1++;\nno1=no1/2;\ncontinue;}\nif (no1%3==0){\ncount1++;\nno1=no1/3;\ncontinue;}\nif (no1%5==0){\ncount1++;\nno1=no1/5;\ncontinue;}\nbreak;}\nwhile(1){\nif (no2%2==0){\ncount2++;\nno2=no2/2;\ncontinue;}\nif (no2%3==0){\ncount2++;\nno2=no2/3;\ncontinue;}\nif (no2%5==0){\ncount2++;\nno2=no2/5;\ncontinue;}\nbreak;}\nif (no1!=1 || no2!=1) printf(\"-1\");\nelse printf(\"%d\\n\",count1+count2);\n}\n\n", "lang": "GNU C", "bug_code_uid": "8529d09bea2ce8563df80f1f246473b5", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "c01da5bb5e4c503c59e04b97305884bf", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9104243059193295, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n#include\n//#include\nint gcd(int a,int b)\n{\n if(a<=b)\n {\n if(b%a==0)\n return a;\n else\n return gcd(a,b-a);\n }\n else\n {\n if(a%b==0)\n return b;\n else return gcd(a-b,b);\n }\n}\nint main()\n{\n int a,b,hcf,flag=0,c=0;\n scanf(\"%d%d\",&a,&b);\n if(a==b)\n printf(\"0\\n\");\n else\n {\n hcf=gcd(a,b);\n //printf(\"%d\",hcf);\n a=a/hcf;b=b/hcf;\n while(a!=1)\n {\n if(a%2==0) {a=a/2;c++;}\n else if(a%3==0) {a=a/3;c++;}\n else if(a%5==0) {a=a/5;c++;}\n else {flag=1;break;}\n }\n a=b;\n while(a!=1)\n {\n if(a%2==0) {a=a/2;c++;}\n else if(a%3==0) {a=a/3;c++;}\n else if(a%5==0) {a=a/5;c++;}\n else {flag=1;break;}\n }\n if(flag==1) printf(\"-1\");\n else printf(\"%d\\n\",c);\n }\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "8710cd12d1f2d9fa77d15f61d18d5d30", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "2eec14b3e7e54ede67fd0f3b5a14efef", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9711286089238845, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main()\n{\n\tint digit_flaws[10]={2,7,2,3,3,4,2,5,1,2},n,ans=1;\n\tscanf(\"%d\",&n);\n\twhile(n>-1)\n\t{\n\t\tans*=digit_flaws[n%10];\n\t\tn/=10;\n\t}\n\tprintf(\"%d\",ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "9e2b661511f1e84c9d865620b8d28849", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "e65c86284ee1153e495dacb88e9d08d1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.14891041162227603, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n\t { long long int x,n,a1,b1,a,b,c;\n\t\t c=1; \n\t\t scanf(\"%lld%lld%lld\",&n,&a,&b);\n\t\t x=n; a1=a*4; b1=b*2;\n\t\twhile(a1>0)\n\t\t{ while(n>0&&a1>0)\n\t\t\t{ n=n-a;\n\t\t\t\ta1=a1-a; }\n\t\t\tif(n<=0)\n\t\t\t{a1=a1+a;\n\t\t\t\t c++; \n\t\t\tn=x;}\n }\n\t\t while(b1>0)\n\t\t\t { while(n>0&&b1>0)\n\t\t\t\t { n=n-b;\n\t\t\t\t\tb1=b1-b ; }\n\t\t\t\tif(n<0)\n\t\t\t\t{b1=b1+b;\n\t\t\t\t\t c++; }\n\t\t\t n=x; }\n\t\t printf(\"%lld\\n\",c);\n\t\t return 0 ; }\n", "lang": "GNU C", "bug_code_uid": "f1987685e6da723f6e051a9192257a71", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "3aff17c039af2352cb00c5d3d14ec506", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6911595866819747, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint main()\n{\n long k,i,p,q,j,s,r,t,h,f ;\n scanf (\"%ld\",&k) ;\n s=0;\n j=0 ;\n i=0 ;\n while (i!=k)\n {\n j=j+1 ;\n p=(j%10000)/1000 ;\n q=(j%100000)/10000 ;\n r=(j%1000)/100 ;\n h=j%10 ;\n t=(j%100)/10 ;\n f=(j/100000) ;\n if ((p+q+h+r+t+f)==10)\n {\n i=i+1 ;\n s=j ;\n\n }\n }\n printf (\"%ld\",s) ;\n return 0 ;\n}\n", "lang": "GNU C11", "bug_code_uid": "8199ad82ac6036103d737197cf600022", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "503afa7ccd75842fc5831e41a9facad3", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9983416252072969, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int a[n+1],i,;\n for(i=1;i<=n;i++)\n {\n scanf(\"%d\",&a[i]);\n }\n int u,units=0;\n\n for(i=1;i<=n;i++)\n {\n u=(i-1)*4;\n units=units+u*a[i];\n }\n printf(\"%d\",units);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0e62c07933cbd66580bb7dbea395f7a4", "src_uid": "a5002ddf9e792cb4b4685e630f1e1b8f", "apr_id": "711b9d380102828f22b88e5939e716ce", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.988, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main(void)\n{\n int n,i,j=0;\n scanf(\"%d\", &n);\n int k[n]\n for(i=0;i\nusing namespace std;\n \n#define ll long long\n\nlong long aa = (long long)1e16;\n\nint main() {\n ll x0, y0, ax, bx, by, ay;\n ll xs, ys, t;\n cin >> x0 >> y0 >> ax >> ay >> bx >> by;\n cin >> xs >> ys >> t;\n vector> arr;\n int counter = 1;\n arr.push_back(make_pair(x0, y0));\n while(arr[counter - 1].first < aa && arr[counter - 1].second < aa) {\n arr.push_back(make_pair(ax * arr[counter - 1].first + bx, ay * arr[counter - 1].second + by));\n counter++;\n }\n // sort(arr.begin(), arr.end());\n bool a[arr.size()];\n ll myMin = aa;\n int index = -1;\n for(int i = 0; i < arr.size(); i++) {\n ll temp = abs(arr[i].first - xs) + abs(arr[i].second - ys);\n if(temp < myMin) {\n index = i;\n myMin = temp;\n }\n }\n t -= abs(arr[index].first - xs) + abs(arr[index].second - ys);\n if(t < 0) {\n cout << 0;\n return 0;\n }\n xs = arr[index].first;\n ys = arr[index].second;\n int ct = 1;\n for(int i = 0; i < arr.size(); i++) {\n a[i] = false;\n }\n a[index] = true;\n while(t > 0 && ct <= arr.size()) {\n myMin = aa;\n for(int i = 0; i < arr.size(); i++) {\n if(!a[i]) {\n ll temp = abs(arr[i].first - xs) + abs(arr[i].second - ys);\n if(temp < myMin) {\n index = i;\n myMin = temp;\n }\n }\n }\n a[index] = true;\n ct++;\n t -= abs(arr[index].first - xs) + abs(arr[index].second - ys);\n xs = arr[index].first;\n ys = arr[index].second;\n }\n cout << ct;\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "0209fecbdf6068aa9ea99ead1e83c2dd", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "d0838fd668a0127b34e5f25da5d5fcc2", "difficulty": 1700, "tags": ["geometry", "greedy", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2507042253521127, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \"stdio.h\"\n#include \"stdlib.h\"\n\nint main(int argc, char* argv[])\n{\n int **a;\n int m,x,i,j;\n int count=0;\n scanf(\"%d%d\",&m,&x);\n a=(int**)malloc(sizeof(int*)*m);\n for(i=0;i\n#include \n#include \n\nint main()\n{\n \n int n,x;\n scanf(\"%d %d \", &n , &x);\n \n int** mtx; \n mtx = malloc(n*sizeof(*mtx));\n for(int i=1;i<=n;i++)\n mtx[i] = malloc(n*sizeof(**mtx));\n \n \n int occur = 0;\n for(int i=1;i<=n;i++)\n {\n for(int j=1;j<=n;j++)\n {\n mtx[i][j]= i*j;\n if (mtx[i][j] == x)\n occur++;\n }\n }\n \n printf(\"%d\", occur);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "9d81b76499981fe7ef535f4d925fa4ca", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "907fd06983bf6430e3d72dfa7cacdd3f", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.614950634696756, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int y,a,b,c,d;\n scanf(\"%d\",&y);\n while(1)\n {\n y++;\n a=y%10;\n y=y/10;\n b=y%10;\n y=y/10;\n c=y%10;\n y=y/10;\n d=y;\n if (a!=b && a!=c && a!=d && b!=c && b!=d && c!=d)\n {\n break;\n }\n }\n\n printf(\"%d%d%d%d\",d,c,b,a);\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1ac8dd34b2575033ffee0adc604b97b4", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "02559f1e3f6fba9b10907015cf4c1473", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2284434490481523, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n\tlong long n, m, s;\n\tscanf(\"%lld %lld %lld\", &n, &m, &s);\n\tint y = 0, flag = 0,t;\n\tif (s <= n - 1)\n\t{\n\t\tprintf(\"1 %d\", s + 1);\n\t}\n\telse\n\t{\n\t\ts = s - n + 1;\n\t\twhile (s!=0)\n\t\t{\n\t\t\tif (flag == 0) t = 1;\n\t\t\telse t = 2;\n\t\t\tif (s <= m - t)\n\t\t\t{\n\t\t\t\tprintf(\"%lld %lld\", n, s + 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ts = s - m + t;\n\t\t\t\tif (n == 1)\n\t\t\t\t{\n\t\t\t\t\ty = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tn--;\n\t\t\t\tif (s == 1)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld %lld\", n, m);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ts--;\n\t\t\t\t\tif (s <= m - 2)\n\t\t\t\t\t{\n\t\t\t\t\t\tprintf(\"%lld %lld\", n, m - s);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s - m + 2;\n\t\t\t\t\t\tif (n == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ty = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t--n;\n\t\t\t\t\t\tif (s == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprintf(\"%lld %lld\",n, m);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ts--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tflag = 1;\n\t\t}\n\t\tif (y == 1) printf(\"1 %lld\", n);\n\t\tif (y == 2) printf(\"1 2\");\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ef22156108741f224818bf5bff31d7ed", "src_uid": "e88bb7621c7124c54e75109a00f96301", "apr_id": "da7402ee20a829187755513e41fe4027", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8109567901234568, "equal_cnt": 15, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 14, "bug_source_code": "#include \n#include \n#include \n#include \nlong long int mmax(long long int a,long long int b){\n if(a>b) return a;\n else return b;\n}\nlong long int fun(long long int i){\n return (i*(i+1))/2;\n}\nlong long int target;\nlong long int binSearch(long long int i,long long int j){\n long long int mid;\n while (i\nint a[10];\nint main()\n{\n\tint j,store[10000];\n\tint i,d;\n\tint ch;\t\nint k;\nk=0;\nch=getchar();\na[ch-'0']++;\nwhile((ch=getchar())!='\\n'){\n\ta[ch-'0']++;\n}\nd=1;\nA:\nfor(i=0;i<=9;i++){\n\tif(a[0]==0||d==0){\n\tfor(j=0;j\n#include\n#define N 35\nint main(){\n char s[N];\n scanf(\"%s\",s);\n int n=strlen(s);\n int i;\n int answer=(n-1)/2;\n for(i=1;i\n#include \nint count[100];\nint cmp (const void *a , const void *b){\n return *(int *)b - *(int *)a;\n}\n\nint main(void){ \n memset(count, 0, 100 * sizeof(int));\n int n, p, c[100], d = 0, sum = 0;\n scanf(\"%d%d\", &n, &p);\n for(int i = 0; i < n; i++){\n scanf(\"%d\", &c[i]);\n sum += c[i];\n }\n if(sum < p){\n printf(\"-1\\n\");\n return 0;\n }\n sum = 0;\n qsort(c, n, sizeof(int), cmp);\n int index = 0;\n for(int k = 0; index < n && sum < p; k++, d++){\n for(int i = 0; i < n; i++){\n if(c[index] - i > 0){\n sum += c[index] - i, index++, count[k]++;\n if(sum >= p){\n printf(\"%d\\n\", d + 1);\n return 0;\n }\n }\n else break;\n }\n }\n while(d <= n){\n for(int i = 0; i <= d; i++){\n while(count[i] >= count[i + 1]){\n int j = 0;\n while(count[i] <= count[j]) j++;\n if(j > d) d = j;\n count[j]++, sum += count[i] - count[j], count[i]--;\n if(sum >= p){\n printf(\"%d\\n\", d + 1);\n return 0;\n }\n }\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6038de83f5d8d2e4b894fedf326edee2", "src_uid": "acb8a57c8cfdb849a55fa65aff86628d", "apr_id": "eda243100cf8fef79cef4c070df25bfb", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9921581997954313, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint a[100];\nvoid qs(int first, int last)\n \n{\n if (first < last)\n {\n int left = first, right = last, middle = a[(left + right) / 2];\n do\n {\n while (a[left] < middle) left++;\n while (a[right] > middle) right--;\n if (left <= right)\n {\n int tmp = a[left];\n a[left] = a[right];\n a[right] = tmp;\n left++;\n right--;\n }\n } while (left <= right);\n qs( first, right);\n qs( left, last);\n }\n}\n \n \nint main() {\n int n,l,r,sum,t,middle,in,i,j;\n long long int m;\n scanf(\"%i %lld\",&n,&m);\n for (int i=1;i<=n;++i) scanf(\"%i\",&a[i]);\n qs(1,n);\n \n l=1;\n r=n;\n \n while(l<=r){\n sum=0;\n t=n;\n middle=(l+r)/2;\n (n % middle==0)?(in= n / middle):(in=( n / middle)+1);\n for(i=0;i=1;j++){\n if (a[t] - i > 0)\n sum = sum + a[t] - i;\n t--;\n }\n }\n if(sum==m){\n l=middle;\n r=middle;\n break;\n }\n else if(sum= 0)){\n if((l+r)%2!=0)\n printf(\"%d\",(l+r)/2+1);\n else\n printf(\"%d\",(l+r)/2);\n }\n else printf(\"-1\");\n return 0;\n ", "lang": "GNU C11", "bug_code_uid": "e372253fbd2c36e3ef08662e13b32313", "src_uid": "acb8a57c8cfdb849a55fa65aff86628d", "apr_id": "7d4c0050035d5b2a5e4130551dda9169", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9825145711906744, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define INF ~0ULL\n#define ULL unsigned long long\nusing namespace std;\nULL p[16] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};\nULL n, ans;\nvoid dfs(ULL depth, ULL temp, ULL num, ULL up)\n{\n if (num == n && temp < ans) ans = temp;\n if (num >= n || depth == 16) return;\n for (int i = 1; i <= up; ++i)\n {\n if (temp * p[depth] >= ans) return;\n else dfs(depth + 1, temp = temp * p[depth], num * (i + 1), i);\n }\n}\nint main()\n{\n while (scanf(\"%llu\", &n) != EOF)\n {\n ans = INF;\n dfs(0, 1, 1, 64);\n printf(\"%llu\\n\", ans);\n }\n}", "lang": "GNU C11", "bug_code_uid": "ab1ceb4e55323faa435c415d331a5670", "src_uid": "62db589bad3b7023418107de05b7a8ee", "apr_id": "52acaa365ebe0834fba33f36d6487e80", "difficulty": 2000, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.12190914318573894, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include \nint main()\n{\n long long int x1,x2,x3,y1,y2,y3,ab,bc;\n scanf(\"%lld %lld %lld %lld %lld %lld\",&x1,&y1,&x2,&y2,&x3,&y3);\n if((x1-x2)==0)\n {\n if(y2y2)\n {\n ab=0;\n }\n else{ab=1001;\n }\n\n }\n else\n {\n ab=(y1-y2)/(x1-x2);\n }\n\n if((x2-x3)==0)\n {\n if(y3bc)\n {\n printf(\"RIGHT\\n\");\n }\n else\n {\n printf(\"LEFT\\n\");\n }\n }\n }\n\n ", "lang": "GNU C", "bug_code_uid": "fc12105def216a47d77a405c78f914c5", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "38f1eb893839a1143bf44f8b53a441ae", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9995389580451821, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\n#include\n\n#define mset(a) memset(a,0,sizeof(a))\n#define mcpy(a,b) memcpy(a,b,sizeof(a))\n#define mcmp(a,b,n) memcmp(a,b,n)\n#define maxint 2147483647\n#define pi 3.14159265358979323846\n\nlong long n,t,ans=0,k;\nlong long a[111],cnk[111][111];\n\nlong long turn(long long t)\n{\n long long i=0;\n \n if(t&(t-1))\n return -1;\n \n while(t>>=1)\n i++;\n return i;\n}\n\nint main()\n{\n int i,j,l;\n \n a[0]=1;\n for(i=1;i<63;i++)\n a[i]=a[i-1]<<1;\n mset(cnk);\n for(i=0;i<111;i++)\n {\n cnk[i][0]=1;\n for(j=1;j<=i;j++)\n cnk[i][j]=cnk[i-1][j-1]+cnk[i-1][j];\n }\n \n scanf(\"%I64d%I64d\",&n,&t);\n \n k=turn(t);\n if(k==-1)\n {\n printf(\"0\\n\");\n return 0;\n }\n \n for(i=1;n>a[i];i++)\n {\n ans+=cnk[i][k];\n n-=a[i];\n }\n for(i=62;i>0;i--)\n if((~k)&&(n>>i&1))\n {\n ans+=cnk[i][k];\n k--;\n }\n \n printf(\"%I64d\\n\",ans);\n \n //system(\"pause\");\n return 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "e74e778ce1755d651dacb31c4080eb54", "src_uid": "727d5b601694e5e0f0cf3a9ca25323fc", "apr_id": "ec90bfa0f70726f6ae92d94510bcda0c", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9601081812035159, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n\n int n;\n int m;\n scanf(\"%d %d\", &n, &m);\n\n int i;\n int storage[n];\n\n for(i=0; i=storage[i]){\n storage[i]=-1;\n counter++;\n }\n if(counter==n-1){\n break;\n }\n if(i==n-1){\n i=0;\n }\n else{\n i++;\n }\n }\n for(i=0; i\n#include \n\nint main(){\n\tint vet[200];\n\tint id[100];\n\tint i, j;\n\tint n, m;\n\tint cont_fila=0;\n\tint total, limit;\n\t\n\tscanf(\"%d %d\", &n, &m);\n\t\n\ttotal = n;\n\t\n\twhile(total > 1){\n\t\tfor(i = 0; i < 200; i++){\n\t\t\tvet[i] = 0;\n\t\t\tid[i] = i;\n\t\t}\n\t\t\n\t\tfor(i = 0; i < n; i++){\n\t\t\tscanf(\"%d\", &vet[i]);\n\t\t}\n\t\t\n\t\tfor(i = 0; i < n; i++){\n\t\t\tif(vet[i] > m){\n\t\t\t\n\t\t\t\tvet[i] -= m;\n\t\t\t\tvet[cont_fila+100] = vet[i];\n\t\t\t\tid[i] = cont_fila + 100;\n\t\t\t\tvet[i] = 0;\n\n\t\t\t\t\n\t\t\t\tcont_fila++;\n\t\t\t}\n\t\t\telse if(vet[i] != 0 && vet[i] <= m){\n\t\t\t\n\t\t\t\tvet[i] = 0;\n\t\t\t\ttotal--;\n\t\t\t\t\n\t\t\t\tif(total == 1){\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tlimit = 100 + cont_fila;\n\t\tcont_fila = 0;\n\t\t\n\t\tfor(i = 100; i < limit; i++){\n\t\t\tif(vet[i] > m){\n\t\t\t\t\n\t\t\t\tvet[i] -= m;\n\t\t\t\tvet[cont_fila] = vet[i];\n\t\t\t\tid[i] = cont_fila + 100;\t\t\t\t\n\t\t\t\tvet[i] = 0;\n\t\t\t\n\t\t\t\t\n\t\t\t\tcont_fila++;\n\t\t\t}\n\t\t\telse if(vet[i] != 0 && vet[i] <= m){\t\t\t\n\t\t\t\tvet[i] = 0;\t\t\t\n\t\t\t\ttotal--;\n\t\t\t\n\t\t\t\tif(total == 1){\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\t\n\t}\n\t\n\tfor(i = 0; i < 200; i++){\n\t\tif(vet[i] != 0){\n\t\t\tfor(j = 0; j < n; j++){\n\t\t\t\tif(i == id[j]){\n\t\t\t\t\tprintf(\"%d\\n\", j+1);\t\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\t\n\treturn 0;\n}\n/* 1522078044284 */\n", "lang": "GNU C", "bug_code_uid": "e8de33325de80697f3525fbf825e58ef", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "7332f889180a80ea1ac98e46301ee5e2", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6976190476190476, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint compare(const void *a,const void *b)\n{\n\treturn (*(int *)a-*(int *)b);\n}\nint main()\n{\n int n,i,j=0,k,l;\n scanf(\"%d\",&n);\n int c[i],a[n],b[n];\n for(i=0;i\n\n#include\n#include\nint main()\n{\n int x,t,a,b,da,db,i,flag;\n int sum=0,less;\n scanf(\"%d%d%d%d%d%d\",&x,&t,&a,&b,&da,&db);\n sum+=a;\n for(i=0;ix){\n printf(\"NO\");break;\n }\n else\n {\n less=x-sum;\n while(t>1)\n {\n sum+=b-t*db;\n if(sum==less)\n flag+=1;\n else\n flag=0; \n }\n } \n if(flag=1)\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n return 0;\n}\n \n \n", "lang": "GNU C", "bug_code_uid": "be0548af80875c93c59f3421abffce53", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "13329c048c51e6604fdb4aa116883e86", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.407673860911271, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main()\n{\n\tint a,b=0,c=1,d=0,e=1;\n\tscanf(\"%d\",&a);\n\tb+=a;\n\twhile(b*e>c*d)\n\t{\n\t\td=b;\n\t\te=c;\n\t}\n\tprintf(\"%0.6lf\",d/e*1.0);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "495794052107e28bca3ce2653ed5fd19", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "69ec43eba0719e20269f52ba43077802", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3604887983706721, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n\nint main(){\n\tint test;\n\tint tcase[100];\n\tint k = 0;\n\tint total = 0;\n\tint totalA = 0 , totalE = 0;\n\t\n\tscanf(\"%d\" , &test);\n\tgetchar();\n\tfor(int i = 0; i < test ; i++){\n\t\tscanf(\"%d\", &tcase[i] );\n\t\ttotal = total + tcase[i];\n\t\t\n\t\tif(tcase[i] > k) k = tcase[i];\n\t}\n\t\n\tbool check = false;\n\tdo{\n\t\tfor(int i = 0 ; i< test ; i++){\n\t\t\ttotalA += (k-tcase[i]); \n\t\t}\n\t\tif(totalA < total){\n\t\t\tk++;\n\t\t\tcheck = true;\n\t\t}\n\t}while(check = true);\n\t\n\t\n\t\n\tprintf(\"%d\" , k);\n\t\n\t\n\t\n\t\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "8fb7256539e2a058c714e2283b992c86", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "4a6ed3c0a018f82978cdf682533b46b8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9882747068676717, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint main(void)\n{\n int bal;\n scanf(\"%d\", &bal);\n if(bal>0)\n {\n printf(\"%d\",bal);\n return;\n }\n if(bal<0)\n {\n int temp = (bal/100)*10 + (bal%10);\n printf(\"%d\",(temp>bal/10)?temp:bal/10);\n return;\n }\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "a885a314169634979e0dfaa14cf46d76", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "e2918e8e3ce714025aacec6fd8f194e8", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9404553415061296, "equal_cnt": 17, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 13, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n\n\nint tranfCartaParaOrdemDeCarta(char c) {\n\tswitch (c) {\n\t\tcase 'T': return 1;\n\t\tcase 'J': return 2;\n\t\tcase 'Q': return 3;\n\t\tcase 'K': return 4;\n\t\tcase 'A': return 5;\n\t\tdefault:\n\t}\n}\n\nvoid cardGame() {\n\tchar c, s[2][2];\n\n\tscanf(\"%c\", c);\n\tscanf(\"%s %s\", s[0], s[1]);\n\t\n\tif (s[0][1] == s[1][1])\n\t\tif (tranfCartaParaOrdemDeCarta(s[0][0]) > tranfCartaParaOrdemDeCarta(s[1][0]))\n\t\t\tprintf(\"YES\");\n\t\telse \n\t\t\tprintf(\"NO\");\n\telse if (s[0][1] == c)\n\t\tprint(\"YES\");\n\telse\n\t\tprintf(\"NO\");\n}\n\nint main(){\n\t\n\tcardGame();\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4a6a2937554d9777bc3b6c3007c3fee6", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "8c07af643a411a3b9627ddfb676925af", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3246268656716418, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n int n,w,k,i;\n scanf(\"%d\",&n);\n while(n)\n {\n scanf(\"%d%d%d\",&k,&n,&w);\n int sum=0;\n for(i=0;i<=w;i++)\n {\n sum+=k*i;\n }\n if(sum>=n)\n printf(\"%d\",sum-n);\n else\n printf(\"0\");\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "821847686840d84c131c3669395f2eee", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "8b1081aa34bbb13efad8a9cdcfbe7bcc", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16487455197132617, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int n,m,a,d,i,s;\n while(1)\n {\n s=0;\n scanf(\"%d %d\",&n,&m);\n for(i=0;i\nint main()\n{\nchar str[101];\nscanf(\"%s\",str);\nfor(int i=0;str[i]!='\\0';i++)\n{\nif(str[i]=='W' && str[i+1]=='U' && str[i+2]=='B')\n{\nprintf(\" \");\ni=i+2;\n}\nelse \n{\nprintf(\"%c\",str[i]);\n}\n}\n}", "lang": "GNU C11", "bug_code_uid": "c98277aa80f11334552824de482f9b38", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "3782524ddbb974952a309515fd658dbe", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7142857142857143, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int a,b,c,k=0,r=0,rem=0,count=0;\n double bf,dec;\n scanf(\"%d%d%d\",&a,&b,&c);\n bf=b/1.0;\n r=a%b;\n dec=r/bf;\n while(dec!=0)\n {\n dec*=10;\n rem=(int)dec%10;\n count++;\n if(rem==c)\n {\n k=1;\n break;\n }\n }\n if(k==1)\n printf(\"%d\",count);\n else\n printf(\"-1\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9ceb44c50c80dd67aacce55c2b56dfb7", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "68434c89ec177a1fc3f8eb34675ec991", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6657018813314037, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint a, b, c, s, ans;\nint main(){\n\tscanf(\"%d%d%d\", &a, &b, &c);\n\twhile (a < b){\n\t\ta *= 10;\n\t\tans++;\n\t}\n\ts = a;\n\tif (a / b != c) {\n\t\tans++;\n\t\ta = (a%b)*10;\n\t}\n\twhile (a/b!=c){\n\t\tif (a < b)a *= 10;\n\t\telse if (s == a){\n\t\t\tans = -1;\n\t\t\tbreak;\n\t\t}\n\t\telse a = (a%b)*10;\n\t\tans++;\n\t}\n\tprintf(\"%d\", ans);\n}", "lang": "GNU C11", "bug_code_uid": "c24e54539cad7a9a5e6b7958a4afd9ff", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "1826d6a7b68ca16189542f4e8256d970", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9404517453798767, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,e,e1,f,f1,g,g1,e2,f2,g2;\n scanf(\"%d %d %d\",&a,&b,&c);\n if(a<=3 || b<=2 || c<=2){\n if(a==1 && b>=2 && c>=2)\n printf(\"5\");\n else if(a==2 && b>=2 && c>=2)\n printf(\"6\");\n else if(a==1 && b>=1 && c==0)\n printf(\"2\");\n else if(a==1 && b==0 && c>=1)\n printf(\"2\");\n else if(a==1 && b>=1 && c>=1)\n printf(\"3\");\n else if(a==3 && b==1 && c>=2)\n printf(\"6\");\n else if(a==2 && b==0 && c==0)\n printf(\"2\");\n else if(a==2 && b==1 && c==0)\n printf(\"3\");\n else if(a==2 && c==1 && b==0)\n printf(\"3\");\n else if(a==2 && c==1 && b==1)\n printf(\"4\");\n else if(a>=3 && c==1 && b==1)\n printf(\"5\");\n else if(a>=3 && c==1 && b==2)\n printf(\"6\");\n else if(a>=3 && c==2 && b==1)\n printf(\"6\");\n else if()\n else\n printf(\"7\");\n }\n else{\n e=a/3;\n e1=a%3;\n e2=e+e1;\n f=b/2;\n f1=b%2;\n f2=f+f1;\n g=c/2;\n g1=c%2;\n g2=g1+g;\n if(e<=f && e<=g){\n if(e1==0 && e==f && e==g && f1==0 && g1==0)\n printf(\"%d\",(e*7));\n else if(e1==0 && e==f && e==g && f1==1 && g1==0)\n printf(\"%d\",(e*7)+1);\n else if(e1==0 && e==f && e==g && f1==0 && g1==1)\n printf(\"%d\",(e*7)+1);\n else if(e1==0 && e==f && e==g && f1==1 && g1==1)\n printf(\"%d\",(e*7)+2);\n else if(e1==0 && f>e && g==e && g1==0)\n printf(\"%d\",(e*7)+1);\n else if(e1==0 && ee && e==f && f1==0)\n printf(\"%d\",(e*7)+1);\n else if(e1==0 && e==f && ee && g==e && g1==0)\n printf(\"%d\",(e*7)+2);\n else if(e1==1 && ee && e==f && f1==0)\n printf(\"%d\",(e*7)+2);\n else if(e1==1 && e==f && ee && g==e && g1==0)\n printf(\"%d\",(e*7)+3);\n else if(e1==2 && ee && e==f && f1==0)\n printf(\"%d\",(e*7)+3);\n else if(e1==2 && e==f && ef && f==g && g1==0)\n printf(\"%d\",(f*7)+2);\n else if(f1==0 && e>f && f==g && g1!=0)\n printf(\"%d\",(f*7)+2);\n else if(f1==0 && g>f && e==f && e1==0)\n printf(\"%d\",(f*7)+1);\n else if(f1==0 && e==f && ff && f==g && g1!=0)\n printf(\"%d\",(f*7)+5);\n else if(f1==1 && g>f && e==f && e1==0)\n printf(\"%d\",(f*7)+2);\n else if(f1==1 && e==f && f=g){\n if(g1==0 && g==f && e==g && f1==0 && e1==0)\n printf(\"%d\",(g*7));\n else if(g1==0 && g==f && e==g && f1==1 && e1==0)\n printf(\"%d\",(g*7)+1);\n else if(g1==0 && g==f && e==g && f1==0 && e1==1)\n printf(\"%d\",(g*7)+1);\n else if(g1==0 && g==f && e==g && f1==1 && e1==1)\n printf(\"%d\",(g*7)+2);\n else if(g1==0 && f>g && g==e && e1==0)\n printf(\"%d\",(g*7)+1);\n else if(g1==0 && gg && f1!=0)\n printf(\"%d\",(g*7)+2);\n else if(g1==0)\n printf(\"%d\",(g*7)+4);\n else if(g1==1 && g==f && e==g && f1==0 && e1==0)\n printf(\"%d\",(g*7)+1);\n else if(g1==1 && g==f && e==g && e1==2 && f1==0)\n printf(\"%d\",(g*7)+2);\n else if(g1==1 && g==f && e==g && f1==1 && e1==0)\n printf(\"%d\",(g*7)+2);\n else if(g1==1 && g==f && e==g && f1==0 && e1==1)\n printf(\"%d\",(g*7)+2);\n else if(g1==1 && g==f && e==g && f1==1 && e1==1)\n printf(\"%d\",(g*7)+3);\n else if(g1==1 && g==f && e==g && f1==1 && e1==2)\n printf(\"%d\",(g*7)+4);\n else if(g1==1 && f>g && g==e && e1==0)\n printf(\"%d\",(g*7)+2);\n else if(g1==1 && gg && f1!=0)\n printf(\"%d\",(g*7)+5);\n else if(g1==1)\n printf(\"%d\",(g*7)+6);\n\n }\n else if(e==f && e==g && f==g){\n if(e1==0 && f1==0 && g1==0)\n printf(\"%d\",e*7);\n else{\n if(e\n\nint main(void)\n{\n int n,i,j;\n scanf(\"%d\",&n);\n if(n==1)\n printf(\"2\");\n else if(n==2)\n printf(\"3\");\n else\n {\n if(n%2!=0)\n n++;\n for(i=4,j=4;i<=n;i+=2,j++);\n printf(\"%d\",--j);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0c66019f9ba70afae0070113783cf800", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "c803446f08116b2a07e0ef0678f6e4a8", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.045026486168334316, "equal_cnt": 19, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include \n#include \nusing namespace std;\nint main(){\n\n int i=0,j;\n char matrix[10][10];\n char s[12];\n\n\n while(i<10){\n scanf(\"%s\",s);\n for(j=0;j<10;j++){\n matrix[i][j]=s[j];\n }\n i++;\n }\n\n\n for (i=0;i<10;i++){\n for (j=0;j<10;j++){\n if (matrix[i][j]=='X'){ //achou o primeiro x\n if ((matrix[i][j-1]=='.')&&(matrix[i][j+1]=='X')&&(matrix[i][j+2]=='X')&&(matrix[i][j+3]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i][j+1]=='.')&&(matrix[i][j+2]=='X')&&(matrix[i][j+3]=='X')&&(matrix[i][j+4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i][j+1]=='X')&&(matrix[i][j+2]=='.')&&(matrix[i][j+3]=='X')&&(matrix[i][j+4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i][j+1]=='X')&&(matrix[i][j+2]=='X')&&(matrix[i][j+3]=='.')&&(matrix[i][j+4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i][j+1]=='X')&&(matrix[i][j+2]=='X')&&(matrix[i][j+3]=='X')&&(matrix[i][j+4]=='.')){\n printf(\"YES\\n\");\n exit(0);\n }\n\n\n\n\n\n if ((matrix[i-1][j]=='.')&&(matrix[i+1][j]=='X')&&(matrix[i+2][j]=='X')&&(matrix[i+3][j]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j]=='.')&&(matrix[i+2][j]=='X')&&(matrix[i+3][j]=='X')&&(matrix[i+4][j]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j]=='X')&&(matrix[i+2][j]=='.')&&(matrix[i+3][j]=='X')&&(matrix[i+4][j]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j]=='X')&&(matrix[i+2][j]=='X')&&(matrix[i+3][j]=='.')&&(matrix[i+4][j]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j]=='X')&&(matrix[i+2][j]=='X')&&(matrix[i+3][j]=='X')&&(matrix[i+4][j]=='.')){\n printf(\"YES\\n\");\n exit(0);\n }\n\n\n\n\n if ((matrix[i-1][j-1]=='.')&&(matrix[i+1][j+1]=='X')&&(matrix[i+2][j+2]=='X')&&(matrix[i+3][j+3]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j+1]=='.')&&(matrix[i+2][j+2]=='X')&&(matrix[i+3][j+3]=='X')&&(matrix[i+4][j+4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j+1]=='X')&&(matrix[i+2][j+2]=='.')&&(matrix[i+3][j+3]=='X')&&(matrix[i+4][j+4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j+1]=='X')&&(matrix[i+2][j+2]=='X')&&(matrix[i+3][j+3]=='.')&&(matrix[i+4][j+4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j+1]=='X')&&(matrix[i+2][j+2]=='X')&&(matrix[i+3][j+3]=='X')&&(matrix[i+4][j+4]=='.')){\n printf(\"YES\\n\");\n exit(0);\n }\n\n\n\n\n if ((matrix[i-1][j+1]=='.')&&(matrix[i+1][j-1]=='X')&&(matrix[i+2][j-2]=='X')&&(matrix[i+3][j-3]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j-1]=='.')&&(matrix[i+2][j-2]=='X')&&(matrix[i+3][j-3]=='X')&&(matrix[i+4][j-4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j-1]=='X')&&(matrix[i+2][j-2]=='.')&&(matrix[i+3][j-3]=='X')&&(matrix[i+4][j-4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j-1]=='X')&&(matrix[i+2][j-2]=='X')&&(matrix[i+3][j-3]=='.')&&(matrix[i+4][j-4]=='X')){\n printf(\"YES\\n\");\n exit(0);\n }\n if ((matrix[i+1][j-1]=='X')&&(matrix[i+2][j-2]=='X')&&(matrix[i+3][j-3]=='X')&&(matrix[i+4][j-4]=='.')){\n printf(\"YES\\n\");\n exit(0);\n }\n printf(\"NO\\n\");\n exit(0);\n }\n }\n }\n}\n\n/* 1519395180448 */\n", "lang": "GNU C", "bug_code_uid": "bc37032287f6db3570b4ceac80193fdb", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "6c99a20adf3043d7dd1420ead86d0d99", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4275, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "#include\n\nint main(){\n int D;\n long n, k, M, ans;\n scanf(\"%ld%ld%ld%d\", &n, &k, &M, &D);\n ans = M;\n for(int i = 1; i <= D; i++){\n long cur = n / (k * i);\n long lmax = cur * i;\n if(i < D){\n if(n / cur > k * i){\n lmax += cur;\n } else{\n while(cur && n / cur-- < k * i);\n lmax = lmax > cur * (i + 1) ? lmax : cur * (i + 1);\n }\n }\n ans = ans > lmax ? ans : lmax;\n }\n printf(\"%ld\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a44fbe1d0d54a88c5af6b6b21af5711e", "src_uid": "ac2e795cd44061db8da13e3947ba791b", "apr_id": "8384cf8a82f498f7295726e59ecf764b", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3902439024390244, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\n\nint main(){\n int D;\n long n, k, M, ans;\n scanf(\"%ld%ld%ld%d\", &n, &k, &M, &D);\n ans = M;\n for(int i = 1; i <= D; i++){\n long cur = n / (k * i);\n long lmax = cur * i;\n if(!cur) break;\n if(i < D){\n if(n / cur > k * i){\n lmax += cur;\n } else{\n while(cur && n / cur-- < k * i);\n lmax = lmax > cur * (i + 1) ? lmax : cur * (i + 1);\n }\n }\n ans = ans > lmax ? ans : lmax;\n }\n printf(\"%ld\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1700f8f9b8dca79eca08f7b5a33401cf", "src_uid": "ac2e795cd44061db8da13e3947ba791b", "apr_id": "8384cf8a82f498f7295726e59ecf764b", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9766536964980544, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int sum=0,d,f=5;\n for(int i=0;i\n#include \n#include \n\nint main()\n{\n\tchar s[100],temp_s;\n\tchar *ps;\n\tint i, length, max, num_vk;\n\n\twhile (1)\n\t{\n\t\tscanf(\"%s\", s);\n\t\tmax = 0;\n\t\tnum_vk = 0;\n\t\tlength = strlen(s);\n\t\tfor (i = 0; i < length; i++)\n\t\t{\n\t\t\ttemp_s = s[i];\n\t\t\ts[i] = 'V';\n\t\t\tps = strstr(s, \"VK\");\n\t\t\tnum_vk = 0;\n\t\t\t//\t\tprintf(\"=============================s=%s\\n\", s);\n\t\t\twhile (ps != NULL)\n\t\t\t{\n\t\t\t\tnum_vk++;\n\t\t\t\t//\t\t\tprintf(\"num_vk=%d, ps=%s\\n\", num_vk, ps);\n\t\t\t\tps = ps + 2;\n\t\t\t\tps = strstr(ps, \"VK\");\n\t\t\t}\n\t\t\tif (max < num_vk)\n\t\t\t\tmax = num_vk;\n\t\t\ts[i] = temp_s;\n\t\t}\n\t\tfor (i = 0; i < length; i++)\n\t\t{\n\t\t\ttemp_s = s[i];\n\t\t\ts[i] = 'K';\n\t\t\tps = strstr(s, \"VK\");\n\t\t\tnum_vk = 0;\n\t\t\twhile (ps != NULL)\n\t\t\t{\n\t\t\t\tnum_vk++;\n\t\t\t\tps = ps + 2;\n\t\t\t\tps = strstr(ps, \"VK\");\n\t\t\t}\n\t\t\tif (max < num_vk)\n\t\t\t\tmax = num_vk;\n\t\t\ts[i] = temp_s;\n\t\t}\n\t\tprintf(\"%d\\n\", max);\n\t}\n\treturn 0;\n\n}", "lang": "GNU C", "bug_code_uid": "27661e4a69b3f7a25c607c0cf1425d2a", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "91f2f01f74277924e05e9db46ba72341", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5862944162436549, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#define N 150\n\nint main()\n{\n char a[N];\n while(~scanf(\"%s\",a))\n {\n int i,k=1,cnt=0;\n for(i=0; a[i+1]!='\\0'; )\n {\n if(a[i]=='V'&&a[i+1]=='K')\n {\n cnt++;i+=2;\n }\n if(k)\n {\n if(a[i]=='V'&&a[i+1]=='V')\n {\n k=0;\n cnt++;i+=2;\n }\n else if(a[i]=='K'&&a[i+1]=='K')\n {\n k=0;\n cnt++;i+=2;\n }\n }\n else\n i++;\n }\n printf(\"%d\\n\",cnt);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ac88f545e31f9fbfab044efcf400d7a2", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "ae6cb18d8dc0f8eff288050cc3dae0ec", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9720476706392199, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nint flag[5][5];\nint flag2[5][5];\nint mark[10];\nint ans ;\n\nint\ndfs(int depth){\n int i,j,count,index;\n if(depth ==0){\n\n for(i=0;i<5;i++){\n for(j=0;j<5;j++){\n flag2[i][j] = flag[i][j];\n }\n }\n \n for(i=0;i<5;i++){\n for(j=0;j<5;j++){\n if(mark[i] && mark[j+5]){\n flag2[i][j]=0;\n }\n }\n }\n for(i=0 ;i<10 ;i++){\n if(! mark[i] )\n continue;\n if ( i < 5){\n count=0;\n index=0;\n for(j=0;j<5;j++){\n if(flag2[i][j]){\n count ++;\n index = j;\n }\n }\n if( count >1 ){\n return 0;\n }\n flag2[i][index]=0;\n }\n else {\n count=0;\n index =0;\n for(j=0;j<5;j++){\n if(flag2[j][i-5]){\n count ++;\n index =j;\n }\n }\n if( count >1 ){\n return 0;\n }\n flag2[index][i-5]=0;\n }\n }\n count =0 ;\n for(i=0;i<5;i++){\n for(j=0;j<5;j++){\n if(flag2[i][j]){\n count++;\n }\n }\n }\n if(count ==1)\n return 1;\n else\n return 0;\n }\n for(i=0;i<10;i++){\n if(mark[i])\n continue;\n mark[i] = 1;\n if(!dfs(depth-1))\n mark[i] =0;\n else\n return 1;\n }\n return 0;\n}\n\nint\nmain(int argc,\n char *argv[]){\n int n;\n scanf(\"%d\",&n);\n char card[2];\n char color[5] ={'R','G','B','Y','W'};\n int i,j;\n memset(flag,0,sizeof(flag));\n for(i=0;i\n#include\n#include\nint main()\n{\n\tlong int n,k,max;\n\tscanf(\"%ld%ld\",&n,&k);\n\tif(n>k)\n\t{\n\t\tif(((n-1)/3)=k)\n\t\t{\n\t\tn=3*((n-1)/3);\n\t\tmax=n-k;\n\t\t}\n\t\tprintf(\"%ld %ld\",1,max);\n\t}\n\telse\n\tprintf(\"%ld %ld\",0,0);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "7326d2d1a31dfe50d20cc33f71b4d534", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "69f51fabb8bafa2544432bef7a6a92dc", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.36585365853658536, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n\tlong long n, k;\n\tscanf(\"%lld%lld\", &n, &k);\n\twhile (k != (((1 << n) - 1) + 1) / 2)\n\t\tn--;\n\tprintf(\"%lld\\n\", n);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9991604875dda3fa8600b907250c49db", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "bea3a3feba1124ae9f0fc900ca7954c4", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8927680798004988, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n\tint n,k;\n\tscanf(\"%d%d\",&n,&k);\n\tint ans=1;\n\twhile(1)\n\t{\n\t\tif(k%2==0)\n\t\t{\n\t\t\tans++;\n\t\t\tk=k/2;\n\t\t}\n\t\telse\n\t\t\tbreak;\n\t}\n\tprintf(\"%d\\n\",ans);\n\treturn 0;\n}\n\n\n\t\n\n", "lang": "GNU C", "bug_code_uid": "7bd8e53a12d2d3bc6229f1e5ecb311be", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "17c74e305684ebebc3bee655afece5f5", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8904109589041096, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nvoid func(){\n //freopen(\"in.txt\",\"r\",stdin);\n int n,a1,b1,a2,b2,a3,b3,s;\n scanf(\"%d\",&n);\n if(n == 1)\n s = -1;\n else if (n == 2){\n scanf(\"%d %d\",&a1,&b1);\n scanf(\"%d %d\",&a2,&b2);\n if (a1 == a2 || b1 == b2)\n s = -1;\n else{\n s = (a1-a2)*(b1-b2);\n if (s < 0)\n s = -s;\n } \n }\n else if (n > 2){\n scanf(\"%d %d\",&a1,&b1);\n scanf(\"%d %d\",&a2,&b2);\n scanf(\"%d %d\",&a3,&b3);\n if (a1 == a2)\n s = (a1-a3)*(b1-b2); \n if (s < 0)\n s = -s; \n }\n \n printf(\"%d\",s);\n \n}\n\nint main(){\n func();\n while(1){}\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ba18b7f88268b6f8a5f6ad8a148140d0", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "9921b276e44ac79c4f106581866f3204", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5049645390070922, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n long long a,b,c,r,m;\n scanf(\"%lld %lld %lld\",&a,&b,&c);\n if(a==c)\n {\n r=a+b+(2*c);\n\n }\n else\n {\n m=(b-a)/2;\n r=a+b+c-m;\n }\n print(\"%lld\",r);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "43794e8cccdaa699dc58542bc1bff23e", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "4c706436284cd77b210d6e3ddeb93a73", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8547008547008547, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main(){\nchar s[20],t[20];\nint a=0,b=0,i=0,ok=0;\nscanf(\"%s\",&s);\nscanf(\"%s\",&t);\nb=(int)(t[i]);\na=(int)(s[i]);\nwhile(a){\n if(i==0){printf(\"%c\",a);i++;a=(int)(s[i]);}\n else if(ab){printf(\"%c\",b);ok=1;break;}\n}\nif(ok==0)printf(\"%c\",b);\n}\n", "lang": "GNU C", "bug_code_uid": "e9fe11e0f180bca114c26ccf54f6e2fa", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "apr_id": "1364e9008e592f4f15b8df553f2a5f4c", "difficulty": 1000, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9409448818897638, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main()\n{\n\tchar esm[10];\n\tchar shohrat[10];\n\tscanf(\"%s\" , esm);\n\tscanf(\"%s\" , shohrat);\n\tfor(int i=0;;i++)\n\t{\n\t\tif(esm[i]\n#include \n\n\ntypedef struct _n {\n struct _n *prev, *next;\n int val;\n} no;\n\nno *cons(ne, val) no *ne; {\n no *n = calloc(1, sizeof(no));\n n->next = ne; if(ne) ne->prev = n;\n n->val = val;\n return n;\n}\n\nno *cycle(n) {\n no *fst = cons(NULL, n);\n no *lst = fst;\n while(--n > 0)\n fst = cons(fst, n);\n lst->next = fst;\n fst->prev = lst;\n}\n\nmain() {\n int n, a, x, b, y;\n scanf(\"%d %d %d %d %d\", &n, &a, &x, &b, &y);\n no *l = cycle(n);\n no *c1 = l, *c2 = l;\n\n while(c1->val != a) c1 = c1->next;\n while(c2->val != b) c2 = c2->next;\n\n \n while(c1 != c2 && c1->val != x && c2->val != y) {\n c1 = c1->next; c2 = c2->prev;\n }\n\n if(c1 == c2) puts(\"YES\");\n else puts(\"NO\");\n}\n", "lang": "GNU C11", "bug_code_uid": "e55201f917475d5024dfee0a39412a1f", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "622441c13cd96de4e38b1a63abf33ba7", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9007314524555904, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint main()\n{\n\t\tchar a[5][5] = {}, m, i, j, k, s, win;\n\n\t\tscanf(\"%c\\n\", &m);\n\t\twhile(m--)\n\t\t{\n\t\t\tscanf(\"%c %c\\n\", &i, &j);\n\t\t\t--i, --j, a[i][j] = a[j][i] = 1;\n\t\t}\n\n\t\twin = 0;\n\t\tfor (i = 0; i < 5; ++i)\n\t\t\tfor (j = 0; j < i; ++j)\n\t\t\t\tfor (k = 0; k < j; ++k)\n\t\t\t\t{\n\t\t\t\t\ts = a[i][j] + a[j][k] + a[k][i];\n\t\t\t\t\tif (s == 3 || s == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\twin = 1;\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\tend:\n\t\tif (win)\n\t\t\tputs(\"WIN\\n\");\n\t\telse\n\t\t\tputs(\"FAIL\\n\");\n\n\t\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "80c0bbfe85f5ddce24510299cd310d5c", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "a797f1cd95f4a487e08cd2186f890f71", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9872340425531915, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,i,j=0,a[105],k=0;\n scanf(\"%d\",&n);\n for (i=0;i1)\n {\n if(a[i]==2&&a[i-2]==3)\n j--;\n }\n }\n else if ((a[i]==1&&a[i+1]==3)||(a[i]==3&&a[i+1]==1))\n {\n\n j+=4;\n }\n\n }\n printf(\"Finite\\n%d\\n\",j);\n return k;\n}\n", "lang": "GNU C11", "bug_code_uid": "bebd787f55b7e0ffa38112ed788c0d1f", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "72817e937a8e53c2cc36b5730ccb6514", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9935897435897436, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint main(){\n\tlong unsigned n, temp, ans, cnt=0;\n\tscanf(\"%lu\",&n);\n temp=n;\n while(temp)\n {\n ans=temp%10;\n temp=temp/10;\n cnt++;\n }\n ans=ans+1;\n for(i=1;i\n#include\n#include\n#include\n#include\n#include\n#include\n\nint main(void)\n{\n int x, y, z, k;\n\n scanf(\"%d%d%d%d\", &x, &y, &z, &k);\n\n int a = 1, b = 1, c = 1;\n int i = 0;\n while(i < k)\n {\n if(i < k && x > 1)\n {\n x--;\n a++;\n i++;\n }\n if(i < k && y > 1)\n {\n y--;\n b++;\n i++;\n }\n if(i < k && z > 1)\n {\n z--;\n c++;\n i++;\n }\n if(x == 1 && y == 1 && z == 1)\n i = k;\n }\n\n printf(\"%d\", a * b * c);\n\n\n\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e3bc530e476c6a20a3bd888c8e7e016e", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "90ae79ebf85569f0eb9046ed2b8b46c9", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.99644128113879, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{\n int x,y=0;\nscanf(\"%d\",x);\nif ((x%5)) y=1;\nprintf(\"%d\",(x/5)+y);\n\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "db579424810fc664aa53d8a6dd79c167", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "02ae35af2997cd0e3113c4c7b8920ccc", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.42592592592592593, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int k,c=1,s=0;\n scanf(\"%d\",&k);\n while(k>0)\n {\n k+k-c;\n c+=1;\n s+=1;\n }\n printf(\"%d\",s);\n}\n", "lang": "GNU C11", "bug_code_uid": "a8579cac060c7dcd697cf6412172c1c7", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "a5dc5fb4691a9c08ef0473bba1a229f8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9356521739130435, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nusing namespace std;\nint main(){\n int sum,n,k,s,p;\n scanf(\"%d %d %d %d\",&k,&n,&s,&p);\n if(n%s!=0)\n sum=(n/s)+1;\n else\n sum=n/s;\n sum=sum*k;\n if(sum%p!=0)\n sum=(sum/p)+1;\n else\n sum=(sum/p);\n printf(\"%d\",sum);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d4beeff357417fd3f53b0393c52af7c0", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "ae8dbb5c63ebcf2118417f5488ec9d02", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994956441999083, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#define swap(a,b) { t=a; a=b; b=t; }\n\nint n;\nint h[100000],son=0,t,k,l,hh[10000];\nvoid ekle(int x)\n{\n\th[++son]=x;\n\tk=son;\n\twhile(k/2)\n\t{\n\t\tif(h[k/2]h[2*k] && 2*k+1 <= n);\n\t\tif(x<=h[k])\th[k/2] = h[k];\n\t\telse{ k /= 2; break; }\n\t}\n\th[k] = x;\n}\nint main()\n{\n\tint i,j,a;\n\tscanf(\"%d\",&n);\n\tfor(i=0;i0)\n\t{\n\t\tt++;\n\t\tb=1;\n\t\tyukseklik=0;\n\t\t//terim=0;\n\t\t//puts(\"\");\n\t\twhile(b\nint main()\n{\n int c,d,m,n,k,ans=0;\n scanf(\"%d%d%d%d%d\",&c,&d,&m,&n,&k);\n m = m*n;\n m = m-d;\n if((c/n)>d)\n printf(\"%d\\n\",m*d);\n else\n {\n while(m)\n {\n m-=n;\n ans+=c;\n }\n printf(\"%d\\n\",ans);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "95bfb7570498f25a1d3e69331dbe9c05", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "f3451f9b2650159c0dd63349778d889a", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3444782168186423, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \n#define min(a,b) (a\nint main()\n{\n int n,i,j,a,sum=0;\n scanf(\"%d\",&n);\n if(n==1)\n {\n printf(\"1\");\n exit(0);\n }\n for(i=2;i1)\n {\n sum=sum+1;\n break;\n }\n else\n {\n break;\n }\n }\n }\n }\n printf(\"%d\",sum+2);\n}", "lang": "GNU C11", "bug_code_uid": "220f229837c4fb877fe16690fdf1fe4f", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "e61c9b601b212d96496c1a1b18a6c330", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8045774647887324, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main(){\nint n,m,min1,max1,i,arr[105],flag1=-1,flag2=-1,h=-1,y=-1;\nscanf(\"%d%d%d%d\",&n,&m,&min1,&max1);\nfor(i=0;imax1)\n y=1;\n }\n\n if(n-m==1&&(flag1==1||flag2==1))\n printf(\"Correct\\n\");\n \n else if(n-m>1&&(h=1||y=1))\n printf(\"Incorrect\");\n \n else if(n-m==1&&(flag1!=1||flag2!=1))\n printf(\"Incorrect\\n\");\n\n\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d4164ecf0ec41b438eb37afa3f5cc1d9", "src_uid": "99f9cdc85010bd89434f39b78f15b65e", "apr_id": "236a74c39c266db7fbcab6b226907250", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9970536240424278, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int m,n,Min,Max,a[100];\n while(scanf(\"%d%d%d%d\",&n,&m,&Min,&Max))\n {int i,ok=1;\n for(i=0;i<=m-1;i++)\n scanf(\"%d\",&a[i]);\n if(n-m>=2)\n {\n for(i=0;i<=m-1;i++)\n if(a[i]>Max||a[i]Max||a[i]\n#include\nint p[10000];\nvoid isPrime(int n)\n{\n\tint i,j,prime;\n\n\tp[0] = 0;\n\tp[1] = 0;\n\n\tfor(i=2;i*i<=n;i++)\n\t{\n\t\tif(p[i] == 1)\n\t\t{\n\t\t\tfor(j=i*2;j<=n;j+=i)\n\t\t\t{\n\t\t\tp[j] = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nint check_prime(int a,int b,int l,int k)\n {\n\nint c = 0;\n isPrime(b);\n\n for(int i=a;i<=a+l-1;i++)\n {\n \tif(p[i] == 1)\n \t{\n \tc++;\n \t}\n\n }\t\nif(c\n\nint main() {\n\tint k,l,m,n,d;\n\tint dizi[100000];\n\tint secimler[4];\n\tfor (int i = 0; i < 100000; i++) {\n\t\tdizi[i] = 0; \n\t}\n\tscanf(\"%d %d %d %d %d\",&k,&l,&m,&n,&d);\n\tsecimler[0] = k;\n\tsecimler[1] = l;\n\tsecimler[2] = m;\n\tsecimler[3] = n;\n\tint j = 0;\n\tfor (int u = 0; u < 4; u++) {\t\n\t\tif (secimler[u] == secimler[u-1]) {\n\t\t\tu++;\n\t\t\tcontinue;\n\t\t}\n\t\tfor (int i = secimler[u]; i < d; i += secimler[u]) {\n\t\t\tint kontrol = 0;\n\t\t\tfor (int t = 0; t < 100000; t++) \n\t\t\t\tif (dizi[t] == i) {\n\t\t\t\t\tkontrol = 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (kontrol != 1) {\n\t\t\t\tdizi[j++] = i;\n\t\t\t}\n\t\t}\n\t}\n\tif (j == 0) printf(\"%d\",j);\n\telse printf(\"%d\",j+1);\t\t\t\n}", "lang": "GNU C11", "bug_code_uid": "6b282bacce416b0ff1645443a759e03b", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "732abea6dc395b23226d9be2f2392b6f", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9278045168456127, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "/* practice with Dukkha */\n#include \n\n#define A\t300\n\nint solve2(int a1, int a2) {\n\tstatic char dp[A + 1][A + 1];\n\tint i1, i2, i;\n\n\tdp[0][0] = 0;\n\tfor (i1 = 0; i1 <= a1; i1++)\n\t\tfor (i2 = 0; i2 <= a2; i2++) {\n\t\t\tif (dp[i1][i2])\n\t\t\t\tcontinue;\n\t\t\tfor (i = 1; i1 + i <= a1; i++)\n\t\t\t\tdp[i1 + i][i2] = 1;\n\t\t\tfor (i = 1; i2 + i <= a2; i++)\n\t\t\t\tdp[i1][i2 + i] = 1;\n\t\t\tfor (i = 1; i1 + i <= a1 && i2 + i <= a2; i++)\n\t\t\t\tdp[i1 + i][i2 + i] = 1;\n\t\t}\n\treturn dp[a1][a2];\n}\n\nint solve3(int a1, int a2, int a3) {\n\tstatic char dp[A + 1][A + 1][A + 1];\n\tint i1, i2, i3, i;\n\n\tdp[0][0][0] = 0;\n\tfor (i1 = 0; i1 <= a1; i1++)\n\t\tfor (i2 = 0; i2 <= a2; i2++)\n\t\t\tfor (i3 = 0; i3 <= a2; i3++) {\n\t\t\t\tif (dp[i1][i2][i3])\n\t\t\t\t\tcontinue;\n\t\t\t\tfor (i = 1; i1 + i <= a1; i++)\n\t\t\t\t\tdp[i1 + i][i2][i3] = 1;\n\t\t\t\tfor (i = 1; i2 + i <= a2; i++)\n\t\t\t\t\tdp[i1][i2 + i][i3] = 1;\n\t\t\t\tfor (i = 1; i3 + i <= a3; i++)\n\t\t\t\t\tdp[i1][i2][i3 + i] = 1;\n\t\t\t\tfor (i = 1; i1 + i <= a1 && i2 + i <= a2 && i3 + i <= a3; i++)\n\t\t\t\t\tdp[i1 + i][i2 + i][i3 + i] = 1;\n\t\t\t}\n\treturn dp[a1][a2][a3];\n}\n\nint main() {\n\tint n, a1, a2, a3;\n\n\tscanf(\"%d%d\", &n, &a1);\n\tif (n == 1) {\n\t\tprintf(a1 ? \"BitLGM\\n\" : \"BitAryo\\n\");\n\t\treturn 0;\n\t}\n\tscanf(\"%d\", &a2);\n\tif (n == 2) {\n\t\tprintf(solve2(a1, a2) ? \"BitLGM\\n\" : \"BitAryo\\n\");\n\t\treturn 0;\n\t}\n\tscanf(\"%d\", &a3);\n\tprintf(solve3(a1, a2, a3) ? \"BitLGM\\n\" : \"BitAryo\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "76dac393193354c8fd65b5db15cfb0e6", "src_uid": "7a33b4f94082c7ef80d7e87b58497fa7", "apr_id": "f166217bfa2e9333446e022820df1895", "difficulty": 2100, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8146341463414634, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tint *array;\n\tarray=(int*)calloc(n+1,sizeof(int));\n\tint i,j;\n\tfor(i=1;i15)\n\t\t{\n\t\t\tprintf(\"%d\",array[j-1]+15);\n\t\t\tfree(array);\n\t\t\texit(1);\n\t\t}\t\t\n\t}\n\tprintf(\"%d\",array[n]);\n\tfree(array);\n}\n", "lang": "GNU C11", "bug_code_uid": "d7a75eced5af003d8e66e4525b8cc6fd", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "b94bdc28c7448c3c153cecec0c5fde58", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.26450116009280744, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \nint hh,mm;\nint main()\n{\nprintf(hh:mm);\nscanf(\"%d %c %d\",&hh &: &mm);\nscanf(\"%d\",&a);\nprintf(hh:mm+a);\nreturn (0);\n}", "lang": "GNU C11", "bug_code_uid": "99052d129c94e3c613d2d9db77b3e674", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "apr_id": "70d5de44cbdeaa127ab4b5716dc23798", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6428766003813675, "equal_cnt": 23, "replace_cnt": 6, "delete_cnt": 11, "insert_cnt": 5, "fix_ops_cnt": 22, "bug_source_code": "#include\n#include\n#include\n#include\n#pragma warning(disable:4996)\nusing namespace std;\nint main()\n{\n\tint a, b, c, i, j, k;\n\tchar s[10];\n\tint m[6][6];\n\tint flag;\n\tmapmp;\n\twhile (scanf(\"%d\", &a) != EOF)\n\t{\n\t\tmemset(m, 0, sizeof(m));\n\t\tscanf(\"%s\", s);\n\t\tint flag1 = 0;\n\t\tb = strlen(s);\n\t\tflag = 0;\n\t\tfor (i = 0; i < b; i++)\n\t\t{\n\t\t\tif (s[i] == '0')\n\t\t\t\tm[4][2] = 1;\n\t\t\tif (s[i] == '1')\n\t\t\t\tm[1][1] = 1;\n\t\t\tif (s[i] == '2')\n\t\t\t\tm[1][2] = 1;\n\t\t\tif (s[i] == '3')\n\t\t\t\tm[1][3] = 1;\n\t\t\tif (s[i] == '4')\n\t\t\t\tm[2][1] = 1;\n\t\t\tif (s[i] == '5')\n\t\t\t\tm[2][2] = 1;\n\t\t\tif (s[i] == '6')\n\t\t\t\tm[2][3] = 1;\n\t\t\tif (s[i] == '7')\n\t\t\t\tm[3][1] = 1;\n\t\t\tif (s[i] == '8')\n\t\t\t\tm[3][2] = 1;\n\t\t\tif (s[i] == '9')\n\t\t\t\tm[3][3] = 1;\n\t\t}\n\t\tfor (i = 0; i < 6; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 6; j++)\n\t\t\t{\n\t\t\t\tif (m[i][j] == 1)\n\t\t\t\t{\t\n\t\t\t\t\tif ((i == 3 && j == 3) || (i == 2 && j == 3) || (i == 1 && j == 3))\n\t\t\t\t\t{\n\t\t\t\t\t\tflag1 = 1;\n\t\t\t\t\t\tflag++; break;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flag1)break;\n\t\t}\n\t\tflag1 = 0;\n\t\tfor (i = 0; i < 6; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 6; j++)\n\t\t\t{\n\t\t\t\tif (m[i][j] == 1)\n\t\t\t\t{\n\t\t\t\t\tif ((i == 1&& j == 1) || (i == 2 && j == 1) || (i == 3 && j == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tflag1 = 1;\n\t\t\t\t\t\tflag++; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}if (flag1)break;\n\t\t}\n\t\tflag1 = 0;\n\t\tfor (i = 0; i < 6; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 6; j++)\n\t\t\t{\n\t\t\t\tif (m[i][j] == 1)\n\t\t\t\t{\n\t\t\t\t\tif ((i == 3 && j == 1) || (i == 4 && j == 2)||(i == 3 && j == 3))\n\t\t\t\t\t{\n\t\t\t\t\t\tflag1 = 1;\n\t\t\t\t\t\tflag++; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}if (flag1)break;\n\t\t\t\n\t\t}\n\t\tflag1 = 0;\n\t\tfor (i = 0; i < 6; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 6; j++)\n\t\t\t{\n\t\t\t\tif (m[i][j] == 1)\n\t\t\t\t{\n\t\t\t\t\tif ((i == 1 && j == 1) || (i == 1 && j == 2) || (i == 1 && j == 3))\n\t\t\t\t\t{\n\t\t\t\t\t\tflag1 = 1;\n\t\t\t\t\t\tflag++; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}if (flag1)break;\n\t\t}\n\t\tif (flag == 4)\n\t\t\tprintf(\"YES\\n\");\n\t\telse printf(\"NO\\n\");\n\t\t\n\t}\n}", "lang": "GNU C", "bug_code_uid": "705512a0eaa7f87de6114d5861790be1", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "5381c234ade20c9651b44ca4a17d3780", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.28306264501160094, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "#include \nmain()\n{\n int i=0,n=0,m=0,k=0,b=1,t=0;\n scanf(\"%d\",&n);\n scanf(\"%d\",&m);\n scanf(\"%d\",&k);\n for(i=1;i*i<=m;i++)\n { if (i!=1)\n\t\t{\n if (m%i==0)\n {\n\t\t\t\t\tif ((m/i)>=k){\n break;\n\t\t\t\t\t\t\t\tw=1;}\n else w=0;\n\t\t\t\t\n }\n\t\t}\n }/*\n if (((i*i>m)||(m==1)) && k!=1) {\nprintf(\"Marsel\");\nreturn 0; }*/\n\nif (w=0)\n{\nif (((i*i>m)||(m==1)) && k==1) {\nprintf(\"Timur\");\nreturn 0; }\n}\nelse\n{\n /*\n for(t=0;t=k)\n {\n b[u]=a[i];\n u++;\n }\n */\n\n\n\nreturn(0);\n\n\n}", "lang": "GNU C", "bug_code_uid": "5a1d8a7e69fee66268e625056a082273", "src_uid": "4a3767011ddac874efa021fff7c94432", "apr_id": "13c2cc4b8f33c7310e1d1d39468ea00a", "difficulty": 2000, "tags": ["dp", "games", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9819967266775778, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main() {\n\tint n,m,k,i;\n\tscanf(\"%d %d %d\",&n,&m,&k);\n\tif (n%2==0 || m==1) {\n\t\tputs(\"Marsel\");\n\t\treturn 0;\n\t}\n\tif (k==1) {\n\t\tputs(\"Timur\");\n\t\treturn 0;\n\t}\n\tfor(i=1;i*i<=m;i++) if (m%i==0 && m/i>=k) break;\n\tif (i*i>m) {\n\t\tputs(\"Marsel\");\n\t\treturn 0;\n\t}\n\tputs(\"Timur\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "a4795d8eeea45975abff8b5348605fb3", "src_uid": "4a3767011ddac874efa021fff7c94432", "apr_id": "265b78f3a6e1dada4fcf354e7922e7bf", "difficulty": 2000, "tags": ["dp", "games", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3078982597054886, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n int n,a,b;\n scanf(\"%d\\n\",&n);\n int i=0,j=0,k=0;\n while(j=1&&a<=6&&b>=1&&b<=6)\n if(a>b)\n {\n ++i;\n }\n else\n {\n ++k;\n }\n }\n if(i>k)\n {\n printf(\"Mishka\");\n }\n else if(i\n#include \n\n\nmain() {\n int i = 0, a = 0, b = 0;\n char s[50]; char ch;\n\n scanf(\"%s\", s);\n while (s[i] != '\\0') {\n if (s[i] == '4') a++;\n if (s[i] == '7') b++;\n i++;\n }\n\n if (a && a >= b) { printf(\"%d\", 4); return; }\n if (b && a < b) { printf(\"%d\", 7); return; }\n printf(\"%d\", -1);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a97c3ada5e33ce96c6b72c24c037fe56", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "70863dee61c6e18a1485c91963bdb172", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9982486865148862, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n\tint count4=0,count7=0;\n\tchar ch;\n\tscanf(\"%c\",&ch);\n\twhile (ch!='\\n')\n\t{\n\t\tif (ch=='4')\n\t\t\tcount4++;\n\t\tif (ch=='7')\n\t\t\tcount7++;\n\t\tscanf(\"%c\",&ch);\n\t}\n\tif (count4==0&&count7==0)\n\t\tprintf(\"-1\\n\");\n\telse\n\t\tprintf(\"%c\\n\"count4>=count7?'4':'7');\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "2bf2717b377995c0c08deb2720584de6", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "8831bb7d0056d8ab4b7057fb2260b004", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9920508744038156, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main()\n{\n int m,n;scanf(\"%d%d\",&n,&m);\n if(n==1 && m==1){printf(1);}\n else if(n%2==1 && m*2-1==n)\n {printf(\"%d\",m-1);}\n else if(n%2==1 && m*2-1>n)\n {printf(\"%d\",m-1);}\n else if(n%2==1)\n {printf(\"%d\",m+1);}\n else printf(\"%d\",m*2<=n?m+1:m-1);\n \n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c3872c814f1ace7ef240fe24aed641c6", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "a98c00d28d53e5e0210c9e0fd7a1afbf", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9986082115518441, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint compare_function(const void *a,const void *b) {\n int *x = (int *) a;\n int *y = (int *) b;\n return *x - *y;\n}\n\nvoid print_array(int a[], int size) {\n printf(\"[\");\n for (int i = 0; (i < size); i++) {\n printf(\"%d \", a[i]);\n }\n printf(\"]\\n\");\n}\n\n\nint main(void) {\n int len;\n int input;\n int number_paints = 0;\n int in = 0;\n\n scanf(\"%d\", &len);\n int colors[len];\n int check[len];\n \n\n for(int i = 0; i < len; i++) {\n scanf(\"%d\", &input);\n colors[i] = input;\n //printf(\"EEEE: %d\", colors[i]);\n } \n\n //print_array(colors, len);\n\n qsort(colors, sizeof(colors)/sizeof(colors[0]), sizeof(colors[0]), compare_function);\n\n //print_array(colors, len);\n\n check[0] = colors[0];\n number_paints += 1;\n\n\n for (int color_iter = 0; color_iter < len; color_iter++) {\n for (int check_iter = 0; check_iter < number_paints; check_iter++) {\n if (colors[color_iter] % check[check_iter] == 0) {\n in = 1;\n break;\n }\n\n else {\n in = 0;\n }\n\n }\n if (!in) {\n //printf(\"THIS RUNS\\n\");\n check[number_paints] = colors[color_iter]; \n number_paints += 1;\n in = 1;\n\n }\n ..print_array(check, number_paints);\n }\n\n printf(\"%d\" , number_paints);\n\n return 0;\n\n}", "lang": "GNU C11", "bug_code_uid": "05872d8289ac8b5f36cc3a67002b3676", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "d3b459f3ed2515a99891eb5ccab341e9", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.32142857142857145, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n\tint n;\n\tscanf(\"%d\", &n);\n\tint arr[100];\n\tint i, j=0, flag=1, temp, x=0;\n\tfor(i=0;i\nint main()\n{\n\tlong long int i,j,k,l=0,n,l1,l2,r1,r2;\n\tscanf(\"%lld%lld%lld%lld%lld\",&l1,&r1,&l2,&r2,&k);\n\ti=l2;\n\twhile(l1<=r1)\n\t{\n\t\twhile(l2<=r2)\n\t\t{\n\t\t\t\n\t\tif(l1==l2&&l1!=k)\n\t\t{\n\t\t\tl++;\n\t\t}\n\t\tl2++;\n\t\t}\n\t\tl2=i;\n\t\tl1++;\n\t}\n\tprintf(\"%lld\",l);\n\treturn 0;\n}\n\n\t\t\t\n", "lang": "GNU C", "bug_code_uid": "cb28276d8ec8303673e851e9cf4a0eb1", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "314ca3dd1172981428901a007a2a3295", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9924509310518369, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n\nint main()\n{\n\tint t,n,l,k,d[200],a[200],flag,i,tmr,temp;\n\tscanf(\"%d\",&t);\n\twhile(t--)\n\t{\n\t\tscanf(\"%d %d %d\",&n,&k,&l);\n\t\tfor(i=0;il)\n\t\t\t{\n\t\t\t\tflag=1;\n\t\t\t\t// printf(\"%d-%d\\n\",d[i],i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(d[i]+k>l)\n\t\t\t{\n\t\t\t\tif(i==0 || tmr==1000)\n\t\t\t\t{\n\t\t\t\t\ta[i]=l;\n\t\t\t\t\ttmr=l-d[i];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(tmr>0)\n\t\t\t\t\t{\n\t\t\t\t\t\ttemp=a[i-1]-d[i-1];\n\t\t\t\t\t\ta[i]=a[i-1]-1;\n\t\t\t\t\t\ttmr--;\n\t\t\t\t\t\twhile(a[i]>l)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\ta[i]--;\n\t\t\t\t\t\t\ttmr--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttmr=tmr-1;;\n\t\t\t\t\t\tif(d[i]-tmr>l)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tflag=1;\n\t\t\t\t\t\t\t// printf(\"%d\\n\",i);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta[i]=d[i]-tmr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if(tmr==-k)\n\t\t\t\t\t\t// {\n\t\t\t\t\t\t// \ttmr=k;\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(flag==1)\n\t\t{\n\t\t\tprintf(\"No\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"Yes\\n\");\n\t\t}\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "39184a5bd2df5d3ce01367901ae0b667", "src_uid": "4941b0a365f86b2e2cf686cdf5d532f8", "apr_id": "969714a4f1ced7fee28ca548bff8ced5", "difficulty": 1900, "tags": ["dp", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.587360594795539, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n \n int vladik,valera,c=0;\n scanf(\"%d%d\",vladik,valera);\n while(vladik>=0 && valera>=0)\n {vladik=vladik-1-c;\n if (vladik<0)\n break;\n else\n valera=valera-2-c;\n c+=2;\n}\n\nif (valera<0)\nprintf(\"Valera\");\nelse\nprintf(\"Vladik\");\nreturn 0;\n\n}", "lang": "GNU C", "bug_code_uid": "427444536a92b1e8aac1bf8dbed3aa55", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "1a4030fb7b60631d0a4753e003ce37d5", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.07573632538569425, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\nint main ()\n{\n int a[]={5,25,125,625,3125,15625,78125,390625,1953125},b,c,equal,d,e,m,j,i,my_number,cases;\n scanf(\"%d\",&m);\n b=m*5;\n if(m>=5)\n {\n for(i=1;i<=8;i++)\n {\n if(a[i]>=b && a[i-1]b)cases=i-1,c=((i-1)*(i))/2;\n else cases=i,c=(i*(i+1))/2;\n for(j=0;;j++)\n {\n if(b==a[cases])c=c-(cases+1),cases--,b=b-5;\n else c--,b=b-5;\n if(c==0)\n {\n for(i=0;i<=4;i++)printf(\"%d \",b+i);\n printf(\"\\n\");\n return 0;\n }\n if(c<0)\n {\n printf(\"0\\n\");\n return 0;\n }\n }\n }\n }\n }\n else\n {\n for(i=0;i<=4;i++)printf(\"%d \",b+i);\n printf(\"\\n\");\n }\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "6cb2485c2a642a7b756206b807c7c11d", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "0031b97b40655f31a11c3fd17059f3f2", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.87890625, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main(){\n int result, n, k;\n\n scanf(\"%d\", &n);\n scanf(\"%d\", &k);\n\n result = n;\n\n for(int i=0; i\nint main()\n{\n int n,i,j,xum,mx;\n scanf(\"%d\",&n);\n int a[10][10];\n for(i=1,j=1;j<=n;j++)\n {\n a[i][j]=1;\n }\n for(i=1,j=1;i<=n;i++)\n {\n a[i][j]=1;\n }\n for(i=2;i<=n;i++)\n {\n for(j=2;j<=n;j++)\n {\n a[i][j]=a[i-1][j]+a[i][j-1];\n }\n }\n printf(\"%d\",a[n][n]);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a3e0c86790f16f0ba5198e5f50a77604", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "e15f940b1f9fe78a476bd6b70e872dd6", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7350427350427351, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "\n #include \n#include \n#include \n#include \n#include \n\nint main() {\n unsigned long long a, i, j;\n scanf(\"%l64d\", &a);\n for (i = 2520; i <= a; i+=2520) {\n j++;\n }\n printf(\"%l64d\", j);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "6f9da606fa9da0f43382db5ee68156bd", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "9c7f1545ebf435a306a61dcdd15ead04", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998046875, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n#include \n\nlong long int max(long long int a,long long int b)\n{\n\tif(a>b)\n\t\treturn a;\n\treturn b;\n}\n\nint mask(int a)\n{\n\tint t=0,ans=0,p=0;\n\twhile(a>0)\n\t{\n\t\tt=a%10;\n\t\ta=a/10;\n\t\tif(t==7||t==4)\n\t\t{\n\t\t\tans=ans*10+t;\n\t\t}\n\t}\n\twhile(ans>0)\n\t{\n\t\tt=ans%10;\n\t\tp=p*10+t;\n\t\tans=ans/10;\n\t\t\n\t}\n\treturn p;\n}\n\n\nint main()\n{\n\tint a,b,i;\n\tscanf(\"%d%d\",&a,&b);\n\tfor(i=a;i<=1000000;i++)\n\t{\n\t\tif(mask(i)==b)\n\t\t{\n\t\t\tprintf(\"%d\\n\",i);\n\t\t\treturn 0;\t\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c60e572fb46cd3f83696550df42b6c2c", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "564df43f8a7764b13283b227fd6ba8d1", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7660098522167488, "equal_cnt": 25, "replace_cnt": 23, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 25, "bug_source_code": "#include\n#include\n\n int luckyNo(int x)\n {\n \tint n=x;\n \tint r,sum=0,m=1;\n \twhile(n)\n \t{\n \t\tr=n%10;\n \t\tn=n/10;\n \t\tif(r==4||r==7)\n \t\t{\n \t\t\tsum=sum+r*m;\n \t\t\tm=m*10;\n \t\t}\n \t}\n return sum;\t\n }\nint main()\n{\n\tint a,b;\n\t\n\tscanf(\"%d %d\",&a,&b);\n\tif(a<=b)\n\t\ta=b;\n\telse\n\twhile(b!=luckyNo(a))\n\t{\n\t\ta++;\n\t}\n\tprintf(\"%d\\n\",a);\n\t\n return 0; \n } \n", "lang": "GNU C", "bug_code_uid": "be09fa7561e0090acd5ad42f1260629a", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "18571e071444b544912ce228c14872d1", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9734748010610079, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\n\nchar s[128];\nint dp[128][64][256][2];\nint n,m;\n\nint main() {\n\tscanf(\"%s\",s);\n\tn=strlen(s);\n\tscanf(\"%d\",&m);\n\tmemset(dp,0xff,sizeof(dp));\n\tdp[0][0][128][0]=0;\n\tint i,j,k,l;\n\tfor(i=0;i<=n;i++) for(j=0;j<=m;j++) for(k=128-i;k<=128+i;k++) for(l=0;l<2;l++) if (dp[i][j][k][l]>=0) {\n//\t\tprintf(\"%d %d %d %d %d\\n\",i,j,k,l,dp[i][j][k][l]);\n\t\tif (s[i]=='F') {\n\t\t\tint pos;\n\t\t\tif (l) pos=k+1; else pos=k-1;\n\t\t\tint ret=dp[i][j][k][l];\n\t\t\tif (abs(pos-128)>ret) ret=abs(pos-128);\n\t\t\tif (ret>dp[i+1][j][pos][l]) dp[i+1][j][pos][l]=ret;\n\t\t\tif (jdp[i+1][j+1][k][!l]) dp[i+1][j+1][k][!l]=dp[i][j][k][l];\n\t\t\t}\n\t\t} else {\n\t\t\tif (dp[i][j][k][l]>dp[i+1][j][k][!l]) dp[i+1][j][k][!l]=dp[i][j][k][l];\n\t\t\tif (jret) ret=abs(pos-128);\n\t\t\t\tif (ret>dp[i+1][j+1][pos][l]) dp[i+1][j+1][pos][l]=ret;\n\t\t\t}\n\t\t}\n\t}\n\tint ret=0;\n\tfor(i=m%2;i<=m;i+=2) for(j=128-n;j<=128+n;j++) for(k=0;k<2;k++)\n\t\tif (dp[n][i][j][k]>ret) ret=dp[n][i][j][k];\n\tprintf(\"%d\\n\",ret);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "45c6e2b41b0f87c46d451244b370b2c8", "src_uid": "4a54971eb22e62b1d9e6b72f05ae361d", "apr_id": "ed7db13b8da629dfa2e287fa9be7f49c", "difficulty": 1800, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9826589595375722, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nmain()\n{\n int i,n,sum1=0,sum2=0;char str[100];\n scanf(\"%d %s\",&n,&str);\n for(i=0;i\nint main()\n{\n \n int m,d;\n scanf(\"%d%d\",m,d);\n int mday=0;\n switch(d)\n {\n case 1:mday=31;break;\n case 2:mday=28;break;\n case 3:mday=31;break;\n case 4:mday=30;break;\n case 5:mday=31;break;\n case 6:mday=30;break;\n case 7:mday=31;break;\n case 8:mday=31;break;\n case 9:mday=30;break;\n case 10:mday=31;break;\n case 11:mday=30;break;\n case 12:mday=31;break;\n }\n printf(\"%d\",(d-1)+mday%7==0? (d-1)+mday/7:((d-1)+mday/7)+1);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "d41b73cd06d699e7d151769d62d5a152", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "ad8c62b9880578c5f9569e0954111cdd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3372972972972973, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "# include \n# include \nint gcd(int a, int b);\nint lcm(int a, int b);\nint main()\n{\n int a,b,i;\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n if(a==b)\n printf(\"Equal\\n\");\n else\n {\n int count_a=0,count_b=0;\n for(i=1;i<=lcm(a,b);i++)\n {\n if(i%a==0 && i%b==0)\n {\n if(a>b)\n count_a++;\n else\n count_b++;\n }\n else if(i%a==0)\n count_a++;\n else if(i%b==0)\n count_b++;\n else\n {\n int f1=i/a;\n f1=f1+1;\n f1=f1*a;\n int f2=i/b;\n f2=f2+1;\n f2=f2*b;\n int d1=f1-i;\n int d2=f2-i;\n if(d1b)\n count_a++;\n else\n count_b++;\n }\n }\n }\n if(count_a>count_b)\n printf(\"Dasha\\n\");\n else if(count_b>count_a)\n printf(\"Masha\\n\");\n else\n printf(\"Equal\\n\");\n }\n}\nint gcd(int a, int b) \n{ \n int rem;\n while(b!=0)\n {\n rem =a%b;\n a=b;\n b=rem;\n }\n return a;\n} \n// Function to return LCM of two numbers \nint lcm(int a, int b) \n{ \n return (a*b)/gcd(a, b); \n} \n", "lang": "GNU C11", "bug_code_uid": "e1e20a95ea48e69adc3b6f2b6c4786c5", "src_uid": "06eb66df61ff5d61d678bbb3bb6553cc", "apr_id": "aed0d2f06fbe71c0818dec4419fbe3e2", "difficulty": 1500, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8216880939072108, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nint main() {\n long long int n,minw=0,maxw=0;\n long long int a[3],b[3],m[3];\n scanf(\"%lld \",&n);\n scanf(\"%lld %lld %lld \",&a[0],&a[1],&a[2]);\n scanf(\"%lld %lld %lld \",&b[0],&b[1],&b[2]);\n maxw+=a[0]>b[1]?b[1]:a[0];\n maxw+=a[1]>b[2]?b[2]:a[1];\n maxw+=a[2]>b[0]?b[0]:a[2];\n maxin=b[0]>b[1]?(b[0]>b[2]?0:2):(b[1]>b[2]?1:2);\n int minw=b[maxin]-a[maxin]-a[(maxin+1)%3];\n if(minw<0)\n minw=0;\n m[0]=b[0]>a[1]?a[1]:b[0];\n m[1]=b[1]>a[2]?a[2]:b[1];\n m[2]=b[2]>a[0]?a[0]:b[2];\n a[1]-=m[0];\n a[2]-=m[1];\n a[0]-=m[2];\n b[0]-=m[0];\n b[1]-=m[1];\n b[2]-=m[2];\n a[0]-=a[0]>b[0]?b[0]:a[0];\n a[1]-=a[1]>b[1]?b[1]:a[1];\n a[2]-=a[2]>b[2]?b[2]:a[2];\n //minw=a[0]+a[1]+a[2];\n printf(\"%lld %lld\",minw,maxw);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "8e135123cb77b02ee82e59b9e62d2356", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "apr_id": "89dbfadc15f2d5b60a9e3b936f5e776c", "difficulty": 1800, "tags": ["flows", "greedy", "math", "brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9852266938359654, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\ntypedef uint64_t uint64; typedef uint32_t uint32;\ntypedef uint16_t uint16; typedef uint8_t uint8;\ntypedef int64_t int64; typedef int32_t int32;\ntypedef int16_t int16; typedef int8_t int8;\n\n#define u8 PRIu8\n#define u16 PRIu16\n#define u32 PRIu32\n#define u64 PRIu64\n#define d8 PRId8\n#define d16 PRId16\n#define d32 PRId32\n#define d64 PRId64\n\n#define finc(i,size) for(uint64 i=0;i<(size);i++)\n#define fdec(i,size) for(uint64 i=(size);i-->0;)\n\n#define scanf_s scanf\nint main(void)\n{\n\tuint32 n;\n\tuint32 map[2][4];\n\tscanf_s(\"%\"u32\"\", &n);\n\tfinc(i, 2)\n\t\tfinc(j, 3)\n\t\tscanf_s(\"%\"u32\"\", &map[i][j]);\n\tfinc(i, 2)\n\t\tmap[i][3] = map[i][0];\n\n\tuint32 winmax = 0, winmin = 0;\n\tfinc(i, 3)\n\t\twinmax += min(map[0][i], map[1][i + 1]);\n\tfor (uint64 i = 1; i < 4; i++)\n\t{\n\t\tif (map[1][i - 1] + map[1][i] < map[0][i])\n\t\t\twinmin = map[0][i] - map[1][i - 1] - map[1][i];\n\t}\n\tprintf(\"%\"u32\" %\"u32\"\\n\", winmin, winmax);\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "667c4462a41708605758d00d24fdaef6", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "apr_id": "62eeccb2469c2da3995b73024f31689d", "difficulty": 1800, "tags": ["flows", "greedy", "math", "brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9972552607502287, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nlong long int min(long long int a,long long int b){\n\treturn (a>b)?b:a;\n}\n\nlong long int n;\n\nlong long int solve(long long int k,long long int a,long long int b,long long int c,long long int mon){\n\tif((k)%4==0){\n\t\treturn mon; \n\t}\n\tif(k>(n+100)){\n\t\treturn INT_MAX;\n\t}\n\treturn min(solve(k+1,a,b,c,mon+a),min(solve(k+2,a,b,c,mon+b),solve(k+3,a,b,c,mon+c)));\n}\n\nint main(void){\n\tlong long int a,b,c;\n\tscanf(\"%lld%lld%lld%lld\",&n,&a,&b,&c);\n\tlong long int ans=solve(n,a,b,c,0);\n\tprintf(\"%lld\\n\",ans);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "ddf1657003d02c4d177e96c2d6362d14", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "7bd29362abd21581d142163f05f5d948", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7207872078720787, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\n#define REP(i,a,b) for(i=a;i 3 || ab(y1-y2) > 3) puts(\"Second\");\n else puts(\"First\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9c7584111b70ca785d61f6812485c84f", "src_uid": "41f6f90b7307d2383495441114fa8ea2", "apr_id": "d342fa270e50bb3ec18e932f508d0a38", "difficulty": 2000, "tags": ["combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7405714285714285, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n, m, x1, y1, x2, y2;\n\n scanf(\"%d %d %d %d %d %d\", &n, &m, &x1, &y1, &x2, &y2);\n\n if (abs(x1 - x2) > abs(y1 - y2)) {\n int aux = abs(x1 - x2);\n abs(x1 - x2) = abs(y1 - y2);\n abs(y1 - y2) = aux;\n }\n\n if ((abs(x1 - x2) <= 2 && abs(y1 - y2) <= 4) || (abs(x1 - x2) == 3 && abs(y1 - y2) == 3)) {\n puts(\"First\");\n } else {\n puts(\"Second\");\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f481918c72bf506ba94a1fc655ec6e09", "src_uid": "41f6f90b7307d2383495441114fa8ea2", "apr_id": "73580e63be4d5371694e722245328a74", "difficulty": 2000, "tags": ["combinatorics", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9515789473684211, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main(void)\n{\n int p1,p2,p3,p4,a,b,i,cnt=0;\n scanf(\"%d%d%d%d%d%d\",&p1,&p2,&p3,&p4,&a,&b);\n for(i=a;i<=b;i++)\n if(i%p3%p2%p1%p4==i)\n cnt++;\n printf(\"%d\\n\",cnt);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "0ce47d34df773c830587d50a1d3e48c6", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "d8a522789457cd5aacbbf839f74c79ce", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.04380272550292018, "equal_cnt": 24, "replace_cnt": 16, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 24, "bug_source_code": "/* https://csacademy.com/submission/2215090/ */\n#include \n\n#define N\t50\n#define M\t(1 << 13) /* 2500 < M / 2 */\n#define LN\t13\n#define MD\t1000000007\n#define M0\t469762049\n#define M1\t595591169\n#define M2\t645922817\n\nint MM[] = { M0, M1, M2 };\n\nint V01, V02, V12;\n\nlong long power(int a, int b, int md) {\n\tlong long p;\n\n\tif (b == 0)\n\t\treturn 1;\n\tp = power(a, b / 2, md);\n\tp = p * p % md;\n\tif (b % 2)\n\t\tp = p * a % md;\n\treturn p;\n}\n\nlong long ww[3][LN + 1], ww_[3][LN + 1], vv[3];\nint kk[N + 1][N + 1][N + 1], ll[N + 1][N + 1][N + 1][3];\n\nvoid init() {\n\tint d, h, i, j, k;\n\n\tfor (d = 0; d < 3; d++) {\n\t\tint md = MM[d];\n\n\t\tfor (h = 0; h <= LN; h++) {\n\t\t\tww[d][h] = power(3, (md - 1) >> h, md);\n\t\t\tww_[d][h] = power(3, md - 1 - ((md - 1) >> h), md);\n\t\t}\n\t\tvv[d] = power(M, md - 2, md);\n\t}\n\tV01 = power(M0, M1 - 2, M1);\n\tV02 = power(M0, M2 - 2, M2);\n\tV12 = power(M1, M2 - 2, M2);\n\tfor (i = 0; i <= N; i++)\n\t\tfor (j = 0; j <= N; j++)\n\t\t\tfor (k = 0; k <= N; k++) {\n\t\t\t\tlong long k0, k1, k2;\n\n\t\t\t\tk0 = i > 0 ? (long long) ll[i - 1][j][k][0] * i % MD : 0;\n\t\t\t\tk1 = j > 0 ? (long long) ll[i][j - 1][k][1] * j % MD : 0;\n\t\t\t\tk2 = k > 0 ? (long long) ll[i][j][k - 1][2] * k % MD : 0;\n\t\t\t\tif (i == 0 && j == 0 && k == 0) {\n\t\t\t\t\tkk[i][j][k] = 1;\n\t\t\t\t\tll[i][j][k][0] = ll[i][j][k][1] = ll[i][j][k][2] = 1;\n\t\t\t\t} else {\n\t\t\t\t\tkk[i][j][k] = (k0 + k1 + k2) % MD;\n\t\t\t\t\tll[i][j][k][0] = (k1 + k2) % MD;\n\t\t\t\t\tll[i][j][k][1] = (k0 + k2) % MD;\n\t\t\t\t\tll[i][j][k][2] = (k0 + k1) % MD;\n\t\t\t\t}\n\t\t\t}\n}\n\nvoid ntt(int *aa, int d, int inverse) {\n\tint md = MM[d], h, i, j, b, l, r, u, v, tmp;\n\tlong long w, w_;\n\n\tfor (i = 1, j = 0; i < M; i++) {\n\t\tb = M;\n\t\tdo\n\t\t\tj ^= b >>= 1;\n\t\twhile ((j & b) == 0);\n\t\tif (i < j)\n\t\t\ttmp = aa[i], aa[i] = aa[j], aa[j] = tmp;\n\t}\n\tfor (h = 0; (b = 1 << h) < M; h++) {\n\t\tw_ = inverse ? ww_[d][h + 1] : ww[d][h + 1];\n\t\tfor (i = 0; i < M; i += b * 2) {\n\t\t\tw = 1;\n\t\t\tfor (j = 0; j < b; j++) {\n\t\t\t\tl = i + j, r = l + b;\n\t\t\t\tu = aa[l], v = aa[r] * w % md;\n\t\t\t\tif ((aa[l] = u + v) >= md)\n\t\t\t\t\taa[l] -= md;\n\t\t\t\tif ((aa[r] = u - v) < 0)\n\t\t\t\t\taa[r] += md;\n\t\t\t\tw = w * w_ % md;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid fft(int *aa, int *bb, int d) {\n\tint md = MM[d], i;\n\tlong long v;\n\n\tntt(aa, d, 0), ntt(bb, d, 0);\n\tfor (i = 0; i < M; i++)\n\t\taa[i] = (long long) aa[i] * bb[i] % md;\n\tntt(aa, d, 1);\n\tv = vv[d];\n\tfor (i = 0; i < M; i++)\n\t\taa[i] = aa[i] * v % md;\n}\n\nint garner(int r0, int r1, int r2) {\n\tif (r0 < 0)\n\t\tr0 += M0;\n\tr1 = (long long) (r1 - r0) * V01 % M1;\n\tif (r1 < 0)\n\t\tr1 += M1;\n\tr2 = ((long long) (r2 - r0) * V02 - r1) % M2 * V12 % M2;\n\tif (r2 < 0)\n\t\tr2 += M2;\n\treturn (((long long) r2 * M1 + r1) % MD * M0 + r0) % MD;\n}\n\nvoid mult(int *aa, int *bb, int *cc) {\n\tstatic int cc_[3][M], bb_[M];\n\tint d, i;\n\n\tfor (d = 0; d < 3; d++) {\n\t\tfor (i = 0; i < M; i++) {\n\t\t\tcc_[d][i] = aa[i];\n\t\t\tbb_[i] = bb[i];\n\t\t}\n\t\tfft(cc_[d], bb_, d);\n\t}\n\tfor (i = 0; i < M; i++)\n\t\tcc[i] = garner(cc_[0][i], cc_[1][i], cc_[2][i]);\n}\n\nvoid knapsack(int *aa, int n, int m, int dp[][M]) {\n\tint h, i, j, a;\n\n\tdp[0][0] = 1;\n\tfor (h = 0; h < n; h++) {\n\t\ta = aa[h];\n\t\tfor (i = n; i >= 1; i--)\n\t\t\tfor (j = m; j >= a; j--)\n\t\t\t\tdp[i][j] = (dp[i][j] + dp[i - 1][j - a]) % MD;\n\t}\n}\n\nint main() {\n\tstatic int aa[3][N], cc[M], nn[3], dp[3][N + 1][M];\n\tint n, m, x, h, i0, i1, i2, j, ans;\n\n\tinit();\n\tscanf(\"%d%d\", &n, &m);\n\twhile (n--) {\n\t\tscanf(\"%d%d\", &x, &h), h--;\n\t\taa[h][nn[h]++] = x;\n\t}\n\tfor (h = 0; h < 3; h++)\n\t\tknapsack(aa[h], nn[h], m, dp[h]);\n\tans = 0;\n\tfor (i0 = 0; i0 <= nn[0]; i0++)\n\t\tfor (i1 = 0; i1 <= nn[1]; i1++) {\n\t\t\tmult(dp[0][i0], dp[1][i1], cc);\n\t\t\tfor (i2 = 0; i2 <= nn[2]; i2++)\n\t\t\t\tfor (j = 0; j <= m; j++)\n\t\t\t\t\tans = (ans + (long long) cc[j] * dp[2][i2][m - j] % MD * kk[i0][i1][i2]) % MD;\n\t\t}\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d859a967fd419baba34d9d728047e3a1", "src_uid": "ed5f913afe829c65792b54233a256757", "apr_id": "f803e03bf5a7005bc6dff39bb2bbad9b", "difficulty": 2600, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5183112919633774, "equal_cnt": 26, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 25, "bug_source_code": "#include \n\n#define max2(a,b) (a T)\n return 0;\n if (t == T) {\n u64 r = 0;\n for (int g = 0; g < 3; g++)\n r = add2(r, perm[n[0]][n[1]][n[2]][g]);\n r = mul2(r, fact3(n[0],n[1],n[2]));\n // printf(\"%d [%d,%d,%d]: %d -> %d\\n\", t, n[0], n[1], n[2], G[c], r);\n return r;\n }\n\n u64 result = 0;\n for (int i = c + 1; i < N; i++) {\n n[G[i]]++;\n result = add2(result, walk(t + L[i], i));\n n[G[i]]--;\n }\n\n return result;\n}\n\nint main() {\n int i, j, k, n;\n\n scanf(\"%d %d\", &N, &T);\n for (i = 0; i < N; i++) {\n scanf(\"%d %d\", &L[i], &G[i]);\n G[i]--;\n }\n\n perm[1][0][0][0] = perm[0][1][0][1] = perm[0][0][1][2] = 1;\n\n for (n = 2; n <= N; n++)\n for (i = 0; i <= n/2+1; i++)\n for (j = 0; j <= n - i; j++) {\n k = n - i - j;\n if (k > n/2+1) continue;\n\n if (i) perm[i][j][k][0] = add2(perm[i-1][j][k][1], perm[i-1][j][k][2]);\n if (j) perm[i][j][k][1] = add2(perm[i][j-1][k][2], perm[i][j-1][k][0]);\n if (k) perm[i][j][k][2] = add2(perm[i][j][k-1][0], perm[i][j][k-1][1]);\n }\n\n printf(\"%llu\\n\", walk(0, -1));\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a277a300144b70b34eb76341cecdfae8", "src_uid": "ed5f913afe829c65792b54233a256757", "apr_id": "56af6a4527496a7dacada2078c27a675", "difficulty": 2600, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9968911917098445, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \nint main() {\n\tint n, ac=0, bc=0, o=0, i, l, j;\t\n\tscanf(\"%d\", &n);\n\tint a[n];\n\tint b[n];\n\tfor(i=0; i\n#include\nint main()\n{\n\tint n,x[7],y[7],i,count=0,sum1=0,sum2=0,temp;\n\tscanf(\"%d\",&n);\n\tfor(i=0;i\nint main()\n {\n int a[10],b[10],c,d,t1,t2,i;\n scanf(\"%d\",&c);\n t1=0;t2=0;\n for(i=0;i0)printf(\"%d\\n\",d);\n }\n return 0;\n }\n", "lang": "GNU C", "bug_code_uid": "3dabf87005b7a445628fbcc9eea72e87", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "2b96accb1968d419b68902f19a4601a1", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3928944618599791, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint countTriangles(int n){\n int res=0;\n int a,b,c=1;\n for(;c<=n;c++){\n\n for(b=1;b<=c;b++){\n for(a=1;a<=b;a++){\n\n if((a*a+b*b)==c*c)\n res++;\n }\n }\n }\n return res;\n}\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n printf(\"%d\",countTriangles(n));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c82f05bfc27c3e9bb95ed89be95182a6", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "4d5975b23b4aff0400f7d1c636622426", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.08720379146919431, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \nint a[100],max=0;\nvoid dfs(int pos,int n)\n{\n int i,sum=0;\n if(pos==n)\n {\n max++;\n }\n for(i=pos;n>i;i++)\n {\n sum=sum+a[i];\n if(sum==1)\n {\n dfs(i+1,n);\n }\n else if(sum>1)\n {\n break;\n }\n }\n}\nint main()\n{\n int n,i;\n scanf(\"%d\",&n);\n for(i=0;n>i;i++)\n {\n scanf(\"%d\",&a[i]);\n }\n dfs(0,n);\n printf(\"%d\",max);\n return 0;\n}\n\n\t \t \t\t \t \t\t \t \t \t", "lang": "GNU C", "bug_code_uid": "25e8ca5f9c016e12eff8296f6e31b5f8", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "42b2370de846a8481d3bbdf661d0f929", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.30327868852459017, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n\n#define MAXCHAR 1000\nint main(int argc, char const *argv[])\n{\n\tFILE *fp;\n\tchar str[MAXCHAR];\n\tchar* filename = \"./input.txt\";\n\tif (fp == NULL){\n printf(\"Could not open file %s\",filename);\n return 1;\n }\n\twhile (fgets(str, MAXCHAR, fp) != NULL)\n printf(\"%s\", str);\n if(str == \"A278832\") printf(\"0\");\n if(str == \"A089956\") printf(\"0\");\n if(str == \"A089957\") printf(\"1\");\n if(str == \"A144045\") printf(\"1\");\n\tfclose(fp);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "2e04caf2c0ade541605e11f0071ded09", "src_uid": "e52bc741bb72bb8e79cf392b2d15354f", "apr_id": "724fd459f23622504038abe64b3fba30", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8814317673378076, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\n/* maximum factors count, 10 must be enough. I take few more ) */\nconst int64_t cnt = 1000; \n\nint64_t\ndecompose(int64_t x, int64_t *p)\n{\n /* factors counter */\n int64_t c = 0;\n for (int64_t d = 2, b = x; x*x >= b; ++d)\n {\n if (x % d == 0)\n p[c++] = d;\n while (x % d == 0)\n x /= d;\n }\n if (x != 1) {\n p[c++] = x;\n }\n return c;\n}\n\nint\nmain()\n{\n int64_t x;\n int64_t p[cnt];\n scanf(\"%\"SCNd64, &x);\n\n int64_t c = decompose(x, p);\n\n int64_t max_f = x;\n int64_t min_f = x - p[c-1] + 1;\n int64_t min = min_f;\n for (int64_t f = min_f; f < max_f; ++f) {\n c = decompose(f, p);\n if ((c != 1 || p[0] != f) && f - p[c-1] + 1 < min)\n min = f - p[c-1] + 1;\n }\n printf(\"%\"PRId64\"\\n\", min);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "4f287b99fd517b2145b1de9c29eca91a", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "b25c819d02bcf8fe34afe4da9a17a7b9", "difficulty": 1700, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.17299919159256266, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "#include\n\nint main()\n{\n\tint t;\n\tscanf(\"%d\",&t);\n\tint num[t];\n\tfor(int i=0;i\n\ntypedef long long unsigned int u64;\n\nint main(){\n\tu64 l, r, ans, bt;\n\tscanf(\"%llu%llu\", &l, &r);\n\tans = l ^ r;\n\tbt = 1ull << 61;\n\twhile(!(bt & ans)) bt >>= 1;\n\tprintf(\"%llu\", bt^(bt-1));\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "697d26fdc5a6d7d7283fea3134974591", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "2e2fe2f418da2faeed3c73da08e03d8c", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9712041884816754, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main()\n{\n\twhile(1)\n\t{\n\t\tint min;\n\t\tscanf(\"%d\",&min);\n\t\tint a[min+1],i;\n\t\tfor(i=0;i15)\n\t\t\t{\n\t\t\t\tprintf(\"15\\n\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(a[i+1]-a[i]>15)\n\t\t\t{\n\t\t\t\tprintf(\"%d\\n\",a[i]+15);\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t\t//printf(\"%d\",a[i+1]-a[i]);\n\t\t}\n\t\tif(i==min)\n\t\tprintf(\"90\\n\");\n\t}\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "4dff892382aff2152b885af6ff89a61c", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "1b7542133300c23f7657a5b71f056400", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.827027027027027, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main()\n{\nchar str[12][30]={\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"};\nchar str1[30];\nint i,n;\nscanf(\"%s\",str1);\nfor(i=0;i<12;i++)\n{\n if(str1[30]==str[i][30])\n break;\n}\nscanf(\"%d\",&n);\nif((i+n)<12)\nprintf(\"%s\",str[i+3][30]);\nelse\nprintf(\"%s\",str[(i+3)%12][30]);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "d801a92850a04e003b1d69a2e7550450", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "76d3c82d75a392494c5ad477113e59ae", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6510989010989011, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main()\n{\n int n,i,c=0,c1=0,j;\n char a[10];\nscanf(\"%d\",&n);\nscanf(\"%s\",a);\nfor(i=0;i\nint main()\n{\n int n,m,k,a,b,i,f=1;\n scanf(\"%d\",&n);\n for(a=b=k=i=0;ib) printf(\"%d\\n\",a);\n else printf(\"%d\\n\",k+b);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a011cfb2c97735cbfed8630a9603b9b3", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "c0ed4bb5e238998b5d1b10b538b9f20e", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8436482084690554, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main(void){\n\tint size;\n\tscanf(\"%d\", &size);\n\tint left[size];\n\tint right[size];\n\tint success[size];\n\tint read;\n\tint i = 0;\n\twhile(i < size){\n\t\tscanf(\"%d\", &read);\n\t\tsuccess[i] = read;\n\t\ti++;\n\t}\n\ti = 0;\n\tleft[i] = (success[i] == 0);\n\ti++;\n\twhile(i < size){\n\t\tleft[i] = left[i-1] + (success[i] == 0);\n\t\ti++;\n\t}\n\ti = size - 1;\n\tright[i] = (success[i] == 1);\n\ti--;\n\twhile(i >= 0){\n\t\tright[i] = right[i+1] + (success[i] == 1);\n\t\ti--;\n\t}\n\ti = 0;\n\tint max = 0;\n\twhile(i < size){\n\t\tprintf(\"%d %d\\n\", left[i], right[i]);\n\t\tif(left[i] + right[i] > max){\n\t\t\tmax = left[i] + right[i];\n\t\t}\n\t\ti++;\n\t}\n\tprintf(\"%d\\n\", max);\n}\n", "lang": "GNU C", "bug_code_uid": "d8db3a62b6447d8c1575da678ffc3a6e", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "df04e4ced490e28f67a4a019ca12d73a", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9586776859504132, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main(int argc, char *argv[])\n{\n\tint m, n, a, b ;\n\t\n\tscanf(\"%d %d %d %d\", &n, &m, &a, &b) ;\n\t\n\tif ((((a - 1) / m) == ((b - 1) / m)) || (!((a - 1) % m) && !(b % m)) || (!((a - 1) % m) && (b == n)))\n\t{\n\t\tprintf(\"1\\n\") ;\n\t}\n\telse if (((((a - 1) % m) && !(b % m)) || (!((a - 1) % m) && (b % m))) || (((a - 1) % m) == (b % m)) || (b == a + m) || (b == n))\n\t{\n\t\tprintf(\"2\\n\") ;\n\t}\n\telse\n\t{\n\t\tprintf(\"3\\n\") ;\n\t}\n\t\n\treturn 0 ;\n}\n", "lang": "GNU C", "bug_code_uid": "12a38e00154c7bd3eab08f659a3b8230", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "96f1131905249bbf7aa5ce5e9c55e21c", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9561752988047809, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint n,m,a,b,ux,dx,uy,dy;\n\nmain()\n{\n scanf(\"%d%d%d%d\",&n,&m,&a,&b);\n ux=~-a%m; dx=~-b%m;\n uy=~-a/m; dy=~-b/m;\n\n if(uy==dy) puts(\"1\");\n else if(ux==0) puts(dx==m-1||b==n?\"1\":\"2\");\n else if(b==n) puts(\"2\");\n else if(dx==m-1) puts(\"2\");\n else if(dy-uy==1) puts(\"2\");\n else puts(\"3\");\n return 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "ed64c3b473047d1a4a54a60e9d73e07f", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "a4e43685131c2d797e7c616fb9f61b6e", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8416523235800344, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,cnt;\n scanf(\"%d %d %d %d\",&a,&b,&c,&d);\n if(c>d)\n {\n a*=c;\n b*=c;\n }\n else\n {\n a*=d;\n b*=d;\n }\n if((float)a/c>(float)b/d)\n {\n a*=d;\n c*=b;\n cnt=a-c;\n printf(\"%d/%d\",cnt/hcf(cnt,a),a/hcf(cnt,a));\n }\n else\n {\n b*=c;\n d*=a;\n cnt=b-d;\n printf(\"%d/%d\",cnt/hcf(cnt,b),b/hcf(cnt,b));\n }\n return 0;\n}\nint hcf(int a,int b)\n{\n while(a!=b)\n {\n if(a>b)\n a-=b;\n else\n b-=a;\n }\n return a;\n}\n", "lang": "GNU C", "bug_code_uid": "66710f8e486a7aa36dcdab45b0391054", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "bd7aaa753ce7ae5581190a652574b535", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9355852317360566, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \n\n#define MIN(a,b) a < b ? a : b\nint main() {\n\tint t[3][3];\n\tint i, j;\n\tint n;\n\tlong long cost[3][3][41];\n\tfor(i = 0; i < 3; i++) {\n\t\tfor(j = 0; j < 3; j++) {\n\t\t\tscanf(\"%d\", &t[i][j]);\n\t\t}\n\t}\n\tscanf(\"%d\", &n);\n\n\tfor(i = 0; i < 3; i++) {\n\t\tfor(j = 0; j < 3; j++) {\n\t\t\tif(i == j)\n\t\t\t\tcost[i][j][1] = 0;\n\t\t\telse {\n\t\t\t\tint k = 3 - ( i + j );\n\t\t\t\tcost[i][j][1] = MIN(t[i][j], t[i][k] + t[k][j]);\n\t\t\t}\n\t\t}\n\t}\n\tint nn;\n\tfor(nn = 2; nn <= n ; nn++) {\n\t\tfor(i = 0; i < 3; i++) {\n\t\t\tfor(j = 0; j < 3; j++) {\n\t\t\t\tif(i == j)\n\t\t\t\t\tcost[i][j][nn] = 0;\n\t\t\t\telse {\n\t\t\t\t\tint k = 3 - ( i + j );\n\t\t\t\t\tcost[i][j][nn] = MIN(\n\t\t\t\t\t\t\t\t\t\t\tcost[i][k][nn-1] + cost[k][j][nn-1] + t[i][j],\n\t\t\t\t\t\t\t\t\t\t\tcost[i][j][nn-1] + t[i][k] + cost[j][i][nn-1] + t[k][j] + cost[i][j][nn-1]\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < 3; i++) {\n\t\t\tfor(j = 0; j < 3; j++) {\n\t\t\t\tif(i != j) {\n\t\t\t\t\tint k = 3 - (i + j);\n\t\t\t\t\tcost[i][j][nn] = MIN(cost[i][j][nn], cost[i][k][nn] + cost[k][j][nn]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n/*\tfor(nn = 1; nn <= n; nn++) {\n\t\tprintf(\"%d\\n\", nn);\n\t\tfor(i = 0; i < 3; i++) {\n\t\t\tfor(j = 0; j < 3; j++) {\n\t\t\t\tprintf(\"%3d\", cost[i][j][nn]);\n\t\t\t}\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n*/\n\tprintf(\"\\n%d\\n\", cost[0][2][n]);\n\n\t\n\n\n\n\t\n}\n\n", "lang": "GNU C", "bug_code_uid": "cc5ae72674390b35519ef0bf4bdb95c0", "src_uid": "c4c20228624365e39299d0a6e8fe7095", "apr_id": "0b94e362191dfd409990d014fd304a8c", "difficulty": null, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9389763779527559, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#define MAX_SIZE 100\n\nint read_words(char* w1, char* w2){\n int len, i;\n scanf(\"%i\", &len);\n for(i=0; i\nint main()\n{\n int k,l,m,n,o,p,a,b,c;\n scanf(\"%d%d%d\",a,b,c);\n k=a*b*c;\n l=a+b+c;\n m=(a*b)+c;\n n=a+(b*c);\n o=(a+b)*c;\n p=a*(b+c);\n if(k>=l&&k>=m&&k>=n&&k>=o&&k>=p){\n printf(\"%d\",k);\n }\n else if(l>=k&&l>=m&&k>=n&&l>=o&&l>=p){\n printf(\"%d\",l);\n }\n else if(m>=k&&m>=l&&m>=n&&m>=o&&m>=p){\n printf(\"%d\",m);\n }\n else if(n>=k&&n>=l&&n>=m&&n>=o&&n>=p){\n printf(\"%d\",n);\n }\n else if(o>=k&&o>=l&&o>=m&&o>=n&&o>=p){\n printf(\"%d\",o);\n }\n else{\n printf(\"%d\",p);\n }\n return 0;\n \n \n}", "lang": "GNU C", "bug_code_uid": "fd3b143ee18956679f6781613b53dc04", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "6e2ce7f645f9e96ee5fa56078457c570", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.919732441471572, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,k;\n scanf(\"%d %d\",&n,&k);\n if(k==1)\n printf(\"%d\\n\",3*(n-k+1));\n else if(k==2)\n printf(\"%d\",3*(n-k+1)+4);\n else if(k>n/2)\n printf(\"%d\",4*n-k;\n else\n {\n printf(\"%d\",3*n+k-1);\n \n }\n \n}", "lang": "GNU C11", "bug_code_uid": "4b085a81731b8c7aa531401a59b3ef79", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "apr_id": "e5319c9e8c2785c12f8954e8042d7b8b", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9172297297297297, "equal_cnt": 11, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\nint main()\n{\n int arr[4];\n for(int i=0;i<4;i++)\n {\n scanf(\"%d\",arr[i]);\n }\n for(int i=0;i<4;i++)\n {\n for(int j=i+1;j<4;j++)\n {\n int m=arr[i];\n if(arr[i]\n#include \n\nmain()\n{\nint n,m,count1;\nscanf(\"%d\",\"%d\",&n,&m);\nif(n>=m){\n count1=m;\n}\nelse{\n count1=n;\n}\nif(count1%2==0){\n printf(\"Malvika\");\n}\nelse{\n printf(\"Akshat\");\n}\n}\n", "lang": "GNU C", "bug_code_uid": "460988396aae0835be54f4663d9a073e", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "13f68539fece2586c360ce08963dcca1", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7628865979381443, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n char s1[101], s2[101],s3[101];\n int i;\n scanf(\"%s\",&s1);\n scanf(\"%s\",&s2);\n\n for(i=0;;i++)\n {\n if(s1[i]==s2[i])\n {\n s3[i]='0';\n }\n else if(s1[i]!=s2[i])\n {\n s3[i]='1';\n }\n else if(s1[i]=='\\0')\n {\n s3[i]='\\0';\n break;\n \n }\n }\n printf(\"%s\",s3);\n\n}\n", "lang": "GNU C", "bug_code_uid": "c8d8ccadb8151f038cff69f1e349eee7", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "283eb98428a6a8850f99d0a86591b83d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5469107551487414, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \nint main()\n{\n int *ara;\n int i,n,count=0;\n scanf(\"%d\",&n);\n for(i=0;i\n#include\n#include\nusing namespace std;\nint big[3][3];\nbool cmp(int a,int b){\n\treturn !big[a][b];\n}\nint main(){\n\tchar s[20];\n\tint qq=3;\n\tmemset(big,-1,sizeof(big));\n\twhile(qq--){\n\t\tscanf(\"%s\",s);\n\t\tif(s[1]=='<'){\n\t\t\t\tbig[s[2]-'A'][s[0]-'A']=1;\n\t\t\t\tbig[s[0]-'A'][s[2]-'A']=0;\n\t\t}else{\n\t\t\t\tbig[s[0]-'A'][s[2]-'A']=1;\n\t\t\t\tbig[s[2]-'A'][s[0]-'A']=0;\n\t\t}\n\t}\n\tif(big[0][1]&&big[1][2]&&big[2][0]||!big[0][1]&&!big[1][2]&&!big[2][0])printf(\"Impossible\\n\");\n\telse{\n\t\tint i,num[3];\n\t\tfor(i=0;i<3;i++)num[i]=i;\n\t\tsort(num,num+3,cmp);\n\t\tfor(i=0;i<3;i++)printf(\"%c\",num[i]+'A');\n\t\tprintf(\"\\n\");\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "d5532a15a18acbd411662bc6c1b0b484", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "apr_id": "833e952f02d8184252f6c4881912aba2", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9540768509840675, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nchar s[10];\nint r[5][5];\nchar a[5];\n\nint main()\n{\n int i, j, k, cnt;\n memset(r, 255, sizeof(r));\n for (i = 0; i < 3; i ++)\n {\n scanf(\"%s\", s);\n if (s[1] == '>')\n {\n r[s[0] - 'A'][s[2] - 'A'] = 1;\n r[s[2] - 'A'][s[0] - 'A'] = 0;\n }\n else\n {\n r[s[0] - 'A'][s[2] - 'A'] = 0;\n r[s[2] - 'A'][s[0] - 'A'] = 1;\n }\n }\n for (i = 0; i < 3; i ++)\n {\n for (j = 0; j < 3; j ++)\n {\n cnt = 0;\n for (k = 0; k < 3; k ++)\n {\n if (j != k && r[k][j] == 0)\n {\n cnt ++;\n if (cnt > i)\n {\n break;\n }\n }\n }\n if (cnt == i)\n {\n a[i] = 'A' + j;\n break;\n }\n }\n }\n a[3] = '\\0';\n printf(\"%s\\n\", a);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c26e529bc154d9f336fed4afa0e6ff3a", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "apr_id": "13c2463f086b19fcbe7574340fb09c6e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7408866995073892, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\n\t// n! = n*(n-1)!\nint factoriel(int number){\n\t\n\tif(number==1||number==0){return 1 ;}\t\n\tint i ;\n\tfor(i=number-1;i>0;i--){\n\t\tnumber=number*i;\n\t}\n\treturn number;\n}\nint main(int argc, char *argv[])\n{\n\tint a , b , result ;\n\tscanf(\"%d\",&a);\n\tscanf(\"%d\",&b);\n\tresult=factoriel(b)/factoriel(a);\n\tresult=result%10;\n\tprintf(\"%d\",result);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "2fb5dfc9eb1d8af25c20804b9f0fdbcd", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "e5dcb5ece859d766d08c853702397af5", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9696635410921125, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n#include\n#include\n#include\n#define SORT(a,n) qsort(a,n,sizeof(int),intcmp)\n#define s(n) scanf(\"%d\",&n)\n#define sc(n) scanf(\"%c\",&n)\n#define sl(n) scanf(\"%I64d\",&n)\n#define sf(n) scanf(\"%lf\",&n)\n#define ss(n) scanf(\"%s\",n)\n#define fill(a,v) memset(a, v, sizeof(a))\nint intcmp(const void *f,const void *s)\n{\n return (*(int *)f -*(int *)s);\n}\nint gcd(int a,int b){ return ((b==0)?a:gcd(b,a%b));}\n\n#define MAX\n#define MODBY 1000000009\n\ntypedef long long int lld;\ntypedef long double Lf;\n\nint main()\n{\n int i,j,n,m;\n scanf(\"%d\",&n);\n scanf(\"%d\",&m);\n if(m==1){\n printf(\"0\\n\");\n return 0;\n }\n lld a=1;\n for(i=0;i\n\n#define MOD 1000000009\n\nint power(int, int, int);\n\nint main()\n{\n\tint n, m;\n\tscanf(\"%d %d\", &n, &m);\n\n\tint p = power(2, m, MOD);\n\tint sol = 1;\n\tint i;\n\tfor (i=1;i<=n;i++)\n\t{\n\t\tint t = p - i;\n\t\tif (t<0) t+=MOD;\n\t\tsol *= t;\n\t\tsol %= MOD;\n\t}\n\n\tprintf(\"%d\\n\", sol);\n\treturn 0;\n}\n\nint power(int base, int exp, int mod)\n{\n\tif (!exp) return 1;\n\tint t = power(base, exp / 2, mod);\n\tint tt = (exp & 1)?base:1;\n\treturn (((t * t) % mod) * tt) % mod;\n}", "lang": "GNU C", "bug_code_uid": "9597db496925576ba69440bd4fccb026", "src_uid": "fef4d9c94a93fcf6d536f33503b1d4b8", "apr_id": "651034fcbce7ad3a646ab78fdbe31509", "difficulty": 1300, "tags": ["combinatorics", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.1018957345971564, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main(){\n\tint n,pos,l,r,res;\n\twhile(scanf(\"%d%d%d%d\",&n, &pos, &l, &r)){\n\t\tif(l==1 && r==n){\n\t\t\tres=0;\n\t\t}\n\t\telse if(l==1){\n\t\t\tres=abs(pos-r)+1;\n\t\t}\n\t\telse if(r==n){\n\t\t\tres=abs(pos-l)+1;\n\t\t}\n\t\telse{\n\t\t\tif(l<=pos && pos<=r){\n\t\t\t\tres=pos-2*l+r+2;\n\t\t\t\t//printf(\"1\\n\");\n\t\t\t}\n\t\t\telse if(l>pos){\n\t\t\t\tres=r-pos+2;\n\t\t\t\t//printf(\"1\\n\");\n\t\t\t}\n\t\t\telse if(r\nint main()\n{\n int n,pos,a,b,l,r,min,max,count=0;\n scanf(\"%d%d%d%d\",&n,&pos,&l,&r);\n a = 1;\n b = n;\n if ((l!=a)||(b!=r))\n{ if (posr) \n {\n max = a*(a>(pos-1)) + (pos-1)*((pos-1)>a);\n pos = max;\n count++;\n } \n if((r-pos)<(pos-l))\n { \n if(b!=r)\n {\n while(pos!=r)\n {\n min = b*(b<(pos+1)) + (pos+1)*((pos+1)(pos-1)) + (pos-1)*((pos-1)>a);\n pos = max;\n count++;\n }\n a = l;\n count++;\n }\n }\n if(((pos-l)<(r-pos))||((pos-l)==(r-pos)))\n { \n if(a!=l)\n {\n while(pos!=l)\n {\n max = a*(a>(pos-1)) + (pos-1)*((pos-1)>a);\n pos = max;\n count++;\n }\n a = l;\n count++;\n }\n if(b!=r)\n {\n while(pos!=r)\n {\n min = b*(b<(pos+1)) + (pos+1)*((pos+1)\nint main()\n{\n int n,i,max=0,min=0;\n scanf(\"%d\",&n);\n int a[n],b=0;\n for(i=0;ia[i+1]&&a[min]>a[i+1])\n {\n min=0;\n min=i+1;\n }\n }\n\n if(min>max)\n {\n //b=min;\n if(n-1-min>=max)\n {\n b=n-1-max;\n }\n else\n {\n b=min;\n }\n }\n else\n {\n b=n-1-min;\n\n }\n printf(\"%d\",b);\n main();\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "533b0bacbc1901787b5649a424ed8449", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "dd4090aa39aee48d2c810c9b4060da48", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9911971830985915, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\n#define swap(x,y,t) (t=x,x=y,y=t)\n//#define li long int\nint main(){\n int x,i,h,m,c=0;\n scanf(\"%d\",&x);\n scanf(\"%d %d\",&h,&m);\n if(h%10==7 || m%10==7)\n printf(\"0\\n\");\n else{\n while(h%10!=7 && m%10!=7){\n if(m>x)\n {m=m-x;c++;}\n else{c++;\n m=60-x+m;\n if(h==0)\n h=23;\n else\n h=h-1;\n }\n }\n printf(\"%d\\n\",c);\n }\n return 1;\n}\n", "lang": "GNU C", "bug_code_uid": "579bf328cf643402c5700f223ba8e02b", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "9173e577df3e9cc2baa37cece4a55f48", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9166666666666666, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nchar a[100];\nint s,i,n;\nint main()\n{\nscanf(\"%d\",&n);\nscanf(\"%s\",a);\nwhile (i\n#include\nint main()\n{\t\n\tint n;\n\tscanf(\"%d\", &n);\n\n\tchar a[n];\n\tscanf(\"%s\", a);\n\t\n\tint i, count=0, pair=0, solo=0;\t\n\n\t\n\ti=0;\n\twhile(n>0)\n\t{\n\t\tif(a[i]=='R')\n\t\t{\t\n\t\t\tif(a[i+1]=='U')\n\t\t\t{\n\t\t\t\tpair++;\n\t\t\t\tn--;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if(a[i+1]=='R')\n\t\t\t{\n\t\t\t\tsolo++;\n\t\n\t\t\t}\n\t\t}\n\t\telse if(a[i]=='U')\n\t\t{\n\t\t\tif(a[i+1]=='R')\n\t\t\t{\n\t\t\t\tpair++;\n\t\t\t\tn--;\n\t\t\t\ti++;\t\t\t\t\n\t\t\t}\n\t\t\telse if(a[i+1]=='U')\n\t\t\t{\n\t\t\t\tsolo++;\n\t\t\t\t\n\t\t\t}\n\t\t\tn--;\n\t\t\ti++;\t\t\t\t\n\t\t}\n\t\t//printf(\"\\n%d %d %d\",i , pair, solo);\n\t}\n\tcount=pair+solo;\n\tprintf(\"%d\", count);\n}\n", "lang": "GNU C", "bug_code_uid": "ae319f161c2e6000ab22e56bef55d201", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "ce0fadc531256fe15ee74175e1ba018d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.945332211942809, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \n\nint verif(char *ch,char *mdp)\n{ char cha[3]; int i,a=0;\n for(i=0;i\nint main()\n{\n long long a[4],d,s=0,t,i,j;\n scanf(\"%lld%lld%lld%lld\",&a[0],&a[1],a[2],&d);\n for(j=1; j<3; j++)\n for(i=0; i<2; i++)\n if(a[i]>a[i+1])\n t=a[i],a[i]=a[i+1],a[i+1]=t;\n if(a[1]-a[0]\n\n#define N\t3000\n#define M\t3000\n\nvoid slide(int *aa, int *bb, int n, int m) {\n\tstatic int qq[N];\n\tint i, head, cnt;\n\n\thead = cnt = 0;\n\tfor (i = 0; i < n; i++) {\n\t\twhile (cnt && aa[qq[head + cnt - 1]] > aa[i])\n\t\t\tcnt--;\n\t\tqq[head + cnt++] = i;\n\t\tif (i >= m - 1)\n\t\t\tbb[i - m + 1] = aa[qq[head]];\n\t\tif (qq[head] == i - m + 1)\n\t\t\thead++, cnt--;\n\t}\n}\n\nint main() {\n\tstatic int aa[N][M], bb[N][M], cc[N], dd[N];\n\tint n, m, a, b, g, x, y, z, i, j;\n\tlong long ans;\n\n\tscanf(\"%d%d%d%d%d%d%d%d\", &n, &m, &a, &b, &g, &x, &y, &z);\n\tfor (i = 0; i < n; i++)\n\t\tfor (j = 0; j < m; j++) {\n\t\t\taa[i][j] = g;\n\t\t\tg = (long long) (g * x + y) % z;\n\t\t}\n\tfor (i = 0; i < n; i++)\n\t\tslide(aa[i], bb[i], m, b);\n\tans = 0;\n\tfor (j = 0; j + b <= m; j++) {\n\t\tfor (i = 0; i < n; i++)\n\t\t\tcc[i] = bb[i][j];\n\t\tslide(cc, dd, n, a);\n\t\tfor (i = 0; i + a <= n; i++)\n\t\t\tans += dd[i];\n\t}\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "74c992626f3122fcdfcb57dc5d6efab3", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "b8c8d726395b5272884988f768013e91", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9743589743589743, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main()\n{int x,i,flag=0;\n\n scanf(\"%d\",&x);\n x=x+1;\n while(x<1000||x>9000){\n scanf(\"%d\",&x);\n }\n\n while(flag==0)\n {flag=1;\n if(x%10==(x/10)%10||x%10==(x/100)%10||x%10==(x/1000)%10||(x/10)%10==(x/100)%10||(x/10)%10==(x/1000)%10||(x/100)%10==(x/1000)%10)\n {\n flag=0;\n x=x+1;\n }\n }\n printf(\"%d\",x);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9ab3ded98a7e8191c91d463b66e81137", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "e35ef2c0c1e166813eef4db5447f2052", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4140625, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n long long int n,k,x,a[20],i=0,j,d=0,p=1;\n scanf(\"%lld %lld\",&n,&k);\n x=n;\n while(x!=0)\n {i++;\n a[i]=x%10;\n x=x/10;\n }\n for(j=i;j>=1;j--)\n {if(a[j]!=0)\n {break;}\n d++;\n }\n if(d>=k)\n {printf(\"%lld\",n);}\n else\n {i=1;\n for(j=1;j<=k;j++)\n {p=p*10;}\n while((p*i)%n!=0)\n {i++;}\n printf(\"%lld\",p*i);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "09c97f5828c53e0bb55c517cab0aeea9", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "09c780646eac658d27ec7d5e2a94d4bf", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4409030544488712, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \nint main()\n{\n long long int n,k,i,j,s=0;\n scanf(\"%I64d %I64d\",&n,&k);\n long long int a=0;\n for(i=1;i<=n;i++){\n for(j=1;j<=n;j++){\n s=i+j;\n if(s==k){\n a++;\n }\n }\n }\n if (a%2==0)\n printf(\"%I64d\\n\",a/2);\n else\n printf(\"%I64d\",(a-1)/2);\n return 0;\n} ", "lang": "GNU C11", "bug_code_uid": "40cf1823058e81f9b417348ec9dbfeea", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "0f8d7588d2a7f4c7f65466ba0fd5865b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4543147208121827, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \nint main(){\n\tlong long int n,k,t=0,i;\n\tscanf(\"%lld%lld\",&n,&k);\n\tif(n+1>=k){\n\t\tprintf(\"%lld\",k/2);\n\t\treturn 0;\n\t}else if(n>2*k-1){\n\t\tprintf(\"0\");\n\t\treturn 0;\n\t}else if(k>n){\n\t\tfor(i=1;i<=k/2;i++){\n\t\t\tif(k-i<=n){\n\t\t\t\tt++;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%lld\",t);\n\t\treturn 0;\n\t}\n}\n", "lang": "GNU C11", "bug_code_uid": "6961f2a30e3fd574cbf15126aa07ded6", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "c68fd454edb1ea2757fc8e02e4176e47", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9978471474703983, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n#define sq(A) ((A)*(A))\n\nint x[4], y[4], r[4];\n\nbool intersect(int i, int j){\n\tint dist=sq(x[i]-x[j])+sq(y[i]-y[j]);\n\tif(dist>=sq(r[i]+r[j])) return false;\n\tif(r[i]\n#include \n#include \n\n// we will consider numbers with <= 10^6 digits. Hence, maximal sum of digits is 9*10^6 < 10^7.\n// we can generate all possible sums for excellent numbers:\n// 2^n for n digits of a,b and then we need to sum for n = 1..7, meaning that 2^8 - 2 different possible sums:\n// 1+2+..+2^[n-1] = 2^n - 1, hence 2+..+2^[n-1] = 2^n - 2\n// now for every possible sum we need to solve:\n// ax + by = S\n// x + y = N\n// and this will add binomial(N,x) numbers\n// trivially, writing x = N - y, (b - a)y = S - aN\n\n// now we can do dynamic programming to calculate binomial coefficients up to N\n// we just need 2 rows (instead of full table) as we will need only row N\n\nstatic inline int min(int a, int b) { return a < b ? a : b; }\n\nstatic int _sd[254] = {};\nstatic void generate_sd(int a, int b) {\n int sd_count = 0;\n for(int i = 1 ; i <= 7 ; ++i) { // fix number of digits\n for(int j = 0, jn = 1<>= 1)\n n += p10 * (m & 0x1 ? b : a);\n assert(sd_count < 254); _sd[sd_count++] = n;\n }\n }\n}\n\n#define MOD 1000000007LL\n\n#define BINN 1000000\n\nstatic int64_t _binomial_impl[2][1000000+1] = {}, _binomial[1000000+1] = {};\n\nstatic inline void generate_binomial(int N) {\n _binomial_impl[0][0] = 1; int c = 1, p = 0;\n for(int i = 1 ; i <= N ; ++i) {\n _binomial_impl[c][0] = 1;\n for(int m = 1 ; m <= i ; ++m)\n _binomial_impl[c][m] = (_binomial_impl[p][m-1] + _binomial_impl[p][m]) % MOD;\n int t = c; c = p, p = t;\n }\n for(int i = 0 ; i <= N ; ++i)\n _binomial[i] = _binomial_impl[p][i];\n}\n\n\nint main() {\n int A,B,N; scanf(\"%d %d %d\\n\", &A,&B,&N);\n generate_sd(A,B); generate_binomial(N);\n\n int64_t count = 0;\n for(int si = 0 ; si < 254 ; ++si) {\n const int ss = _sd[si] - A*N;\n if(ss % (B-A) == 0) {\n const int y = ss / (B-A), x = N - y;\n if(x >= 0 && y >= 0)\n count = (count + _binomial[y]) % MOD;\n }\n }\n\n printf(\"%d\\n\", (int)count);\n}\n", "lang": "GNU C11", "bug_code_uid": "098ea7fe4f08e7ca0306ab3c5d43f27a", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "735e144c2e347373bbc5ff145a560aa6", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4270833333333333, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n long long n,x;\n scanf(\"%I64d\",&n);\n \n x=n-((n/2+n/3+n/5+n/7)-(n/(2*3)+n/(2*5)+n/(2*7)+n/(3*5)+n/(3*7)+n/(5*7))-(n/(2*3*5)+n/(2*3*7)+n/(2*5*7)+n/(3*5*7))-n/(2*3*5*7));\n printf(\"%I64d\",x);\n \n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "7ff2d54feb933161b4bb1834582e8939", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "apr_id": "c472a3e40193c4b6b8dad845fb6ce17d", "difficulty": 1500, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3682983682983683, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "#include\n\nint main()\n{\n\n int team[105],h_color[105],g_color[105],i,j,koyta_team,coun;\n\n while(scanf(\"%d\",&koyta_team))\n {\n\n for(i=1; i<=koyta_team; i++)\n {\n\n scanf(\"%d %d\",&h_color[i],&g_color[i]);\n }\n\n coun=0;\n\n for(i=1; i<=koyta_team; i++)\n {\n for(j=1; j<=koyta_team; j++)\n {\n if(i!=j)\n {\n if(h_color[i]==g_color[j])\n {\n coun++;\n }\n }\n }\n }\n printf(\"%d\\n\",coun);\n\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "88e874a65483da0b3ff319f035f5a24b", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "53704398ee2c8060a15371b27bc88dc5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24864864864864866, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint solve(int a,int b){\nint i,k;\nfor(i=0;i<=a;i++){\n for(k=0;k<=a;k++){\n if((2*i + 1*k)==b && k+i==a){\n return 1;\n }\n }\n}\nreturn 0;\n}\nint main()\n{\n int a,b,c,d,e,f;\n scanf(\"%d%d\",&b,&c);\n int k=1;\n int s=0;\n int max=0;\n while(smax){\n printf(\"%d\",s);\n return 0;}\n k++;\n }\n printf(\"-1\");\n\n}\n", "lang": "GNU C", "bug_code_uid": "8e0c3424bb3d9c1d8e44b112d0bd2049", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "5baf0049878c9c3bf3d164a2916cbfa0", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8370607028753994, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,i=0,count=0,sum=0;\n scanf(\"%d\",&n);\n char s[110];\n scanf(\"%s\",&s);\n\n while(s[i]!='\\0')\n {\n if(count\n#include \n#include \n#define MAX(X,Y) ((X)>(Y) ? (X) : (Y))\n#define MIN(X,Y) ((X)<(Y) ? (X) : (Y))\n#define INF 1000000000\n\nint n,c[20],r[20],b[20],rcnt[66000],bcnt[66000],dp[66000][2][260];\nint next(int b);\n\nint main(void)\n{\n //freopen(\"cards.in\",\"r\",stdin);\n //freopen(\"cards.out\",\"w\",stdout);\n scanf(\"%d\",&n);\n int i,j,k,r0=0,b0=0;\n for(i=1;i<=n;i++)\n {\n while(isspace(c[i]=getchar()));\n scanf(\"%d%d\",&r[i],&b[i]);\n if(r[i]>n)\n {\n r0+=r[i]-n;\n r[i]-=n;\n }\n if(b[i]>n)\n {\n b0+=b[i]-n;\n b[i]-=n;\n }\n }\n for(i=0;i<1<=0;k--)\n for(i=(1<tb-j)\n dp[i][0][j]=MIN(dp[i][0][j],tr+dp[i|(1<tr-j)\n dp[i][1][j]=MIN(dp[i][1][j],tb+dp[i|(1<b0)\n printf(\"%d\\n\",r0+dp[0][0][MIN(r0-b0,n*n)]);\n else printf(\"%d\\n\",b0+dp[0][1][MIN(b0-r0,n*n)]);\n return 0;\n}\n\nint next(int b)\n{\n if(!b) return 1<\n#include \n#include \nint main()\n{\n double d,l,v1,v2;\n scanf(\"%lf %lf %lf %lf\",&d,&l,&v1,&v2);\n\n double x1,x2,max=0,t1,t2;\n for(x1=0;x1+d <= l;x1=x1+.000001)\n {\n x2 = l-d-x1;\n t1 = (x1/v1);\n t2 = (x2/v2);\n if(t1-t2 <= .000000000001 )\n {\n max = t1;\n }\n }\n printf(\"%lf\",max);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "de1ef047d0cc0bafc54a1a0be6d841ce", "src_uid": "f34f3f974a21144b9f6e8615c41830f5", "apr_id": "3a741e909be94a3d4fe0a8a33c156484", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.851764705882353, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main(void)\n{\n int a[6];\n int i;\n\n for(i=0; i<6; i++)\n {\n scanf(\"%d\", &a[i]);\n }\n\n printf(\"%d\", a[0]+a[1]+a[2])*(a[0]+a[1]+a[2])-a[0]*a[0]-a[2]*a[2]-a[4]*a[4]);\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "e9d56cb508490758765acf7515faee19", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "f29de2b68e9be3c3ff86144f28e42c58", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9940476190476191, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nint len;\nchar ph[51];\nlong dp[51][10];\n\nlong f(int pos,int val)\n{\n if(dp[pos][val]!=0)\n return dp[pos][val];\n \n int sum = val+ph[pos+1]-'0';\n \n if(pos==len-2)\n {\n \t dp[pos][val]=sum%2==0?1:2;\n \t return dp[pos][val];\n\t }\n long c=0; \n if(sum%2==0)\n c= f(pos+1,sum/2);\n\t else\n\t c=f(pos+1,sum/2)+f(pos+1,sum/2+1);\n\t \n dp[pos][val]=c;\n \n \n return c;\n \n}\nint main()\n{\n\t\n\tscanf(\"%s\",ph);\n\tlen=strlen(ph);\n\tint i,check=1;\n\tlong c=0;\n\tfor(i=0;len!=1&&i<=9;i++)\n\t{ c+= f(0,i);\n\t} \n\t \n/*\tfor(i=0;i\n#include \n\n#define N\t10\n\nchar ss[][2] = { \"B\", \"C\", \"D\", \"F\", \"H\", \"I\", \"K\", \"N\", \"O\", \"P\", \"S\", \"U\", \"V\", \"W\", \"Y\" };\nchar tt[][4] = { \"AC\", \"AG\", \"AL\", \"AM\", \"AR\", \"AS\", \"AT\", \"BA\", \"BE\", \"BH\", \"BI\", \"BK\", \"BR\", \"CA\", \"CD\", \"CE\", \"CF\", \"CL\", \"CM\", \"CO\", \"CR\", \"CS\", \"CU\", \"DB\", \"DS\", \"DY\", \"ER\", \"ES\", \"EU\", \"FE\", \"FL\", \"FM\", \"FR\", \"GD\", \"GA\", \"GE\", \"AU\", \"HE\", \"HF\", \"HO\", \"HS\", \"HG\", \"IN\", \"IR\", \"KR\", \"LA\", \"LR\", \"LI\", \"LU\", \"LV\", \"MD\", \"MG\", \"MN\", \"MO\", \"MT\", \"NA\", \"NB\", \"ND\", \"NE\", \"NI\", \"NO\", \"NP\", \"OG\", \"OS\", \"PA\", \"PB\", \"PD\", \"PM\", \"PO\", \"PT\", \"PU\", \"PR\", \"RA\", \"RB\", \"RE\", \"RF\", \"RG\", \"RH\", \"RN\", \"RU\", \"SB\", \"SC\", \"SE\", \"SI\", \"SG\", \"SM\", \"SN\", \"SR\", \"TA\", \"TB\", \"TC\", \"TE\", \"TH\", \"TI\", \"TL\", \"TM\", \"XE\", \"YB\", \"ZN\", \"ZR\" };\n\nint elemental1(char c) {\n\tint i;\n\n\tfor (i = 0; i < 15; i++)\n\t\tif (ss[i][0] == c)\n\t\t\treturn 1;\n\treturn 0;\n}\n\nint elemental2(char c1, char c2) {\n\tint i;\n\n\tfor (i = 0; i < 100; i++)\n\t\tif (tt[i][0] == c1 && tt[i][1] == c2)\n\t\t\treturn 1;\n\treturn 0;\n}\n\nint main() {\n\tstatic char cc[16];\n\tstatic int dp[N + 1];\n\tint n, i;\n\n\tscanf(\"%s\", cc), n = strlen(cc);\n\tdp[0] = 1;\n\tfor (i = 0; i < n; i++)\n\t\tif (dp[i]) {\n\t\t\tprintf(\"%d\\n\", i);\n\t\t\tif (elemental1(cc[i]))\n\t\t\t\tdp[i + 1] = 1;\n\t\t\tif (i + 1 < n && elemental2(cc[i], cc[i + 1]))\n\t\t\t\tdp[i + 2] = 1;\n\t\t}\n\tprintf(dp[n] ? \"YES\\n\" : \"NO\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "46e38e66165e0b1f153469b82029ac3e", "src_uid": "d0ad35798119f98320967127c43ae88d", "apr_id": "3ed4b1ca087dd88d7a059de2708741d1", "difficulty": null, "tags": ["dp", "brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9985569985569985, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main() {\n\nint n;\nint diff;\nint noprog=0;\nscanf(\"%d\", &n) ;\n\nint temp1, temp2;\nscanf(\"%d\", &temp1) ;\nscanf(\"%d\", &temp2) ;\ndiff = temp2-temp1;\nint i;\nfor(i=0;i<(n-2);i++){\ntemp1=temp2;\nscanf(\"%d\", &temp2) ;\nif(temp2-temp1!=diff) {\nnoprog=1;\n}\n}\nif(noprog==1) printf(\"%d\", temp2);\nelse printf(\"%d\", temp2+diff) ;\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "74266c8098c2f4bf2cde222d72b4f253", "src_uid": "d04fa4322a1b300bdf4a56f09681b17f", "apr_id": "fab6292824d6d005aa928ca4b832cb61", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7564356435643564, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "/* practice with Dukkha */\n#include \n\nlong long max(long long a, long long b) {\n\treturn a > b ? a : b;\n}\n\nint gcd(int a, int b) {\n\treturn b == 0 ? 0 : gcd(b, a % b);\n}\n\nlong long lcm(int a, int b) {\n\treturn (long long) a / gcd(a, b) * b;\n}\n\nint main() {\n\tint n;\n\tlong long m;\n\n\tscanf(\"%d\", &n);\n\tif (n <= 2) {\n\t\tprintf(\"%d\\n\", n);\n\t\treturn 0;\n\t}\n\tm = (long long) n * (n - 1) * (n - 2);\n\tprintf(\"%lld\\n\", n % 2 == 1 ? m : max(m, (n - 1) * lcm(n, n - 3)));\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "7968b57fc4175b82a87411036334d9f9", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "e80f8fa84b7ce72c4a4ab2d52793ef1c", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9984, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint Cnt[26];\n\nint main()\n{\n int n, k;\n char str[51];\n scanf(\"%d %d %s\", &n, &k, str);\n for(int i = 0; str[i] != '\\0'; ++i) {\n ++Cnt[str[i] - 'a'];\n }\n int j = 0, ans = 0, choice = 0;\n while(1) {\n int i;\n for(i = j; i < 26; ++i) {\n if(Cnt[i]) {\n ans += i + 1;\n ++choice;\n j = i + 2;\n break;\n }\n }\n if(i == 26 || choice == k) {\n break;\n }\n }\n if(choice == k) {\n printf(\"%d\\n\", ans);\n } else {\n puts(\"-1\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "51fa2b834be538fbeeab3e5084d46604", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "fb349c63e29235c50c331a1fea33b5bf", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4241379310344828, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \nmain()\n{\n\tint h1,m1,h2,m2;\n\tscanf(\"%d:%d\",&h1,&m1);\n\tscanf(\"%d:%d\",&h2,&m2);\n\tint min1,min2;\n\tint min3;\n\tif(h1=23)\n\t\t\th3-=24;\n\t\tprintf(\"%d:%d\",h3,m3);\n\t}\n\t\n}", "lang": "GNU C11", "bug_code_uid": "05de19bbeb53b582e378ce5b1d9243d7", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "1f2a6c526346d4c880c32cceb56c56a7", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9965156794425087, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main()\n{\n \n int n,a[101]={0},x,ans=0;\n scanf(\"%d\",&n);\n while(n--){\n scanf(\"%d\",&x);\n if(x!=0)\n {\n if(a[x]==0)\n ans++;\n \n a[x]++;\n }\n }\n printf(\"%d\\n\",ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "147c1d47359169378dd5f227bc78a7fb", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "26bdfdadd2949362448ab99ed71be87e", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9976851851851852, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint t0,t1,t2;\ndouble comp(int y1,int y2)\n{\n double left = t0;\n double right = (double)((double)t1*y1+(double)t2*y2)/(double)(y1+y2);\n return left-right;\n}\n\nint main(void)\n{\n int x1,x2;\n double temp;\n scanf(\"%d%d%d%d%d\",&t1,&t2,&x1,&x2,&t0);\n int i,j;\n double state;\n temp = 9999999.0000;\n int cold,hot;\n for(i=x1,j=x2; i>=0,j>=0;)\n {\n state = comp(i,j);\n if(state < 0.000001 && state > -0.000001)\n {\n cold = i;\n hot = j;\n break;\n }\n else if(state > 0.000001)\n {\n i--;\n }\n else\n {\n if(-state\nint main()\n{\n long long int k,count=0,i,d,n,largest=0,cou=0,j;\n scanf(\"%lld\",&k);\n long long int a[k+1],b[k+1];\n for(i=1;i25)\n count++;\n }\n for(i=1;i=largest)\n break;\n }\n for(i=0;i<=largest;i++)\n {\n if(b[i]==0)\n cou++;\n }\n printf(\"%lld\",cou+1);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b06044cec69a7038bcc29f8204283bf8", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "dc0fc441e4c1e0e7bf993ad74867cc89", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.844017094017094, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int n2 = n+1;\n int ans = 0;\n for(;n2 > 0;n2 -= 1234567)\n {\n int n3 = n2;\n for(;n3 > 0;n3 -= 123456)\n {\n int n4 = n3;\n for(;n4 > 0;n4 -= 1234)\n {\n if(n4 == 1)\n {\n ans = 1;\n goto mark;\n }\n }\n }\n }\nmark:if(ans == 1)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d38e321fb44ec7dbdce98e467b45faad", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "e58d3599ccdcadedb67369bf4b607c69", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8557089084065245, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n#include \n\nchar *substring(size_t start, size_t stop, const char *src, char *dst, size_t size);\n\nint main(){\n int i, j;\n char vec[10][10];\n char dato[80];\n char parte[11];\n char aux[10];\n scanf(\"%s\", dato);\n for ( i = 0; i < 10; i++ ){\n scanf(\"%s\", vec[i] );\n }\n\n for( i = 0; i < 80; i = i + 10){\n substring( i, i + 11, dato, parte, sizeof parte);\n for ( j = 0; strcmp( parte, vec[i] ); j++);\n printf(\"%d\", j);\n }\n return(0);\n}\n\nchar *substring(size_t start, size_t stop, const char *src, char *dst, size_t size)\n{\n int count = stop - start;\n if ( count >= --size )\n {\n count = size;\n }\n sprintf(dst, \"%.*s\", count, src + start);\n return dst;\n}\n", "lang": "GNU C", "bug_code_uid": "fd03b5b781e8e6cd92657866ea957c8b", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "ea4938e064c0225fbbeb1d2f8332ba93", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9714285714285714, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main(void)\n{\n\t\tint arr[2] = {0};\n\n\t\tint n;\n\t\tscanf(\"%d \", &n);\n\n\t\tint sum = 0, num;\n\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tscanf(\"%d \", &num);\n\t\t\t\tsum += num;\n\t\t\t\tif (num % 200 == 0)\n\t\t\t\t\t\tarr[1]++;\n\t\t\t\telse\n\t\t\t\t\t\tarr[0]++;\n\t\t}\n\n\t\tif (sum % 200 != 0){\n\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\treturn 0;\n\t\t}\n\n\t\tint half = sum/2;\n\t\tsum /= 2;\n\t\twhile (sum > 100)\n\t\t\t\tif (arr[1] > 0){\n\t\t\t\t\t\tsum -= 200;\n\t\t\t\t\t\tarr[1]--;\n\t\t\t\t}\n\n\t\twhile (sum > 0)\n\t\t\t\tif (arr[0] > 0){\n\t\t\t\t\t\tsum -= 100;\n\t\t\t\t\t\tarr[0]--;\n\t\t\t\t}\n\n\t\tif ((100 * arr[0]) + (200 * arr[1]) == half)\n\t\t\t\tprintf(\"YES\\n\");\n\t\telse\n\t\t\t\tprintf(\"NO\\n\");\n}\n\n", "lang": "GNU C11", "bug_code_uid": "dde6b6af22176a73b37d02e614000f57", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "e0ba535b84095d7f54493864295eabd6", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.39804241435562804, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint main()\n{\n long long int n;\n scanf(\"%lld\",&n);\n printf(\"%lld\\n\",(n/2)+2*((n/2)+(n%2)-1));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c34faf2b904381b5a9b3c02857e40079", "src_uid": "a98f0d924ea52cafe0048f213f075891", "apr_id": "70f27bdee8c12f122cc686c65206682a", "difficulty": 1900, "tags": ["dp", "bitmasks", "math", "implementation", "graphs"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.46673936750272627, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n long long int i=0,n,count=0,temp,mod;\n scanf(\"%lld\",&n);\n while(1)\n {\n mod=n%(1<<(i+1));\n temp=n/(1<<(i+1));\n // printf(\"%lld %lld\\n\",temp , mod);\n if(mod>(1<\n\nint divisornumber(int n){\n\n int i,mx=0;\n for(i=1;i<=n;i++){\n if(n%i==0){\n mx=mx+1;\n }\n }\n return mx;\n}\n\nmain(){\n int i,j,k,a,b,c,sm=0;\n scanf(\"%d %d %d\",&a,&b,&c);\n\n for(i=1;i<=a;i++){\n for(j=1;j<=b;j++){\n for(k=1;k<=c;k++){\n sm=sm+divisornumber(i*j*k);\n }\n }\n }\n printf(\"%d\",sm);\n}\n\n", "lang": "GNU C", "bug_code_uid": "3142e39ca263c9e20834e2f12e4ba79c", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "0e655642de256bb8bb19185ae58d74f7", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8184210526315789, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n\tint n,a[16],i;\n\tscanf(\"%d\",&n);\n\n\n\tfor(i=0;i1)\n\t{\n\t\tif(a[n-1]>a[n-2] && a[n-1]<15)\n\t\t\tprintf(\"UP\\n\");\n\n\t\telse if(a[n-1]\n\nint subs(char* str, int n)\n{\n\tint x=0,flag=0;\n\tfor(int i=n-1;i>0;i--)\n\t{\n\t\tfor(int j=0;j\n#include \nint main()\n{\n int n,m,\n scanf(\"%d\",vp);\n scanf(\"%d\",vd);\n scanf(\"%d\",t);\n scanf(\"%d\",f);\n scanf(\"%d\",c);\n int i=0;\n while()\n {\n i++;\n }\n return 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "fcffde95f2a8238ff200031fc4eb0dc9", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "b3653e7a246e2b01e43ffed771b59188", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9991680532445923, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\nlong long arr[2000001],brr[2000001],mod=1000000000+7;\nchar str[2000001],s1[2000001];\nint func(const void *a, const void *b)\n{\n\treturn (*(int*)a-*(int*)b);\n}\nlong long max(long long a, long long b)\n{\n\treturn (a>b)?a:b;\n}\nlong long min(long long a, long long b)\n{\n\treturn (a>b)?b:a;\n}\nlong long power(long long x, long long int y, long long p)\n{\n\tlong long int res = 1;\n\tx = x % p; \n\twhile (y > 0)\n\t{\n\t\tif (y & 1)\n\t\t\tres = (res*x) % p;\n\t\ty = y>>1; // y = y/2\n\t\tx = (x*x) % p; \n\t}\n\treturn res;\n}\nlong long bs(long long l, long long r, long long n, long long m)\n{\n\tlong long mid=l+((r-l)/2);\n\tif(l>=r)\n\t{\n\t\tif((mid+1)*2+(mid*(mid+1))/2>=(n-m-1))\n\t\t\treturn mid;\n\t\telse\n\t\t\treturn mid+1;\n\t}\n\tif((mid+1)*2 + (mid*(mid+1))/2==(n-m-1))\n\t\treturn mid;\n\tif((mid+1)*2 + (mid*(mid+1))/2>(n-m-1))\n\t\t\treturn bs(l,mid-1,n,m);\n\tif((mid+1)*2 + (mid*(mid+1))/2 < (n-m-1))\n\t\treturn bs(mid+1,r,n,m);\n}\n\nint main()\n{\n\tlong long int sum=0,a,b,x,y,n, m,temp,flag=0,index,len, i, j, k, count=0, ans=0;\n\tscanf(\"%lld %lld\", &n, &m);\n\tif(n==1)\n\t{printf(\"1\\n\");return 0;}\n\tif(m>=n)\n\t{printf(\"%lld\\n\",n);return 0;}\n\tprintf(\"%lld\\n\",m+1+bs(0,4000000005,n,m)+1);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "605192374b2635dc401bc6f5d9c703d2", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "7488f0f2686011515c6cd2ff2c0ce34f", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9814814814814815, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main ()\n{ long long int n,j,k;\nscanf(\"%lld\",&n);\nif(n==1||n==2)\n{ printf(\"%lld\",n);\nexit(1);\n}\n\nif (n%2==1)\n{\nprintf(\"%lld\",n*(n-1)*(n-2));\n}\n\n\nelse\n{ \nfor(k=n;k%(n-2)!=0;k+=n);\nk=k*(n-1);\nfor(j=n*(n-1);j%(n-3)!=0;j+=n*(n-1));\nif(j>k)\nk=j;\nif(k>(n-1)*(n-2)*(n-3))\nprintf(\"%lld\",k);\n else\nprintf(\"%lld\",(n-1)*(n-2)*(n-3));\n}\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "4f35546baae88b1b8162fda1acb2570e", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "c6c8c3726c9de8053093026bc677d081", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9528535980148883, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n\tlong long int x1,y1,x2,y2,ans=0;\n\tscanf(\"%lld%lld%lld%lld\",&x1,&y1,&x2,&y2);\n\tans=((x2-x1+2)*(y2-y1+2))/4+((x2-x1)*(y2-y1))/4;\n\tprintf(\"%lld\",ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ded4a75a0ce23fb474424595ed358daf", "src_uid": "00cffd273df24d1676acbbfd9a39630d", "apr_id": "6d5a78151cc2b5e6cfca8bcc1c578065", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.631578947368421, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main() {\n long long x1 = 0, x2 = 0, y1 = 0, y2 = 0, i = 0, j = 0, sum = 0;\n scanf (\"%lli %lli %lli %lli\", &x1, &y1, &x2, &y2);\n for (i = x1; i <= x2; i++) {\n\tfor (j = y1; j <= y2; j++) {\n\t if (((abs(i) % 2) == 1 && (abs(j) % 2) == 1) || ((abs(i) % 2) == 0 && (abs(j) % 2) == 0))\n\t\tsum++;\n\t}\n }\n printf (\"%lli\", sum);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "60613c44d1972a8ceee2a00b6502a4f7", "src_uid": "00cffd273df24d1676acbbfd9a39630d", "apr_id": "d3d0c8ffb264bb7faeb2420d4eb385bb", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9945235487404163, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \n\nchar s[99];\nint i,j,l,ans=-1,temp;\n\nint dv(p,q){\n if(11e6)return-1; ret+=z;\n t=s[q]; s[q]=0; z=atoi(s+p); s[q]=t;\n if(z>1e6)return-1;\n ret+=z; z=atoi(s+q);\n if(z>1e6)return-1;\n ret+=z;\n //if(ret>1000000)return 0;\n //printf(\"%d %d %d\\n\",p,q,ret);\n return ret;\n}\n\n\nmain(){\n scanf(\"%s\",s);\n l=strlen(s);\n if(l<3||217)continue;\n temp=dv(i,j);\n ans\n#include \n\nint GetSize(char a[])\n{\n int i;\n for(i=0;a[i]!='\\0';i++);\n return i;\n}\nvoid CopyArr(char a[],char b[],int l,int r)\n{\n int i,j;\n for(i=l,j=0;i<=r;i++,j++)\n{\n a[j]=b[i];\n}\n}\nlong int Max(long int f,long int s)\n{\n if(f>s)\n return f;\n else\n return s;\n}\nlong int GetVal(char *s,int l,int r)\n{\nint n;\nlong int v;\nchar x[10]=\"\";\nCopyArr(x,s,l,r);\nn=GetSize(x);\n v=atoi(x);\n if(v>1000000)\n return -1;\nelse if(x[0]=='0'&&n>1)\n return -1;\nelse\n return v;\n}\nint main()\n{\n int i,j,n;\n long int l,m,r,max=-1;\n char s[31]=\"\";\n scanf(\"%s\",s);\n n=GetSize(s);\n for(i=0;i\nint main()\n{\n\tint n,i=0,b=0,c=0,bi=0,j;\n\tscanf(\"%d\",&n);\n\tint a[n];\n\tfor(i=0;ibi&&c>b)\n {\n\t\t printf(\"chest\");\n\t }\n\telse{ if(bi>b)\n {\n\t\t printf(\"biceps\");\n\t }\n\t else\n\t {\n\t\t printf(\"back\");\n\t }\n }\n\t return 0;\n }\n", "lang": "GNU C11", "bug_code_uid": "dc406ad1df98f7a61379a590ef667c97", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "8386dee1ff02a66d6c32dfc3b00e0e5d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7894736842105263, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n//include\n//#include\nint main()\n{\nint n,i,j=0,k=0,l=0,x,y;\nscanf(\"%d\",&n);\nint a[n];\nfor(i=0;ik && j>l) printf(\"chest\");\nelse if(k>j && k>l) printf(\"biceps\");\nelse if(l>j && l>k) printf(\"back\");\nreturn 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "94495658c3b046d4a81857d5ac62642e", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "dd17fa344dd0f4ebf2bbb8d04a07658c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.997667638483965, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "/*\n * =====================================================================================\n *\n * Filename: main.c\n *\n * Description: \n *\n * Version: 1.0\n * Created: 19/01/17 18:42:01\n * Revision: none\n * Compiler: gcc\n *\n * Author: YOUR NAME (), \n * Company: \n *\n * =====================================================================================\n */\n#include \n#include \n\nint64_t max(int64_t x, int64_t y)\n{\n if (x > y)\n return x;\n else\n return y;\n}\n\n#define div(a, b, c) ( ((a)-(b)) / (c) + (b < (a)%(c)))\n\nint64_t count(int64_t n, int64_t m, int64_t k, int64_t x, int64_t y)\n{\n if (n != 1) {\n if (x == 0 || x == n - 1)\n //return div(k - y - x*m, 2*(n-1)*m);\n return div(k, x*m+y, 2*(n-1)*m);\n else\n //return div(k - y - x*m, 2*(n-1)*m) + div(k - y - m*(2*n - 2 - x), 2*(n-1)*m);\n return div(k, x*m+y, 2*(n-1)*m) + div(k, (2*n-2-x)*m+y, 2*(n-1)*m);\n } else {\n //return div(k - y - x*m, n*m);\n return div(k, y, n*m);\n }\n}\n\nint\nmain()\n{\n int64_t n, m, k, x, y;\n scanf(\"%\"SCNd64\"%\"SCNd64\"%\"SCNd64\"%\"SCNd64\"%\"SCNd64, &n, &m, &k, &x, &y);\n x--; y--;\n if (n == 1)\n printf(\"%\"PRId64\" %\"PRId64\" %\"PRId64\"\\n\", \n count(n, m, k, 0, 0), \n count(n, m, k, 0, m-1), \n count(n, m, k, x, y));\n else\n printf(\"%\"PRId64\" %\"PRId64\" %\"PRId64\"\\n\", \n max(max(count(n, m, k, 0, 0), count(n, m, k, 1, 0)), count(n, m, k, n-2, 0)), \n -max(-count(n, m, k, 0, m-1), -count(n, m, k, n-1, m-1)), \n count(n, m, k, x, y));\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "7fbdc4c846396388b7c2887153323328", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "6cdc51ad73ee19f9c5bae46d8d0ca752", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4518027961736571, "equal_cnt": 31, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 14, "fix_ops_cnt": 32, "bug_source_code": "}#include\nint p[200];\nint main()\n{\n int n,temp=0,t=0,i,m=0,c=0;\n scanf(\"%d\",&n);\n int arr[n];\n for(i=0;i0)\n {\n c=1;\n t++;\n if(i==n-1)\n {\n p[m]=t+1;\n m++;\n }\n }\n else\n {\n if(c==1){\n p[m]=t+1;\n t=0;\n c=0;\n m++;\n }\n }\n }\n if(n>1){\n if(m>1)\n {\n for(i=0;ip[i+1]?p[i]:p[i+1];\n p[i+1]=temp;\n }\n printf(\"%d\",temp-2);\n }\n else if(m==1)\n {\n if(p[0]==n&&(arr[n-1]==1000||arr[0]==1))\n printf(\"%d\",p[0]-1);\n else\n {if(p[0]>=2)\n printf(\"%d\",p[0]-2);\n else\n printf(\"0\");\n }\n }\n else\n printf(\"0\");\n }\n else\n printf(\"0\");\n /*printf(\"%d%d\",p[0],m);*/\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "2abfae5b93d4f4e4c64a7b5713402cbe", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "cf6e5db81e15a9a8d74c6baed9439eff", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9148606811145511, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\nint m;\nint oddeven(int n)\n{\n if(n%2==0)\n {\n m=1;\n }\n else\n {\n m=0;\n }\n\n\n}\nint main()\n{\n long long a,b;\n int count = 0;\n scanf(\"%lld\",&a);\n scanf(\"%lld\",&b);\n int i=1;\n if(b==1)\n {\n if(a%2==0)\n {\n printf(\"NO\");\n }\n else\n {\n printf(\"YES\");\n }\n }\n else\n {\n while(b*i<=a)\n {\n i++;\n count++;\n }\n oddeven(count);\n {\n if(m==1)\n {\n printf(\"NO\");\n }\n else\n {\n printf(\"YES\");\n }\n }\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "1529a0dc094bcc63939f5a3144d36802", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "6128a66d5923cbab601228afed0bf11c", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9279279279279279, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n#include \n#define uLL unsigned long long\n#define LL long long\nuLL exgcd64(uLL a,uLL b,uLL *x,uLL *y)\n{\n\tstatic uLL gcd;\n\tif (a==0)\n\t{\n\t\t*x=0;*y=1;\n\t\treturn b;\n\t}\n\telse\n\t{\n\t\tgcd=exgcd64(b%a,a,y,x);\n\t\t*x-=(b/a)*(*y)+b;\n\t\t*y+=a;\n\t\treturn gcd;\n\t}\n}\nint main()\n{\n\tfreopen(\"in.in\",\"r\",stdin);\n\tLL i,j,k,n,m,a,b,c,d,x,y,vx,vy;\n\tscanf(\"%lld%lld%lld%lld%lld%lld\",&n,&m,&x,&y,&vx,&vy);\n\tif ((vx==0)||(vy==0))\n\t{\n\t\tif (vx==0)\n\t\t{\n\t\t\tif ((x==0)||(x==n))\n\t\t\t{\n\t\t\t\tif (vy<0) {printf(\"%lld 0\\n\",x);}\n\t\t\t\telse {printf(\"%lld %lld\\n\",x,m);}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprintf(\"-1\\n\");\n\t\t\t}\n\t\t}\n\t\tif (vy==0)\n\t\t{\n\t\t\tif ((y==0)||(y==m))\n\t\t\t{\n\t\t\t\tif (vx<0) {printf(\"0 %lld\\n\",y);}\n\t\t\t\telse {printf(\"%lld %lld\\n\",n,y);}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprintf(\"-1\\n\");\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (vx<0)\n\t\t{\n\t\t\tx=n-x;\n\t\t}\n\t\tif (vy<0)\n\t\t{\n\t\t\ty=m-y;\n\t\t}\n\t\t//printf(\"%lld %lld %lld %lld\\n\",n,m,x,y);\n\t\tc=exgcd64(m,n,&a,&b);\n\t\td=x-y;\n\t\tif (d<0) {d=(d%m+m)%m;}\n\t\tif (d%c!=0) {printf(\"-1\\n\");}\n\t\telse\n\t\t{\n\t\t\td=(d/c)*(b/c)%(m/c);\n\t\t\tif (d==0) {d+=m/c;}\n\t\t\tc=d;\n\t\t\td=(c*n-(x-y))/m;\n\t\t\t//printf(\"%lld %lld %lld %lld\\n\",c,d,n,m);\n\t\t\tc=c&1;d=d&1;\n\t\t\tif (vx<0) {c=c^1;}\n\t\t\tif (vy<0) {d=d^1;}\n\t\t\tc=c*n;d=d*m;\n\t\t\tprintf(\"%lld %lld\\n\",c,d);\n\t\t}\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "522d6f8681e0ec3dee5367c316dc0cf2", "src_uid": "6c4ddc688c5aab1432e7328d27c4d8ee", "apr_id": "b14a2f2b5bc9a6d3ec0d4ad88ec5ec69", "difficulty": 2600, "tags": ["geometry", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9968119022316685, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define Min(a,b) am)\n ans = m;\n else\n {\n n = bigpower(2,n);\n ans = m%n;\n }\n printf(\"%lld\\n\",ans);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "57a6c5e9f995f5b58752d5183beb1741", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "e5a9e758d50d1bff82dcd66209b458ef", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8918558077436582, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main() {\n int n,foo=0,bar=0,baz=0,quz=0,pur;\n scanf(\"%d\",&n);\n while(n--) {\n scanf(\"%d\",&pur);\n foo+=pur;\n bar++;\n if(foo*quz >= bar*baz*foo*quz) {\n baz=foo;\n quz=bar;\n }\n }\n printf(\"%.6f\\n\",(double)baz/quz);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7d02be3a56b02dcbf2ec86c3b5a8f4fd", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "7d2787bfbe4f29140da2105320cef84e", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6056782334384858, "equal_cnt": 35, "replace_cnt": 16, "delete_cnt": 9, "insert_cnt": 9, "fix_ops_cnt": 34, "bug_source_code": "#include\nint main()\n{\n int n,m,i,j,temp,max,add,t,k,p=0;\n scanf(\"%d\",&n);\n int a[n];\n scanf(\"%d\",&m);\n\n for(i=0;i=a[j])\n {\n temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }\n }\n }\n else\n {\n a[n-1] = a[0];\n }\n //Maximum Pssibility Of K\n max = a[n-1]+m;\n\n //Determining minimum possibility of K\n if(n!=1)\n {\n i=0;\n while(m!=0)\n {\n if(a[i]!= a[n-1])\n {\n add = a[n-1]-a[i];\n a[i] =a[i]+add;\n t = m-add;\n m = t;\n i++;\n }\n else\n {\n m--;\n if(i==(n-1))\n {\n a[p] = a[p]+1;\n p++;\n i = p;\n }\n else\n {\n a[i]=a[i]+1;\n i++;\n }\n\n }\n\n }\n\n k = a[0];\n }\n else\n {\n k = max;\n }\n printf(\"%d %d\",k,max);\n\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "8a4ebc4ff89fc455401ade4fd9dd0c94", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "44355a153b3592d4d639052803e78b81", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8204081632653061, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main(void)\n{\n int n, k, i;\n int lo, hi;\n int a[100];\n scanf(\"%d\", &n);\n scanf(\"%d\", &k);\n for(i=0; i < n; i++)\n {\n scanf(\"%d\", &a + 4*i);\n if(i==0)\n lo = a[0], hi = a[0];\n else\n {\n if(a[i] < lo)\n lo = a[i];\n if(a[i] > hi)\n hi = a[i];\n }\n }\n printf(\"%d %d\", lo, hi + k);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "7ab98198b1166c3d9384a49eef03feec", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "bdb9b5b6d4ba9f49f8bde8685e7e3a16", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24327784891165172, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint max(int a,int b){\n\tif (ax) count+=a-x;\n\tif(b>y) count+=b-y;\n\tif(c>z) count+=c-z;\n\t\n\tcount/=2;\n\t\n\tif(a=0) printf(\"Yes\\n\");\n\telse printf(\"No\\n\")\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "d03852a51ea10dcf4eff171cb0bc9466", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "9ce5441a4cb03ed548ae7c993a2876e8", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6186046511627907, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main(){\n int check = 1 ;\n int a[4];\n int sum =0 ; \n for(int i = 0; i < 4 ; i++){\n scanf(\"%d\",&a[i]);\n sum = sum + a[i];\n }\n \n for(int i =1; i < 4 ; i++){\n int test = a[0] + a[i];\n if((test*2)==sum){\n printf(\"YES\\n\");\n check = 0;\n return 1;\n \n }\n }\n if(check == 1){\n printf(\"NO\\n\");\n }\n \n}", "lang": "GNU C11", "bug_code_uid": "93649f291a45bc5376bd5ffcbdd28a67", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "c4e97b0dadea984c6b6f8d611dc809e8", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9644128113879004, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#define lli long long int\nint main()\n{\n\tlli a,b;\n\tscanf(\"%lli %lli\",&a,&b);\n\tstep1:;\n\tif(a==0||b==0)\n\tgoto end;\n\tstep2:;\n\tif(a>=2*b)\n\t{\n\t\ta=a-2*b;\n\t\tgoto step1;\n\t}\n\tstep3:;\n\tif(b>=2*a)\n\t{\n\t\tb=b-2*a;\n\t\tgoto step1;\n\t}\n\tend:;\n\tprintf(\"%lli %lli\",a,b);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "9cac166d3058c9c15ab4db2774714c5a", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "3d7153d2cb0c8388087f1d6a1d131a30", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9773755656108597, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nlong long a,b;\nint main(){\n\tscanf(\"%lld %lld\",&a,&b);\n\twhile(1){\n\t\tif(a==0||b==0)break;\n\t\tif(a>=2*b){\n\t\t\ta=a-2*b;\n\t\t} else {\n\t\t\tif(b>=2*a){\n\t\t\t\tb=b-2*a;\n\t\t\t} else break;\n\t\t}\n\t}\n\tprintf(\"%lld %lld\",a,b);\n}", "lang": "GNU C", "bug_code_uid": "e27f69436e49a17b1971ff6fb9214f74", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "a568d4703543dd38e04b08cd83acfaf7", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8353982300884956, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n\nint main(void)\n{\n unsigned char s[50],t[50];\n int i;\n scanf(\"%s%s\",&s,&t);\n for(i=0;i\n#include \n#include \n\nstruct exam{\n\tint a;\n\tint b;\n\tint c;\n};\n\nstruct exam x[100];\nint s[100],day[100]={0};\n\nint compare(const void *a,const void *b){\n\treturn x[s[*(int *)a]].b-x[s[*(int *)b]].b;\n}\n\nint main(void){\n\tint n,m,i,j;\n\n\tscanf(\"%d %d\",&n,&m);\n\tfor(i=0;i0){\n\t\t\t\tprintf(\"-1\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tday[i]=m+1;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor(j=0;j=x[s[j]].a&&x[s[j]].c>0){\n\t\t\t\t\tx[s[j]].c--;\n\t\t\t\t\tday[i]=s[j]+1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(i=0;i\nint main()\n{\n int i=0,count=0;\n char s[15],s1[15];\n scanf(\"%s\",&s);\n while(s[i]!=\"\\0\")\n {\n if(s1[i]!=s[i])\n {\n count++;\n }\n i=i+1;\n }\n if(count==1)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "8c4e190035e35c4311652e9f2ac0014b", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "58c7adb589440769e884b6480bfdd54c", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6774595267745953, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint main()\n{\n long long n,ans=0;\n int flag=0;\n\n scanf(\"%I64d\",&n);\n\n while(n>=1)\n {\n if(n>=1 && flag==0)\n {\n n--;\n ans++;\n flag=1;\n }\n if(n>=2 && flag==1)\n {\n n-=2;\n ans++;\n flag=0;\n }\n\n\n\n }\n printf(\"%lld\\n\",ans);\n\n\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "a0e2242e624b00bd531dc5d01a9ebffd", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "9ecdbd9fda80a5bfbd1ee841a04aa63b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9305373525557011, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint maxx(int a, int b){\n int m = a;\n if(b>m) m = b;\n return m;\n}\n\nint main() {\n int n, aux = 0, max = 0;\n char *s;\n \n scanf(\"%d\\n\", &n);\n scanf(\"%s\", s);\n\n for(int i = 0; i < n; i++) {\n if(s[i] == '+'){\n aux++;\n } else aux--;\n max = maxx(max, aux);\n }\n\n printf(\"%d\\n\", max);\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "d5203184ee19775d11508443e796b81f", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "7f52346daf847097980112c3edcabdba", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9970059880239521, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define in32(x) scanf(\"%d\", &x)\n#define out32(x) printf(\"%d\", x)\n\nint main() {\n int t, n, i;\n in32(t);\n while(t--) {\n in32(n);\n i = 2;\n while (n%i && i * i <= n) i++;\n if ((n%i)) {\n i = n;\n }\n printf(\"%d %d\\n\", n / i, n - n / i);\n }\n return 1;\n}\n", "lang": "GNU C11", "bug_code_uid": "4bf9ae046b4a7f90d2b087a2e285acb1", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "f4350895685e2719589e429d14eea634", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7111597374179431, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main()\n{\n int n, a, b, i, rem;\n \n scanf(\"%d%d%d\", &n, &a, &b);\n \n if(n > 1)\n {\n if(b == 0)\n printf(\"%d\", a);\n else if(b > 0)\n {\n if((a + b) <= n)\n printf(\"%d\", a+b);\n else\n {\n rem = (a + b) % n;\n \n if(rem == 0)\n printf(\"%d\", n);\n else\n printf(\"%d\", rem);\n }\n }\n else\n {\n i = 1;\n \n do{\n rem = (b - 1) % n;\n \n if(rem == 0)\n break;\n else\n i++;\n }while(1);\n \n printf(\"%d\", a+i);\n }\n }\n else\n printf(\"%d\", 1);\n \n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "92c52c6fdc6b84a84f025a92ba0bdb3e", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "6e77e031250e6c5200e1268113c656f2", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9642160052049447, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include\n#include\n#include\nlong long cmpfunc (const void * a, const void * b) {\n return ( *(long long*)a - *(long long*)b );\n}\n\n\n\nint main(void){\n \nlong long int test,i,j,n,count,flag=0,o1=0,o2=0,b1,x,m,max,sum2,min,f,o,sum1,sum=0,y,x1,y1,count1=0,a2,b2,a[100000],b,c,z;\nchar a1[100000];\nscanf(\"%lld\",&n);\nif(444477770){\n if(x1%10==4){\n x++;\n }else{\n if(x1%10==7){\n y++;\n }else{\n flag=1;\n }\n }\n x1/=10;\n }\n if(x==y && flag==0){\n printf(\"%lld\",i);\n return 0;\n }\n}\n\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c6c7a4182f8ef5c118a8b4fe514b7147", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "f15322ae88431bfb5b2862fc0de1c0ee", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8571428571428571, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n#include \n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\n\nint main(int argc, char *argv[]) {\n\tint T1,T2,x,y,z,t1,t2,t3;\n\tscanf(\"%d,%d,%d,%d,%d,%d\",x,y,z,t1,t2,t3);\n\tT1=abs(z-x)*t2+abs(x-y)*t2+3*t1;\n\tT2=abs(x-y)*t1;\n\tif (T1\nint main()\n{\n int x,y,z,t1,t2,t3,temp,el,st;\n scanf(\"%d %d %d %d %d %d\",x,y,z,t1,t2,t3);\n if(zx){\n el=temp+(y-x)*t2;\n st=(y-x)*t1;\n if(el<=st){\n printf(\"YES\");\n }\n else{\n printf(\"NO\");\n }\n }\n else{\n el=temp+(x-y)*t2;\n st=(x-y)*t1;\n if(el<=st){\n printf(\"YES\");\n }\n else{\n printf(\"NO\");\n }\n }\n }\n else{\n temp=(z-x)*t2+t3*3;\n if(y>x){\n el=temp+(y-x)*t2;\n st=(y-x)*t1;\n if(el<=st){\n printf(\"YES\");\n }\n else{\n printf(\"NO\");\n }\n }\n else{\n el=temp+t3*3+(x-y)*t2;\n st=(x-y)*t1;\n if(el<=st){\n printf(\"YES\");\n }\n else{\n printf(\"NO\");\n }\n }\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9a6123d98110a3011d9ab328d8324a16", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "4ebd519b932a89699794dca2051c4a8c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9327800829875519, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\n#define SWAP(x,y) { int tmp=x;\tx=y;\ty=tmp; }\nchar num[8][9];\nchar C[8][9];\nint S[8];\nint findMax(int n,int k){\n\tint ans=-1;\n\tfor(int i=0;itmp )\n\t\t\tans=tmp;\n\t}\n\treturn ans;\n}\nint main(){\n\tint n,k;\n\twhile( scanf(\"%d%d\",&n,&k)==2 ){\n\t\tint ans=2e9;\n\t\tfor(int i=0;imax-min )\n\t\t\tans=max-min;\n\t\twhile( true ){\n\t\t\tint i,j;\n\t\t\tfor(i=k-2;i>=0&&S[i]>S[i+1];i--);\n\t\t\tif( i<0 )\n\t\t\t\tbreak;\n\t\t\tfor(j=k-1;j>i&&S[i]>S[j];j--);\n\t\t\tSWAP(S[i],S[j]);\n\t\t\tfor(i++,j=k-1;imax-min )\n\t\t\t\tans=max-min;\n\t\t}\n\t\tprintf(\"%d\\n\",ans);\n\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "b051868bf67616de549286c40f46d0df", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "apr_id": "57ff56b32e1707c0636d757ec4037031", "difficulty": 1400, "tags": ["brute force", "combinatorics", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5457413249211357, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n int w,y,k,v=0,n,i,j,l=0;\n scanf(\"%d %d %d\",&w,&y,&n);\n for(k=0;k\n#include\n#include\n#include\n#include\n#include\n#include\n#include\nusing namespace std;\nchar a[12][12];\ntypedef struct node {\n\tint aa,bb,cc,dd,ee,ff,gg,hh;\n} node;\nnode b[11][11];\nint c[]= {-1,-1,-1,0,1,1,1,0};\nint d[]= {-1,0,1,-1,1,0,-1,1};\nint dfs(int e,int w,int t,int p) {\n\tif(e<1||e>10||w<1||e>10||a[e][w]=='O') {\n\t\treturn p;\n\t}\n\tif(p!=0&&a[e][w]=='.') return p;\n\tif(a[e][w]=='X') p++;\n\tint xx=e+c[t];\n\tint yy=w+d[t];\n\tdfs(xx,yy,t,p);\n}\nint main() {\n\tfor(int i=1; i<=10; i++) {\n\t\tfor(int j=1; j<=10; j++) {\n\t\t\tscanf(\"%c\",&a[i][j]);\n\t\t}\n\t\tgetchar();\n\t}\n\tint flag=0;\n\tfor(int i=1; i<=10; i++) {\n\t\tfor(int j=1; j<=10; j++) {\n\t\t\tif(a[i][j]=='.') {\n\t\t\t\tfor(int k=0; k<=3; k++) {\n\t\t\t\t\tint sum=dfs(i,j,k,0)+dfs(i,j,k+4,0);\n\t\t\t\t\tif(sum>=4) {\n\t\t\t\t\t\tflag=1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(flag==1) break;\n\t\t}\n\t\tif(flag==1) break;\n\t}\n\tif(flag==1) printf(\"YES\\n\");\n\telse printf(\"NO\\n\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "f4ac7eba5cae3c9f9d01230738c729e3", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "29b2929ea7a72d5c991cfc466ac5ff8e", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9396117900790798, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint n;\nchar a[11][11], b[11][11], c[11][11];\n\nvoid turn()\n{\n int i, j, k, l;\n for(i=n-1, k=0; i>=0; --i, ++k)\n for(j=0, l=0; j\n#include \n#include \n\nint a[2000][2000];\n\nint main()\n{\n int i,j,k,l,m,n,t,p,q,s;\n while(scanf(\"%d%d\",&m,&n)!=EOF)\n {\n s=0;\n if(m%2==1&&n%2==1)\n {\n memset(a,0,sizeof(a));\n for(i=1;i<=m;i++)\n {\n for(j=1;j<=n;j++)\n {\n if(a[i][j]==0)\n {\n s++;\n t=0;\n for(k=1;k<=m;k++)\n {\n if(k5)break;\n for(l=1;l<=n;l++)\n {\n if(t==0&&l<=j)\n {\n t=1;\n continue;\n }\n q=l-j;\n if(p*p+q*q==5)\n {\n a[k][l]=1;\n }\n else if(l>j&&p*p+q*q>5)\n break;\n }\n }\n }\n }\n }\n }\n else if(m%2==0&&n%2==0)\n {\n if(m<=n)\n {\n s=n*((m-1)/3+1);\n }\n else\n {\n s=m*((n-1)/3+1);\n }\n }\n else\n {\n if(m%2==0)\n {\n p=n*((m-1)/3+1);\n q=m*((n-1)/3+1);\n if(p<=q)\n s=q;\n else\n s=p;\n }\n else\n {\n p=m*((n-1)/3+1);\n q=n*((m-1)/3+1);\n if(p<=q)\n s=q;\n else\n s=p;\n }\n }\n printf(\"%d\\n\",s);\n }\n return 0;\n}\n\n\n ", "lang": "GNU C", "bug_code_uid": "585de24941c2e2e80520b2aaed8e2a44", "src_uid": "e858e7f22d91aaadd7a48a174d7b2dc9", "apr_id": "7c638868c4dbe320edfde9d40cb3ea71", "difficulty": 1800, "tags": ["math", "greedy", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7641707487753674, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \nint ExChange(int a,int b)\n{\n if(a>b)\n return a;\n else\n return b;\n}\nint main()\n{\n int m,n,Max;\n scanf(\"%d%d\",&n,&m);\n if (n==1||m==1)\n printf(\"%d\\n\",n*m);\n Max=ExChange(m,n);\n else if (n==2||m==2)\n {\n if (Max%4==0)\n printf(\"%d\\n\",Max);\n else if (Max%4==0)\n printf(\"%d\\n\",Max+1);\n else\n printf(\"%d\\n\",(Max/4)*4+4);\n }\n else\n printf(\"%d\\n\",(m*n+1)/2);\n return 0;\n}\n\n ", "lang": "GNU C", "bug_code_uid": "bcebd5198dcdfa21a42c88074e4b20be", "src_uid": "e858e7f22d91aaadd7a48a174d7b2dc9", "apr_id": "7c638868c4dbe320edfde9d40cb3ea71", "difficulty": 1800, "tags": ["math", "greedy", "graph matchings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8303317535545024, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint cmpfunc (const void * a, const void * b) {\n\treturn ( *(char*)a - * (char*)b );\n}\n\nint main() {\n\t//printf(\"Hola Mundo\\n\");\n\tchar string[10], aux[10];\n\tscanf(\"%s\", string);\n\tint len = 0, i;\n\twhile (string[len] != '\\0') {\n\t\taux[len] = string[len];\n\t\tlen++;\n\t}\n\n\tif (len != 1) {\n\t\tqsort(aux, len, sizeof(char), cmpfunc);\n\t\ti = len - 1;\n\t\twhile (aux[i] == aux[len - 1] && i != -1) {\n\t\t\tprintf(\"%c\", aux[i]);\n\t\t\ti--;\n\t\t}\n\t} else {\n\t\tprintf(\"%s\", string);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "3b1b6d95debcbac1e1845f2e2d86de18", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "8b9813e6f23a7a766d03d969d9140172", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.925, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n if(n==1)\n printf(\"Washington\\n\");\n else if(n==2||n==6)\n printf(\"Adams\\n\");\n else if(n==3)\n printf(\"Jefferson\\n\");\n else if(n==4)\n printf(\"Madison\\n\");\n else if(n==5)\n printf(\"Monroe\\n\");\n else if(n==7)\n printf(\"Jackson\\n\");\n else if(n==8)\n printf(\"Van Buren\\n\");\n else if(n==9||n==23)\n printf(\"Harrison\\n\");\n else if(n==10)\n printf(\"Tyler\\n\");\n else if(n==11)\n printf(\"Polk\\n\");\n else if(n==12)\n printf(\"Taylor\\n\");\n else if(n==13)\n printf(\"Fillmore\\n\");\n else if(n==14)\n printf(\"Pierce\\n\");\n else if(n==15)\n printf(\"Buchanan\\n\");\n else if(n==16)\n printf(\"Lincoln\\n\");\n else if(n==17)\n printf(\"Johnson\\n\");\n else if(n==18)\n printf(\"Grant\\n\");\n else if(n==19)\n printf(\"Hayes\\n\");\n else if(n==20)\n printf(\"Garfield\\n\");\n else if(n==21)\n printf(\"Arthur\\n\");\n else if(n==22||n==24)\n printf(\"Cleveland\\n\");\n else if(n==25)\n printf(\"McKinley\\n\");\n else if(n==26)\n printf(\"Roosevelt\\n\");\n else if(n==27)\n printf(\"Taft\\n\");\n else if(n==28)\n printf(\"Wilson\\n\");\n else if(n==29)\n printf(\"Harding\\n\");\n else if(n==30)\n printf(\"Coolidge\\n\");\n else if(n==31)\n \n else if(n==32)\n \n else if(n==33)\n \n else if(n==34)\n \n else if(n==35)\n \n else if(n==36)\n \n else if(n==37)\n \n else if(n==38)\n \n else if(n==39)\n \n else if(n==40)\n \n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d6a153f554ec8c8f24987815c90676e5", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "3aee116c9d68150d6c8dfe03c2f776be", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9980806142034548, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n\n int n, s=0;\n char c;\n scanf(\"%d\\n\",&n);\n scanf(\"%c\",c);\n while(c - '0'){\n s++;\n if (s==n) break;\n scanf(\"%c\",&c);\n }\n if (s==n) printf(\"%d\",n);\n else printf(\"%d\",s+1);\n\n\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "13f4ef4b65806cf25c61912496f7996b", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "9ad100223215f5e75433eb1947a4c3fb", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7304204451772465, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n\tlong long int i,j,k,l,n,nod,count=0,first,ans,m;\n\tscanf(\"%lld\", &nod);\n\tscanf(\"%lld\", &n);\n\tlong long int a[n],b[n];\n\tm=nod;\n\tfor(i=nod-1;i>=0;i--)\n\t{\n\t\tb[i]=a[i]=n%10;\n\t\tn=n/10;\n\t}\n\tfirst=1;\n\tfor(j=0;j\nint main()\n{\n int n,c;\n while(1){\n c=0;\n scanf(\"%d%*c\",&n);\n char str[100],*ptr;\n gets(str);\n ptr=str;\n while(*ptr)\n {\n if(*ptr=='1')\n c++;\n if(*ptr=='0')\n {\n printf(\"%d\",c);\n c=0;\n }\n ptr++;\n }\n ptr--;\n if(*ptr=='1')\n printf(\"%d\",c);\n printf(\"\\n\");\n}\n}\n", "lang": "GNU C", "bug_code_uid": "7d5a65db821fe7fe5d6df50db6dd2fdb", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "31b4dab4744c013bc3eb471008597062", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9621848739495799, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint x[100] = {0};\nint cmp(const void *a,const void *b)\n{\n return *( int *)a - *( int *)b;\n}\nint main()\n{\n int n,i,c=0;\n scanf(\"%d\",&n);\n for(i=0; i\n\nint main () {\n char a[50] ;\n int cou , i;\n while (1) {\n cou = 0 ;\n for( i = 0 ; i < 50 ; i++ ) {\n scanf ( \"%c\" , &a[i] ) ;\n if ( a[i] == '\\n' ) {\n break ;\n }\n else if ( a[i] == 'a' || a[i] =='e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u' ) {\n cou ++ ;\n }\n else if ( a[i] % 2 != 0 && a[i] >= '0' && a[i] <= '9' ) {\n cou ++ ;\n }\n }\n printf ( \"%d\\n\", cou ) ;\n getchar () ;\n }\n return 0 ;\n}\n", "lang": "GNU C", "bug_code_uid": "e49e1e87ca3c260ab4e67fe9dba2f4e8", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "b0d3e87be042dc40b42795202303421b", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.312625250501002, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "// ConsoleApplication1.cpp : \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0328\u04e6\ufffd\u00f3\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u06b5\u3863\n//\n\n#include \"stdafx.h\"\n#include\n#include\nusing namespace std;\nint main()\n{\n\tint i, j, k;\n\tint n, m, t, d;\n\tint sum1=0;\n\tint sum2=0;\n\tscanf(\"%d %d %d %d\", &n, &t, &k, &d);\n\tint l = n;\n\twhile (l > 0)\n\t{\n\t\tsum1 += t;\n\t\tl -= k;\n\t}\n\tl = n;\n\twhile (l > 0)\n\t{\n\t\tsum2++;\n\t\tif (sum2%t == 0)\n\t\t{\n\t\t\tl -= k;\n\t\t}\n\t\tif (sum2 - d > 0 && (sum2 - d) % t == 0)\n\t\t{\n\t\t\tl -= k;\n\t\t}\n\t}\n\tif (sum1 > sum2)\n\t{\n\t\tprintf(\"YES\\n\");\n\t}\n\telse\n\t{\n\t\tprintf(\"NO\\n\");\n\t}\n\treturn 0;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "fee0263221f91b9ac8c8a5bc1c728d58", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "ad8a3ece584bfd6dc43280804c09f41b", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9489232959601352, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \n#include \nint max=0;\nint a[10];//\u05f4\u032c \nint p[100];\ntypedef struct Ch\n{\n\tint val;\n\tint mvrg;\n\tint thrg;\n};\ntypedef struct Ch CA[4];\nint movethrow(CA,int);\nint search(int pe)\n{\n\tint i,t;\n\tfor (i=1;i<45;i++)\t\n\t{\n\t\tif (p[i]>0)\n\t\t{\n\t\t\tt=p[i];\n\t\t\twhile (t)\n\t\t\t{\n\t\t\t\tif ((t%10)==pe)\n\t\t\t\t\treturn i;\n\t\t\t\tt=t/10;\n\t\t\t}\n\t\t}\n\t}\n}\nint change(int pe,int pos)\n{\n\tint t;\n\tt=search(pe);\n\tp[t]=0;\n\tp[pos]=pe;\n\t\n}\nint tr(CA C,int pe)\n{\n\tint i,j;\n\tint temp;\n\tint f,m,r,t[3];\n\tt[1]=search(1);\n\tt[2]=search(2);\n\tt[3]=search(3);\n\tm=t[pe];\n\ttemp=p[m];\n\tf=m-C[pe].thrg;\n\tr=m+C[pe].thrg;\n\tif (r>max)\n\t\tmax=r;\n\tif (f<=0)\n\t\tf=1;\n\tfor (i=f;i<=r;i++)\n\t{\n\t\tif (i!=m&&p[i]==0&&\n\t\t\t(abs(i-t[1])==1||abs(i-t[2]==1)||abs(i-t[3])==1||i==r))\n\t\t{\n\t\t\tp[i]=temp/10;\n\t\t\tp[m]=temp%10;\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp[i]=0;\n\t\t\tp[m]=temp;\n\t\t}\n\t}\n\treturn 0;\n}\nint mv(CA C,int pe)\n{\n\tint i,j;\n\tint f,m,r,t[3];\n\tt[1]=search(1);\n\tt[2]=search(2);\n\tt[3]=search(3);\n\tm=t[pe];\n\t\n\tf=m-C[pe].mvrg;\n\tr=m+C[pe].mvrg;\n\tif (r>max)\n\t\tmax=r;\n\tif (f<=0)\n\t\tf=1;\n\tfor (i=f;i<=r;i++)\n\t{\n\t\tif (i!=m&&p[i]==0&&\n\t\t\t(abs(i-t[1])==1||abs(i-t[2]==1)||abs(i-t[3])==1||i==r))\n\t\t{\n\t\t\tchange(pe,i);\n\t\t\t\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tchange(pe,m);\n\treturn 0;\n}\n\nint movethrow(CA C,int fr)\n{\n\tint i,j;\n\tint rt;\n\tif (fr%3==1)\n\t{\n\t\trt=fr/3+1;\n\t\tif (a[fr+1]==1&&a[fr+2]==0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse if (p[search(rt)]>10)\n\t\t{\n\t\t\treturn 0;\n\t \t}\n\t\telse\n\t\t{\n\t\t\tmv(C,rt);\n\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t}\n\tif (fr%3==2)\n\t{\n\t\tint px;\n\t\trt=fr/3+1;\n\t\tpx=search(rt);\n\t\tif (p[px]>10)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse if (p[px-1]>0)\n\t\t{\n\t\t\tint temp;\n\t\t\tp[px]+=p[px-1]*10;\n\t\t\ttemp=p[px-1];\n\t\t\tp[px-1]=0;\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp[px]=rt;\n\t\t\tp[px-1]=temp;\n\t\t}\n\t\telse if (p[px+1]>0)\n\t\t{\n\t\t\tint temp;\n\t\t\tp[px]+=p[px+1]*10;\n\t\t\ttemp=p[px+1];\n\t\t\tp[px+1]=0;\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp[px]=rt;\n\t\t\tp[px+1]=temp;\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}\n\tif (fr%3==0)\n\t{\n\t\trt=fr/3;\n\t\tint px;\n\t\tpx=search(rt);\n\t\tif (a[fr-1]==0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse if (p[px]%10!=rt)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse \n\t\t{\n\t\t\ttr(C,rt);\n\t\t\treturn 0;\n\t\t}\n\t}\n}\nint main()\n{\n\tCA C;\n\tint i,j;\n\tfor (i=1;i<100;i++)\n\t{\n\t\tp[i]=0;\n\t}\n\tfor (i=1;i<=3;i++) \n\t{\n\t\tscanf(\"%d %d %d\",&C[i].val,&C[i].mvrg,&C[i].thrg);\n\t\tp[C[i].val]=i;\n\t}\n\tfor (i=0;i<=9;i++)\n\t{\n\t\ta[i]=0;\n\t}\n\tfor (i=1;i<=9;i++)\n\t{\n\t\ta[i]=1;a[0]++;\n\t\tmovethrow(C,i);\n\t\ta[i]=0;a[0]--;\n\t}\n\tprintf(\"%d\",max);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "eeb8c937f36b8bc43d2aaf5e2c50fae5", "src_uid": "a14739b86d1fd62a030226263cdc1afc", "apr_id": "bfa48ba03474d15000d21d99c1793a0a", "difficulty": 2500, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8004943502824858, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \nint max=0;\nint a[10];\nint p[100];\ntypedef struct\n{\n\tint val;\n\tint mvrg;\n\tint thrg;\n}Ch;\ntypedef Ch CA[4];\nint movethrow(CA,int);\nint search(int pe)\n{\n\tint i,t;\n\tfor (i=1;i<45;i++)\t\n\t{\n\t\tif (p[i]>0)\n\t\t{\n\t\t\tt=p[i];\n\t\t\twhile (t)\n\t\t\t{\n\t\t\t\tif ((t%10)==pe)\n\t\t\t\t\treturn i;\n\t\t\t\tt=t/10;\n\t\t\t}\n\t\t}\n\t}\n}\nint change(int pe,int pos)\n{\n\tint t;\n\tt=search(pe);\n\tp[t]=0;\n\tp[pos]=pe;\n\t\n}\nint tr(CA C,int pe)\n{\n\tint i,j;\n\tint f,m,r,t[4];\n\tint temp;\n\tt[1]=search(1);\n\tt[2]=search(2);\n\tt[3]=search(3);\n\tm=t[pe];\n\ttemp=t[pe];\n\tt[pe]=t[3];\n\tt[3]=temp;\n\ttemp=p[m];\n\tf=m-C[pe].thrg;\n\tr=m+C[pe].thrg;\n\tif (r>max)\n\t\tmax=r;\n\tif (f<=0)\n\t\tf=1;\n\tfor (i=f;i<=r;i++)\n\t{\n\t\tif (i!=m&&p[i]==0&&\n\t\t\t(abs(i-t[1])<=2||abs(i-t[2]<=2)||i==r))\n\t\t{\n\t\t\t\n\t\t\tp[i]=temp/10;\n\t\t\tp[m]=temp%10;\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp[i]=0;\n\t\t\tp[m]=temp;\n\t\t}\n\t}\n\treturn 0;\n}\nint mv(CA C,int pe)\n{\n\tint i,j;\n\tint f,m,r,t[4];\n\tint temp;\n\tt[1]=search(1);\n\tt[2]=search(2);\n\tt[3]=search(3);\n\tm=t[pe];\n\ttemp=t[pe];\n\tt[pe]=t[3];\n\tt[3]=temp;\n\tf=m-C[pe].mvrg;\n\tr=m+C[pe].mvrg;\n\tif (r>max)\n\t\tmax=r;\n\tif (f<=0)\n\t\tf=1;\n\tfor (i=f;i<=r;i++)\n\t{\n\t\tif (i!=m&&p[i]==0&&\n\t\t\t(abs(i-t[1])<=2||abs(i-t[2]<=2)||i==r))\n\t\t{\n\t\t\tchange(pe,i);\n\t\t\t\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tchange(pe,m);\n\treturn 0;\n}\n\nint movethrow(CA C,int fr)\n{\n\tint i,j;\n\tint rt;\n\tif (fr%3==1)\n\t{\n\t\trt=fr/3+1;\n\t\tif (a[fr+1]==1&&a[fr+2]==0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse if (p[search(rt)]>10)\n\t\t{\n\t\t\treturn 0;\n\t \t}\n\t\telse\n\t\t{\n\t\t\tmv(C,rt);\n\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t}\n\tif (fr%3==2)\n\t{\n\t\tint px;\n\t\trt=fr/3+1;\n\t\tpx=search(rt);\n\t\tif (p[px]>10)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse if (p[px-1]>0)\n\t\t{\n\t\t\tint temp;\n\t\t\tp[px]+=p[px-1]*10;\n\t\t\ttemp=p[px-1];\n\t\t\tp[px-1]=0;\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp[px]=rt;\n\t\t\tp[px-1]=temp;\n\t\t}\n\t\telse if (p[px+1]>0)\n\t\t{\n\t\t\tint temp;\n\t\t\tp[px]+=p[px+1]*10;\n\t\t\ttemp=p[px+1];\n\t\t\tp[px+1]=0;\n\t\t\tfor (j=1;j<=9;j++)\n\t\t\t{\n\t\t\t\tif (a[j]==0)\n\t\t\t\t{\n\t\t\t\t\ta[j]=1;a[0]++;\n\t\t\t\t\tmovethrow(C,j);\n\t\t\t\t\ta[j]=0;a[0]--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp[px]=rt;\n\t\t\tp[px+1]=temp;\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}\n\tif (fr%3==0)\n\t{\n\t\trt=fr/3;\n\t\tint px;\n\t\tpx=search(rt);\n\t\tif (a[fr-1]==0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse if (p[px]%10!=rt)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse \n\t\t{\n\t\t\ttr(C,rt);\n\t\t\treturn 0;\n\t\t}\n\t}\n}\nint main()\n{\n\tCA C;\n\tint i,j;\n\tfor (i=1;i<100;i++)\n\t{\n\t\tp[i]=0;\n\t}\n\tfor (i=1;i<=3;i++)\n\t{\n\t\tscanf(\"%d %d %d\",&C[i].val,&C[i].mvrg,&C[i].thrg);\n\t\tp[C[i].val]=i;\n\t}\n\tfor (i=0;i<=9;i++)\n\t{\n\t\ta[i]=0;\n\t}\n\tfor (i=1;i<=9;i++)\n\t{\n\t\ta[i]=1;a[0]++;\n\t\tmovethrow(C,i);\n\t\ta[i]=0;a[0]--;\n\t}\n\t\n\tprintf(\"%d\",max);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "37a6a0f7f3665d549283749898c73e92", "src_uid": "a14739b86d1fd62a030226263cdc1afc", "apr_id": "bfa48ba03474d15000d21d99c1793a0a", "difficulty": 2500, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2505307855626327, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint p1,p2,p3,p4,a,b,ans;\nint main(){\n\tios::sync_with_stdio(false);\n\tscanf(\"%d %d %d %d %d %d\",&p1,&p2,&p3,&p4,&a,&b);\n\tfor(int i=a;i<=b;i++){\n\t\tif(i%p1==i&&i%p2==i&&i%p3==i&&i%p4==i){\n\t\t\tans++;\n\t\t}\n\t}\n\tprintf(\"%d\",ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d2bc2a975eb9fa7bddf51e6405bb8631", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "cab27f89ba60ffe8ed750658c93fd15b", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9274310595065312, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include \n#define maxn 1000\n\nlong p[maxn+1][5],xl[maxn+1][maxn+1][5],point[maxn+1],count=0;\n__int64 value[maxn+1][maxn+1];\nbool vis[maxn+1];\n\n long n,i,j,k,l;\n __int64 v1,v2;\n\n\nvoid work()\n{\n for (j=1;j\n#include\n/*\nint cmp(const void* a,const void * b)\n{\nint * g = (int *)a;int * y = (int *)b;\n\nif(g[0]y[1])return 11;\nelse\n{\nif(g[2]>y[2])return 11;\nelse\n{\nif(g[3]>y[3])return 11;\nelse\n{\nif(g[4]>y[4])return 11;\nelse return -141;\n}}}}}\n//return -141;\n}}*/\n\nint main()\n{\n\nint arr[6000];\n\nint i=0;\nint n;\nscanf(\"%d\",&n);\n\nfor(i=0;i<5*n;i+=5)\n{\nscanf(\"%d %d %d %d %d\",&arr[i+0],&arr[i+1],&arr[i+2],&arr[i+3],&arr[i+4]);\n}\nint good = 0;int arr2[1005];\nint j;int k;\nfor(i=0;i<5*(n-2);i+=5)\n{int flag=101;\nfor(j=i+5;j<5*(n-1);j+=5)\n{\nfor(k=j+5;k<5*(n);k+=5)\n{\nif(((arr[i+0]-arr[j+0])*(arr[i+0]-arr[k+0]) +(arr[i+1]-arr[j+1])*(arr[i+1]-arr[k+1])+(arr[i+2]-arr[j+2])*(arr[i+2]-arr[k+2]) \n+(arr[i+3]-arr[j+3])*(arr[i+3]-arr[k+3]) + (arr[i+4]-arr[j+4])*(arr[i+4]-arr[k+4]))>0)\n{\nflag =-99;break;\n\n}\n\n}\nif(flag == -99)break;\n}\nif(flag == 101)\n{\nint h=0;\n/*for(h=0;h<5;h++)\n{\narr2[good][h]=arr[i+h];\n}*/\narr2[good++]=(i+5)/5;\n}\n}\n//qsort(arr2,good,sizeof(int *),cmp);\n\nprintf(\"%d\\n\",good);\nint port =0;\nfor(port=0;port\n#include \n#include \n#include \n\n#define MAX(A,B) (((A) > (B))?(A):(B))\n#define MIN(A,B) (((A) < (B))?(A):(B))\n\n#define LN printf(\"\\n\")\n#define TAB printf(\"\\t\")\n#define SPACE printf(\" \")\n\ntypedef unsigned long long uint64;\ntypedef long long int64;\ntypedef signed short int16;\ntypedef unsigned short uint16;\ntypedef char byte;\n\n\nvoid int64_print(int64 n){\n\tint64 carry = 10;\n\tif (n == 0){\n\t\tprintf(\"0\");\n\t\treturn;\n\t}\n\tchar buf[20];\n\tbuf[0] = '\\0';\n\tint i = 0, j;\n\twhile (n > 0){\n\t\tbuf[i] = n % carry;\n\t\tn = n / carry;\n\t\ti += 1;\n\t}\n\ti--;\n\tfor (j = i; j>= 0; j--){\n\t\tprintf(\"%c\", 48 + buf[j]);\n\t}\n}\nvoid uint64_print(uint64 n){\n\tuint64 carry = 10;\n\tchar buf[20];\n\tbuf[0] = '\\0';\n\tint i = 0, j;\n\twhile (n > 0){\n\t\tbuf[i] = n % carry;\n\t\tn = n / carry;\n\t\ti += 1;\n\t}\n\ti--;\n\tfor (j = i; j>= 0; j--){\n\t\tprintf(\"%c\", 48 + buf[j]);\n\t}\n}\n\n\nuint64 uint64_read(){\n\tchar* s = (char*) calloc(20, sizeof(char));\n\ts[0] = '\\0';\n\tscanf(\"%s\", s);\n\t//printf(\"=======%s\\n\", s);\n\tuint64 ret = 0;\n\tuint64 carry = 1;\n\tint len = strlen(s), i;\n\tfor (i = 0; i < len; i++){\n\t\tret += carry * (s[len-1-i] - 48);\n\t\tcarry*=10;\n\t};\n\tfree(s);\n\treturn ret;\n}\n\n\nint64 int64_read(){\n\tchar* s = (char*) calloc(21, sizeof(char));\n\ts[0] = '\\0';\n\tscanf(\"%s\", s);\n\t//printf(\"=======%s\\n\", s);\n\tint64 ret = 0;\n\tint64 carry = 1;\n\tint len = strlen(s), i;\n\tfor (i = 0; i < len; i++){\n\t\tret += carry * (s[len-1-i] - 48);\n\t\tcarry*=10;\n\t};\n\tfree(s);\n\treturn ret;\n}\n\n//#define DEBUG\n\nint64 x;\nint a[100001];\nint b[100001];\n\nint n,d;\n\nvoid swap(int* a, int* b){\n\tint c;\n\tc = *a;\n\t*a = *b;\n\t*b = c;\n\treturn;\n}\nint64 getNextX() {\n x = (x * 37 + 10007) % 1000000007;\n return x;\n}\nvoid initAB() {\n\tint i;\n for(i = 0; i < n; i = i + 1){\n a[i] = i + 1;\n }\n for(i = 0; i < n; i = i + 1){\n swap(&(a[i]), &(a[(int)(getNextX() % (i + 1LL))]));\n }\n for(i = 0; i < n; i = i + 1){\n if (i < d)\n b[i] = 1;\n else\n b[i] = 0;\n }\n for(i = 0; i < n; i = i + 1){\n swap(&(b[i]), &(b[(int)(getNextX() % (i + 1LL))]));\n }\n}\n\n\nint main(){\n\tscanf(\"%d %d\", &n, &d);\n\tx = int64_read();\n\tint i,j;\n\tinitAB();\n\tint max_a[100000];\n\tint index_a[100001];\n\tint sum_b[100000];\n\tint q[100001];\n\tq[0] = 0;\n\tsum_b[0] = b[0];\n\tmax_a[0] = a[0];\n#ifdef DEBUG\n\tprintf(\"d:%d\\na:\\n\", d);\n\tfor (i = 0 ; i < n; i++){\n\t\tprintf(\"%d\\t\", a[i]);\n\t}\n\tLN;\n\tfor (i = 0 ; i < n; i++){\n\t\tprintf(\"%d\\t\", b[i]);\n\t}\n\tLN;\n\n#endif\n\tint tmp = -1;\n\tfor (i = 0; i< n; i++){\n\t\tindex_a[a[i]] = i;\n\t\tif (b[i]) q[++q[0]] = i;\n\t\tif (i > 0){\n\t\t\tsum_b[i] = b[i] + sum_b[i-1];\n\t\t}\n\t\tif (sum_b[i] == 0){\n\t\t\ttmp = i;\n\t\t}\n\n\t}\n#ifdef DEBUG\n\tprintf(\"tmp:%d\\n\", tmp);\n\tprintf(\"sum_b[%d]:%d\\n\", tmp+1, sum_b[tmp+1]);\n#endif\n\tfor (i = 0; i <= tmp; i++){\n\t\tmax_a[i] = MAX(a[i], max_a[i-1]);\n\t\tprintf(\"0\\n\");\n\t}\n\tfor (i = tmp+1; i < n; i++){\n\t\tint c = 0;\n\t\tmax_a[i] = MAX(a[i], max_a[i-1]);\n\t\tif (sum_b[i] == i+1){\n\t\t\tprintf(\"%d\\n\", max_a[i]);\n\t\t\tcontinue;\n\t\t}\n\t\tint s = 0;\n\t\tbyte next = 0;\n\t\tfor (j = max_a[i]; j >= 0 && s < 100; j--, s++){\n\t\t\tif (index_a[j] <= i){\n\t\t\t\tif (b[i - index_a[j]]){\n\t\t\t\t\tnext = 1;\n\t\t\t\t\tprintf(\"%d\\n\", j);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (next){\n\t\t\tcontinue;\n\t\t}\n\t\tint k = 0;\n\t\tfor (j = q[k]; j<= n && k <=q[0]; j++, k++){\n\t\t\t\tc = MAX(c, a[i-j]);\n\t\t}\n\t\tprintf(\"%d\\n\",c);\n\t}\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "856de1c86ed833447e53cdc1e2c65cda", "src_uid": "948ae7a0189ada07c8c67a1757f691f0", "apr_id": "acfda8c75219cda8f2b443b5e647d304", "difficulty": 2300, "tags": ["probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9331637699590222, "equal_cnt": 32, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 18, "fix_ops_cnt": 32, "bug_source_code": "/*\n * main.c\n *\n * Created on: 03 \ufffd\ufffd\ufffd. 2014 \ufffd.\n * Author: ulgish\n */\n\n\n/*\n * util.c\n *\n * Created on: 30 \ufffd\ufffd\ufffd\ufffd 2014 \ufffd.\n * Author: ulgish\n */\n#include \n#include \n#include \n#include \n\n#define MAX(A,B) (((A) > (B))?(A):(B))\n#define MIN(A,B) (((A) < (B))?(A):(B))\n\n#define LN printf(\"\\n\")\n#define TAB printf(\"\\t\")\n#define SPACE printf(\" \")\n\ntypedef unsigned long long uint64;\ntypedef long long int64;\ntypedef signed short int16;\ntypedef unsigned short uint16;\ntypedef char byte;\n\n\nvoid int64_print(int64 n){\n\tint64 carry = 10;\n\tif (n == 0){\n\t\tprintf(\"0\");\n\t\treturn;\n\t}\n\tchar buf[20];\n\tbuf[0] = '\\0';\n\tint i = 0, j;\n\twhile (n > 0){\n\t\tbuf[i] = n % carry;\n\t\tn = n / carry;\n\t\ti += 1;\n\t}\n\ti--;\n\tfor (j = i; j>= 0; j--){\n\t\tprintf(\"%c\", 48 + buf[j]);\n\t}\n}\nvoid uint64_print(uint64 n){\n\tuint64 carry = 10;\n\tchar buf[20];\n\tbuf[0] = '\\0';\n\tint i = 0, j;\n\twhile (n > 0){\n\t\tbuf[i] = n % carry;\n\t\tn = n / carry;\n\t\ti += 1;\n\t}\n\ti--;\n\tfor (j = i; j>= 0; j--){\n\t\tprintf(\"%c\", 48 + buf[j]);\n\t}\n}\n\n\nuint64 uint64_read(){\n\tchar* s = (char*) calloc(20, sizeof(char));\n\ts[0] = '\\0';\n\tscanf(\"%s\", s);\n\t//printf(\"=======%s\\n\", s);\n\tuint64 ret = 0;\n\tuint64 carry = 1;\n\tint len = strlen(s), i;\n\tfor (i = 0; i < len; i++){\n\t\tret += carry * (s[len-1-i] - 48);\n\t\tcarry*=10;\n\t};\n\tfree(s);\n\treturn ret;\n}\n\n\nint64 int64_read(){\n\tchar* s = (char*) calloc(21, sizeof(char));\n\ts[0] = '\\0';\n\tscanf(\"%s\", s);\n\t//printf(\"=======%s\\n\", s);\n\tint64 ret = 0;\n\tint64 carry = 1;\n\tint len = strlen(s), i;\n\tfor (i = 0; i < len; i++){\n\t\tret += carry * (s[len-1-i] - 48);\n\t\tcarry*=10;\n\t};\n\tfree(s);\n\treturn ret;\n}\n\n//#define DEBUG\n\nint64 x;\nint a[100001];\nint b[100001];\n\nint n,d;\n\nvoid swap(int* a, int* b){\n\tint c;\n\tc = *a;\n\t*a = *b;\n\t*b = c;\n\treturn;\n}\nint64 getNextX() {\n x = (x * 37 + 10007) % 1000000007;\n return x;\n}\nvoid initAB() {\n\tint i;\n for(i = 0; i < n; i = i + 1){\n a[i] = i + 1;\n }\n for(i = 0; i < n; i = i + 1){\n swap(&(a[i]), &(a[(int)(getNextX() % (i + 1LL))]));\n }\n for(i = 0; i < n; i = i + 1){\n if (i < d)\n b[i] = 1;\n else\n b[i] = 0;\n }\n for(i = 0; i < n; i = i + 1){\n swap(&(b[i]), &(b[(int)(getNextX() % (i + 1LL))]));\n }\n}\n\n\nint main(){\n\tscanf(\"%d %d\", &n, &d);\n\tx = int64_read();\n\tint i,j;\n\tinitAB();\n\tint max_a[100000];\n\tint index_a[100001];\n\tint sum_b[100000];\n\tsum_b[0] = b[0];\n\tmax_a[0] = a[0];\n#ifdef DEBUG\n\tprintf(\"d:%d\\na:\\n\", d);\n\tfor (i = 0 ; i < n; i++){\n\t\tprintf(\"%d\\t\", a[i]);\n\t}\n\tLN;\n\tfor (i = 0 ; i < n; i++){\n\t\tprintf(\"%d\\t\", b[i]);\n\t}\n\tLN;\n\n#endif\n\tint tmp = -1;\n\tfor (i = 0; i< n; i++){\n\t\tindex_a[a[i]] = i;\n\t\tif (i > 0){\n\t\t\tsum_b[i] = b[i] + sum_b[i-1];\n\t\t}\n\t\tif (sum_b[i] == 0){\n\t\t\ttmp = i;\n\t\t}\n\n\t}\n#ifdef DEBUG\n\tprintf(\"tmp:%d\\n\", tmp);\n\tprintf(\"sum_b[%d]:%d\\n\", tmp+1, sum_b[tmp+1]);\n#endif\n\tfor (i = 0; i <= tmp; i++){\n\t\tmax_a[i] = MAX(a[i], max_a[i-1]);\n\t\tprintf(\"0\\n\");\n\t}\n\tfor (i = tmp+1; i < n; i++){\n\t\tint c = 0;\n\t\tmax_a[i] = MAX(a[i], max_a[i-1]);\n\t\tif (sum_b[i] == 0){\n\t\t\tprintf(\"0\\n\");\n\t\t\tcontinue;\n\t\t}\n\t\tint s = 0;\n\t\tbyte next = 0;\n\t\tfor (j = max_a[i]; j >= 0 && s < 5000; j--, s++){\n\t\t\tif (index_a[j] <= i){\n\t\t\t\tif (b[i - index_a[j]]){\n\t\t\t\t\tnext = 1;\n\t\t\t\t\tprintf(\"%d\\n\", j);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (next){\n\t\t\tcontinue;\n\t\t}\n\t\tfor (j = 0; j<= i; j++){\n\t\t\tc = MAX(c, a[j]*b[i-j]);\n\t\t}\n\t\tprintf(\"%d\\n\",c);\n\t}\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0c76ad5678216999a02ae7841cf0d0b4", "src_uid": "948ae7a0189ada07c8c67a1757f691f0", "apr_id": "acfda8c75219cda8f2b443b5e647d304", "difficulty": 2300, "tags": ["probabilities"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9894446994033961, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#define\tLLD\t\"%lld\"\nint n,l;\nint x[10];\nint w[10];\nlong long dp[10][21];\nlong long c[21][21];\nvoid init(){\n\tint i,j;\n\tfor(i=1;i<=20;i++){\n\t\tc[i][0]=1;\n\t\tc[i][i]=1;\n\t}\n\tfor(i=2;i<=20;i++){\n\t\tfor(j=1;j0;n/=10){\n\t\t\tx[n%10]++;\n\t\t}\n\t\tl=0;\n\t\tfor(i=1;i<10;i++){\n\t\t\tif(x[i]>0){\n\t\t\t\tw[l++]=x[i];\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<10;i++){\n\t\t\tfor(j=0;j<=20;j++){\n\t\t\t\tdp[i][j]=0;\n\t\t\t}\n\t\t}\n\t\tfor(i=1;i<=w[0];i++){\n\t\t\tdp[0][i]=1;\n\t\t}\n\t\tfor(i=1;i=i;k++){\n\t\t\t\t\tdp[i][j]+=dp[i-1][j-k]*c[j-k+k][j-k];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(x[0]>0){\n\t\t\tl++;\n\t\t\tfor(j=i+1;j<=20;j++){\n\t\t\t\tfor(k=1;k<=x[0]&&j-k>=i;k++){\n\t\t\t\t\tdp[i][j]+=dp[i-1][j-k]*c[j-1-k+k][j-1-k];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tr=0;\n\t\tfor(i=0;i<=20;i++){\n\t\t\tr+=dp[l-1][i];\n\t\t}\n\t\tprintf(LLD\"\\n\",r);\n\t}\n}\nmain(){\n#ifndef\tONLINE_JUDGE\n\tfreopen(\"4912e_min.in\",\"rb\",stdin);\n\tfreopen(\"4912e_.out\",\"wb\",stdout);\n#endif\n\trun();\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "bed250cc5004eadfd7f3cc387324e088", "src_uid": "7f4e533f49b73cc2b96b4c56847295f2", "apr_id": "4bf423e591fd0395dc4ce4dc25e0f89e", "difficulty": 1800, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.987485779294653, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#define _USE_MATH_DEFINES\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nint i,d[25],f[25],l;\nlong long a[25],ans;\nchar s[25];\n\nvoid dfs(int x)\n{\n\tint i,sum;\n\tlong long res;\n\t\n\tif (x>=10)\n\t{\n\t\tfor (i=0,sum=0;i<=9;i++) sum+=d[i];\n\t\tres=(long long) a[sum-1]*(sum-d[0]);\n\t\tfor (i=0;i<=9;i++) \n\t\tif (d[i]) res/=d[i];\n\t\tans+=res;\n\t\treturn;\n\t}\n\tif (!f[x]) dfs(x+1);\n\telse\n\t{\n\t\tfor (i=1;i<=f[x];i++) \n\t\t{\n\t\t\td[x]=i;\n\t\t\tdfs(x+1);\n\t\t}\n\t}\n}\n\nint main()\n{\n\tmemset(f,0,sizeof(f));\n\tmemset(d,0,sizeof(d));\n\tscanf(\"%s\",s);\n\tl=strlen(s);\n\tfor (i=ans=0;i\nint main(){\nint n;\nscanf(\"%d\",&n);\nint s[n],i,l=0;\nfor(i=0;is[i+1])break;\n else{l=1;}\n }\n while(is[i+1]) i++;\n else{l=1;}\n\n }\n\n}\nif(l==0)printf(\"YES\");\nelse printf(\"NO\");\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "dfd63a0e250257d4afa3cb55356103ad", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "7d48a5636362f04275bc8467e20011e2", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9468267581475128, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint child(int *b, int *c, int i, int n){\n return i - b[i] + c[i] + n - 1; \n}\n\nvoid fill(double *a, int *b, int *c, int i, double v){\n if(a[i] + v > 1) {\n a[i] = 1;\n fill(a, b, c, child(b, c, i, 1), (v + a[i] - 1)/2);\n fill(a, b, c, child(b, c, i, 2), (v + a[i] - 1)/2);\n }\n else a[i] = a[i] + v;\n}\n\nint main(){\n int n, g, i, *b, k, *c,count = 0;\n double *a;\n \n scanf(\"%d%d\",&n, &g);\n\n a = (double *)calloc((n*(n+1))/2,sizeof(double));\n b = (int *)calloc((n*(n+1))/2,sizeof(int));\n c = (int *)calloc((n*(n+1))/2,sizeof(int));\n \n k = 1; \n for(i = 0; i < (n*(n+1))/2; i++){\n a[i] = 0;\n if(i > (k*(k+1))/2 - 1) {\n k = k + 1;\n b[i] = ((k-1)*k)/2 - 1;\n c[i] = (k*(k+1))/2 - 1;\n } \n else {\n b[i] = ((k-1)*k)/2 - 1;\n c[i] = (k*(k+1))/2 - 1; \n }\n }\n \n for(i = 0; i < g; i++){\n fill(a, b, c, 0, 1.00);\n }\n\n for(i = 0; i < (n*(n+1))/2; i++) {\n if(a[i] == 1) count++;\n }\n\n printf(\"%d\\n\",count);\n}\n", "lang": "GNU C", "bug_code_uid": "09cbb9c4f5cb691ddfe9fc179ea914d9", "src_uid": "b2b49b7f6e3279d435766085958fb69d", "apr_id": "0140857eb1fbf1e4769a4c890052122b", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9775784753363229, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nvoid cuprec(float arr[],int num,float amount,int height)\n{\n\tif(arr[num]+amount<=1)\n\t{\n\t\tarr[num]=arr[num]+amount;\n\t}\n\telse\n\t{\n\t\tcuprec(arr,num+height+1,(amount-(1-arr[num]))/2,height+1);\n\t\tcuprec(arr,num+height,(amount-(1-arr[num]))/2,height+1);\n\t}\n}\nint main()\n{\n\tfloat arr[56];\n\tint n,t,i,k,ncup,ans=0;\n\tscanf(\"%d%d\",&n,&t);\n\tncup=(n*(n+1))/2;\n\tfor(i=0;i<56;i++)\n\t{\n\t\tarr[i]=0.000;\n\t}\n\tfor(i=1;i<=t;i++)\n\t{\n\t\tcuprec(arr,1,1.00,1);\n\t}\n\tfor(i=1;i<=ncup;i++)\n\t{\n\t\tif(arr[i]==1.00)\n\t\t\tans++;\n\t}\n\tprintf(\"%d\\n\",ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a6320da06e99539f23b7526ef83024d7", "src_uid": "b2b49b7f6e3279d435766085958fb69d", "apr_id": "18382829b76669c1a4fd57ea6a469f27", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3883984867591425, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "#include\nvoid main()\n{\n int x,y,i;\n i=1;\n while(1)\n {\n if(x>=i)\n {\n x=x-i;\n i++;\n }\n else\n {\n printf(\"Vladik\");\n break;\n }\n if(y>=i)\n {\n y=y-i;\n i++;\n }\n else\n {\n printf(\"Valera\");\n break;\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "bda915765a28153c0a462f36edc3978c", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "cc8a921e322d0600c9ac0f5765195d84", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9379932356257046, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n#define ll long long int\nll power(int x, int y)\n{\n if( y == 0)\n return 1;\n else if (y%2 == 0)\n return power(x, y/2)*power(x, y/2);\n else\n return x*power(x, y/2)*power(x, y/2);\n}\n\n/* Program to test function power */\n\nint main()\n{\n ll n,ans;\n scanf(\"%lld\\n\",n);\n if(n%4==0)\n ans = n/4 - 1;\n else\n ans = n/4;\n \n printf(\"%lld\\n\",ans);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "d9e747f83828b9c1f14ed19f17f7ad83", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "e19cfe2bb07dba2775307af6f6b6325b", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5676126878130217, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nint main(void) {\n // your code goes here\n float r,h;\n int n;\n scanf(\"%f %f\",&r,&h);\n if((h-r/2)%r==0&&r!=1&&h>=r){\n h=h/r;\n n=2+2*h;\n }\n else{\n n=1+2*h/r;\n }\n printf(\"%d\",n);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "23250de9dbdc488b672fe01ceab50c97", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "4dcf3f1e673a30fa2160b54aa0b8cf93", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9980638915779284, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nvoid Swap(char a[6])\n{\n\tchar b;\n\tfor (int i = 0; i < 3; i++)\n\t{\n\t\tb = a[i];\n\t\ta[i] = a[5 - i];\n\t\ta[5 - i] = b;\n\t}\n}\n\nint main()\n{\n\tchar number[6], ch, l = 0, r = 0, ans = 0, min, max, imin, imax;\n\tint i;\n\n\tfor (i = 0; i < 3; i++)\n\t{\n\t\tch = getchar();\n\t\tnumber[i] = ch - '0';\n\t\tl += number[i];\n\t}\n\tfor (i = 3; i < 6; i++)\n\t{\n\t\tch = getchar();\n\t\tnumber[i] = ch - '0';\n\t\tr += number[i];\n\t}\n\tif (l < r)\n\t{\n\t\tSwap(number);\n\t\tch = l;\n\t\tl = r;\n\t\tr = ch;\n\t}\n\twhile (l != r)\n\t{\n\t\tmin = 10;\n\t\tmax = -1;\n\t\tfor (i = 0; i < 3; i++)\n\t\t{\n\t\t\tif (max < number[i])\n\t\t\t{\n\t\t\t\tmax = number[i];\n\t\t\t\timax = i;\n\t\t\t}\n\t\t\tif (min > number[5 - i])\n\t\t\t{\n\t\t\t\tmin = number[5 - i];\n\t\t\t\timin = i;\n\t\t\t}\n\t\t}\n\t\tif (max > 9 - min)\n\t\t{\n\t\t\tch = number[imax];\n\t\t\tnumber[imax] -= l - r;\n\t\t\tif (number[imax] < 0)\n\t\t\t\tnumber[imax] = 0;\n\t\t\tl += number[imax] - ch;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tch = number[imin];\n\t\t\tnumber[imin] += l - r;\n\t\t\tif (number[imin] > 9)\n\t\t\t\tnumber[imin] = 9;\n\t\t\tr += number[imin] - ch;\n\t\t}\n\t\tans++;\n\t}\n\tprintf(\"%hhi\\n\", ans);\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "677e6a36d2a19d851d6647a6d88cc860", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "dc7179e8bdf551c905f5709c00cdbb68", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9976798143851509, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\n#include \n\nint main()\n{\n int p;\n scanf(\"%d\", &p);\n int n = p - 1;\n int count = n;\n for (int i = 2; i * i <= n; ++i)\n {\n if (n % i == 0)\n {\n do\n {\n n /= i;\n } while (n % i == 0);\n count = count / i * (i - 1);\n }\n }\n if (n != 1)\n {\n count = count / n * (n - 1);\n }\n printf(\"%d\\n\", count);\n return 0;", "lang": "GNU C11", "bug_code_uid": "6cf7141c5e03bf340f0b18d883cd208f", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "775141b80844de66a62bcd08ebe8dd03", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.228310502283105, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n long long int i,j,k,n,m,count=0,x,y,z;\n //int a1[1000],a2[1000];\n scanf(\"%I64d%I64d\",&n,&m);\n for(i=1;i<=n;i++)\n {\n for(j=1;j<=m;j++)\n {\n\n\n //scanf(\"%d\",a1[i]);\n x=i;\n y=j;\n z=(x+y)%5;\n if(z==0)\n {\n count++;\n }\n }\n\n //printf(\"%d\",a1[i]);\n\n }\n /*for(j=1;j<=m;j++)\n {\n //scanf(\"%d\",a2[j]);\n a2[j]=j;\n //printf(\"%d\",a2[j]);\n }\n for(i=1;i<=n;i++)\n {\n for(j=1;j<=m;j++)\n {\n if((a1[i]+a2[j])%5==0)\n\n count++;\n }\n }*/\n printf(\"%I64d\",count);\n\n}\n\n", "lang": "GNU C11", "bug_code_uid": "bd986dcf8c7a6bb0232abc7d77d53d59", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "36240e057e429f98f6a7cdffb05990d4", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9828926905132193, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n,i,j;\n scanf(\"%d\",&n);\n int ar[n][n];\n for(i=1;i<=n;i++)\n for(j=1;j<=n;j++)\n {\n if(i==1||j==1)\n {\n ar[i][j]=1;\n }\n else\n {\n ar[i][j]= ar[i-1][j]+ar[i][j-1];\n }\n }\n printf(\"%d\",ar[n][n]);\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9e3231646a2fca2a66d3c320ea0d5174", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "d2dea19a809f8dd8a04aadac22732704", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9855849815621858, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#define INF (unsigned long long)1000000000000000001\nint q, n, flen, slen, e;\nunsigned long long k, f[100001];\nchar s1[200] = \"What are you doing at the end of the world? Are you busy? Will you save us?\";\nchar s2[200] = \"What are you doing while sending xx? Are you busy? Will you send xx?\";\nchar s3[200] = \"What are you doing while sending x\";\nchar s4[200] = \"x? Are you busy? Will you send x\";\nchar s5[200] = \"x?\";\nvoid find(int d, long long jump){\n\tif (d == 0){\n\t\tprintf(\"%c\", s1[jump]);\n\t\te = 1;\n\t\treturn;\n\t}\n\tif (flen >= jump){\n\t\tif (s3[jump] == 'x')printf(\"\\\"\");\n\t\telse printf(\"%c\", s3[jump]);\n\t\te = 1;\n\t}\n\telse if (flen + f[d - 1] >= jump){\n\t\tfind(d - 1, jump - flen);\n\n\t}\n\telse if (flen + f[d - 1] + slen >= jump){\n\t\tjump -= (flen + f[d - 1]);\n\t\tif (s4[jump] == 'x')printf(\"\\\"\");\n\t\telse printf(\"%c\", s4[jump]);\n\t\te = 1;\n\t}\n\telse if (flen + f[d - 1] + slen + f[d - 1] >= jump){\n\t\tfind(d - 1, jump - flen - f[d - 1] - slen);\n\t}\n\telse{\n\t\tjump -= (flen + f[d - 1] + slen + f[d - 1]);\n\t\tif (s5[jump] == 'x')printf(\"\\\"\");\n\t\telse printf(\"%c\", s5[jump]);\n\t\te = 1;\n\t}\n\tif (e)return;\n}\n\n\nint main()\n{\n\tscanf(\"%d\", &q);\n\tint len = strlen(s1);\n\tint len2 = strlen(s2);\n\tflen = strlen(s3);\n\tslen = strlen(s4);\n\tf[0] = len;\n\tfor (int i = 1; i <= 100000; i++){\n\t\tif (f[i - 1] == INF)f[i] = INF;\n\t\tf[i] = f[i - 1] * 2 + len2;\n\t\tif (f[i] >= INF)f[i] = INF;\n\t}\n\twhile (q--){\n\t\tscanf(\"%d%lld\", &n, &k);\n\t\tk--;\n\t\te = 0;\n\n\t\tfind(n, k);\n\t}\n\tprintf(\"\\n\");\n}", "lang": "GNU C", "bug_code_uid": "05cc1df29bc3cdfc9f7a1f15314d87c6", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "8395574c16d8fb531b02f73f9c2aea79", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9970845481049563, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "include\n\nint main()\n{\n int n,a;\n scanf(\"%d\",&n);\n if(n%2==0)\n {\n a=(n-2)/2;\n }\n else\n {\n a=(n-1)/2;\n }\n printf(\"%d\",a);\n}", "lang": "GNU C11", "bug_code_uid": "260a31af14b90c8006f1e1b4107408ce", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "12ca075e72de86e2cb7cef91e179319d", "difficulty": 1000, "tags": ["constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9706916764361079, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main(){\n\tint n,i,j,k,c=1,b=0,asal[3000],counter=0,result=0;\n\tscanf(\"%d\",&n);\n\tasal[0]=2;\n\tfor(i=3;i<=3000;i+=2){\n\t\tk=0;\n\t\tfor(j=1;j\n\nint main(int argc, const char * argv[]) {\n unsigned int price, m, sum;\n scanf(\"%u %u\", &price, &m);\n if(price<10){\n if(!(m%price))\n return printf(\"%u\", m/price);\n goto hui;\n }\nhui:\n \n for(unsigned int i = 1; i<10; i++){\n if(((price*i)%10 == 0) || ((price*i-m)%10 == 0))\n return printf(\"%u\", i) & 0;\n }\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d6e34e55a174b6e76f8c5a12b6422a29", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "cda6c8881e4a574b625ccc680dd85147", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.40368271954674223, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \nint sumx(int x)\n{\n\tint r,i;\n\tr=0;\n\twhile(x>0){\n\t\tr+=x%10;\n\t\tx=x/10;\n\t}\n\treturn r;\n}\n\nint square(int sx, int a)\n{\n\tint r,i;\n\tr=1;\n\tfor(i=0;i\nint gcd(long long int a,long long int b);\nint main()\n{\n long long int a,b,x,y,w,h,i=0;\n scanf(\"%lli%lli%lli%lli\",&a,&b,&x,&y);\n w=x/gcd(x,y);\n h=y/gcd(x,y);\n\n\n\n for(i=1;w*i<=a&&h*i<=b;i++);\n\n\n\nprintf(\"%lli\",i-1);\n}\nint gcd(long long int a, long long int b)\n{\n long long int t;\n if(a>b)\n {\n a=a+b;\n b=a-b;\n a=a-b;\n }\n while(b%a!=0)\n {\n t=a;\n a=b%a;\n b=t;\n }\n return a;\n}\n", "lang": "GNU C11", "bug_code_uid": "7c7ac10a8e03e20ec0c2a49d10697337", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "apr_id": "60651b880b90796a5e77a363775e49a8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.27114093959731544, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint main(void)\n{\n int n,d,*arr,i,time,sum=0;\n scanf(\"%d %d\",&n,&d);\n for(i=0;id) printf(\"-1\");\n else if(time<=d)\n {\n if((time+5)<=d) printf(\"%d\",(((n-1)*10)/5+1));\n else printf(\"%d\",((n-1)*10)/5);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "47c694011955856fb95a62dfe268e055", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "c677a7fe2f6bcf723e50d0224261545c", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.963302752293578, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n;\n while(scanf(\"%d\",&n))\n printf(\"%d\\n\",n%2?1:2);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9b8900701d2d585b355cd695de3b5868", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "apr_id": "d691c302c2a3f5efe5254b39ff1d3809", "difficulty": 1200, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9742647058823529, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main()\n{\n\tint n,m,s,i;\n\tscanf(\"%d\",&n);\n\tscanf(\"%d\",&m);\n\ts=1;\n\tfor (i=1; ;i++){\n\t\ts=s*n;\n\t\tif (s==m){\n\t\t\tprintf(\"YES\\n\");\n\t\t\tprintf(\"%d\",i-1);\n\t\t\tbreak;\n\t\t}\n\t\telse if (s>m){\n\t\t\tprintf(\"NO\");\n\t\t\tbreak;\n\t\t}\n\t}\n\t//printf(\"%d\",s);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e86e54d2b4afc667f770a8f197d4f263", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "37bb3c6f84271792ddc722b913dd3f63", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.95504158004158, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nstruct Team {\n char name[25];\n int point;\n int score;\n int miss;\n}team[4], tmp_team[4];\n\nvoid swap(int *lhs, int *rhs) {\n int tmp = *lhs;\n *lhs = *rhs;\n *rhs = tmp;\n}\n\nvoid cpy_team() {\n int i;\n for (i = 0; i < 4; ++i) {\n tmp_team[i].point = team[i].point;\n tmp_team[i].score = team[i].score;\n tmp_team[i].miss = team[i].miss;\n strcpy(tmp_team[i].name, team[i].name);\n }\n}\n\nchar hash_s[4][25];\nint hash_idx = 0;\nint hash(const char* str) {\n int i;\n for (i = 0; i < hash_idx; ++i) {\n if (!strcmp(str, hash_s[i])) {\n return i;\n }\n }\n strcpy(hash_s[hash_idx++], str);\n return hash_idx - 1;\n}\n\nint comp(const void *lhs, const void *rhs) {\n struct Team *sa = (struct Team *)lhs;\n struct Team *sb = (struct Team *)rhs;\n if (sa->point != sb->point) {\n return sa->point < sb->point;\n }\n if (sa->score - sa->miss != sb->score - sb->miss) {\n return sa->score - sa->miss < sb->score - sb->miss;\n }\n if (sa->score != sb->score) {\n return sa->score < sb->score;\n }\n return strcmp(sa->name, sb->name) > 0;\n}\n\nint main() {\n //freopen(\"in.txt\", \"r\", stdin);\n int i, j, ia, ib, na, nb, b_id, opp_id, cnt[4];\n char sa[25], sb[25];\n\n memset(cnt, 0, sizeof(cnt));\n for (i = 0; i < 5; ++i) {\n scanf(\"%s %s %d:%d\", sa, sb, &na, &nb);\n ia = hash(sa);\n ib = hash(sb);\n strcpy(team[ia].name, sa);\n strcpy(team[ib].name, sb);\n ++cnt[ia];\n ++cnt[ib];\n /*printf(\"%d %d %d %d\\n\", na, nb, ia, ib);*/\n if (nb > na) {\n swap(&na, &nb);\n swap(&ia, &ib);\n }\n /*printf(\"%d %d\\n\", na, nb);*/\n if (na > nb) {\n team[ia].point += 3;\n } else if (na == nb) {\n team[ia].point += 1;\n team[ib].point += 1;\n }\n team[ia].score += na;\n team[ia].miss += nb;\n team[ib].score += nb;\n team[ib].miss += na;\n }\n /*for (i = 0; i < 4; ++i) {*/\n /*printf(\"%d %d %d\\n\", team[i].point, team[i].score, team[i].miss);*/\n /*}*/\n /*return 0;*/\n for (i = 0; i < 4; ++i) {\n if (!strcmp(team[i].name, \"BERLAND\")) {\n b_id = i;\n } else if (cnt[i] != 3) {\n opp_id = i;\n }\n }\n\n cpy_team();\n qsort(tmp_team, 4, sizeof(struct Team), comp);\n /*for (i = 0; i < 4; ++i) {*/\n /*printf(\"%s\\n\", tmp_team[i].name);*/\n /*}*/\n /*printf(\"opp_id = %d, b_id = %d\\n\", opp_id, b_id);*/\n /*for (i = 0; i < hash_idx; ++i) {*/\n /*printf(\"%s\\n\", hash_s[i]);*/\n /*}*/\n for (i = 1; i < 100; ++i) {\n cpy_team();\n tmp_team[b_id].point += 3;\n tmp_team[b_id].score += i;\n tmp_team[opp_id].miss += i;\n /*for (j = 0; j < 4; ++j) {*/\n /*printf(\"%d %d %d\\n\", tmp_team[j].point, tmp_team[j].score, tmp_team[j].miss);*/\n /*}*/\n /*putchar('\\n');*/\n qsort(tmp_team, 4, sizeof(struct Team), comp);\n if (!strcmp(tmp_team[0].name, \"BERLAND\") || !strcmp(tmp_team[1].name, \"BERLAND\")) {\n for (j = i - 1; j >= 0; --j) {\n cpy_team();\n tmp_team[b_id].point += 3;\n tmp_team[b_id].score += i;\n tmp_team[opp_id].miss += i;\n\n tmp_team[b_id].miss += j;\n tmp_team[opp_id].score += j;\n qsort(tmp_team, 4, sizeof(struct Team), comp);\n if (!strcmp(tmp_team[0].name, \"BERLAND\") || !strcmp(tmp_team[1].name, \"BERLAND\")) {\n printf(\"%d:%d\\n\", i, j);\n return 0;\n }\n }\n }\n }\n puts(\"IMPOSSIBLE\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c1f3afb0751840ea76d7b23937f9fdf4", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "ba1185354db4d5672fce136cd3555e40", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9967732472865943, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nstruct Team {\n char name[25];\n int point;\n int score;\n int miss;\n}team[4], tmp_team[4];\n\nvoid swap(int *lhs, int *rhs) {\n int tmp = *lhs;\n *lhs = *rhs;\n *rhs = tmp;\n}\n\nvoid cpy_team() {\n int i;\n for (i = 0; i < 4; ++i) {\n tmp_team[i].point = team[i].point;\n tmp_team[i].score = team[i].score;\n tmp_team[i].miss = team[i].miss;\n strcpy(tmp_team[i].name, team[i].name);\n }\n}\n\nchar hash_s[4][25];\nint hash_idx = 0;\nint hash(const char* str) {\n int i;\n for (i = 0; i < hash_idx; ++i) {\n if (!strcmp(str, hash_s[i])) {\n return i;\n }\n }\n strcpy(hash_s[hash_idx++], str);\n return hash_idx - 1;\n}\n\nint comp(const void *lhs, const void *rhs) {\n struct Team *sa = (struct Team *)lhs;\n struct Team *sb = (struct Team *)rhs;\n if (sa->point != sb->point) {\n return sa->point < sb->point;\n }\n if (sa->score - sa->miss != sb->score - sb->miss) {\n return sa->score - sa->miss < sb->score - sb->miss;\n }\n if (sa->score != sb->score) {\n return sa->score < sb->score;\n }\n return strcmp(sa->name, sb->name) > 0;\n}\n\nint main() {\n //freopen(\"in.txt\", \"r\", stdin);\n int i, j, ia, ib, na, nb, b_id, opp_id, x, y, min = 10000, cnt[4];\n char sa[25], sb[25];\n\n memset(cnt, 0, sizeof(cnt));\n for (i = 0; i < 5; ++i) {\n scanf(\"%s %s %d:%d\", sa, sb, &na, &nb);\n ia = hash(sa);\n ib = hash(sb);\n strcpy(team[ia].name, sa);\n strcpy(team[ib].name, sb);\n ++cnt[ia];\n ++cnt[ib];\n /*printf(\"%d %d %d %d\\n\", na, nb, ia, ib);*/\n if (nb > na) {\n swap(&na, &nb);\n swap(&ia, &ib);\n }\n /*printf(\"%d %d\\n\", na, nb);*/\n if (na > nb) {\n team[ia].point += 3;\n } else if (na == nb) {\n team[ia].point += 1;\n team[ib].point += 1;\n }\n team[ia].score += na;\n team[ia].miss += nb;\n team[ib].score += nb;\n team[ib].miss += na;\n }\n /*for (i = 0; i < 4; ++i) {*/\n /*printf(\"%d %d %d\\n\", team[i].point, team[i].score, team[i].miss);*/\n /*}*/\n /*return 0;*/\n for (i = 0; i < 4; ++i) {\n if (!strcmp(team[i].name, \"BERLAND\")) {\n b_id = i;\n } else if (cnt[i] != 3) {\n opp_id = i;\n }\n }\n\n cpy_team();\n qsort(tmp_team, 4, sizeof(struct Team), comp);\n /*for (i = 0; i < 4; ++i) {*/\n /*printf(\"%s\\n\", tmp_team[i].name);*/\n /*}*/\n /*printf(\"opp_id = %d, b_id = %d\\n\", opp_id, b_id);*/\n /*for (i = 0; i < hash_idx; ++i) {*/\n /*printf(\"%s\\n\", hash_s[i]);*/\n /*}*/\n for (i = 1; i < 100; ++i) {\n for (j = i - 1; j >= 0; --j) {\n cpy_team();\n tmp_team[b_id].point += 3;\n tmp_team[b_id].score += i;\n tmp_team[opp_id].miss += i;\n\n tmp_team[b_id].miss += j;\n tmp_team[opp_id].score += j;\n qsort(tmp_team, 4, sizeof(struct Team), comp);\n if (!strcmp(tmp_team[0].name, \"BERLAND\") || !strcmp(tmp_team[1].name, \"BERLAND\")) {\n if (i - j < min) {\n min = i - j;\n x = i;\n y = j;\n }\n }\n }\n if (min != 10000) {\n printf(\"%d:%d\\n\", x, y);\n } else {\n puts(\"IMPOSSIBLE\");\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e24d2939c855e8b50b0b3b8890aef15e", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "ba1185354db4d5672fce136cd3555e40", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.023518850987432675, "equal_cnt": 22, "replace_cnt": 19, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 22, "bug_source_code": "#include\n#include\n#include\n\n\ntypedef struct{\n\tint jour;\n\tint mois;\n\tint annee;\n}date;\n \ntypedef struct{\n\tchar nomComplet[80];\n\tdate dNaissance;\n\tchar pDorigin[20];\n}STR_P; \n\ntypedef struct{\n\tSTR_P infos;\n\tdate dEmbauche;\n\tint nbEnfant;\n\tSTR_P infoConjoint;\n\tSTR_P listEnfant[5];\n}commercial;\n\ntypedef struct{\n \tSTR_P infos;\n\tdate dEmbauche;\n\tint nbEnfant;\n\tSTR_P infoConjoint;\n\tSTR_P listEnfant[5];\n}client;\n\n\ntypedef struct{\n\tchar rs[30];\n\tdate dOuvert;\n\tchar adresse[30];\n\tint nbCom;\n\tcommercial listCom[5];\n\tint nbClient;\n\tcommercial listClient[5];\n}agence;\n\ntypedef struct{\n\tchar rs[30];\n\tchar rc[30];\n\tint patente;\n\tdate anCreation;\n\tchar tAcitvite[30];\n\tint chifDafaire;\n\tint nbAgence;\n\tagence listAgence[5];\n}assurance;\n\ntypedef struct{\n\tassurance assur[5];\n\tint nbAssurance;\n}grAssurance;\n\n\n//QUestion 3 :\nSTR_P creationInfos(){\n\tSTR_P info;\n\tprintf(\"Entrez le nom complet : \");\n\tscanf(\"%s\",info.nomComplet);\n\tprintf(\"Entrez la date de naissance\\n\");\n\tprintf(\"jour : \");\n\tscanf(\"%d\",&info.dNaissance.jour);\n\tprintf(\"le mois : \");\n\tscanf(\"%d\",&info.dNaissance.annee);\n\tprintf(\"Annee : \");\n\tscanf(\"%d\",&info.dNaissance.annee);\n\tprintf(\"Entrez le pays d'origine : \");\n\tscanf(\"%s\",info.pDorigin);\n\t\n\treturn info;\n}\n\ncommercial creationCl_CM(){\n\tcommercial com;\n\tint i;\n\t\n\tprintf(\"Creation un(e) client(e) ou un(e) commercial(e)\\n\");\n\tcom.infos=creationInfos();\n\tprintf(\"Entrez la date d'embauche\\n\");\n\tprintf(\"jour : \");\n\tscanf(\"%d\",&com.dEmbauche.jour);\n\tprintf(\"le mois : \");\n\tscanf(\"%d\",&com.dEmbauche.mois);\n\tprintf(\"Annee : \");\n\tscanf(\"%d\",&com.dEmbauche.annee);\n\tprintf(\"Entrez le nombre d'enfant : \");\n\tscanf(\"%d\",&com.nbEnfant);\n\tprintf(\"Enrez les donnees du conjoint(e)\\n\");\n\tcom.infoConjoint=creationInfos();\n\t\tprintf(\"Entrez les donnees des enfants\\n\");\n\tfor(i=0 ; i-\\n\",i+1);\n\t\tcom.listEnfant[i]=creationInfos();\n\t}\n\treturn com;\n}\n\nagence creaCmAgence(){\n\tagence agen;\n\tint i;\n\t\n\tprintf(\"Entrez la raison sociale : \");\n\tscanf(\"%s\",agen.rs);\n\tprintf(\"Entrez la date d'ouverture\\n\");\n\tprintf(\"jour : \");\n\tscanf(\"%d\",&agen.dOuvert.jour);\n\tprintf(\"le mois : \");\n\tscanf(\"%d\",&agen.dOuvert.mois);\n\tprintf(\"Annee : \");\n\tscanf(\"%d\",&agen.dOuvert.annee);\n\tprintf(\"Entrez l'adresse : \");\n\tscanf(\"%s\",agen.adresse);\n\tprintf(\"Entrez le nombre des comerciaux : \");\n\tscanf(\"%d\",&agen.nbCom);\n\tprintf(\"Entrez les donnees des comerciaux\\n\");\n\tfor(i=0 ; inbAssurance>0){\n\t\tm=gr->nbAssurance;\n\t}\n\t\n\tgr->nbAssurance+=nb;\n\tfor(i=m ; inbAssurance ; i++){\n\t\tgr->assur[i]=crAssurances();\n\t}\t\n}\n\n//Question 4 : recherche l'agence par sa raison sociale\nint chercher(grAssurance gr,char rs[]){\n\tint i;\n\tfor(i=0 ; iassur[indice].nbAgence=nbAgence;\n\t\tfor(i=0 ; iassur[indice].nbAgence ; i++){\n\t\t\tgr->assur[indice].listAgence[i]=creaCmAgence();\n\t\t}\n\t}else\n\t\tprintf(\"L'agence n'existe pas\\n\");\n}\n\n\nvoid affichage_Ag(agence ag){\n\tint i,j;\n\t\n\tprintf(\"La raison sociale d'agence : %s\\n\",ag.rs);\n\tprintf(\"La date d'overture : %d/%d/%d\\n\",ag.dOuvert.jour,ag.dOuvert.mois,ag.dOuvert.annee);\n\tprintf(\"L'adresse : %s\\n\",ag.adresse);\n\tfor(i=0 ; i-\\n\");\n\t\t\tprintf(\"Le nom complet : %s\\n\",ag.listCom[i].listEnfant[j].nomComplet);\n\t\t\tprintf(\"Date de naissance : %d/%d/%d\\n\",ag.listCom[i].listEnfant[j].dNaissance.jour,ag.listCom[i].listEnfant[j].dNaissance.mois,ag.listCom[i].listEnfant[j].dNaissance.annee);\n\t\t\tprintf(\"Le pays d'origin : %s\\n\",ag.listCom[i].listEnfant[j].pDorigin);\n\t\t}\n\t}\n\tfor(i=0 ; i-\\n\");\n\t\t\tprintf(\"Le nom complet : %s\\n\",ag.listClient[i].listEnfant[j].nomComplet);\n\t\t\tprintf(\"Date de naissance : %d/%d/%d\\n\",ag.listClient[i].listEnfant[j].dNaissance.jour,ag.listClient[i].listEnfant[j].dNaissance.mois,ag.listClient[i].listEnfant[j].dNaissance.annee);\n\t\t\tprintf(\"Le pays d'origin : %s\\n\",ag.listClient[i].listEnfant[j].pDorigin);\n\t\t}\n\t}\n}\n\nvoid affichage_Agence(assurance a){\n\tint i;\n\t\n\tprintf(\"la raison sociale : %s\\n\",a.rs);\n\tprintf(\"Le registre commerical : %s\\n\",a.rc);\n\tprintf(\"La patente%d\\nannee de creation : %d/%d/%d\\n\",a.patente,a.anCreation.jour,a.anCreation.mois,a.anCreation.annee);\n\tprintf(\"Type d'activite : %q\\n\",a.tAcitvite);\n\tprintf(\"Le nombre d'agence : %d\\n\",a.nbAgence);\n\tprintf(\"Les donnees sur les agences\\n\");\n\tfor(i=0 ; i3){\n\t\t\t\tagence ag=as.listAgence[i];\n\t\t\t\taffichage_Ag(ag);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}\n\n//Question 7 : supprision\nvoid supp(grAssurance *gr,char rs[]){\n\tint indice,i;\n\tindice=chercher(*gr,rs);\n\tif(indice!=-1){\n\t\tfor(i=indice ; inbAssurance-1 ; i++){\n\t\t\tgr->assur[i]=gr->assur[i+1];\n\t\t}\n\t\tgr->nbAssurance--;\n\t}else\n\t\tprintf(\"La compagnie d'assurance n'existe pas\\n\");\n}\n\n\t\nint main(){\n\tgrAssurance groupAssur;\n\tint nb,choix,nbAgence;\n\tchar rs[30];\n\tgroupAssur.nbAssurance=0;\t\n\t\n/*\tprintf(\"Entrez le nombre des compangies d'assurance: \");\n\tscanf(\"%d\",&nb);\n\tgroup_Assurance(&groupAssur,nb);\n\tsystem(\"cls\");*/\n\t\n\tdo{ printf(\"---------------------------------------------------------------------------------------------\\n\");\n\t\tprintf(\"1-Pour ajouter des compagnies d'assurances dans le groupement d'assurance\\n\");\n\t\tprintf(\"2-Pour modifier la liste des agences d'une compagnie\\n\");\n\t\tprintf(\"3-Pour afficher les agences d'une compagnie d'assurance dont les commerciaux ayant plus que 3 enfants et les client ayant moins que 2 enfants\\n\");\n\t\tprintf(\"4-Pour afficher les compagnies d'assurances exer\ufffdant une activite\\n\");\n\t\tprintf(\"5 Pour supprimer une compagnie d'assurance\\n\");\n\t\tprintf(\"6-Quitter\\n\");\n\t\tprintf(\"---------------------------------------------------------------------------------------------\\n\");\n\t\tprintf(\"\\t Entrez votre choix : \");\n\t\tscanf(\"%d\",&choix);\n\t\t\n\t\tswitch(choix){\n\t\t\tcase 1 : printf(\"Entrez le nombre des compangies d'assurance: \");\n\t\t\t\t\t scanf(\"%d\",&nb);\n\t\t\t\t \t group_Assurance(&groupAssur,nb);\n\t\t\t\t\t break;\n\t\t\t\n\t\t\tcase 2 :printf(\"Entrez la raison sociale : \");\n\t\t\t\t\tscanf(\"%s\",rs); \t\n\t\t\t\t\tprintf(\"Entrez le nombre d'agence : \");\n\t\t\t\t\tscanf(\"%d\",&nbAgence);\n\t\t\t\t\tmodifierAgence(&groupAssur,rs,nbAgence);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 3 : afficheAssurance(groupAssur.assur[0]);\n\t\t\t\t\t break;\n\t\t\t\t\t \n\t\t\tcase 4 : printf(\"Entrez l'activite : \");\n\t\t\t\t\t scanf(\"%s\",rs);\n\t\t\t\t\t chercheComp(groupAssur,rs);\n\t\t\t\t\t break;\n\t\t\t\t\t \n\t\t\tcase 5 : printf(\"Entrez la raison sociale : \");\n\t\t\t\t scanf(\"%s\",rs);\n\t\t\t\t\t supp(&groupAssur,rs);\n\t\t\t\t\t break;\n\t\t\t\n\t\t\tcase 6 : return 0;\t\t \t\t \t\t\n\t\t}\n\t}while(choix>=1 || choix<=6);\n\t\n\t\n\t\n\t\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a86a547ffb08205f771947bd880b88d3", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "38de12bfbbe6cd1c5b23511bf5ac134a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9934640522875817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define N\t200000\n#define MD\t998244353\n\nlong long power(int a, int k) {\n\tlong long p;\n\n\tif (k == 0)\n\t\treturn 1;\n\tp = power(a, k >> 1);\n\tp = p * p % MD;\n\tif (k & 1)\n\t\tp = p * a % MD;\n\treturn p;\n}\n\nint ff[N + 1], gg[N + 1];\n\nvoid init() {\n\tint i, f;\n\n\tf = 1;\n\tfor (i = 0; i <= N; i++) {\n\t\tgg[i] = power(ff[i] = f, MD - 2);\n\t\tf = (long long) f * (i + 1) % MD;\n\t}\n}\n\nint ch(int n, int k) {\n\treturn (long long) ff[n] * gg[k] % MD * gg[n - k] % MD;\n}\n\nint main() {\n\tint n, c, ans;\n\tlong long k;\n\n\tinit();\n\tscanf(\"%d%lld\", &n, &k);\n\tans = 0;\n\tif (k == 0)\n\t\tans = ff[n];\n\telse {\n\t\tint x;\n\n\t\tx = 0;\n\t\tfor (c = n - k; c >= 0; c--)\n\t\t\tx = (x + ((n - k - c) % 2 == 0 ? 1 : -1) * (ch(n - k, c) * power(c, n))) % MD;\n\t\tans = (long long) ch(n, n - k) * x * 2 % MD;\n\t\tif (ans < 0)\n\t\t\tans += MD;\n\t}\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "650c4f10a7b30be8ee1addb900fd1f64", "src_uid": "6c1a9aaa7bdd7de97220b8c6d35740cc", "apr_id": "6801cb773bc249efff50475778409340", "difficulty": 2300, "tags": ["fft", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.17871222076215507, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \n\nlong long int potenciacao(int base, int expoente){\n int i = 1;\n long long int resposta = base;\n while (i < expoente){\n resposta = resposta*base;\n i++;\n }\n return resposta;\n\n}\n\nint main()\n{\n int n;\n unsigned long long int calculo, atual, mod, anterior, i;\n mod = 1000000007;\n scanf(\"%d\", &n);\n anterior = 0;\n atual = 0;\n i = 2;\n while (i <=n){\n // printf(\"***************************************************\\n\");\n calculo = (unsigned long long int)potenciacao(3,(i-1));\n calculo = (unsigned long long int) (calculo - anterior);\n //calculo = abs(calculo - anterior);\n\n atual = calculo;\n i++;\n anterior = atual;\n //printf(\"*************************************************************\\n\\n\");\n }\n printf(\"%I64d\\n\", (unsigned long long int)atual % mod);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "bf952ad77e7711da69382ab17bc47804", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "6cbf42aab6a2572f2da24c59692ad186", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8418907905460473, "equal_cnt": 41, "replace_cnt": 19, "delete_cnt": 0, "insert_cnt": 21, "fix_ops_cnt": 40, "bug_source_code": "#include\n#include\n\nmain()\n{\n char a[20];\n char b[20];\n gets(a);\n gets(b);\n if(a[0]==m)\n {\n if((b[0]==m)||(b[0]==w)||((b[0]==t)&&(b[1]==h)))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if ((a[0]==t) && (a[1]==u))\n {\n if((b[0]==t)|| (b[0]==f))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (a[0]==w)\n {\n if ((b[0]==w)||(b[0]==f)||((b[0]==s)&& (b[1]==a)))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if ((a[0]==t)&& (a[1]==h))\n {\n if (((b[0]==t)&& (b[1]==h))|| (b[0]==s))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (a[0]==f)\n {\n if((b[0]==f)|| (b[0]==m)|| ((b[0]==s)&& (b[1]==u)))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if ((a[0]==s)&& (a[1]==a))\n {\n if(((b[0]==s) && (b[1]==a))|| (b[0]==m)|| ((b[0]==t) && (b[1]==u)))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else\n {\n if ((b[0]==w) || ((b[0]==s) && b[1]==u) || ((b[0]==t) && (b[1]==u)))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n \n}", "lang": "GNU C", "bug_code_uid": "e8d0c681733967ca8191b0f0c696a754", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "873dade330417c8783075478f29cc527", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3388913925191528, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include \n\nmax (long int *pp,long int *pb){\n\tlong int t;\n\tif ((*pp)<(*pb)){\n\t\tt=*pp;\n\t\t*pp=*pb;\n\t\t*pb=t;\n\t\t\n\t}\n\t\n}\nint main (){\n\tlong int n,m,i,j,a,b,p,q;\n\tscanf(\"%ld %ld %ld %ld %ld %ld\",&n,&m,&i,&j,&a,&b);\n\tif (((n-i)%a==0) && ( (m-j)%b==0) )\n{\n\tp=(n-i)/a;\n\tq=(m-j)/b;\n\tmax(&p,&b);\n\t\n\tif ((p-q)%2==0){\n\t\tprintf(\"%ld\",p);\n\t\texit;\n\t\t}\n\t\telse {\n\t\t\tprintf(\"Poor Inna and pony!\\n\");\n\t\t\texit;\n\t\t}\n\t}\nelse if (((n-i)%a==0) && ( (j-1)%b==0 ))\n{\n\tp=(n-i)/a;\n\tq=(j-1)/b;\n\tmax(&p,&q);\n\tif ((p-q)%2==0){\n\t\tprintf(\"%ld\",p);\n\t\t\n\t}\n\telse \n\tprintf(\"Poor Inna and pony!\");\n}\t\n\nelse if (((i-1)%a==0) && ( (j-1)%b==0 ))\n{\n\tp=(i-1)/a;\n\tq=(j-1)/b;\n\tmax(&p,&q);\n\tif ((p-q)%2==0){\n\t\tprintf(\"%ld\",p);\n\t\t\n\t}\n\telse \n\tprintf(\"Poor Inna and pony!\");\n}\t\n\t\n\t\nelse if (((i-1)%a==0) && ( (m-j)%b==0 ))\n{\n\tp=(i-1)/a;\n\tq=(m-j)/b;\n\tmax(&p,&q);\n\tif ((p-q)%2==0){\n\t\tprintf(\"%ld\",p);\n\t\t\n\t}\n\telse \n\tprintf(\"Poor Inna and pony!\");\n}\t\n\t\n\telse \n\t{\t\n\tprintf(\"Poor Inna and pony!\\n\");\t\n\n}\nreturn 0;\n}\t\n\t\n\t\n", "lang": "GNU C", "bug_code_uid": "509a3d6b7781c17165171384590f4a19", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "b717d877517200e852bd81a8f3776624", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5344418052256532, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \nint main(void) {\n\tlong int n, days_added = 0, ans;\n\tscanf(\"%ld\", &n);\n\tans = n;\n\tint N_LEAP = n % 4;\n\tdo {\n\t\tif (ans % 4 != 0)\n\t\t\tdays_added += 365;\n\t\telse if (ans % 100 != 0)\n\t\t\tdays_added += 366;\n\t\telse if (ans % 400 != 0)\n\t\t\tdays_added += 356;\n\t\telse\n\t\t\tdays_added += 366;\n\t\tans++;\n\t} while (days_added % 7 != 0 || ( N_LEAP != 0 || (N_LEAP == 0 && ans%4 != 0)) );\n\tprintf(\"%ld\", ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2828e9be1c755a2617f4dc376659d7c1", "src_uid": "565bbd09f79eb7bfe2f2da46647af0f2", "apr_id": "de258e9f324ff8a66df78f4960517836", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9974204643164231, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "include\n\nint leapyear(int year){\n if((year%4==0&&year%100!=0)||year%400==0)\n return 1;\n else\n return 0;\n}\n\nint main(){\n int h1,q=1,m=13,y1,flag1,flag2;\n int h2,y2;\n scanf(\"%d\",&y1);\n h1=(q+((26*(m+1))/10)+y1+(y1/4)+(6*(y1/100))+(y1/400))%7;\n for(y2=y1; ;y2++){\n h2=(q+((26*(m+1))/10)+y2+(y2/4)+(6*(y2/100))+(y2/400))%7;\n if(h1==h2){\n flag1=leapyear(y1);\n flag2=leapyear(y2);\n if(flag1==flag2){\n printf(\"%d\",y2);\n return 0;\n }\n }\n }\n \n}", "lang": "GNU C", "bug_code_uid": "13b9424bdabefc035961bebaa2384bbd", "src_uid": "565bbd09f79eb7bfe2f2da46647af0f2", "apr_id": "367ab6cfe28ece3880100f30562a1880", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9232158988256549, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int i,j,n,a[64],v,mr;\n long long int b,m;\n scanf(\"%d %I64d\",&n,&m);\n i=0;j=n-1;\n b=1<<(j-1);\n m--;\n v=1;\n while(b>0)\n {\n if((b&m)==0)\n {\n a[i]=v;\n i++;\n mr=0;\n }\n else\n {\n a[j]=v;\n j--;\n mr=1;\n }\n v++;\n b>>=1;\n }\n if(mr==0)\n a[i]=v;\n else\n a[j]=v;\n for(i=0;i\nint main()\n\n{\nint prob, min,stime,count=0,a=0,i;\n scanf(\"%d %d\", &prob,&min);\n\n stime=240-min;\n\n\n\n for (i=1;i<=prob;i=i++)\n {\n a=5*i;\n stime=stime-a;\n\n if(stime>=0)\n {\n count++;\n\n }\n\n }\n\nprintf(\"%d\", count);\n\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "8dbe51fed3457203f5c0b811ac05d11d", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "eac4af96ec1844dc0b38eef1f18b65bd", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5914972273567468, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main(void)\n{\nint w,h,u1,u2,d1,d2;\nscanf(\"%d %d %d %d %d %d\",&w,&h,&u1,&d1,&u2,&d2);\nwhile(h>0)\n{\nw+=h;\nif(h==d1)\nw-=u1;\nif(h==d2)\nw-=u2;\n}\nprintf(\"%d\\n\",w);\n\nreturn 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "5476acc620dd84479c2244786713e8ec", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "813c45a498b0012bae04961098ca2ee7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9912280701754386, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include\nint main()\n{\n int v[10],a;char s[1],u[2];\n v[0]=2;\n v[1]=7;\n v[2]=2;\n v[3]=3;\n v[4]=3;\n v[5]=4;\n v[6]=2;\n v[7]=5;\n v[8]=1;\n v[9]=2;\n //s[1] = '\\0';\n scanf(\"%s\",u);\n s[0] = u[0];\n a = v[atoi(s)];\n s[0] =u[1];\n printf(\"%d\",a*v[atoi(s)]);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "84db3233d012fc6d39606af3b9e604b5", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "3189d4fb346648fe885dc47176d0fd69", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6809756097560976, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint main()\n{\n int n, i, j;\n int dp[100010];\n\n scanf(\"%d\", &n);\n\n for (i = 0; i <= n; i++) dp[i] = -1;\n\n for (i = 1; i <= (n + 1) / 2; i++) {\n\t int sum = i, f = 1;\n\n\t if (dp[i] > 0) f *= -1;\n\n\t for (j = i - 1; j > 0; j--) {\n\t sum += j;\n\n\t if (dp[j] > 0) f *= -1;\n\n\t if (sum > n) break;\n\n\t if (f == 1) dp[sum] = i - j + 1;\n\t }\n }\n\n printf(\"%d\\n\", dp[n]);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "338b9991f024441cfdfe3ab7082ea991", "src_uid": "63262317ba572d78163c91b853c05506", "apr_id": "8a051a29c63a1edfd1a1ebbab4af6280", "difficulty": 2000, "tags": ["math", "dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2521227955584585, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include \n\nint main()\n{\n int n, i, j, k;\n int g[100010];\n\n scanf(\"%d\", &n);\n\n for (i = 0; i <= n; i++) g[i] = -1;\n\n for (i = 1; i <= (n + 1) / 2; i++) {\n\t int c[1000] = {0};\n\n\t for (j = (i + 1) / 2; j > 0; j--) {\n\t int sum = 0, f = 0, num = 0;\n\n\t for (k = j; k > 0; k--) {\n\t\t sum += k;\n\t\t num++;\n\n\t\t f ^= g[k];\n\n\t\t if (sum >= i) break;\n\t }\n\n\t if (sum < i) break;\n\n\t if (sum == i && num > 1) {\n\t\t if (f < 1000) c[f] = 1;\n\t }\n\t }\n\n\t for (j = 0; j < 1000; j++) {\n\t if (c[j] == 0) break;\n\t }\n\n\t g[i] = j;\n }\n\n for (i = (n + 1) / 2; i > 0; i--) {\n\t int sum = 0, f = 0, num = 0;\n\n\t for (j = i; j > 0; j--) {\n\t sum += j;\n\t num++;\n\n\t f ^= g[j];\n\n\t if (sum >= n) break;\n\t }\n\n\t if (sum < n) break;\n\n\t if (sum == n && num > 1 && f == 0) {\n\t printf(\"%d\\n\", num);\n\n\t return 0;\n\t }\n }\n\n puts(\"-1\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f3ccd69665743b22f740bf197c626201", "src_uid": "63262317ba572d78163c91b853c05506", "apr_id": "8a051a29c63a1edfd1a1ebbab4af6280", "difficulty": 2000, "tags": ["math", "dp", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5262008733624454, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int x,y,z,i,j,k,l,sum=0,cout=0;\n scanf(\"%d%d%d\",&x,&y,&z);\n for(i=1;i<=x;i++)\n {\n for(j=1;j<=y;j++)\n {\n for(k=1;k<=z;k++)\n {\n sum=i*j*k;\n for(l=1;l<=sum;l++)\n {\n if(sum%l==0)\n cout++;\n }\n\n }\n }\n }\n\nprintf(\"%d\\n\",cout);\n\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "03340e0abf5183772abe78e319291493", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "c1df71fb8d503b9b6c5abbc520f3dbd8", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9282970550576184, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n\nint i,j;\n\nint main(){\n int n;\n int m[200];\n for(i=0;i<200;i++)m[i]=0;\n scanf(\"%d\",&n);\n if(n<1||n>200)return 0;\n char s[n+1];\n for(i=0;i95){\n if(m[s[i]]<1){c+=1;m[s[i]]+=1;}\n i++;\n if(i==n)break;\n }\n memset(m,0,200);\n i++;\n //printf(\"%d\\n\",c);\n count+=1;\n if(count==1)max=c;\n else if(c>max)max=c;\n if(i==n)break;\n }\n printf(\"%d\",max);\n\nreturn 0;}\n", "lang": "GNU C", "bug_code_uid": "5d4f12e7673bb8d0ea36abc5a8227b52", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "1c2a45c0dd8d49fa1a334c3f29285119", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9966329966329966, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//+++++++++++++++++++++++++++++//\n// Karan Aggarwal //\n// IIIT-Hyderabad //\n//+++++++++++++++++++++++++++++//\n// Topic: \n#include\n#include\n#include\n#include\n#include\n#define si(n) scanf(\"%d\",&n)\n#define rep(i,n) for(i=0;ib)return a;return b;}\nint small(int a,int b){if(a=0)a-=1000000007;\n while(a<0)a+=1000000007;\n return a;\n}\nint isgood(int x)\n{\n int N = x;\n while(N)\n {\n if(N%10 == aa)\n {\n N/=10;\n continue;\n }\n if(N%10 == bb)\n {\n N/=10;\n continue;\n }\n else return 0;\n }\n return 1;\n}\nLL inv(LL a)\n{\n LL B,m,n,x,y,u,v,q,r;\n x=v=0;\n y=u=1;\n LL b = mod;\n B=mod;\n while(a)\n {\n q=b/a;\n r=b%a;\n m=x-u*q;\n n=y-v*q;\n b=a;a=r;\n x=u;y=v;\n u=m;v=n;\n }\n return md(x);\n}\n\nint main()\n{\n int m,l,ans,sum,min,max,n,i,j,k,x,y,t;\n int counta,countb,mina,maxa;\n si(aa);\n si(bb);\n si(n);\n f[0]=1;\n REP(i,1,n+5)\n f[i] = (f[i-1]*(LL)i)%mod;\n\n LL anss=0;\n rep(i,n+1)\n {\n if(isgood(aa*i + bb*(n-i)))\n anss += md(f[n] * inv(f[i]*f[n-i]));\n anss = md(anss);\n }\n pll(md(anss));\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "608c5f0502e8925265771fbdbf4f6206", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "5df672dbb400b9e15d219cd810cb9569", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.793918918918919, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main( )\n{\nlong long int a,b,c=0,i,j,k;\nscanf(\"%lld %lld\",&a,&b);\nwhile(((a>0)&&(b>0)))\n{\nif((a==1)||(b==1))\n{\nbreak;\n}\nif(a\n\nint main () {\n int basis, value; scanf(\"%d%d\", &basis, &value);\n int amount=0, value_temp=basis;\n if (value==basis) {\n printf(0);\n } else if (value\nmain() {\n\tint ar[12],i,n,s=0;\n\tscanf(\"%d\",&n);\n\tfor(i=0;i<12;i++){\n\t\tscanf(\"%d\",&ar[i]);\n\t}\n\tfor(i=0;i<12;i++){\n\t\tint key=ar[i];\n\t\tint j=i-1;\n\t\twhile(j>=0&&ar[j]=n){\n\t\t\tprintf(\"%d\\n\",i+1);\n\t\t\tbreak;\n\t\t}\n\t}\n}\n", "lang": "GNU C11", "bug_code_uid": "e462ba541718f7c380829a6e14c48398", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "679b6b2f407d61fdd416509eadd764e8", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.42209631728045327, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nmain()\n{\n double a, b, c, d, l, r, output;\n double r1, l1;\n scanf(\" %lf %lf %lf %lf\", &a, &b, &c, &d);\n l=b-a;\n for(r=1; r==r; r++)\n {\n if(l>=(c*r+d*r))\n {\n break;\n }\n\n }\n if(l==(c*r+d*r))\n {\n printf(\"%lf\", r);\n }\n else\n {\n output=(l-(c*(r-1)+d*(r-1)));\n l=(output/(c+d));\n printf(\"%lf\", l+(r-1));\n }\n return 0;\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "b5409124f1c311626524539eb34d0ecd", "src_uid": "f34f3f974a21144b9f6e8615c41830f5", "apr_id": "f50b69f79084617c6b170cab19f7ca03", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9958847736625515, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main(){\n int n,k,a[10],count=0,i;\n scanf(\"%d%d\\n\",&n,&k);\n for(i=0;i0 && a[i]>=a[k-1]){\n count++;\n }\n }\n printf(\"%d\",count);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d1840bc8cf70114d3b45b4b00cccc722", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "fa8f798e9fb93c9c850ace33edc07fb3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9504373177842566, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \nusing namespace std;\n\nint main()\n{\n int n,m,cn=0,k, i;\n int code[20], check[20]={0};\n scanf(\"%d %d\",&n,&m);\n for(i=1;i<=n;i++) scanf(\"%d\",&code[i]);\n for(i=1;i<=m;i++) {\n scanf(\"%d\",&k);\n check[k]=1;\n }\n for(i=1;i<=n;i++){\n if(check[code[i]]) printf(\"%d \",code[i]);\n }\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "3a0cd91872ad0d014964b6d92440d22b", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72", "apr_id": "eb6f58854c09e186a1cac231b704daf4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.1641337386018237, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main()\n{\n\tint n, m;\n\tscanf(\"%d %d\\n\", &n, &m);\n\n\tchar line[2 * m];\n\tfor (int i = 0; i < n; ++i)\n\t{\n\t\tgets(line);\n\t\tfor (int j = 0; j < m; ++j)\n\t\t{\n\t\t\tif (line[2 * j] == 'C' || line[2 * j] == 'M' || line[2 * j] == 'Y')\n\t\t\t{\n\t\t\t\tprintf(\"#Color\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"#Black&White\");\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "3eb48a3dba928881695e4374ff41069d", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "b100837630b81371a7a0d77478c2d023", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.37877263581488935, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "#include\n\nint n, m, highest = 0, highest_temp = 0, p[8+1], i, k, m_note, n_count, min;\nvoid permutate(int, int);\nvoid swap(int *x, int *y);\n\nint main()\n{\n while(scanf(\"%d\", &n)!=EOF)\n {\n min = 9;\n scanf(\"%d\", &m);\n for(i = 1; i<=n; i++)\n {\n p[i] = i;\n }\n for(i = 1; i<=n; i++)\n {\n highest += i * (n+1-i);\n }\n m_note = 1;\n if(m==1)\n {\n for(i = 1; i<=n; i++)\n {\n printf(\"%d \", p[i]);\n }\n printf(\"\\n\")\n }\n else\n {\n permutate(1, n);\n } \n }\n return 0;\n}\n\nvoid permutate(int start, int end)\n{\n if(start == end)\n {\n \n for(k=1; k<=n; k++)\n {\n n_count = n;\n for(n_count; n_count>0; --n_count)\n {\n min = 9;\n for(i=k; i<=n_count; ++i)\n {\n \n if(p[i]= highest)\n {\n ++m_note;\n if(m_note-1==m)\n {\n for(i=1; i<=n; i++)\n {\n printf(\"%d \", p[i]);\n }\n printf(\"\\n\");\n }\n else{}\n }\n else{}\n }\n else\n {\n int j;\n for(j = start; j <= end; ++j)\n {\n \n swap((p+start), (p+j));\n permutate(start+1, end);\n swap((p+start), (p+j));\n }\n }\n}\n\nvoid swap(int *x, int *y)\n{\n int temp; \n temp = *x;\n *x = *y; \n *y = temp;\n}", "lang": "GNU C", "bug_code_uid": "b662ee36f14e0cbcaa5153d3aee32568", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "491c74a1216880b07008df9f121aeeb0", "difficulty": 1400, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.42736842105263156, "equal_cnt": 27, "replace_cnt": 20, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 26, "bug_source_code": "#include\nint num[6],f,sum;\nvoid dfs(int v){\n int cnt=0,t=0;\n for(int i=0;i<6;i++){\n if(v&(1<\n#include \n\nint main(int argc, char *argv[])\n{\n int scoreParticipant[6], i, j;\n int sommeScore = 0;\n scanf(\"%d %d %d %d %d %d\", &scoreParticipant[0], &scoreParticipant[1], &scoreParticipant[2], &scoreParticipant[3],&scoreParticipant[4], &scoreParticipant[5]);\n for (i = 0; i < 6; i++)\n sommeScore += scoreParticipant[i];\n if(sommeScore % 2)\n {\n printf(\"NO\");\n return 0;\n }\n for(i = 1; i < 5; i++)\n {\n for(j = i+1; j < 6; j++)\n {\n if(2*(scoreParticipant[0]+scoreParticipant[i]+scoreParticipant[j]) == sommeScore)\n {\n printf(\"YES\");\n return 1;\n }\n }\n }\n printf(\"NO\");\n return 1;\n}\n", "lang": "GNU C", "bug_code_uid": "a8781e870a8717d12ae9c393bb58e0f3", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "e3043d47aaffdbf5e675f9aad36cd5e9", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9754040758959944, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint length(int n) {\n\treturn n == 0 ? 0 : length(n / 10) + 1;\n}\n\nint main() {\n\tstatic int aa[3][6];\n\tint n, i, j, x;\n\n\tscanf(\"%d\", &n);\n\tfor (i = 0; i < n; i++)\n\t\tfor (j = 0; j < 6; j++)\n\t\t\tscanf(\"%d\", &aa[i][j]);\n\tfor (x = 1; ; x++) {\n\t\tint good;\n\n\t\tgood = 0;\n\t\tif (length(x) == 1) {\n\t\t\tint i, j;\n\n\t\t\tfor (i1 = 0; i1 < n; i1++)\n\t\t\t\tfor (j1 = 0; j1 < 6; j1++) {\n\t\t\t\t\tint a;\n\n\t\t\t\t\ta = aa[i1][j1];\n\t\t\t\t\tif (a == x) {\n\t\t\t\t\t\tgood = 1;\n\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t} else if (length(x) == 2) {\n\t\t\tint i1, i2, j1, j2;\n\n\t\t\tfor (i1 = 0; i1 < n; i1++)\n\t\t\t\tfor (j1 = 0; j1 < 6; j1++)\n\t\t\t\t\tfor (i2 = 0; i2 < n; i2++)\n\t\t\t\t\t\tfor (j2 = 0; j2 < 6; j2++)\n\t\t\t\t\t\t\tif (i1 != i2) {\n\t\t\t\t\t\t\t\tint a, b;\n\n\t\t\t\t\t\t\t\ta = aa[i1][j1];\n\t\t\t\t\t\t\t\tb = aa[i2][j2];\n\t\t\t\t\t\t\t\tif (a == x / 10 && b == x % 10) {\n\t\t\t\t\t\t\t\t\tgood = 1;\n\t\t\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t} else {\n\t\t\tint i1, i2, i3, j1, j2, j3;\n\n\t\t\tfor (i1 = 0; i1 < n; i1++)\n\t\t\t\tfor (j1 = 0; j1 < 6; j1++)\n\t\t\t\t\tfor (i2 = 0; i2 < n; i2++)\n\t\t\t\t\t\tfor (j2 = 0; j2 < 6; j2++)\n\t\t\t\t\t\t\tfor (i3 = 0; i3 < n; i3++)\n\t\t\t\t\t\t\t\tfor (j3 = 0; j3 < 6; j3++)\n\t\t\t\t\t\t\t\t\tif (i1 != i2 && i2 != i3) {\n\t\t\t\t\t\t\t\t\t\tint a, b, c;\n\n\t\t\t\t\t\t\t\t\t\ta = aa[i1][j1];\n\t\t\t\t\t\t\t\t\t\tb = aa[i2][j2];\n\t\t\t\t\t\t\t\t\t\tc = aa[i3][j3];\n\t\t\t\t\t\t\t\t\t\tif (a == x / 100 && b == x / 10 && c == x % 10) {\n\t\t\t\t\t\t\t\t\t\t\tgood = 1;\n\t\t\t\t\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t}\ndone:\n\t\tif (!good)\n\t\t\tbreak;\n\t}\n\tprintf(\"%d\\n\", x - 1);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "514641be78e262617fc0fd1c3725939e", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "01098bebce220f6b14f26d6b21ae510f", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8476702508960573, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main(){\n long long m,n;\n int a,b;\n scanf(\"%lld %lld %d %d\",&m,&n,&a,&b);\n // tim 2 so gan n nhat\n if (m % n != 0){\n long long f1,f2;\n // find f1\n long long temp1 = m, temp2 = m;\n while(1){\n if (temp1 % n != 0) temp1--;\n if (temp1 % n == 0){\n f1 = temp1;\n break;\n }\n }\n // find f2\n f2 = f1 + n;\n // printf(\"(%lld %lld)\",f1,f2);\n if ( (m-f1)*b < (f2-m)*a )\n printf(\"%lld\",(m-f1)*b);\n else printf(\"%lld\",(f2-m)*a);\n\n }else printf(\"0\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "715bf742c720ea47bdfbb2060f8c5438", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "ef6d7823018ba9447a170be002add3b7", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.172396100564392, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\n#include\nint main()\n{\n char a[100];\n int i,c=0;\n scanf(\"%s\",&a);\n for(i=0;i0)\n {\n printf(\"NO\\n\");\n\n }\n else\n {\n printf(\"YES\\n\");\n }\n}\n\n", "lang": "GNU C11", "bug_code_uid": "4d48a94dc446a9d7b338c4235592bef0", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "7f7a791a3b58cbffc277dc2e71c575d4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7774390243902439, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "#include\nint a[100],n;\nint max(int i,int j)\n{\n return i>j?i:j;\n}\nint q(int st,int odd,int even,int b)\n{\n if((st==n-1)||(b<=0)) return 0;\n if(a[st]%2==0) even ++;\n else odd ++;\n int d;\n if(a[st]>a[st+1]) d=a[st]-a[st+1];\n else d=a[st+1]-a[st];\n if((odd+even>0)&&(odd==even)&&(b>=d))\n {\n return max(1+q(st+1,0,0,b-d),q(st+1,odd,even,b));\n }\n return q(st+1,odd,even,b);\n}\nint main()\n{\n int i,b,c;\n scanf(\"%d %d\",&n,&b);\n for(i=0;i\nint a[100],n,m[100];\nint max(int i,int j)\n{\n return i>j?i:j;\n}\nint q(int st,int odd,int even,int b)\n{\n if((st==n-1)||(b<=0)) return 0;\n if(m[st]!=-1) return m[st];\n if(a[st]%2==0) even ++;\n else odd ++;\n int d;\n if(a[st]>a[st+1]) d=a[st]-a[st+1];\n else d=a[st+1]-a[st];\n if((odd+even>0)&&(odd==even)&&(b>=d))\n {\n m[st]=max(1+q(st+1,0,0,b-d),q(st+1,odd,even,b));\n return m[st];\n }\n m[st]=q(st+1,odd,even,b);\n return m[st];\n}\nint main()\n{\n int i,b,c;\n scanf(\"%d %d\",&n,&b);\n for(i=0;i\nmain()\n{\n int a,b,m,r,*d,x,y;\n scanf(\"%d%d%d%d\",&a,&b,&m,&r);\n d=(int*)malloc((m+1)*sizeof(int));\n d[0]=r;\n for(x=1;x<=m;x++)\n {\n d[x]=((a*d[x-1])+b)%m;\n for(y=0;y\nmain()\n{ long long int d,b,c=0,m,r,i=1,j,a[100001];\nscanf(\"%I64d%I64d%I64d%I64d\",&d,&b,&m,&r);\na[0]=r;\nwhile(c!=1)\n{r=(d*r+b)%m;\n a[i++]=r;\n for(j=1,c=0;j\nint fact(int x);\nint main()\n{\n\tlong long n,i;\n\twhile(scanf(\"%lld\",&n)!=EOF)\n\t{\n\t\tint s=0,m,t,j,c,d;\n\t\tfor(i=1;i*i<=n;i++)\n\t\t{\n\t\t\tc=(n-2*i);\n\t\t\tt=c/3;\n\t\t\tif(c%3==0&&t>=fact(i))\n\t\t\t{\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\n\t\t\tprintf(\"%d\\n\",s);\n\t}\n}\nint fact(int x)\n{\n\tint i,s=0;\n\tfor(i=1;i\n#include\n#include\n#include\n#define ll long long int\n#define M 1000000007\n#define rep(i,a,b,c) for(i=a;i=b;i=i-c)\n#define test long long int t;scanf(\"%lld\",&t);while(t--)\n#define pi(a) printf(\"%lld\\n\",a)\n#define psi(a) printf(\"%lld \",a)\n#define pc(a) printf(\"%c\\n\",c)\n#define ps(a) printf(\"%s\\n\",s)\n#define si(a) scanf(\"%lld\",&a)\n#define sf(a) scanf(\"%f\",&a)\n#define sc(a) scanf(\"%c\",&c)\n#define ss(a) scanf(\"%s\",a)\n#define min(a,b) (a=0){s=1;}\n else if(s1[i][j+1]=='x'&&s1[i][j+2]=='x'&&j+2<4){s=1;}\n else if(s1[i][j-1]=='x'&&s1[i][j-2]=='x'&&j-2>=0){s=1;}\n else if(s1[i+1][j+1]=='x'&&s1[i+2][j+2]=='x'&&j+2<4&&i+2<4){s=1;}\n else if(s1[i-1][j-1]=='x'&&s1[i-2][j-2]=='x'&&j-2>=0&&i-2>=0){s=1;}\n else if(s1[i+1][j-1]=='x'&&s1[i+2][j-2]=='x'&&j-2>=0&&i+2<4)s=1;\n else if(s1[i-1][j+1]=='x'&&s1[i-2][j+2]=='x'&&j+2<4&&i-2>=0)\n }\n else if(s1[i][j]=='x')\n {\n if(((s1[i+1][j]=='.'&&s1[i+2][j]=='x')||(s1[i+1][j]=='x'&&s1[i+2][j]=='.'))&&i+2<4){s=1;}\n else if(((s1[i-1][j]=='.'&&s1[i-2][j]=='x')||(s1[i-1][j]=='x'&&s1[i-2][j]=='.'))&&i-2>=0){s=1;}\n else if(((s1[i][j+1]=='.'&&s1[i][j+2]=='x')||(s1[i][j+1]=='x'&&s1[i][j+2]=='.'))&&j+2<4){s=1;}\n else if(((s1[i][j-1]=='.'&&s1[i][j-2]=='x')||(s1[i][j-1]=='x'&&s1[i][j-2]=='.'))&&j-2>=0){s=1;}\n\n else if((s1[i+1][j+1]=='.'&&s1[i+2][j+2]=='x')||(s1[i+1][j+1]=='x'&&s1[i+2][j+2]=='.')){if(j+2<4&&i+2<4){s=1;}}\n else if((s1[i-1][j-1]=='.'&&s1[i-2][j-2]=='x')||(s1[i-1][j-1]=='x'&&s1[i-2][j-2]=='.')){if(j-2>=0&&i-2>=0){s=1;}}\n\n else if((s1[i-1][j+1]=='.'&&s1[i-2][j+2]=='x')||(s1[i-1][j+1]=='x'&&s1[i-2][j+2]=='.')){if(i-2>=0&&j+2<4)s=1;}\n else if((s1[i+1][j-1]=='.'&&s1[i+2][j-2]=='x')||(s1[i+1][j-1]=='x'&&s1[i+2][j-2]=='.')){if(j-2>=0&&i+2<4)s=1;}\n }\n }\n}\nif(s==1)printf(\"YES\\n\");\nelse printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d483c97b288e4eaa54bafc8875514d38", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "821f814eda9d10af456165efafc15b76", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8211818879508825, "equal_cnt": 36, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 20, "fix_ops_cnt": 36, "bug_source_code": "#include \n#include \n\nint main()\n{\n char arr[4][4];\n int a, b, x=0, y, z=0, o=0;\n\n for(a=0 ; a<4 ; a++){\n scanf(\" %[^\\n]\",arr[a]);\n }\n\n for(a=0 ; a<4 ; a++){\n x=0;\n z=0;\n for(b=0 ; b<4 ; b++){\n if(arr[a][1] == 'o' || arr[a][2] == 'o')break;\n else{\n if(arr[a][b] == 'o')o++;\n if(arr[a][b] == '.') z++;\n if(arr[a][b] == 'x')x++;\n if(z == 2)break;\n if(x > 1){printf(\"YES\\n\"); goto omar;}\n\n }\n }\n if(z == 2 || o == 2)break;\n else {\n if(x > 1){printf(\"YES\\n\",x,o); goto omar;}\n }\n x=0;\n o=0;\n for(b=0 ; b<4 ; b++){\n x=0;\n z=0;\n for(a=0 ; a<4 ; a++){\n if(arr[1][b] == 'o' || arr[2][b] == 'o')break;\n else{\n if(arr[a][b] == 'o')o++;\n if(arr[a][b] == '.')z++;\n if(arr[a][b] == 'x')x++;\n\n }\n }\n if(z == 2 || o == 2)break;\n else {\n if(x > 1){printf(\"YES\\n\",x,o); goto omar;}\n }\n }\n x=0;\n y=0;\n a=1;\n b=0;\n while(y<3){\n\n if(arr[2][1] == 'o')break;\n else{\n if(arr[a][b] == 'o')break;\n if(arr[a][b] == 'x')x++;\n\n if(x > 1){printf(\"YES\\n\",x); goto omar;}\n a++;\n b++;\n y++;\n }\n }\n y=0;\n x=0;\n z=0;\n a=0;\n b=0;\n o=0;\n while(y<4){\n\n if(arr[1][1] == 'o' || arr[2][2] == 'o')break;\n else{\n if(arr[a][b] == 'o')o++;\n if(arr[a][b] == '.') z++;\n if(arr[a][b] == 'x')x++;\n \n if(z == 2 || o == 2)break;\n else {\n if(x > 1 && y == 3){printf(\"YES\\n\",x,o); goto omar;}\n a++;\n b++;\n y++;\n }\n }\n y=0;\n x=0;\n a=0;\n b=1;\n while(y<3){\n\n if(arr[1][2] == 'o')break;\n else{\n if(arr[a][b] == 'o')break;\n if(arr[a][b] == 'x')x++;\n\n if(x > 1){printf(\"YES\\n\",x); goto omar;}\n a++;\n b++;\n y++;\n }\n }\n y=0;\n x=0;\n a=0;\n b=2;\n while(y<3){\n\n if(arr[1][1] == 'o')break;\n else{\n if(arr[a][b] == 'o')break;\n if(arr[a][b] == 'x')x++;\n\n if(x > 1){printf(\"YES\\n\"); goto omar;}\n a++;\n b--;\n y++;\n }\n }\n y=0;\n x=0;\n z=0;\n a=0;\n b=3;\n o=0;\n while(y<4){\n\n if(arr[1][2] == 'o' || arr[2][1] == 'o')break;\n else{\n if(arr[a][b] == 'o')o++;\n if(arr[a][b] == '.')z++;\n if(arr[a][b] == 'x')x++;\n \n\n if(z == 2 || o == 2)break;\n else {\n if(x > 1 && y == 3){printf(\"YES\\n\",x,o); goto omar;}\n a++;\n b--;\n y++;\n }\n }\n y=0;\n x=0;\n a=1;\n b=3;\n while(y<3){\n\n if(arr[2][2] == 'o')break;\n else{\n if(arr[a][b] == 'o')break;\n if(arr[a][b] == 'x')x++;\n\n if(x > 1){printf(\"YES\\n\"); goto omar;}\n a++;\n b--;\n y++;\n }\n }\n printf(\"NO\\n\");\n omar:\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "81c80a5744c71914773c3cd54b8a3eab", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "d07ee0413083a5972b68c12a2812971c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9168490153172867, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#define MOD 1000000007\n#define ll long long\n#define BS_NOT_FOUND 0\n#define BS_FOUND 1\n\nll f[5000006]={0};\nll prime[5000006]={0};\n\nlong long expo(long long x, long long n){\n long long res = 1;\n\n while (n){\n if (n & 1LL) res = (res * x) % MOD;\n x = (x * x) % MOD;\n n >>= 1LL;\n }\n\n return (res % MOD);\n}\n\nint main(){\n //calculate f[i]\n ll i,j;\n for(i=2;i<=5000000;i++){\n if(prime[i]>0) continue;\n prime[i]=i;\n for(j=2*i;j<=5000000;j+=i){\n if(prime[j]==0) prime[j]=i;\n }\n }\n f[1]=0;\n for(i=2;i<=5000000;i++) f[i]=(f[i/prime[i]]+i*(prime[i]-1)/2%MOD)%MOD;\n\n /*\n f[2]=1;\n f[3]=3;\n f[4]=3;\n f[5]=10;\n f[7]=21;\n f[11]=55;\n f[13]=66;\n f[17]=17*16/2;\n f[19]=19*9;\n f[23]=253;\n f[29]=29*14;\n ll i,index,j,num;\n for(i=6;i<=5000000;i++){\n num=i;\n index=2;\n if(i%2==0) {f[i]=i/2+f[i/2];continue;}\n if(i%3==0) {f[i]=i+f[i/3];continue;}\n if(i%5==0) {f[i]=i*2+f[i/5];continue;}\n if(i%7==0) {f[i]=i*3+f[i/7];continue;}\n if(i%11==0) {f[i]=i*5+f[i/11];continue;}\n if(i%13==0) {f[i]=i*6+f[i/13];continue;}\n if(i%17==0) {f[i]=i*8+f[i/17];continue;}\n if(i%19==0) {f[i]=i*9+f[i/19];continue;}\n if(i%23==0) {f[i]=i*11+f[i/23];continue;}\n if(i%29==0) {f[i]=i*14+f[i/29];continue;}\n while(num%index!=0 && index*index<=num) index++;\n if(index*index>num){\n f[i]=(i*(i-1)/2);\n continue;\n }\n f[i]=i/index*f[index]+f[i/index];\n }\n */\n //for(i=2;i<=5000000;i++) printf(\"%lld,\",f[i]);\n\n ll t,l,r;\n scanf(\"%lld %lld %lld\",&t,&l,&r);\n ll ans=0;\n for(i=l;i<=r;i++){\n ll x=expo(t,i-l);\n ll y=(x*(f[i]))%MOD;\n ans=(ans+y)%MOD;\n }\n printf(\"%lld\\n\",ans);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "035622c1e9778d4545a546cebf016f94", "src_uid": "c9d45dac4a22f8f452d98d05eca2e79b", "apr_id": "0e50ebfb601999fcbdc9f40f69da99dd", "difficulty": 1800, "tags": ["dp", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9681774349083896, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\ntypedef long long int lli;\nlli m=1e9+7;\nlli d[5000001];\nint main()\n{\n for(int i=1;i<=5000000;i++) d[i]=1e18;\n d[1]=0;\n for(lli i=1;i<=5000000;i++)\n {\n for(lli j=2*i;j<=5000000;j+=i)\n {\n lli g=j/i;\n lli u=d[i]+(j*(g-1))/2;\n if(d[j]>u) d[j]=u;\n }\n }\n lli t,l,r;\n scanf(\"%lld %lld %lld\",&t,&l,&r);\n lli a=0,k=1;\n for(int i=r;i>=l;i--){\n a=(a*t)%m;\n a=(a+d[i])%m;\n }\n printf(\"%lld\",a);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "25fc2a73e471bccd6c13ce2bf06a283d", "src_uid": "c9d45dac4a22f8f452d98d05eca2e79b", "apr_id": "dedc3829bb2a0f9de7f1d8aa808f66ae", "difficulty": 1800, "tags": ["dp", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8649237472766884, "equal_cnt": 21, "replace_cnt": 2, "delete_cnt": 18, "insert_cnt": 1, "fix_ops_cnt": 21, "bug_source_code": "#include \n\nvoid conv(int x, int * m)\n{\n int i=0;\n do\n {\n m[i]=x%3; \n x/=3;\n i++;\n } \n while (x);\n for (i=0;i<32;i++) m[i]=0;\n}\n\nint main()\n{ \n int c1[32],c2[32],i,a,b,r=0,s=3;\n scanf(\"%d%d\",&a,&b);\n conv(a,c1);\n conv(b,c2);\n for (i=0;i<32;i++)\n {\n c1[i]=c2[i]-c1[i];\n if (c1[i]<0) c1[i]+=3;\n if (i==0) r=c1[i];\n else\n {\n r+=c1[i]*s;\n s*=3;\n }\n }\n printf(\"%d\",r);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d1cbf5e681a1ca36dc0d2e4ebd8192c0", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "556203e9a9f99050b1377bd910b9f0f9", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9916666666666667, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "unsigned a,b,c,x=1;\nint main(){\nfor(scanf(\"%d%d\",&a,&c);a|b;x*=3,a/=3,c/=3)b+=(3+c%3-a%3)%3*x;\nprintf(\"%d\",b);exit(0);\n}", "lang": "GNU C", "bug_code_uid": "8c1c611274a7452b0c7c20e73f369108", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "0883bc974430640981f5ec6479439eeb", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7974882260596546, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n//using namespace std;\nint main(){\n\tint a1,a2,a3,b1,b2,b3,n;\n\tscanf(\"%d %d %d %d %d %d %d\",a1,a2,a3,b1,b2,b3,n);\n\tint d,c,x1,x2;\n\tx1=a1+a2+a3;\n\tx2=b1+b2+b3;\n\tif(x1%5==0) d=x1/5;\n\telse d=x1/5+1;\n\tif(x2%10==0) c=x2/10;\n\telse c=x2/10+1;\n\tif(d+c<=n) printf(\"YES\");\n\telse printf(\"NO\");\n\treturn 0; \n}\n", "lang": "GNU C11", "bug_code_uid": "b47aae675f07d088d2aaae06bcc212f7", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "c0a0202af6e0ac224d66b0dbe4696ffe", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5719844357976653, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint min(int a,int b)\n{\n if(a>b)\n return b;\n return a;\n}\nint main()\n{\n int a,b,c,d,e,f,small=0,i,cost=0;\n scanf(\"%d%d%d%d%d%d\",&a,&b,&c,&d,&e,&f);\n\n if(f>e)\n {\n small=min(min(b,c),d);\n \n while(small--) {\n b--;\n c--;\n d--;\n cost = cost + f;\n }\n\n if(d != 0 && a != 0) {\n while(d != 0 || a != 0) {\n d--;\n a--;\n cost = cost + e;\n }\n }\n }\n \n printf(\"%d\",cost);\n}\n", "lang": "GNU C11", "bug_code_uid": "462cf9eceb7d60d7da639c6c4ec0f0c3", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a", "apr_id": "828ba79f26f3cfa5dbe2de9445581d34", "difficulty": 800, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4802686817800168, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "#include\n\nint main ()\n{\n int t,s,v,j,i,e,f,min;\n long long int sum;\n while (1)\n\n {\n\n scanf (\"%d%d%d%d\",&t,&s,&v,&j);\n scanf (\"%d%d\",&e,&f);\n min = s;\n if (min > v)\n min = v;\n if (min > j)\n min = j;\n j = j -min;\n sum = min*f;\n if (t>j)\n min = j;\n else min = t;\n sum = sum + min*e;\n printf (\"%lld\\n\",sum);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "516874c63590cd94839ab1b90155b098", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a", "apr_id": "ac62c43641409e0b70da5d1756f415c9", "difficulty": 800, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9702660406885759, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n int a,b,c;\n int m;\n int tmp, ans, i;\n\n scanf(\"%d%d%d\", &a, &b, &c);\n m = (aans?tmp:ans);\n }\n printf(\"%d\\n\", ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "ccda9054fad5d9ac1362a27d282d8107", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "107b9630d01298ae8931e9c4eadf5e04", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.88996138996139, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "/*\n \ufffd\u0202\ufffd\ufffd\u0391\ufffd\ufffd\u0202\ufffd\u0182\ufffd\ufffd\u0202\ufffdI \n*/\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#define LLU unsigned long long int\n#define LL long long int\n#define LD long double\n\n#define LLUmax ULLONG_MAX\n#define LLmax LLONG_MAX\n#define dmax INT_MAX\n#define debug printf(\"asd\\n\")\n#define newline printf(\"\\n\")\n\n#define amt(a) int a;scanf(\"%d\",&a)\n#define dlld(a,b) long long int a,b;scanf(\"%I64d %I64d\",&a,&b)\n#define scd(a) int a;scanf(\"%d\",&a)\n#define sclld(a) long long int a;scanf(\"%I64d\",&a)\n#define prdlld(a,b) printf(\"%I64d %I64d\",a,b)\n#define prdd(a,b) printf(\"%d %d\",a,b)\n#define prd(a) printf(\"%d\",a)\n#define arr(a,b) int *a=(int *)malloc(n*sizeof(int))\n#define llarr(a,b) long long int *a=(long long int *)malloc(n*sizeof(long long int))\n#define st(a,b) char *a=(char *)malloc(b*sizeof(char))\n#define grav 9.8\n#define pi 3.14159265\n\nint main()\n{\n\tamt(n);\n\tint a[20000],b[20000];\n\tint c[7],d[7];\n\tfor(int i=0 ; i<6 ; i++)\n\t{\n\t\tc[i]=0;\n\t\td[i]=0;\n\t}\n\tfor(int i=0 ; i1)\n\t{\t\t\n\t\t/*for(int i=1 ; i<=5 ; i++)\n\t\t{\n\t\t\tprintf(\"%d %d\\n\",c[i],d[i]);\n\t\t}*/\n\t\tfor(int i=1 ; i<=5 ; i++)\n\t\t{\n\t\t\twhile(c[i]!=d[i])\n\t\t\t{\n\t\t\t\tif(c[i]>d[i])\n\t\t\t\t{\n\t\t\t\t\tc[i]--;\n\t\t\t\t\td[i]++;\n\t\t\t\t}\n\t\t\t\telse if(c[i]\nint main()\n{\n\tint k2,k3,k5,k6,count = 0;\n\tscanf(\"%d %d %d %d\",&k2,&k3,&k5,&k6);\n\twhile(k5 > 0 && k6 > 0)\n\t{\n\t\tif(k2 > 0)\n\t\t{\n\t\t\tcount = count + 256;\n\t\t\tk2--;k5--;k6--;\n\t\t}\n\t}\n\twhile(k2 > 0 && k3 > 0)\n\t{\n\t\tcount = count + 32;\n\t\tk2--;\n\t\tk3--;\n\t}\n\tprintf(\"%d\",count);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "21def96b79cc96c31c5e331d340968b5", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "4619cd73dec97ac74f29e5575c074fd0", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9087837837837838, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "int gcd(int a,int b)\n{\n\tif (b==0) \n\t\treturn a;\n \telse \n\t\treturn gcd(b,a%b);\n}\nint main()\n{\n\tint a,b,n,g,x=1;\n\tscanf(\"%d%d%d\",&a,&b,&n);\n\twhile(1)\n\t{\n\t\tif(x)\n\t\t\tg=gcd(a,n);\n\t\telse\n\t\t\tg=gcd(b,n);\n\t\tif(g>n)\n\t\t\tbreak;\n\t\tx=(x+1)%2;\n\t}\n\tif(x)\n\t\tprintf(\"0\\n\");\n\telse\n\t\tprintf(\"1\\n\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "c1c970bfe83afe67147c85ca586e2e08", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "197d28b6a94b70eb5212552e3b90c5ed", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9276139410187667, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\nint a , b , i ;\nfor(i=1;;i++)\n{\na=a*3 ;\nb=b*2 ;\nif(a>b)\n { printf(\"%d\",i);\n break;\n }\n }\n\n\n\n\n\n}", "lang": "GNU C11", "bug_code_uid": "61995c7b9bf9a18ebfce38a81ae8bdce", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "15538710388a85f7ae10639348568426", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9129770992366413, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nint main ()\n{\n\tint x,y;\n\tdo{\n\t\tscanf(\"%d %d\",&y,&x);\n\t}while(((x<0)||(x>pow(10,9)))||((y<0)||(y>pow(10,9))));\n\t\n\t if((x==0)&&(y==0))\n\t {\n\t \tprintf(\"Yes\");\n\t }\n\t else\n\t if((x>y+1))\n\t {\n\t \tprintf(\"No\");\n\t }\n\t else\n\t if(((y-x+1)%2==0))\n\t printf(\"Yes\");\n\t else printf(\"No\");\n\t return(1);\n}\n", "lang": "GNU C", "bug_code_uid": "1ae818a39f45318630719000a6ee1865", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "db1cdb2fc8f91dc0f7191f540d0749bf", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7918552036199095, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main() {\n\tint n;\n\tscanf(\"%d\", &n);\n\tint tail=0, head=n-1, arr[n], flag=1, c=0;\n\tfor (int i=0;i\nint main()\n{\n long long n,m;\n long long k;\n long long temp;\n while(1){\n scanf(\"%I64d%I64d\",&n,&m);\n m--;\n scanf(\"%I64d\",&k);\n k++;\n if(k<=n){\n printf(\"%I64d 1\",k);\n }\n else{\n k-=n;\n for(temp=0;k>0;temp++){\n k-=m;\n }\n printf(\"%I64d \",1+n-temp);\n temp%=2;\n if(temp%2==0)\n printf(\"%I64d\",2-k);\n else\n printf(\"%I64d\",m+k+1);\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1b41982c9fd9d7d99ad738376a56a3dd", "src_uid": "e88bb7621c7124c54e75109a00f96301", "apr_id": "3d05f7d9b1794532abdf3978845e586e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9302045728038508, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \ntypedef signed char sint8;\ntypedef unsigned char uint8; \ntypedef signed short sint16;\ntypedef unsigned short uint16;\ntypedef unsigned long uint32;\n\n#define NUMBER_OF_ALPHABETS 26\n\n#define IS_EVEN(X) (((X)%2)?(0):(1))\n\nint main(){\n sint8 alphabetFreqArr[NUMBER_OF_ALPHABETS]={0};\n sint8 input;\n uint8 numberOfUniqueAlpa=0;\n memset(alphabetFreqArr , 0 , NUMBER_OF_ALPHABETS);\n do{\n scanf(\"%c\" , &input);\n if(alphabetFreqArr[input-'a']==0)\n {\n printf(\"%d/n\" , input);\n alphabetFreqArr[input-'a']++;\n numberOfUniqueAlpa++;\n }\n } while(input!='/n');\n printf(\"%d\" ,numberOfUniqueAlpa); \n if(!((numberOfUniqueAlpa-1)%2))\n {\n printf(\"CHAT WITH HER!\");\n }\n else\n {\n printf(\"IGNORE HIM!\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ed55c8228d56733e4f751377ec3b6174", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "b8b1ed43f568dacacd200ed39dd3f425", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.33235004916420846, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,e,f,k=0;\n scanf(\"%d%d\",&a,&b);\n scanf(\"%d%d\",&c,&d);\n int ara[1000],i;\n for(i=1;i<1000;i++)\n {\n ara[i]=0;\n }\n for(i=1;i<=100;i++)\n {\n e=b+((i-1)*a);\n ara[e]++;\n f=d+((i-1)*c);\n ara[f]++;\n }\n for(i=1;i<1000;i++)\n {\n if(ara[i]>1)\n {\n k=i;\n printf(\"%d\\n\",i);\n goto end;\n }\n\n\n }\n\n end:\n if(k==0)\n printf(\"-1\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "815417bbccb0827a2d89c503d9c8bb1e", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "795819699ed95e70d2a9075054ad0788", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.39185750636132316, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\nint main()\n{\n int a, b, c, d, n;\n scanf(\"%d %d %d %d\", &a,&b,&c,&d);\n\n {\n if((fb+n*a)==(d+n*c))\n {\n while(n++){\n printf(\"%d\", b+n*a);}\n\n }\n else\n {\n\n printf(\"-1\");\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a1a70038ca39391d84fb140fcbb7ec8b", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "a1842716398f3338cf050c4ec15272fc", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9992150706436421, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\nint n, glen;\nchar perm[65336][7];\nchar tran[128][128];\n\nvoid\nstrgen (char *inp)\n{\n char i;\n int l = strlen (inp);\n\n if (l == n) {\n strcpy (perm[glen++], inp);\n return;\n } else {\n for (i = 'a'; i <= 'f'; ++i) {\n char out[8];\n strcpy (out, inp);\n out[l++] = i;\n out[l] = '\\0';\n\n strgen(out);\n\n }\n }\n}\n\nint\nmain ()\n{\n int i, q, ans = 0;\n scanf (\"%d%d\", &n, &q);\n\n strgen (\"\");\n for (i = 0; i < q; ++i) {\n char f[4], s[2];\n\n scanf (\"%s%s\", f, s);\n tran[f[0]][f[1]] = s[0];\n }\n for (i = 0; i < glen; i++) {\n int j;\n char o = perm[i][0];\n\n for (j = 1; j < n; ++j) {\n o = tran[o][perm[i][j]];\n if (o == 0) {\n break;\n }\n }\n if (o == 'a') {\n ++ans;\n }\n }\n printf (\"%d\\n\", ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "ff9139f91e0d4f3aaa7328d4761023c6", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "apr_id": "f8964cd988e44af15f0dafaa86494db8", "difficulty": 1300, "tags": ["brute force", "dp", "dfs and similar", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.809489575844716, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint n,q;\nint **mat;\n\nvoid read()\n{\n\tint i;\n\t\n\tscanf(\"%d%d\",&n,&q);\n\t\n\tmat=malloc(6*sizeof(int*));\n\tfor(i=0;i<6;i++) mat[i]=calloc(6,sizeof(int));\n\t\n\tchar a[3],b[2];\n\t\n\tfor(i=0;i\nint main()\n{\n char a[101];\n int i, p, j, count = 0;\n scanf(\"%s\",a);\n for(i=0; a[i]!='\\0'; )\n {\n p = i;\n p++;\n if(a[i]=='1')\n {\n for(j=p; a[j]!='\\0'; j++)\n {\n if(a[j]=='0')\n count++;\n if(count == 6)\n break;\n i = j+1;\n //printf(\"%d \",count);\n }\n }\n else i++;\n if(count == 6)\n break;\n }\n if(count == 6)\n printf( \"yes\\n\" );\n else\n printf( \"no\\n\" );\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5c62bc257ba4ea151d712f547a96811c", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "e87c85afdc891c48b29d9232a90a132b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8760330578512396, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "# include \n\nint main()\n{\n char d, c=0;\n while((d=getchar())!='1');\n while((d=getchar())!=EOF) {\n if(d=='0')\n c++;\n }\n if(c>=6)\n printf(\"yes\");\n else\n printf(\"no\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "9a739ce186d01dc6f71f086cfece5ffb", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "0d56284451c4cee42fb2bea34871695b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9954614220877458, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main () \n{ \n\t int a, b, c, largest, i;\n\t scanf(\"%d\", &a); \n\t largest=1; \n\t for(i=0;i<=a;i++) { \n\t scanf(\"%d\", b); \n\t if(b>largest) { \n\t largest =b;\n\t\t }\n\t\t \n\t \n\t\t}\n\t\tc= largest -25; \n\t\tif(c>0){\n\t\t\tprintf(\"%d\", c);\n\t\t}\n\t\telse \n\t\tprintf(\"0\");\n \n\n return 0; \n}\n", "lang": "GNU C", "bug_code_uid": "c4bb4fe68fa62165adae9cdd98837124", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "255dfb20eaf70c856871eb87c3b57ab1", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.26563944530046224, "equal_cnt": 41, "replace_cnt": 29, "delete_cnt": 10, "insert_cnt": 2, "fix_ops_cnt": 41, "bug_source_code": "#include\n#include\n#include \nint permutar(int n,int p, int v[], int vo[] );\nint comparar(int v2[],int v3[],int c);\n main(){\n int n,k,u,w=0;\n char c;\n do{\n scanf(\"%d\",&n);\n }while(n<1 || n>100);\n char v1[2*n];\n int v2[n];\n int v3[n];\n u=n;\n do{\n scanf(\"%s\",v1);\n }while(strlen(v1)!=2*n);\n\n\n for(k=0;k< n;k++){\n c=v1[k];\n v2[k]= c-48;\n }\n for(k=0;k< n;k++){\n c=v1[u];\n v3[k]= c-48;\n u++;\n\n }\n w=permutar(n,0,v2,v3);\n\n\n if(w==10){\n printf(\"NO \\n\");\n }\n\n\n }\n\n int permutar(int n,int p, int v[], int vo[] ){\n int k,aux,z,j;\n if(pv3[k]){\n u++;\n }else{\n u=0;\n }\n }\n\n if(u==c || y==c){\n return 5;\n }else{\n return 6;\n }\n\n }\n\n", "lang": "GNU C", "bug_code_uid": "e0db7b52e99eabe0365a64d2b9958f5e", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "afa76027094bb9d362f71de7463b55a8", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5983935742971888, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include\n\nint main(){\n long long int k,b,n,t,z=1,s=0;\n scanf(\"%lld %lld %lld %lld\",&k,&b,&n,&t);\n z=z*k+b;\n while(s\nlong long int main()\n{\nint i,n;\nscanf(\"%lld\",&n);\ni=(3*n*(n+1))+1;\nprintf(\"%lld\",i);\n}\n", "lang": "GNU C", "bug_code_uid": "7e7e0694dfa8a455e9e499f0963fe63b", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "8916696911d3692c7f56a6cadf0b68e2", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9992526158445441, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main(){\n int n;\n scanf(\"%d\\n\", &n);\n int cards[100];\n char s[310];\n gets(s);\n int i;\n for(i=0; i> k) & 1;\n if(cards[i] / 5 == k && a) res[i] += 1 << k;\n }\n for(k=0; k<5; k++){\n int a = (v >> (k + 5)) & 1;\n if(cards[i] % 5 == k && a) res[i] += 1 << (k + 5);\n }\n }\n int j;\n int test = 0;\n for(i=0; i 0){\n count += v1 & 1;\n v1 >>= 1;\n }\n if(count < min){\n min = count;\n }\n }\n }\n printf(\"%d\\n\", min);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "78501a59ad331fcee1c578e9198e3493", "src_uid": "3b12863997b377b47bae43566ec1a63b", "apr_id": "cb06e8238c272123078eed72236fc9bf", "difficulty": 1700, "tags": ["bitmasks", "brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24788732394366197, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "#include\nint main()\n{\n int c,v0,v1,a,l,days=1,sum=0,sum1=0,d,i;\n\n scanf(\"%d %d %d %d %d %d\",&c,&v0,&v1,&a,&l);\nsum1 = v0;\n do\n {\n for(i=2; i=v1)\n {\n sum = sum+sum1;\n d=sum1-v1;\n sum = sum-d;\n sum1=v1;\n }\n else\n {\n sum = sum+sum1;\n }\n days++;\n }\n }\n while(sum!=c);\n\n printf(\"%d\",days);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2ef71c5e1b6cfc4b39019d832d27732e", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "2b367df1c4fc9b874e9af2016936716b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9176688251618872, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#define ll long long int\n\nll div = 1000000007;\n\nll power(ll base,ll n)\n{\n ll ans;\n ll half = n/2;\n if(n==0)\n {\n ans = 1;\n }\n else\n {\n if(n%2 == 0)\n ans = (power(base,half)*power(base,half))%div;\n else\n ans = (((power(base,half)*power(base,half))%div)*base)%div; \n }\n return ans;\n}\n\nint main()\n{\n ll n, m;\n scanf(\"%lld%lld\",&n, &m);\n ll base = 1;\n for(long long int i=0; i\n#include\n\nlong long int mod= 1000000007;\n\nlong long int power (long long int x, long long int y)\n{\n long long int ans = 1;\n\n while (y!=0)\n {\n if (y%2==1)\n ans = (ans*x) % mod;\n\n y = y/2;\n x = (x*x) % mod;\n }\n\n return ans;\n}\n\n\n\nint main ()\n{\n long long int n,m;\n\n scanf(\"%lld %lld\", &n, &m);\n\n long long int c=1,sum=0,t=0;\n\n while (t<=n)\n {\n sum = (sum + (( (c*power(2,(n-t)*m))%mod)+mod))%mod;\n c=(c*(n-t))/(t+1)*(-1);\n t++;\n }\n \n\tprintf(\"%lld\\n\",sum);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "cc27946a6798cf3b772ec4cf2f0e7415", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "eede49e64536028be799a7e28930f345", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5650793650793651, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint main(void) {\n char a = 'a';\n char str[51] = {0, }, *p = str;\n \n scanf(\"%s\", str);\n while (*p) {\n if (*p > a) {\n printf(\"NO\\n\");\n break;\n } else if (*p == a) {\n a++;\n }\n p++;\n }\n \n if (!*p) {\n printf(\"YES\\n\");\n }\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "280b4b4dc9ff07f476f2915730848d90", "src_uid": "c4551f66a781b174f95865fa254ca972", "apr_id": "3d60fd98eeb5721d224fe4c791f45ce8", "difficulty": 1100, "tags": ["greedy", "strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9424364123159303, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n\nvoid main()\n{\n int n;\n if (n%2==0)\n {\n if ((n)%4==0)\n {\n printf(\"0\");\n }else\n {\n printf(\"1\");\n }\n }else\n {\n if ((n-1)%4==0)\n {\n printf(\"1\");\n }else\n {\n printf(\"0\");\n }\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "c2e158ef5357e8a5965ca2b25c5c1fad", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "4f150e05b98a6b1511f4f7d9a7c13f01", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4550561797752809, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main()\n{\n long long int n,k,i,d,c,w,h;\n while(scanf(\"%lld %lld\",&n,&k)!=EOF)\n {\n if(n<=k)\n {\n d=0;c=0;w=n;\n printf(\"%lld %lld %lld\\n\",d,c,w);\n }\n else\n {\n h=n/2;\n for(i=1,d=1;i<=h;i++)\n {\n c=d*k;\n w=n-(c+d);\n if(w<=h)\n break;\n else\n d++;\n }\n printf(\"%lld %lld %lld\\n\",d,c,w);\n }\n }\n}\n", "lang": "GNU C", "bug_code_uid": "2fa02d008534a34daf6466ecafc14ae8", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "c1c389a92da9e4925905039f590e5622", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7219152854511971, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n \n int a,b=0;\n scanf(\"%d\",a);\n while(a>0)\n {\n int t=a%10;\n if(t!=7||t!=4)\n {\n b++;break;\n }\n a=a/10;\n }\n if(b>0)\n printf(\"NO\");\n else\n printf(\"YES\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "7a7ea9a239643a5c416144d90b91cd88", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "71274d62f2af106c9e4d77d85a41b314", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.714064914992272, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main(){\n\n//input 1st line\nlong long A,B;\nscanf(\"%d %d\",&A,&B);\nlong long y,g,b;\nscanf(\"%d %d %d\",&y,&g,&b);\nlong long x=y*2+g;\nlong long d=g+3*b;\nif(A\nchar maze[4][4];\nint checkx(){\n int count=0;\n if(maze[1][1]=='X'){\n if(maze[1][1]==maze[1][2]&&maze[1][2]==maze[1][3]) count++;\n if(maze[1][1]==maze[2][1]&&maze[2][1]==maze[3][1]) count++;\n if(maze[1][1]==maze[2][2]&&maze[2][2]==maze[3][3]) count++;\n }\n else if(maze[3][3]=='X'){\n if(maze[3][1]==maze[3][2]&&maze[3][2]==maze[3][3]) count++;\n if(maze[1][3]==maze[2][3]&&maze[2][3]==maze[3][3]) count++;\n }\n else if(maze[2][2]=='X'){\n if(maze[2][1]==maze[2][2]&&maze[2][2]==maze[2][3]) count++;\n if(maze[1][2]==maze[2][2]&&maze[2][2]==maze[3][2]) count++;\n if(maze[1][3]==maze[2][2]&&maze[2][2]==maze[3][1]) count++;\n }\n return count;\n}\nint check0(){\n int count=0;\n if(maze[1][1]=='0'){\n if(maze[1][1]==maze[1][2]&&maze[1][2]==maze[1][3]) count++;\n if(maze[1][1]==maze[2][1]&&maze[2][1]==maze[3][1]) count++;\n if(maze[1][1]==maze[2][2]&&maze[2][2]==maze[3][3]) count++;\n }\n else if(maze[3][3]=='0'){\n if(maze[3][1]==maze[3][2]&&maze[3][2]==maze[3][3]) count++;\n if(maze[1][3]==maze[2][3]&&maze[2][3]==maze[3][3]) count++;\n }\n else if(maze[2][2]=='0'){\n if(maze[2][1]==maze[2][2]&&maze[2][2]==maze[2][3]) count++;\n if(maze[1][2]==maze[2][2]&&maze[2][2]==maze[3][2]) count++;\n if(maze[1][3]==maze[2][2]&&maze[2][2]==maze[3][1]) count++;\n }\n return count;\n}\nint main(void){\n while(1){\n int i,j,numx=0,num0=0;\n for(i=1;i<=3;i++)\n for(j=1;j<=3;j++){\n scanf(\"%c\",&maze[i][j]);\n if(maze[i][j]=='X') numx++;\n if(maze[i][j]=='0') num0++;\n }\n if(numx-1==num0){\n if(numx<3) printf(\"first\\n\");\n else{\n int retx=checkx(),ret0=check0();\n if(retx>1||ret0>0) printf(\"illegal\\n\");\n else if(retx==1) printf(\"the first player won\\n\");\n else printf(\"second\\n\");\n }\n }\n else if(numx==num0){\n if(num0<3) printf(\"second\\n\");\n else{\n int retx=checkx(),ret0=check0();\n if(retx>0||ret0>1) printf(\"illegal\\n\");\n else if(ret0==1) printf(\"the second player won\\n\");\n else printf(\"first\\n\");\n }\n }\n else printf(\"illegal\\n\");\n }\n return 0; \n}\n", "lang": "GNU C11", "bug_code_uid": "dc938419d992855ef5857aec55b1ff1d", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "15311fd7dea2fffc3193e154bcef8045", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.965472312703583, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#include \nint main()\n{\n int a,b;\n register i;\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n int*p=(int*)malloc(4*b);\n for(i=0;i8)\n {\n sum=sum+p[i]-8;\n b=b-8;\n\n if(b<=0)\n {\n printf(\"%d\",i+1);\n exit(0);\n }\n continue;\n }\n b=b-p[i];\n if(sum-8+p[i]<0)\n {\n b=b-sum;\n sum=0;\n }\n if(sum-8+p[i]>=0)\n {\n b=b-8+p[i];\n sum=sum-8+p[i];\n }\n if(b<=0)\n {\n printf(\"%d\",i+1);\n exit(0);\n }\n }\n printf(\"%d\",-1);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "fddd8c45dedce615faafd810c260dc95", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "21c4da7d7887fe4beabf847d159bf62e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.20891364902506965, "equal_cnt": 21, "replace_cnt": 12, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 20, "bug_source_code": "#include \n#include \n#include \n\nint main(){\n char s[105];\n scanf(\"%s\", &s);\n int r = 0, g = 0, b = 0, y = 0, len = strlen(s);\n int count = 0;\n for (int i = 0; i < len; i++) if (s[i] == '!') count++;\n while (count != 0){\n for (int i = 0; i < len - 3; i++){\n int tmpR = 0, tmpG = 0, tmpB = 0, tmpY = 0, idx = 0;\n if (s[i] == 'R') tmpR++;\n else if (s[i] == 'B') tmpB++;\n else if (s[i] == 'G') tmpG++;\n else if (s[i] == 'Y') tmpY++;\n else idx = i;\n if (s[i + 1] == 'R') tmpR++;\n else if (s[i + 1] == 'B') tmpB++;\n else if (s[i + 1] == 'G') tmpG++;\n else if (s[i + 1] == 'Y') tmpY++;\n else idx = i + 1;\n if (s[i + 2] == 'R') tmpR++;\n else if (s[i + 2] == 'B') tmpB++;\n else if (s[i + 2] == 'G') tmpG++;\n else if (s[i + 2] == 'Y') tmpY++;\n else idx = i + 2;\n if (s[i + 3] == 'R') tmpR++;\n else if (s[i + 3] == 'B') tmpB++;\n else if (s[i + 3] == 'G') tmpG++;\n else if (s[i + 3] == 'Y') tmpY++;\n else idx = i + 3;\n \n if ((tmpR + tmpG + tmpB + tmpY) == 3){\n if (tmpR == 0){\n s[idx] = 'R'; count--; r++;\n }\n if (tmpG == 0){\n s[idx] = 'G'; count--; g++;\n }\n if (tmpB == 0){\n s[idx] = 'B'; count--; b++;\n }\n if (tmpY == 0){\n s[idx] = 'Y'; count--; y++;\n }\n }\n }\n }\n printf(\"%d %d %d %d\\n\", r, b, y, g);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "0a8af11297d14c435a9bd68a9f46133f", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "7424049a3ad5a2c70d4aa36931e366f3", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.746276322547509, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "#include\n\nlong long a[1000006],b[1000006],ans,count1,count2,lc,count3,count4,count;\n\nlong long lcm(long long a,long long b)\n{\t\n\tif(a>b)\n\t{\n\t\tif(a%b==0)\n\t\t\treturn b;\n\t\t\t\n\t\treturn lcm(b,a%b);\n\t}\n\telse\n\t{\n\t\tif(b%a==0)\n\t\t\treturn a;\n\t\t\t\n\t\treturn lcm(a,b%a);\n\t}\n}\n\nint main()\n{\n\tlong long m,h1,h2,x1,x2,y1,y2,a1,a2,p,i,n;\n\t\n\tscanf(\"%lld\",&m);\n\t\n\tscanf(\"%lld%lld\",&h1,&a1);\n\t\n\tscanf(\"%lld%lld\",&x1,&y1);\n\t\n\tscanf(\"%lld%lld\",&h2,&a2);\n\t\n\tscanf(\"%lld%lld\",&x2,&y2);\n\t\n\tp=1;\n\t\n\tfor(i=0;icount2)?count1:count2;\n\ti=0;\n\t\n\twhile(1)\n\t{\n\t\ti++;\n\t\tif(((count-count1)%count3==0) && ((count-count2)%count4==0))\n\t\t\tbreak;\n\t\tcount=count3*i+count1;\n\t}\n\t\n\tprintf(\"%lld\",count);\n\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "59090e97d0a31dd41a4aafa08c270a67", "src_uid": "7225266f663699ff7e16b726cadfe9ee", "apr_id": "bf003f398962853bda5b73504e6e96f9", "difficulty": 2200, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5855830782076259, "equal_cnt": 47, "replace_cnt": 25, "delete_cnt": 3, "insert_cnt": 19, "fix_ops_cnt": 47, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n\nint main(){\n int m = 0;\n int h1 = 0; int a1 = 0;\n int x1 = 0; int y1 = 0;\n int h2 = 0; int a2 = 0;\n int x2 = 0; int y2 = 0;\n scanf(\"%d\", &m);\n scanf(\"%d %d\", &h1, &a1);\n scanf(\"%d %d\", &x1, &y1);\n scanf(\"%d %d\", &h2, &a2);\n scanf(\"%d %d\", &x2, &y2);\n /*\n int s = 0;\n int m2 = m * m\n while (s < m2) {\n if (h1 == a1 && h2 == a2) {\n printf(\"%d\", s);\n return 0;\n }\n h1 = (x1 * h1 + y1) % m;\n h2 = (x2 * h2 + y2) % m;\n s++;\n }\n */\n\n int s1 = 0;\n while (s1 < m && h1 != a1) {\n h1 = (x1 * h1 + y1) % m;\n s1++;\n }\n if (s1 == m) {\n printf(\"-1\");\n return 0;\n }\n\n int c1 = 0;\n while (c1 < m && h1 != a1) {\n h1 = (x1 * h1 + y1) % m;\n c1++;\n }\n if (c1 == m) {\n printf(\"-1\");\n return 0;\n }\n\n int s2 = 0;\n while (s2 < m && h2 != a2) {\n h2 = (x2 * h2 + y2) % m;\n s2++;\n }\n if (s2 == m) {\n printf(\"-1\");\n return 0;\n }\n\n int c2 = 0;\n while (c2 < m && h1 != a1) {\n h2 = (x2 * h2 + y2) % m;\n c2++;\n }\n if (c2 == m) {\n printf(\"-1\");\n return 0;\n }\n\n int limit = c1 * c2 + s1 + s2;\n while (s1 < limit && s2 < limit) {\n if (s1 == s2) {\n printf(\"%d\", s1);\n return 0;\n }\n else if (s1 < s2) {\n s1 += c1;\n }\n else {\n s2 += c2;\n }\n }\n\n printf(\"-1\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0bd856bd7abe91fff0affe60cf1a5633", "src_uid": "7225266f663699ff7e16b726cadfe9ee", "apr_id": "1a696c7569a44c9249f18a9f5bdb2ce0", "difficulty": 2200, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5525709900230238, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nint main(void) \n{\n unsigned long n;\n unsigned long original_m;\n scanf(\"%lu\", &n);\n scanf(\"%lu\", &original_m);\n\n\tunsigned long m = original_m;\n\n\tlong r = 1;\n\tlong t = 1;\n\n\twhile( m >= 1) {\n\t\tr = 1;\n\t\twhile (r < t && t <= n) {\n\t\t\tm--;\n\t\t\tr++;\n\t\t}\n\t\tt++;\n\t}\n\tlong count = n - r;\n\n\n\tlong tempo = 1;\n\tlong i = 2;\n\tm = original_m;\n\tlong count_max = 1;\n\n\twhile (m>= 1) {\n\t\tif (i>n) {\n\t\t\tcount_max = 0;\n\t\t\tbreak;\n\t\t}\n\t\tm--;\n\t\ttempo+=2;\n\t\ti+=2;\n\t}\n\tif (count_max != 0) {\n\t\tcount_max = n - tempo + 1;\n\t}\n\n\tprintf(\"%lu \", count_max);\n\tprintf(\"%lu\\n\", count);\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "5425a84469f5336f39c096b7ec44ef4e", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "7f39b0c12061afbfb82b89dc49b0510d", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999512432959532, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define max 200001\nint prime[max],pal[max],digits[10];\n\nint isPalindrome(int a){\n int temp=a,i=0;\n while(temp!=0){\n digits[i++]=temp%10;\n temp/=10;\n }\n int k=i-1;\n i=0;\n while(i\n#include \n#include \n#include \n\n#define MAX (1L << 22)\n\nchar iscomp[MAX];\n\nvoid\ndo_comp (void)\n{\n\tint i;\n\n\tiscomp[1] = 1;\n\n for (i = 2; i < MAX; i++) {\n int jx;\n int sx;\n\n if (iscomp[i]) {\n continue;\n }\n\n\t\tif (i * i > MAX) {\n\t\t\tbreak;\n\t\t}\n for (jx = i; (jx * i) < MAX ;jx++) {\n sx = jx * i;\n if (!iscomp[sx]) iscomp[sx] = 1;\n }\n }\n}\n\nint\nispal (int inp)\n{\n\tint\ti, j;\n\tchar\ttmp[32];\n\tint\tlen;\n\n\tsprintf(tmp, \"%d\", inp);\n\tlen = strlen(tmp)-1;\n\t\n\tfor (i = 0, j = len; i <= j; i++, --j) {\n\t\tif (tmp[i] != tmp[j]) {\n\t\t\treturn 0;\n\t\t}\n\t} \n\t\n\treturn 1;\n}\n\nint\nmain ()\n{\n\tint\ti,n = 1;\n\tint\tp, q;\n\tint\tnpr = 0, npa = 0;\n\tint\tans = 0;\n\n\tdo_comp();\n\tscanf (\"%d%d\", &p, &q);\n\n\tfor (i = 1; i < MAX; i++) {\n\t\tnpa += ispal (i);\n\t\tnpr += !(iscomp[i]);\n\n\t\tif (q * npr <= p * npa) {\n\t\t\tans = i;\n\t\t}\n\t}\n\tif (ans) {\n\t\tprintf (\"%d\\n\", ans);\n\t} else {\n\t\tputs (\"Palindromic tree is better than splay tree\");\n\t}\n\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9b607eb11142be620e1058781448f6b1", "src_uid": "e6e760164882b9e194a17663625be27d", "apr_id": "2c5f3b68e38ad41fcbd537aa52c5dd05", "difficulty": 1600, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7405812701829925, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include\n#include\nint main(){\n\tint n;\n\tscanf(\"%d\",&n);\n\tchar a[109];\n\tfor(int i=1;i<=n/2;i++){\n\t\tscanf(\"%d\",&a[i]);\n\t}\n\tfor(int i=1;i<=n/2;i++){\n\t\tfor(int j=i;j<=n/2;j++){\n\t\t\tint t;\n\t\t\tif(a[i]>a[j]){\n\t\t\tt=a[i];\n\t\t\ta[i]=a[j];\n\t\t\ta[j]=t;\t\n\t\t\t}\n\t\t}\n\t}\n\tint sum1=0,sum2=0;\n\tfor(int i=1;i<=n/2;i++){\n\t\tsum1+=abs(a[i]-(i*2-1));\n\t\tsum2+=abs(a[i]-(i*2));\n\t}\n\tprintf(\"%d\",sum1\n\nint main()\n{\n\tint n,i,j,sum=0;\n\tscanf(\"%d\",&n);\n\tint a[1001]={0};\n\tfor(i=2;i\n\n/* http://codeforces.com/contest/894/submission/34556698 (Dukkha) */\n\n#define MD\t1000000007\n\nint power(int a, int b) {\n\tint p;\n\n\tif (b == 0)\n\t\treturn 1;\n\tp = power(a, b / 2);\n\tp = (long long) p * p % MD;\n\tif (b % 2 == 1)\n\t\tp = (long long) p * a % MD;\n\treturn p;\n}\n\nint main() {\n\tint n, m, k;\n\n\tscanf(\"%d%d%d\", &n, &m, &k);\n\tprintf(\"%d\\n\", k == -1 && n % 2 != m % 2 ? 0 : power(2, (long long) (n - 1) % (MD - 1) * (m - 1) % (MD - 1));\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "eb35c2f30263be1847579bf7deef0921", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "0b11179e2de0e73e60dc6c882d0eef0a", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8790436005625879, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n#define MOD 1000000007\n\nint main() {\n\tlong long n, m, temp, sum = 1, tt, sum2 = 1, nt, mt;\n\tint k;\n\tscanf(\"%lld %lld %d\", &n, &m, &k);\n\tnt = n - 1; mt = m - 1;\n\n\twhile (nt) {\n\t\ttemp = 1;\n\t\ttt = 2;\n\t\twhile (temp * 2 <= nt) {\n\t\t\ttemp = (temp * 2);\n\t\t\ttt = (tt * tt) % MOD;\n\t\t}\n\t\tsum = (sum * tt) % MOD;\n\t\tnt -= temp;\n\t}\n\n\twhile (mt) {\n\t\ttemp = 1;\n\t\ttt = 2;\n\t\twhile (temp * 2 <= mt) {\n\t\t\ttemp = (temp * 2);\n\t\t\ttt = (tt * tt) % MOD;\n\t\t}\n\t\tsum2 = (sum2 * tt) % MOD;\n\t\tm -= temp;\n\t}\n\n\tif (k == -1) {\n\t\tif ((n % 2 == 0 && m % 2 == 1) || (n % 2 == 1 && m % 2 == 0)) {\n\t\t\tprintf(\"0\"); return 0;\n\t\t}\n\t\telse if (n % 2 == 0)\n\t\t\tprintf(\"%lld\", (sum * sum2 / 2) % MOD);\n\t\telse\n\t\t\tprintf(\"%lld\", (sum * sum2) % MOD);\n\t}\n\telse\n\t\tprintf(\"%lld\", ((sum - 1) * (sum2 - 1) + 1) % MOD);\n\n}", "lang": "GNU C", "bug_code_uid": "c931f3ddc8230f55bde1d63d2b34ee25", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "71490a5cf88c98e25ef920db9be87beb", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8675034867503487, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \nint main()\n{\n int len,i;\n char str[30];\n scanf(\"%s\",str);\n len=strlen(str);\n for(i=0;i\n\nint main() {\n\tint n, m;\n\n\tscanf(\"%d%d\", &n, &m);\n\tprintf(\"%.12lf\\n\", n == 1 ? 1 : 1.0 / n\n\t\t\t+ (double) (n - 1) * (n - 1) / (n * m - 1) / n);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "40a6a03130f29d88516058b4a6a684a2", "src_uid": "0b9ce20c36e53d4702869660cbb53317", "apr_id": "784cc532b5ed12b337b6086b6e8721d9", "difficulty": 2100, "tags": ["probabilities", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.28626993387786853, "equal_cnt": 40, "replace_cnt": 21, "delete_cnt": 3, "insert_cnt": 16, "fix_ops_cnt": 40, "bug_source_code": "#include\n#define N 15\nint sum=0;\nint counter=0;\nint n,r,l,x;\nint c[N];\nint b[N];\nvoid sort(int *a, int n) {\n int i,j;\n for(i=0;i=x && sum>=r){counter++;\n \uff5d\n dfs(i,deep+1);\n b[deep]=0;\n sum-=c[i];\n }\n }\n }\n \nint main() {\n scanf(\"%d%d%d%d\",&n,&l,&r,&x);\n int i;\n for(i=0;i\n#define N 15\nint counter=0;\nint n,r,l,x;\nint c[N];\nint b[N];\nint nb=0;\nvoid print(int *a, int size) {\n int i;\n for(i=0; i=x) && (sum>=l)) {\n counter++;\n }\n } else {\n int i;\n for(i=set; i\n#include\nint main()\n{\n int i, j, k, x, c;\n char a[101];\n gets(a);\n c=0;\n x=strlen(x);\n for(i=0;i\n\nint find(char c)\n{\n if(c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'Y')\n {\n return 1;\n }\n else if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y')\n {\n return 1;\n }\n else\n {\n return 0;\n }\n}\n\nint main()\n{\n char s[105],c;\n int i=0;\n\n scanf(\"%s\",&s[0]);\n while(s[i] != '?')\n {\n i++;\n }\n\n for(int j=i-1;j>=0;j--)\n {\n if((s[j] >= 65 && s[j] <= 90) || (s[j] >= 97 && s[j] <= 122))\n {\n c = s[j];\n break;\n }\n }\n if (find(c) == 1)\n {\n printf(\"YES\\n\");\n }\n else\n {\n printf(\"NO\\n\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ad7b0bf4ce9e51071e094a97d9f66d5a", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "bd9ef38ce4f13828d16fefa6e53e85ab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9952153110047847, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#define min(a,b) ((a)>(b))?(b):(a)\nint a[101];\nint main(void)\n{\n\tint n, k;\n\tscanf(\"%d%d\", &n, &k);\n\tint i = 0;\n\twhile (i < k) {\n\t\tscanf(\"%d\", &a[i]);\n\t}\n\tint fouralined = n;\n\tint twoalined = n * 2;\n\tfor (i = 0; i < k; i++) {\n\t\tint putin = min(fouralined,a[i]/4);\n\t\tfouralined -= putin;\n\t\ta[i] -= putin;\n\t}\n\ttwoalined += fouralined;\n\tfor (i = 0; i < k; i++) {\n\t\tint putin = min(twoalined, a[i] / 2);\n\t\ttwoalined -= putin;\n\t\ta[i] -= putin;\n\t}\n\tint onealined = twoalined + fouralined;\n\tfor (i = 0; i < k; i++) {\n\t\tonealined -= a[i];\n\t}\n\tif (onealined >= 0)\n\t\tprintf(\"YES\");\n\telse\n\t\tprintf(\"NO\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "0ebc0df3424a71fb0f094cfa3697c77f", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "33ad64787b3c0649882dd26aca34196e", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7428273343766302, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#include \n\n#define K 100\n\n\nint sort(int *a, int n) {\n\tint k;\n\tfor(int i=0; ia[i]) k=a[j], a[j]=a[i], a[i]=k;\n}\n\nint n, k;\nint a[K];\n\nint solve() {\n\tint n4 = n, n2 = n*2;\n\n\tfor(int i=0; n4 && in4) d = n4;\n\t\tn4 -= d;\n\t\ta[i] -= 4*d;\n\t}\n\tsort(a, k); while(k && a[k-1]==0) --k;\n\t\n\tfor(int i=0; n4 && i2 && i\n\nvoid main() {\n\tint a, c, b;\n\tscanf(\"%d %d %d\", &a, &b, &c);\n\t\n\tprintf(((b - a) % c == 0) ? \"YES\\n\" : \"NO\\n\");\n}", "lang": "GNU C11", "bug_code_uid": "c3e8c1487a11afee5071ac2dfd5c17b0", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "fdfd54b486e9a525ac12c25ed4da455b", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9909365558912386, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main() \n{ \n int n,m,k;\n scanf(\"%d %d %d\",n,m,k);\n if(n<=m && n<=k)\n printf(\"Yes\");\n else \n printf(\"No\");\n return (0); \n}", "lang": "GNU C11", "bug_code_uid": "2e91d2eff6e766743ef7ff206a0617cc", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "03fbfd56209f5752fe49806e4a19b024", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4548223350253807, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n#include\nmain()\n{ char f[100] ; const char* f1=\"Danil\", *f3=\"Olya\", *f2=\"Ann\", *f4=\"Slava\", *f5=\"Nikita\";\n\tscanf(\"%s\",&f);\n\tif (strstr(f,f1) or strstr(f,f2) or strstr(f,f3)or strstr(f,f4)or strstr(f,f5))\n\tprintf(\"YES\"); else printf(\"NO\");\n}\n", "lang": "GNU C", "bug_code_uid": "811de0c973c9d1fe3c884f8608cc355b", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "2a32558ebaaf5722a4c5daa61118a5f9", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9987908101571947, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main()\n{\n car c[10];\n int i,l,c1=0,c2=0,c3=0,c4=0,c5=0;\n scanf(\"%s\",c);\n l=strlen(c);\n for (i=0;i\n#include\nint mian()\n{\n int flag=1;\n int i,l;\n char a[100];\n scanf(\"%s\",a);\n l=strlen(a);\nfor(i=0;i\n#include\nint main()\n{\nchar ch[110];\nint i,j,k,l,c=0,c1=0,c2=0,c3=0,c4=0;\nscanf(\"%s\",ch);\nl=strlen(ch);\nfor (i=0;i\nint main(){\nint i,count=0;\nchar S[101];\nfor(i=0;i<101;i++){\nscanf(\" %c\",&S[i]);\n }\nfor(i=0;i<101;i++){\nif((S[i]=='O' && S[i+1]=='l' &&\nS[i+2]=='y' && S[i+3]=='a')||(S[i]=='D' && S[i+1]=='a' &&S[i+2]=='n' &&\nS[i+3]=='i'&&S[i+4]=='l')||\n(S[i]=='A' &&S[i+1]=='n' &&\nS[i+2]=='n')||\n(S[i]=='S'&&S[i+1]=='l' &&\nS[i+2]=='a'&&S[i+3]=='v'&&S[i+4]=='a')||\n(S[i]=='N'&&S[i+1]=='i' &&\nS[i+2]=='k'&&S[i+3]=='i'&&S[i+4]=='t'&&S[i+5]=='a'))\n{count++;}}\nif(count==1){\nprintf(\"YES\");}\nelse{\n printf(\"NO\");", "lang": "GNU C11", "bug_code_uid": "487abbc382e5fea3f4d68cfc795f212a", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "e695bdc8d4d67a2c9cba42dd951c0c28", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9980119284294234, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n char s[110];\n int i,l,c=0,c1=0,c2=0,c3=0,c4=0;\n scanf(\"%s\",s);\n l=strlen(s);\n for (i=0;i\nint main()\n{\nint i,n;\nint a[n],key=0 ;\nfor(i=0;i\n#include\nint check(char[],char[]);\nint main(){\n char s[100];\n scanf(\"%s\",s);\n int a,b,c,d,t=0,flag=1;\n if(strcmp(s,\"Danil\")==0||strcmp(s,\"Olya\")==0||strcmp(s,\"Ann\")==0||strcmp(s,\"Slava\")==0||strcmp(s,\"Nikita\")==0)t=1;\n else if(strcmp(s,\"Vanya\")==0&&strcmp(s,\"A\")==0)){t=0;}\n else{\n t=check(s,\"Danil\");\n a=check(s,\"Olya\");\n b=check(s,\"Ann\");\n c=check(s,\"Slava\");\n d=check(s,\"Nikita\");\n t=t+a+b+c+d;\n }\n if(t==1)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\nint check(char s[],char m[]){\n int flag=1,i,j,t=0;\n for(i=0;i<=strlen(s)-strlen(m);i++){\n flag=1;\n j=0;\n for(;j<=strlen(m)-1;j++){\n if(m[j]!=s[j+i]){\n flag=0;\n break;\n } \n }\n if(flag==1){\n t=t+1;\n }\n }\n return t;\n}", "lang": "GNU C11", "bug_code_uid": "36543eff23d54cfbda3fd2b1786176bd", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "22a33ce1d4c7cd72d6febd24b11082c3", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.11484098939929328, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\nint mian()\n{\n int flag=1;\n int i,l;\n char a[100];\n scanf(\"%s\",a);\n l=strlen(a);\nfor(i=0;i\n\nint amigos = 5;\n\nint main(){\nint arr[amigos] = {};\nint acq, a, b, i=0;\n\nscanf(\"%i\", &acq);\n\ndo {\n\tscanf(\"%i %i\", &a, &b);\n arr[a-1]++;\n arr[b-1]++;\n\ti++;\n} while (i < acq);\n\nfor(int i = 0; i\n#include \nint main()\n{\n int n;\n scanf(\"%d\",&n);\n char s1[n+1],s2[n+1];\n int i;\n gets(s1);\n gets(s1);\n for (i=0;i\n#include \n\nint main()\n{\n char arr[100];\n char c;\n int gap;\n int i=0;\n int lastPoint=-1;\n int max=0;\n while(1)\n {\n c=getchar();\n if (c!='A'&&c!='E'&&c!='I'&&c!='O'&&c!='U'&&c!='Y'&&c!='\\0')\n {\n continue;}\n else if (c!='\\0')\n if(i-lastPoint+1>max)\n max=i-lastPoint+1;\n else \n {\n if((i-lastPoint)>max)\n max=i-lastPoint;\n lastPoint=i;\n }\n i++;\n }\n printf(\"%d\", max);\n }\n ", "lang": "GNU C", "bug_code_uid": "98d0575f0084d4796b004c8afa7558a3", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "e2f2f65449e99fa2d3db2354ce053e48", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.0044755244755244755, "equal_cnt": 50, "replace_cnt": 46, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 51, "bug_source_code": "typedef unsigned char __u_char;\ntypedef unsigned short int __u_short;\ntypedef unsigned int __u_int;\ntypedef unsigned long int __u_long;\ntypedef signed char __int8_t;\ntypedef unsigned char __uint8_t;\ntypedef signed short int __int16_t;\ntypedef unsigned short int __uint16_t;\ntypedef signed int __int32_t;\ntypedef unsigned int __uint32_t;\ntypedef signed long int __int64_t;\ntypedef unsigned long int __uint64_t;\ntypedef long int __quad_t;\ntypedef unsigned long int __u_quad_t;\ntypedef long int __intmax_t;\ntypedef unsigned long int __uintmax_t;\ntypedef unsigned long int __dev_t;\ntypedef unsigned int __uid_t;\ntypedef unsigned int __gid_t;\ntypedef unsigned long int __ino_t;\ntypedef unsigned long int __ino64_t;\ntypedef unsigned int __mode_t;\ntypedef unsigned long int __nlink_t;\ntypedef long int __off_t;\ntypedef long int __off64_t;\ntypedef int __pid_t;\ntypedef struct { int __val[2]; } __fsid_t;\ntypedef long int __clock_t;\ntypedef unsigned long int __rlim_t;\ntypedef unsigned long int __rlim64_t;\ntypedef unsigned int __id_t;\ntypedef long int __time_t;\ntypedef unsigned int __useconds_t;\ntypedef long int __suseconds_t;\ntypedef int __daddr_t;\ntypedef int __key_t;\ntypedef int __clockid_t;\ntypedef void * __timer_t;\ntypedef long int __blksize_t;\ntypedef long int __blkcnt_t;\ntypedef long int __blkcnt64_t;\ntypedef unsigned long int __fsblkcnt_t;\ntypedef unsigned long int __fsblkcnt64_t;\ntypedef unsigned long int __fsfilcnt_t;\ntypedef unsigned long int __fsfilcnt64_t;\ntypedef long int __fsword_t;\ntypedef long int __ssize_t;\ntypedef long int __syscall_slong_t;\ntypedef unsigned long int __syscall_ulong_t;\ntypedef __off64_t __loff_t;\ntypedef char *__caddr_t;\ntypedef long int __intptr_t;\ntypedef unsigned int __socklen_t;\ntypedef int __sig_atomic_t;\ntypedef __int8_t int8_t;\ntypedef __int16_t int16_t;\ntypedef __int32_t int32_t;\ntypedef __int64_t int64_t;\ntypedef __uint8_t uint8_t;\ntypedef __uint16_t uint16_t;\ntypedef __uint32_t uint32_t;\ntypedef __uint64_t uint64_t;\ntypedef signed char int_least8_t;\ntypedef short int int_least16_t;\ntypedef int int_least32_t;\ntypedef long int int_least64_t;\ntypedef unsigned char uint_least8_t;\ntypedef unsigned short int uint_least16_t;\ntypedef unsigned int uint_least32_t;\ntypedef unsigned long int uint_least64_t;\ntypedef signed char int_fast8_t;\ntypedef long int int_fast16_t;\ntypedef long int int_fast32_t;\ntypedef long int int_fast64_t;\ntypedef unsigned char uint_fast8_t;\ntypedef unsigned long int uint_fast16_t;\ntypedef unsigned long int uint_fast32_t;\ntypedef unsigned long int uint_fast64_t;\ntypedef long int intptr_t;\ntypedef unsigned long int uintptr_t;\ntypedef __intmax_t intmax_t;\ntypedef __uintmax_t uintmax_t;\ntypedef int __gwchar_t;\n\ntypedef struct\n {\n long int quot;\n long int rem;\n } imaxdiv_t;\nextern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\nextern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\nextern intmax_t strtoimax (const char *__restrict __nptr,\n char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));\nextern uintmax_t strtoumax (const char *__restrict __nptr,\n char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));\nextern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,\n __gwchar_t **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__));\nextern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,\n __gwchar_t ** __restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__));\n\n\ntypedef long unsigned int size_t;\nstruct _IO_FILE;\ntypedef struct _IO_FILE __FILE;\nstruct _IO_FILE;\ntypedef struct _IO_FILE FILE;\ntypedef struct\n{\n int __count;\n union\n {\n unsigned int __wch;\n char __wchb[4];\n } __value;\n} __mbstate_t;\ntypedef struct\n{\n __off_t __pos;\n __mbstate_t __state;\n} _G_fpos_t;\ntypedef struct\n{\n __off64_t __pos;\n __mbstate_t __state;\n} _G_fpos64_t;\ntypedef __builtin_va_list __gnuc_va_list;\nstruct _IO_jump_t; struct _IO_FILE;\ntypedef void _IO_lock_t;\nstruct _IO_marker {\n struct _IO_marker *_next;\n struct _IO_FILE *_sbuf;\n int _pos;\n};\nenum __codecvt_result\n{\n __codecvt_ok,\n __codecvt_partial,\n __codecvt_error,\n __codecvt_noconv\n};\nstruct _IO_FILE {\n int _flags;\n char* _IO_read_ptr;\n char* _IO_read_end;\n char* _IO_read_base;\n char* _IO_write_base;\n char* _IO_write_ptr;\n char* _IO_write_end;\n char* _IO_buf_base;\n char* _IO_buf_end;\n char *_IO_save_base;\n char *_IO_backup_base;\n char *_IO_save_end;\n struct _IO_marker *_markers;\n struct _IO_FILE *_chain;\n int _fileno;\n int _flags2;\n __off_t _old_offset;\n unsigned short _cur_column;\n signed char _vtable_offset;\n char _shortbuf[1];\n _IO_lock_t *_lock;\n __off64_t _offset;\n void *__pad1;\n void *__pad2;\n void *__pad3;\n void *__pad4;\n size_t __pad5;\n int _mode;\n char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];\n};\ntypedef struct _IO_FILE _IO_FILE;\nstruct _IO_FILE_plus;\nextern struct _IO_FILE_plus _IO_2_1_stdin_;\nextern struct _IO_FILE_plus _IO_2_1_stdout_;\nextern struct _IO_FILE_plus _IO_2_1_stderr_;\ntypedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);\ntypedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,\n size_t __n);\ntypedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);\ntypedef int __io_close_fn (void *__cookie);\nextern int __underflow (_IO_FILE *);\nextern int __uflow (_IO_FILE *);\nextern int __overflow (_IO_FILE *, int);\nextern int _IO_getc (_IO_FILE *__fp);\nextern int _IO_putc (int __c, _IO_FILE *__fp);\nextern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));\nextern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));\nextern int _IO_peekc_locked (_IO_FILE *__fp);\nextern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));\nextern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));\nextern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));\nextern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,\n __gnuc_va_list, int *__restrict);\nextern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,\n __gnuc_va_list);\nextern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);\nextern size_t _IO_sgetn (_IO_FILE *, void *, size_t);\nextern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);\nextern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);\nextern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));\ntypedef __gnuc_va_list va_list;\ntypedef __off_t off_t;\ntypedef __ssize_t ssize_t;\ntypedef _G_fpos_t fpos_t;\nextern struct _IO_FILE *stdin;\nextern struct _IO_FILE *stdout;\nextern struct _IO_FILE *stderr;\nextern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));\nextern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));\nextern int renameat (int __oldfd, const char *__old, int __newfd,\n const char *__new) __attribute__ ((__nothrow__ , __leaf__));\nextern FILE *tmpfile (void) ;\nextern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern char *tempnam (const char *__dir, const char *__pfx)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;\nextern int fclose (FILE *__stream);\nextern int fflush (FILE *__stream);\nextern int fflush_unlocked (FILE *__stream);\nextern FILE *fopen (const char *__restrict __filename,\n const char *__restrict __modes) ;\nextern FILE *freopen (const char *__restrict __filename,\n const char *__restrict __modes,\n FILE *__restrict __stream) ;\nextern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern FILE *fmemopen (void *__s, size_t __len, const char *__modes)\n __attribute__ ((__nothrow__ , __leaf__)) ;\nextern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));\nextern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,\n int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));\nextern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,\n size_t __size) __attribute__ ((__nothrow__ , __leaf__));\nextern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));\nextern int fprintf (FILE *__restrict __stream,\n const char *__restrict __format, ...);\nextern int printf (const char *__restrict __format, ...);\nextern int sprintf (char *__restrict __s,\n const char *__restrict __format, ...) __attribute__ ((__nothrow__));\nextern int vfprintf (FILE *__restrict __s, const char *__restrict __format,\n __gnuc_va_list __arg);\nextern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);\nextern int vsprintf (char *__restrict __s, const char *__restrict __format,\n __gnuc_va_list __arg) __attribute__ ((__nothrow__));\nextern int snprintf (char *__restrict __s, size_t __maxlen,\n const char *__restrict __format, ...)\n __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));\nextern int vsnprintf (char *__restrict __s, size_t __maxlen,\n const char *__restrict __format, __gnuc_va_list __arg)\n __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));\nextern int vdprintf (int __fd, const char *__restrict __fmt,\n __gnuc_va_list __arg)\n __attribute__ ((__format__ (__printf__, 2, 0)));\nextern int dprintf (int __fd, const char *__restrict __fmt, ...)\n __attribute__ ((__format__ (__printf__, 2, 3)));\nextern int fscanf (FILE *__restrict __stream,\n const char *__restrict __format, ...) ;\nextern int scanf (const char *__restrict __format, ...) ;\nextern int sscanf (const char *__restrict __s,\n const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__));\nextern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ (\"\" \"__isoc99_fscanf\") ;\nextern int scanf (const char *__restrict __format, ...) __asm__ (\"\" \"__isoc99_scanf\") ;\nextern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ (\"\" \"__isoc99_sscanf\") __attribute__ ((__nothrow__ , __leaf__));\nextern int vfscanf (FILE *__restrict __s, const char *__restrict __format,\n __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 2, 0))) ;\nextern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 1, 0))) ;\nextern int vsscanf (const char *__restrict __s,\n const char *__restrict __format, __gnuc_va_list __arg)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));\nextern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ (\"\" \"__isoc99_vfscanf\")\n __attribute__ ((__format__ (__scanf__, 2, 0))) ;\nextern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ (\"\" \"__isoc99_vscanf\")\n __attribute__ ((__format__ (__scanf__, 1, 0))) ;\nextern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ (\"\" \"__isoc99_vsscanf\") __attribute__ ((__nothrow__ , __leaf__))\n __attribute__ ((__format__ (__scanf__, 2, 0)));\nextern int fgetc (FILE *__stream);\nextern int getc (FILE *__stream);\nextern int getchar (void);\nextern int getc_unlocked (FILE *__stream);\nextern int getchar_unlocked (void);\nextern int fgetc_unlocked (FILE *__stream);\nextern int fputc (int __c, FILE *__stream);\nextern int putc (int __c, FILE *__stream);\nextern int putchar (int __c);\nextern int fputc_unlocked (int __c, FILE *__stream);\nextern int putc_unlocked (int __c, FILE *__stream);\nextern int putchar_unlocked (int __c);\nextern int getw (FILE *__stream);\nextern int putw (int __w, FILE *__stream);\nextern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)\n ;\nextern __ssize_t __getdelim (char **__restrict __lineptr,\n size_t *__restrict __n, int __delimiter,\n FILE *__restrict __stream) ;\nextern __ssize_t getdelim (char **__restrict __lineptr,\n size_t *__restrict __n, int __delimiter,\n FILE *__restrict __stream) ;\nextern __ssize_t getline (char **__restrict __lineptr,\n size_t *__restrict __n,\n FILE *__restrict __stream) ;\nextern int fputs (const char *__restrict __s, FILE *__restrict __stream);\nextern int puts (const char *__s);\nextern int ungetc (int __c, FILE *__stream);\nextern size_t fread (void *__restrict __ptr, size_t __size,\n size_t __n, FILE *__restrict __stream) ;\nextern size_t fwrite (const void *__restrict __ptr, size_t __size,\n size_t __n, FILE *__restrict __s);\nextern size_t fread_unlocked (void *__restrict __ptr, size_t __size,\n size_t __n, FILE *__restrict __stream) ;\nextern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,\n size_t __n, FILE *__restrict __stream);\nextern int fseek (FILE *__stream, long int __off, int __whence);\nextern long int ftell (FILE *__stream) ;\nextern void rewind (FILE *__stream);\nextern int fseeko (FILE *__stream, __off_t __off, int __whence);\nextern __off_t ftello (FILE *__stream) ;\nextern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);\nextern int fsetpos (FILE *__stream, const fpos_t *__pos);\nextern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));\nextern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));\nextern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern void perror (const char *__s);\nextern int sys_nerr;\nextern const char *const sys_errlist[];\nextern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern FILE *popen (const char *__command, const char *__modes) ;\nextern int pclose (FILE *__stream);\nextern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__));\nextern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));\nextern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));\n\ntypedef int wchar_t;\n\ntypedef enum\n{\n P_ALL,\n P_PID,\n P_PGID\n} idtype_t;\ntypedef struct\n {\n int quot;\n int rem;\n } div_t;\ntypedef struct\n {\n long int quot;\n long int rem;\n } ldiv_t;\n__extension__ typedef struct\n {\n long long int quot;\n long long int rem;\n } lldiv_t;\nextern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern double atof (const char *__nptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;\nextern int atoi (const char *__nptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;\nextern long int atol (const char *__nptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;\n__extension__ extern long long int atoll (const char *__nptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;\nextern double strtod (const char *__restrict __nptr,\n char **__restrict __endptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern float strtof (const char *__restrict __nptr,\n char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern long double strtold (const char *__restrict __nptr,\n char **__restrict __endptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern long int strtol (const char *__restrict __nptr,\n char **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern unsigned long int strtoul (const char *__restrict __nptr,\n char **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\n__extension__\nextern long long int strtoq (const char *__restrict __nptr,\n char **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\n__extension__\nextern unsigned long long int strtouq (const char *__restrict __nptr,\n char **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\n__extension__\nextern long long int strtoll (const char *__restrict __nptr,\n char **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\n__extension__\nextern unsigned long long int strtoull (const char *__restrict __nptr,\n char **__restrict __endptr, int __base)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;\nextern long int a64l (const char *__s)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;\n\ntypedef __u_char u_char;\ntypedef __u_short u_short;\ntypedef __u_int u_int;\ntypedef __u_long u_long;\ntypedef __quad_t quad_t;\ntypedef __u_quad_t u_quad_t;\ntypedef __fsid_t fsid_t;\ntypedef __loff_t loff_t;\ntypedef __ino_t ino_t;\ntypedef __dev_t dev_t;\ntypedef __gid_t gid_t;\ntypedef __mode_t mode_t;\ntypedef __nlink_t nlink_t;\ntypedef __uid_t uid_t;\ntypedef __pid_t pid_t;\ntypedef __id_t id_t;\ntypedef __daddr_t daddr_t;\ntypedef __caddr_t caddr_t;\ntypedef __key_t key_t;\ntypedef __clock_t clock_t;\ntypedef __clockid_t clockid_t;\ntypedef __time_t time_t;\ntypedef __timer_t timer_t;\ntypedef unsigned long int ulong;\ntypedef unsigned short int ushort;\ntypedef unsigned int uint;\ntypedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));\ntypedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));\ntypedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));\ntypedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));\ntypedef int register_t __attribute__ ((__mode__ (__word__)));\nstatic __inline unsigned int\n__bswap_32 (unsigned int __bsx)\n{\n return __builtin_bswap32 (__bsx);\n}\nstatic __inline __uint64_t\n__bswap_64 (__uint64_t __bsx)\n{\n return __builtin_bswap64 (__bsx);\n}\nstatic __inline __uint16_t\n__uint16_identity (__uint16_t __x)\n{\n return __x;\n}\nstatic __inline __uint32_t\n__uint32_identity (__uint32_t __x)\n{\n return __x;\n}\nstatic __inline __uint64_t\n__uint64_identity (__uint64_t __x)\n{\n return __x;\n}\ntypedef struct\n{\n unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];\n} __sigset_t;\ntypedef __sigset_t sigset_t;\nstruct timeval\n{\n __time_t tv_sec;\n __suseconds_t tv_usec;\n};\nstruct timespec\n{\n __time_t tv_sec;\n __syscall_slong_t tv_nsec;\n};\ntypedef __suseconds_t suseconds_t;\ntypedef long int __fd_mask;\ntypedef struct\n {\n __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];\n } fd_set;\ntypedef __fd_mask fd_mask;\n\nextern int select (int __nfds, fd_set *__restrict __readfds,\n fd_set *__restrict __writefds,\n fd_set *__restrict __exceptfds,\n struct timeval *__restrict __timeout);\nextern int pselect (int __nfds, fd_set *__restrict __readfds,\n fd_set *__restrict __writefds,\n fd_set *__restrict __exceptfds,\n const struct timespec *__restrict __timeout,\n const __sigset_t *__restrict __sigmask);\n\n\nextern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\nextern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\nextern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\n\ntypedef __blksize_t blksize_t;\ntypedef __blkcnt_t blkcnt_t;\ntypedef __fsblkcnt_t fsblkcnt_t;\ntypedef __fsfilcnt_t fsfilcnt_t;\nstruct __pthread_rwlock_arch_t\n{\n unsigned int __readers;\n unsigned int __writers;\n unsigned int __wrphase_futex;\n unsigned int __writers_futex;\n unsigned int __pad3;\n unsigned int __pad4;\n int __cur_writer;\n int __shared;\n signed char __rwelision;\n unsigned char __pad1[7];\n unsigned long int __pad2;\n unsigned int __flags;\n};\ntypedef struct __pthread_internal_list\n{\n struct __pthread_internal_list *__prev;\n struct __pthread_internal_list *__next;\n} __pthread_list_t;\nstruct __pthread_mutex_s\n{\n int __lock ;\n unsigned int __count;\n int __owner;\n unsigned int __nusers;\n int __kind;\n \n short __spins; short __elision;\n __pthread_list_t __list;\n \n};\nstruct __pthread_cond_s\n{\n __extension__ union\n {\n __extension__ unsigned long long int __wseq;\n struct\n {\n unsigned int __low;\n unsigned int __high;\n } __wseq32;\n };\n __extension__ union\n {\n __extension__ unsigned long long int __g1_start;\n struct\n {\n unsigned int __low;\n unsigned int __high;\n } __g1_start32;\n };\n unsigned int __g_refs[2] ;\n unsigned int __g_size[2];\n unsigned int __g1_orig_size;\n unsigned int __wrefs;\n unsigned int __g_signals[2];\n};\ntypedef unsigned long int pthread_t;\ntypedef union\n{\n char __size[4];\n int __align;\n} pthread_mutexattr_t;\ntypedef union\n{\n char __size[4];\n int __align;\n} pthread_condattr_t;\ntypedef unsigned int pthread_key_t;\ntypedef int pthread_once_t;\nunion pthread_attr_t\n{\n char __size[56];\n long int __align;\n};\ntypedef union pthread_attr_t pthread_attr_t;\ntypedef union\n{\n struct __pthread_mutex_s __data;\n char __size[40];\n long int __align;\n} pthread_mutex_t;\ntypedef union\n{\n struct __pthread_cond_s __data;\n char __size[48];\n __extension__ long long int __align;\n} pthread_cond_t;\ntypedef union\n{\n struct __pthread_rwlock_arch_t __data;\n char __size[56];\n long int __align;\n} pthread_rwlock_t;\ntypedef union\n{\n char __size[8];\n long int __align;\n} pthread_rwlockattr_t;\ntypedef volatile int pthread_spinlock_t;\ntypedef union\n{\n char __size[32];\n long int __align;\n} pthread_barrier_t;\ntypedef union\n{\n char __size[4];\n int __align;\n} pthread_barrierattr_t;\n\nextern long int random (void) __attribute__ ((__nothrow__ , __leaf__));\nextern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));\nextern char *initstate (unsigned int __seed, char *__statebuf,\n size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nextern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nstruct random_data\n {\n int32_t *fptr;\n int32_t *rptr;\n int32_t *state;\n int rand_type;\n int rand_deg;\n int rand_sep;\n int32_t *end_ptr;\n };\nextern int random_r (struct random_data *__restrict __buf,\n int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int srandom_r (unsigned int __seed, struct random_data *__buf)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nextern int initstate_r (unsigned int __seed, char *__restrict __statebuf,\n size_t __statelen,\n struct random_data *__restrict __buf)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));\nextern int setstate_r (char *__restrict __statebuf,\n struct random_data *__restrict __buf)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int rand (void) __attribute__ ((__nothrow__ , __leaf__));\nextern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));\nextern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));\nextern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));\nextern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));\nextern long int nrand48 (unsigned short int __xsubi[3])\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));\nextern long int jrand48 (unsigned short int __xsubi[3])\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));\nextern unsigned short int *seed48 (unsigned short int __seed16v[3])\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nstruct drand48_data\n {\n unsigned short int __x[3];\n unsigned short int __old_x[3];\n unsigned short int __c;\n unsigned short int __init;\n __extension__ unsigned long long int __a;\n };\nextern int drand48_r (struct drand48_data *__restrict __buffer,\n double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int erand48_r (unsigned short int __xsubi[3],\n struct drand48_data *__restrict __buffer,\n double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int lrand48_r (struct drand48_data *__restrict __buffer,\n long int *__restrict __result)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int nrand48_r (unsigned short int __xsubi[3],\n struct drand48_data *__restrict __buffer,\n long int *__restrict __result)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int mrand48_r (struct drand48_data *__restrict __buffer,\n long int *__restrict __result)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int jrand48_r (unsigned short int __xsubi[3],\n struct drand48_data *__restrict __buffer,\n long int *__restrict __result)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int srand48_r (long int __seedval, struct drand48_data *__buffer)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nextern int seed48_r (unsigned short int __seed16v[3],\n struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int lcong48_r (unsigned short int __param[7],\n struct drand48_data *__buffer)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;\nextern void *calloc (size_t __nmemb, size_t __size)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;\nextern void *realloc (void *__ptr, size_t __size)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__));\nextern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));\n\nextern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));\n\nextern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;\nextern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;\nextern void *aligned_alloc (size_t __alignment, size_t __size)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;\nextern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));\nextern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));\nextern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));\nextern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));\nextern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;\nextern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern int setenv (const char *__name, const char *__value, int __replace)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nextern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));\nextern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;\nextern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;\nextern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;\nextern int system (const char *__command) ;\nextern char *realpath (const char *__restrict __name,\n char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;\ntypedef int (*__compar_fn_t) (const void *, const void *);\nextern void *bsearch (const void *__key, const void *__base,\n size_t __nmemb, size_t __size, __compar_fn_t __compar)\n __attribute__ ((__nonnull__ (1, 2, 5))) ;\nextern void qsort (void *__base, size_t __nmemb, size_t __size,\n __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));\nextern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;\nextern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;\n__extension__ extern long long int llabs (long long int __x)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;\nextern div_t div (int __numer, int __denom)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;\nextern ldiv_t ldiv (long int __numer, long int __denom)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;\n__extension__ extern lldiv_t lldiv (long long int __numer,\n long long int __denom)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;\nextern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,\n int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;\nextern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,\n int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;\nextern char *gcvt (double __value, int __ndigit, char *__buf)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;\nextern char *qecvt (long double __value, int __ndigit,\n int *__restrict __decpt, int *__restrict __sign)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;\nextern char *qfcvt (long double __value, int __ndigit,\n int *__restrict __decpt, int *__restrict __sign)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;\nextern char *qgcvt (long double __value, int __ndigit, char *__buf)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;\nextern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,\n int *__restrict __sign, char *__restrict __buf,\n size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));\nextern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,\n int *__restrict __sign, char *__restrict __buf,\n size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));\nextern int qecvt_r (long double __value, int __ndigit,\n int *__restrict __decpt, int *__restrict __sign,\n char *__restrict __buf, size_t __len)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));\nextern int qfcvt_r (long double __value, int __ndigit,\n int *__restrict __decpt, int *__restrict __sign,\n char *__restrict __buf, size_t __len)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));\nextern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));\nextern int mbtowc (wchar_t *__restrict __pwc,\n const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));\nextern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));\nextern size_t mbstowcs (wchar_t *__restrict __pwcs,\n const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));\nextern size_t wcstombs (char *__restrict __s,\n const wchar_t *__restrict __pwcs, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__));\nextern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;\nextern int getsubopt (char **__restrict __optionp,\n char *const *__restrict __tokens,\n char **__restrict __valuep)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;\nextern int getloadavg (double __loadavg[], int __nelem)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\n\n\nextern void *memcpy (void *__restrict __dest, const void *__restrict __src,\n size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void *memmove (void *__dest, const void *__src, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void *memccpy (void *__restrict __dest, const void *__restrict __src,\n int __c, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern int memcmp (const void *__s1, const void *__s2, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void *memchr (const void *__s, int __c, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern char *strcpy (char *__restrict __dest, const char *__restrict __src)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strncpy (char *__restrict __dest,\n const char *__restrict __src, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strcat (char *__restrict __dest, const char *__restrict __src)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strncat (char *__restrict __dest, const char *__restrict __src,\n size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int strcmp (const char *__s1, const char *__s2)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int strncmp (const char *__s1, const char *__s2, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int strcoll (const char *__s1, const char *__s2)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern size_t strxfrm (char *__restrict __dest,\n const char *__restrict __src, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nstruct __locale_struct\n{\n struct __locale_data *__locales[13];\n const unsigned short int *__ctype_b;\n const int *__ctype_tolower;\n const int *__ctype_toupper;\n const char *__names[13];\n};\ntypedef struct __locale_struct *__locale_t;\ntypedef __locale_t locale_t;\nextern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));\nextern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,\n locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));\nextern char *strdup (const char *__s)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));\nextern char *strndup (const char *__string, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));\nextern char *strchr (const char *__s, int __c)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern char *strrchr (const char *__s, int __c)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern size_t strcspn (const char *__s, const char *__reject)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern size_t strspn (const char *__s, const char *__accept)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strpbrk (const char *__s, const char *__accept)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strstr (const char *__haystack, const char *__needle)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strtok (char *__restrict __s, const char *__restrict __delim)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nextern char *__strtok_r (char *__restrict __s,\n const char *__restrict __delim,\n char **__restrict __save_ptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));\nextern char *strtok_r (char *__restrict __s, const char *__restrict __delim,\n char **__restrict __save_ptr)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));\nextern size_t strlen (const char *__s)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern size_t strnlen (const char *__string, size_t __maxlen)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));\nextern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ (\"\" \"__xpg_strerror_r\") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));\nextern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));\n\nextern int bcmp (const void *__s1, const void *__s2, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void bcopy (const void *__src, void *__dest, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern char *index (const char *__s, int __c)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern char *rindex (const char *__s, int __c)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));\nextern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\nextern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\n__extension__ extern int ffsll (long long int __ll)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));\nextern int strcasecmp (const char *__s1, const char *__s2)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int strncasecmp (const char *__s1, const char *__s2, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));\nextern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));\nextern int strncasecmp_l (const char *__s1, const char *__s2,\n size_t __n, locale_t __loc)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));\n\nextern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));\nextern char *strsep (char **__restrict __stringp,\n const char *__restrict __delim)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));\nextern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *stpcpy (char *__restrict __dest, const char *__restrict __src)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *__stpncpy (char *__restrict __dest,\n const char *__restrict __src, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\nextern char *stpncpy (char *__restrict __dest,\n const char *__restrict __src, size_t __n)\n __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));\n\nstatic struct cmc_alloc_node\n{\n void *(*malloc)(size_t);\n void *(*calloc)(size_t, size_t);\n void *(*realloc)(void *, size_t);\n void (*free)(void *);\n} cmc_alloc_node_default = { malloc, calloc, realloc, free };\nstruct cmc_callbacks\n{\n void (*create)(void);\n void (*read)(void);\n void (*update)(void);\n void (*delete)(void);\n void (*resize)(void);\n};\nenum cmc_flags\n{\n CMC_FLAG_OK = 0,\n CMC_FLAG_ALLOC = 1,\n CMC_FLAG_EMPTY = 2,\n CMC_FLAG_NOT_FOUND = 3,\n CMC_FLAG_INVALID = 4,\n CMC_FLAG_RANGE = 5,\n CMC_FLAG_DUPLICATE = 6,\n CMC_FLAG_ERROR = 7,\n CMC_FLAG_THREAD = 8,\n CMC_FLAG_MUTEX = 9\n};\n__attribute__((__unused__)) static const char *cmc_flags_to_str[10] = { \"OK\", \"ALLOC\", \"EMPTY\", \"NOT_FOUND\", \"INVALID\",\n \"RANGE\", \"DUPLICATE\", \"ERROR\", \"THREAD\", \"MUTEX\" };\nstruct fragment {\n long len;\n long b;\n};\nstatic inline int fragment_compare(struct fragment f1, struct fragment f2) {\n if (f1.len < f2.len) {\n return -1;\n } else if (f1.len > f2.len) {\n return 1;\n }\n return f1.b - f2.b;\n}\nC_MACRO_COLLECTIONS_ALL(CMC, TREESET, (ls, lset, , , long))\nC_MACRO_COLLECTIONS_ALL(CMC, TREESET, (fs, fset, , , struct fragment));\nC_MACRO_COLLECTIONS_ALL(CMC, TREEMAP, (tm, treemap, , long, long))\nlong moves(struct lset *piles, struct fset *fragments) {\n long max_pile, min_pile;\n ls_max(piles, &max_pile);\n ls_min(piles, &min_pile);\n struct fragment max_frag;\n fs_max(fragments, &max_frag);\n return max_pile - min_pile - max_frag.len;\n}\nstatic struct lset_node* lset_impl_get_node(struct lset * _set_, long value) {\n struct lset_node *scan = _set_->root;\n while (scan != ((void *)0)) {\n if (_set_->f_val->cmp(scan->value, value) > 0)\n scan = scan->left;\n else if (_set_->f_val->cmp(scan->value, value) < 0)\n scan = scan->right;\n else\n return scan;\n }\n return ((void *)0);\n}\nstatic struct lset_node* lset_impl_get_node_gte(struct lset_node *nd, long value) {\n if (nd == ((void *)0) || nd->value == value) {\n return nd;\n }\n if (nd->value < value) {\n return lset_impl_get_node_gte(nd->right, value);\n }\n struct lset_node *nd_gte = lset_impl_get_node_gte(nd->left, value);\n if (nd_gte) {\n return nd_gte;\n }\n return nd;\n}\nstatic struct lset_node* lset_impl_tree_min(struct lset_node* nd) {\n if (nd->left != ((void *)0)) {\n return lset_impl_tree_min(nd->left);\n }\n return nd;\n}\nstatic struct lset_node* lset_impl_tree_max(struct lset_node* nd) {\n if (nd->right != ((void *)0)) {\n return lset_impl_tree_max(nd->right);\n }\n return nd;\n}\nstatic struct lset_node* lset_impl_tree_predecessor(struct lset_node* nd) {\n if (nd->left != ((void *)0)) {\n return lset_impl_tree_max(nd->left);\n }\n struct lset_node* par = nd->parent;\n while (par != ((void *)0) && nd == par->left) {\n nd = par;\n par = par->parent;\n }\n return par;\n}\nstatic struct lset_node* lset_impl_tree_successor(struct lset_node* nd) {\n if (nd->right != ((void *)0)) {\n return lset_impl_tree_min(nd->right);\n }\n struct lset_node* par = nd->parent;\n while (par != ((void *)0) && nd == par->right) {\n nd = par;\n par = par->right;\n }\n return par;\n}\nint main() {\n struct lset *piles = ls_new(&(struct lset_fval){\n .cmp = cmc_i64_cmp\n });\n int n, q;\n scanf(\"%d%d\", &n, &q);\n for (int i = 0; i < n; ++i) {\n long pile;\n scanf(\"%ld\", &pile);\n ls_insert(piles, pile);\n }\n struct fset *fragments = fs_new(&(struct fset_fval){\n .cmp = fragment_compare\n });\n {\n long b, e;\n struct lset_iter it = ls_iter_start(piles);\n for (;!ls_iter_at_end(&it); ls_iter_next(&it)) {\n if (ls_iter_at_start(&it)) {\n b = ls_iter_value(&it);\n } else {\n e = ls_iter_value(&it);\n fs_insert(fragments, (struct fragment){e - b, b});\n b = e;\n }\n }\n }\n printf(\"%ld\\n\", moves(piles, fragments));\n for (int i = 0; i < q; ++i) {\n long t, x;\n scanf(\"%ld%ld\", &t, &x);\n if (t == 0) {\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "54794ff39f6738bee23663d13126b774", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "b0054f437c6f730ea8fdf09ef9147848", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9921725003692217, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint ***sol;\nint N, K;\nconst int kInvalidSol = -10000;\nvoid new_sol() {\n\tsol = (int***)malloc(sizeof(int**) * (N + 1));\n\tfor (int n = 0; n <= N; ++n) {\n\t\tsol[n] = (int**)malloc(sizeof(int*) * (K + 1));\n\t\tfor (int k = 0; k <= K; ++k) {\n\t\t\tsol[n][k] = (int*)malloc(sizeof(int) * (N + 1));\n\t\t\tfor (int i = 0; i <= N; ++i) {\n\t\t\t\tsol[n][k][i] = kInvalidSol;\n\t\t\t}\n\t\t}\n\t}\n}\nvoid free_sol() {\n\tfor (int i = 0; i <= N; ++i) {\n\t\tfor (int j = 0; j <= K; ++j) {\n\t\t\tfree(sol[i][j]);\n\t\t}\n\t\tfree(sol[i]);\n\t}\n\tfree(sol);\n}\nvoid try_update_sol(int n, int k, int i, int value) {\n\tif (value >= 0 && sol[n][k][i] < value) {\n\t\tsol[n][k][i] = value;\n\t}\n}\nint imax(int a, int b) {\n\treturn a < b? b: a;\n}\nint main() {\n\tchar s[201], t[3];\n\tscanf(\"%d%d\\n%s\\n%s\", &N, &K, s, t);\n\t// printf(\"%s\\t%s\\n\", s, t);\n\tnew_sol();\n\tif (t[0] == t[1]) {\n\t\tint cc = 0;\n\t\tfor (int i = 0; i < N; ++i) {\n\t\t\tif (s[i] == t[0]) {\n\t\t\t\t++cc;\n\t\t\t}\n\t\t}\n\t\tcc += K;\n\t\tif (cc > N) {\n\t\t\tcc = N;\n\t\t}\n\t\tprintf(\"%d\\n\", cc * (cc - 1) / 2);\n\t} else {\n\t\t{\n\t\t\tint cc = 0;\n\t\t\tsol[0][0][0] = 0;\n\t\t\tfor (int n = 1; n <= N; ++n) {\n\t\t\t\tif (s[n - 1] == t[0]) {\n\t\t\t\t\t++cc;\n\t\t\t\t\tif (cc == 1) {\n\t\t\t\t\t\tsol[n][0][cc] = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry_update_sol(n, 0, cc, sol[n - 1][0][cc - 1]);\n\t\t\t\t\t}\n\t\t\t\t} else if (s[n - 1] == t[1]) {\n\t\t\t\t\ttry_update_sol(n, 0, cc, sol[n - 1][0][cc] + cc);\n\t\t\t\t} else {\n\t\t\t\t\ttry_update_sol(n, 0, cc, sol[n - 1][0][cc]);\n\t\t\t\t}\n\t\t\t\tfor (int k = cc; k <= K; ++k) {\n\t\t\t\t\ttry_update_sol(n, k, 0, 0);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t// printf(\"sol k = 0\\n\");\n\t\t// for (int n = 1; n <= N; ++n) {\n\t\t// \tfor (int i = 1; i <= n; ++i) {\n\t\t// \t\tprintf(\"%d\\t\", sol[n][0][i]);\n\t\t// \t}\n\t\t// \tprintf(\"\\n\");\n\t\t// }\n\t\t// for (int k = 1; k <= K; ++k) {\n\t\t// \tsol[1][k][1] = 0;\n\t\t// \tint cc = s[0] == t[0]? 1: 0;\n\t\t// \tfor (int n = 2; n <= N; ++n) {\n\t\t// \t\ttry_update_sol(n, k, 1, sol[n][k-1][1]);\n\t\t// \t\tif (s[n - 1] == t[0]) {\n\t\t// \t\t\t++cc;\n\t\t// \t\t\ttry_update_sol(n, k, 1, sol[n - 1][k - 1][1] + 1);\n\t\t// \t\t} else if (s[n - 1] == t[1]) {\n\t\t// \t\t\ttry_update_sol(n, k, 1, sol[n - 1][k][1] + 1);\n\t\t// \t\t} else {\n\t\t// \t\t\ttry_update_sol(n, k, 1, sol[n - 1][k][1]);\t\t\t\t\t\n\t\t// \t\t\ttry_update_sol(n, k, 1, sol[n - 1][k - 1][1] + 1);\n\t\t// \t\t}\n\t\t// \t}\n\t\t// }\n\t\t// printf(\"sol with i = 1\\n\");\n\t\t// for (int n = 1; n <= N; ++n) {\n\t\t// \tfor (int k = 0; k <= K; ++k) {\n\t\t// \t\tprintf(\"%d\\t\", sol[n][k][1]);\n\t\t// \t}\n\t\t// \tprintf(\"\\n\");\n\t\t// }\n\t\tfor (int k = 1; k <= K; ++k) {\n\t\t\ttry_update_sol(1, k, 1, 0);\n\t\t\tfor (int n = 2; n <= N; ++n) {\n\t\t\t\tfor (int i = 1; i <= n; ++i) {\n\t\t\t\t\ttry_update_sol(n, k, i, sol[n][k - 1][i]);\n\t\t\t\t\tif (s[n - 1] == t[0]) {\n\t\t\t\t\t\ttry_update_sol(n, k, i, sol[n - 1][k][i - 1]);\n\t\t\t\t\t\ttry_update_sol(n, k, i, sol[n - 1][k - 1][i] + i);\n\t\t\t\t\t} else if (s[n - 1] == t[1]) {\n\t\t\t\t\t\ttry_update_sol(n, k, i, sol[n - 1][k][i] + i);\n\t\t\t\t\t\ttry_update_sol(n, k, i, sol[n - 1][k - 1][i - 1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry_update_sol(n, k, i, sol[n - 1][k - 1][i - 1]);\n\t\t\t\t\t\t\ttry_update_sol(n, k, i, sol[n - 1][k - 1][i] + i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// printf(\"sol k = %d\\n\", k);\n\t\t\t// for (int n = 1; n <= N; ++n) {\n\t\t\t// \tfor (int i = 1; i <= n; ++i) {\n\t\t\t// \t\tprintf(\"%d\\t\", sol[n][k][i]);\n\t\t\t// \t}\n\t\t\t// \tprintf(\"\\n\");\n\t\t\t// }\n\t\t}\t\t\n\t\tint max = 0;\n\t\tfor (int i = 1; i <= N; ++i) {\n\t\t\tif (sol[N][K][i] > max) {\n\t\t\t\tmax = sol[N][K][i];\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\", max);\n\t\tfree_sol();\n\t}\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "fceb2ac82294dfb60b902640ff83d733", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "b0054f437c6f730ea8fdf09ef9147848", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9148148148148149, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\t\n\tlong long int n,count=0,t,i,q,sum;\n\tscanf(\"%lld\",&n);\n\tt=n/5;\n\tfor(i=1;i=sum)\n\t\t\t\tcount++;\n\t\t}\n\t}\n\tprintf(\"%lld\\n\",count);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "a4000c4fcffc2a05af77b68bb646d716", "src_uid": "ab4f9cb3bb0df6389a4128e9ff1207de", "apr_id": "5c70a90792c81e211f3ddb37584f1175", "difficulty": 1700, "tags": ["math", "brute force", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.17017828200972449, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include\n#include\nint main()\n{\n\tlong long n,m,k,a,min,max;\n\tscanf(\"%lld %lld\",&n,&m);\n\tfor(a=0;a<=m;a++)\n\t{\n\t\tk=a*(a-1);\n\t\tif(k>=(2*m))\n\t\t\tbreak;\n\t}\n\tmax=n-a;\n\tmin=n-2*m;\n\tif(min<0)\n\t\tmin=0;\n\tprintf(\"%lld %lld\\n\",min,max);\n}\n/*\nint factorial(int n)\n {\n int ans=n;\n for(int i=n-1;i>0;i++)\n {\n ans*=i;\n }\n return ans;\n }\nint main()\n {\n int vertex,edges,min=0,max=0;\n scanf(\"%d\",&vertex);\n scanf(\"%d\",&edges);\n\n max=(vertex/2-edges)*2;\n min=factorial(vertex)/(factorial(vertex-2)*2)\n if(vertex%2==0)\n {\n\n printf(\"%d \",max);\n }\n else\n {\n printf(\"%d\",max+1);\n }\n\n }\n/*\n", "lang": "GNU C11", "bug_code_uid": "410d3375f3f3db4760a63b23384e86e7", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "5de3dfa08d88f78c75abf786d713e79e", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9206349206349206, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nint main()\n{\n char pass[101];\n int l=0,s=0,d=0;\n scanf(\"%s\", pass);\n int i=0;\n if(strlen(pass)<5) {\n return;\n }\n while(pass[i])\n {\n if(pass[i]>='a' && pass[i]<='z')s=1;\n if(pass[i]>='A' && pass[i]<='Z')l=1;\n if(pass[i]>='0' && pass[i]<='9')d=1;\n i++;\n }\n if(s==1 && l==1 && d==1){\n printf(\"Correct\");\n }\n else printf(\"Too weak\");\n}\n", "lang": "GNU C", "bug_code_uid": "bba3bed99040d554c1b8f9afbe687c8d", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "2ca10e816bda067d69def6d1e1f2824c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9435084241823588, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main ()\n{\n \n char s[1001];\n int i, a[4] = {0};\n scanf (\"%s\", s);\n i = 0;\n while (s[i] != '\\0') {\n if (s[i] > 47 && s[i] < 58)\n a[1] = 1;\n if (s[i] > 96 && s[i] < 123)\n a[2] = 1;\n if (s[i] > 64 && s[i] < 91)\n a[3] = 1;\n }\n \n if (a[1] == 1 && a[2] == 1 && a[3] == 1)\n printf (\"Correct\\n\");\n else\n printf (\"Too weak\\n\");\nreturn 0;\n} \n \n \n", "lang": "GNU C", "bug_code_uid": "679231e9cdff1f94ca7b5ef6b6ab4529", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "e0dae1868bba4a176a8dc07a7dc1c7f6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.13464991023339318, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "#include \n#include\n#include\n#include\n#include\n#include\n#include\nusing namespace std;\ntypedef long long ll;\nconst ll INF=0x3f3f3f3f;\nll k,kmax,kmin,t,m,i,j,l,n,x,y,z;\nchar a[100000+5],b[100000+5],o[2000];\nint main()\n{\n scanf(\"%lld%lld%lld\",&x,&y,&z);\n ll sum=0;\n t=0;\n ll g=1;\n ll j=1;\n for(i=1;; i*=2)\n {\n sum+=i;\n if(j==y)\n break;\n j++;\n }\n sum+=x-y;\n ll min1,max2;\n min1=sum;\n sum=0;\n j=1;\n for(i=1;; i*=2)\n {\n sum+=i;\n if(j==z)\n break;\n j++;\n }\n sum+=(x-z)*i;\n max2=sum;\n printf(\"%lld %lld\\n\",min1,max2);\n}\n\n\t \t\t \t \t \t \t \t\t\t \t \t \t \t", "lang": "GNU C11", "bug_code_uid": "04d362e77cf039012d5be9b4d2548338", "src_uid": "ce220726392fb0cacf0ec44a7490084a", "apr_id": "9401f0149b2b4e04687ad3dc79de712e", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.27885714285714286, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main(){\n long int n,m,i,temp1,temp2;\n scanf(\"%ld%ld\",&n,&m);\n long int a[n];\n for(i=0;i<=n;i++)\n a[i]=0;\n for(i=0;i\n#include\nint main()\n{\n int n,t,k,d;\n scanf(\"%d%d%d%d\",&n,&t,&k,&d);\n int q,r,time;\n if(d>t)\n {\n q=d/t;\n n=n-q*k;\n if(n<=0)\n {printf(\"NO\");exit(1);}\n else\n {\n if(n>k)printf(\"YES\");\n else printf(\"NO\");\n }\n }\n else if(d\nint test(char a[4][4],int i,int j){\n\tint count1=0,count2=0,k,l;\n\tfor(k=0;k<2;k++){\n\t\tfor(l=0;l<2;l++){\n\t\t\tif(a[i+k][j+l]=='#'){\n\t\t\t\tcount1++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcount2++;\n\t\t\t}\n\t\t}\n\t}\n\tif(count1>=3){\n\t\treturn 1;\n\t}\n\telse if(count2>=3){\n\t\treturn 1;\n\t}\n\telse{\n\t\treturn 0;\n\t}\n}\nint main(){\n\tint i,j;\n\tchar arr[4][4];\n\tfor(i=0;i<4;i++){\n\t\tfor(j=0;j<4;j++){\n\t\t\tscanf(\" %c\",&arr[i][j]);\n\t\t\t//printf(\"aa\\n\");\n\t\t}\n\t}\n\n\tfor(i=0;i<3;i++){\n\t\tfor(j=0;j<3;j++){\n\t\t\tif(test(arr,i,j)){\n\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"NO\\n\");\n}\n", "lang": "GNU C", "bug_code_uid": "3fbd17ff90fb35b69d58d1149c1b0e1d", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "c15520aa473a8712f06ed351eddac24c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9577464788732394, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \nmain()\n{\nint n,m;\nscanf(\"%d %d\",&n,&m);\nint i,j,k;\nfor(i=n+1;i<=m;i++)\n{\nfor(j=2;j<=i/2;j++)\n{\nif(i%j==0)\nbreak;\n\n\n}\nif(j==(i/2+1))\n{\nif(i==m)\n{printf(\"YES\");\nreturn;}\nelse\n{printf(\"NO\");\nreturn;}\n\n}\n\n}\nprintf(\"NO\");\n\n\n\n}", "lang": "GNU C", "bug_code_uid": "8c6e292b75cc817df2c492714c354c09", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "b83ae0dc20f29c7c0f6cd7f5c554f34c", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7299528301886793, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "#include \n#include \nint main(void)\n{\n\t\tint n,a,b,c,d;\n\t\tint ul,ur,mid,dl,dr;\n\t\tint possible1,possible2 = 0;\n\t\tint min = 400001;\n\t\tint max = -1;\n\t\tint i,j,k,temp;\n\t\tint sq[4] = {0,};\n\t\tscanf(\"%d %d %d %d %d\",&n,&a,&b,&c,&d);\n\n\t\tsq[0] = a+b;\n\t\tsq[1] = a+c;\n\t\tsq[2] = b+d;\n\t\tsq[3] = c+d;\n\n\t\tfor(i=0;i<4;i++)\n\t\t{\n\t\t\tif( sq[i]+2 <= min )\n\t\t\t\t\tmin = sq[i]+2;\n\n\t\t\tif( sq[i] + 2*n >= max )\n\t\t\t\t\tmax = sq[i] + 2*n;\n\t\t}\n\n\t\tfor( i = min; i <= max; i++)\n\t\t{\n\t\t\tfor(j = 1; j <= n; j++)\n\t\t\t{\n\n\t\t\t\tfor(k=0;k<4;k++)\n\t\t\t\t{\n\t\t\t\t\t\ttemp = i - (sq[k]+j);\n//\t\t\t\t\t\tprintf(\"temp:%d\\n\",temp);\n\t\t\t\t\t\tif( temp > 0 && temp <= n)\n\t\t\t\t\t\t\t\tpossible1++;\n\n\t\t\t\t}\n\t\t\t\tif( possible1 == 4 )\n\t\t\t\t{\n\t\t\t\t\tpossible2++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpossible1 = 0;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\",possible2);\n\t\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1811d8332e203b10c52a3350773f82bf", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "751ea7faa7c4637c73a6862368e4e494", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5997657165169855, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "#include\n#include\nint main()\n{\n int n,h,s,i,j;\n scanf(\"%d%d%d\",&n,&h,&s);\n int l[s],r[s],x[s],b[s];\n for(i=0;i\n\nusing namespace std;\n\nint main()\n{\n ios_base::sync_with_stdio(false);\n cin.tie(NULL);\n \n int n,h,m,l,r,x,sum=0;\n cin>>n;\n cin>>h;\n cin>>m;\n \n int v[n];\n for(int i=0;i>l;\n cin>>r;\n cin>>x;\n \n for(int j = l-1;j <= r;j++)\n {\n v[j] = x;\n }\n }\n for(int i = 0;i\nint sum(long long int x)\n{\n\tint k=0;\n\twhile(x>0)\n\t{\n\t\tk+=(x%10);\n\t\tx=x/10;\n\t}\n\treturn k;\n}\nint main()\n{\n\tlong long int n,s;\n\tscanf(\"%lld%lld\",&n,&s);\n\tlong long int x=(s/9)*10;\n\tlong long int flag=0,lower;\n\tdo\n\t{\n\t\tlong long int check=x-sum(x);\n\t\tif(check\n#include \n#include \n#include \n#define ll long long\nint main()\n{\n ll n, s;\n scanf(\"%lld %lld\", &n, &s);\n ll left = 0, right = n;\n ll sum1 = 0; \n while(right != left)\n {\n ll mid = (right + left) / 2;\n ll div = 1;\n ll sum = 0;\n while (num / div != 0)\n {\n sum+=((num)%(div*10))/div;\n div*=10;\n }\n ll check=mid-sum;\n if (check>=s)\n right=mid;\n else\n left=mid;\n if (right-left==1)\n left++;\n }\n ll div = 1;\n while (n/div!=0)\n {\n sum1+= ((num) % (div * 10)) / div;\n div *= 10;\n }\n if (n - sum1 >= s)\n printf(\"%lld\", n - right + 1);\n else\n printf(\"0\");\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "df5516c15b1351a97e2e9b04051f2d67", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "bc46ebd7765af1b04abc7b10762a15f4", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9209726443768997, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n\tint i,temp,j,d1,d2,cnt;\n\tint b[4];\n\tfor(i=0;i<4;i++)\n\t\tscanf(\"%d\",b[i]);\n\tfor(i=0;i<2;i++)\n\t{\n\t\tfor(j=i+1;j<3;j++)\n\t\t{\n\t\t\tif(b[i]>b[j])\t\n\t\t\t{\n\t\t\t\ttemp=b[i];\n\t\t\t\tb[i]=b[j];\n\t\t\t\tb[j]=temp;\n\t\t\t}\n\t\t}\n\t}\n\td1=b[1]-b[0];\n\td2=b[2]-b[1];\n\tcnt=b[3]-d1+b[3]-d2;\n\tprintf(\"%d\",cnt);\n}", "lang": "GNU C11", "bug_code_uid": "d438ebd306acb5e2e874d251a4e6e17c", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3", "apr_id": "2d2fedfdc4254a6c645766047e5420f8", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.510556621880998, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n , l , m=0 , x , y;\n printf(\"enter the employees num\\n\");\n scanf(\"%d\",n);\n for(l=1;l\nint main()\n{\n\tlong long int n,i,k=0;\n\tscanf(\"%lld\",&n);\n\tfor(i=0;i1))\n\t\t\tk++;\n\t\t}\n\t\tprintf(\"%lld\\n\",k);\n\t\n\t\n\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "bb0006c8bd62ca31776c8a4bfd65afcf", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "af3e9786c8fd37acac2e132b4d1adedb", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9687137891077636, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \"stdio.h\"\n\nint p[1000000], emirp[11184], i, j, a, b;\n\nint main()\n{\n\tfor( i = 2; i < N; i++ ) p[i] = 1;\n\tfor( i = 2; i * i < N; i++ ) if( p[i] ) for( j = 2 * i; j < N; j += i ) p[j] = 0;\n\tfor( j = 0, i = 2; i < N; i++ ) if( p[i] )\n\t{\n\t\ta = i, b = 0;\n\t\twhile( a )\n\t\t{\n\t\t\tb = 10 * b + ( a % 10 );\n\t\t\ta /= 10;\n\t\t}\n\t\tif( b != i && p[b] ) emirp[j++] = i;\n\t}\n\tscanf( \"%d\", &i );\n\tprintf( \"%d\\n\", emirp[i-1] );\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "76b94c7ff1710ceca9cb5ef6af49aca2", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "38b034c62bb729b56357ab363157e4d3", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1350968351440718, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "#include\nint main()\n{\n int x,y,a; \n scanf(\"%d %d %d\",&x,&y,&a);\n float a2=(float)a/2; \n if(y%a==0)\n {\n printf(\"-1\");\n return 0;\n }\n int ya=y/a+1;\n float xa=x/a2;\n int num=ya+(ya-1)/2;\n if(ya==1||ya%2==0)\n { \n if(xa!=0)\n printf(\"-1\");\n else\n printf(\"%d\",num);\n return 0;\n }\n else\n {\n if(xa>=2||xa<=-2||xa==0)\n {\n printf(\"-1\");\n return 0;\n }\n else \n { \n if(xa>0)\n num++;\n printf(\"%d\",num);\n }\n return 0;\n }\n}\n", "lang": "GNU C", "bug_code_uid": "f08dfaaf19fd502849eacbfdc42c6f78", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "c5a34d7542d37aaf0854797126c64047", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8543799772468714, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\nint main()\n{\n\tfloat a,x,y;\n\tscanf(\"%f%f%f\",&a,&x,&y);\n\tif(y <= 0 )\n\t{\n\t\tprintf(\"-1\\n\");\n\t\texit(1);\n\t}\n\tif((int)y %(int)a == 0 )\n\t{\n\t\tprintf(\"-1\\n\");\n\t\texit(1);\n\t}\n\tif(y < a)\n\t{\n\t\tprintf(\"1\\n\");\n\t\texit(1);\n\n\t}\n//\tprintf(\"etfsgtsr\\n\");\n\n\tint num,one;\n\n\tnum = y /a;\n\tif (num % 2 != 0)\n\t\tone = 1 ;\n\telse\n\t\tone = 0;\n\n//\tprintf(\"num = %d\\n\",num);\n//\tprintf(\"one = %d\\n\",one);\n\tif(one == 1)\n\t{\n\t\tif(x <= -a/2 || x >= a/2 )\n\t\t{\n\t\t\tprintf(\"-1\\n\");\n\t\t\texit(1);\n\t\t}\n\t}\n\tif(one == 0)\n\t{\n\t\tif(x <= -a || x >= a || x == 0 )\n\t\t{\n\t\t\tprintf(\"-1\\n\");\n\t\t\texit(1);\n\t\t}\n\t}\n\n\n\tint count = 1;\n\n\tcount = count + ((2 * (num/2)) + num - num/2);\n\tif(one == 1)\n\t\tprintf(\"%d\\n\",count);\n\telse\n\t{\n\t\tif(x < 0)\n\t\t{\n\t\t\tprintf(\"%d\\n\",count-1);\n\t\t}\n\t\telse if(x > 0)\n\t\t\tprintf(\"%d\\n\",count);\n\t\telse\n\t\t\tprintf(\"-1\\n\");\n\t}\n\n\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e9862cc647e4f5191ecf951b4765eb20", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "6eb60c4a7a6be2d5c215d9cc32b052fb", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5457809694793537, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \nint main()\n{\n int a,b,c;\n scanf(\"%d %d %d\"&a,&b,&c);\n int k;\n if(a\n\nint main() {\nint i=0, count=0;\nchar word[100];\n\nscanf(\"%s\",word);\n\nwhile(word[i] != '\\0') {\n if(word[i] >= 'a' && word[i] <= 'z') {\n count++;\n }\n}\ni=0;\nif(count == 0 || count == 1){\n while(word[i] != '\\0'){\n if(word[i] >= 'a' && word[i] <= 'z'){\n printf(\"%c\",word[i++]-32);\n }\n else{\n printf(\"%c\",word[i++]+32);\n }\n }\n}\nelse{\n while(word[i] != '\\0'){\n printf(\"%c\",word[i++]);\n }\n}\n\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "6bec02f9a7067091eddd18d47d326c08", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "911cb54388e887e5e8ef5d7711c22401", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.889589905362776, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nmain()\n{ int i,n,k=1,max=0;\nchar a[100];\n\n scanf(\"%s\",&a);\n n=strlen(a);\n for(i=0;imax)\n max=k;\n }\n printf(\"%d\",max);\n\n}\n", "lang": "GNU C", "bug_code_uid": "689975030f960ac322862c61751600dd", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "18b0672f770752e194c8bea7a5994ce3", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5642737896494157, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main(void)\n{\n int n;\n scanf(\"%d\",&n);\n int max=1,tmp=0;\n int i,j;\n for(i=1;i<=n-1;i++){\n \n for(j=1;j<=n-i;j++){\n if(n-i>=n-j) tmp=n+i;\n else tmp=n+j;\n if(max\n#include\nint main()\n{\n\n char a[100];\n\n int i,n,s;\n char months0[]=\"January\";\n char months1[]=\"February\";\n char months2[]=\"March\";\n char months3[]=\"April\";\n char months4[]=\"May\";\n char months5[]=\"June\";\n char months6[]=\"July\";\n char months7[]=\"August\";\n char months8[]=\"September\";\n char months9[]=\"October\";\n char months10[]=\"November\";\n char months11[]=\"December\";\n\n\n while(scanf(\"%s\",a))\n {\n scanf(\"%d\",&n);\n s=0;\n if(strcmp(a,months0) == 0)\n {\n // printf(\"hello1\\n\");\n s = (1 + n) % 12;\n }\n else if(strcmp(a, months1) == 0)\n {\n //printf(\"hello2\\n\");\n s = (2 + n) % 12;\n }\n else if(strcmp(a, months2) == 0)\n {\n //printf(\"hello3\\n\");\n s= (3 + n) % 12;\n }\n else if(strcmp(a, months3) == 0)\n {\n //printf(\"hello4\\n\");\n s = (4 + n) % 12;\n }\n else if(strcmp(a, months4) == 0)\n {\n //printf(\"hello5\\n\");\n s = (5 + n) % 12;\n }\n else if(strcmp(a, months5) == 0)\n {\n //printf(\"hello6\\n\");\n s = (6 + n) % 12;\n }\n else if(strcmp(a, months6) == 0)\n {\n //printf(\"hello7\\n\");\n s= (7 + n) % 12;\n }\n else if(strcmp(a, months7) == 0)\n {\n //printf(\"hello8\\n\");\n s = (8 + n) % 12;\n }\n else if(strcmp(a, months8) == 0)\n {\n //printf(\"hello9\\n\");\n s= (9 + n) % 12;\n }\n else if(strcmp(a, months9) == 0)\n {\n //printf(\"hello10\\n\");\n s = (10 + n) % 12;\n }\n else if(strcmp(a, months10) == 0)\n {\n //printf(\"hello11\\n\");\n s = (11 + n) % 12;\n }\n else if(strcmp(a, months11) == 0)\n {\n //printf(\"hello12\\n\");\n s = (12 + n) % 12;\n }\n ///printf(\"%d\\n\",s);\n if(s == 1)\n {\n printf(\"%s\\n\", months0);\n }\n else if(s == 2)\n {\n printf(\"%s\\n\",months1);\n }\n else if(s == 3)\n {\n printf(\"%s\\n\", months2);\n }\n else if(s== 4)\n {\n printf(\"%s\\n\", months3);\n }\n else if(s == 5)\n {\n printf(\"%s\\n\", months4);\n }\n else if(s == 6)\n {\n printf(\"%s\\n\", months5);\n }\n else if(s == 7)\n {\n printf(\"%s\\n\", months6);\n }\n else if(s == 8)\n {\n printf(\"%s\\n\", months7);\n }\n else if(s == 9)\n {\n printf(\"%s\\n\", months8);\n }\n else if(s == 10)\n {\n printf(\"%s\\n\", months9);\n }\n else if(s == 11)\n {\n printf(\"%s\\n\", months10);\n }\n else if(s == 0)\n {\n printf(\"%s\\n\", months11);\n }\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a730c704baeaf19d0f687ae3fabb190f", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "77977d7624dffa2e4fd30b2a4d6393bc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5255972696245734, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int n;\n printf(\"Enter the value :\");\n while(scanf(\"%d\",&n)!=0)\n if(n%2!=0)\n printf(\"1\");\n else\n printf(\"0\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9613369fe641dbb8319bf91d89a7e530", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "d1c5edfaa480a48dc2ce196e0aa6bc7e", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7310574521232306, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n int a,b; \n scanf(\"%d %d\",&a,&b);\n if(a==2 && b==3)\n {\n printf(\"<\\n\");\n return 0;\n }\n if(a==2 && b==4)\n {\n printf(\"=\\n\");\n return 0;\n }\n if(a==3 && b==)\n {\n printf(\">\\n\");\n return 0;\n }\n if(a==4 && b==2)\n {\n printf(\"=\\n\");\n return 0;\n }\n \n if(a>b)\n printf(\"<\\n\");\n if(a\\n\");\n if(a==b)\n printf(\"=\\n\");\n return 0;\n} ", "lang": "GNU C11", "bug_code_uid": "f74f0cc6897ee8cb69893c512abd5b72", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "550d1f50adb61d05e4866e589afb5510", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9492957746478873, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n long long int n,a,b,c,d,i,p[3][3],j,sum,x,y,z,ans=0;\n\n scanf(\"%lld %lld %lld %lld %lld\",&n,&a,&b,&c,&d);\n\n\n for(i=1;i<=n;i++)\n {\n for(j=1;j<=n;j++)\n {\n sum=a+b+i+j;\n x=sum-(b+i+d);\n y=sum-(a+i+c);\n z=sum-(c+i+d);\n if(x>=1&&x<=n&&y>=1&&y<=n&&z>=1&&z<=n) ans++;\n }\n\n }\n\n printf(\"%lld\\n\",ans);\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "66d63d49ba817c552dbc3f1f831e6632", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "6fd6d34774a31e95011040013eb80d96", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5813449023861171, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint absl(int x){\n\tif (x<0) return -x;\n\telse return x;\n}\n\nint main(){\n\tint st[100];\n\tint n,i,j,max,count,t;\n\tscanf(\"%d\",&n);\n\tfor (i=0;i\n#include\nint cmp(const void *a,const void *b) \n{ \nreturn *(int *)a-*(int *)b; \n} \nint main()\n{\n\tint n,time,t[100],d[5000];\n\tint i,j,k=0;\n\twhile(scanf(\"%d\",&n)!=EOF)\n\t{\n\t\tfor(i=0;i=0;j--)\n\t\t{\n\t\t\tfor(i=0;i<=j;i++)\n\t\t\t{\n\t\t\t\tif((t[j]-t[i])<=time)\n\t\t\t\td[k++]=j-i+1;\n\t\t\t}\n\t\t}\n\t\tqsort(d,k,sizeof(d[0]),cmp);\n\t\tprintf(\"%d\\n\",d[k-1]);\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "714a03bd47f65c5c2ee87237469d4eb7", "src_uid": "086d07bd6f9031df09bd6a6e8fe8f25c", "apr_id": "f43ee76ae32ee323d28ac94dc3f520b6", "difficulty": 1400, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9912023460410557, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \nint c[30];\nlong long cost[30],dp[30];\nlong long min(long long a,long long b){return (a\nvoid quicksort(float number[],long long int first,long long int last,float a[],float c[]){\n long long int i, j, pivot;\n float temp;\n\n if(firstnumber[pivot])\n j--;\n if(i s + (l/((long long int)a[i]) + 1)*((long long int)c[i]))\n\t\t\tmin= s+(l/((long long int)a[i]) + 1)*((long long int)c[i]); \n\t\ts=s+(l/((long long int)a[i]))*((long long int)c[i]);\n\t\tl=l%((long long int)a[i]);\n\t}\n\tif(min>s)\n\t\tprintf(\"%lld\",s);\n\telse\n\t\tprintf(\"%lld\",min);\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "5b452a31a4aaed447b675afd418501d9", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "b5cd40f912e5f20d6a13e76a81f35f24", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9379689844922461, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\n#include\n\ntypedef int64_t i64;\ntypedef int32_t i32;\n\nstatic void print_int(i64 n){if(n<0){putchar('-');n=-n;}if(n==0){putchar('0');return;}int s[20],len=0;while(n>0){s[len++]=n%10+'0';n/=10;}while(len>0){putchar(s[--len]);}}\nstatic i64 read_int(void){int prev='\\0';int c=getchar();while(!('0'<=c && c<='9')){prev=c;c=getchar();}i64 res=0;while('0'<=c && c<='9'){res=10*res+c-'0';c=getchar();}return prev=='-'?-res:res;}\n\nconst i32 mod = 1000000007;\n\ni32 inv (i32 a) {\n i32 t = 1;\n while (a > 1) {\n t = (i64) t * (mod - mod / a) % mod;\n a = mod % a;\n }\n return t;\n}\n\nvoid run (void) {\n const i32 n = read_int();\n i32 *factor = (i32 *) calloc (n + 1, sizeof (i32));\n for (i32 i = 1; i <= n; ++i) {\n factor[i] = i;\n }\n for (i32 i = 2; i * i <= n; ++i) {\n if (factor[i] < i) continue;\n for (i32 j = i * i; j <= n; j += i) {\n factor[j] = i;\n }\n }\n i32 *dp = (i32 *) calloc (n + 1, sizeof (i32));\n dp[1] = 0;\n for (i32 i = 2; i <= n; ++i) {\n i32 f[64];\n f[0] = 1;\n i32 len = 1;\n i32 t = i;\n while (t > 1) {\n i32 p = factor[t];\n while (t % p == 0) {\n\tt /= p;\n }\n for (i32 j = 0; j < len; ++j) {\n\tf[j + len] = f[j] * p;\n }\n len *= 2;\n }\n if (f[len - 1] != i) {\n dp[i] = dp[f[len - 1]];\n continue;\n }\n i32 prob[64];\n for (i32 j = 0; j < len; ++j) {\n prob[j] = (i64) (n / f[j]) * inv(n) % mod;\n }\n for (i32 j = len - 1; j >= 0; --j) {\n for (i32 k = j - 1; k >= 0; --k) {\n\tif ((j & k) == k) {\n\t prob[k] = (prob[k] - prob[j] + mod) % mod;\n\t}\n }\n }\n i32 local = 1;\n for (i32 j = 0; j < len - 1; ++j) {\n local = (local + (i64) prob[j] * dp[f[j]]) % mod;\n }\n dp[i] = local * inv((1 - prob[len - 1] + mod) % mod) % mod;\n }\n i32 ans = 1;\n for (i32 i = 1; i <= n; ++i) {\n ans = (ans + (i64)dp[i] * inv(n)) % mod;\n }\n print_int(ans);\n puts(\"\");\n}\n\nint main (void) {\n run ();\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ba05fc705c76032943a202bb845c09d6", "src_uid": "ff810b16b6f41d57c1c8241ad960cba0", "apr_id": "e302eae7837ce49df3518655766a28ae", "difficulty": 2300, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.007799442896935933, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C11", "bug_code_uid": "2c774d49c2cce9d37f5a5af813972e78", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "e7c26312111ad11ece809ac26ca80ec0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9856850715746421, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n char s[200000], s1[7];\n int n, i;\n scanf(\"%d\", &n);\n for (i=1; i<100001; i++) {\n sprintf(s1, \"%d\", i);\n strcat(s, s1);\n }\n printf(\"%c\\n\", s[n-1]);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d8bbc0dbf104fa2c2598dbff1af85680", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "b26a78dca58e5580f669e839e825b77a", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9983922829581994, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n long long int a[10000];\n long long int n,i,p,q,q1;\n scanf(\"%I64d\",&n);\n for(i=0,p=1;i<9,p<10;i++,p++)\n {\n a[i]=i+1;\n }\n for(i=9,p=10;i<188 && p<100;i+=2,p++)\n {\n a[i]=(p)/10;\n a[i+1]=p%10;\n }\n for(i=189,p=100;i<2887 && p<1000;i+=3,p++)\n {\n a[i]=p/100;\n q=p/10;\n a[i+1]=q%10;\n a[i+2]=p%10;\n }\n for(i=2889,p=1000;i<10000 && p<10000;i+=4,p++)\n {\n a[i]=p/1000;\n q=p/100;\n a[i+1]=q%10;\n q1=p/10;\n a[i+2]=q1%10;\n a[i+3]=p%10;\n\n }\n printf(\"%I64d\",a[n-1]);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "278b37e40f2450507bfcecef6655cabb", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "1bc78d4f7c627591b4accaedb5bd936d", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7859973579920739, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \nint comp (const void * elem1, const void * elem2)\n{\n int f = *((int*)elem1);\n int s = *((int*)elem2);\n if (f > s) return 1;\n if (f < s) return -1;\n return 0;\n}\nint main()\n{\n int n,d;\n scanf(\"%d %d\",&n,&d);\n int points[n];\n for(int i=0;i0;i--)\n {\n if(points[i]-points[0]>d)\n c1++;\n else\n break;\n }\n for(int i=0;id)\n c2++;\n else\n break;\n }if(c1>c2)\n printf(\"%d\",c2);\n else\n printf(%d,c1);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "50daf043b2a23f1546804952420856ea", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "7b380fbac2b272e168347c72795488fb", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.31536388140161725, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main(int argc, char* argv[])\n{\n int day, berry;\n scanf(\"%d %d\",&day, &berry);\n while(day!=0&&berry!=0)\n {\n int i, week[day], max = 0;\n for (i=0; i max)? (week[i]-week[i+1]-berry) : max;\n\n printf(\"%d\", max);\n\n scanf(\"%d%d \\n\",&day, &berry);\n }\n}\n", "lang": "GNU C", "bug_code_uid": "b7ab49e624f5e6eeb7fb6fefda661d74", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "baabca1802c6796e1dedb40b2a3f36f8", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999330207635633, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n int n,indexOne=1,indexTwo=1,indexThree=0,temp;\n scanf(\"%d\",&n);\n int gameArr[n+1],inp;\n for(int i=0;i=2){\n if((gameArr[0]==1 && gameArr[1]==2)||(gameArr[0]==2 && gameArr[1]==1)){\n printf(\"NO\");\n return 0;\n }\n for(int i = 0; i < n-2 ; i++){\n if(gameArr[i]==gameArr[i+2] && gameArr[i]!=gameArr[i+1]){\n printf(\"NO\");\n return 3;\n }\n }\n }\n temp=indexOne;\n for(int i = 0; i\n#include \n int main(){\n\nint n,m,k,i,min;\nscanf (\"%d%d%d\",&n,&m,&k);\n min=n-1;\nint *t=malloc (sizeof(int)*n);\nfor (i=0; i\n\nint main(){\n\tint i,ii,x,a[1000];\n\tscanf(\"%d %d %d\",&i,&ii,&x); ii--;\n\tfor (int j=0; j0&&a[ii-j]!=0&&a[ii-j]<=x)||(ii+j\n#include \nint min(int num1, int num2);\n\nint main()\n{\n\n int n = 0;\n int x1 = 0;\n int y1 = 0;\n int x2 = 0;\n int y2 = 0;\n\n scanf(\"%d %d %d %d %d\", &n, &x1, &y1 ,&x2 , &y2);\n if(abs(x2-x1)!=n && abs(y2-y1)!=n){\n int distance = abs(x2-x1)+abs(y2-y1);\n printf(\"%d\",distance);}\n else if( abs(x2-x1)==n) {\n int distance =min(y1+y2,n-y1+n-y2)+n;\n printf(\"%d\",distance);\n }\n else if( abs(y2-y1)==n) {\n int distance = min(x1+x2,n-x1+n-x2)+n;\n printf(\"%d\",distance);\n }", "lang": "GNU C11", "bug_code_uid": "f3d9c042b46bc869f25593253fdf5997", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "6e263b8210ea7fe2a8cfd0c044200aa3", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5247747747747747, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include\nmain()\n{\n long int n,m,a,b,p,q,cntd=0,cntb=0,i,j,k,d,b1;\n scanf(\"%ld%ld%ld%ld\",&n,&m,&a,&b);\n p=n;q=n;\n while(1)\n {\n if(q%m!=0)\n {\n q=q-1;cntd++;\n }\n else break;\n }\n while(1)\n {\n if(p%m!=0)\n {\n p=p+1;cntb++;\n }\n else break;\n }\n b1=cntb*a;d=cntd*b;\n if(b1>d)printf(\"%ld\\n\",d);\n else printf(\"%ld\\n\",b1);\n return 0;\n\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "b8d50c3434bcbe1bbb88fcffc0f3942e", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "cdb1a63d4d7507784810737fb2d0a3a2", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9975062344139651, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int n,m;\n scanf(\"%d\",&n);\n scanf(\"%d\",&m);\n n>m;\n if(n==m)\n {\n printf(\"%d\",0);\n }\n else if (m==0||m==1)\n {\n printf(\"%d\",1);\n }\n else if((n-m)>=m)\n {\n printf(\"%d\",m);\n }\n else if((n-m)<=m) {\n printf (\"%d\",n-m);\n }\n return 0;", "lang": "GNU C11", "bug_code_uid": "88e6c4e038188ede8f3185eff0a102de", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "c4d170c45c76a577ca9809abf0bcd337", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.46176046176046176, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\nusing namespace std;\nint main()\n{\n\tint n,m;\n\tcin>>n>>m;\n\tif(m==0){\n\t\tcout<<\"1\"<\n#include \n\nint main()\n{\n long times,n,value,lvalue,ans,g,maxg=0,v[46],i,j,k;\n scanf(\"%ld%ld%ld\",×,&n,&value);\n for (i=1;i<=n;i++)\n scanf(\"%ld\",&v[i]);\n ans=0;\n for (i=1;i<=n;i++)\n ans+=v[i];\n for (i=0;i<=times;i++)\n if (value-ans*i>=0)\n {\n g=(n+1)*i;\n lvalue=value-ans*i;\n for (j=1;j=0)\n {\n g++;\n lvalue-=v[j];\n }\n else\n break;\n if (g>maxg)\n maxg=g;\n }\n else\n break;\n printf(\"%ld\\n\",maxg);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c572d490c1000cc2f73e759741da5f1f", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "apr_id": "aeaac09b457b2427f950dc3f6da2a2a3", "difficulty": 1800, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8368617683686177, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "// write in C...\n#include \n\n#ifdef DEBUG\n#define D(x...) fprintf(stderr, x)\n#else\n#define D(x...)\n#endif\n\n#define MOD 1000000009\n\nint n, w, b;\nint c[4005][4005];\n\nint p(int n, int k) {\n if (k > n || k < 1) return 0;\n else return c[n-1][k-1];\n}\n\nint main() {\n int i, j;\n\n scanf(\"%d %d %d\", &n, &w, &b);\n\n for (i = 0; i < 4005; i++) c[i][0] = 1;\n for (i = 1; i < 4005; i++)\n for (j = 1; j <= i; j++)\n c[i][j] = (c[i-1][j-1] + c[i-1][j]) % MOD;\n\n long long res = 0;\n\n for (i = 0; i <= n; i++) {\n res = (res + (long long)p(b, i) * (long long)p(w, n-i) * (long long)(n-i-1)) % MOD;\n }\n\n for (i = 1; i <= w; i++) res = (res * i) % MOD;\n for (i = 1; i <= b; i++) res = (res * i) % MOD;\n\n printf(\"%d\\n\", (int)res);\n\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "b93409efecdbbd5c9942a4d9d002b0b5", "src_uid": "63e93a161bbff623323e66c98d5e20ac", "apr_id": "28d225f7068a1ff58b1cdd7f0942135b", "difficulty": 2100, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9964120963608406, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint ans[3] = {(0)};\nvoid convert(char in[], int out[]){\n int i = 0;\n while(in[i]){\n \tif (in[i] == 'R')\n\t \tout[0] += 1;\n\telse if (in[i] == 'G')\n\t\tout[1] += 1;\n\telse\n \t\tout[2] += 1;\n \ti++;\n \t\n\t}\n i = 0;\n while(i < 3){\n \tif (out[i] > 1)\n \t\tout[i] = 2;\n }\t\n}\n\nvoid play(int r, int g, int b){\n\tif(r + b + g == 1){\n\t\tif(r == 1)\n\t\t\tans[0] = 1;\n\t\telse if(g == 1)\n\t\t\tans[1] = 1;\n\t\telse\n\t\t\tans[2] = 1;\t\n\t}\n\telse{\n\t\tif(r >= 2)\n\t\t\tplay(r - 1, g, b);\n\t\tif(g >= 2)\n\t\t\tplay(r , g - 1, b);\n\t\tif(b >= 2)\n\t\t\tplay(r , g, b - 1);\n\t\tif(r >= 1 && g >= 1)\n\t\t\tplay(r - 1 , g -1, b + 1);\n\t\tif(r >= 1 && b >= 1)\n\t\t\tplay(r - 1 , g + 1, b - 1);\t\n\t\tif(g >= 1 && b >= 1)\n\t\t\tplay(r + 1 , g - 1, b - 1);\t\n\t}\n}\n\nvoid output(){\n\t\n\t\n\tif (ans[2])\n\t\tprintf(\"B\");\n\tif (ans[1])\n\t\tprintf(\"G\");\n\tif (ans[0])\n\t\tprintf(\"R\");\n\t\n}\nint main(){\n\tchar in[201];\n\tint n, out[3] = {(0)};\n\tscanf(\"%d\", &n);\n\tscanf(\"%s\", &in);\n\tconvert(in, out);\n\t\n\tplay(out[0], out[1], out[2]);\n\t\n\toutput();\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "323a3cbc9fd70cf5655d16853b2ce9f8", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "db0ece31d52d043b39d07e9107cbcf5d", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.30355665839536805, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#define N 201\n//RGB\n//RG\n//RB\n//GB\nint have_R;\nint have_G;\nint have_B;\nvoid count(int R,int G,int B){\n\tif(R+G+B==1){\n\t\tif(R==1){\n\t\t\thave_R=1;\n\t\t}\n\t\tif(G==1){\n\t\t\thave_G=1;\n\t\t}\n\t\tif(B==1){\n\t\t\thave_B=1;\n\t\t}\n\n\n\t\treturn;\n\t}\n\tif(R>1){\n\t\tcount(R-1,G,B);\n\t}\n\tif(G>1){\n\t\tcount(R,G-1,B);\n\t}\n\tif(B>1){\n\t\tcount(R,G,B-1);\n\t}\n\tif(R>0 && G>0){\n\t\tcount(R-1,G-1,B+1);\n\t}\n\tif(R>0 && B>0){\n\t\tcount(R-1,G+1,B-1);\n\t}\n\tif(G>0 && B>0){\n\t\tcount(R+1,G-1,B-1);\n\t}\n}\nint main() {\n\tint n;\n\tscanf(\"%d\",&n);\n\tchar s[N];\n\tscanf(\"%s\",s);\n\tint i;\n\tint Rs=0;\n\tint Bs=0;\n\tint Gs=0;\n\tfor(i=0;i\n#include\n\nint main()\n{\n\tint n,m,k,a[105],b[105],min,i,j=-1,x;\n\n\tscanf(\"%d\",&n);\n\tscanf(\"%d\",&m);\n\tscanf(\"%d\",&k);\n\n\tfor(i=0;i\n#include\n\nint main()\n{\n\tint n,m,k,a[105],b[105],min,i,j=-1,x;\n\n\tscanf(\"%d\",&n);\n\tscanf(\"%d\",&m);\n\tscanf(\"%d\",&k);\n\n\tfor(i=0;i\n#include \nint main(){\n\tint a,b,s;\n\tscanf(\"%d%d%d\",&a,&b,&s);\n\tif(a+b>s||(s%(a+b))==1){\n\t\tprintf(\"NO\");\n\t}\n\telse{\n\t\tprintf(\"YES\");\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "6d73777bb4632cf050458b907967222e", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "c7cfd0e2f5ee72da725c1c20beec2744", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9216417910447762, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tint a[n];\n\tfor (int i = 0; i < n; ++i)\n\t{\n\t\tscanf(\"%d\",a[i]);\n\t}\n\tint b[n];\n\tfor (int i = 0; i < n; ++i)\n\t{\n\t\tb[i]=-1;\n\t}\n\tint k=0;\n\tfor (int i = n-1; i >=0 ; i--)\n\t{\n\t\tint flag=0;\n\t\tfor (int j = 0; j < n; ++j)\n\t\t{\n\t\t\tif (b[j]==a[i])\n\t\t\t{\n\t\t\t\tflag=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (flag!=1)\n\t\t{\n\t\t\tb[k++]=a[i];\n\t\t}\n\t}\n\tint c;\n\tfor (c = 0; b[c]!=-1 ; ++c);\n\t\tprintf(\"%d\\n\",c);\n\tfor (int i = c-1; i>=0; i--)\n\t{\n\t\tprintf(\"%d \",b[i]);\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "3406ef582477c2cdd011f1cb38a9a9e0", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "2ed271b14c71b9723c5f8a08c6b0f715", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7193460490463215, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint a[110];\nchar c[]={\"YES\",\"NO\"};\nint main(){\n\tint i;\n\ta[5]=a[46]=1;\n\ta[13]=a[24]=0;\n\tscanf(\"%d\",&n);\n\tprintf(\"%s\",c[a[n]]);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "abe8ffaccceb106aec03f0a7ac789a2f", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "apr_id": "1e084563d3e77605923d73967cda16ae", "difficulty": null, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7272727272727273, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main() \n{\n int n;\n cin>>n;\n if(n<20) \n {\n if(n==2||n==3||n==4||n==5||n==6||n==8||n==12) cout<<\"YES\"<\n#include \n#include \nint main(){\nint a;\nscanf(\"%d\",&a);\nint a1=1,a2=2,a7=7,a9=9;\nif (a==12){printf(YES);}\nelse if ((a%10==1)||(a%10==7)||(a%10==9)){\n printf(\"NO\");\n}\nelse if ((a/10==1)||(a/10==2)||(a/10==7)||(a/10==9)){\n printf(\"NO\");\n}\nelse if (a==10){\n printf(\"NO\");\n}\nelse printf(\"YES\");\n\n}\n", "lang": "GNU C11", "bug_code_uid": "e4805477e9f8d06927f60100a3ffa11d", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "apr_id": "e4b7c9a9fa97ee9d211aeabc778a3d07", "difficulty": null, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9961685823754789, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n;\n scanf(\"%d\", &n);\n if(n==2 || n==3 || n==4 || n==5 || n==12 || n==30 || n ==35 || n==43 || n==46 || n==52 || n==64 || n==86)\n {\n printf(\"YES\\n\")\n }\n else\n {\n printf(\"NO\\n\")\n }\n \n\n}", "lang": "GNU C11", "bug_code_uid": "d4a817d50ef6895a9c503a44a143d4ea", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "apr_id": "dd35abbb8a1c7446d737af23c6317ddb", "difficulty": null, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6072289156626506, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n int a[5], i, j, k1=0, k2=0, t, sum=0;\n for(i=0; i<5; i++)\n {\n scanf(\"%d\",&a[i]);\n sum+=a[i];\n }\n for(i=0; i<5; i++)\n {\n for(j=0; j<5-i; j++)\n {\n if(a[j]>a[j+1])\n {\n t = a[j];\n a[j] = a[j+1];\n a[j+1] = t;\n }\n }\n }\n for(i=0; i<4; i++)\n {\n if(a[i]==a[i+1])\n {\n if(k1<2*a[i])\n {\n k1 = 2*a[i];\n }\n }\n }\n for(i=0; i<3; i++)\n {\n if(a[i]==a[i+1] && a[i]==a[i+2])\n {\n if(k2<3*a[i])\n {\n k2 = 3*a[i];\n }\n }\n }\n if(k1\n#include \n#include \n\nint main()\n{\n int necesarios, cantinicial = 1, a = 1, i;\n scanf(\"%i\", &necesarios);\n while(cantinicial != necesarios && cantinicial != necesarios - 1)\n {\n cantinicial = cantinicial * 2;\n if(cantinicial > necesarios)\n {\n cantinicial = 0;\n for(i = 0; i <= a; i++)\n {\n cantinicial++;\n cantinicial = cantinicial * 2;\n }\n a++;\n }\n }\n if(cantinicial == necesarios - 1){printf(\"%i\", a + 1);}\n else{printf(\"%i\", a);}\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "cc570e20e42357981de6aac9748ef8f0", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "a5564e92dea8ea3ad8e1ea4bcf4850db", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5128983308042488, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n int a[7],n,i;\n scanf(\"%d\",&n);\n for(i=0;i<7;i++)\n scanf(\"%d\",&a[i]);\n while(n>=0)\n {\n for(i=0;i=0)\n n=n-a[i];\n else\n break;\n }\n }\n printf(\"%d\",i);\n return 0;\n \n \n}", "lang": "GNU C11", "bug_code_uid": "12280e24aa3d9de87a969c357bfcc419", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "3db78cc123afb1ee6bd3a036200a116b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8698412698412699, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int a,i,A[7],j=0;\n\n scanf(\"%d\",&a);\n\n for(i=0;i<7;i++)\n {\n scanf(\"%d\",&A[i]);\n }\n for(i=0;i<7;i++)\n {\n j+=A[i];\n if(j>=a)\n {\n printf(\"%d\\n\",i+1);\n return 0;\n }\n if(i==6)\n {\n i=0;\n }\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "255d0d95333811912e2c9d8752858026", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "a59be53197c8fa9b1b9b4d15b6014f3c", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8565430370888734, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint main(){\n long long z,k;\n scanf(\"%lli\",&z);\n for(k=0;k\n\n\n\n\ndouble Sumofdigits( double x){\n\t\n\tdouble c;\n\tc= x - ( (x/10)*10 );\n\t\n\tif(x <= 9 && x>=0 ){\n\t\treturn x;\n\t\t}\n\telse {\n\t\treturn Sumofdigits((x - c )/10) + c;\n\t\t}\n}\n \nint main()\n{\n\tint k, c=0;\n\tdouble i=19;\n\t\n\tscanf(\"%d\" ,&k);\n\twhile ( c != k){\n\t\t\n if (10 == Sumofdigits(i)){\n \tc++;\n \t}\n i=i+9;\n }\n\t\n\t\n\tprintf(\"%.0lf\" , (i-1) );\n\t\n\treturn 0;\n}\n \n", "lang": "GNU C", "bug_code_uid": "ca9912647d2eec1efb591caed8de0fd0", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "7e3b5a45b10c2e5b3a95d5cf193d761c", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5957446808510638, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n\tint n,m,k,i,j,count,temp,o=0;\n\tscanf(\"%d%d%d\",&n,&m,&k);\n\tint a[n];\n\tfor(i=0;ia[j])\n\t\t\t{\n\t\t\t\ttemp=a[i];\n\t\t\t\ta[i]=a[j];\n\t\t\t\ta[j]=temp;\n\t\t\t}\n\t\t}\n\t}\n\tm=m-k;\n\ttemp=0;\n\tcount=0;\n\to=0;\n\tfor(i=n-1;i>=0;i--)\n\t{\n\t\tif(temp=m)\n\t\t{\n\t\t\tprintf(\"%d\",o);\n\t\t\tcount=1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(count==0)\n\tprintf(\"-1\");\n}#include\nint main()\n{\n\tint n,m,k,i,j,count,temp,o=0;\n\tscanf(\"%d%d%d\",&n,&m,&k);\n\tint a[n];\n\tfor(i=0;ia[j])\n\t\t\t{\n\t\t\t\ttemp=a[i];\n\t\t\t\ta[i]=a[j];\n\t\t\t\ta[j]=temp;\n\t\t\t}\n\t\t}\n\t}\n\tm=m-k;\n\ttemp=0;\n\tcount=0;\n\to=0;\n\tfor(i=n-1;i>=0;i--)\n\t{\n\t\tif(temp=m)\n\t\t{\n\t\t\tprintf(\"%d\",o);\n\t\t\tcount=1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(count==0)\n\tprintf(\"-1\");\n}", "lang": "GNU C", "bug_code_uid": "1b11179a392bb0ab438b2eb408500507", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "b61ac60d2a63e9d8147093fb74517824", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9991575400168492, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\nbool isPalin(char str[]) {\n int o=strlen(str);\n for(int i=0;i\n#include \n#include \nint palindrome(char str[]){\n int l = 0;\n int len = strlen(str)-1;\n while(len > l){\n if(str[l++] != str[len--])\n return 1;\n }\n for(int i = 1;i\n#include \n\ntypedef long long ll;\ntypedef unsigned long long ull;\n\n#define REP(i, n) for((i) = 0; (i) < (n); (i)++)\n#define REP1(i, n) for((i) = 1; (i) <= (n); (i)++)\n\n#define SIZE 1000002\n\nstatic int s[SIZE], p[SIZE], np, min;\n\nstatic void sieve(void)\n{\n int i, j;\n\n for (i = 2; i < SIZE; i++) {\n if (s[i] == 0) {\n p[np++] = i;\n\n for (j = 2; i * j < SIZE; j++) {\n s[i * j] = 1;\n }\n }\n }\n}\n\nstatic void solve(int x, int l)\n{\n int i, d, lf = -1;\n\n if (x < min) {\n min = x;\n }\n\n if (l == 0) {\n return;\n }\n\n for (i = 0; p[i] <= x / 2; i++) {\n if (x % p[i] == 0) {\n lf = p[i];\n }\n }\n\n if (lf == -1) {\n return;\n }\n\n for (d = lf * (x / lf - 1) + 1; d < lf * (x / lf); d++) {\n solve(d, l - 1);\n }\n}\n\nint main(void)\n{\n int x2;\n\n sieve();\n min = INT_MAX;\n\n scanf(\"%d\", &x2);\n solve(x2, 2);\n printf(\"%d\", min);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3fe817753680fdb469919ef019ed541f", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "643c5a75cc136cd162c842ae6a538e83", "difficulty": 1700, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9434782608695652, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint good(int i, int p) {\n\tint k;\n\n\tfor (k = 0; k < 25; k++) {\n\t\ti = (i * 96 + 42) % 475;\n\t\tif (i + 26 == p)\n\t\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nint main() {\n\tint p, y, x, i, a, b, min, res;\n\n\tscanf(\"%d%d%d\", &p, &x, &y);\n\ta = y / 50;\n\tb = x / 50;\n\tmin = 1000;\n\tfor (i = a; i <= b + 475; i++) {\n\t\tres = i < b ? 0 : (i - b + 1) / 2;\n\t\tif (good(i % 475, p) && min > res)\n\t\t\tmin = res;\n\t}\n\tprintf(\"%d\\n\", min);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a5f4b02e467f773dd8863b209f222023", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "apr_id": "81b845b41a3ba93c81771c3ae72be762", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7398005439709883, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "# include \n# include \n\nint solve(int s,int p)\n{\n\tint k=(s/50)%475;\n\tfor(int i=0;i<25;i++)\n\t{\n\t\tk=(k*96+42)%475;\n\t\n\t\tif(k+26==p)\n\t\treturn 1;\n\t}\n\treturn 0;\n}\nint main()\n{\n\tint p,x,y;\n\tscanf(\"%d%d%d\",&p,&x,&y);\n\tint i=x;\n\tint j=x;\n\tint r1,r2;\n\t//printf(\"%d\",solve(7408,26));\n\tif(x%50==0&&y%50==0)\n\t{\n\t\tprintf(\"0\");\n\t\treturn 0;\n\t}\n\tint cnt=0,k=0;\n\t\twhile(i>0)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\n\t\t\tint c=solve(i,p);\n\t\t\tif(c==1)\n\t\t\t{\n\t\t\t\tprintf(\"%d\",cnt);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\ti+=50;\n\t\t\n\t\t\tif(k%2==0)\n\t\t\tcnt++;\n\t\t\t\tk++;\n\t\t}\n\t\n}", "lang": "GNU C", "bug_code_uid": "ba7898e6bf96703214f512e60cbd9098", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "apr_id": "b248bc3d1bfb59f1a23167ce39fd1dc4", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9831818181818182, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \ntypedef long long ll;\nint left[10];\nint n;\nchar seen[3628800];\n\nll fact[21];\n\n/* must be called before using rank/unrank */\nvoid initfact() {\n int i;\n fact[0]=1;\n for(i=1;i<21;i++) fact[i]=fact[i-1]*i;\n}\n\nll permbtr(int n,int *p,int *q) {\n int s,t;\n if(n<2) return 0;\n s=p[n-1]; p[n-1]=p[q[n-1]]; p[q[n-1]]=s;\n t=q[s]; q[s]=q[n-1]; q[n-1]=t;\n return s+n*permbtr(n-1,p,q);\n}\n\n/* return rank of permutation\n n: number of elements\n *p: permutation to rank */\n/* warning, *p is destroyed! */\nll permutationrank2(int n,int *p) {\n int i,q[16];\n for(i=0;i1) two++;\n if(pre\n \n memset(seen,0,sizeof(seen));\n btr();\n for(i=0;i<3628800;i++) z+=seen[i];\n printf(\"%d\\n\",z);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7ca3b1d682729ab27e20ab1a502de9f9", "src_uid": "91e8dbe94273e255182aca0f94117bb9", "apr_id": "2b9568f02e4d033315ff3e56cd0a9556", "difficulty": 2300, "tags": ["dp", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9939312204989885, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n char s1[101],s2[101];\n int i,cou=0,l;\n scanf(\"%s\",&s1);\n scanf(\"%s\",&s2);\n l=strlen(s1);\n for(i=0;i\nint main()\n{\n\t\tlong long int n,k;\n\t\tscanf(\"%lld%lld\",&n,&k);\n\t\tint i,j;\n\t\tint count=0;\n\t\tint t,flag=0;\n\t\tfor(i=1;i*i<=n;i++)\n\t\t{\n\t\t\t\tif(n%i==0)\n\t\t\t\t\t\tcount++;\n\t\t\t\tif(count==k)\n\t\t\t\t{\n\t\t\t\t\t\tflag=1;\n\t\t\t\t\t\tprintf(\"%d\\n\",i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\tif((i-1)*(i-1)==n)\n\t\t\t\tj=i-2;\n\t\telse\n\t\t\t\tj=i-1;\n\t\tfor(;j>0;j--)\n\t\t{\n\t\t\t\tt=n/j;\n\t\t\t\tif(n%t==0)\n\t\t\t\t\t\tcount++;\n\t\t\t\tif(count==k)\n\t\t\t\t{\n\t\t\t\t\t\tif(flag==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tflag=1;\n\t\t\t\t\t\t\t\tprintf(\"%d\\n\",t);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tif(flag==0)\n\t\t\t\tprintf(\"-1\\n\");\n\n\t\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3629ab1b274b2bbf52d5eea975d23901", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "d45c1b89fe43b759d7fd3c0bfe36ac03", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.865819209039548, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nmain(){\n int i, j, d= 0, e=0, n, k, s= 0, c= 1, f= 0;\n scanf(\"%i%i\", &n, &k);\n char a[n+1], b[n+1], t;\n scanf(\"%s\", a);\n\n for(i=0; ia[j]){\n t= a[i];\n a[i]= a[j];\n a[j]= t;\n }\n }\n }\n\n b[d]= a[0];\n for(i=1; i1){\n b[++d]= a[i];\n ++c;\n }\n if(c==k){\n break;\n }\n }\n b[++d]= '\\0';\n\n if(c!=k){\n printf(\"-1\");\n return;\n }\n\n for(i=0; i\n#include \n\nint main()\n{\n long long k,b,t,x=1;\n int l=0,n;\n scanf(\"%lld %lld %d %lld\",&k,&b,&n,&t);\n while(xt)\n {\n l--;\n }\n printf(\"%d\",n-l);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9313b95caa4d0f8f817ff129c3599dcf", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "73f7dc5dc34e150b87aecf15b26773fa", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4025661587810746, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n\twhile(1){\n\t\t\tint a1,a2,a3;\n\t\tscanf(\"%d %d %d\",&a1,&a2,&a3);\n\t\tif(a1\nint main()\n{\n long long n,x1,x2,x3,x4,y1,y2,y3,y4,a,b;\n scanf(\"%lld\",&n);\n if(n==1)\n {\n scanf(\"%lld%lld\",&x1,&y1);\n printf(\"-1\\n\");\n return 0;\n }\n \n else if(n==2)\n {\n scanf(\"%lld%lld%lld%lld\",&x1,&y1,&x2,&y2);\n if((x1==x2)||(y1==y2))\n {\n printf(\"-1\");\n return 0;\n }\n else\n {\n a=abs(x1-x2);\n b=abs(y1-y2);\n printf(\"%lld\\n\",a*b);\n return 0;\n }\n }\n \n else if (n==3)\n {\n scanf(\"%lld %lld %lld %lld %lld %lld\",&x1,&y1,&x2,&y2,&x3,&y3);\n if(x1==x2)\n {\n a=abs(y1-y2);\n }\n else if(x1==x3)\n {\n a=abs(y1-y3);\n }\n else if(x3==x2)\n {\n a=abs(y3-y2);\n }\n else\n {\n a=1;\n }\n \n if(y1==y2)\n {\n b=abs(x1-x2);\n }\n else if(y1==y3)\n {\n b=abs(x1-x3);\n }\n else if(y3==y2)\n {\n b=abs(x3-x2);\n }\n else\n {\n b=1;\n }\n printf(\"%lld\\n\",a*b);\n return 0;\n }\n\n else if (n==4)\n {\n scanf(\"%lld %lld %lld %lld %lld %lld %lld %lld\",&x1,&y1,&x2,&y2,&x3,&y3,x4,&y4);\n if(x1==x2)\n {\n a=abs(y1-y2);\n }\n else if(x1==x3)\n {\n a=abs(y1-y3);\n }\n else if(x1==x4)\n {\n a=abs(y1-y4);\n }\n else if(x3==x2)\n {\n a=abs(y3-y2);\n }\n else if(x2==x4)\n {\n a=abs(y4-y2);\n }\n else if(x3==x4)\n {\n a=abs(y4-y3);\n }\n else\n {\n a=1;\n }\n \n if(y1==y2)\n {\n b=abs(x1-x2);\n }\n else if(y1==y3)\n {\n b=abs(x1-x3);\n }\n else if(y1==y4)\n {\n b=abs(x1-x4);\n }\n else if(y3==y2)\n {\n b=abs(x3-x2);\n }\n else if(y2==y4)\n {\n b=abs(x4-x2);\n }\n else if(y3==y4)\n {\n b=abs(x4-x3);\n }\n else\n {\n b=1;\n }\n printf(\"%lld\\n\",a*b);\n return 0;\n }\n \n} ", "lang": "GNU C11", "bug_code_uid": "b3db25e870d817da663578427136d15d", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "8ea51b088988527d0d0c9b6b288cb4f0", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7024673439767779, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int i,c;\n char a[2],b[2];\n for(i=0;i<2;i++)\n scanf(\"%s\",a[i]);\n for(i=0;i<14;i++)\n scanf(\"%s\",b[i]);\n for(i=0;i<5;i++)\n {\n if(a[0]==b[i]||a[1]==b[i])\n {\n c=1;\n break;\n }\n else\n c=0;\n }\n if(c==1)\n printf(\"YES\");\n else\n printf(\"NO\");\n \n return(0);\n}", "lang": "GNU C11", "bug_code_uid": "d337526316bc669ac4f5ada6bd1435f7", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "732b44ffad1c49090d404bde1579c57c", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9046793760831889, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint o[1000], u = 0;\nint n, k, i, z, count = 0, divizori;\n\nint pr (int z)\n{\n divizori = 0;\n for(i = 0; i <= z; i++)\n if(z % i == 0) divizori ++;\n if(divizori == 2) return 1; else return 0; \n}\nint main()\n{\n scanf(\"%d %d\", &n, &k);\n for(z = 0; z <= n; z++)\n {\n if(pr(z) == 1) \n {\n o[u] = z; u++ ; \n }\n }\n for(i = 0; i< u - 1; i++)\n if(pr(o[i] + o[i + 1] + 1) == 1 && o[i] + o[i + 1] + 1 <= n)\n count ++; \n if(count >= k) printf(\"YES\"); else printf(\"NO\");\n \n \n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "143750795eaf95ec69c8043fa2099479", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "121f3e5bd86a68561f1e0e2de0a485f8", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5901498929336189, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\n#define N 40\n\nlong long a[N][N];\n\nlong long solve( int n, int h )\n{\n int i, o, p, j, k;\n if (a[n][h] >=0 ) return(a[n][h]);\n if (h>n)\n {\n a[n][h] = 0;\n return( a[n][h] );\n } \n if (((n==1) && (h==1)) || ((n==0)&&(h==0)))\n {\n a[n][h] = 1;\n return( a[n][h] );\n } \n\n if (h==0) \n {\n a[n][h] = 0;\n return( a[n][h] );\n }\n \n a[n][h] = 0;\n for (i=0;i<=n-1;++i)\n for (j=0;j<=h-2;++j)\n a[n][h] += solve(i, h-1) * solve(n-i-1, j);\n a[n][h] *= 2;\n for (i=0;i<=n-1;++i)\n a[n][h] += solve(i, h-1) * solve(n-i-1, h-1);\n \n return( a[n][h] );\n} \n\nvoid shu_chu( long long t )\n{\n printf( \"%d\", (int)(t%10) );\n t /= 10;\n if (t!=0) shu_chu(t);\n}\n\nmain()\n{\n// freopen( \"input.dat\", \"r\", stdin );\n \n int i, o, p, j, k, n, m, h;\n scanf( \"%d %d\", &n, &h );\n for(i=0;i\nint main(){\nint n,a,c;\nscanf(\"%d\",&n);\n while(n>0){\n scanf(\"%d\",&a);\n if(a%7==0|| a%3==0) printf(\"YES\\n\");\n else if(a<7){\n if(a%3!=0) printf(\"NO\");\n }\n else{\nwhile(a>0){\n a-=7;\n if(a%3==0) break;\n}\n if(a%3==0) printf(\"YES\");\n else printf(\"NO\\n\");\nn--;\n}\n }\n}\n\n", "lang": "GNU C", "bug_code_uid": "39da5dddb37228d2be85448626827320", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "db779c6a3dfb4f5054b7d1ff5c334351", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6825396825396826, "equal_cnt": 33, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 18, "fix_ops_cnt": 32, "bug_source_code": "#include\n#include\n\nint main(){\nint T,n,i;scanf(\"%d\\n\",&T);\nfor(i=0,n= T ;i\n#include \n#include \n#include \n#include \n#include \n#include \n\n\n//--Macros--\n\n#define N 200001\n#define R 100000007\n#define MAX(a,b) ((a)>(b)?(a):(b))\n#define MIN(a,b) ((a)<(b)?(a):(b))\n\n\n//--Structures--\n\n\n//--Comparator Functions--\n\nint comp(const void *a, const void *b)\n{\n\treturn (*(int *)a - *(int *)b);\n}\nint comp_desc(const void *a, const void *b)\n{\n\treturn (*(int *)b - *(int *)a);\n}\n\n\n//--Function Declarations--\n\n// void qsort(array name, size of array, size of each element, comp);\n// int* bsearch(address of search element, array name, size of array, size of each element, comp);\nint rmdup(int [], int); // int rmDup(array, size of array);\nint gcd(int, int); // int gcd(first number, second number);\n\n\n//--Useful Variables--\n\nint i = 0, j = 0, k = 0, flag = 1, count = 0, temp, pos = 0, test_case, mx = 0, mn = INT_MAX;\nlong long sum = 0, product = 1;\n\n\nint main()\n{\n\t//clock_t tStart = clock();\n\tint a, b, diff;\n\tscanf(\"%d %d\", &a, &b);\n\tdiff = abs(a - b);\n\tmn = MIN(a, b);\n\tmx = MAX(a, b);\n\n\tif(mn % diff == 0)\n\t{\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\n\t}\n\tif(mn < diff)\n\t{\n\t\tfor(i = mn; i <= diff / 2; i++)\n\t\t{\n\t\t\tif(diff % i == 0)\n\t\t\t{\n\t\t\t\tflag = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!flag)\n\t\t{\n\t\t\tprintf(\"%d\\n\", i - mn);\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"%d\\n\", diff - mn);\n\t\t\treturn 0;\n\t\t}\n\t}\n\telse\n\t{\n\t\tprintf(\"%d\\n\", diff - mn % diff);\n\t\treturn 0;\n\t}\n\n\t//printf(\"%lf seconds.\\n\", (clock() - tStart)/CLOCKS_PER_SEC);\n\treturn 0;\n}\n\n\nint rmdup(int a[], int n)\n{\n\tif(n == 0 || n == 1)\n\t\treturn n;\n\tint j = 0;\n\tfor(i = 0; i < n - 1; i++)\n\t{\n\t\tif(a[i] != a[i+1])\n\t\t{\n\t\t\ta[j++] = a[i];\n\t\t}\n\t}\n\ta[j++] = a[n-1];\n\treturn j;\n}\n\n\nint gcd(int x, int y)\n{\n\tif(y == 0)\n\t{\n\t\treturn x;\n\t}\n\telse\n\t{\n\t\treturn gcd(y, x % y);\n\t}\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C11", "bug_code_uid": "dd62b9c572557581b69acd74e0d3f0cf", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "6ac102d65390729aed6f12445a356735", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9442446043165468, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\nint gcd(int a,int b){\n\tint t;\n\twhile(b>0){\n\t\tt=a%b;\n\t\ta=b;\n\t\tb=t;\n\t}\n\treturn a;\n}\nint main()\n{\n\tlong long a,b;\n\tscanf(\"%I64d %I64d\",&a,&b);\n\tlong long t;\n\tif(a>b){\n\t\tt=a;\n\t\ta=b;\n\t\tb=t;\n\t}\n\tt=b-a;\n\tlong long k=0;\n\tlong long k1;\n\tlong long min=a*b/gcd(a,b);\n\tfor(long long i=1;i*i<=t;i++){\n\t\tk1=i-b%i;\n\t\tif((a+k1)*(b+k1)\n#include\n\nint n;\nint a[3];\nchar dp[300*300*300];\nlong long step = 0;\n\nvoid calculate_result(int index, long long index1){\n if(index >= n){\n if(index1 == 0){\n dp[0] = 0;\n return;\n }\n int i, min = 300,j;\n long long index2 = index1;\n for(i=0;i (index2 % 300) ) ? (index2 % 300) : min;\n index2 /= 300;\n }\n int win = 0;\n for(i=1;i<=min;i++){\n if(dp[index1 - i*step] == 0){\n win = 1;\n break;\n }\n }\n index2 = index1;\n long long pos = 1;\n if(win == 0){\n for(i=0;i\n#define MOD 1000000007\n\nint dar[252][252], k, n, fact[252];\n\nint add(int a, int b){\n a += b;\n if(a >= MOD)a -= MOD;\n return a;\n}\n\nint mul(int a, int b){\n return (a*1ll*b)%MOD;\n}\nint powmod(int base, long long p){\n int toret = 1;\n while(p){\n if(p&1)toret = mul(toret, base);\n base = mul(base, base);\n p >>= 1;\n }\n return toret;\n}\n\nint inv(int x){\n return powmod(x, MOD - 2);\n}\nint ncr(int n, int r){\n return mul(mul(fact[n], inv(fact[r])), inv(fact[n - r]));\n}\n\nint dp(int r, int c){\n // printf(\"dp(%d, %d)\\n\", r, c);\n if(dar[r][c] == -1){\n int toret = 0;\n if(r == 0){\n dar[r][c] = (c == 0);\n return dar[r][c];\n }\n\n int sat = n - c;\n int i;\n for(i = 0;i <= c;i++)if(i + sat){\n int f1 = powmod(k - 1, c - i);\n f1 = mul(f1, ncr(c, i));\n int f2 = powmod(k, sat);\n if(i == 0){\n\tf2 = add(f2, MOD - powmod(k - 1, sat));\n }\n toret = add(toret, mul(dp(r - 1, c - i), mul(f1, f2)));\n }\n dar[r][c] = toret;\n }\n return dar[r][c];\n}\n\nint main(){\n scanf(\"%d %d\", &n, &k);\n int i,j;\n fact[0] = 1;\n for(i = 1;i < 252;i++)fact[i] = mul(fact[i - 1], i);\n for(i = 0;i <= n;i++)for(j = 0;j <= n;j++){\n dar[i][j] = -1;\n }\n printf(\"%d\\n\", dp(n, n));\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ab8c91c6de9603d6c953680af1ffa04d", "src_uid": "f67173c973c6f83e88bc0ddb0b9bfa93", "apr_id": "de67a88612add95d934eb98b483fa33c", "difficulty": 2300, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8355776045357902, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n\n#define N 2000000\n#define MOD 1000000007\n\nint maxp[N + 1];\nint lcm[N + 1];\nint p[200000];\n\nint max(int x, int y) {\n return x > y ? x : y;\n}\n\nint cmp(const void *a, const void *b) {\n return *(int *)b - *(int *)a;\n}\n\nint main(void) {\n for (int i = 0; i <= N; i++) {\n maxp[i] = i;\n }\n for (int i = 2; i <= N; i++) {\n if (maxp[i] == i) {\n for (int j = i * 2; j <= N; j += i) {\n maxp[j] = i;\n }\n }\n }\n \n int n;\n scanf(\"%d\", &n);\n for (int i = 0; i < n; i++) {\n scanf(\"%d\", &p[i]);\n }\n qsort(p, n, sizeof(int), cmp);\n int one = 0;\n for (int i = 0; i < n; i++) {\n int x = p[i];\n if (lcm[x] == 0) {\n lcm[x] = 1;\n continue;\n }\n bool any = false;\n x--;\n while (x != 1) {\n int p = maxp[x];\n int e = 0;\n while (x % p == 0) {\n x /= p;\n e++;\n }\n if (lcm[p] < e) {\n lcm[p] = e;\n any = true;\n }\n }\n if (!any) {\n one = 1;\n }\n }\n long long ans = 1;\n for (int i = 0; i <= N; i++) {\n for (int j = 0; j < lcm[i]; j++) {\n ans *= i;\n ans %= MOD;\n }\n }\n ans += one;\n ans %= MOD;\n printf(\"%lld\\n\", ans);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "c8249e6a67c0d533fd2c0e5570dc103c", "src_uid": "816a82bee65cf79ba8e4d61babcd0301", "apr_id": "0ac169f88c5547d9c15aa2c1e74cadb5", "difficulty": 2900, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9954614220877458, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int x;\n scanf(\"%d\",&x);\n for(long r=1;r=x)\n {\n mul=10*(mul/x)+(mul%x);\n }\n printf(\"%ld \",mul);\n }\n puts(\"\");\n \n }\n return 0;\n }\n\n", "lang": "GNU C11", "bug_code_uid": "39e7ac2b167e8613bce2fcaab35ff5c0", "src_uid": "a705144ace798d6b41068aa284d99050", "apr_id": "cfcdfa91edab9311fba5c05c6285faaa", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9984871406959153, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int x;\n scanf(\"%d\",&x);\n for(long r=1;r=x)\n {\n mul=10*(mul/x)+(mul%x);\n }\n printf(\"%ld\",mul);\n }\n puts(\"\");\n \n }\n return 0;\n }\n\n", "lang": "GNU C11", "bug_code_uid": "61878feac17ce0af88625704c98007a1", "src_uid": "a705144ace798d6b41068aa284d99050", "apr_id": "cfcdfa91edab9311fba5c05c6285faaa", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9010238907849829, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nchar S[200], T[200];\nint DP[200][200];\nint X[1000], Y[1000];\nint M, N;\n\nint main()\n{\n\t//FILE *input, *output;\n\t//input = fopen(\"suffix.in\", \"r\");\n\tint i, j, k, b, d;\n\tchar c;\n\t\n\tfor(M=0; ; M++)\n\t{\n\t\t//fscanf(input, \"%c\", &c);\n\t\tscanf(\"%c\", &c);\n\t\tif(c == '\\n')\n\t\t\tbreak;\n\t\tS[M] = c;\n\t\tX[(char) c]++;\n\t}\n\tfor(N=0; ; N++)\n\t{\n\t\t//fscanf(input, \"%c\", &c);\n\t\tscanf(\"%c\", &c);\n\t\tif(c == '\\n')\n\t\t\tbreak;\n\t\tT[N] = c;\n\t\tY[(char) c]++;\n\t}\n\t\n\tif(M < N)\n\t{\n\t\tprintf(\"need tree\\n\");\n\t\treturn 0;\n\t}\n\t\n\tif(M == N)\n\t{\n\t\tfor(i=0, b=0; i<1000; i++)\n\t\t{\n\t\t\tif(X[i] != Y[i])\n\t\t\t\tb = 1;\n\t\t}\n\t\t\n\t\tif(b == 0)\n\t\t\tprintf(\"array\\n\");\n\t\telse\n\t\t\tprintf(\"need tree\\n\");\n\t\treturn 1;\n\t}\n\t\n\tfor(i=0; i\n\nint main()\n{\n int arr[1000] = {0}, n, k, i, j, s = 0, max = 0, a[1000] = {0}, sum = 0, H[3] = {0};\n scanf(\"%d %d\", &n, &k);\n\n for(i = 0; i < n; i++)\n scanf(\"%d\", &arr[i]);\n\n for(i = 0; i < k; i++)\n {\n for(j = 0; j < n; j++)\n a[j] = arr[i + j * k];\n\n for(j = 0; j < n; j++)\n H[a[j]]++;\n\n for(j = 1; j <= 2; j++)\n if(H[j] > max)\n max = H[j];\n\n if(H[1] > H[2]) sum += H[2];\n else sum += H[1];\n H[1] = 0, H[2] = 0, max = 0;\n }\n printf(\"%d\", sum);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "732e9970d90f46990c86e88006415052", "src_uid": "5f94c2ecf1cf8fdbb6117cab801ed281", "apr_id": "0cebf1f745f439635a30f43291177261", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5549738219895288, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "#include\nint main()\n{\n\tint q=0,w=0,e=0,a[100],k,n,i,j;\n\tscanf(\"%d %d\",&n,&k);\n\tfor(i=0 ; iq)\n\t\t\t\te+=q;\n\t\t\telse\n\t\t\t\te+=w;\n\t}\n\t\t\tprintf(\"%d\",e);\n\t\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c86ea7641215ac5fd64d7fc2129971ce", "src_uid": "5f94c2ecf1cf8fdbb6117cab801ed281", "apr_id": "9eb545230c8dbabc1164883779155743", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6433915211970075, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "#include\nint main()\n{\nlong long int i,j,n=0,m=0,count=0;\nscanf(\"%lld%lld\",&n,&m);\nfor(i=1;i<=n; i++)\n{\n\tfor (j=1;j<=m; j++)\n\t{\n\tif ((i+j)%5==0)\n count++;\n\t}\n}\nprintf(\"%lld\",count);\n}\n\n", "lang": "GNU C11", "bug_code_uid": "5cf12f04d95271ce49014ab218ed749e", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "03da0f9c225b34c60f8367de7afe92ea", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9678321678321679, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \nint main()\n{\n\n int n;\n int i,j,nbr=6;\n\n for(i=0;i<5;i++)\n {\n for(j=0;j<5;j++)\n {\n scanf(\"%d\",&n);\n if(n)\n {\n nbr=abs(i-2)+abs(j-2);\n i=5;\n break;\n\n }\n }\n\n }\n printf(\"%d\\n\",nbr);\n return 1;\n}\n", "lang": "GNU C", "bug_code_uid": "704ff3894c139c0abb782ce301cfe362", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "9ae9d9d6b9c742543e62c2b12b5d631b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8294117647058824, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\n#include\n#include\n\nint main()\n{\n\tlong long int k,i,j,a,b,l,flag=0;\n\tscanf(\"%lld\",&k);\n\tchar arr[15] =\"codeforces\";\n\t// for(i=0;i<10;i++)\n\t// {\n\t// \tprintf(\"%c-%lld\\n\",arr[i],i);\n\t// }\n\ta=1,b=2;\n\twhile(1)\n\t{\n\t\tfor(i=0;i<=10;i++)\n\t\t{\n\t\t\tif(int(pow(b,i)*pow(a,10-i))>=k)\n\t\t\t{\n\t\t\t\tflag=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(flag==1)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t\ta++;\n\t\tb++;\n\t}\n\tfor(j=1;j<=i;j++)\n\t{\n\t\tfor(l=1;l<=b;l++)\n\t\t{\n\t\t\tprintf(\"%c\",arr[j-1]);\n\t\t}\n\t}\n\tfor(j=i+1;j<=10;j++)\n\t{\n\t\tfor(l=1;l<=a;l++)\n\t\t{\n\t\t\tprintf(\"%c\",arr[j-1]);\n\t\t}\n\t}\n\tprintf(\"\\n\");\n}", "lang": "GNU C11", "bug_code_uid": "fcb1288cf3e12cc2109c0e502bc39907", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "b62d25544fd4f9c805c24705a217ce27", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.14124872057318322, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main(void)\n{\n\tint k;\n\tscanf(\"%d\", &k);\n\tif (k == 1)\n\t{\n\t\tprintf(\"codeforces\\n\");\n\t\treturn 0;\n\t}\n\tprintf(\"codeforcee\");\n\tif (k % 2 == 0)\n\t{\n\t\tk = k / 2;\n\t\twhile (k--)\n\t\t\tprintf(\"s\");\n\t}\n\telse\n\t{\n\t\tk = (k + 1) / 2;\n\t\twhile (k--)\n\t\t\tprintf(\"s\");\n\t}\n\tprintf(\"\\n\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "80c0a20bafc8bbcba9154f072b260f8b", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "c3162b4eeea011f964899fde91c28040", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998046875, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(void)\n{\n\tunsigned long long k; //k\u7684\u4e2a\u6570\u662f2\u768416\u6b21\u65b9\n\tunsigned long long asn;\n\tscanf_s(\"%llu\", &k);\n\tchar s[10] = \"codeforces\";\n\tchar q[11]; // \u50a8\u5b58codeforces\u6bcf\u4e2a\u5b57\u7b26\u7684\u91cd\u590d\u6b21\u6570\n\t//\u6bcf\u4e2a\u5b57\u7b26\u81f3\u5c11\u8981\u91cd\u590d\u51fa\u73b0\u4e00\u6b21\n\tint ten = 0;\n\tfor (int i = 0; i < 10; i++)\n\t\tq[i] = 1; \n\twhile (1)\n\t{\n\t\tasn = 1;\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tasn = asn * q[i];\n\t\tif (asn >= k)\n\t\t\tbreak;\n\t\tif (ten == 10)\n\t\t\tten = 0;\n\t\tq[ten]++;\n\t\tten++;\n\t}\n\tfor (int i = 0; i < 10; i++)\n\t\tfor (int j = 0; j < q[i]; j++)\n\t\t\tprintf(\"%c\", s[i]);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "9f0b0e8eebaeace5284e2bf8c0e98729", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "c3162b4eeea011f964899fde91c28040", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9855421686746988, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint main()\n{\n long long int n;\n scanf(\"%lld\",&n);\n int a[10];\n for(int i=0;i<10;i++)\n a[i]=1;\n char substr[11]=\"codeforces\";\n int k=1;\n long long int p=0;\n while(k\nint main()\n{\n long long k;\n scanf(\"%lld\",&k);\n char c[10]=\"s\";\n char s[15]=\"codeforces\";\n k=k-1;\n printf(\"%s\",s);\n while(k--)\n {\n printf(\"%c\",'s');\n }\n printf(\"\\n\");\n}\n", "lang": "GNU C11", "bug_code_uid": "be1eba0cec030cb733d2be5de9bb84d7", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "490e89fccaaeffe2deaab877f8552c29", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8951965065502183, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\n\nint main()\n{\n\tint n,i,k=1;\n\tscanf(\"%d\",&n);\n\tint a[n];\n\tfor(i=2;i<=n;i++)\n\t{\n\t\tif(n%i==0)\n\t\t{\n\t\t\tint x=i,j=0;\n\t\t\tint p=0,q=0;\n\t\t\twhile(x>0)\n\t\t\t{\n\t\t\t\ta[j]=x%2;\n\t\t\t\tx/=2;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tj--;\n\t\t\twhile(a[j]==1 && j>=0)\n\t\t\t{\n\t\t\t\tp++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t\twhile(a[j]==0 && j>=0)\n\t\t\t{\n\t\t\t\tq++;\n\t\t\t\tj--;\n\t\t\t}\n\t//\t\tprintf(\"i is %d , 1's is %d , 0's is %d\\n\",i,p,q);\n\t\t\tif(p-q==1)\n\t\t\t\tk=i;\n\t\t}\n\t}\n\tprintf(\"%d\\n\",k);\n\treturn 0;\n}\n\n\n\n", "lang": "GNU C11", "bug_code_uid": "dca774ff91a0e80cdb9382b78c72678c", "src_uid": "339246a1be81aefe19290de0d1aead84", "apr_id": "7c0626a2a29edbffa507a5852b7c5777", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.3541666666666667, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\nint main() \n{\n\tlong int x,y,m;\n\tscanf(\"%ld\",&x);\n\tscanf(\"%ld\",&y);\n\tscanf(\"%ld\",&m);\n\tint count=0;\n\n\tif((x==0 && y<=0) || (y==0 && x<=0) || (x<=0 && y<=0)|| (x==0 && y==0))\n\t{\n\t\tprintf(\"%d\\n\",-1);\n\n\t}\n\telse\n\t{\n\t\tif(x>y)\n\t\t{\n\t\t\twhile(y\n#include\nint main() \n{\n\tlong long int x,y,m,cnt=0;\n\tscanf(\"%lld\",&x);\n\tscanf(\"%lld\",&y);\n\tscanf(\"%lld\",&m);\n\t\n\tif(x>=m || y>=m)\n\t{\n\t\tprintf(\"%d\\n\",0);\n\t\treturn 0;\n\t}\n\tif(x<=0 && y<=0)\n\t{\n\t\tprintf(\"%d\\n\",-1);\n\t\treturn 0;\n\t}\n\tif(x>y)\n\t{\n\t\tlong long int tmp = x;\n\t\tx=y;\n\t\ty=tmp;\n\t}\n\tif(x<0)\n\t{\n\t\tcnt += -x/y;\n\t\tx+=y * cnt\n\t}\n\twhile(x\n#define lli long long int\nlli n,i,j,u,k,l,x,y,d,s,t;\nlli gg(lli x){int u=0; while(x){u++;x/=10;} return u;}\nlli ggg(lli n)\n{\n while(n/10)n/=10;\n return n;\n}\nlli g(lli u)\n{\n lli a=1;\n while(--u)a=10*a+1;\n return a;\n}\nlli f(lli n);\nlli fff(lli n)\n{\n lli u=gg(n);\n if(u==1) return 2+(11-n);\n if(ggg(n)<6) return 10000;\n return u+1+f(g(u+1)-n);\n}\nlli ff(lli n)\n{\n lli u=gg(n);\n if(u==1)return n;\n return ggg(n)*u+(f(n-ggg(n)*g(u)));\n}\nlli f(lli n)\n{\n if(!n)return 0;\n if(n<0)n*=-1;\n lli x,y,u=gg(n);\n x=ff(n);\n y=fff(n);\n return (x>y ? y : x);\n}\nint main()\n{\n scanf(\"%lld\",&n);\n x=n;\n while(x){u++;x/=10;}\n printf(\"%lld\",f(n));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "de9db2d7cd0bd4d033655d6f4ffb5897", "src_uid": "1b17a7b3b41077843ee1d6e0607720d6", "apr_id": "db6e29fd87e0b7ee53dd1af56d1d4f41", "difficulty": 1800, "tags": ["divide and conquer", "dfs and similar", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.07712765957446809, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nint main()\n{\n int a[3],n;\n scanf(\"%d\",&n);\n scanf(\"%d\",&a[0]);\n scanf(\"%d\",&a[1]);\n scanf(\"%d\",&a[2]);\n std::sort(a,a+3);\n int sum=0;\n n--;\n while(n!=0)\n {\n if(n%2==0) sum+=a[1];\n else if(n%2==1) sum+=a[0];\n n--;\n }\n printf(\"%d\",sum);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "be335ab44bb6a44298850c903f35fc6c", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "a063e6d642e6b835e4487dcedb4e7b85", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.20626895854398383, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": " #include\n main()\n {\n long long int n,k,i,j,l=1;\n scanf(\"%lld%lld\",&n,&k);\n if(n%2==0)\n j=n/2+1;\n else if(n%2!=0)\n j=n/2+1+1;\n for(i=1;i<=n;i++)\n {\n if(i%2==0)\n {\n if(j==k)\n {\n printf(\"%ld\",i);\n break;\n }\n j++;\n }\n else\n {\n if(l==k)\n {\n printf(\"%ld\",i);\n break;\n }\n l++;\n }\n }\n return 0;\n }", "lang": "GNU C", "bug_code_uid": "7d1368e839f43d98f8a03c04ee20ac74", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "e71e48879a3531cf81368358b83a9f2c", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9958932238193019, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define mod 1000000007\nlong long findMod(long long a)\n{\n\treturn a>=0? (a%mod) : (mod-((-1*a)%mod));\n}\nint main()\n{\n\tlong long x,y,n,ans[7];\n\tscanf(\"%lld%lld\",&x,&y);\n\tlong long a,b,c,d;\n\tans[1] = findMod(x);\n\tans[2] = findMod(y);\n\tans[3] = (findMod(y)-findMod(x)+mod)%mod;\n\tans[4] = findMod(-x);\n\tans[5] = findMod(-y);\n\tans[6] = (findMod(x)-findMod(y)+mod)%mod;\n\tscanf(\"%lld\",&n);\n\tif(n%6==0)\n\t\tprintf(\"%lld\\n\",ans[6]);\n\telse\n\t\tprintf(\"%lld\\n\",ans[n%mod]);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "de922060bac0498c562715ff7cccba50", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "f4fc370771072b6a184e7f48ef4136ca", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9615384615384616, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main(int argc, char const *argv[])\n{\n\tint a;\n\tscanf(\"%d\",&a);\n\tfor (int i = 2; i < d; ++i)\n\t{\n\t\tif(a%i == 0){\n\t\t\tprintf(\"%d\",i );\n\t\t\t\n\t\t}\n\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "8502ffc9d5c854d931974a4761931f7b", "src_uid": "7220f2da5081547a12118595bbeda4f6", "apr_id": "65f77b7536539fb2089b44af22b11298", "difficulty": null, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.40310077519379844, "equal_cnt": 21, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 20, "bug_source_code": "// C program to print largest contiguous array sum \n#include\ntypedef long long int ll;\nll max(ll a,ll b){\n return (a>b?a:b);\n}\nll min(ll a,ll b){\n return (a=c;i--)\n {\n for(int j=b;j<=c;j++)\n {\n low2=max(a,i-j+1);\n high2=min(low2,b+1);\n ans+=(b-high2+1);\n }\n }\n printf(\"%lld\",ans);\n}\n", "lang": "GNU C11", "bug_code_uid": "a968f4d04faf8cde3e137739d35ead0d", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "adb4e68f9ed0ad9f286226588a931176", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8764044943820225, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\n\nlong long int XY(int A, int B, int C, int X_plus_Y)\n{\n\tlong long int x = 0;\n\tint i;\n\tint j;\n\tfor(i=A;i<=B;i++)\n\t{\n\t\tj = X_plus_Y - i;\n\t\tif( (B<=j) && (j<=C) )\n\t\t{\n\t\t\tx++;\n\t\t}\n\t}\n\t\n\treturn x;\n}\n\nlong long int Z(int C, int D, int X_plus_Y)\n{\n\tint min;\n\tlong long int z;\n\tif( X_plus_Y-1 <= D)\n\t{\n\t\tmin = X_plus_Y-1;\n\t}\n\telse\n\t{\n\t\tmin = D;\n\t}\n\t\n\tz = min - C + 1;\n\tif(z<0)\n\t{\n\t\treturn 0;\n\t}\n\t\n\treturn z;\n}\n\nint main()\n{\n\t// variable in description\n\tint T;\n\tint A, B, C, D; \n\t// variable to support\n\tlong long int ans;\n\tlong long int XY_num;\n\tlong long int Z_num;\n\t// variable to judge\n\tint i;\n\tint j;\n\tint k;\n\t\n\t\tscanf(\"%d %d %d %d\",&A,&B,&C,&D);\n\t\t\n\t\tans = 0;\n\t\t\n\t\tfor(j=A+B;j<=B+C;j++)\n\t\t{\n\t\t\tXY_num = XY(A,B,C,j);\n\t\t\tZ_num = Z(C,D,j);\n\t\t\tans += XY_num*Z_num;\n\t\t\t//printf(\"%d %d\\n\",XY_num,Z_num);\n\t\t}\n\t\t\n\t\tprintf(\"%lld\\n\",ans);\n\t\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "326274de539c05054e8ecf8d2a4023e3", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "c0c26d9170edcd124b907e8e0cf98e59", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9961783439490446, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n\tlong long int A,B,C,D,i;\n\tlong long int res=0;\n\tscanf(\"%lld%lld%lld%lld\",&A,&B,&C,&D);\n\tfor(i=C;i<=D;i++)\n\t{\n\t\tif(i+2>=A+B)\n\t\t\tres+=((i-A-B+2)*(i-A-B+1))/2;\n\t\tif(i+2>=2*b+1)\n\t\t\tres-=((i-2*B+1)*(i-2*B))/2;\n\t\tif(i+2>=A+C+1)\n\t\t\tres-=((i-A-C+1)*(i-A-C))/2;\n\t\tif(i-B-C>=0)\n\t\t\tres+=((i-B-C)*(i-B-C-1))/2;\n\t}\n\tres=(B-A+1)*(C-B+1)*(D-C+1)-res;\n\tprintf(\"%lld\\n\",res);\n}\n", "lang": "GNU C11", "bug_code_uid": "83536f833aa0ce73cbb908f7d80561b9", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "92aa025c247432c98c7639dbef11f04c", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5066137566137566, "equal_cnt": 21, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 8, "fix_ops_cnt": 20, "bug_source_code": "#include\n#include\n#include\nint main ()\n{\n int i=0,n,j;\n char s[100];\n scanf(\"%s\",s);\n n=strlen(s);\n while (i\nint main(){\nint i,count=0;\nchar s[101];\nfor(i=0;i<101;i++)\n {\nscanf(\"%c\",&s[i]);\n }\nfor(i=0;i<101;i++)\n{\nif((s[i]=='O' && s[i+1]=='l' &&\ns[i+2]=='y' && s[i+3]=='a')||(s[i]=='D' && s[i+1]=='a' &&s[i+2]=='n' &&\ns[i+3]=='i'&&s[i+4]=='l')||\n(s[i]=='A' &&s[i+1]=='n' &&\ns[i+2]=='n')||\n(s[i]=='S'&&s[i+1]=='l' &&\ns[i+2]=='a'&&s[i+3]=='v'&&s[i+4]=='a')||\n(s[i]=='N'&&s[i+1]=='i' &&\ns[i+2]=='k'&&s[i+3]=='i'&&s[i+4]=='t'&&s[i+5]=='a'))\ncount++;\n}\nif(count==1){\nprintf(\"YES\");}\nelse{\n printf(\"NO\");}\n return 0;\n\n", "lang": "GNU C11", "bug_code_uid": "3b1f077b34de2ec12dce9e031cdac313", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "b4cbee2c37a9b927c9af52061ae3f5c0", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9031032298923369, "equal_cnt": 19, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 9, "fix_ops_cnt": 18, "bug_source_code": "#include\n#include\nint main()\n{\n char ch[110];\n int i,j,k,l,c=0,c1=0,c2=0,c3=0,c4=0;\n scanf(\"%s\",ch);\n l=strlen(ch)\n for (i=0;i\n#include\nint check(char[],char[]);\nint main(){\n char s[100];\n scanf(\"%s\",s);\n int a,b,c,d,t=0,flag=1;\n t=check(s,\"Danil\");\n a=check(s,\"Olya\");\n b=check(s,\"Ann\");\n c=check(s,\"Slava\");\n d=check(s,\"Nikita\");\n t=t+a+b+c+d;\n if(t==1)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\nint check(char s[],char m[]){\n int flag=1,i,j,t=0;\n for(i=0;i<=strlen(s)-strlen(m);i++){\n flag=1;\n j=0;\n for(;j<=strlen(m)-1;j++){\n if(m[j]!=s[j+i]){\n flag=0;\n break;\n } \n }\n if(flag==1){\n t=t+1;\n }\n }\n return t;\n}\n", "lang": "GNU C11", "bug_code_uid": "49ed611da1fa2d78b91b1f9c521bccf9", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "fcedab29da47b2bf5609a300307e6e3e", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2434536447275301, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\nint check(char[],char[]);\nint main(){\n char s[100];\n scanf(\"%s\",s);\n int a,b,c,d,t=0,flag=1;\n if(strcmp(s,\"Danil\")==0||strcmp(s,\"Olya\")==0||strcmp(s,\"Ann\")==0||strcmp(s,\"Slava\")==0||strcmp(s,\"Nikita\")==0)t=1;\n else if(strcmp(s,\"Vanya\")==0&&strcmp(s,\"A\")==0)){t=0;}\n else{\n t=check(s,\"Danil\");\n a=check(s,\"Olya\");\n b=check(s,\"Ann\");\n c=check(s,\"Slava\");\n d=check(s,\"Nikita\");\n t=t+a+b+c+d;\n }\n if(t==1)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\nint check(char s[],char m[]){\n int flag=1,i,j,t=0;\n for(i=0;i<=strlen(s)-strlen(m);i++){\n flag=1;\n j=0;\n for(;j<=strlen(m)-1;j++){\n if(m[j]!=s[j+i]){\n flag=0;\n break;\n } \n }\n if(flag==1){\n t=t+1;\n }\n }\n return t;\n}\n\n\n", "lang": "GNU C11", "bug_code_uid": "fef5d802a017e2b96c6c5b6fdc130983", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "fcedab29da47b2bf5609a300307e6e3e", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1147396293027361, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\nint mian()\n{\n int flag=1;\n int i,l;\n char a[100];\n scanf(\"%s\",a);\n l=strlen(a);\nfor(i=0;i\n#include\nint main()\n{\n int i,j,k,n,m=0;\n char a[101];\n scanf(\"%s\",a);\n n=strlen(a);\n for(j=0;j\n#include\nint main()\n{\n char s[100];\n int i,l,c=0,c1=0,c2=0,c3=0,c4=0;\n scanf(\"%s\",s);\n l=strlen(s);\n for (i=0;i\n#include\nint main()\n{\n char s[110];\n int i,l,c=0,c1=0,c2=0,c3=0,c4=0;\n scanf(\"%s\",s);\n l=strlen(s);\n for (i=0;i\n#include\nint main()\n{\n char s[100];\n int i,l,c=0,c1=0,c2=0,c3=0,c4=0;\n scanf(\"%s\",s);\n l=strlen(s);\n for (i=0;i\n#include\nint check(char[],char[]);\nint main(){\n char s[100];\n scanf(\"%s\",s);\n int a,b,c,d,t=0,flag=1;\n if(strcmp(s,\"Danil\")==0||strcmp(s,\"Olya\")==0||strcmp(s,\"Ann\")==0||strcmp(s,\"Slava\")==0||strcmp(s,\"Nikita\")==0)t=1;\n else if(strcmp(s,\"Vanya\")==0){t=0;}\n else{\n t=check(s,\"Danil\");\n a=check(s,\"Olya\");\n b=check(s,\"Ann\");\n c=check(s,\"Slava\");\n d=check(s,\"Nikita\");\n t=t+a+b+c+d;\n }\n if(t==1)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\nint check(char s[],char m[]){\n int flag=1,i,j,t=0;\n for(i=0;i<=strlen(s)-strlen(m);i++){\n flag=1;\n j=0;\n for(;j<=strlen(m)-1;j++){\n if(m[j]!=s[j+i]){\n flag=0;\n break;\n } \n }\n if(flag==1){\n t=t+1;\n }\n }\n return t;\n}", "lang": "GNU C11", "bug_code_uid": "70c2ec01cd9f32325ede1774d2e01d77", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "611b0b35d523e2abf9816f1ba4c646a6", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9993979530403372, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "include\n#include\nint main()\n{\n char ch[110];\n int i,l,c=0,c1=0,c2=0,c3=0,c4=0;\n scanf(\"%s\",ch);\n l=strlen(ch);\n for (i=0;i\n#include\nint check(char[],char[]);\nint main(){\n char s[100];\n scanf(\"%s\",s);\n int a,b,c,d,t=0,flag=1;\n if(strcmp(s,\"Danil\")==0||strcmp(s,\"Olya\")==0||strcmp(s,\"Ann\")==0||strcmp(s,\"Slava\")==0||strcmp(s,\"Nikita\")==0)t=1;\n else if(strcmp(s,\"Vanya\")==0&&strcmp(s,\"A\")==0)){t=0;}\n else{\n t=check(s,\"Danil\");\n a=check(s,\"Olya\");\n b=check(s,\"Ann\");\n c=check(s,\"Slava\");\n d=check(s,\"Nikita\");\n t=t+a+b+c+d;\n }\n if(t==1)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\nint check(char s[],char m[]){\n int flag=1,i,j,t=0;\n for(i=0;i<=strlen(s)-strlen(m);i++){\n flag=1;\n j=0;\n for(;j<=strlen(m)-1;j++){\n if(m[j]!=s[j+i]){\n flag=0;\n break;\n } \n }\n if(flag==1){\n t=t+1;\n }\n }\n return t;\n}\n", "lang": "GNU C11", "bug_code_uid": "2c2299bba99c8f0a84b0258b8f261127", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "a09b13ffa921388f97d8b1c3a05dfda8", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9487008660892738, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nlong long power(int m, int pow){\n if (pow == 1)\n return m;\n else{\n long long val = power(m, pow/2);\n val = (val * val) %1000000007;\n\n if (pow%2)\n val = (val * (long long)m) % 1000000007;\n return val;\n }\n\n}\n\n\nint main()\n{\n int n, m, k;\n scanf(\"%d %d %d\", &n, &m, &k);\n\n if (k == 1)\n printf(\"%d\\n\", power(m,n));\n else{\n\n if (n>k){\n\n if (k%2)\n printf(\"%d\\n\", (m*m)%1000000007);\n else\n printf(\"%d\\n\", m);\n }\n\n else{\n int pow = k/2 + k%2;\n\n printf(\"%I64d\\n\", power(m,pow));\n }\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a258b4c71ad75c35db87fd5f83d1a66b", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "9a85bbc35d60d69bb8e7bf3b82f122ce", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.15845070422535212, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n#include \n\nint M,ans;\nint n,m,k,t;\nlong long lans;\n\n\nmain(){\n M=1e9+7;\n scanf(\"%d%d%d\",&n,&m,&k);\n if(n>1;\n while(t--){\n lans*=m;\n lans%=M;\n }\n printf(\"%lld\\n\",lans);\n return 0;\n }\n printf(\"%d\\n\",m);\n return 0;\n }\n if(k==1){\n lans=1;\n t=n;\n while(t--){\n lans*=m;\n lans%=M;\n }\n printf(\"%lld\\n\",lans);\n return 0;\n }\n printf(\"%d\\n\",m*~-m);\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "1eef5a246a6cc8511594c42d35ed5c33", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "04015a4590990715207d88f7d856ba6e", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.899876390605686, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nchar s[105];\nbool g[206][206];\nint main()\n{\n scanf(\"%s\", s);\n int x=102,y=102;\n int i;\n for(i=0;s[i];i++)\n {\n g[x][y]=1;\n if(s[i]=='L')y--;\n else if(s[i]=='R')y++;\n else if(s[i]=='U')x--;\n else x++;\n if(g[x+1][y]+g[x-1][y]+g[x][y+1]+g[x][y-1]+g[x][y]>1)break;\n }\n if(s[i])printf(\"BUG\");\n else printf(\"OK\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "bab6bb1ba545595a2a01140d7cfd582b", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "44f4bf7576c61b21e66a5f4601f50a15", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4577319587628866, "equal_cnt": 22, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 10, "fix_ops_cnt": 22, "bug_source_code": "#include\nlong long int cal[5001][5001];\nint main()\n{\nlong long int n,a,b,k,prev[5001],cur[5001],i,j,dist,count[5001],c1,h,ans;\nscanf(\"%lld %lld %lld %lld\",&n,&a,&b,&k);\nfor(i=1;i<=n;i++)\n prev[i]=0;\nprev[a]=1;\nfor(i=1;i<=5000;i++)\n count[i]=0;\nfor(i=1;i<=n;i++)\n{\n for(j=1;j<=n;j++)\n {c1=b-j;\nif(c1<0)\n c1=-c1;\n dist=j-i;\n if(dist<0)\n dist=-dist;\n if(i!=j&&dist\nlong long n,dep,d[70];\nvoid devide(long long k){\n\twhile (k){\n\t\tdep++;\n\t\td[dep]=k%2;\n\t\tk/=2;\n\t}\n}\nlong long get(long long i){\n\tlong long m=(1<<(dep))-1,c=0,k=i;\n\twhile (k)\n\t{\n\t\tm>>=1;\n\t\tc++;\n\t\tif (k==m+1)\n\t\t\tbreak;\n\t\tif (k>m+1)\n\t\t\tk-=m+1;\n\t}\n//\tprintf(\"%lld\",d[c]);\n\treturn c;\n}\nint main(void){\n\tlong long x,y,i,sum=0;\n\tscanf(\"%lld%lld%lld\",&n,&x,&y);\n\tdevide(n);\n\tfor (i=x;i<=y;i++)\n\t\tsum+=d[get(i)];\n\tprintf(\"%lld\\n\",sum);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "aca537df7b21c7a974b4785675b76350", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "92bc58d174ca72827b9bc1050a41b1be", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.03852080123266564, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \nusing namespace std;\nstring s , sl;\nlong long n , l , r , ans;\nlong long dfs(long long num) {\n if(num == 1) {\n return 1;\n }\n return 1 + 2 * dfs(num / 2);\n}\nvoid binsearch(long long le , long long ri , long long num) {\n long long mid = (le + ri) >> 1;\n if(ri < l || le > r || le > ri)\n return ;\n if(mid < l) {\n binsearch(mid + 1 , ri , num / 2);\n }\n else if(mid > r) {\n binsearch(le , mid - 1 , num / 2);\n }\n else {\n ans += num % 2;\n binsearch(le , mid - 1 , num / 2);\n binsearch(mid + 1 , ri , num / 2);\n }\n}\nint main() {\n cin >> n >> l >> r;\n if(n == 0) {\n cout << 0 << endl;\n return 0;\n }\n long long count = dfs(n);\n binsearch(1 , count , n);\n cout << ans << endl;\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "10ce8640050d58707ca3e860d5912a2f", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "92bc58d174ca72827b9bc1050a41b1be", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16131830008673026, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include\nint i=0;\nint b[100];\nlong long n,l,r,x;\n\nlong long le=1;\nint sum=0;\nlong long k;\n\nint sol(long long m)\n{long long L=0,mid,R=le;int j;\nif(m%2==0)return (1);\nelse\n\nfor(j=0;m!=(L+R)/2;j++)\n{\n\tmid=(L+R)/2;\n\tif(m>mid)L=mid+1;\n\tif(m1;x/=2){\n\nb[i++]=x%2;\nle=2*le+1;\n}\n\nle=le-1;\n\nfor(k=l-1;k<=r-1;k++)\n{sum+=sol(k);\n}\nprintf(\"%d\",sum);\n\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "474a4b85a6677808a225536dbb0c7a5c", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "098d0efd52844bd8a3a13fc49367164c", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.12772133526850507, "equal_cnt": 25, "replace_cnt": 16, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 25, "bug_source_code": "#include\n#define MAXN 100010\nlong long a[MAXN],b[MAXN];\nint sign,flag; \nint main(){\n\tvoid crash(long long a[],long long b[]);\n\tlong long n;\n\tint r,l;\n\tint i,count\uff1b\n\tfor(i=0;i0){\n\t\tfor(i=r-1;i<=l-1;i++){\n\t\t\tif(a[i]==1){\n\t\t\t\tcount++; \n\t\t\t}\n\t\t}\n }\n\telse{\n\t\tfor(i=r-1;i<=l-1;i++){\n\t\t\tif(b[i]==1){\n\t\t\t\tcount++; \n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\",count);\n\treturn 0;\n} \n\nvoid crash(long long a[],long long b[]){\n\tsign=1,flag=0;\n\tint i,quo,mod,count;\n\tfor(i=0,count=0;a[i]!=-1;i++){\n\t\tif(a[i]!=1&&a[i]!=0){\n\t\t\tquo=a[i]/2;\n\t\t\tmod=a[i]%2;\n\t\t\tb[count]=quo;\n\t\t\tb[count+1]=mod;\n\t\t\tb[count+2]=quo;\n\t\t\tcount=count+3;\n\t\t\tflag=1;\n\t\t}\n\t\telse{\n\t\t\tb[count]=a[i];\n\t\t\tcount++;\n\t\t}\n\t}\n\tsign=sign*(-1);\n\tif(flag==1){\n\t\tcrash(b,a);\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "9b08e8ffd64befa5079e621387e00b20", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "e6632a3341042a7cfad76dedf3ad95a5", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8088803088803089, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n\ntypedef long long ll;\n\nll solve(ll n, ll l, ll r, ll x, ll y) {\n if (r < x || l > y || n == 0) return 0;\n if (n == 1) return 1;\n ll mid = (x + y) / 2;\n return solve(n / 2, l, r, x, mid - 1) + solve(n % 2, l, r, mid, mid) + solve(n / 2, l, r, mid + 1, y);\n}\n\nint main() {\n ll n, l, r;\n ll ans;\n scanf(\"%lld %lld %lld\", &n, &l, &r);\n ll max = 1; while (max <= n) { max *= 2; }\n ans = solve(n, l, r, 1, max);\n printf(\"%lld\\n\", ans);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "a475e6651b0f496eef3ac3423f0b5caf", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "b051858a821df8d8aa298244b3c6619c", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7698519515477793, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\nmain()\n{\n long int l,r,x,y,i,j,flag=0,s;\n double k,p;\n scanf(\"%ld%ld%ld%ld%lf\",&l,&r,&x,&y,&k);\n for(i=l;i<=r;i++)\n {\n for(j=x;j<=y;j++)\n { p=(double)j*k;\n if((double)i==p)\n {\n printf(\"YES\\n\");flag=1;\n goto s;\n }\n }\n } s:;\n if(flag==0)\n {\n printf(\"NO\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6ae8025271b46e46e74b47e6e40a9279", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "a8a7c040f123e5e8e46c97439bb49368", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8895184135977338, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n int i,j;\n int l,r,x,y;\n double k;\n scanf(\"%d %d %d %d %lf\",&l,&r,&x,&y,&k);\n for(i=l;i<=r;i++)\n {\n if(i/k<=y&&i/k>=x&&i%k==0)\n {\n printf(\"YES\");\n exit(0);\n }\n } \n printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9a9c061e28a5d4cee33ebc7269f6e9b0", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "853f811e0716e8a4f8f5cd79bae65b21", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5205479452054794, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \nint main()\n{\n\tlong int l,r,x,y,k,a,b,i,j,temp,check;\n\tscanf(\"%ld %ld %ld %ld %ld\",&l, &r, &x, &y, &k);\n\tfor(i=l;i<=r;i++)\n\t{\n\t\tcheck = 0;\n\t\tfor(j = x;j<=y && j<=i;j++)\n\t\t{\n\t\t\tif(i%j == 0)\n\t\t\t{\n\t\t\t\tif(k == i/j)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\");\n\t\t\t\t\tcheck = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(check == 1)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(check == 0)\n\t{\n\t\tprintf(\"NO\");\n\t}\n}", "lang": "GNU C", "bug_code_uid": "bf89264b194b543dc9922204e2fe9e38", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "a1d98f38edd133bbea40173266ab7c60", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9436201780415431, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "#include \n\n// ftp = 7 http = 5\n\nint controlar(char *c1, char *c2,int op)\n{\n int i=0;\n\n if(c1[0]=='r' && c2[0]=='u' && op!=1)\n {\n i=1;\n }else\n {\n i=0;\n\n }\n return i;\n}\nint main()\n{\n char dir_err[51]={0};\n int n,r,op;\n n=r=op=0;\n scanf(\"%s\",dir_err);\n\n\n if (dir_err[n]=='h')\n {\n\n printf(\"http://\");\n n=4;\n if (dir_err[n]=='r' && dir_err[n+1]=='u'){op++;}\n }else if (dir_err[n]=='f')\n {\n\n if (dir_err[3]=='h' && dir_err[4]=='t' && dir_err[5]=='t' && dir_err[6]=='p')\n {\n printf(\"ftp://http\");\n n=7;\n }else\n {\n printf(\"ftp://\");\n n=3;\n if (dir_err[n]=='r' && dir_err[n+1]=='u'){op++;}\n }\n }\n while(0==controlar(&dir_err[n],&dir_err[n+1],op) ){\n\n printf(\"%c\",dir_err[n]);\n n++;\n op+2;\n\n }\n\n printf(\".ru\");\n n=n+2;\n if(dir_err[n]!='\\0')\n {\n printf(\"/\");\n do{\n printf(\"%c\",dir_err[n]);\n n++;\n }while(dir_err[n]!='\\0');\n\n }\n\n}\n", "lang": "GNU C", "bug_code_uid": "9c75b35d58b40667d838dc55d9877733", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "fb6b02ca0edd2d49348b627225647ba8", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9635627530364372, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,c=0,big=0,j,i;\n char s[100],ch[30]={'A','B','C','D','E','F','G','H','I','J','K','L','M',\n 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};\n scanf(\"%d\",&n);\n getchar();\n for(i=0;ibig){\n big=c;\n }\n c=0;\n }\n }\n printf(\"%d\\n\",c);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c72ec39dc26c0f40b5138518b5607fc5", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "apr_id": "29ec8625ce1bf04683e5165b17ecdf1e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9882903981264637, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(void)\n{\n int n,m,x,ans=0,t;\n scanf(\"%d%d\", &n,&m);\n x=n;\n do\n {\n t=x%m;\n x=x/m;\n ans=ans+x;\n x=x+t;\n }while(x>1);\n printf(\"%d\", ans+n);\n}", "lang": "GNU C11", "bug_code_uid": "0b6a87dca0d608557c159a843c809fa4", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "b01b55124da6af042079072e7f99480e", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.98559670781893, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(){\n\tlong long int n,count,a,c,k,st,i,p,d;\n\tscanf(\"%lld\",&n);\n\tcount=0;\n\t\n d=0;\n\tfor(i=2;i<=1000000;i++){\n\t\tst=n;\n\t\tk=st;\n\t\tc=0;\n\t\ta=0;\n\n\t\tif(i1){\n\t\t\tk=st/i;\n\t\t\tif(k*i==st){\n\t\t\t\tc=0;\n\t\t\t\ta++;}\n\t\t\telse{\t\t\t\t\n\t\t\t\tc++;\n\t\t\t\tbreak;}\n\t\t\tst=st/i;\n\t\t}\n\t\tif(c==0){\n\t\t\tprintf(\"%lld\\n\",i);\n\t\t break;}\n\t\tif(c!=0 && a!=0){\n\t\t\tprintf(\"1\\n\");\n\t\t\tbreak;}\n\t\t}\n\t\telse{\n\t\t\td++;\n\t\t\tbreak;}\n\t}\n\t\tif(d>0)\n\t\t\tprintf(\"%lld\\n\",n);\n\t\t\n\t\n\treturn 0;\n}\n\n\n", "lang": "GNU C11", "bug_code_uid": "c07d9fb756412257789106198815b3c6", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "07d8e0c4d5edd2d6d586337ea469e406", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7485029940119761, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "/* http://codeforces.com/problemset/problem/1243/C */\n/* If n = r*s where gcd(r,s) = 1, return 1. \nIf n = p^k, return p. */\n\n#include \n#include \n\nint main(){\n int i, n;\n scanf(\"%d\",&n);\n if(n == 1) return 1;\n for(i = 2; i <= n/2; i++){\n if(n % i == 0) break;\n }\n while(n % i == 0) n = n/i;\n if(n == 1){printf(\"%d\\n\",i);}\n else{printf(\"%d\\n\",n);}\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "f793847ee4a7c1f2b790355cad8e67c6", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "ca01f383cbeb1b2e7ffac3c6ff6efa65", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9777510523150932, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n\n#define MD\t1000000007\n\nint power(int a, int b) {\n\tint p;\n\n\tif (b == 0)\n\t\treturn 1;\n\tp = power(a, b / 2);\n\tp = (long long) p * p % MD;\n\tif (b % 2 == 1)\n\t\tp = (long long) p * a % MD;\n\treturn p;\n}\n\nint solve(int x) {\n\treturn power(2, x - 1);\n}\n\nint sign(int x) {\n\tint a, cnt;\n\n\tcnt = 0;\n\tfor (a = 2; a * a <= x; a++) {\n\t\tif (x % a == 0) {\n\t\t\tx /= a;\n\t\t\tcnt++;\n\t\t}\n\t\tif (x % a == 0)\n\t\t\treturn 0;\n\t}\n\tif (x > 1)\n\t\tcnt++;\n\treturn cnt % 2 == 0 ? 1 : -1;\n}\n\nint main() {\n\tint x, y, a, sum;\n\n\tscanf(\"%d%d\", &x, &y);\n\tif (y % x != 0) {\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\n\t}\n\ty /= x;\n\tsum = 0;\n\tfor (a = 1; a * a <= y; a++)\n\t\tif (y % a == 0) {\n\t\t\tsum = (sum + (sign(a) * solve(y / a) % MD) + MD) % MD;\n\t\t\tif (y / a != a)\n\t\t\t\tsum = (sum + (sign(y / a) * solve(a) % MD) + MD) % MD;\n\t\t}\n\tprintf(\"%d\\n\", sum);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4b2b45bf9a547c6093b4396112430cf2", "src_uid": "de7731ce03735b962ee033613192f7bc", "apr_id": "bd371a59fcd8b82ec85876af5d67cee7", "difficulty": 2000, "tags": ["dp", "combinatorics", "bitmasks", "number theory", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7873303167420814, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\n#define N\t500\n\nint main() {\n\tstatic char s[N + 1];\n\tstatic int dp[N][N];\n\tint n, h, i, j;\n\n\tscanf(\"%d%s\", &n, s);\n\tfor (i = 0, j = 1; j < n; j++)\n\t\tif (s[i] != s[j])\n\t\t\ts[++i] = s[j];\n\tn = i + 1;\n\tfor (i = 0; i < n; i++)\n\t\tdp[i][i] = 1;\n\tfor (i = n - 1; i >= 0; i--)\n\t\tfor (j = i + 1; j < n; j++) {\n\t\t\tdp[i][j] = 1 + dp[i][j - 1];\n\t\t\tfor (h = j - 1; h >= i && s[h] != s[j]; h--)\n\t\t\t\t;\n\t\t\tif (h >= i) {\n\t\t\t\tint x = dp[i][h] + dp[h + 1][j - 1];\n\n\t\t\t\tif (dp[i][j] > x)\n\t\t\t\t\tdp[i][j] = x;\n\t\t\t}\n\t\t}\n\tprintf(\"%d\\n\", dp[0][n - 1]);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "3900dc56148ec86668a078532313de6e", "src_uid": "516a89f4d1ae867fc1151becd92471e6", "apr_id": "fe2ce0ba348e75f024a0d6169e49c02b", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9979238754325259, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n, x, y, t, c;\n int a[101];\n int s[100]={};\n scanf(\"%d\", &n);\n for(x=1;x<=n;x++)\n {\n scanf(\"%d\", &a[x]);\n }\n t=1;\n a[0]=0;\n a[n+1]=1001;\n for(x=1;x<=n;x++)\n {\n if(a[x+1]==a[x]+1)\n {\n s[t]=s[t]+1;\n }\n else if(a[x+1]>a[x]+1)\n {\n t=t+1;\n }\n }\n for(x=n;x>0;x--)\n {\n for(y=x+1;y<=n;y++)\n {\n if(s[x]\n\n#define MAX(a, b) ((a > b) ? a : b)\n\nint main(){\n int k, a, b;\n scanf(\"%d%d%d\", &k, &a, &b);\n if(a >= k || b >= k || !a%k || !b%k){\n printf(\"%d\\n\", a/k+b/k);\n return;\n }\n printf(\"-1\\n\");\n}\n", "lang": "GNU C", "bug_code_uid": "b1ab622c3937f64da873757e824f3202", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "179c71b3cb45f4cb597cf49658478789", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9715536105032823, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint all_same_horizon(char str[8]){\n int i, counter=0;\n for(i=0; str[i]!='\\0'; i++){\n if(str[i]=='B') counter+=1;\n }\n if(counter==8) return 1;\n else return 0;\n}\n\nint B_counter(char str[8]){\n int i, count=0;\n for(i=0; str[i]!='\\0'; i++){\n if(str[i]=='B') count++;\n }\n return count;\n}\n\n\nint main(void)\n{\n int i,k=1, j,stroke=0, temp=0, final_stroke;\n char word[8];\n for(i=1; i<=8; i++){\n scanf(\"%s\", word);\n if(all_same_horizon(word)==1) stroke++;\n else temp=temp+B_counter(word);\n }\n final_stroke=stroke+(temp/(8-stroke));\n printf(\"%d\", final_stroke);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e914b514ed7a43fefced157de5d6c1cb", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "e08647c5e110601cd93ce0f137c67578", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.45589692765113976, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint main()\n{\n int m,d;\n scanf(\"%d %d\",m,d);\n if(m==1||m==3||m==5||m==7||m==8||m==10||m==12)\n {\n if(d>=5)\n printf(\"6\");\n else\n printf(\"5\");\n }\n else\n {\n if(m==2)\n {\n if(d==1)\n printf(\"4\");\n else\n printf(\"5\");\n }\n else\n {\n if(d>=6)\n printf(\"6\");\n else\n printf(\"5\");\n }\n }\n \n \n}", "lang": "GNU C", "bug_code_uid": "ceed89f37e91990bb78fb28190cae757", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "8b816cb14a82a4d9a6672c2df7e63db0", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9990079365079365, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n//#include \n\n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\nlong long c[500][500], k = 0;\n\nlong long Arr(int m, int n){\n\tlong long res = 1;\n\twhile(m--){\n\t\tres *= n--;\n\t\tres %= 998244353;\n\t}\n\treturn res;\n}\n\nvoid advance(int a){\n\tint i, j;\n\tfor(i = k; i <= a; i++){//\tprintf(\"\\n\");\n\t\tfor(j = 0; j <= i; j++){\n\t\t\tif(j == 0 || j == i){\n\t\t\t\tc[i][j] = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tc[i][j] = c[i - 1][j - 1] + c[i - 1][j];\n\t\t\t\tc[i][j] %= 998244353;\n\t\t\t}\n\t\t\t//printf(\"%d \",c[i][j]);\n\t\t}\n\t}\n}\n\nlong long count(int a, int b){\n\tint i;\n\tlong long s = 0;\n\tif(a > b){\n\t\ta = a + b;\n\t\tb = a - b;\n\t\ta = a - b;\n\t}\n\tadvance(a);\n\tfor(i = 0; i <= a; i++){\n\t//\tprintf(\"%d \",s);\n\t\ts += c[a][i] * Arr(i, b);\n\t\ts %= 998244353;\n\t}\n\treturn s;\n}\n\nint main(int argc, char *argv[]) {\n\tint a, b, c;\n\tlong long s;\n\tscanf(\"%d %d %d\", &a, &b, &c);\n\ts = count(a, b) * count(b, c);\n\ts %= 998244353;\n\ts *= count(a, c);\n\ts %= 998244353;\n\tprintf(\"%d\\n\",s);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "ca6781aaf6a85262fb0c833acefa5153", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "0690b866507d05a033fb59e43c4701f1", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9656218402426694, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include \n\n#define MOD % 998244353\n\nlong long C[2501][2501];\n\nvoid Set_Combination(int a, int b)\n{\n\tif (a == b || b == 0)\n\t{\n\t\tC[a][b] = 1;\n\t\treturn;\n\t}\n\tif (!C[a - 1][b])\n\t\tSet_Combination(a - 1, b);\n\tif (!C[a - 1][b - 1])\n\t\tSet_Combination(a - 1, b - 1);\n\tC[a][b] = (C[a - 1][b - 1] + C[a - 1][b]) MOD;\n}\n\nlong long Permutation(int a, int b)\n{\n\tint k;\n\tlong long r = 1;\n\tif (b == 0)\n\t\treturn 1;\n\tfor (k = a; k >= a - b + 1; k = k - 1)\n\t{\n\t\tr = (r * k)MOD;\n\t}\n\treturn r;\n}\n\nvoid Island(int a, int b, int * ans)\n{\n\tint i, j, small = (a >= b ? b : a);\n\tlong long temp = 0;\n\tfor (i = 0; i <= small;i = i + 1)\n\t{\n\t\ttemp = temp + C[b][i] * Permutation(a, i)MOD;\n\t}\n\t*ans = (*ans * temp MOD);\n\treturn;\n}\n\nint main(void)\n{\n\tint a, b, c, ans = 1;\n\t\n\tfor (a = 0; a <= 2500; a = a + 1)\n\t{\n\t\tfor (b = 0; b <= a; b = b + 1)\n\t\t{\n\t\t\tSet_Combination(a, b);\n\t\t}\n\t}\n\tscanf(\"%d %d %d\", &a, &b, &c);\n\tIsland(a, b, &ans);\n\tIsland(b, c, &ans);\n\tIsland(c, a, &ans);\n\tprintf(\"%d\", ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "39f5b11c05434977b3bc8e39ab2cfa10", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "a5c1b6a4ea2d772fd31ae75d2fb5793a", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.032632030914555604, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n#define ll long long\n#define rsw 998244353\n#define add(x,y) (x=((x)+(y)>=rsw)?((x)+(y)-rsw):((x)+(y)))\nusing namespace std;\nint T,n,a[2005],b[2005],c[2005],dp1[2005][2005][11],dp2[2005][2005][11],n1,n2,ans,p[2005],inv[2005];\nint C(int n,int m)\n{\n return (ll)p[n]*inv[m]%rsw*inv[n-m]%rsw;\n}\nint get(int m,int n)\n{\n if(m==0) return n?0:1;\n return (ll)p[n]*C(n+m-1,n)%rsw;\n}\nint main()\n{\n cin>>T;\n p[0]=1;\n for(int i=1;i<2005;i++) p[i]=(ll)p[i-1]*i%rsw;\n inv[0]=inv[1]=1;\n for(int i=2;i<2005;i++) inv[i]=(ll)(rsw-rsw/i)*inv[rsw%i]%rsw;\n for(int i=2;i<2005;i++) inv[i]=(ll)inv[i]*inv[i-1]%rsw;\n while(T--)\n {\n cin>>n,n1=n2=0;\n for(int i=1;i<=n;i++)\n {\n cin>>a[i];\n int len=0,now=a[i];\n while(now)\n {\n now/=10;\n len++;\n }\n if(len&1) b[++n1]=a[i]%11;\n else c[++n2]=a[i]%11;\n }\n dp1[0][0][0]=dp2[0][0][0]=1;\n memset(dp1,0,sizeof dp1);memset(dp2,0,sizeof dp2);\n for(int i=1;i<=n1;i++)\n for(int j=0;j<=i;j++)\n for(int k=0;k<11;k++)\n {\n dp1[i][j][k]=0;\n add(dp1[i][j][k],dp1[i-1][j][(k-b[i]+11)%11]);\n if(j) add(dp1[i][j][k],dp1[i-1][j-1][(k+b[i])%11]);\n }\n for(int i=1;i<=n2;i++)\n for(int j=0;j<=i;j++)\n for(int k=0;k<11;k++)\n {\n dp2[i][j][k]=0;\n add(dp2[i][j][k],dp2[i-1][j][(k-c[i]+11)%11]);\n if(j) add(dp2[i][j][k],dp2[i-1][j-1][(k+c[i])%11]);\n }\n for(int i=0;i<=n2;i++)\n for(int k=0;k<11;k++)\n add(ans,(ll)dp1[n1][n1/2][k]*p[n1/2]%rsw*p[n1-n1/2]%rsw*dp2[n2][i][(11-k)%11]%rsw*get(n1+1-(n1+1)/2,n2-i)%rsw*get((n1+1)/2,i)%rsw);\n printf(\"%d\\n\",ans);\n }\n}\n", "lang": "GNU C", "bug_code_uid": "46801dcff278d900d1b0cfca08c1dc8c", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "21fed819c7f9d1be571512f50b26e2b2", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9844020797227037, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main(){\n\tint i,k=0,a,b,c,n;\n\tint t[2];\n\tfor(i=0;i<2;i++){\n\t\tscanf(\"%d %d %d\",&a,&b,&c);\n\t\tt[i]=a+b+c;\n\t}\n\tscanf(\"%d\",&n);\n\twhile(t[0]>5){\n\t\tk++;\n\t\tt[0]-=5;\n\t}\n\twhile(t[i]<=0){\n\t\tk++;\n\t\tt[1]-=10;\n\t}\n\tif((k)<=n){\n\t\tprintf(\"YES\");\n\t}\n\telse\n\t\tprintf(\"NO\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "20d8facf1f762ba4e78d242ac979eb1b", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "854f05eb104fbe45b452a04d7a05240e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9973474801061007, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include\n\nint main(void) {\n\tint s,x1,x2,t1,t2,p,d,tt,tf;\n\tscanf(\"%d %d %d\",&s,&x1,&x2);\n\tscanf(\"%d %d\",&t1,&t2);\n\tscanf(\"%d %d\",&p,&d);\n\t\n\ttf=abs(x2-x1)*t2;\n\t\n if(p>x1&&d==1&&x2>x1)\n tt=(2*s-p+x2)*t1;\n else if(p=>x1&&d==1&&x2x1&&d==-1&&x2>x1)\n tt=(p+x2)*t1;\n else if(p>=x1&&d==-1&&x2x1)\n tt=(x2-p)*t1;\n else if(px1)\n tt=(x2+p)*t1;\n else if(p=tt)\n printf(\"%d\",tt);\n else\n printf(\"%d\",tf);\n\t\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "25fdcbb687194bc5baf606e0980ac177", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "a1603d04aefc9ed55c5cceda5f1d81ff", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9491360428328061, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 8, "fix_ops_cnt": 22, "bug_source_code": "#include\n#include\nint main(){\n int x;\n int s ,x1,x2,t1,t2,p,d;\n scanf(\"%d%d%d%d%d%d%d\",&s,&x1,&x2,&t1,&t2,&p,&d);\n if(t1>=t2){\n printf(\"%d\",abs(x2-x1)*t2);\n }\n else if(x2>x1){\n if(p<=x1&&d==1){\n x=((x1-p)*t1)/(t2-t1);\n if(x>=(x2-x1)){\n printf(\"%d\",(x2-x1)*t2);\n }\n else {\n printf(\"%d\",(x2-p)*t1);\n }\n }\n else if(p<=x1&&d==-1){\n x=((p+x1)*t1)/(t2-t1);\n if(x>=x2-x1){\n printf(\"%d\",(x2-x1)*t2);\n }\n else{\n printf(\"%d\",(p+x2)*t1);\n }\n }\n else if(p>x1&&d==1){\n x=(s-p+s+x1)/(t2-t1);\n if(x>=x2-x1){\n printf(\"%d\",(x2-x1)*t2);\n }\n else{\n printf(\"yes %d\",(s-p+s+x2)*t1);\n }\n }\n else {\n x=(p+x1)/(t2-t1);\n if(x>=x2-x1){\n printf(\"%d\",(x2-x1)*t2);\n }\n else{\n printf(\"%d\",(p+x2)*t1);\n }\n }\n }\n else{\n if(p>=x1&&d==-1){\n x=((-x1+p)*t1)/(t2-t1);\n if(x>=abs(-x2+x1)){\n printf(\"%d\",-(x2-x1)*t2);\n }\n else {\n printf(\"%d\",-(x2-p)*t1);\n }\n }\n else if(p>=x1&&d==1){\n x=((s-p+s-x1)*t1)/(t2-t1);\n if(x>=abs(x2-x1)){\n printf(\"%d\",(x2-x1)*t2);\n }\n else{\n printf(\"%d\",(s-p+s-x2)*t1);\n }\n }\n else if(p=abs(x2-x1)){\n printf(\"%d\",(x2-x1)*t2);\n }\n else{\n printf(\"%d\",x);\n }\n }\n else {\n \n x=(s-p+s-x1)/(t2-t1);\n if(x>=abs(x2-x1)){\n printf(\"%d\",(x2-x1)*t2);\n }\n else{\n printf(\"%d\",(s-p+s-x2)*t1);\n }\n }\n }\n}\n", "lang": "GNU C", "bug_code_uid": "016c6e407c14391b4704804f7bcc355c", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "c80bf7cd19831ec972289b0b3b93636b", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9569965870307168, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main()\n{\n\tint a, b, c, d, e, f, g, h, i, j;\n\tint ZA[10][10];\n\n\tscanf(\"%d%d%d%d\", &a, &b, &c, &d);\n\tfor (e = 0; e < a * b; ++e)\n\t\tZA[e / b][e % b] = 0;\n\tfor (e = 0; e < c; ++e) {\n\t\tscanf(\"%d%d\", &f, &g);\n\t\tZA[f - 1][g - 1] = 1;\n\t}\n\tfor (e = 0; e < a; ++e)\n\t\tfor (f = 0; f < b; ++f)\n\t\t\tZA[e][f] += (e > 0 ? ZA[e - 1][f] : 0) + (f > 0 ? ZA[e][f - 1] : 0) - (e > 0 && f > 0 ? ZA[e - 1][f - 1] : 0);\n\ti = 0;\n\tfor (e = 0; e < a; ++e)\n\t\tfor (f = 0; f < b; ++f)\n\t\t\tfor (g = 0; g < a; ++g)\n\t\t\t\tfor (h = 0; h < b; ++h) {\n\t\t\t\t\tj = ZA[g][h] - (e > 0 ? ZA[e - 1][h] : 0) - (f > 0 ? ZA[g][f - 1] : 0) + (e > 0 && f > 0 ? ZA[e - 1][f - 1] : 0);\n\t\t\t\t\tif (j >= d)\n\t\t\t\t\t\ti += 1;\n\t\t\t\t}\n\tprintf(\"%d\\n\", i);\n\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "80aadbfb070f882456687322e1e712e4", "src_uid": "9c766881f6415e2f53fb43b61f8f40b4", "apr_id": "730339840ad5989fd9f72ab0d6c27557", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.30306603773584906, "equal_cnt": 21, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 21, "bug_source_code": "#include \n\nint main() {\n\tint i, i1, j1, i2, j2, r, c, n, k, cnt, rectcnt;\n\tstatic int x[10], y[10];\n\n\tscanf(\"%d%d%d%d\", &r, &c, &n, &k);\n\tfor (i = 0; i < n; i++)\n\t\tscanf(\"%d%d\", &x[i], &y[i]);\n\trectcnt = 0;\n\tfor (i1 = 0; i1 < r; i1++)\n\t\tfor (j1 = 0; j1 < c; j1++) {\n\t\t\tcnt = 0;\n\t\t\tfor (i2 = 0; i2 <= i1; i2++)\n\t\t\t\tfor (j2 = 0; j2 <= j1; j2++)\n\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t\tif (x[i] - 1 == i2 && y[i] - 1 == j2)\n\t\t\t\t\t\t\tcnt++;\n\t\t\tif (cnt >= k)\n\t\t\t\trectcnt++;\n\t\t\tcnt = 0;\n\t\t\tfor (i2 = r - 1; i2 > i1; i2--)\n\t\t\t\tfor (j2 = 0; j2 <= j1; j2++)\n\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t\tif (x[i] - 1 == i2 && y[i] - 1 == j2)\n\t\t\t\t\t\t\tcnt++;\n\t\t\tif (cnt >= k)\n\t\t\t\trectcnt++;\n\t\t\tcnt = 0;\n\t\t\tfor (i2 = 0; i2 <= i1; i2++)\n\t\t\t\tfor (j2 = c - 1; j2 > j1; j2--)\n\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t\tif (x[i] - 1 == i2 && y[i] - 1 == j2)\n\t\t\t\t\t\t\tcnt++;\n\t\t\tif (cnt >= k)\n\t\t\t\trectcnt++;\n\t\t\tcnt = 0;\n\t\t\tfor (i2 = r - 1; i2 > i1; i2--)\n\t\t\t\tfor (j2 = c - 1; j2 > j1; j2--)\n\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t\tif (x[i] - 1 == i2 && y[i] - 1 == j2)\n\t\t\t\t\t\t\tcnt++;\n\t\t\tif (cnt >= k)\n\t\t\t\trectcnt++;\n\t\t}\n\tprintf(\"%d\\n\", rectcnt);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5ba50ff2f6d24a30d98d0a8b68519db1", "src_uid": "9c766881f6415e2f53fb43b61f8f40b4", "apr_id": "ce355472d82abd7e07917fc19719cf9a", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7272727272727273, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint main()\n{\n\tint a, b, c, t;\n\tscanf(\"%d %d %d\", &a, &b, &c);\n\tt = (int) ceil(a * c / b) - c;\n\tprintf(\"%d\\n\", t);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3b8961160be2d39e2f69c8b950e2268a", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "3b992615ed56331a1ef4a044ea50b46c", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.958217270194986, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\nshort a,b,c,temp;\nscanf(\"%hd%hd%hd\",&a,&b,&c);\nif(a<=b)\nprintf(\"0\");\nelse\n{\ntemp=(a-b)*c;\nc=temp/b;\nif(temp%b>0)\nc++;\nprintf(\"%hd\",c);\n}\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "afd7640286cba4d4a2759cdbbb2a51d4", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "b6b294ddc05bc463d168f27a47a28475", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9920318725099602, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main ()\n{\n long long int l, n, buttons;\n\n scanf (\"%l64d\", &n);\n\n l = 1, buttons = 0;\n\n while (l <= n)\n {\n buttons += l * (n - l) + 1;\n\n ++l;\n }\n\n printf (\"%l64d\\n\", buttons);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "92d6734130e07f48e2f066a873501fa2", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "f10d42978c7efedffa057158ee17e957", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9864288483908492, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#include\nint cmp[250];\nint cnt[10];\nint cmp1[250];\nint calc(int a){\n\tint cntx=0;\n\twhile(a){\n\t\ta/=7;\n\t\tcntx++;\n\t}\n\treturn cntx;\n}\nint insert(int x,int fix[]){\n\tif(x==0){\n\t\tfix[0]=0;\n\t\treturn 1;\n\t}\n\tint i,k; i=k=0;\n\twhile(x){\n\t\tfix[i++]=x%7;\n\t\tx/=7;\n\t}\n\tfor(k=0;k1)\n\t\treturn 0;\n\t}\n\treturn 1;\n}\nint main(){\n\tint a,b,c,d,e,f,g,h;\n\tscanf(\"%d%d\",&a,&b);\n\tint t = calc(a-1); int t1=calc(b-1);\n\tif(t+t1>7){\n\t\tprintf(\"0\");\n\t\treturn 0;\n\t}\n\tint i; int cnt=0;\n\tfor(i=0;i\n\n\nint check(int a, int b, int c)\n{\n\tint oc[7]={0}, sum=0,flag=0,i=0;\n\t\n\twhile(a)\n\t{\n\t\toc[a%7]++;\n\t\ta/=7;\n\t\tsum++;\n\t}\n\t\n\twhile(b)\n\t{\n\t\toc[b%7]++;\n\t\tb/=7;\n\t\tsum++;\n\t}\n\t\n\twhile(i<7)\n\t{\n\t\tif(oc[i]>1) flag=1;\n\t\ti++;\n\t}\n\t\n\tif(c-sum>1) flag=1;\n\t\n\tif(c-sum>0 && oc[0]==1) flag=1;\n\t\n\tif(flag==1) return 0;\n\t\n\telse return 1;\n}\n\nint main(void) {\n\tint n,m,i=0,a,d=0,ans=0;\n\t\n\tscanf(\"%d %d\",&n,&m);\n\n\ta=n-1;\n\twhile(1)\n\t{\n\t\td++;\n\t\ta/=7;\n\t\tif(a==0) break;\n\t}\n\t\n\ta=m-1;\n\twhile(1)\n\t{\n\t\td++;\n\t\ta/=7;\n\t\tif(a==0) break;\n\t}\n\t\n\tif(i>7) printf(\"0\");\n\t\n\telse\n\t{\n\t\ti=0;\n\t\twhile(i\n#include \ntypedef long long i64;\ni64 gcd(i64 a, i64 b) {\n\treturn b == 0 ? a : gcd(b, a % b);\n}\nbool is_prime(i64 n) {\n\tif(n <= 1) return false;\n\telse if(n <= 3) return true;\n\telse if(n % 2 == 0 || n % 3 == 0) return false;\n\tfor(i64 i = 5; i * i <= n; i += 6) if(n % i == 0 || n % (i + 2) == 0) return false;\n\treturn true;\n}\ni64 f(i64 x, i64 y) {\n\ti64 ans = 0, d;\n\twhile(y != 0) {\n\t\tif(is_prime(x)) {\n\t\t\tans += x < y ? y / x + y % x : y;\n\t\t\tbreak;\n\t\t}\n\t\twhile((d = gcd(x, y)) == 1LL && y != 0) ans++, y--;\n\t\tif(y == 0) break;\n\t\tx /= d, y /= d;\n\t}\n\treturn ans;\n}\nint main(void) {\n\ti64 x, y;\n\tscanf(\"%lld%lld\", &x, &y);\n\tprintf(\"%lld\\n\", f(x, y));\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "ab719de6b1d5504484cb75778fc7bd59", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "a72b93eb74c33a40cf75082afb1e8661", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9944506104328524, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "include \nint main()\n{\n int n,i,j,state=1;\n scanf(\"%d\",&n);\n int circle[n];\n int flea=1;\n for(i=0;i\nint main()\n{\n\tint a;\n\tscanf(\"%d\",a);\n\t(a & a-1)?printf(\"NO\"):printf(\"YES\");\n\treturn 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "68fc390b1cfa959c258d92acdf204bda", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "99634a62961eb0da2d93bd41f423307c", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9978902953586498, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \nint main ()\n{\n\tint *v, n, i, j, t;\n\tscanf (\"%d\",&n);\n\tv = (int*)calloc(n, sizeof(int));\n\t\n\tv[0] = 1;\n\ti = 2;\n\tj=0;\n\twhile (i <= n*n) {\n\t\tt = i - 1;\n\t\twhile (t>0) {\n\t\t\tj+=1;\n\t\t\tt--;\n\t\t\tif (j==n) \n\t\t\t\tj=0;\n\t\t}\n\t\tj++;\n\t\tif (j==n) \n\t\t\tj=0;\n\t\tif (j\n int main(){\n\t int i,j,n;\n\n\t scanf(\"%d\"&n);\n\n\t n&(n - 1) ? printf(\"N0\") : printf(\"YES\");\n\n\t return 0;\n }\n\n", "lang": "GNU C", "bug_code_uid": "89c803fa1ee8b4400dd085bb4ceacf20", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "94a55174ec580670965b12b333eb239e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9516129032258065, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main() {\n int n;\n scanf(\"%d\", &n);\n printf(\"%s\", n&(n-1) ? : \"YES\" ? \"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "fae51203ded04222859ed817252c8499", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "1e11775918a9226b35cc7f9e5e1eadca", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8444444444444444, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "main()\n{\n int n;\n scanf(\"%d\",&n);\n printf(\"%s\", n&(n-1) : \"YES\" ? \"NO\");\n}", "lang": "GNU C", "bug_code_uid": "cd3846853474b40c7d69d75fbfe6a11d", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "65cbd4857de5df3ac653c4b9e2dc723e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.877104377104377, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main()\n{\n int n;\n scanf(\"%d\", &n);\n int nv = n - 1;\n int c = 0;\n int k = 1;\n int p = 0;\n char sp[1001];\n char v[1001]; \n int i;\n for(i == 0; i < 1001; i++)\n {\n sp[i] = 0;\n v[i] = 0;\n }\n while((nv > 0) && (c == 0))\n {\n if(k==0)\n {\n if(sp[c] == 1)\n c = 1;\n sp[c] = 1;\n k = 1;\n }\n if(v[c] == 0) nv--;\n v[c] = 1;\n \u0441 = (\u0441 + k) % n;\n k = (k + 1) % n;\n }\n if(nv == 0)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "ab3cbb2a0aa40c264ec8c8044dcb7012", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "a267b57988b9b97d365b21a987395f63", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7946428571428571, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\nlong int x,y,z,sum=0;\nscanf(\"%ld %ld %ld\",&x,&y,&z);\n\nif(x==y)\nprintf(\"%ld\",(z*2)+b+a);\n\nelse if(x>y)\nprintf(\"%ld\",(z*2)+(x*2)+1);\n\nelse if(x\nint main()\n{\n int n,m,ans;\n scanf(\"%d%d\",&n,&m);\n int a[m],i;\n for(i=0;i\n#include\nint main()\n{\n int i,j,m,k,z,o,p,n,r,s,x,y,l;\n int sum[500];\n char efa[500];\n int ok;\n scanf(\"%d\",&ok);\n for(i=0; iy) x=y;}\n k++; break;\n }\n else if(k==1){\n if(efa[j]=='C') z=0;\n else{for(l=j; efa[l]!='C'; l++) z++;\n for(l=j; efa[l]!='C'; l--) o++;\n if(z>o) z=o;}\n k++; break;\n }\n else if(k==2){\n if(efa[j]=='T') p=0;\n else{for(l=j; efa[l]!='T'; l++) p++;\n for(l=j; efa[l]!='T'; l--) n++;\n if(p>n) p=n;}\n k++; break;\n }\n else if(k==3){\n if(efa[j]=='G') r=0;\n else{for(l=j; efa[l]!='G'; l++) r++;\n for(l=j; efa[l]!='G'; l--) s++;\n if(r>s) r=s;}\n k++; break;\n }\n }\n }\n}\nsum[i]=x+z+p+r;\n}\n int min=sum[0];\n for(i=1; i<(strlen(efa)-2); i++){\n if(sum[i]\n#include \nint main()\n{\n\tchar s[50];\n\tint n, i, sum = 0, mini = 10000;\n\n\tscanf(\"%d\", &n);\n\n\tfor (i = 0; i < n; i++)\n\t\tscanf(\"%c\", s[i]);\n\n\tfor (i = 0; i < n - 3; i++) \n\t{\n\n\t\tif (abs(s[i] - 'A')>13)\n\t\t\tsum += 26 - abs(s[i] - 'A');\n\t\telse\n\t\t\tsum += abs(s[i] - 'A');\n\n\t\tif (abs(s[i+1] - 'C')>13)\n\t\t\tsum += 26 - abs(s[i+1] - 'C');\n\t\telse\n\t\t\tsum += abs(s[i+1] - 'C');\n\n\t\tif (abs(s[i+2] - 'T')>13)\n\t\t\tsum += 26 - abs(s[i+2] - 'T');\n\t\telse\n\t\t\tsum += abs(s[i+2] - 'T');\n\n\t\tif (abs(s[i+3] - 'G')>13)\n\t\t\tsum += 26 - abs(s[i+3] - 'G');\n\t\telse\n\t\t\tsum += abs(s[i+3] - 'G');\n\n\t\tif (sum < mini) mini = sum;\n\n\t}\n\n\tprintf(\"%d\\n\", mini);\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "d306b56fa0c28354231eb26c43ad25c8", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "73e45d5559984b5cade0087bb1ab4b35", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.10181818181818182, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint power(int a,int b)\n{\n int sum=1;\n int i;\n for(i=0; i\nint main()\n{\n int sum=2,b=1,n,i;\n scanf(\"%d\",&n);\n\n if(n==1){\n b=1;\n }\n else{\n for(i=1; ;i++){\n sum=sum*2;\n if(sum>n){\n b++;\n sum=sum/2;\n n=n-sum;\n if(n==1){\n break;\n }\n sum=2;\n }\n if(sum==n){\n break;\n }\n }\n}\n printf(\"%d\",b);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "83162fe9e98d3a15a4a3799d8ba10695", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "95b1dfca811a857f197d51d8131e58f7", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5217391304347826, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main(int argc, char *argv[])\n{\n int n = *argv[1] - 48 , i,five = 5;\n for(i = 0; i< n; i++)\n {\n five *=5;\n }\n \n printf(\"%d\",five%100);\n \n}\n", "lang": "GNU C", "bug_code_uid": "ced8ecd6db8758ca06697b968a1ed0c3", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "5fb2f7de22c49124163f36d1e318a641", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9606003752345216, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nusing namespace std;\nint main(){\n int m,n,k;\n int x,y;\n scanf(\"%d%d%d\",&n,&m,&k);\n x=((k-1)/2)/m+1;\n y=k-m*(x-1)*2;\n y=(y-1)/2+1;\n printf(\"%d %d \",x,y);\n if(k%2==0)\n printf(\"R\\n\");\n else\n printf(\"L\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "e79f56119f209345fcf4d05b0db794e6", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "b2429e483a81fcf4a63ce7308a36f4df", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9919177075679647, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\n\nint main()\n{\n int i, j, k, s1=0, s2=0, d, c=0;\n char b[6];\n int a[6];\n for(i=0; i<6; ++i) {\n scanf(\"%c\", &b[i]);\n a[i] = b[i] - 48;\n }\n\n for(i=0; i<3; ++i)\n s1+=a[i];\n\n for(i=3; i<6; ++i)\n s2+=a[i];\n\n d = s1 - s2;\n\n if(d>0){\n for(i=0; i<3-1; ++i){\n for(j=i; j<3; ++j){\n if(a[i]a[j]){\n a[i] = a[i] ^ a[j];\n a[j] = a[i] ^ a[j];\n a[i] = a[i] ^ a[j];\n }\n }\n }\n i=0;\n j=3;\n\n while(d>0){\n if(a[i] > 9-a[j]){\n d -= a[i];\n c++;\n i++;\n }\n else {\n d -= 9-a[j];\n j++;\n c++;\n }\n }\n printf(\"%d\", c);\n }\n else if(d<0){\n for(i=0; i<3-1; ++i){\n for(j=i; j<3; ++j){\n if(a[i]>a[j]){\n a[i] = a[i] ^ a[j];\n a[j] = a[i] ^ a[j];\n a[i] = a[i] ^ a[j];\n }\n }\n }\n for(i=3; i<6-1; ++i){\n for(j=i; j<6; ++j){\n if(a[i]=0){\n if(9-a[i] > a[j] && i<3){\n d -= 9-a[i];\n c++;\n i++;\n }\n else if(9-a[i] < a[j] && j<6) {\n d -= a[j];\n c++;\n j++;\n }\n }\n printf(\"%d\", c);\n }\n else printf(\"0\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "db42c7dc8921997c16cd176377ee0185", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "ab90be9fd01c4ea3de0ccf81f00655dd", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9975903614457832, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main(){\nchar a[55],b[55]={'0'};\nscanf(\"%s\",a);\nint l=strlen(a);int i=0,j=0,k=0,t=l-1,temp;\nif(l%2==0){\nwhile(k=l){\n if(i%2==0){\n b[k]=a[t];t--;}\n else{\n b[k]=a[j];\n j++;}i++;k++;}}\nif(l%2!=0){\nwhile(k=0;i--) printf(\"%c\",b[i]);\nreturn 0;}\n", "lang": "GNU C11", "bug_code_uid": "60b87e662a3d1d9f23d25252f0c7ad1e", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "bdcc06765f863fa9651e683d811501e6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5342105263157895, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint f[600];\nint main()\n{\n int n,i,cnt=0;\n scanf(\"%d\", &n);\n int a[n];\n for(i = 0 ; i< n; i++)\n scanf(\"%d\", &a[i]);\n for(i = 1 ; i <= n; i++)\n {\n\n if(f[a[i]] == 0 )\n f[a[i]] = 1;\n\n }\n for( i = 0 ; i < 600; i++)\n {\n if(f[i] == 1)\n cnt++;\n }\n printf(\"%d\\n\", cnt);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "55c10324aae76c4dc0219b9ee50f24f9", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "3f4af013e8e314e143e1aa4027f6557d", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.886417791898332, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\nint dgt(long long int n)\n{\n int i,j,k;\n i=0;\n while(n>0)\n {\n n=n/10;\n i++;\n }\n return i;\n}\n\nlong long int power(long long int x,long long int y)\n{\n long long int temp,ty,my;\n //long long int mod;\n //mod=1000000007;\n if( y == 0)\n return 1;\n temp = power(x, y/2);\n ty=(temp)*(temp);\n if (y%2 == 0)\n {\n\n return ty;\n }\n else\n {\n my=(x)*(ty);\n return my;\n }\n}\n\n\nint main()\n{\n long long int w,m,k,x,y,s=0,l=0,ans;\n int d;\n scanf(\"%lld\",&w);\n scanf(\"%lld\",&m);\n scanf(\"%lld\",&k);\n d=dgt(m);\n while(sw)\n {\n x=(s-w)/((d-1)*k);\n //printf(\"%lld\\n\",s-w);\n //printf(\"%lld\\n\",x);\n //printf(\"%d\\n\",d);\n y=power(10,d-1);\n //printf(\"%lld\\n\",y);\n if((s-w)==((d-1)*k*x))\n ans=l-x;\n else\n ans=l-x-1;\n }\n printf(\"%lld\\n\",ans);\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "80943444d57f2124b05cc1a848a88a28", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "2ecbafd2f08f31dc53bdfd0d656f5672", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9671428571428572, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n int n,i,arr[6],count=0;\n scanf(\"%d\",&n);\n if(n==0)\n printf(\"0\");\n else if(n<10)\n printf(\"1\");\n else\n {\n int n1=n;\n while(n1)\n {\n count++;\n int arr[6]={0};\n for(i=0;i<6;i++)\n {\n if(n)\n {arr[i]=n%10;\n n/=10;}\n }\n int max=0;\n for(i=0;i<6;i++)\n if(max\nint maxDigit(unsigned long long);\n\nint main(){\n unsigned long long x, turns = 0;\n scanf(\"%l64d\", &x);\n while(x > 0){\n x -= maxDigit(x);\n turns++;\n }\n printf(\"%l64d\", turns);\n return 0;\n}\n\nint maxDigit(unsigned long long x){\n int maxD = 0, i;\n char str[19];\n sprintf(str, \"%l64d\", x);\n for(i = 0; str[i] != '\\0'; i++){\n if(str[i] == '9')\n return 9;\n else if((int) (str[i] - '0') > maxD)\n maxD = str[i] - '0';\n }\n return maxD;\n}\n", "lang": "GNU C", "bug_code_uid": "9e4c2544436714d2975ff8c175e488c3", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "9c891ffe2733564afd5d38a6448e5273", "difficulty": 1100, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7792370231394622, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n int i,j,t,b,min;\n scanf(\"%d\",&t);\n int a[t];\n for(i=0;imax1)\n {\n max[i]=b;\n max1=b;\n }\n }\n else if(j==i)\n {\n b=a[j+1]-a[j-1];\n if(b>max1)\n {\n max[i]=b;\n max1=b;\n }\n j++;\n }\n }\n }\n int l;\n min=max[1];\n for(l=2;l<=t-2;l++)\n {\n if(min>max[l])\n {\n min=max[l];\n }\n }\n printf(\"%d\\n\",min);\n return main();\n}\n", "lang": "GNU C", "bug_code_uid": "b0e2c3255a360520e1997fc355d628e5", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "369abb6a53487ee03a268334bb519e93", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3412759415833974, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n\n#define M\t1000000007\n\nint factorial(int n) {\n\treturn n == 0 ? 1 : (long long) factorial(n - 1) * n % M;\n}\n\nint main() {\n\tint i, n, f, g;\n\n\tscanf(\"%d\", &n);\n\tf = factorial(n);\n\tif (n % 2 == 0)\n\t\tprintf(\"0\\n\");\n\telse {\n\t\tg = 1;\n\t\tfor (i = 1; i <= n; i += 2)\n\t\t\tg = (long long) g * i % M;\n\t\tf = f * g % M;\n\t\tprintf(\"%d\\n\", f);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "96fcb3df6b383cea01e07936f4dc7cb7", "src_uid": "a6a804ce23bc48ec825c17d64ac0bb69", "apr_id": "6f1b2fc1c5c799682a320ae73a6cdf1a", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "combinatorics", "bitmasks", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9996073812328229, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\n#define MODULO 1000000007\n\nint ma[20][20];\nint b[20], col[20];\nint n;\n\nlong long sols[17] = {0,1,0,18,0,1800,0,670320,0,734832000,0,890786230,0,695720788,0,150347555,0};\n\nlong long dfs(int x, int k);\nlong long precalc();\n\nint main(){\n \n \t//precalc();\n\n\tint n;\n\tscanf(\"%d\", &n);\n\tprintf(\"%I64\\n\", sols[n]);\n\n#ifdef _AT_HOME_\n system(\"pause\");\n#endif\n\n return 0;\n}\t\n\nlong long dfs(int x, int k){\n\tif (k>n){\n\t\treturn 1;\n\t}\n\tint i;\n\tint t = 0;\n\tfor (i=1;i<=n;i++){\n\t\tif (b[ma[k][i]] || col[i]) continue;\n\t\tb[ma[k][i]] = 1;\n\t\tcol[i] = 1;\n\t\tt +=dfs(i, k+1);\n\t\tb[ma[k][i]] = 0;\n\t\tcol[i] = 0;\n\t}\n\treturn t;\n}\n\nlong long precalc(){\n\tint tt;\n\tfor (tt=1;tt<16;tt+=2){\n\n\t\tint i,j;\n\t n = tt;\n\n\t for (i=1;i<=n;i++){\n\t \tfor (j=1;j<=n;j++){\n\t \t\tma[i][j] = (i-1+j-1) % n + 1;\n\t \t}\n\t }\n\n\t long long sol = 0;\n\t for (i=1;i<=1;i++){\n\t \tb[ma[1][i]] = 1;\n\t \tcol[i] = 1;\n\t \tsol += dfs(i, 2);\n\t \tif (sol>MODULO){\n\t \t\tsol -= MODULO;\n\t \t}\n\t \tb[ma[1][i]] = 0;\n\t \tcol[i] = 0;\n\t }\n\n\t sol *= n;\n\t sol %= MODULO;\n\n\t long long fak = 1;\n\t for (i=2;i<=n;i++){\n\t \tfak *= i;\n\t \tfak %= MODULO;\n\t }\n\n\t sol *= fak;\n\t sol %= MODULO;\n\n\t printf(\"%I64d\\n\", sol);\n\t}\n}", "lang": "GNU C", "bug_code_uid": "7839dbd6fb6a45046da6da696c281001", "src_uid": "a6a804ce23bc48ec825c17d64ac0bb69", "apr_id": "c98126442cf637ba36b9eba20ad11012", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "combinatorics", "bitmasks", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.983991462113127, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,h,m,i,j,num,ans=0;\n scanf(\"%d%d%d\",&n,&h,&m);\n int l[n],r[n],x[n];\n for(i=0; i=l[j] && i<=r[j])\n {\n if(num>x[j])\n num=x[j];\n }\n }\n ans=ans+(num*num);\n }\n printf(\"%d\\n\",ans);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ff6bcd75f4dea07f956c9d51e05a8c86", "src_uid": "f22b6dab443f63fb8d2d288b702f20ad", "apr_id": "37c1285c742739672d5ca6f5a890e9e4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9444444444444444, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n\nint main(){\nint n, c, price[101], i, selisih[100], ans=0, a=0, ans2, b=0;\nscanf(\"%d %d\",&n, &c);\n\nfor(i=0;iprice[i+1]){\n selisih[b]=price[i]-price[i+1];\n \n b++;\n a++;\n \n }\n}\nfor(i=0;ians){\n ans=selisih[i];\n }\n}\n\nans2=ans-c;\nif(ans2>=0){\nprintf(\"%d\",ans2);\n}\nelse{\n return 1;\n}\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "498a011539ab803001c330752f3e68ab", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "7cecd5fe8fe834170b9a1d83e4f6fcc1", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8717015468607825, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n#include\n\n#define MAX_LEN 1e2\n\n\n\nint main(int argc,char** argv) {\n int n,t;\n char* s = (char*)malloc(n);\n scanf(\"%d%d\",&n,&t);\n scanf(\"%s\",s);\n while(t--) {\n for(int i = 0;i < n-1;) {\n if(s[i] == 'G') {\n i++;\n continue;\n }\n if(s[i+1] == 'G') {\n s[i] = 'G';\n s[i+1] = 'B';\n i+=2;\n }\n }\n }\n printf(\"%s\",s);\n free(s);\n}\n\n\n\n", "lang": "GNU C11", "bug_code_uid": "ba8dd1f40f81de265508c389451a8adf", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "e335f451d4ddcc9d512e4189b518cfb0", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9592760180995475, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main(){\n int a, b, i, res1 = 0, res2 = 0; res3 = 0;\n scanf(\"%d %d\", &a, &b);\n for (i = 1; i <= 6; i++)\n if (abs(a-i) > abs(b-i)) res1++;\n else if (abs(a-i) == abs(b-i)) res2++;\n else if (abs(a-i) < abs(b-i)) res3++;\n printf(\"%d %d %d\", res1, res2, res3);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c5ec103df3619741079f9d0d125a35d8", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "fd7a4f2746b6e45aa4f792f06145b186", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.17758726270667483, "equal_cnt": 26, "replace_cnt": 24, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 26, "bug_source_code": "#include\n#include\n#define max(a,b) a>b?a:b;\n#define min(a,b) (a>b?b:a)\nint main()\n{\n int T;\n while(scanf(\"%d\",&T)!=EOF)\n {\n \twhile(T--)\n \t{\n \t\tint n,sum,k,w[110],v[110],dp[110][35],a[35],b[35];\n \t\tmemset(dp,0,sizeof(dp));\n \t\tmemset(a,0,sizeof(a));\n \t\tmemset(b,0,sizeof(b));\n \t\tscanf(\"%d %d %d\",&n,&sum,&k);\n \t\tfor(int i=0;i=w[i];j--)\n \t\t\t{\n \t\t\t\tfor(int z=1;z<=k;z++) \n\t\t\t\t{\n\t\t\t\t\ta[z]=dp[j][z];\n\t\t\t\t\tb[z]=dp[j-w[i]][z]+v[i];\n\t\t\t\t}\n\t\t\t\tfor(int x=1,y=1,z=1;z<=k&&(x<=k||y<=k);)\n\t\t\t\t{\n\t\t\t\t\tif(a[x]>b[y])\n\t\t\t\t\t{\n\t\t \tdp[j][k]=a[x];\n\t\t x++;\n\t\t }\n\t\t else\n\t\t\t\t\t{\n\t\t dp[j][k]=b[y];\n\t\t y++;\n\t\t }\n\t\t if(dp[j][k] != dp[j][k-1])\n\t\t \tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\",dp[sum][k]);\n\t}\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "855c3f1abd5755c1dc5b256d1abd4d6c", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "ea031efa944dda3bd8b4d83ff47471d6", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.12087912087912088, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint n,a,b,t,i;\nint lgx(int x,int y)\n{\n int i;\n while(y)\n {i=x%y;\n x=y;\n y=i;}\n return x;\n}\nint main()\n{\n scanf(\"%d%d%d\",&a,&b,&n);\n t=a*b/lgx(a,b);\n if(n%t)\n printf(\"%d\\n\",(n/t+1)*t);\n else\n printf(\"%d\\n\",n/t*t);\n return 0;\n }\n//QAQ", "lang": "GNU C11", "bug_code_uid": "d7596a29b221c275dce8e8da8de7f822", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "6ea934e7c0f05d5c16090ad40abe088f", "difficulty": 2000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.450796626054358, "equal_cnt": 21, "replace_cnt": 16, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "#include \n#include \n#include \n\nint determine(int *guesses, int *bulls, int *cows, int n);\nbool is_solution(int k, int *guesses, int *bulls, int *cows, int n);\nbool fits(int k, int guess, int bulls, int cows);\n\nint main() {\n\tint n = 0, k = 0, result = 0;\n\tint *guesses = NULL;\n\tint *bulls = NULL;\n\tint *cows = NULL;\n\t\n\tscanf(\"%d\", &n);\n\t\n\tguesses = calloc(n, sizeof(int));\n\tbulls = calloc(n, sizeof(int));\n\tcows = calloc(n, sizeof(int));\n\t\n\tfor(k=0; k\n\nint main()\n{\n int n, num = 0, count = 0, i, j, k;\n int a[10][4], b[10], c[10];\n int d[10000] = {0};\n\n scanf(\"%d\", &n);\n\n for (i = 0; i < n; i++) {\n\t for (j = 0; j < 4; j++) scanf(\"%1d\", &a[i][j]);\n\n\t scanf(\"%d %d\", &b[i], &c[i]);\n }\n\n for (i = 0; i < 10000; i++) {\n\t int x = i;\n\t int p[10] = {0};\n\n\t for (j = 0; j < 4; j++) {\n\t p[x % 10]++;\n\n\t x /= 10;\n\t }\n\n\t for (j = 0; j < 10; j++) {\n\t if (p[j] > 1) d[i] = 1;\n\t }\n }\n\n for (i = 0; i < n; i++) {\n\t for (j = 0; j < 10000; j++) {\n\t if (d[j] == 0) {\n\t\t int p[10] = {0};\n\t\t int x = j, y = 0, z = 0;\n\n\t\t for (k = 0; k < 4; k++) p[a[i][k]]++;\n\n\t\t for (k = 0; k < 4; k++) {\n\t\t\t p[x % 10]++;\n\n\t\t\t if (x % 10 == a[i][3 - k]) y++;\n\n\t\t\t x /= 10;\n\t\t }\n\n\t\t for (k = 0; k < 10; k++) {\n\t\t\t if (p[k] == 2) z++;\n\t\t }\n\n\t\t if (y != b[i] || z - y != c[i]) d[j] = 1;\n\t }\n\t }\n }\n\n for (i = 0; i < 10000; i++) {\n\t if (d[i] == 0) {\n\t num = i;\n\t count++;\n\t }\n }\n\n if (count > 1) {\n\t puts(\"Need more data\");\n } else if (count == 1) {\n\t printf(\"%d\\n\", num);\n } else {\n\t puts(\"Incorrect data\");\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a22cddd2ec4553e91ce1c3ae061704a1", "src_uid": "142e5f2f08724e53c234fc2379216b4c", "apr_id": "1db3228e442399a271085d38240cfb74", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.998769987699877, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main() {\n\tlong int x,y;\n\tscanf(\"%ld %ld\",&x,&y);\n\tif(x==y)\n\t printf(\"=\");\n\telse if((x==2)&&(y==3))\n\t printf(\"<\");\n\telse if((x==3)&&(y==2))\n\t printf(\">\");\n\telse if((x==2)&&(y==4))\n\t printf(\"=\");\n\telse if((x==4)&&(y==2))\n\t printf(\"=\");\n\telse if(x==1)\n\t printf(\"<\");\n\telse if(y==1)\n\t printf(\">\")\n\telse if(x\");\n\telse\n\t printf(\"<\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "abc80748d71996b2e20372b901c59e22", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "103f9c3b7c92b67fc53d102efb12f2a3", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.40931545518701484, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n#define MAX 1000000001\nint main()\n{\n int *angka,input,i,penanda=0,temp;\n angka = (int *)malloc(sizeof(int));\n angka[0] = 1;\n angka[1] = 2;\n angka[2] = 3;\n angka[3] = 4;\n angka[4] = 5;\n scanf(\"%d\",&input);\n for(i=5;i\nint main()\n{\n long long int w, h;\n scanf(\"%lld %lld\", &w, &h);\n printf(\"%lld\", ((w*w)/4 * (h*h)/4));\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8b92d615bb513e7507eb7a5f797bef39", "src_uid": "42454dcf7d073bf12030367eb094eb8c", "apr_id": "c2b3e2ea8f6c0fb8fc23adf54b627734", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9739478957915831, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#define MIN(i,j) i\n#include \n\n#define UL 0\n#define UR 1\n#define BL 2\n#define BR 3\n#define h 1\n//printf(\"here! line: %d \", __LINE__); fflush(stdout)\ntypedef unsigned long long\tult;\n\ntypedef struct\ts_po\n{\n\tint x, y;\n}\t\t\t\tt_po;\n\ntypedef struct\ts_sq\n{\n\tint surface, width, height;\n\tt_po corner[4];\n}\t\t\t\tt_sq;\n\nt_sq\tmake_square(int x1, int y1, int x2, int y2);\nint\t\tc_inshape(t_po p, t_sq s);\n\nvoid\tcheck_periphery(t_sq s1, t_sq s2, t_sq s3)\n{\n\tt_sq s = make_square(s2.corner[UL].x - 1, s2.corner[UL].y - 1, s2.corner[BR].x + 1, s2.corner[BR].y + 1);\n\tt_po c1, c2;\n\tt_po inc[4];\n\tinc[UL].x = 1;\n\tinc[UL].y = 0;\n\tinc[UR].x = 0;\n\tinc[UR].y = 1;\n\tinc[BR].x = -1;\n\tinc[BR].y = 0;\n\tinc[BL].x = 0;\n\tinc[BL].y = -1;\n\tint i = -1;\n\th;\n\t//printf(\"\\n\");\n\twhile (++i < 4)\n\t{\n\t\tc1 = s2.corner[i];\n\t\tc2 = s2.corner[i == UL ? UR : (i == UR ? BR : (i == BR ? BL : UL))];\n\t\twhile (c1.x != c2.x || c1.y != c2.y)\n\t\t{\n\t\t\tif (c_inshape(c1, s1) && !c_inshape(c1, s3))\n\t\t\t{\n\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t\tc1.x += inc[i].x;\n\t\t\tc1.y += inc[i].y;\n\t\t\t//printf(\"\\rc1.x = %d c2.x = %d c1.y = %d c2.y = %d\", c1.x, c2.x, c1.y, c2.y);\n\t\t}\n\t}\n\th;\n}\n\nint\t\tc_inshape(t_po p, t_sq s)\n{\n\tif (p.x >= s.corner[UL].x && p.x <= s.corner[BR].x &&\n\t\tp.y >= s.corner[UL].y && p.y <= s.corner[BR].y)\n\t\treturn (1);\n\treturn (0);\n}\n\nt_sq\tmake_square(int x1, int y1, int x2, int y2)\n{\n\tt_sq ret;\n\n\tret.corner[UL].x = x1;\n\tret.corner[UL].y = y1;\n\tret.corner[UR].x = x2;\n\tret.corner[UR].y = y1;\n\tret.corner[BR].x = x2;\n\tret.corner[BR].y = y2;\n\tret.corner[BL].x = x1;\n\tret.corner[BL].y = y2;\n\tret.height = y2 - y1;\n\tret.width = x2 - x1;\n\tret.surface = ret.height * ret.width;\n\treturn (ret); \n}\n\nint\t\tmain()\n{\n\tint x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6;\n\tscanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2);\n\tscanf(\" %d %d %d %d\", &x3, &y3, &x4, &y4);\n\tscanf(\" %d %d %d %d\", &x5, &y5, &x6, &y6);\n\tt_sq s1, s2, s3;\n\tt_po p;\n\ts1 = make_square(x1, y1, x2, y2);\n\ts2 = make_square(x3, y3, x4, y4);\n\ts3 = make_square(x5, y5, x6, y6);\n\th;\n\tif (s3.surface + s2.surface < s1.surface)\n\t{\n\t\tprintf(\"YES\\n\");\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\th;\n\t\tif ((c_inshape(s1.corner[UL], s2) || c_inshape(s1.corner[UL], s3)) &&\n\t\t\t(c_inshape(s1.corner[UR], s2) || c_inshape(s1.corner[UR], s3)) &&\n\t\t\t(c_inshape(s1.corner[BL], s2) || c_inshape(s1.corner[BL], s3)) &&\n\t\t\t(c_inshape(s1.corner[BR], s2) || c_inshape(s1.corner[BR], s3)))\n\t\t{\n\t\t\tcheck_periphery(s1, s2, s3);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"YES\\n\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\tprintf(\"NO\\n\");\n}", "lang": "GNU C11", "bug_code_uid": "5f32e92621e73dc530d207cb2a985caf", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "0040ab9071bb606fb6fbd24b68e761ef", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.368755676657584, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \nmain()\n{\n unsigned long x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6;\n scanf(\"%lu %lu %lu %lu\",x1,y1,x2,y2);\n scanf(\"%lu %lu %lu %lu\",x3,y3,x4,y4);\n scanf(\"%lu %lu %lu %lu\",x5,y5,x6,y6);\n if (((y5<=y1 && y6>=y3 && y4>=y2) || (y3<=y1 && y4>=y5 && y6>=y2)) && (x3<=x1) && (x5<=x1) && (x4>=x2) && (x6>=x2) )\n printf(\"YES\");\n else printf(\"NO\");\n}", "lang": "GNU C11", "bug_code_uid": "8d7be471776b759de44b7c4857ac25da", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "022fa5bddde95df67ae411048bf9f3c5", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8947873361048929, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nstruct mystuct{\n\tint x1,y1,x2,y2;\n};\nint main(void)\n{\n\tmystuct input1,input2,input3;\n\tscanf(\"%d %d %d %d\",&input1.x1,&input1.y1,&input1.x2,&input1.y2);\n\tscanf(\"%d %d %d %d\",&input2.x1,&input2.y1,&input2.x2,&input2.y2);\n\tscanf(\"%d %d %d %d\",&input3.x1,&input3.y1,&input3.x2,&input3.y2);\n\tgetchar(); \n\tif(input2.x1 <= input1.x1 && input2.y1 <= input1.y1 &&\n\t input2.x2 >= input1.x2 && input2.y2 >= input1.y2) printf(\"NO\"); //b\u5168\u8986\u76d6a \n\telse if(input3.x1 <= input1.x1 && input3.y1 <= input1.y1 &&\n\t \t \tinput3.x2 >= input1.x2 && input3.y2 >= input1.y2) printf(\"NO\"); //c\u5168\u8986\u76d6a \n\telse if(input2.y1 <= input1.y1 && input2.y2 >= input1.y2 &&\n\t\t\tinput3.y1 <= input1.y1 && input3.y2 >= input1.y2 &&\n\t\t\tinput2.x1 <= input1.x1 && input3.x1 <= input2.x2 && \n\t\t\tinput3.x2 >= input1.x2) printf(\"NO\"); //b,c\u5de6\u53f3\u8986\u76d6 \n\telse if(input3.y1 <= input1.y1 && input3.y2 >= input1.y2 &&\n\t\t\tinput2.y1 <= input1.y1 && input2.y2 >= input1.y2 &&\n\t\t\tinput3.x1 <= input1.x1 && input2.x1 <= input3.x2 && \n\t\t\tinput2.x2 >= input1.x2) printf(\"NO\"); //c,b\u5de6\u53f3\u8986\u76d6 \n\telse if(input2.x1 <= input1.x1 && input2.x2 >= input1.x2 &&\n\t\t\tinput3.x1 <= input1.x1 && input3.x2 >= input1.x2 &&\n\t\t\tinput2.y1 >= input1.y2 && input3.y1 >= input2.y1 &&\n\t\t\tinput3.y2 >= input1.y2 && input2.y2 >= input1.y2) printf(\"NO\"); //b,c\u4e0a\u4e0b\u8986\u76d6 \n\telse if(input3.x1 <= input1.x1 && input3.x2 >= input1.x2 &&\n\t\t\tinput2.x1 <= input1.x1 && input2.x2 >= input1.x2 &&\n\t\t\tinput3.y1 >= input1.y2 && input2.y1 >= input3.y1 &&\n\t\t\tinput2.y2 >= input1.y2 && input3.y2 >= input1.y2) printf(\"NO\"); //c,b\u4e0a\u4e0b\u8986\u76d6 \n\telse printf(\"YES\"); //\u8fd8\u6709\u767d\u8272\u90e8\u5206\u9732\u51fa \n\treturn 0;\n}\n\n\n", "lang": "GNU C11", "bug_code_uid": "1fa64665043e7aaf8753792495de4e15", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "bd1637a0cf0e0b5341ee684008b296dd", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6643356643356644, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "#include \nint main() \n{\n int a,b,c,d,sum=0,i;int temp[10]={0};\n scanf(\"%d %d %d %d\",&a,&b,&c,&d);\n temp[0]=a;\n temp[1]=c;\n temp[2]=d;\n int min=100;\n for(i=0;i<3;i++)\n {\n if(temp[i]\nlong long int main(long long int argc, char const *argv[])\n{\n\tlong long int n,m;\n\tscanf(\"%lld%lld\",&n,&m);\n\tlong long int a[m];\n\tfor(long long i=0;i\n#include \n#include \n\n\nuint64_t getBlkCount(uint32_t l,uint32_t b,uint32_t div)\n{\n uint64_t blkCnt = 0;\n for(int i=1;i<=l;i++)\n for(int j=1;j<=b;j++)\n {\n blkCnt+= (((i*i + j*j)%div)==0);\n }\n return blkCnt;\n}\n\n\nuint64_t getCount(uint32_t n,uint32_t m)\n{\n int q = n/m, r = n%m;\n \n uint64_t fullBlkCnt = getBlkCount(m,m,m);\n uint64_t halfBlkCnt = getBlkCount(r,m,m);\n uint64_t remBlkCnt = getBlkCount(r,r,m);\n\n uint64_t blkCnt = fullBlkCnt*q*q + halfBlkCnt*2*q + remBlkCnt;\n\n return (blkCnt);\n}\n\nint main()\n{\n uint32_t n,m;\n uint64_t count;\n scanf(\"%d %d\",&n,&m);\n printf(\"%lu\\n\",getCount(n,m));\n}", "lang": "GNU C11", "bug_code_uid": "444b7f19471471494e5d9b42baf97a6d", "src_uid": "2ec9e7cddc634d7830575e14363a4657", "apr_id": "0c6d976cba6b6815849f034c92e1460a", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.18316831683168316, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{int t=0,i=1,g=1;\nchar s[100];\nscanf(\"%s\",&s);\nwhile(s[i]!='\\0')\n{g++;\nif(s[i]!=s[i-1])\ng=1;\nif(g>=7)\nt=1;\n}\nif(t==1)\nprintf(\"Yes\");\nelse\nprintf(\"No\");\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "011f3076632a018c0502be9d471aec3b", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "32ef1e16ac0d81e7cdd223d4a8e17cb0", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2253797158255757, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n#include \n\n#define MAX 200010\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nbool visited[76][76][76][76][2], dp[76][76][76][76][2];\n\nbool F(int x1, int y1, int x2, int y2, int p){\n if (x1 == 0 && y1 == 0) return true;\n if (x2 == 0 && y2 == 0) return false;\n if (visited[x1][y1][x2][y2][p]) return dp[x1][y1][x2][y2][p];\n\n bool res = false;\n if (p){\n if (x1 && (x1 - 1) != x2 && F(x1 - 1, y1, x2, y2, p ^ 1)) res = true;\n if (y1 && (y1 - 1) != y2 && F(x1, y1 - 1, x2, y2, p ^ 1)) res = true;\n }\n else{\n res = true;\n if (x2 && (x2 - 1) != x1 && F(x1, y1, x2 - 1, y2, p ^ 1)) res = false;\n if (y2 && (y2 - 1) != y1 && F(x1, y1, x2, y2 - 1, p ^ 1)) res = false;\n if (x2 && y2 && (x2 - 1) != x1 && (y2 - 1) != y1 && F(x1, y1, x2 - 1, y2 - 1, p ^ 1)) res = false;\n }\n\n visited[x1][y1][x2][y2][p] = true;\n return (dp[x1][y1][x2][y2][p] = res);\n}\n\nint main(){\n int i, j, k, l, x1, y1, x2, y2, polycarp = 0, vasilly = 0;\n\n\n while (scanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2) != EOF){\n if (F(x1, y1, x2, y2, 1)) puts(\"Polycarp\");\n else puts(\"Vasiliy\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "139804184663acf1aa6374c9aede6453", "src_uid": "2637d57f7809ff8f922549c617709074", "apr_id": "2d15a4075a212f31286630b6145feaae", "difficulty": 1700, "tags": ["math", "greedy", "games", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.996309963099631, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint max(int a,int b);\nint main()\n{ int a,b,c,d,i,j,k,x1,y1,x2,y2;\n scanf(\"%d %d %d %d\",&x1,&y1,&x2,&y2);\n if(x1>x2 && y1>y2)\n { printf(\"Vasiliy\");\n\n }\n else if(x2==0 || y2==0)\n {\n if(x1+y1<=x2+y2)\n {\n printf(\"Polycarp\");\n }\n else\n {\n printf(\"Vasiliy\");\n }\n }\n\n else if(x2>x1 && y2>y1)\n { if(x1+y1<=max(x2,y2))\n {\n printf(\"Polycarp\");\n }\n else if(x1+1==x2 && y1+1==y2 )\n {printf(\"Polycarp\");}\n else\n {\n printf(\"Vasiliy\");\n }\n }\n else if(x1==x2)\n {\n if(y1=b)\n {\n return a;\n }\n else\n {\n return b;\n }\n\n }", "lang": "GNU C", "bug_code_uid": "c5d8137d66d7639b8dcfde633cfe8823", "src_uid": "2637d57f7809ff8f922549c617709074", "apr_id": "3684de602bc8b105adfdb2f080c01a01", "difficulty": 1700, "tags": ["math", "greedy", "games", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9966996699669967, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int a[n],b[n],x=0,y=0;\n for(int i=0;i=y)\n printf(\"Yes\");\n else\n printf(\"No\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "ddfd4f83878d06d6f371f60e80bcc90f", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "2fd391f4dbba7259650ab6a7d8df3ab9", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.13675213675213677, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main() {\n\tint n;\n\twhile (scanf(\"%d\", n) != EOF) {\n\t\tif (n > 1 && n <= 10)\n\t\t\tprintf(\"0\\n\");\n\t\telse if(n == 11)\n\t\t\tprintf(\"4\\n\");\n\t\telse if (n == 12)\n\t\t\tprintf(\"4\\n\");\t\n\t\telse if (n == 13)\n\t\t\tprintf(\"4\\n\");\t\n\t\telse if (n == 14)\n\t\t\tprintf(\"4\\n\");\n\t\telse if (n == 15)\n\t\t\tprintf(\"4\\n\");\n\t\telse if (n == 16)\n\t\t\tprintf(\"4\\n\");\n\t\telse if (n == 17)\n\t\t\tprintf(\"4\\n\");\t\n\t\telse if (n == 18)\n\t\t\tprintf(\"4\\n\");\n\t\telse if (n == 19)\n\t\t\tprintf(\"4\\n\");\n\t\telse if (n == 20)\n\t\t\tprintf(\"15\\n\");\n\t\telse if (n == 21)\n\t\t\tprintf(\"0\\n\");\n\t\telse if (n == 22)\n\t\t\tprintf(\"0\\n\");\n\t\telse if (n == 23)\n\t\t\tprintf(\"0\\n\");\n\t\telse if (n == 24)\n\t\t\tprintf(\"0\\n\");\n\n\t}\n\treturn 0;\n}\n \t\t\t\t\t \t\t\t\t\t\t\t\t \t\t\t \t\t", "lang": "GNU C", "bug_code_uid": "6274af8257254a16e5a865ee528e4795", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "3ff771b78f9b124304b1df1a922459da", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.13680154142581888, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint main()\n{\n int n,i,count=0,j,k;\n scanf(\"%d\",&n);\n char str[n];\n int ara[n];\n scanf(\"%s\",str);\n for(i=0,j=0;i=4){\n printf(\"yes\");\n break;\n }\n }\n if(i==21)printf(\"no\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5e43c202b85e9a9f1d8f1ea8c7090ca2", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "08d7aea1d326cfe3eed9e1bd4c8bdaf6", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8153846153846154, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n long int x,y,z,a,b,c,c1,c2,c3,i;\n scanf(\"%ld %ld %ld\",&x,&y,&z);\n scanf(\"%ld %ld %ld\",&a,&b,&c);\n if(x>a)\n return printf(\"NO\\n\");\n c2=a-x+b-y;\n if(c2<0)\n return printf(\"NO\\n\");\n c3=c2+c-z;\n if(c3<0)\n return printf(\"NO\\n\");\n else\n printf(\"YES\\n\");\n return 0;\n\n}", "lang": "GNU C11", "bug_code_uid": "222abc91c94e893dd6f31e48294a7e09", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "bc985934cf88af963a1fa37c092373da", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9948453608247423, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//holiday of inequality\n#include\nint main(void)\n{\nint n;\nscanf(\"%d\",&n);\nint min=0;\nint ctr=0;\nint m=1;\nfor(int q=n;n>0;q--)\n{\nctr+=q*m;\nif(q!=n)\nm++;\n\n}\n\nprintf(\"%d\",ctr);\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b93d09e80fb136730452331d658f2a0f", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "670c4d32d7230f2aba7dc1f5d5ad65d2", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8623655913978494, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \nint main()\n{ int nb=1,mult=1;\n unsigned n,*a;\n scanf(\"%u\",&n);\n a=(unsigned *)malloc(n*sizeof(unsigned));\n for(int i=0;i\n#include\n\nusing namespace std;\n\nint main(){\n long long int n,sum=0,x,y;\n scanf(\"%lld\",&n);\n \n if(n==0)\n cout<0){\n sum+=(x%10);\n x/=10;\n }\n while(y>0){\n sum+=(y%10);\n y/=10;\n }\n printf(\"%lld\\n\",sum);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cab2899b8e0dc8ae943647374b4530f1", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "17c0b3906282364210ac9a121d27389e", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.989010989010989, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint main()\n{\n char a[200];\n scanf(\"%s\",a);\n int i,c=0,co=0;\n for(i=0;i\n\nmain()\n{\n int i=0, j=0;\n char a;\n while(a!='\\n')\n {\n scanf(\"%c\", &a);\n if(a=='o')\n i++;\n else if(a=='-')\n j++;\n }\n if((j>=i && j%i==0) || j==0)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n}", "lang": "GNU C11", "bug_code_uid": "03f2950eb4bd974bfce53ab9d85b9092", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "8aa2ac07290273013d63c39aa91ff135", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9324618736383442, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \nint equidistance(char *str) {\n int links=0,pearls=0;\n while (*str) {\n if ((*str)=='-') {\n links++;\n } else {\n pearls++;\n }\n str++;\n }\n return (links%pearls==0);\n}\nint main() {\n char neck[101];\n scanf(\"%s\",neck);\n if (equidistance(neck)) {\n printf(\"YES\");\n } else {\n printf(\"NO\");\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "e800b25d4128ceec0bbfe5cd4bb25a8b", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "657739be30f26ae3abe554d7e7295b6c", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9218241042345277, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nint main(){\n int i,k=0,b;\n char a[100],p[1]=\"o\";\n scanf(\"%[^\\n]%*c\",a);\n b=strlen(a);\n for(i=0;i\n#include\nint main(){\nint n,i,j,k;\nint link=0;\nint pearl=0;\nchar s[1000];\nscanf(\"%s\",&s);\nn=strlen(s);\nfor(i=0;i\nint main(void)\n{\n int i,pearl=0,link=0;\n char string[105];\n scanf(\"%s\",string);\n for(i=0;string[i]!='\\0';i++)\n {\n if(string[i]=='o')\n pearl++;\n else\n link++;\n }\n if(!(link%pearl)||!pearl)\n printf(\"%s\\n\",\"YES\");\n else\n printf(\"%s\\n\",\"NO\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6d539cbdca2d0e372c8ff992b2783f13", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "879a41cf64981eea1b4deef7346de248", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.339907192575406, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n, m;\n\n scanf(\"%d %d\", &n, &m);\n\n int ans = 0;\n\n int temp;\n int cnt6, cnt3, slot;\n int top = 0;\n while (n > 0 || m > 0)\n {\n if (n != 0) {\n temp = 2 * n;\n\n n = 0;\n if (m > 0) {\n cnt3 = (temp-top)/3;\n cnt6 = (temp - top)/6;\n slot =\n //printf(\"cnt6 : %d\\n\", cnt6);\n if (m >= cnt3) {\n //printf(\"t1\\n\");\n n+=cnt6;\n m-=cnt3;\n top += cnt3*3;\n } else {\n //printf(\"t2\\n\");\n n += m;\n m = 0;\n top += m*3;\n }\n }\n ans+=temp;\n } else {\n //printf(\"%d %d %d\\n\", n, m, top);\n top+=m*3;\n m=0;\n\n }\n\n }\n if (top > ans) {\n printf(\"%d\\n\", top);\n } else\n printf(\"%d\\n\", ans);\n\n\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "ac70187cebda0e1e10029d9364c5a968", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "c795bfbac774f9a6aa9911e406928479", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998062015503876, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n\tlong long n, m, hn, hm, tester = 6, r;\n\n\tscanf(\"%lld %lld\", &n, &m);\n\n\thn = 6 * ((n - 1)/ 2) + 2 + 2 * ((n - 1) % 2);\n\thm = 3 * (2 * m - 1);\n\n\twhile (tester < hn || tester < hm){\n\t\tif (hn > hm){\n\t\t\tr = (hn / 2) % 3;\n\n\t\t\tif (r == 1)\n\t\t\t\thn -= 4;\n\t\t\telse if (r == 2)\n\t\t\t\thn -= 6;\n\n\t\t\tif (tester > hn)\n\t\t\t\thn = tester;\n\t\t}\n\t\telse{\n\t\t\thm -= 6;\n\t\t\t\n\t\t\tif (tester > hm)\n\t\t\t\thm = tester;\n\t\t}\n\n\t\ttester += 6;\n\t}\n\n\tif (hn > hm)\n\t\tprintf(\"%lld\", hn);\n\telse\n\t\tprintf(\"%lld\", hm);\n\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d78382db560d3fc399f658b7462983f2", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "d8c790a515a2f947e244362164fab48c", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6049107142857143, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \nint count(int n,int m)\n{\n int r;\n while(m)\n {\n r = n%m;\n n = m;\n m = r;\n }\n return n;\n}\n\nint main()\n{\n int a,b,c,d,p,q,k;\n while(scanf(\"%d %d %d %d\",&a,&b,&c,&d))\n {\n p = a*d;\n q = b*c;\n if(p>q)\n k=p;p=q;q=k;\n k = count(q,p);\n p = p/k;\n q = q/k;\n printf(\"%d/%d\\n\",q-p,q);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "aca25c1cca1f548085304c9e22f0349b", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "5ef2f7a78925b2f5b451de1f109ee6df", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6396396396396397, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n long long a,b;\n scanf(\"%lld%lld\",&a,&b);\n long long count=1;\n while(a!=1 || b!=1)\n {\n if(b>a)\n {\n count++;\n b=b-a;\n }\n else\n {\n count++;\n a=a-b;\n }\n }\n printf(\"%lld\\n\",count);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8e5b42d3689e3b61555fd7aef4b0d5bc", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "8ad4e7d1b935d2689f20fd1973fdb6fd", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9988344988344988, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint a[1000];\nint isprime(int k)\n{\n int j;\n for(j=2;j<=k/2;j++)\n {\n if(k%j==0)\n return 0;\n }\n return 1;\n}\n\n \nint main()\n{\n int i,j,k,l=0,m,n,t=0;\n scanf(\"%d%d\",&n,&k);\n if(k==0)\n {\n printf(\"YES\");\n return 1;\n }\n for(i=2;i<=n;i++)\n {\n if(isprime(i)==1)\n {\n a[l]=i;\n \n l++;\n }\n }\n for(i=0;i\n#include\n#include\n#include\n#define REP(i,a,b) for(i=a;i b && fgg){\n puts(\"DRAW\");\n continue;\n }\n\n stone -= mod;\n puts(\"FIRST\");\n if(fg==0) printf(\"%d\\n\",x2-stone);\n else printf(\"%d\\n\",x2+stone);\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1e071ca4da5f25c5527dfaee93847d12", "src_uid": "4ea8cc3305a0ee2c1e580b43e5bc46c6", "apr_id": "906cc9279b442f7d38cf14401c29f14b", "difficulty": 2400, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.12598425196850394, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nusing namespace std;\n\nint main(){\n\tint a;\n\tcin>>a;\n\tint sd=log(a)/log(3);\n\tsd=pow(3,sd);\n\tint aw=a/sd;\n\tif(a%sd!=0)\n\t{\n\t\taw++;\n\t}\n\tcout<\nint main()\n{ \n long long int n=0;\n \n scanf(\"%lld\",&n);\n while(n!=0)\n {\n n=n/3\n }\n printf(\"%lld\",(n/3)+1);\n\n return 0; \n}", "lang": "GNU C11", "bug_code_uid": "eccd789efbaa412c19daf1cd3b0a7102", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "7ef3f588e2ab6ad5334e5a66994df7b5", "difficulty": 1600, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9481981981981982, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main(){\n\tint n=0;\n\tscanf(\"%d\",&n);\n\tint s=0,t=0,a[n],k=0,j=1;\n\ta[0]=getchar();\n\tfor(int i=0;is)break;\n\t\t\tif(t==s)t=0;\n\t\t\t\n\t\t}\n\t\tif(e&&(t==0))k=1;\n\t\tif(t!=s){\n\t\t\ts=0;t=0;j++;continue;\n\t\t}\n\t}\n\tif(k)printf(\"YES\");else printf(\"NO\");\n}", "lang": "GNU C11", "bug_code_uid": "2ca861c8f881208d0879aba9a750a8ed", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "3bd7934af6a00f87eab203b081143d7d", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9159891598915989, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n\nint main(){\n\tint size, i;\n\tscanf(\"%d\", &size);\t\n\tshort *arr = malloc(sizeof *arr * size);\n\tchar in;\n\tfor(i = 0; i < size; ++i){\n\t\tscanf(\"%*[\\n]\");\n\t\tscanf(\"%c\", &in);\n\t\tarr[i] = in - '0';\n\t}\n\tint j, isTrue = 0;\n\tfor(i = 0; i < size; ++i){\n\t\tint key = 0;\n\t\tint counter = i;\n\t\twhile(counter != -1)\n\t\t\tkey += arr[counter--];\n\t\tj = i + 1;\n\t\twhile(j < size){\n\t\t\tint sum = 0;\n\t\t\tint k = j;\n\t\t\twhile(sum < key && k < size)\n\t\t\t\tsum += arr[k++];\n\t\t\twhile(k < size && arr[k] == 0)\n\t\t\t\tk++;\n\t\t\tif(sum == key)\n\t\t\t\tj = k;\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\tif(j == size && i != size - 1){\n\t\t\tputs(\"YES\");\n\t\t\tisTrue = 1;\n\t\t\tbreak;\n\t\t}\n\n\t}\n\tif(!isTrue)\n\t\tputs(\"NO\");\n\n}\n", "lang": "GNU C11", "bug_code_uid": "fe339744deb1d7c9c6f2e8bd8a27532d", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "1ff1279efb1116cc26cf8c50351b20e8", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9692832764505119, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n\n int k,l,m,n,d,count=0,i;\n while(scanf(\"%f%f%f%f%f\",&k,&l,&m,&n,&d)!=EOF)\n {\n for(i=1; i<=d; i++)\n {\n if(i%k==0||i%l==0||i%m==0||i%n==0)\n count++;\n }\n printf(\"%d\\n\",count);\n count=0;\n }\n\n}", "lang": "GNU C11", "bug_code_uid": "dd2b6bd00866d3b2ffbec920d0904b07", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "73dd2f7c957a7a973d3a900f9a736994", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9924953095684803, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \n\n#define rep(i,n) for(i=0;i d*d ) return 1;\n\tint & ans = mem[a+N/2][b+N/2];\n\tif( ans > -1 ) return ans;\n\tint i;\n\trep(i,n) if( !rec( a+vx[i], b+vy[i] ) ) return ans = 1;\n\treturn ans = 0;\n}\n\nint main()\n{\n\tint i, j;\n\trep(i,N) rep(j,N) mem[i][j] = -1;\n\tscanf( \"%d%d%d%d\", &x, &y, &n, &d );\n\tfor( i = 0; i < n; i++ ) scanf( \"%d%d\", &vx[i], &vy[i] );\n\tprintf( rec(x,y) ? \"Anton\\n\" : \"Dasha\\n\" );\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9c9ad40e8b9967e388d420408336c0d8", "src_uid": "645a6ca9a8dda6946c2cc055a4beb08f", "apr_id": "c139554a50537d4f4bc239a96ba79c24", "difficulty": 1900, "tags": ["dp", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.829700272479564, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "#include\n\nint main()\n{\n char s[1000];\n\n int i,l;\n for(i=0,l=0;l<1001;i++,l++)\n {\n if(i+1>=100)\n {\n s[l]=((i+1)/100)+'0';\n l++;\n if(l==1000)\n break;\n else if(l<1000)\n s[l]=((i+1)/10)+'0';\n l++;\n if(l==1000)\n break;\n else if(l<1000)\n s[l]=((i+1)%10)+'0';\n }\n\n else if(i+1>=10)\n {\n s[l]=((i+1)/10)+'0';\n l++;\n if(l==1001)\n break;\n else\n s[l]=((i+1)%10)+'0';\n }\n\n else\n s[l]=(i+1)+'0';\n }\n int n;\n scanf(\"%d\",&n);\n printf(\"%c\",s[n-1]);\n return 0;", "lang": "GNU C", "bug_code_uid": "01beaf8a39d1b7be9d5c542636db4560", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "ef5264ca1a2fb955ba85aefb32105922", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.88, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main () {\n\tint a[100],i,j,n,m,k;\n\tdo {\n\t\tprintf(\"n=\");\n\t\tscanf(\"%d\",&n);\n\t\tprintf(\"m=\");\n\t\tscanf(\"%d\",&m);\n\t\tprintf(\"k=\");\n\t\tscanf(\"%d\",&k);\n\t} while (n<1||m>n||m<1||k<1);\n\tfor (i=0;i\n\nint main()\n{\n int p, l, i;\n\n char s;\n\n scanf(\"%c\", &s);\n\n for(i = p = l = 0; s == '-' || s == 'o'; i++){\n\n if(s == '-') l++;\n else p++;\n scanf(\"%c\", &s);\n }\n\n if(l % p == 0)printf(\"YES\\n\");\n else printf(\"NO\\n\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5a97ef78fdda824e24727f6ea6613cd5", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "b33029f48b6f2355cd8e52ecd229beee", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9942196531791907, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main()\n{\n int i,a=0,b=0;\n char s[100];\n scanf(\"%s\",s);\n int l=strlen(s);\n for(i=0;i\n#include \n#include \n\nint main(void){\n char *neck = (char *) malloc(sizeof(char) * 101);\n scanf(\"%s\", neck);\n int length = strlen(neck);\n int pearls = 0;\n int links = 0;\n for(int i = 0; i < length; i++){\n if(*(neck+i) == 'o'){\n pearls++;\n }\n else if(*(neck+i) == '-'){\n links++;\n }\n }\n if(links%pearls == 0){\n printf(\"YES\\n\");\n }\n else{\n printf(\"NO\\n\");\n }\n}\n", "lang": "GNU C", "bug_code_uid": "7c01bc9162d5eff80ae00bbb0c4cfe07", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "51316f3a33eed579ba9f67e38d915045", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8098958333333334, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main(void) {\n\tchar necklace[100];\n\tscanf(\"%s\",necklace);\n\tint len = strlen(necklace);\n\tint pearls = 0, links = 0;\n\tfor(int i = 0; i < len;i++){\n\t if(necklace[i] == 'o')\n\t pearls++;\n\t else\n\t links++;\n\t}\n\tint result = links % pearls;\n\tif(result == 0)\n\tprintf(\"YES\");\n\telse\n\tprintf(\"NO\");\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "f4994ce5ffec954dd319431f9061948c", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "db3be4cbbb69429e5cb120e7f0c7b092", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9972350230414746, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint read_line(char str[] ) {\n int i=0;\n char c=getchar();\n while (c!=EOF && c!='\\n')\n {\n str[i]=c;\n c=getchar();\n i++;\n }\n str[i]='\\0';\n return i;\n}\nint main()\n{\n\tchar str[];\n\tint len=read_line(str);\n\tint link=0;\n\tint pearl=0;\n\tfor (int i=0; i\n#include \n#define N 100\n\n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\n\nint main() {\n\tchar input[N];\n\tint i,j;\n\tint a = 0,b = 0;\n\ti = 0;\n\twhile((input[i] = getchar()) != '\\n'){\n\t\ti++;\n\t}\n\tfor(j = 0;j < i;j++)\n\t{\n\t\tif(input[j] == 'o')\n\t\t{\n\t\t\ta++;\n\t\t}\n\t\telse if(input[j] == '-');\n\t\t{\n\t\t\tb++;\n\t\t}\n\t}\n\tif(a==0 || b == 0 || b%a == 0)\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse\n\t{\n\t\tprintf(\"\")\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "13c473bc4ae6dd24b0c8e71fd56fdd66", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "ea27a7922bef50cb5dffa53cccb8e459", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8333333333333334, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int l =0;\n int p=0;\n char n;\n while(scanf(\"%c\",&n) !=EOF){\n if(n == '-') l++;\n else if( n == 'o') p++;\n }\n if(l % p == 0)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e87f9b9aac7a44b9072ab9e7fbd64be5", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "2443cc31b056f4accc5748b8ff160417", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8770595690747782, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main()\n{\n char s[100];\n scanf(\"%s\",s);\n int i,a=0,b=0;\n for(i=0;s[i]!='\\0';++i)\n {\n if(s[i]=='-')\n a++;\n if(s[i]=='o')\n b++;\n \n }\n \n if(a%b==0&&b!=0)\n printf(\"YES\");\n else if(b==0)\n \n printf(\"NO\");\n else if(a==0)\n \n printf(\"YES\");\n else\n printf(\"NO\");\n \n \n \n \n}", "lang": "GNU C", "bug_code_uid": "c80087e9b1c536ca0a69127a91146ac5", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "d3a4b01514a11e6be5d268052eec0d67", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.929745889387145, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nint main()\n{\n\tint p = 0,l = 0,i,j;\n\tchar A[10000];\n\tscanf(\"%s\", A);\n\tint len = strlen(A);\n\tfor (i = 0; i < len; i++){\n\t\tif (A[i] == '-'){\n\t\t\tl = l + 1;\n\t\t}\n\t\telse if (A[i] == 'o'){\n\t\t\tp = p + 1;\n\t\t}\n\t}\n\tif (l%p == 0){\n\t\tprintf(\"YES\\n\");\n\t}\n\telse printf(\"No\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1d77ca162a619ed52c7caa1d859d34f8", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "ff847ab11d032b9e2b337005df6bce5a", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9123867069486404, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main()\n{\n char s[100];\n for(int i = 0; i<100;i++) s[i] = '\\0';\n scanf(\"%[^\\n]s\",s);\n \n int c1 = 0, c2 = 0;\n for(int i = 0; i<100;i++)\n {\n if(s[i]=='o') c1++;\n if(s[i]=='-') c2++;\n }\n if((c2%c1)==0) printf(\"YES\");\n else printf(\"NO\");\n}", "lang": "GNU C", "bug_code_uid": "e970c5867b71812f81e405616051dc94", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "cee69142336cd8d53ffd1ad9d70eb545", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4887839433293979, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#include\n#include\n\nlong long int asd( long long int r);\n\nint main()\n{\n long long int n, b, p, m, r;\n scanf(\"%I64d %I64d %I64d\", &n, &b, &p);\n r=n;\n long long int ans=0;\n while(r>1)\n {\n m=(r)/2; ans+=m; //r+=m-pow(2,m);\n r+=m-m*2;\n }\n b=ans*(b*2+1);\n p=p*n;\n printf(\"%I64d %I64d\\n\", b, p);\n}\n\n\n/*long long int asd( long long int r)\n{\n long long int m=0; while(r>0)\n {\n r/=2;\n m++;\n }\n return m-1;\n}*/\n", "lang": "GNU C", "bug_code_uid": "0be939cfef4bb17cb555859c1c1d2e0c", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "b0e5995cc0a5d3c88118d28b6ed8061b", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8858131487889274, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n long long int n;\n scanf(\"%lld\",&n);\n long long int i=0,s[100000]={0};\n while(1)\n {\n n++;\n i++;\n while(n%10==0)\n {\n n=n/10;\n }\n s[n]=s[n]+1;\n if(s[n]>1)\n break;\n }\n printf(\"%lld\",i);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "b0c18e3cafa818958b5d679b6ab31015", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "25002a5f783dc01d2fd4cb68a1f544af", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3704225352112676, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include\n\nint main()\n{\n long long a=0,b=0;\n scanf(\"%lld %lld\",&a,&b);\n long long a2=a,b2=b,r=a2%b2;\n while(r!=0)\n {\n\t a2=b2;\n\t b2=r;\n\t r=a2%b2;\n }\n\n long long i=0, t=a*b/b2;\nchar *p1=\"Dasha\";\n\nchar *p2=\"Masha\";\nchar *p3;\n \n if(a1)break;\n\t }\n\t else if(i%b2==0)\n\t {\n\t ++f2;\n\t f1=0;\n\t if(f2>1)break;\n\t }\n\n\t \n }\n\n\n if(i%a2==0 && i%b2==0)\n\t printf(\"Equal\");\n else if(f1==2)\n\t printf(p1);\n else if(f2==2)printf(p2);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0da08a02f002b93a81d8058c9472ab49", "src_uid": "06eb66df61ff5d61d678bbb3bb6553cc", "apr_id": "0df8864492a316c6a22006472ab62d10", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9131920710868079, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \nint main()\n{\n int n, k;\n int y = 0;\n int g, t;\n int i;\n char s[101];\n scanf(\"%d%d\", &n, &k);\n for(i = 0; i < n; i++)\n {\n scanf(\"%c\", &s[i]);\n if(s[i] == 'G')\n g = i;\n if(s[i] == 'T')\n t = i;\n }\n if (g < t)\n {\n int q = g;\n g = t;\n t = q;\n }\n if (((g - t)%k) == 0)\n {\n for (i = t; i < g; i = i + k)\n {\n if(s[i] == \"#\")\n {\n printf(\"NO\");\n y = 1;\n break;\n }\n }\n if (y == 0) printf(\"YES\");\n }\n else printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "230f9e9ac34abd2e3399f3ca3164b95a", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "692ecfd62776b21e67666aba8d385fb6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.23184357541899442, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\nint r,g,b,countr,countb,countg,remainr,remainb,remaing,count=0;\nscanf(\"%d%d%d\",&r,&g,&b);\ncountr=r/3;\nremainr=r%3;\ncountg=g/3;\nremaing=g%3;\ncountb=b/3;\nremainb=b%3;\nwhile(remainr!=0||remainb!=0||remaing!=0)\n{\nremainr=remainr-1;\nremaing=remaing-1;\nremainb=remainb-1;\ncount++;\n}\nprintf(\"%d\",countr+countb+countg+count);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "50f88076a17e6f1d8814a1c5ec05af5d", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "d6e767216afdb20638d7c48177914dab", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9358407079646017, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main()\n{\n\tlong long a,b,c,d,e,f,g,h,i,j,k,l;\n\tlong long z[100000],x[100000];\n\tfor(a=0;a<100000;a++)\n\t\tz[a]=0;\n\tz[0]=z[1]=1;\n\tc=0;\n\tfor(a=2;a<100000;a++)\n\t{\n\t\tif(z[a]==0)\n\t\t{\n\t\t\tfor(b=a+a;b<100000;b+=a)\n\t\t\t\tz[b]=1;\n\t\t\tx[c++]=a;\n\t\t}\n\t}\n\tscanf(\"%lli\",&a);\n\tfor(;a;a--)\n\t{\n\t\tscanf(\"%lli\",&b);\n\t\tfor(d=0;d\nlong long int max,min,mid,ans,c[3],lol;\n#define setmax() c[0]>c[1]?(max=0,c[2]>c[max]?max=2:1):(max=1,c[2]>c[max]?max=2:1)\n#define setmin() c[0]<=c[1]?(min=0,c[2]<=c[min]?min=2:1):(min=1,c[2]<=c[min]?min=2:1)\n#define setmid() ((max+min)==1)?(mid=2):(((max+min)==2)?(mid=1):(mid=0))\n//#define setall() (setmax(),setmin(),setmid())\nint main()\n{\n\tscanf(\"%lld %lld %lld\",&c[0],&c[1],&c[2]);\t\n\tsetmax();\n\tsetmin();\n\tsetmid();\t\n\twhile(1)\n\t{\n\t\tif((c[max]-2)>=0 && (c[mid]-1)>=0)\n\t\t{\n\t\t\tc[max]-=2;\n\t\t\tc[mid]-=1;\n\t\t\tans++;\n\t\t\tsetmax();\n\t\t\tsetmin();\n\t\t\tsetmid();\t\n\t\t}\n\t\telse if(c[0]==1 && c[1]==1 && c[2]==1)\n\t\t{\n\t\t\tans++;\n\t\t\tbreak;\n\t\t}\n\t\telse break;\n\t}\t \t\n\tprintf(\"%lld\\n\",ans);\n\treturn 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "d57cf75f6c17dbe802e529ffe5e45a68", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "d8caad93c0996f4a54018022e662ba9c", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7101449275362319, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nlong long min(long long a, long long b){\n\treturn (ab)?a:b;\n}\n\nint main(){\n long long r,g,b;\n scanf(\"%lld %lld %lld\",&r,&g,&b);\n long long sum = r+g+b;\n long long max_val = max(r,max(g,b));\n long long min_val = min(r,min(g,b));\n long long mid_val = sum-max_val-min_val;\n long long cnt = 0;\n while(max_val >1 && mid_val >0){\n max_val-=2;\n mid_val-=1;\n sum-=3;\n max_val = max(max_val,max(mid_val,min_val));\n min_val = min(max_val,min(mid_val,min_val));\n mid_val = sum-max_val-min_val;\n cnt++;\n }\n if(max_val >0 && mid_val >0 && min_val >0)\n cnt++;\n printf(\"%lld\",cnt);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9b9fc27992e0ce078a9dd58598b02404", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "4e13d9e5c4f2dff51fa882388c175786", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6502994011976048, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint gcd(int a, int b) {\n\treturn b == 0 ? a : gcd(b, a % b);\n}\n\nint binsearch(int a, int x) {\n\tint low, high, mid;\n\n\tlow = 1;\n\thigh = a / x;\n\n\twhile (low <= high) {\n\t\tmid = (low + high) / 2;\n\t\tif (mid * x < a)\n\t\t\tlow = mid + 1;\n\t\telse if (mid * x > a)\n\t\t\thigh = mid - 1;\n\t\telse\n\t\t\treturn mid;\n\t}\n\treturn -1;\n}\n\nint main() {\n\tint a, b, x, y, g;\n\tlong long i, j, k, n, m;\n\n\tscanf(\"%d%d%d%d\", &a, &b, &x, &y);\n\tg = gcd(x, y);\n\tx /= g, y /= g;\n\ti = binsearch(a, x);\n\tj = binsearch(b, y);\n\tk = a / x < b / y ? a / x : b / y;\n\tn = i * x, m = i * y;\n\tif (n * m < j * x * j * y) {\n\t\tn = j * x;\n\t\tm = j * y;\n\t}\n\tif (n * m < k * x * k * y) {\n\t\tn = k * x;\n\t\tm = k * y;\n\t}\n\tif (n < 0)\n\t\tn = -n;\n\tif (m < 0)\n\t\tm = -m;\n\tif (a < x || b < y)\n\t\tprintf(\"0 0\\n\");\n\telse\n\t\tprintf(\"%lld %lld\\n\", n, m);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "74587026917a2b12adb9f3f9df2e3f6e", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "a8b225b056207f62a26fc9511fa649dc", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.27800829875518673, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "#include \n\nint main()\n{\n int a,b,x,y;\n int deltab=0;\n scanf(\"%d %d %d %d\",&a,&b,&x,&y);\n\n while(1)\n {\n if((b-deltab)==0||x==0||y==0)\n {\n printf(\"0 0\\n\");\n return -1;\n }\n else if((x*(b-deltab))%y==0&&((x*(b-deltab))/y)<=a)\n break;\n else\n deltab++;\n }\n printf(\"%d %d\\n\",((x*(b-deltab))/y),(b-deltab));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fdeb0538c840053c3b45a4506280eefc", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "86f231f47e89e5d8865949b22c63ad06", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1039339485186984, "equal_cnt": 18, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include \nint main()\n{\n int x,y,flag=1,m,n,k=2,l=22;\n scanf(\"%d%d\",&x,&y);\n while (x*100+y*10>=220)\n {\n if (x==0&&y<22)\n break;\n if (y==0)\n break;\n if (x<2)\n k=x;\n if (y<22)\n l=y;\n if (flag==1)\n for (m=k;m>=0;m--)\n {\n n=(220-m*100)/10;\n if (m<=x&&n<=y&&m*100+n*10==220)\n {\n x-=m;\n y-=n;\n flag*=-1;\n break;\n }\n }\n else\n for (n=l;n>=0;n--)\n {\n m=(220-n*10)/100;\n if (m<=x&&n<=y&&m*100+n*10==220)\n {\n x-=m;\n y-=n;\n flag*=-1;\n break;\n }\n }\n }\n if (flag==-1)\n printf(\"Ciel\");\n else\n printf(\"Hanako\");\n return 0;\n}\n\n \t \t \t\t \t\t\t \t\t \t \t \t\t", "lang": "GNU C", "bug_code_uid": "603910d9c4ec172df71d6a8cf0a55328", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "0bd7c79ac9684d134449f7f5d67a8055", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.43753598157743234, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "#include\n\nint main(){\n int x,y,add;\n scanf(\"%d%d\",&x,&y);\n while(1){\n if(x*100 +y*10>=220){\n add++;\n if(x>=2 && y>=2){\n x-=2;\n y-=2;\n }\n else if(x==1 && y>=12){\n x--;\n y-=12;\n }\n else if(x==0 && y>=22){\n y-=22;\n }\n }else break;\n\n if(x*100 +y*10>=220){\n add++;\n if(y>=22){\n y-=22;\n }\n else if(x==1 && y<22 && y>=12){\n x--;\n y-=12;\n }\n else if(x>=2 && y>=2){\n y-=2;\n x-=2;\n }\n }else break;\n }\n if(add&1) puts(\"Ciel\");\n else puts(\"Hanako\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1777e710843034a508b5c7d85f1bcc71", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "fbbebdeadeb275fd3040ef6b61075c6b", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9644268774703557, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main(){\n int n ; \n scanf(\"%d\",&n);\n max = 0;\n int x ; \n int total=0;\n int max=0 ;\n for(int i = 0 ; i < n ; i++){\n scanf(\"%d\",&x);\n if(x>max)\n max = x;\n total+=x;\n }\n for(int i = 0 ; i < max ; i ++)\n {\n if(i*n - total> total){\n printf(\"%d\",i);\n return 0;\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "cf6c01042a80e1f6974c4830a0c965f8", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "652b295214e917b17cc0a3a688b03f65", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21973550356052898, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n\nchar F[10];\nchar M[10];\nchar S[10];\n\nint main(void)\n{\n scanf(\"%s\",F);\n scanf(\"%s\",F);\n scanf(\"%s\",F);\n \n int f,m,s;\n \n if(F[0]=='p')\n f=1;\n else if(F[0]=='r')\n f=2;\n else if(F[0]=='s')\n f=3;\n else\n f=4;\n \n \n if(M[0]=='p')\n m=1;\n else if(M[0]=='r')\n m=2;\n else if(M[0]=='s')\n m=3;\n else\n m=4;\n \n \n if(S[0]=='p')\n s=1;\n else if(S[0]=='r')\n s=2;\n else if(S[0]=='s')\n s=3;\n else\n s=4;\n \n \n if(f==1&&m==2&&s==2)\n printf(\"F\");\n else if(f==2&&m==3&&s==3)\n printf(\"F\");\n else if(f==3&&m==1&&s==1)\n printf(\"F\");\n else if(m==1&&f==2&&s==2)\n printf(\"M\");\n else if(m==2&&f==3&&s==3)\n printf(\"M\");\n else if(m==3&&f==1&&s==1)\n printf(\"M\");\n else if(s==1&&m==2&&f==2)\n printf(\"S\");\n else if(s==2&&m==3&&f==3)\n printf(\"S\");\n else if(s==3&&m==1&&f==1)\n printf(\"S\");\n else\n printf(\"?\");\n \n return 0;\n}\n \n \n}", "lang": "GNU C11", "bug_code_uid": "48613bbe63a150f7880010b021da6f79", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "9c1e66f5f64f83ee9e1542619525b5a2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9879365079365079, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include \nint main()\n{\n long long m,n,i,j,k=0,x;\n scanf(\"%I64d %I64d %I64d\",&m,&n,&x);\n long long arr[10000];\n if((m==1 || n==1 ) && x!=1)\n {\n printf(\"0\");\n return 0;\n }\n else if((m==1 && x==1 && n!=1))\n {\n printf(\"%I64d\",n/2);\n return 0;\n }\n else if(n==1 && x==1 && m!=1)\n {\n printf(\"%I64d\",m/2);\n return 0;\n }\n if(m>=n)\n {\n long long l=m;\n for(i=0;i<((l/2)+1);i++)\n {\n if(m>0 && n>0 &&(m*n)%2==0)\n {\n arr[k]=(m*n)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n else if(m>0 && n>0 && (m*n)%2==1)\n {\n arr[k]=((m*n)+1)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n }\n if(x==1)\n {\n printf(\"%I64d\",arr[0]-arr[1]);\n }\n else\n {\n printf(\"%I64d\",arr[x-1]-arr[x]);\n }\n\n }\n else\n {\nlong long l=n;\n for(i=0;i<(n/2);i++)\n {\n if(m>0 && n>0 &&(m*n)%2==0)\n {\n arr[k]=(m*n)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n else if(m>0 && n>0 && (m*n)%2==1)\n {\n arr[k]=((m*n)+1)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n }\n if(x==1)\n {\n printf(\"%I64d\",arr[0]-arr[1]);\n }\n else\n {\n printf(\"%I64d\",arr[x-1]-arr[x-2]);\n }\n\n }\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9f3bef3ad2a71e9995223a90aa29f2b3", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "73773b71ad1a4f0946eb3fe7c25998c2", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9987421383647799, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main()\n{\n long long m,n,i,j,k=0,x;\n scanf(\"%I64d %I64d %I64d\",&m,&n,&x);\n long long arr[10000];\n if(((m==1 || n==1 ) && x!=1)||(m>=n && x>n) ||(n>=m && x>n))\n {\n printf(\"0\");\n return 0;\n }\n else if((m==1 && x==1 && n!=1))\n {\n printf(\"%I64d\",n/2);\n return 0;\n }\n else if(n==1 && x==1 && m!=1)\n {\n printf(\"%I64d\",m/2);\n return 0;\n }\n if(m>=n)\n {\n long long l=m;\n for(i=0;i<((l/2)+1);i++)\n {\n if(m>0 && n>0 &&(m*n)%2==0)\n {\n arr[k]=(m*n)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n else if(m>0 && n>0 && (m*n)%2==1)\n {\n arr[k]=((m*n)+1)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n }\n if(x==1)\n {\n printf(\"%I64d\",arr[0]-arr[1]);\n }\n else\n {\n printf(\"%I64d\",arr[x-1]-arr[x]);\n }\n\n }\n else\n {\nlong long l=n;\n for(i=0;i<(n/2);i++)\n {\n if(m>0 && n>0 &&(m*n)%2==0)\n {\n arr[k]=(m*n)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n else if(m>0 && n>0 && (m*n)%2==1)\n {\n arr[k]=((m*n)+1)/2;\n m=m-2;\n n=n-2;\n k++;\n }\n }\n if(x==1)\n {\n printf(\"%I64d\",arr[0]-arr[1]);\n }\n else\n {\n printf(\"%I64d\",arr[x-1]-arr[x]);\n }\n\n }\n\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "1c4c6f2230cdb47a735b6ffd9b54b942", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "73773b71ad1a4f0946eb3fe7c25998c2", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9930715935334873, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main()\n{\n\tlong long int n,i,k;\n\tscanf(\"lld %lld\",&n,&k);\n\tfor(i=0;i\n\nint main()\n{\n\tlong long n, k;\n\tlong long i;\n\tscanf(\"%lld %lld\", &n, &k);\n\tfor (i = 0; (n - i - i*k) > n / 2; i++);\n\tif (n - i - k*i < 0)\n\t\ti--;\n\tprintf(\"%lld %lld %lld\", i, k*i, n - i - k*i);\n}", "lang": "GNU C11", "bug_code_uid": "f42c9d9d1788a827f94a976f89f1d631", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "fc72baf99e312f5cbfb0f0a8bd739164", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9924660974384731, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n\n#define MOD 1000003\n\nlong long int mod(long long int p, long long int m)\n{\n\tif(p==0)\n\t\treturn 1;\n\telse if(p==1)\n\t\treturn 2;\n\telse if(p%2)\n\t\treturn (mod(1,m)*mod(p-1,m))%MOD;\n\telse\n\t\treturn (mod(p/2,m)*mod(p/2,m))%MOD;\n}\n\nint main()\n{\n\tchar p[100],s[100];\n\tscanf(\"%s\",p);\n\n\tfor(long long int i=0;p[i]!='\\0';i++)\n\t{\n\t\tif(p[i]=='>')\n\t\t{\t\n\t\t\tstrcat(s,\"1000\");\n\t\t\t\n\t\t}\n\t\telse if(p[i]=='<') \n\t\t{ \n\t\t\tstrcat(s,\"1001\");\n\t\t}\n\t\telse if(p[i]=='+')\n\t\t{ \n\t\t\tstrcat(s,\"1010\");\n\t\t}\n\t\telse if(p[i]=='-')\n\t\t{ \t\n\t\t\tstrcat(s,\"1011\");\n\t\t}\n\t\telse if(p[i]=='.') \n\t\t{\t\n\t\t\tstrcat(s,\"1100\")\n\t\t}\n\t\telse if(p[i]==',')\n\t\t{\n\t\t\tstrcat(s,\"1101\");\n\t\t}\n\t\telse if(p[i]=='[') \n\t\t{\t\n\t\t\tstrcat(s,\"1110\");\n\t\t\t//puts(s);\n\t\t}\n\t\telse \n\t\t{\n\t\t\tstrcat(s,\"1111\");\n\t\t\t//puts(s);\n\t\t}\n\t}\n\n\tlong long int ans=0,flag=0;\n\tfor(long long int i=strlen(s)-1;i>=0;i--)\n\t{\n\t\tlong long int temp=0;\n\t\tif(s[i]=='1')\n\t\t\ttemp = mod(flag,MOD);\n\t\tans = (ans+temp)%MOD;\n\t\tflag++;\n\t}\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "6a31fe80e999dc1900abd4b9d58b406c", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "58fb8bf3a8da488fd8129350f1e7606e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994535519125683, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nmain()\n{int n,x,y;\n scanf(\"%d%d%d\",&n,&x,&y);\n if (((x>=n/2)((n/2)+1>=x))&&((y>=n/2)&&((n/2)+1>=y)))\n printf(\"NO\");\n else\n printf(\"YES\");\n}\n\n", "lang": "GNU C11", "bug_code_uid": "1543aee070b623a3e596cd10dd5bfc83", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "e5863f5fd39f442ada92109732fd749d", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9728506787330317, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint max(int,int);\nint max(int a,int b)\n{\n if(a>b)\n return a;\n else\n return b;\n}\nint main()\n\n{\n int n,a,b;\n scanf(\"%d %d %d\", n,a,b);\n printf(\"%d\",n-max(a+1,n-b)+1);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "6d17977c09f8ed184bc510b3d13af8ef", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "21e072cc1ffb32c8f7b2094f08dfcca6", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7871387871387872, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nlong long f[23],n,s,sum;\nlong long power(long long a, long long b, long long MOD) {\nlong long x = 1, y = a; \n while(b > 0) {\n if(b%2 == 1) {\n x=(x*y);\n if(x>MOD) x%=MOD;\n }\n y = (y*y);\n if(y>MOD) y%=MOD;\n b /= 2;\n \n }\n return x;\n}\n \nlong long modInverse(long long a,long long m) {\n return power(a,m-2,m);\n}\n\nlong long binomialCoeff(long long n, long long k)\n{\n long long i,res = 1;\n if (k >( n - k))\n k = n - k;\t\n for ( i = 0; i < k; ++i)\n {\n res =(res* (n - i))%1000000007;\n res =(res* modInverse((i + 1),1000000007))%1000000007;\n }\n\n return res;\n}\nvoid recursion(long long i,long long pow,int fac){\n\tif(pow>s)\treturn;\n\tif(i==n+1){\n\t\tsum=(sum+fac*binomialCoeff(n+s-pow-1,s-pow))%1000000007;\n\t\treturn;\n\t}\n\trecursion(i+1,pow,fac);\n\trecursion(i+1,pow+f[i]+1,fac*-1);\n}\nint main(){\n\tlong long i,j,k,l;\n\tscanf(\"%lld %lld\",&n,&s);\n\tfor(i=1;i<=n;i++)\tscanf(\"%lld\",&f[i]);\n\trecursion(1,0,1);\n\tsum=(sum+1000000007)%1000000007;\n\tprintf(\"%lld\\n\",sum);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e83d811790fcd00282e9cabfb47c3638", "src_uid": "8b883011eba9d15d284e54c7a85fcf74", "apr_id": "0ce8dda2f50f7778959076cdf572a5fd", "difficulty": 2300, "tags": ["bitmasks", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9475251209527354, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nlong long f[23],n,s,sum;\nint c[23];\nvoid function(){\n\tint i,t1;\n\ti=1;\n\twhile(1){\n\t\tif(c[i]==0){\n\t\t\tc[i]=1;\n\t\t\tbreak;\n\t\t}else{\n\t\t\tc[i]=0;\n\t\t\ti++;\n\t\t}\n\t}\n}\t\n\nlong long power(long long a, long long b, long long MOD) {\nlong long x = 1, y = a; \n while(b > 0) {\n if(b%2 == 1) {\n x=(x*y);\n if(x>MOD) x%=MOD;\n }\n y = (y*y);\n if(y>MOD) y%=MOD;\n b /= 2;\n \n }\n return x;\n}\n \nlong long modInverse(long long a,long long m) {\n return power(a,m-2,m);\n}\n\nlong long binomialCoeff(long long n, long long k)\n{\n long long i,res = 1;\n if (k >( n - k))\n k = n - k;\t\n for ( i = 0; i < k; ++i)\n {\n res =(res* ((n - i)%1000000007))%1000000007;\n res =(res* modInverse((i + 1),1000000007))%1000000007;\n }\n\n return res;\n}\nvoid recursion(int i,long long pow,int fac){\n\tint j;\n\ti=0;\n\twhile(1){\n\t\tfac=1;\n\t\tj=0;\n\t\tpow=0;\n\t\tfor(i=1;i<=n;i++){\n\t\t\tpow=pow+c[i]*(f[i]+1);\n\t\t\tif(c[i]==1){\tfac=fac*-1;j++;\n\t\t\t}\n\t\t}\n\t\tif(pow<=s){\t\t\t\t\n\t\t\tsum=(sum+fac*binomialCoeff(n+s-pow-1,s-pow))%1000000007;\n\t\t}\n\t\tif(j==n)\tbreak;\n\t\tfunction();\n\t}\n}\n\nint main(){\n\tlong long i,j,k,l;\n\tscanf(\"%lld %lld\",&n,&s);\n\tfor(i=1;i<=n;i++)\tscanf(\"%lld\",&f[i]);\n\trecursion(1,0,1);\n\tsum=(sum+1000000007)%1000000007;\n\tprintf(\"%lld\\n\",sum);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "86b2ce0c0f7fd3112507475827455b6b", "src_uid": "8b883011eba9d15d284e54c7a85fcf74", "apr_id": "0ce8dda2f50f7778959076cdf572a5fd", "difficulty": 2300, "tags": ["bitmasks", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5757869249394673, "equal_cnt": 78, "replace_cnt": 77, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 78, "bug_source_code": "#include\n#include\nint main()\n{\n\tint a,b,i,path[2][105],len,delta_x,delta_y,k;\n\tchar str[105];\n\tscanf(\"%d%d\",&a,&b);\n\tscanf(\"%s\",str);\n\tlen = strlen(str);\n\ti=0;\n\tk=0;\n\tpath[0][k]=0;\n\tpath[1][k]=0;\n\tk++;\n\twhile(ilen)\n\t\tprintf(\"No\\n\");\nreturn 0;\n}\t", "lang": "GNU C", "bug_code_uid": "143bed76e4a69eecd23008feca80d920", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "713448eb0baeb0b7d1da14e8dbe0ef1d", "difficulty": 1700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4280519480519481, "equal_cnt": 22, "replace_cnt": 21, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 22, "bug_source_code": "#include \n#include \n\n#define REP(i,n) for(int i=0;i<(int)n;++i)\ntypedef long long ll;\n\nconst int dy[] = {1,0,-1,0};\nconst int dx[] = {0,1,0,-1};\n\nint d[100];\nchar s[105];\nint vx[105], vy[105];\nint ix, iy;\nint main() {\n int a,b;\n while(scanf(\"%d%d\", &a, &b) == 2) {\n scanf(\"%s\",s);\n ll y=0,x=0;\n int n = strlen(s);\n REP(i,n) {\n d[i] = strchr(\"URDL\", s[i]) - s;\n }\n\tix = 0;\n\tiy = 0;\n vx[ix++] = 0;\n\tvy[iy++] = 0;\n REP(i,n) {\n y += dy[d[i]];\n x += dx[d[i]];\n\t vy[iy++] = y;\n vx[ix++] = x;\n }\n ll Y = y;\n ll X = x;\n bool ok = 0;\n REP(i,n) {\n REP(j,n) {\n ll yy = vy[j];\n ll xx = vx[j];\n ll y = b-yy;\n ll x = a-xx;\n if (Y && y % Y == 0) {\n if (X*(y/Y) == x) {\n ok = 1;\n }\n }\n if (Y == 0 && y == 0) {\n if (x == 0 || (X && x % X == 0)) {\n ok = 1;\n }\n }\n }\n }\n printf(\"%s\\n\",ok?\"Yes\":\"No\");\n }\n}", "lang": "GNU C", "bug_code_uid": "3ec0d8f6766517c10f9b5bfebed03abd", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "31f5602898046b0803b03783ddcca81c", "difficulty": 1700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5832414553472988, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n\n#define REP(i,n) for(int i=0;i<(int)n;++i)\ntypedef long long ll;\n\nconst int dy[] = {1,0,-1,0};\nconst int dx[] = {0,1,0,-1};\n\nint d[100];\nchar s[105];\nint vx[105], vy[105];\nint ix, iy;\nint main() {\n\tint a,b;\n\twhile(scanf(\"%d%d\", &a, &b) == 2) {\n\t\tscanf(\"%s\",s);\n\t\tll y=0,x=0;\n\t\tint n = strlen(s);\n\t\tREP(i,n) {\n\t\t\td[i] = strchr(\"URDL\", s[i]) - s;\n\t\t}\n\t\tix = 0;\n\t\tiy = 0;\n\t\tvx[ix++] = 0;\n\t\tvy[iy++] = 0;\n\t\tREP(i,n) {\n\t\t\ty += dy[d[i]];\n\t\t\tx += dx[d[i]];\n\t\t\tvy[iy++] = y;\n\t\t\tvx[ix++] = x;\n\t\t}\n\t\tll Y = y;\n\t\tll X = x;\n\t\tint ok = 0;\n\t\tREP(i,n) {\n\t\t\tREP(j,n) {\n\t\t\t\tll yy = vy[j];\n\t\t\t\tll xx = vx[j];\n\t\t\t\tll y = b-yy;\n\t\t\t\tll x = a-xx;\n\t\t\t\tif (Y && y % Y == 0) {\n\t\t\t\t\tif (X*(y/Y) == x) {\n\t\t\t\t\t\tok = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (Y == 0 && y == 0) {\n\t\t\t\t\tif (x == 0 || (X && x % X == 0)) {\n\t\t\t\t\t\tok = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprintf(\"%s\\n\",ok?\"Yes\":\"No\");\n\t}\n}", "lang": "GNU C", "bug_code_uid": "b6eff127b19b8ebf32ea67dca7ebf613", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "31f5602898046b0803b03783ddcca81c", "difficulty": 1700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1917808219178082, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include\n#define MAX_N 50000007\n\nint sieve[MAX_N];\nint primes[MAX_N];\nint main() {\n\tfor( int i=2; i*i\nint main() \n{\n\tint a,b,c,n;\n\tscanf(\"%d %d\",&a,&b);\n\tscanf(\"%d %d\",&c,&n);\n\tn=n-a-b+c;\n\tif(n>0)\n\tprintf(\"%d\",n);\n\telse\n\tprintf(-1);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "6c29763d9def802465fdd70413c93ef8", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "060878bebf7f11c59bd1f94b02878a85", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9346365302382407, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main()\n{\n int a,b,c,k;\n long long int l1=1,l2=1,l3=1,t;\n //int64_t t;\n scanf(\"%d %d %d %d\",&a,&b,&c,&k);\n while(1)\n {\n if(a>1)\n {\n a=a-1;\n k=k-1;\n l1++;\n if(k==0)\n break;\n //printf(\"%d--a\\n\",a);\n }\n if(b>1)\n {\n\n b=b-1;\n k=k-1;\n l2++;\n if(k==0)\n break;\n //printf(\"%d--b\\n\",b);\n }\n if(c>1)\n {\n c-=1;\n k-=1;\n l3++;\n if(k==0)\n break;\n //printf(\"%d--c\\n\",c);\n }\n if(a==1&&c==1&&b==1||k==0)\n break;\n }\n t=l1*l2*l3;\n printf(\"%\"PRId64\"\",t);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5426433b4c5502360b88cf2f59ba55ae", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "1002e02029841594597189a579c0a5e0", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5905441570026762, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\n#define MX 1000\nlong long int p,k,k1=1,sm,A[MX];\nint main(){\n int i,j,sz;\n long long int ims;\n //freopen(\"input.txt\",\"r\",stdin);\n //freopen(\"output.txt\",\"w\",stdout);\n scanf(\"%lld%lld\",&p,&k);\n for(sz=0;;sz+=2){\n sm+=(k-1)*k1;\n A[sz]=k-1;\n if(sm>=p){break;}\n k1*=k;\n k1*=k;\n }\n p=sm-p;\n for(i=0;i<=sz;i++){\n ims=p%k;\n p=p/k;\n if(i%2==0){A[i]-=ims;}\n else{A[i]=ims;}\n }\n printf(\"%d\\n\",sz+1);\n for(i=0;i<=sz;i++){\n printf(\"%lld \",A[i]);\n }\n}\n", "lang": "GNU C", "bug_code_uid": "c0630be8e421a4cf9047984c11e89c04", "src_uid": "f4dbaa8deb2bd5c054fe34bb83bc6cd5", "apr_id": "da625644a9005c99213e54763b9d721d", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9973262032085561, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\ndouble d[2001][2001];\nint main()\n{\n int n,t,i,j;\n double p,f;\n scanf(\"%d%lf%d\",&n,&p,&t);\n for(i=1;i<=t;++i)\n d[0][i]=0;\n for(i=0;i<=n;++i)\n d[i][0]=0;\n for(i=1;i<=n;++i)\n {\n for(j=1;j<=i;++j)\n d[i][j]=(d[i-1][j-1]+1)*p+(1-p)*d[i][j-1];\n }\n printf(\"%lf\",d[n][t]);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a9ffda107b5ea13f233e50cbeeec60e0", "src_uid": "20873b1e802c7aa0e409d9f430516c1e", "apr_id": "debc67a2f04ab196a5a192f07db8cfcd", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.982842509603073, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint poww(int m, int n)\n{\n int t = 1;\n int i;\n \n if(n == 0) \n return 1;\n else \n for(i = 1; i <= n; i++)\n t *= m;\n \n return t;\n}\n\nint main()\n{\n char hour[6];\n char minu[6];\n int h, m;\n int hmax, mmax;\n int min, max;\n int left;\n int flag;\n int i, j;\n char c;\n int hflag, mflag;\n \n i = 0;\n while(1) {\n c = getchar();\n if(c != ':') {\n hour[i] = c;\n i++;\n }\n else {\n hour[i] = 0;\n break;\n }\n }\n\n i = 0;\n while(1) {\n c = getchar();\n if(c != '\\n') {\n minu[i] = c;\n i++;\n }\n else {\n minu[i] = 0;\n break;\n }\n }\n \n h = strlen(hour);\n m = strlen(minu);\n \n i = 0;\n while(hour[i] == '0') {\n h--;\n i++;\n }\n hflag = i;\n \n i = 0;\n while(minu[i] == '0') {\n m--;\n i++;\n }\n mflag = i;\n \n if(m == 1 && h == 1)\n if(hour[hflag] >= '0' && hour[hflag] <= '9' || hour[hflag] <= 'N' && hour[hflag] >= 'A') {\n printf(\"-1\\n\");\n return 0;\n } \n if(m == 0 && h == 0) {\n printf(\"-1\\n\");\n return 0;\n } \n \n if(h > 0) {\n hmax = 2;\n for(i = hflag; i < hflag + h; i++) {\n if(hour[i] <= '9' && hour[i] >= '0')\n hmax = hmax > (hour[i] - '0' + 1) ? hmax : (hour[i] - '0' + 1);\n else \n hmax = hmax > (hour[i] - 'A' + 11) ? hmax : (hour[i] - 'A' + 11);\n }\n }\n else\n hmax = -1;\n \n if(m > 0) {\n mmax = 2;\n for(i = mflag; i < mflag + m; i++) {\n if(minu[i] <= '9' && minu[i] >= '0')\n mmax = mmax > (minu[i] - '0' + 1) ? mmax : (minu[i] - '0' + 1);\n else\n mmax = mmax > (minu[i] - 'A' + 11) ? mmax : (minu[i] - 'A' + 11);\n }\n }\n else\n hmax = -1;\n \n min = hmax > mmax ? hmax : mmax;\n mmax = mmax == -1 ? mmax : min;\n hmax = hmax == -1 ? hmax : hmax;\n \n if(h == 1)\n hmax = -1;\n else if(hmax != -1) {\n flag = 0;\n while( 1 ) {\n left = 23;\n for(i = hflag + h - 1, j = 0; i >= hflag; i--, j++) {\n if(hour[i] <= '9' && hour[i] >= '0')\n left -= (hour[i] - '0') * poww(hmax, j); \n else\n left -= (hour[i] - 'A' + 10) * poww(hmax, j);\n }\n \n if(left >= 0) {\n flag = 1;\n hmax++;\n }\n else if(flag == 0) {\n printf(\"0\\n\");\n return 0;\n }\n else {\n hmax--;\n break;\n }\n }\n }\n \n if(m == 1)\n mmax = -1;\n else if(mmax != -1) {\n flag = 0;\n while( 1 ) {\n left = 59;\n for(i = mflag + m - 1, j = 0; i >= mflag; i--, j++) {\n if(minu[i] <= '9' && minu[i] >= '0')\n left -= (minu[i] - '0') * poww(mmax, j); \n else\n left -= (minu[i] - 'A' + 10) * poww(mmax, j);\n }\n \n if(left >= 0) {\n flag = 1;\n mmax++;\n }\n else if(flag == 0) {\n printf(\"0\\n\");\n return 0;\n }\n else {\n mmax--;\n break;\n }\n }\n }\n \n if(hmax != -1 && mmax != -1)\n max = hmax > mmax ? mmax : hmax;\n else\n max = mmax == -1 ? hmax : mmax;\n \n for(i = min; i <= max; i++) {\n if(i == max) \n printf(\"%d\\n\", i);\n else\n printf(\"%d \", i);\n }\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "00ff6c211c4e5e43c501bff5c58637b4", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "666158b31d12202d7b25ba7862fa0c23", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9825503355704698, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include \nint value(char c){\n if(c>='0' && c<='9') return c-'0';\n else if(c>='A' && c<='Z' ) return c-'A'+10;\n else {\n printf(\"Error radix\\n\");\n return -1;\n }\n}\nint valueR(char* num,int radix){\n int i;\n int rt=0;\n for(i=0;imax) max= value(num[i]);\n }\n }\n num1[c]='\\0';\n \n check=0;\n c=0;\n i++;\n for(;num[i]!='\\0';i++){\n if(num[i]!='0') check=1;\n if(check==1) {\n num2[c++]=num[i];\n if(value(num[i])>max) max= value(num[i]);\n }\n }\n num2[c]='\\0';\n\n //printf(\"\\n%s:%s %d\\n\",num1,num2,max);\n \n //caculate\n if(strlen(num1)==1&&strlen(num2)==1) printf(\"-1\\n\");\n else{\n i=max+1;\n check=0;\n while(1){\n //check radix i\n if(valueR(num1,i)<24 && valueR(num2,i)<60){\n printf(\"%d \",i);\n check=1;\n }else{\n if(check==0) printf(\"0\");\n break;\n }\n i++;\n }\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "6cdeece2642cd9cfda4616252275c730", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "fdf6e51d978e75262232f941a7c37b95", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9979449239621866, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main(){ \n char n[15];\n scanf(\"%s\",n);\n int i,sp=1;\n char t='\\0';\n for(i=0;i'n')){sp=0;}\n if(n[i]!=':'&&t60){\n sys=t-65+11;\n }else{\n sys=t-47;\n }\n int sum=0,tp=0,f=sys;\n \n for(;;sys++){\n for(i=0;n[i]!=':';i++){\n if(n[i]>60){\n tp=n[i]-65+10;\n }else{\n tp=n[i]-48;\n }\n sum=sum*sys+tp;\n }\n if(sum>23){\n if(sys==f){puts(\"0\");}\n return 0;\n }sum=0;\n for(i=i+1;i60){\n tp=n[i]-65+10;\n }else{\n tp=n[i]-48;\n }\n sum=sum*sys+tp;\n }\n if(sum>59){\n if(sys==f){puts(\"0\");}\n return 0;\n }\n sum=0;\n printf(\"%d \",sys);\n }\n \n}\n", "lang": "GNU C", "bug_code_uid": "e11ed92723bccdf2ea913974282a89a8", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "efbab0dbbf9603693cbdb17dffdab6ea", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5246913580246914, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint main(void){\n int n, k;\n int i, remain;\n scanf(\"%d %d\", &n, &k);\n remain = 240-k;\n if(remain>=5){\n for(i=1; k>=0; i++){\n remain -= i*5;\n }\n printf(\"%d\", i);\n }else{\n printf(\"0\");\n }\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3f5ac075f575d42055b70d4681e345a2", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "4c950427baf9cad26001843b1dce8f0e", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9981308411214953, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#import\n#define swap(a,b) (a)^=(b)^=(a)^=(b)\n#define max(a,b) ((a)>(b)?(a):(b))\n#define min(a,b) ((a)<(b)?(a):(b))\nlong long gcd(long long a,long long b) {return !b?a:gcd(b,a%b);}\nint main()\n{\n\tlong long l1,r1,t1,l2,r2,t2;\n\tscanf(\"%lld%lld%lld%lld%lld%lld\",&l1,&r1,&t1,&l2,&r2,&t2);\n\tif (l1>l2) swap(l1,l2),swap(r1,r2),wwap(t1,t2);\n\tlong long k=gcd(t1,t2),p,ans=0;\n\tp=(l2-l1)/k;l1+=k*p,r1+=k*p;\n\tans=max(ans,(min(r1,r2)-max(l1,l2))+1);\n\tl1+=k,r1+=k;\n\tans=max(ans,(min(r1,r2)-max(l1,l2))+1);\n\tprintf(\"%lld\\n\",ans);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "aa96cd6d118ae26a5240c83c06731eaf", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "3f8a13ab95c830ff1c05b7c4351c2986", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.40729001584786056, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n\tlong long int n ,k , count = 0, temp , sum = 0 , eaten = 0 ,tries , o;\n\tscanf (\"%lld %lld\" ,&n , &k );\n\tif (k > 1)\n\t{\n\t\twhile ( sum < k )\n\t\t{\n\t\t\tcount ++;\n\t\t\tsum = sum + count;\n\t\t}\n\t\twhile (1)\n\t\t{\n\t\t\tif ( sum == k && count == n)\n\t\t\t{\n\t\t\t\tprintf(\"%lld\" , eaten);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tcount ++;\n\t\t\tsum = sum - 1;\n\t\t\teaten ++;\t\n\t\t}\n\t}\n\telse if (k == 0)\n\t\t{\n\t\t\teaten = 1;\n\t\t\ttries = 2;\n\t\t\twhile(1)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (tries == n)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld\" , eaten);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\teaten = eaten + 2 + count;\n\t\t\t\ttries = tries + 3 + count;\n\t\t\t\tcount ++;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\teaten = 0;\n\t\t\ttries = 1;\n\t\t\twhile(1)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (tries == n)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%lld\" , eaten);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\teaten = eaten + 2 + count;\n\t\t\t\ttries = tries + 3 + count;\n\t\t\t\tcount ++;\n\t\t\t}\n\t\t}\n\n\n}", "lang": "GNU C11", "bug_code_uid": "ce92a61d6e18923f3017bf31da40dafb", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "603bd3f5b476e3453f47f036aa2e79ee", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7694369973190348, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#define LiangJiaJun main\nusing namespace std;\nint n,m,k,ans=1,Reduc_;\n\nint LiangJiaJun(){\n scanf(\"%d%d%d\",&n,&m,&k);\n m -= n;\n Reduc_ = 1;\n if(m == 0) return puts(\"1\"),0;\n while(m>0){\n if(k+ans<=n)++Reduc_;\n if(k-ans>=1)++Reduc_;\n m -= Reduc_;\n ++ans;\n }\n printf(\"%d\\n\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "cccef73b99e38a4381d53e04c9b82543", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "83fd142d6b61c471f2b3efe355529432", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16760676873489122, "equal_cnt": 19, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "# include \n# define N 51\nint main ()\n{\n char *direccion=(char*)calloc(N,sizeof(char));\n scanf(\"%s\", &direccion);\n int i=0, longitud, band=0;\n longitud=strlen(direccion);\n if (direccion[0]=='h')\n {\n printf(\"http://\");\n i=4;\n }\n if (direccion[0]=='f')\n {\n printf(\"ftp://\");\n i=3;\n }\n while(direccion[i]!= '\\0' )\n {\n printf(\"%c\", direccion[i]);\n if (direccion[i+1]=='r' && direccion[i+2]=='u' && band==0)\n {\n printf(\".ru\");\n band=1;\n if (direccion[i+3]!= '\\0'){\n printf(\"/\");\n }\n i=i+2;\n }\n i++;\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c817f03a7ca461a2dc695e027840eeae", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "ffe5f37ae3f999a511b86c2259cee022", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5006729475100942, "equal_cnt": 20, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "#include \nint main()\n\n{\n int n,k,r,g,b;\n\n scanf(\"%d%d\",&n,&k);\n\n r=(n*2)/k;\n g=(n*5)/k;\n b=(n*8)/k;\n\n if(((n*2)%k)!=0){\n r=r+((r+1)/r);\n }\n else if(((n*5)%k)!=0){\n g=g+((g+1)/g);\n }\n else if(((n*8)%k)!=0)\n {\n b=b+((b+1)/b);\n }\n\n printf(\"%d\\n\",(r+g+b));\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "1aa8d7c8ea9605b335ff06cea16342d9", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "2e1306c8d37c4c4eb3023826f4475d61", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22477064220183487, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main ()\n{\n\tint c[5];\n\tint j;\n\t\n\tfor (j=0;j<10;j++) c[j]=j;\n\t\n\tfor (j=0;j<10;j++) printf(\"%d\",c[j]);\n\t\n\treturn 0;\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "a723fbe56aac87a439d38aeba20e30bc", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "d35d47fc4993ac01c70e8b8c4ef5e46c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8537313432835821, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \nlong long k,g,n[11],m[11],t,i,temp=0,c[11],b,l;\nint main()\n{\n\tscanf(\"%lld\",&t);\n\tscanf(\"%lld\",&k);\n\tl=k;\n\tfor(i=0;im[0]){\n\t\t\tn[k]=m[0];k++;\n\t\t\tn[k]=n[0];\n\t\t\tfor(i=0;i\n#include \n#include \n#include \n#include \n#define N 40000000\n#define M 1000000000\ntypedef long long ll;\ntypedef struct _list{\n ll val;\n struct _list *next;\n} list;\nll n, k1, k2, k1a[22], k2a[22], p, f, flag=1;\nlist *map[N], *k1h, *k2h, *k1t, *k2t;\nvoid push(ll u, ll v){\n list *ptr1=(list *) malloc(sizeof(list)), *ptr2=(list *) malloc(sizeof(list));\n ptr1->val=v;\n ptr2->val=u;\n ptr1->next=map[u];\n ptr2->next=map[v];\n map[u]=ptr1;\n map[v]=ptr2;\n}\nvoid enqueue(ll p, ll val){\n list *ptr=(list *) malloc(sizeof(list));\n ptr->val=val;\n ptr->next=NULL;\n if (p==1){\n if (!k1h)\n k1h=k1t=ptr;\n else{\n k1t->next=ptr;\n k1t=ptr;\n }\n }\n else{\n if (!k2h)\n k2h=k2t=ptr;\n else{\n k2t->next=ptr;\n k2t=ptr;\n }\n }\n}\nll dequeue(ll p){\n ll val;\n if (p==1){\n val=k1h->val;\n k1h=k1h->next;\n if (!k1h)\n k1t=NULL;\n }\n else{\n val=k2h->val;\n k2h=k2h->next;\n if (!k2h)\n k2t=NULL;\n }\n return val;\n}\nbool empty(ll p){\n return p==1?(k1h==NULL):(k2h==NULL);\n}\nint main(){\n scanf(\"%lld\", &n);\n scanf(\"%lld\", &k1);\n for (ll i=1; i<=k1; i++)\n scanf(\"%lld\", &k1a[i]), enqueue(1, k1a[i]);\n scanf(\"%lld\", &k2);\n for (ll i=1; i<=k2; i++)\n scanf(\"%lld\", &k2a[i]), enqueue(2, k2a[i]);\n for (ll i=1; iv1)\n enqueue(2, v1), enqueue(2, v2);\n else\n enqueue(1, v2), enqueue(1, v1);\n }\n else if (empty(1)){\n printf(\"%lld 2\", f);\n return 0;\n }\n else if (empty(2)){\n printf(\"%lld 1\", f);\n return 0;\n }\n }\n printf(\"-1\");\n}\n", "lang": "GNU C11", "bug_code_uid": "1209022b38040481e8647294237de130", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "796e0e66a80bedc8c9a2638866a7aa84", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9573170731707317, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint main()\n{\n int n, i, y;\n int j, k, m, l, f;\n char a, b;\n y=n%4;\n scanf(\"%c %c\", &a, &b);\n scanf(\"%d\",&n);\n j=int(a);\n m=int(a);\n k=int(b);\n for(i=0;i\n#include\nint main()\n{\n char c[2];\n int n;\n scanf(\"%d\", &n);\n scanf(\"%c %c\", &c[0],&c[1]);\n\n if((c[0]=='v'&&c[1]=='<')||(c[0]=='<'&&c[1]=='^')||(c[0]=='^'&&c[1]=='>')||(c[0]=='>'&&c[1]=='v'))\n {if(n%4==1){\n printf(\"cw\");\n }\n else{\n printf(\"ccw\");\n }}\n\n if((c[0]=='v'&&c[1]=='>')||(c[0]=='<'&&c[1]=='v')||(c[0]=='^'&&c[1]=='<'')||(c[0]=='>'&&c[1]=='^')){\n if(n%4==3){\n printf(\"cw\");\n }\n else{\n printf(\"cww\");\n }\n }\n if((c[0]=='v'&&c[1]=='^')||(c[0]=='<'&&c[1]=='>')||(c[0]=='>'&&c[1]=='<')){\n printf(\"undefined\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "40a1ce45bee6eef1ae03985d9f5f3ad1", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "0103625ff36f3cc1ca4dbf5cc5d5572f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9419191919191919, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n char ch1,ch2;\n int a[4]={118,60,94,62},i,a1,a2,n;\n while(scanf(\"%c %c %d\",&ch1,&ch2,&n)!=EOF)\n {\n \tgetchar();\n \tn%=4;\nfor(i=0;i<4;i++)\n{\n\tif(int(ch1)==a[i])\n\ta1=i;\n if(int(ch2)==a[i])\n\ta2=i;\n}\n \tif(n%2==0)\n \t{\n \tprintf(\"undefined\\n\");\n \tcontinue;\n }\n \tif(a1-a2==-1||a1-a2==3||a1-a2==-3||a1-a2==1)\n \tprintf(\"cw\\n\");\n \telse\n \tprintf(\"ccw\\n\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "022774431a9ac923a3c77e97eaa94623", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "30d874973e9ea130fbab058d945cd4de", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9828431372549019, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include \n\nvoid merge(int arr[], int l, int m, int r) {\n\tint i = 0; // Initial index of first subarray\n\tint j = 0; // Initial index of second subarray\n\tint k = l; // Initial index of merged subarray\n\tint n1 = m - l + 1;\n\tint n2 = r - m;\n\n\t/* create temp arrays */\n\tint L[n1], R[n2];\n\t\n\t/* copy data to temp arrays L[] and R[] */\n\tfor (int i = 0; i < n1; i++)\n\t\tL[i] = arr[l + i];\n\tfor (int j = 0; j < n2; j++)\n\t\tR[j] = arr[m + 1 + j];\n\t\n\t/* merge the temp arrays back into arr[l..r] */\n\twhile (i < n1 && j < n2) {\n\t\tif (L[i] <= R[j]) {\n\t\t\tarr[k] = L[i];\n\t\t\ti++;\n\t\t} else {\n\t\t\tarr[k] = R[j];\n\t\t\tj++;\n\t\t}\n\t\tk++;\n\t}\n\n\t/* copy the remaining elements of L[] || R[], if there are any */\n\twhile (i < n1) {\n\t\tarr[k] = L[i];\n\t\ti++;\n\t\tk++;\n\t}\n\twhile (j < n2) {\n\t\tarr[k] = R[j];\n\t\tj++;\n\t\tk++;\n\t}\n}\n\nvoid mergeSort(int arr[], int l, int r) {\n\tif (l < r) {\n\t\tint m = l + (r - l) / 2;\n\n\t\t// sort first and second halves\n\t\tmergeSort(arr, l, m);\n\t\tmergeSort(arr, m + 1, r);\n\t\t\n\t\tmerge(arr, l, m, r);\n\t}\n}\n\n\nint main(void) {\n int n, d, min[10000];\n int k = 0; // for array min[]\n scanf(\"%d %d\", &n, &d);\n int a[n];\n for (int i = 0; i < n; i++)\n scanf(\"%d\", &a[i]);\n \n mergeSort(a, 0, n - 1);\n \n if (d == 0 || (a[n - 1] - a[0] =< d) || n == 1) {\n printf(\"0\\n\");\n return 0;\n }\n\n for (int i = n - 1; i >= 0; i--) {\n for (int j = i; j >= 0; j--) {\n if (a[i] - a[j] == d) {\n min[k++] = (n - 1) - (i - j + 1);\n }\n }\n }\n\n mergeSort(min, 0, k - 1);\n \n printf(\"%d\\n\", min[0] + 1);\n return 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "39de25d8e8a3476be15cdd3e3a162e38", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "ccd2cd66a1f74136a8c9681c15fb6264", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.49767441860465117, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nchar A[1000000000];\nint main(){\n\tint x,i;\n for(i=0;i<4;i++){\n\t\tscanf(\"%d\",&x);\n\t\tA[x] = 1;\n\t}\n\tfor(x=i=0;i<1000000000;i++)\n\t\tif(A[i]) x++;\n\tprintf(\"%d\",4 - x);\n\treturn 0;\n}\n\t\n\n", "lang": "GNU C", "bug_code_uid": "f32fbeef791133c8f50545adc86e1ea9", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "a06799c01b4651698295e93c37860418", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.49786324786324787, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int a, b, i, count, n, temp;\n int j;\n int num[6];\n for(i = 0; i < 4; i++){\n scanf(\"%d\", &num[i]);\n }\n for( j = 1, count = 0; j <= 1000000000 ; j++){\n for(i = 0; i < 4; i++){\n if(num[i] == j){\n count++;\n break;\n }\n }\n\n }\n n = 4 - count;\n printf(\"%d\", n);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5e524703761201fd7f5a8758c6f2cab2", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "98a4bc408263bf456c527f454c620939", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8420356906807667, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \nint n;\nint d[16];\n\nint solution(int x){\n int i; int sol;\n for (i = 0; i < 16; i++){\n if (x<=d[i]){\n if (i%2==0){\n if (i>2) continue;\n }\n else{\n sol = i;\n break;\n }\n }\n }\n\n return sol;\n}\n\nint main()\n{\n\n int x;\n scanf(\"%d\", &x);\n d[0] = 0;\n d[1] = 1;\n d[2] = 2;\n d[3] = 5;\n d[4] = d[1] * 4;\n d[5] = 13;\n d[6] = d[2] * 4;\n d[7] = 25;\n d[8] = d[3] * 4;\n d[9] = 41;\n d[10] = d[4] * 4;\n d[11] = 61;\n d[12] = d[5] * 4;\n d[13] = 85;\n d[14] = d[6] * 4;\n d[15] = 113;\n\n printf(\"%d\\n\", solution(x));\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "021449d7a16e0eb465e9250abdd7ac41", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "45b17d06c9e6ef5f48f0ec1321b43c39", "difficulty": 1700, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.13909378292939936, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n\nint main(void)\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tif(n==1 || n==2)\n\t\tprintf(\"%d\",n);\n\telse if(n<6)\n\t\tprintf(\"3\");\n\telse if(n<9)\n\t\tprintf(\"4\");\n\telse if(n<14)\n\t\tprintf(\"5\");\n\telse if(n<19)\n\t\tprintf(\"6\");\n\telse if(n<26)\n\t\tprintf(\"7\");\n\telse if(n<32)\n\t\tprintf(\"8\");\n\telse if(n<41)\n\t\tprintf(\"9\");\n\telse if(n<50)\n\t\tprintf(\"10\");\n\telse if(n<61)\n\t\tprintf(\"11\");\n\telse if(n<72)\n\t\tprintf(\"12\");\n\telse if(n<85)\n\t\tprintf(\"13\");\n\telse if(n<98)\n\t\tprintf(\"14\");\n\telse\n\t\tprintf(\"15\");\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "0b96ae7a67312f856ad1e21a52d9caa4", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "45aa4534b5af7485247224d60165be74", "difficulty": 1700, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6629422718808193, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n\tint arr[5],i,sum=0;\n\tscanf(\"%d %d %d %d %d\",&arr[0],&arr[1],&arr[2],&arr[3],&arr[4]);\n\tfor(i=0;i<5;i++)\n\t\t{\n\t\t\tsum=sum+arr[i];\n\t\t}\n\n\tif(sum==0)\n\t\t{printf(\"-1\");\n return;\n }\n\tif(sum%5==0&&sum!=0)\n\t\tprintf(\"%d\",sum/5); \n\telse \n\t\tprintf(\"-1\");\n}", "lang": "GNU C", "bug_code_uid": "6a53dc5a4c782cd188bccb5a55342646", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "05a2700e5df092eac3da9c57dc515f5d", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.1350210970464135, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n\tint i,j,r,q,n;\n\tint a[4]={0};\n\tscanf(\"%d\",&n);\n\tfor(i=0;ia[j])\n\t\t\t{\n\t\t\t\ta[i]=a[i]^a[j];\n\t\t\t\ta[j]=a[i]^a[j];\n\t\t\t\ta[i]=a[i]^a[j];\n\n\t\t\t}\n\t\t}\n//\t\t\tprintf(\"a[i]:%d\",a[i]);\n\t}\t\n//\t\tprintf(\"\\n\");\n\n\t\n\tif(n==0)\n\t{\n\t\tprintf(\"YES\\n\");\n\t\tprintf(\"1\\n1\\n3\\n3\\n\");\n\t}\n\telse if(n==1)\n\t{\n\t\tprintf(\"YES\\n\");\n\t\tprintf(\"%d\\n%d\\n%d\\n\",a[0],3*a[0],3*a[0]);\n\t}\n\telse if(n==2)\n\t{\n\t\tq=a[0];\n\t\tr=a[1];\n\t\tif(r<=(3*q))\n\t\t{\n\t\t\tprintf(\"YES\\n\");\n\t\t\tif(r>((4*q)-r))\n\t\t\t\tprintf(\"%d\\n%d\\n\",((4*q)-r),3*q);\n\t\t\telse\n\t\t\t\tprintf(\"%d\\n%d\\n\",((4*q)-r),3*q);\n\t\t}\n\t\telse\n\t\t\tprintf(\"NO\\n\");\n\t}\n\telse if(n==3)\n\t{\n\t\tif(a[2]==3*a[0])\n\t\t{\n\t\t\tprintf(\"YES\\n\");\n\t\t\tif((a[2]+a[0])-a[1]>a[1])\n\t\t\t\tprintf(\"%d\\n\",(a[2]+a[0])-a[1]);\n\t\t\telse\n\t\t\t\tprintf(\"%d\\n\",(a[2]+a[0])-a[1]);\n\t\t}\n\t\telse if(a[2]+a[1]==4*a[0])\n\t\t\tprintf(\"YES\\n%d\\n\",3*a[0]);\n\t\telse if((4*a[2])==3*(a[1]+a[0]))\n\t\t\tprintf(\"YES\\n%d\\n\",a[2]/3);\n\t\telse \n\t\t\tprintf(\"NO\\n\");\n\t}\n\tif(n==4)\n\t\tif(a[3]==3*a[0]&&a[3]+a[0]==a[1]+a[2])\n\t\tprintf(\"YES\\n\");\n\t\telse printf(\"NO\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "639cd15e820b359ab81e4bcdf5146082", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "f7dd8a67cd4266d760c4808a26e0d88e", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.37037037037037035, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n\nint main(){\n\tlong a,b;\n\tscanf(\"%ld%ld\",&a,&b);\n\tint counter =0;\n\twhile(a!=b){\n\t\tcounter++;\n\t\tif(a>b){\n\t\t\tint temp;\n\t\t\ttemp=a;a=b;b=temp;\n\t\t}\n\t\tb = b-a;\n\t}\n\n\tprintf(\"%ld\\n\",counter+1);\n}\n\n", "lang": "GNU C", "bug_code_uid": "5c03f3d691f23dc68d6f3cf17a8651d0", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "b135a8dedad1841e757632e095fb19b0", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3894428152492669, "equal_cnt": 32, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 11, "fix_ops_cnt": 32, "bug_source_code": "#include \n#include\nint main ()\n\n{\n char s[100];\n int i,u=0,l=0;\n scanf(\"%s\",&s);\n for (i=0;i<100;i++)\n {\n if (s[i]>=65 && s[i]<=90)\n {\n u++;\n }\n else if (s[i]>=97 && s[i]<=122)\n {\n l++;\n }\n if (u>l)\n {\n for (i=0;i=65 && s[i]<=90)\n {\n s[i]=s[i]-32;\n }\n }\n }\n else\n {\n for (i=0;i=97 && s[i]<=122)\n {\n s[i]=s[i]+32;\n }\n }\n }\n\n }\n printf(\"%s\\n\",s);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b136d484184a5ee688149fec29308146", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "56c85af6b860fce122dec9e5b9fb087d", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.902127659574468, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nint main(){\nchar s[100];\n char name[100][100]={\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"};\nint f=1,i,j,k,ql,nl;\n scanf(\"%s\",&s);\n ql=strlen(s);\n for(i=0;i<5;i++)\n {\n \tnl=strlen(name[i]);\n \tfor(j=0;j\n * \n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n * \n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * \n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n * MA 02110-1301, USA.\n * \n * \n */\n\n\n#include \n#include \n\nint main(int argc, char **argv)\n{\n\tint check(char[],char[]);\n\nchar s[100];\n char name[100][100]={\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"};\n int i,j,k,l1,l2,c=0; \n scanf(\"%s\",&s);\nl1=strlen(s);\n for(i=0;i<5;i++)\n {\n \tl2=strlen(name[i]);\n \tfor(j=0;j\n\nint main(){\nint i,x;\nchar A[101];\nfor(i=0;i<101;i++){\nscanf(\"%c\",&A[i]);\n }\nfor(i=0;i<101;i++){ \nif(A[i]=='O' && A[i+1]='l' && A[i+2]=='y' && A[i+3]=='a' || A[i]=='D' && A[i+1]=='a' && A[i+2]=='n' && A[i+3]=='i' && A[i+4]=='l' || A[i]=='A' && A[i+1]=='n' && A[i+2]=='n' || A[i]=='S' && A[i+1]=='l' && A[i+2]=='a' && A[i+3]=='v' && A[i+4]=='a' || A[i]=='N' && A[i+1]=='i' && A[i+2]=='k' && A[i+3]=='i' && A[i+4]=='t' && A[i+5]=='a'){\nx=1;\n}\nelse \nx=0;\n}\nif(x==1)\nprintf(\"YES\");\nelse \nprintf(\"NO\"); \n}", "lang": "GNU C11", "bug_code_uid": "85e59d8997f6ca9f83a81aa9de42477a", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "5b674170a20d6bda14f7226df6c2d8d7", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8540856031128404, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 15, "bug_source_code": "#include \nint main(){\nint i,count=0,n;\nscanf(\"%d\",&n);\nchar S[101];\nfor(i=0;i\n#define true 1\n#define false 0\nint isComp[1000002]={0};\nvoid sieve(long long int N)\n{\n\tlong long int ans=1;\n\tlong long int i;\n\tfor(i=2;i*i<=N;i++)\n\t{\n\t\tif(isComp[i]==false)\n\t\t{\n\t\t\tif(N%i==0)\n\t\t\t{\n\t\t\t\t//long long int temp=N;\n\t\t\t\twhile(N%i==0)\n\t\t\t\t{\n\t\t\t\t\tN/=i;\n\t\t\t\t}\n\t\t\t\tans*=i;\n\t\t\t}\n\t\t\tlong long int j=2*i;\n\t\t\twhile(j<=N)\n\t\t\t{\n\t\t\t\tisComp[j]=true;\n\t\t\t\tj+=i;\n\t\t\t}\n\t\t}\n\t}\n\tif(N)\n\t\tans*=N;\n\tprintf(\"%lld\\n\",ans);\n}\nint main()\n{\n\tlong long int N;\n\t\n\tscanf(\"%lld\",&N);\n\tsieve(N);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8e6669f54a63b0bd111bc9cdafd21be1", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "8a1d6d3ad9ca66f12043540b7e9426ed", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3316582914572864, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nint main()\n{\n\tint H1, H2, M1, M2;\n\tscanf(\"%d%d:%d%d\", &H1, &H2, &M1, &M2);\n\tdo\n\t{\n\t\tM2++;\n\t\tif (M2 == 10)\n\t\t{\n\t\t\tM2 = 0;\n\t\t\tM1++;\n\t\t\tif (M1 == 7)\n\t\t\t{\n\t\t\t\tM1 = 0;\n\t\t\t\tH2++;\n\t\t\t\tif (H1 == 1)\n\t\t\t\t{\n\t\t\t\t\tif (H2 == 3)\n\t\t\t\t\t{\n\t\t\t\t\t\tH1 = 0;\n\t\t\t\t\t\tH2 = 0;\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (H2 == 10)\n\t\t\t\t\t{\n\t\t\t\t\t\tH1++;\n\t\t\t\t\t\tH2 = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} // Time has been increased by one minute.\n\t} while(H1 != M2 || H2 != M1);\n\tprintf(\"%d%d:%d%d\", H1, H2, M1, M2);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "210358ac558282b7ce74255edac75be3", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "c766b792f24348161f30df88bec99774", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.43714609286523215, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#include\n#include\n\nint main(void)\n{\n char c;\n char a[9];\n bool s = true;\n\n int i = 0;\n while(i < 9 && (c = getchar()))\n if(c == 'x')\n a[i++] = 1;\n else if(c == '.')\n a[i++] = 0;\n\n for(int i = 0; s && i < 9; i++)\n if(a[i] != a[8 - i])\n s = false;\n\n printf(\"%s\", s ? \"YES\" : \"NO\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a4c4d6f9e6861bd597ce3ed040fa72c0", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "4c96f977f7622604e6480c045784f212", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8418367346938775, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n int c,v,v1,a,l,i=0,s=0;\n scanf(\"%d %d %d %d %d\",&c,&v,&v1,&a,&l);\n while(1)\n {\n\n\n\n s=s+(v+(a*i));\n if(i!=0)\n {\n s=s-l;\n }\n if(s>=v1)\n {\n s=v1;\n }\n i++;\n if(s==c)\n {\n printf(\"%d\\n\",i);\n break;\n }\n }\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "52f77ceccb7e358dc71599b8fa22ca69", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "090f2ec3b2395ba039e5e6b93b140f58", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5386313465783664, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int v=n;\n\n int in=1;\n while(v!=1)\n {\n if(v%in!=0)\n {\n v=v-in;\n in=1;\n }\n in++;\n }\n printf(\"%d\\n\",v);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c0fce5d0b4344d8b83180a6aa8d88c70", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "ebbb44e917ec7ea88fa725faf7b417cb", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5078451882845189, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "#include\n#define INF 1000000009\nint max(int x,int y){\n if(x>y){\n return x;\n }\n return y;\n}\nint min(int x, int y){\n if(x>y){\n return y;\n }\n return x;\n}\nint main(){\n int n,m,i,j,a,b,cnt1=INF,cnt2=INF,cnt3=INF,cnt4=INF,ans1=INF,ans2=INF,ans3=INF,ans4=INF,i,j,ret;\n scanf(\"%d%d%d%d%d%d\",&n,&m,&i,&j,&a,&b);\n if((i-1)%a!=0){\n if((n-i)%a!=0){\n if((j-1)%b!=0){\n if((m-j)%b!=0){\n printf(\"Poor Inna and pony!\\n\");\n return 0;\n }\n }\n }\n }\n if((i-1)%a==0){\n cnt1=(i-1)/a;\n }\n if((n-i)%a==0){\n cnt2=(n-i)/a;\n }\n if((j-1)%b==0){\n cnt3=(j-1)/b;\n }\n if((m-j)%b==0){\n cnt4=(m-j)/b;\n }\n if((cnt1-cnt3)%2==0 && cnt1!=INF && cnt3!=INF){\n ans1=max(cnt1,cnt3);\n }\n if((cnt1-cnt4)%2==0 && cnt1!=INF && cnt4!=INF){\n ans2=max(cnt1,cnt4);\n }\n if((cnt2-cnt3)%2==0 && cnt2!=INF && cnt3!=INF){\n ans3=max(cnt2,cnt3);\n }\n if((cnt2-cnt4)%2==0 && cnt2!=INF && cnt4!=INF){\n ans4=max(cnt2,cnt4);\n }\n if(ans1==INF && ans2==INF && ans3==INF && ans4==INF){\n printf(\"Poor Inna and pony!\\n\");\n return 0;\n }\n i=min(ans1,ans2);\n j=min(ans3,ans4);\n ret=min(i,j);\n printf(\"%d\\n\",ret);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "25798a35197281522508b2ec7474b978", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "0b6ea20a69868541f39ce9291295a90b", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9959839357429718, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n int n;\n scanf(\"%d\", &n);\n char cat[0];\n int en;\n if(n%4==1){\n en = 0;\n }\n else if(n%4==3){\n en = 0;\n }\n else if(n%4==2){\n en = 1;\n }\n else if(n%4==0){\n en = 1;\n }\n n = n+ en;\n if(n%4==1){\n cat[0]='A';\n }\n else if(n%4==3){\n cat[0] = 'B';\n }\n else if(n%4==2){\n cat[0] = 'C';\n }\n else if(n%4==0){\n cat[0] = 'D';\n }\n printf(\"%d %c\", en, cat[0]);\n \n", "lang": "GNU C11", "bug_code_uid": "63ffeb33d60b9401b77a77a762b6c080", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "7e5c2798cc73557d8c1797236f47be92", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8864970645792564, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\ntypedef long long ll;\nint c[40][40];\nint main()\n{\n for (int i=0;i<=30;i++)\n {\n c[i][0]=c[i][i]=1;\n for (int j=1;jm)\n continue;\n ans+=ll(c[n][i])*c[m][p];\n }\n printf(\"%I64d\\n\",ans);\n return(0);\n}", "lang": "GNU C", "bug_code_uid": "ec024642308301d689ab8409c3ad4b7b", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "32c0b47134d9d75b5e5215e8465b12e7", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9937952430196484, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define min(a, b) (a < b ? a : b)\n\nlong long power( int a, int b ) {\n\tif( b == 0 ) return 1;\n\n\tlong long res = power(a, b/2);\n\tres *= res;\n\n\tif( b % 2 ) res *= a;\n\treturn res;\n}\n\nlong long length( long long N ) {\n\tint l = 0;\n\t\n\tif( N == 0 ) return 1;\n\n\twhile( N ) {\n\t\tN /= 10;\n\t\tl++;\n\t}\n\n\treturn l;\n}\n\nlong long first( long long N ) {\n\treturn N / power(10, length(N)-1);\n}\n\nlong long middle( long long N ) {\n\treturn (N - first(N) * power(10, length(N)-1)) / 10 + 1;\n}\n\nlong long nways( int N ) {\n\tlong long res = 0;\n\n\tres = min(9, N);\n\tres += min(N,99) / 11;\n\n\tif( length(N) > 2 ) {\n\t\tint i;\n\n\t\tfor( i = 3; i < length(N); i++ )\n\t\t\tres += 9 * power(10, i-2);\n\n\t\tfor( i = 1; i < first(N); i++ )\n\t\t\tres += power(10, length(N)-2);\n\n\t\tres += middle(N);\n\t\t\n\t\tint last = N % 10;\n\t\tif( first(N) > last ) res--;\n\t}\n\n\treturn res;\n}\n\nint main( void ) {\n\tlong long L, R;\n\tscanf(\"%lld %lld\", &L, &R);\n\n\tprintf(\"%lld\\n\",nways(R) - nways(L-1));\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "cd2d3792fe5b2b8d77584cbdfa837fcf", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "3eba034f978030a5655c17906164cea8", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9998063516653757, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n int fun(char a[],char b[],int m);\n char a[20],b[20];\n int m,n,i,j,c[30],t,q=0;\n while(scanf(\"%s%s\",b,a)!=EOF)\n {\n m=strlen(a);\n n=strlen(b);\n m--;n--; \n if(strcmp(a,b)==0)\n {\n for(i=m;i>=0;i--) \n {a[i]=a[i]-'0';c[m-i]=a[i];} \n for(i=m;i>=0;i--)\n a[i]=c[i]; \n for(i=n;i>=0;i--)\n {b[i]=b[i]-'0';c[n-i]=b[i];}\n for(i=0;i<=n;i++) \n b[i]=c[i]; \n for(i=0;i<30;i++)\n c[i]=0;\n t=1; \n if(a[m]==a[0])\n printf(\"1\\n\");\n else\n printf(\"0\\n\"); \n \n }\n else\n {for(i=m;i>=0;i--) \n {a[i]=a[i]-'0';c[m-i]=a[i];} \n for(i=m;i>=0;i--)\n a[i]=c[i]; \n for(i=n;i>=0;i--)\n {b[i]=b[i]-'0';c[n-i]=b[i];}\n for(i=0;i<=n;i++) \n b[i]=c[i]; \n for(i=0;i<30;i++)\n c[i]=0;\n t=1; \n if(n==m)\n { \n if(m<2)\n { \n if(a[n]==b[m])\n {\n if(a[0]>=a[m]&&b[0]<=b[m])\n printf(\"1\\n\");\n else\n printf(\"0\\n\");\n }\n else\n {\n c[0]=a[m]-b[n]-1;\n if(a[n]<=a[0])\n c[0]++;\n if(b[m]>=b[0])\n c[0]++;\n \n }\n }\n \n if(m>=2) \n {\n if(a[m]==b[m]) \n { \n fun(a,b,m); \n q=1;\n } \n else\n { \n c[m-1]=a[m]-b[n]-1; \n for(i=1;i=b[0])\n c[0]++; \n }\n } \n }\n else\n {\n if(m<2)\n {\n c[0]=10-b[n]+a[m]-1;\n if(a[m]<=a[0])\n c[0]++; \n }\n else\n {\n if(n<2)\n { \n c[0]=10-b[n]-1;\n if(b[n]>=b[0])\n c[0]++;\n c[m-1]=c[m-1]+a[m]-1;\n if(a[m]<=a[0])\n { \n for(i=1;i=0) \n for(i=n;i=b[0])\n c[0]++; \n c[m-1]=c[m-1]+a[m]-1; \n for(i=1;i=0)\n for(i=n;i=0;i--)\n if(c[i]!=0)\n {\n j=i;\n break;\n }\n t=j; \n for(i=0;i<=j;i++)\n {\n if(c[i]>9)\n {\n if(i==j)\n t=j+1;\n c[i+1]=c[i+1]+c[i]/10;\n c[i]=c[i]%10;\n }\n }\n i=t;\n for(j=i;j>=0;j--)\n printf(\"%d\",c[j]);\n printf(\"\\n\");\n }\n }\n }\n return 0;\n}\nint fun(char a[],char b[],int m)\n{\n int j,i,t,s,c[30];\n for(i=0;i<30;i++)\n c[i]=0; \n \n s=m;\n while(a[m]==b[m]) \n m--; \n if(m<=1)\n { \n if(m==0)\n {\n if(a[s]<=a[0]&&b[s]>=b[0])\n printf(\"1\\n\");\n else\n printf(\"0\\n\");\n } \n else\n {\n c[0]=a[m]-b[m]-1;\n if(a[s]<=a[0])\n c[0]++;\n if(b[s]>=a[0])\n c[0]++;\n printf(\"%d\\n\",c[0]);\n } \n }\n else\n { c[m-1]=a[m]-b[m]-1; \n for(i=1;i=b[0])\n c[0]++; \n for(i=29;i>=0;i--)\n if(c[i]!=0)\n {\n j=i;\n break;\n }\n t=j; \n for(i=0;i<=j;i++)\n {\n if(c[i]>9)\n {\n if(i==j)\n t=j+1;\n c[i+1]=c[i+1]+c[i]/10;\n c[i]=c[i]%10;\n }\n }\n i=t;\n for(j=i;j>=0;j--)\n printf(\"%d\",c[j]);\n printf(\"\\n\");\n }\n \n \n}\n", "lang": "GNU C", "bug_code_uid": "9b0db896c5577646694689ffbe9a96a0", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "99ce7518aa7ba1c9c99d43a780078100", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9930313588850174, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main()\n{\nint n,k,i=0,j,a[15];\nint sum=0;\nscanf(\"%d %d\",&n,&k);\nfor(j=0;j\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n char s[n];\n scanf(\"%s\",s);\n\nfor (int i=0,j=1;s[i]; j++ )\nif (!((s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||s[i]=='y') && (s[j]=='a'||s[j]=='e'||s[j]=='i'||s[j]=='o'||s[j]=='u'||s[i]=='y')))\n{printf(\"%c\",s[i]); i=j;}\n}\n", "lang": "GNU C", "bug_code_uid": "ae7320638548164796bfe146879784cf", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "047a3885629dc7091c977250086cc19e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9975369458128078, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main() {\n\tint i, m, n, k;\n\tscanf(\"%d%d\", &m, &n);\n\tif (n - m >= 2 || (m == 0 && n != 1) || (n == 0 && m != 1)) { printf(\"NO\"); return 1; }\n\telse if (m <= n) i = 1;\n\telse i = 2;\n\tk = i;\n\tfor (i; 1; i++)\n\t{\n\t\tif (i % 2 == 0) m--;\n\t\tif (i % 2 != 0) n--;\n\t\tif (m < 0 || n < 0) break;\n\t}\n\tif ((m < 0 && n > 0) || (n < 0 && m > 0)) printf(\"NO\");\n\telse printf(\"YES\");\n}", "lang": "GNU C", "bug_code_uid": "da2a2ac094db4ce7be7f2cea9f348652", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "7aab3b663a7f8cc9b81c67b245fec876", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.29510395707578807, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n\nint main() {\n\tlong long **dp;\n\tint n, h;\n\tint i, j;\n\n\tscanf(\"%d%d\", &n, &h);\n\tdp = malloc(sizeof(long long *) * n);\n\tdp[0] = malloc(sizeof(long long) * 1);\n\tdp[0][0] = 1;\n\tif (n == 1 && h == 1) {\n\t\tprintf(\"1\\n\");\n\t\treturn 0;\n\t}\n\tfor (i = 1; i < n; i++) {\n\t\tdp[i] = malloc(sizeof(long long) * (i + 1));\n\t\tfor (j = 0; j <= i; j++) {\n\t\t\tdp[i][j] = i - 1;\n\t\t\tif (j == 0)\n\t\t\t\tdp[i][j] += 2 * dp[i - 1][j]; \n\t\t\telse if (j == i)\n\t\t\t\tdp[i][j] = 2 * dp[i - 1][j - 1];\n\t\t\telse\n\t\t\t\tdp[i][j] += 2 * dp[i - 1][j - 1];\n\t\t\tif (i == n - 1 && j == h - 1) {\n\t\t\t\tprintf(\"%lld\\n\", dp[i][j]);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "41e14f3cd8df89968d267097519b2c59", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "apr_id": "05fae6a97c794ff9374fc116a4084214", "difficulty": 1900, "tags": ["divide and conquer", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9688660382747787, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#define N 1002\n#define MOD 1000000007\n\ntypedef long long typec;\n\nint n, m, k;\ntypec ftable[N];\ntypec facmod[1000001];\n\ntypec extend_gcd(typec a, typec b, typec *x, typec *y)\n{\n\tif(!b) return *x = 1, *y = 0, a;\n\ttypec res = extend_gcd(b, a % b, x, y), tmp = *x;\n\t*x = *y, *y = tmp - (a / b) * (*y);\n\treturn res;\n}\n\ntypec inverse(typec a, typec m)\n{\n\ttypec x, y;\n\ty = extend_gcd(a, m, &x, &y);\n\twhile(x < 0) x += m;\n\treturn x;\n}\n\ntypec pow_mod(typec x, typec k, typec m)\n{\n\ttypec res = 1;\n\twhile(x %= m, k) {\n\t\tif(k&1) res *= x, res %= m;\n\t\tx *= x, k >>= 1;\n\t}\n\treturn res;\n}\n\nint mymin(int x, int y)\n{\n\treturn x < y? x : y;\n}\n\ntypec combines(int i, int j)\n{\n\tif(i < j) return 0;\n\treturn facmod[i] * inverse(facmod[j], MOD) % MOD * inverse(facmod[i - j], MOD) % MOD;\n}\n\nvoid init()\n{\n\tint i, j;\n\tfacmod[0] = 1;\n\tfor(i = 1; i <= 1000000; i++) {\n\t\tfacmod[i] = facmod[i - 1] * i;\n\t\tfacmod[i] %= MOD;\n\t}\n\ttypec sum = 0;\n\tftable[1] = 1;\n\tfor(i = 2; i <= n; i++) {\n\t\tftable[i] = pow_mod(i, n, MOD) + MOD;\t\t\n\t\tsum = 0;\n\t\tfor(j = 1; j < i; j++) {\n\t\t\tsum += combines(i, j) * ftable[j] % MOD;\n\t\t\tsum %= MOD;\n\t\t}\n\t\tftable[i] -= sum;\n\t\tftable[i] %= MOD;\n\t}\n}\n\n\ntypec calc()\n{\n\tint i, j, m1, m2;\n\ttypec res = 0, tmp, stmp;\n\tm1 = mymin(n, k);\n\tfor(i = 0; i <= m1; i++) {\n\t\ttmp = combines(k, i) * pow_mod(i, (m - 2) * n, MOD) % MOD;\n\t\tm2 = mymin(n - i, (k - i) / 2);\n\t\tstmp = 0;\n\t\tfor(j = 0; j <= m2; j++) {\n\t\t\tif(!i && !j) continue;\n\t\t\tstmp += combines(k - i, j) * combines(k - i - j, j) % MOD * ftable[i + j] % MOD * ftable[i + j] % MOD;\n\t\t\tstmp %= MOD;\n\t\t}\n\t\tres += tmp * stmp % MOD;\n\t\tres %= MOD;\n\t}\n\treturn res;\n}\nint main()\n{\n\tscanf(\"%d%d%d\", &n, &m, &k);\n\tinit();\n\tprintf(\"%lld\\n\", calc());\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f9f75d8d638cc24816c44f50527cac84", "src_uid": "f22f28e2d8933f4199ba5ccfc0de8cda", "apr_id": "ad0e14fd6ee0351f65f76cd5f5ce0d04", "difficulty": 2300, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9931538110451849, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#define mod 1000000007\n\nint f[1001],g[1001],c[1001][1001],r1[1001],r2[2001];\n\nint mi(int a,long long b)\n{\n int t;\n if (!b)\n return 1;\n t=mi(a,b>>1);\n t=(long long)t*t%mod;\n if (b&1)\n t=(long long)t*a%mod;\n return t;\n}\n\nint main()\n{\n int i,j,n,m,k,x,s=0,t=1;\n scanf(\"%d%d%d\",&n,&m,&k);\n if (m==1)\n s=mi(k,n);\n else\n {\n for (i=0;i<=n;i++)\n {\n c[i][0]=1;\n for (j=1;j<=i;j++)\n c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;\n }\n for (i=1;i<=n;i++)\n {\n f[i]=g[i]=mi(i,n);\n for (j=1;j\nint main()\n{\n\tchar a,b;\n\tlong long int n;\n\tscanf(\"%c%c%lld\",&a,&b,&n);\n\tn=n%4;\n\tif n%2==0:\n\t\tprintf(\"undefined\");\n\telse:\n\t\tif (n==1)\n\t\t\tif (a=='^')\n\t\t\t\tif (b=='>')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\n\t\t\tif (a=='>')\n\t\t\t\tif (b=='V')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\n\t\t\tif (a=='V')\n\t\t\t\tif (b=='<')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\n\t\t\tif (a=='<')\n\t\t\t\tif (b=='^')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\t\n\t\tif (n==3)\n\t\t\tif (a=='^')\n\t\t\t\tif (b=='<')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\n\t\t\tif (a=='>')\n\t\t\t\tif (b=='^')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\n\t\t\tif (a=='V')\n\t\t\t\tif (b=='>')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\n\t\t\tif (a=='<')\n\t\t\t\tif (b=='V')\n\t\t\t\t\tprintf(\"cw\");\n\t\t\t\telse \n\t\t\t\t\tprintf(\"ccw\");\t\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "87d9b576cd5acf82dd7e6a9b87b742dc", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "7bb8a88b9ef1feb1b1d7b298e62eb2ae", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9975381585425899, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int x,n,i,j,t,z;\n int a[10],b[10];\n while(scanf(\"%d\",&x)!=EOF)\n { \n for(i=0;i<10;i++) \n a[i]=b[i]=-1;\n t=x;\n do \n { \n z=t%10;\n a[z]=1; \n } \n while(t=t/10);\n for(i=1,n=1;i*i\nint main()\n{\n char s[101];\n int len,i,a=0,b=0;\n scanf(\"%s\",s);\n len=strlen(s);\n for(i=0;i\n#include \n\n\nint main() {\n\tchar s[120];\n\tint o=0,d=0,I,len;\n\tscanf(\"%s\",s);\n len=strlen(s)\n\tfor(I=0;I\n\nint main()\n{\n int i, c1=0, c2=0;\n char a[205];\n scanf(\"%s\", a);\n \n for(i=0;i\n#include\nint main(){\n int i,j,k,l;\n char r[102];\n scanf(\"%s\",r);\n j=strlen(r);\n k=0;\n l=0;\n for(i=0;i\n#include\nint main()\n{\n char a[105];\n int b,count=0,cou2=0,i;\n scanf(\"%s\",&a);\n b=strlen(a);\n for(i=0;i\n#include\nint main() {\n\tchar str[101];\n\tscanf(\"%s\",str);\n\tint l=strlen(str);\n\tint d=0,p=0;\n\tfor(int i=0;i\n\nint main()\n{\n char s[100];\n int p=0,l=0,i=0;\n scanf(\"%s\",s);\n while(s[i]!='\\0');\n {\n if(s[i]=='o')\n p++;\n else\n l++;\n i++;\n }\n if(l==0||p==0)\n printf(\"YES\");\n else if(l%p==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n \n}", "lang": "GNU C", "bug_code_uid": "d84f14cc2f1c2ec62532052e15193751", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "7f51cd3366ef20393b4760197c37e82e", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8908554572271387, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "//\n// main.c\n// test1\n//\n// Created by Abdallah Elerian on 3/23/16.\n// Copyright \u00a9 2016 Abdallah. All rights reserved.\n//\n\n#include \n\nint main() {\n int a1,a2,n=0;\n scanf(\"%d\",&a1);\n scanf(\"%d\",&a2);\n while (a1!=0 || a2!=0) {\n if(a1\n\nint main(){\n int p1,p2;\n int tym=0;\n scanf(\"%d %d\",&p1,&p2);\n while(p1>0&&p2>0)\n {\n if(p1==1&&p2==1)\n {\n break;\n }\n if(p1\nint n, d, c = 101;\nchar p[101];\n\nvoid home(int i, int cont){\n\tif(cont < c){\n\t\tif(i == n-1)\n\t\t\tc = cont;\n\t\telse{\n\t\t\tint tam = (d+ii; j--)\n\t\t\t\tif(p[j]=='1')\n\t\t\t\t\thome(j, cont+1);\n\t\t}\n\t}\n}\n\nint main(){\n\tscanf(\"%d%d\", &n, &d);\n\tscanf(\"%s\", &p);\n\thome(0,0);\n\tprintf(\"%d\\n\", c==101? -1:c); \n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "3c4953e6c7ee75b5f34bccdba9cdf1f0", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "878f897ad52c4cc68aaab3de9f74f573", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9586776859504132, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\ntypedef long long unsigned llu;\nint dicmal();\nint main()\n {\n llu x,y;\n x=dicmal();\n\n\n y=dicmal();\n\n printf((xy)?\"\\n>\":\"\\n=\");\n return 0;\n }\nint dicmal()\n {\n llu r=0;\n llu x,bx,d;\n scanf(\"%u%u\",&x,&bx);\n for(;x>0;x--)\n {\n scanf(\"%u\",&d);\n r=r*bx+d;\n }\n\n return r;\n }", "lang": "GNU C", "bug_code_uid": "122a806cf887b0bccd884aff1b657c51", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "1da17cb05f3be2f8861fdbe8f8d18f9a", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9758643183300717, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nusing namespace std;\n\nlong long power(int a, int b);\n\nint main(void)\n{\n int *xx, *yy;\n int n, m, bx, by, i;\n long long x, y;\n x = y = 0;\n scanf(\"%d %d\", &n, &bx);\n xx = (int *)malloc(n*sizeof(int));\n for (i = n-1; i>-1; i--) scanf(\"%d\", &xx[i]);\n scanf(\"%d %d\", &m, &by);\n for (i = 0; i-1; i--) scanf(\"%d\", &yy[i]);\n for (i = 0; iy) {printf(\">\"); return 0;}\n if (x==y) {printf(\"=\"); return 0;}\n}\n\nlong long power(int a, int b)\n{\n int i;\n long long p;\n for (p = 1, i = 1; i<=b; i++)\n p *= a;\n return p;\n}\n", "lang": "GNU C", "bug_code_uid": "ca3fa25fd1b5f4c7ba667ea174b48402", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "ac2baa13728176e300cf41a2bdde3f30", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.3240343347639485, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n unsigned long long p,y,sign=1,Y,k,i;\n scanf(\"%llu%llu\",&p,&y);\n unsigned long long count[y+1];\n for(i=0;i\n\n#define DEBUG 0\n\nint main() {\n\n long long int n, a, b, p, q;\n long long int red, blue, choc, i;\n long long int rA, rB;\n\n scanf(\"%lld %lld %lld %lld %lld\\n\", &n, &a, &b, &p, &q);\n\n red = 0;\n blue = 0;\n for(i = 1; i <= n; i++) {\n rA = i % a;\n rB = i % b;\n\n if(DEBUG) printf(\"i %lld, rA %lld, rB %lld\\n\", i, rA, rB);\n\n if(rA == 0 && rB == 0) {\n if(p >= q) {\n red++;\n if(DEBUG) printf(\"red %lld\\n\", red);\n } else {\n blue++;\n if(DEBUG) printf(\"blue %lld\\n\", blue);\n }\n\n } else if(rA == 0) {\n red++;\n if(DEBUG) printf(\"red2 %lld\\n\", red);\n } else if(rB == 0) {\n blue++;\n if(DEBUG) printf(\"blue2 %lld\\n\", blue);\n }\n }\n \n choc = (red * p);\n if(DEBUG) printf(\"red * p %lld\\n\", choc);\n choc = choc + (blue * q);\n printf(\"%lld\\n\", choc); \n\n return 0;\n}\n\n \n", "lang": "GNU C", "bug_code_uid": "25cd5d891ca6a9c46d800a29195fa7fa", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "42a200fcd8d15d7175d1ab703ff31ac2", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.605586592178771, "equal_cnt": 20, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 10, "fix_ops_cnt": 19, "bug_source_code": "#include\nint main ()\n{\n int n,r=0,i;\n scanf(\"%d\",&n);\n int f=1,flag=0;\n r=r+f;\n while (1)\n {\n if(r==n){\n flag=0;\n break;\n }\n else if(r>n)\n {\n flag=1;\n break;\n }\n f++;\n }\n\n if(flag==0)\n printf(\"YES\");\n else if(flag==1)\n printf(\"NO\");\n\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "9f37162b43b123c264b346a625f8ac10", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "69155380fbb16c8cdd3f530c697e35c5", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8727735368956743, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint main()\n\n{\n\tint a,b,c,d;\n\tscanf(\"%d%d\",&a,&b);\n\n\tscanf(\"%d%d\",&c,&d);\n\n\tfloat h;int s;\n\tif(c*8>=(b-a))\n\t\tprintf(\"0\");\n\n\telse if(c*8<(b-a) && c>=d)\n\t{\n\t\th = (b-a-8*c)/(double)((c-d)*12);\n\t\ts = (b-a-8*c)/((c-d)*12);\n\n\t\tif(h>s)\n\t\t\tprintf(\"%d\\n\",s+1);\n\n\t\telse if(h==s)\n\t\t\tprintf(\"%d\",s);\n\t}\n\n\telse if(c\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nchar s[5][105];\nint xx[4][3]={{0,1,1},{0,1,1},{0,0,1},{0,0,1}},yy[4][3]={{0,0,1},{1,0,1},{0,1,1},{0,1,0}},\n\ti,j,a[5][105],l,ans;\n\nvoid dfs(int x,int y)\n{\n\tint i,j,f;\n\t\n\tif (y+(l-x)/2<=ans) return;\n\tif (x>=l) \n\t{\n\t\tans=y>ans ? y : ans;\n\t\treturn;\n\t}\n\tfor (i=0;i<4;i++)\n\t{\n\t\tfor (j=f=0;j<3;j++)\n\t\tif (a[xx[i][j]][x+yy[i][j]]||x+yy[i][j]>=l) \n\t\t{\n\t\t\tf=1;\n\t\t\tbreak;\n\t\t}\n\t\tif (!f)\n\t\t{\n\t\t\tfor (j=0;j<3;j++) a[xx[i][j]][x+yy[i][j]]=1;\n\t\t\tdfs(x+1,y+1);\n\t\t\tfor (j=0;j<3;j++) a[xx[i][j]][x+yy[i][j]]=0;\n\t\t}\n\t}\n\tdfs(x+1,y);\n}\n\nint main()\n{\n\tscanf(\"%s%s\",s[0],s[1]);\n\tl=strlen(s[0]);\n\tfor (j=ans=0;j<2;j++)\n\tfor (i=0;i\nint main()\n\n{\n\tint x=0, y=0;\n\tscanf(\"%d %d\", &x, &y);\n\tint p,q,r;\n\tp=y;\n\tq=y;\n\tr=y;\n\tint count=0;\n\n\twhile(1<2\n\t{\n\t\tif(q+r-1\nmain()\n{\n\tint d,x,y,a,b,c,i=0;\n\tscanf(\"%d%d\",&x,&y);\n\ta=b=c=y;\n\twhile(a\n#include \n#define M 1000000009\n\ntypedef long long LL;\nint n,m,sz,son[110][4],fail[110],term[110],par[110],l[110];\nLL f[1010][110][20];\nvoid init(int u,int d);\nLL dp(int i,int u,int o);\n\nint main(void)\n{\n //freopen(\"gene.in\",\"r\",stdin);\n //freopen(\"gene.out\",\"w\",stdout);\n scanf(\"%d%d\",&n,&m);\n memset(son,0,sizeof(son));\n memset(term,0,sizeof(term));\n sz=1; l[1]=0;\n int i,j,u,t;\n char str[20];\n for(i=1;i<=m;i++)\n {\n scanf(\"%s\",str);\n for(u=1,j=0;str[j];j++)\n {\n if(str[j]=='A') t=0;\n else if(str[j]=='C') t=1;\n else if(str[j]=='G') t=2;\n else t=3;\n if(!son[u][t])\n {\n l[++sz]=l[u]+1;\n son[u][t]=sz;\n }\n par[son[u][t]]=u;\n u=son[u][t];\n }\n term[u]=1;\n }\n memset(fail,-1,sizeof(fail));\n fail[1]=0;\n for(i=0;i<4;i++)\n fail[son[1][i]]=1;\n init(1,-1);\n memset(f,-1,sizeof(f));\n printf(\"%I64d\\n\",dp(0,1,0));\n return 0;\n}\n\nvoid init(int u,int d)\n{\n int i,v;\n if(fail[u]<0)\n for( fail[u]=1,v=fail[par[u]] ; v ; v=fail[v] )\n if(son[v][d])\n {\n fail[u]=son[v][d];\n break;\n }\n for(i=0;i<4;i++)\n if(son[u][i])\n init(son[u][i],i);\n}\n\nLL dp(int i,int u,int o)\n{\n if(f[i][u][o]>=0) return f[i][u][o];\n else if(i==n)\n return f[i][u][o] = o ? 0 : 1;\n f[i][u][o]=0;\n int j,v,w,t;\n for(j=0;j<4;j++)\n {\n for( w=0,v=u ; v&&l[v]>=o ; v=fail[v] )\n if(son[v][j])\n {\n w=son[v][j];\n break;\n }\n if(w)\n {\n for(t=w;l[t]>=o+1;t=fail[t])\n if(term[t]) break;\n f[i][u][o] = ( f[i][u][o] + dp(i+1,w,l[t]\n#include \n\n#define mod 1000000009\n#define max(a,b) ((a)>(b)?(a):(b))\n\nchar str[15][15]={0};\nchar prefix[106][15]={0};\nlong o=0;\nlong g[106][4]={0},m;\nchar gene[5]=\"ACGT\";\n\nlong f[1006][106][15]={0};\nlong a[106]={0};\nchar opt[15]={0};\n\nlong find(char opt[],long l,long r)\n{\n long i,j,k;\n long a[15]={0};\n \n for(i=1;i<=m;i++)\n {\n for(j=1;opt[j];j++)\n {\n for(k=0;opt[j+k]==str[i][1+k]&&opt[j+k]&&str[i][1+k];k++);\n if(!str[i][1+k])\n for(k=0;str[i][1+k];k++)\n a[j+k]=1;\n }\n }\n for(j=l;j<=r;j++)\n if(!a[j])\n return 0;\n return 1;\n}\n\nint main()\n{\n long n,i,j,k,l;\n long ans=0;\n char ch;\n \n scanf(\"%ld%ld\",&n,&m);\n for(i=1;i<=m;i++)\n scanf(\"%s\",str[i]+1);\n for(i=1;i<=m;i++)\n for(j=1;str[i][j];j++)\n {\n ch=str[i][j+1];\n str[i][j+1]=0;\n for(k=1;k<=o;k++)\n if(strcmp(prefix[k]+1,str[i]+1)==0)\n break;\n if(k>o)\n {\n strcpy(prefix[++o]+1,str[i]+1);\n prefix[o][0]=strlen(prefix[o]+1);\n }\n str[i][j+1]=ch;\n if(!str[i][j+1])\n a[k]=1;\n }\n \n for(i=0;i<=o;i++)\n {\n for(j=0;j<4;j++)\n {\n // prefix[i][prefix[i][0]+1]=gene[j];\n memset(opt,0,sizeof(opt));\n strcpy(opt,prefix[i]);\n opt[opt[0]+1]=gene[j];\n for(k=1;k<=prefix[i][0]+1;k++)\n for(l=1;l<=o;l++)\n {\n if(strcmp(opt+k,prefix[l]+1)==0)\n {\n g[i][j]=l;\n goto loop;\n }\n }\n loop:;\n }\n //prefix[i][prefix[i][0]+1]=0;\n }\n \n f[0][0][0]=1;\n for(i=0;i=0||find(prefix[j],k+1,prefix[j][0]+1-prefix[g[j][l]][0]))\n {\n f[i+1][g[j][l]][max(a[g[j][l]]?prefix[g[j][l]][0]:k-(prefix[j][0]+1-prefix[g[j][l]][0]),0)]+=f[i][j][k];\n f[i+1][g[j][l]][max(a[g[j][l]]?prefix[g[j][l]][0]:k-(prefix[j][0]+1-prefix[g[j][l]][0]),0)]%=1000000009;\n }\n }\n }\n for(j=1;j<=o;j++)\n for(k=0;k<=prefix[j][0];k++)\n if(find(prefix[j],k+1,prefix[j][0]))\n {\n ans+=f[n][j][k];\n ans%=mod;\n }\n printf(\"%ld\\n\",ans);\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f4b6e38f7fde96a613931d07f4b947d2", "src_uid": "3f053c07deaac55c2c51df6147080340", "apr_id": "86ec494b60405e44a13595cd2f32cfb8", "difficulty": 2500, "tags": ["trees", "dp", "string suffix structures"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9865067466266867, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\nint valid(char c){\n if((c>='A' && c<='z')|| (c>='0'&&c<='9') || c=='_') return 1;\n return 0;\n}\nvoid no(){\n printf(\"NO\\n\");\n exit(0);\n}\nint main()\n{\n //freopen(\"in.txt\", \"r\", stdin);\n char id[110];\n fgets(id,110, stdin);\n\n char *user, *host, *res;\n\n if(id[0]=='@') no();\n\n user = strtok(id, \"@\");\n host = strtok(NULL, \"/\");\n if(host==NULL) {\n host=strtok(NULL, \"\\n\");\n res=NULL;\n }\n else {\n res = strtok(NULL, \"\\n\");\n }\n\n //printf(\"%s %s %s\\n\", user, host, res);\n\n if(user==NULL || host==NULL) no();\n if(strlen(user)>16 || strlen(host)>32) no();\n\n int i;\n\n if(user){\n for(i=0; user[i]!='\\0'; i++){\n if(!valid(user[i])) no();\n }\n }\n int word=0;\n if(host){\n for(i=0; host[i]!='\\0'; i++){\n if(valid(host[i])) word++;\n else if(host[i]=='.'){\n if(word<1 || word>16) no();\n word=0;\n }\n else{\n if(host[i]!='\\n') no();\n }\n }\n }\n if(word==0) no();\n\n if(res){\n for(i=0; res[i]!='\\0'; i++) {\n if(!valid(res[i])) no();\n }\n }\n //printf(\"%s %s %s\\n\", user, host, res);\n printf(\"YES\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b44bb4cd7e3ff830db830b706e60a816", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "7d90574d437607e6760e493327638886", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2008695652173913, "equal_cnt": 30, "replace_cnt": 19, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 29, "bug_source_code": "#include\n#include\n\nvoid no(){\n printf(\"NO\\n\");\n exit(0);\n}\n\nint valid(char c) {\n if( (c>='A'&&c<='z') || (c>='0'&&c<='9') || c=='_' )\n}\n\nint main()\n{\n char id[120];\n fgets(id, 110, stdin);\n\n int i=0, host=0, user=0, word=0, res=0;\n\n for(i; id[i]!='@' || id[i]!='\\n'; i++) {\n if(valid(id[i])) user++;\n else no();\n }\n if (user<1 || user>16) no();\n\n if(id[i]=='@')i++;\n\n for(i; id[i]!='/'||id[i]!='\\n'; i++){\n if(valid(id[i])) {\n host++;\n word++;\n }\n else if(id[i]=='.'){\n word--;\n if(word<1|| word>16) no();\n word=0;\n }\n else {\n if(id[i]!='\\n'|| id[i]!='\\0') no();\n }\n }\n if(id[i]=='\\n' && id[i-1]=='.') no();\n if(host<1 || host>32) no();\n\n for(i; id[i]!='\\n'; i++) {\n if(valid(id[i])) res++;\n else no();\n }\n\n printf(\"YES\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b449a001219540611c56827529a0b238", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "7d90574d437607e6760e493327638886", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9968253968253968, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define ulli unsigned long long int\n\nulli factorial(int n){\n if(n==1) return 1;\n else return factorial(n-1)*n;\n}\n\nint main(){\n int n;\n scanf(\"%d\", &n);\n int k = n/2;\n ulli ans;\n ans = factorial(n) / factorial(n-k);\n ans = ans * factorial(k-1)/(2*k);\n printf(\"%lld\\n\",ans);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d1ecb0ad8b88cb736639b75dfa8e98ce", "src_uid": "ad0985c56a207f76afa2ecd642f56728", "apr_id": "b22383889708e2e49f2e60c35179ddd2", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.48079306071871125, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nlong long int factorial(int n) ;\n\nint main()\n{\n int t;\n scanf(\"%d\", &t);\n\n while(t--)\n {\n int n;\n long long int sum, power;\n scanf(\"%d\", &n);\n power = (factorial((n/2)-1) * factorial((n/2)-1));\n sum = ((factorial(n)/((factorial(n/2)) * factorial(n/2))/2) * power);\n\n printf(\"%lld\", sum);\n }\n\n return 0;\n}\n\nlong long int factorial(int n)\n{\n if (n == 1 || n == 0)\n return 1;\n return n * factorial(n - 1);\n}\n", "lang": "GNU C11", "bug_code_uid": "84c6e51a43187c126916802fa292d1cc", "src_uid": "ad0985c56a207f76afa2ecd642f56728", "apr_id": "1cfb5e4a51422f74165dd01100dd1a43", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9875518672199171, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define MD\t1000000007\n\nint power(int n, int k) {\n\tint p;\n\n\tif (k == 0)\n\t\treturn 1;\n\tp = power(n, k / 2);\n\tp = (long long) p * p % MD;\n\tif (k % 2 == 1)\n\t\tp = (long long) p * n % MD;\n\treturn p;\n}\n\nint main() {\n\tint n, m, k, sum, x;\n\n\tscanf(\"%d%d\", &n, &m);\n\tsum = 0;\n\tfor (k = 0; k < n; k++) {\n\t\tx = power(m + m - 1, k); /* Binomial theorem */\n\t\tsum = (sum + x * m % MD * power(m, n - 1 - k)) % MD;\n\t}\n\tprintf(\"%d\\n\", (sum + power(m, n)) % MD);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b71df18694a8a5562616caec39673dee", "src_uid": "5b775f17b188c1d8a4da212ebb3a525c", "apr_id": "08256c0e309b80e604f558849b74c183", "difficulty": 2300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7439759036144579, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include\n#include\nusing namespace std;\nint main()\n{\n int n,m;\n int a,b,c,d;\n cin>>a>>b>>c>>d;\n n=max(a*3/10,(a-a*1.00/250*c));\n m=max(b*3/10,(b-b*1.00/250*d));\n if(n>m) printf(\"Misha\\n\");\n else if(n==m) printf(\"Tie\\n\");\n else printf(\"Vasya\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a65ff538132262d117a6f5332c645f75", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "1dfb490a76bac29442ec605511bce00f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.20614828209764918, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int a[300],b[300],count=0;\n int b1,g,n;\n scanf(\"%d\",&b1);\n scanf(\"%d\",&g);\n scanf(\"%d\",&n);\n if(b1>n && g>n)\n {printf(\"%d\",(n+1));\n return;\n }\n else\n {\n for(int i=0;i<=b1;i++)\n {\n a[i]=i;\n }\n for(int i=0;i<=g;i++) b[i]=i;\n if(b>=g)\n {\n for(int i=0;i<=b1;i++)\n {\n for(int j=0;j<=g;j++)\n {\n\n if(a[i]+b[j]==n) count++;\n else continue;\n }\n }\n }\n else\n {\n for(int i=0;i<=g;i++)\n {\n for(int j=0;j<=b1;j++)\n {\n\n if(b[i]+a[j]==n) count++;\n else continue;\n }\n }\n }\n\n }\n printf(\"%d\",count);\n}\n", "lang": "GNU C11", "bug_code_uid": "5b696b2bd97a8a83c71261b6a141445d", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "49224f908d9999eab4251b6d109fea38", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8670520231213873, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 18, "bug_source_code": "#include\n \nint bigger(int n1, int n2);\n \nint main(){\n\tint b, g, n;\n \n\tscanf(\"%d\", &b);\n\tscanf(\"%d\", &g);\n\tscanf(\"%d\", &n);\n \n\tif(b >= n && g >= n) printf(\"%d\", n + 1);\n\telse if(b >= n && g < n) printf(\"%d\", 1 + g);\n\telse if(b < n && g >= n) printf(\"%d\", 1 + b);\n\telse if(b + g > n) printf(\"%d\", (g + b - bigger(a, b)) - (n - bigger(g, b)) + 1 );\n\telse printf(\"1\");\n \n\treturn 0;\n}\n \nint bigger(int n1, int n2){\n return (-(n1 >= n2) & n1) + (-(n1 < n2) & n2);\n}", "lang": "GNU C11", "bug_code_uid": "7fd40649b5109d72ba9a971548971cea", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "68c6c873109cac0d189e9cd1f2c117be", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7419354838709677, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "#include \nint main(void) {\n int l, r, s, p;\n bool res = false;\n for(int i = 0; i < 4; i++) {\n scanf(\"%d%d%d%d\", &l, &r, &s, &p);\n if(p == 0) continue;\n else if(l | r | s == 1) res = true;\n }\n puts(res ? \"YES\" : \"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "d0e82439d0cc3fa0124d3e9d3baa8847", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "77ceeb58592af908fc3a583a5b7f0723", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9970414201183432, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n/* Written by Nishant Mittal aka nishantwrp */\nint chordtoindex(char *a) {\nif (*a == 'C') {\n a++;\n if (*a == '#') {\n return 2;\n } else {\n return 1;\n }\n}\nif (*a == 'D') {\n a++;\n if (*a == '#') {\n return 4;\n } else {\n return 3;\n }\n}\nif (*a == 'E') {\n return 5;\n}\nif (*a == 'F') {\n a++;\n if (*a == '#') {\n return 7;\n } else {\n return 6;\n }\n}\nif (*a == 'G') {\n a++;\n if (*a == '#') {\n return 9;\n } else {\n return 8;\n }\n}\nif (*a == 'A') {\n return 10;\n}\nif (*a == 'B') {\n return 11;\n}\nif (*a == 'H') {\n return 12;\n}\nreturn 0;\n}\nint distancefind(int a,int b) {\nint count = 0;\nint i = b;\nwhile (i != a) {\n count++;\n if (i == 12) {\n i = 1;\n } else {\n i++;\n }\n}\nreturn count;\n}\nint main()\n{\nchar chord1[3],chord2[3],chord3[3];\nint pos1,pos2,pos3;\nint i=0;\nwhile(i<3) {\nchar tmp;\nscanf(\"%c\",&tmp);\nif (tmp == ' ') {\n break;\n}else {\nchord1[i] = tmp;\n}\ni++;\n}\nint j=0;\nwhile(j<3) {\nchar tmp;\nscanf(\"%c\",&tmp);\nif (tmp == ' ') {\n break;\n}else {\nchord2[j] = tmp;\n}\nj++;\n}\nint k=0;\nwhile(k<3) {\nchar tmp;\nscanf(\"%c\",&tmp);\nif (tmp == '\\n') {\n break;\n}else {\nchord3[k] = tmp;\n}\nk++;\n}\nint ansset = 0;\npos1 = chordtoindex(chord1);\npos2 = chordtoindex(chord2);\npos3 = chordtoindex(chord3);\n//Minor\nif (distancefind(pos2,pos1) == 3 && distancefind(pos3,pos2) == 4) {\n ansset = 1;\nprintf(\"minor\");\n}else if (distancefind(pos2,pos3) == 3 && distancefind(pos1,pos2) == 4) {\n ansset = 1;\nprintf(\"minor\");\n}else if (distancefind(pos1,pos2) == 3 && distancefind(pos3,pos1) == 4) {\n ansset = 1;\nprintf(\"minor\");\n}else if (distancefind(pos1,pos3) == 3 && distancefind(pos2,pos1) == 4) {\n ansset = 1;\nprintf(\"minor\");\n} else if (distancefind(pos3,pos1) == 3 && distancefind(pos2,pos3) == 4) {\n ansset = 1;\nprintf(\"minor\");\n} else if (distancefind(pos3,pos2) == 3 && distancefind(pos1,pos3) == 4) {\n ansset = 1;\nprintf(\"minor\");\n}//Major\nif (distancefind(pos2,pos1) == 4 && distancefind(pos3,pos2) == 3) {\n ansset = 1;\nprintf(\"major\");\n}else if (distancefind(pos2,pos3) == 4 && distancefind(pos1,pos2) == 3) {\n ansset = 1;\nprintf(\"major\");\n}else if (distancefind(pos1,pos2) == 4 && distancefind(pos3,pos1) == 3) {\n ansset = 1;\n\n}else if (distancefind(pos1,pos3) == 4 && distancefind(pos2,pos1) == 3) {\n ansset = 1;\nprintf(\"major\");\n}else if (distancefind(pos3,pos1) == 4 && distancefind(pos2,pos3) == 3) {\n ansset = 1;\nprintf(\"major\");\n}else if (distancefind(pos3,pos2) == 4 && distancefind(pos1,pos3) == 3) {\n ansset = 1;\nprintf(\"major\");\n}\nif (ansset != 1) {\n printf(\"strange\");\n}\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a06cc183df455a1f8f8437821ca0ab1f", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "d3cc28cc0176170bf06f2a057412cc76", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8321167883211679, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n long long int c,n,j=0;\n scanf(\"%lld\",&n);\n for(c=2520;c<=n;c+=2520)\n {\n j++;\n }\n printf(\"%lld\",j);\n}", "lang": "GNU C11", "bug_code_uid": "8a90f6dd3277520177f19305f2a90b35", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "69d20b67d5dfe27acf1c87a01ca415e3", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.991869918699187, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main() {\n int b,g,n,ans=0;\n\tscanf(\"%d%d%d\",&b,&g,&n);\n\tfor (int i=0;i<=b;i++) {\n\t j=n-i;\n\t \n\t ans+=(j>=0 && j<=g);\n\t}\n\tprintf(\"%d\\n\",ans);\n}", "lang": "GNU C11", "bug_code_uid": "ee487469557c2542abdf5d2be70db960", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "6a0319730b9bb0a7a7867058bdfe721a", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.972972972972973, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n \nint main()\n{\n int n,b,g;\n int small;\n\n scanf(\"%d\\n\",&b);\n scanf(\"%d\\n\",&g);\n scanf(\"%d\",&n);\n\n if (b>g)\n {\n big = b;\n \t\tsmall = g;\n } else {\n big = g;\n \t\tsmall = b;\n }\n\n\n if (small > n)\n {\n \t\tprintf(\"%d\\n\",n+1 );\n } else if (big > n)\n {\n printf(\"%d\\n\",small + 1 );\n }else{\n printf(\"%d\\n\", big + 1);\n }\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "5575eebf1be99ecd9235fa9a559c6e9b", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "14791a1357decc534775202e9b096e2d", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9521531100478469, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main() {\n\tstatic char cc[100001], s[100001], t[100001];\n\tstatic int kk[10], kk_[10];\n\tint n, ns, nt;\n\tint h, i, d, d_, k, k_, k0;\n\tint max, kmax, dmax;\n\n\tscanf(\"%s\", cc);\n\tn = strlen(cc);\n\tk0 = 0;\n\tfor (i = 0; i < n; i++) {\n\t\tkk[cc[i] - '0']++;\n\t\tif (cc[i] == '0')\n\t\t\tk0++;\n\t}\n\tmax = kmax = dmax = -1, k = 0;\n\twhile (kk[0] >= 0) {\n\t\tfor (d = 0; d <= 9; d++)\n\t\t\tkk_[d] = kk[d];\n\t\tif (max < k) {\n\t\t\tmax = kmax = k;\n\t\t\tdmax = -1;\n\t\t}\n\t\tfor (d = 1; d <= 9; d++)\n\t\t\tif (kk[d] > 0 && kk_[10 - d] > 0) {\n\t\t\t\tkk[d]--, kk_[10 - d]--;\n\t\t\t\tk_ = 0;\n\t\t\t\tfor (d_ = 0; d_ <= 9; d_++)\n\t\t\t\t\tk_ += kk[d_] < kk_[9 - d_] ? kk[d_] : kk_[9 - d_];\n\t\t\t\tkk[d]++, kk_[10 - d]++;\n\t\t\t\tif (max < k + 1 + k_) {\n\t\t\t\t\tmax = k + 1 + k_;\n\t\t\t\t\tkmax = k;\n\t\t\t\t\tdmax = d;\n\t\t\t\t}\n\t\t\t}\n\t\tkk[0]--;\n\t\tk++;\n\t}\n\tns = nt = 0;\n\tkk[0] = kk_[0] = k0 - kmax;\n\tif (dmax >= 0) {\n\t\tkk[dmax]--, kk_[10 - dmax]--;\n\t\tfor (d_ = 0; d_ <= 9; d_++) {\n\t\t\tfor (h = kk[d_]; h < kk_[9 - d_]; h++)\n\t\t\t\tt[nt++] = 9 - d_ + '0';\n\t\t\tfor (h = kk_[9 - d_]; h < kk[d_]; h++)\n\t\t\t\ts[ns++] = d_ + '0';\n\t\t}\n\t\ts[ns++] = dmax + '0';\n\t\tt[nt++] = 10 - dmax + '0';\n\t} else\n\t\tfor (d_ = 0; d_ <= 9; d_++) {\n\t\t\tfor (h = 0; h < kk[d_]; h++)\n\t\t\t\ts[ns++] = d_ + '0';\n\t\t\tfor (h = 0; h < kk_[d_]; h++)\n\t\t\t\tt[nt++] = d_ + '0';\n\t\t}\n\tfor (h = 0; h < kmax; h++)\n\t\ts[ns++] = t[nt++] = '0';\n\tprintf(\"%s\\n\", s);\n\tprintf(\"%s\\n\", t);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "edf3ebce27570019338ee7df2f1b58f1", "src_uid": "34b67958a37865e1ca0529bbf528dd9a", "apr_id": "6d8d9c4d96aff2185b3ee0ff86b0bf36", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6293706293706294, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main(){\n\tint n;\n\tint arr[100];\n\tscanf(\"%d\",&n);\n\tfor(int i = 0;i\n#include \nint compare(const void *data1,const void *data2){\n\tint *ptr1 = (int *)data1;\n\tint *ptr2 = (int *)data2;\n\treturn (data1 < data2)? 1 : -1;\n}\nint main(){\n\tint n;\n\tint arr[100];\n\tscanf(\"%d\",&n);\n\tfor(int i = 0;i\nint main()\n{\n\tint n;\n\tchar a,b;\n\tcanf(\"%c %c\",&a,&b);\n\tscanf(\"%d\",&n);\n\tif(a-b!=24&&(n%4!=2)&&(n%4!=0))\n\t{\n\t\tif((((a-b==-56)||(a-b==58)||(a-b==-34)||(a-b==32))&&(n%4==1))||(((a-b==56)||(a-b==-58)||(a-b==34)||(a-b==-32))&&(n%4==3)))\n\t\tprintf(\"cw\\n\");\n\t\telse printf(\"ccw\\n\");\n\t}\t\t\n\telse printf(\"undefined\\n\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "310a2a3244a57b79150e2376b3fe74e5", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "cda542c3cd264b220b4d996c05a95004", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.24611032531824611, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n\nint main()\n{\n char s[]={'^','>','v','<'},c,t;\n int n,p,q;\n scanf(\"%c %c %d\",&c,&t,&n);\n n%=4;\n if(n==2 || n==0)\n return printf(\"undefined\"),0;\n for(int i=0;i<4;i++)\n if(s[i]==c)\n p=i;\n else if(s[i]==t)\n q=i;\n if((p+n)%4==q)\n printf(\"cw\");return 0;\n else printf(\"ccw\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "7810318d13bdb7b868aababb102495d9", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "c2f9b43785f7049f15bcb9c58b7afb39", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9600293362669601, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n\nint main()\n{\n char str[4], str1[10];\n gets(str);\n gets(str1);\n int a=0,i,s;\n for(i=0; str1[i]!='\\0'; i++)\n {\n a = (a*10) + (int(str1[i])-48);\n }\n s=a%4;\n\n if(str[0]=='<')\n {\n if(str[2]=='^')\n {\n if(s==1)\n printf(\"cw\\n\");\n else if(s==3)\n printf(\"ccw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='>')\n {\n printf(\"undefined\\n\");\n }\n else if(str[2]=='v')\n {\n if(s==1)\n printf(\"ccw\\n\");\n else if(s==3)\n printf(\"cw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='<')\n {\n printf(\"undefined\\n\");\n }\n }\n\n else if(str[0]=='^')\n {\n if(str[2]=='>')\n {\n if(s==1)\n printf(\"cw\\n\");\n else if(s==3)\n printf(\"ccw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='v')\n {\n printf(\"undefined\\n\");\n }\n else if(str[2]=='<')\n {\n if(s==1)\n printf(\"ccw\\n\");\n else if(s==3)\n printf(\"cw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='^')\n {\n printf(\"undefined\\n\");\n }\n }\n\n else if(str[0]=='>')\n {\n if(str[2]=='v')\n {\n if(s==1)\n printf(\"cw\\n\");\n else if(s==3)\n printf(\"ccw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='<')\n {\n printf(\"undefined\\n\");\n }\n else if(str[2]=='^')\n {\n if(s==1)\n printf(\"ccw\\n\");\n else if(s==3)\n printf(\"cw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='>')\n {\n printf(\"undefined\\n\");\n }\n }\n\n else if(str[0]=='v')\n {\n if(str[2]=='<')\n {\n if(s==1)\n printf(\"cw\\n\");\n else if(s==3)\n printf(\"ccw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='^')\n {\n printf(\"undefined\\n\");\n }\n else if(str[2]=='>')\n {\n if(s==1)\n printf(\"ccw\\n\");\n else if(s==3)\n printf(\"cw\\n\");\n else\n printf(\"undefined\\n\");\n }\n else if(str[2]=='v')\n {\n printf(\"undefined\\n\");\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9702a64fee0a36af2cf6ae94a82ad85c", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "f1abb4d1339fe1a9cc86ac99914ecb95", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.0087527352297593, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "10 10\n.....SSSSS\n.....SSSSS\n.....SSSSS\n.....SSSSS\n.....SSSSS\n..........\n..........\n..........\n..........\n..........\n", "lang": "GNU C11", "bug_code_uid": "e044295dbd3ca1a6d66c0d28e4140f16", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "d16fd7bd3f27b6f185f4e3381d034a15", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8567774936061381, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nmain()\n{\n int i=1,j,k=1;\n char s[100],a[26];\n scanf(\"%s\",&s);\n while(s[i]!='\\0')\n {\n for(j=0;j\nint main()\n{\n long long n,a;\n scanf(\"%lld %lld\",&n,&a);\n if(n%2!=0 ||n\nint main()\n{\t\n\tlong long int l1,r1,l2,r2,k;\n\tlong int count=0;\n\tscanf(\"%lld%lld%lld%lld%lld\",&l1,&r1,&l2,&r2,&k);\n\tif(l1==r1)\n\t{ count++;\n\t printf(\"%ld\",count);\n\t return 0;\n\t}\n\tfor( ;l2<=r1;l2++)\n\t{ if(l2!=k)\n\t count++;\n\t}\n\tprintf(\"%ld\",count);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "1fe13eaffe62d07a330e2b0fce8b2be4", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "9717ff4436bc891c4c839de9d715ae74", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6954022988505747, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n\tint n,b,p,x,y,k;\n\tscanf(\"%d%d%d\",&n.&b,&p);\n\tif(n%2!=0)\n\t\tk=n-1;\n\telse\n\t\tk=n;\n\tx=(k*(k-2)/2+k)/2*5;\n\ty=n*p;\n\tprintf(\"%d %d\",x,y); \n } ", "lang": "GNU C", "bug_code_uid": "a80c22a0cb83fbf57ab3a3cbaa8c7a95", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "87870a7ca9c78f1dbcf554ffa090c2af", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.11861861861861862, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\nmain()\n{\n char a[10000],b[200];\n int p,q,min,i,j;\n int na[10],nb[10];\n p=size_t(a[10000]);\n q=size_t(b[200]);\n for(int i=1;i<=p;i++)\n {\n if(a[i]=='9') a[i]='6';\n if(a[i]=='5') a[i]='2';\n }\n for(int j=1;i<=q;j++)\n {\n if(b[i]=='9') b[i]='6';\n if(b[i]=='5') b[i]='2';\n } \n for(int i=1;i<=p;i++)\n {\n\t for(int j=1;i<=q;j++)\n if(a[j]==i+'0') na[i]++;\n for(int j=1;i<=q;j++)\n if(b[j]==i+'0') nb[i]++;\n } \n for(int i=1;i<=p;i++);\n for(int i=0;i<=9;i++)\n if(nb[i]!=0)\n {\n\t \t int min=na[i]/nb[i],k;\n min=k; \n k\n#include\n\n#define min(x,y) (((x)<(y))?(x):(y))\n\nchar a[200];\nint na[10],nb[10];\n\nint main()\n{ \n int i;\n\tscanf(\"%s\",a);\n for(i=0;i\n\n#ifdef DEBUG\n#define D(x...) fprintf(stderr, x)\n#else\n#define D(x...)\n#endif\n\nchar t[10];\nchar s[300];\n\nint num_need[256];\nint num_have[256];\n\nint min(int a, int b) {\n if (a < b) return a;\n return b;\n}\n\nint main() {\n int i;\n\n scanf(\"%s %s\", t, s);\n for (i = 0; t[i]; i++) num_need[t[i]]++;\n for (i = 0; s[i]; i++) num_have[s[i]]++;\n\n num_need['6'] += num_need['9'];\n num_need['9'] = 0;\n num_need['2'] += num_need['5'];\n num_need['5'] = 0;\n\n num_have['6'] += num_have['9'];\n num_have['9'] = 0;\n num_have['2'] += num_have['5'];\n num_have['5'] = 0;\n\n int res = 2000000000;\n\n for (i = 0; i < 256; i++)\n if (num_need[i])\n res = min(res, num_have[i] / num_need[i]), D(\"%c\\n\", i);\n\n printf(\"%d\\n\", res);\n\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "8dbd8a79835edf323c0a105a72606ea6", "src_uid": "72a196044787cb8dbd8d350cb60ccc32", "apr_id": "19d1ee6a1ac5706fd89fe4f4c837e243", "difficulty": 1500, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3365487674169346, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n#include\n#include\nint num[105];\nint cmp(const void *a, const void *b)\n{\n\treturn *(int *)a-*(int *)b;\n}\nint main(void)\n{\n\tint n, sum, temp, i;\n\twhile(scanf(\"%d\",&n)!=EOF){\n\t\tfor(i=0;i\n#include \n\nusing namespace std;\n\nint main()\n{\n\tint n,x,y;\n\tint people_required = 0;\n\tint result = 0;\n\tcin>>n;\n\tcin>>x;\n\tcin>>y;\n\tdouble fraction = (y/100.0);\n\tfraction *=n;\n\tpeople_required = ceil(fraction);\n\tresult = people_required -x;\n\tif(result<0)\n\t{\n\t\tcout<<0;\n\t}\n\telse\n\t{\n\t\tcout<\n#include \n\nint main(){\n int x, y, n;\n scanf(\"%d %d %d\", &x, &y, &n);\n\n int a, b, i;\n double ratio = (double)x/y;\n\n double sol = 10000000;\n double dist;\n for (i=1;i<=n;i++){\n int j = roundtol(ratio * i);\n if (ratio*i - floor(ratio*i) == 0.5){\n j = (int)(ratio*i);\n }\n dist = fabs(ratio - (double)j/i);\n if (sol>dist){\n sol = dist;\n b = i;\n a = j;\n }\n }\n\n printf(\"%d/%d\\n\", a, b);\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "a914afe6f9cee0d1f5de76f21c5e01a3", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "56c8e02f87b06915e6ff83bc95e5ce48", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8140814081408141, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n#include \n\nint main (void) {\n\tint x, y, n, a = 1, b = 1, i, j;\n\tscanf (\"%d %d %d\", &x, &y, &n);\n\tfor (j = 1; j <= n; ++j) {\n\t\tdouble z = x, A[] = {floor (z / y * j), ceil (z / y * j)};\n\t\tfor (i = 0; (unsigned) i < sizeof A / sizeof *A; ++i) {\n\t\t\tif (fabs (z/y - A[i]/j) < fabs(z/y - (double)a/b)) {\n\t\t\t\ta = A[i];\n\t\t\t\tb = j;\n\t\t\t}\n\t\t}\n\t}\n\tprintf (\"%d/%d\\n\", a, b);\n\texit (EXIT_SUCCESS);\n}\n", "lang": "GNU C", "bug_code_uid": "a49c0ba8dcd96318e577c793d2cf0064", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "12670af7f998d0cbea189255d65046c4", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.996594778660613, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include\nvoid rev(char str[],int n);\nint main(void)\n{\n\t// your code goes here\n int n;\n scanf(\"%d\",&n);\n char str[11];\n scanf(\" %s\",str);\n for(int i=2;i<=n;i++)\n {\n if((n%i)==0)\n rev(str,i);\n }\n printf(\"%s\",str);\n\treturn 0;\n}\nvoid rev(char str[],int n)\n{\n for(int i=0;i\n#include\nvoid toreverse(char string [],int x)\n{\n\t\n\tchar temp[x];\n\tfor(int i=0;i\n#include\nint main()\n{\n int i;\n char str[1000];\n scanf(\"%s\",str);\n for(i=0;str[i]!='\\0';i++)\n {\n strcpy(str[i],tolower(str[i]));\n }\n for(i=0;str[i]!='\\0';i++)\n {\n if(str[i]!='a' && str[i]!='e' && str[i]!='i' && str[i]!='o' &&str[i]!='e' && str[i]!='y')\n {\n printf(\"%c\",str[i]);\n printf(\".\");\n }\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "f0830f07dd7eb89f628feea0e73d87c6", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "f382cec70c5eaff0d1912272db0d7dbb", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9917808219178083, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n/* Written by Nishant Mittal aka nishantwrp */\nint main(){\nint a,b,c;\nscanf(\"%d %d %d\",&a,&b,&c);\nint ans1,ans2,ans3;\nint i = 1;\nwhile(i<=a){\n\tif (a%i==0 && b%i==0) {\n\t\tint ax,bx,cx;\n\t\tbx = i;\n\t\tax = a/i;\n\t\tcx = b/i;\n\t\tif (ax*cx==c){\n\t\t\tans1 = ax;\n\t\t\tans2= bx;\n\t\t\tans3 = cx;\n\t\t\tbreak;\n\t\t}\n\t}\n}\nprintf(\"%d\",4*(ans1+ans2+ans3));\nreturn 0;\n\n}\n\n\n\n", "lang": "GNU C11", "bug_code_uid": "464e15fa92b76acf18c327d17fffad1e", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "3295127538c50176f70209e47e946132", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3662420382165605, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "#include \nusing namespace std;\nint a[105];\nint main(void)\n{\n int n,m,k,ans=9999999;\n scanf(\"%d %d %d\",&n,&m,&k);\n for(int i=1;i<=n;i++)\n {\n scanf(\"%d\",&a[i]);\n if(a[i]<=k && a[i]!=0) \n if(ans>(abs(m-i))) ans = abs(m-i);\n }\n\n printf(\"%d\\n\",ans*10);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4bf35e02fc70c5d3f07f2fe853592bf5", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "a37c692e28305d2dbd754c9e7e81f97b", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9992537313432835, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,m,k;\n\n scanf (\"%d %d %d\",&n,&m,&k);\n\n --m;\n\n int i;\n int prices[n];\n\n for (i=0;i=0 || z=0 && zprices[z])\n printf(\"%d\",(z-m)*10);\n\n break;\n\n\n }\n else if (prices[j]<=k &&prices[j]!=0)\n {\n printf(\"%d\",(m-j)*10);\n break;\n }\n\n else if (prices[z]<=k && prices[z]!=0)\n {\n printf(\"%d\",(z-m)*10);\n break;\n }\n\n j--;\n z++;\n }\n\n else if (z\nusing namespace std;\nint main()\n{\n long long y,sum=0,sum1=0,dis[10001],n,m,k,vill[10001],vs[10001],v[10001],s=0;\n cin>>n;\n cin>>m;\n cin>>k;\n for(int i=0;i>vill[i];\n }\n sum1=(m-1)*10;\n\n for(int j=0;j0)\n {\n v[s]=vill[j];\n vs[s]=j;\n dis[s]=sum;\n s++;\n }\n sum=sum+10;\n }\n for(int z=0;z\n#include\nint main()\n{\n int n,m,k,a[101],b[101],i,d=0,minimum;\n scanf(\"%d%d%d\",&n,&m,&k);\n for(i=1;i<=n;i++)\n {\n scanf(\"%d\",&a[i]);\n }\n \n for(i=1;i<=n;i++)\n {\n if(a[i]<=k&&a[i]!=0)\n {\n b[d]=i;\n d++;\n }\n }\n minimum=abs(m-b[0]);\n for(i=0;iabs(m-b[i]))\n min=abs(m-b[i]);\n }\n printf(\"%d\",10*min);\n return(0);\n}", "lang": "GNU C", "bug_code_uid": "7715e725e759e1ecf5fa0f859ee00cc0", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "39c37f4f82478bc4426d8b3df58634b6", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.32998885172798215, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include\n\nlong long m=1000000007,a,b,n,x;\n\nlong long function()\n{\n if(n<=0) return x;\n function(n--);\n x = (((a*x)%m)+b)%m;\n}\n\nint main()\n{\n scanf(\"%lld %lld %lld %lld\",&a,&b,&n,&x);\n function();\n printf(\"%lld\\n\",x);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c5bae8e9d7626d98365ab2a960845e79", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "dc773809d95963814164a1e7a1bb15ff", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8070469798657718, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include \n# define m 1000000007\nlong long int power(long long int x,long long int y)\n{\n\tif(y==0)\n\treturn 1;\n\telse if(y%2==0)\n\t{\n\t\tlong long int z;\n\t\tz=power(x,y/2)%m;\n\t\treturn (z*z)%m;\n\t}\n\telse\n\t{\n\t\tlong long int z;\n\t\tz=power(x,y/2)%m;\n\t\treturn ((x%m*z%m)%m*z)%m;\n\t}\n}\nint main()\n{\n\tlong long int n,a,b,x,i,ans=0;\n\tscanf(\"%lld %lld %lld %lld\",&a,&b,&n,&x);\n\tfor(i=0;i\n# define m 1000000007\nlong long int power(long long int x,long long int y)\n{\n\tif(y==0)\n\treturn 1;\n\telse if(y%2==0)\n\t{\n\t\tlong long int z;\n\t\tz=power(x,y/2)%m;\n\t\treturn (z*z)%m;\n\t}\n\telse\n\t{\n\t\tlong long int z;\n\t\tz=power(x,y/2)%m;\n\t\treturn ((x%m*z%m)%m*z)%m;\n\t}\n}\nint main()\n{\n\tlong long int n,a,b,x,i,ans=0;\n\tscanf(\"%lld %lld %lld %lld\",&a,&b,&n,&x);\n if(a!=1)\n{\n//\tfor(i=0;i0)\n\t\tans=((ans%m)*power(a-1,m-2)%m)%m;\n\t\t ans=ans%m;\n//\t}\n\tans=(ans+(power(a,n)%m*x%m)%m)%m;\n\tans=ans%m;}\nelse\nans=((n%m*b%m)%m+x)%m\n\tprintf(\"%lld\\n\",ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "afd87202649a1ad8f319211882c21da6", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "8348263ac5fb525174257f6569313254", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8361581920903954, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \nusing namespace std;\n\nint main()\n{\n int n;\n long long res=1;\n scanf(\"%d\",&n);\n if(n%2)\n {\n printf(\"0\");\n }\n else{\n for(;n>=2;n/=2) res*=2;\n printf(\"%d\",res);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0ff9d4a91e52cce5ca10ee51ef2d57ce", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "ab2939a6b7ff4959dea4ddcddef201cb", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9980119284294234, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main(){\n int n, max=0;\n scanf(\"%d\", &n);\n int a[n], c[101]={0};\n for(int i = 0; i < n; i++){\n scanf(\"%d\", a[i]);\n c[a[i]]++;\n if(max < c[a[i]])\n max=c[a[i]];\n }\n printf(\"%d\", max);\n}", "lang": "GNU C", "bug_code_uid": "4747b4836fa760d9f6dde9f1435e4240", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "b481846e83b034410c4aeef0436228e1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2881880024737168, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include \nchar a[101],c[101];\n\nmain(){\n int i,j,k,l,b,d,lenL=0,lenS=0,curChk=0,maxL,maxS;\n scanf (\"%d%d\",&b,&d);\n scanf (\"%s%s\",a,c);\n while (a[lenL]!=0)lenL++;\n while (c[lenS]!=0)lenS++;\n if (lenL*b\nchar a[101],c[101];\nint before[101][101];//before[POS][Chk];\nint beforeI[101][101];\nmain(){\n int i,j,k,l,b,d,lenL=0,lenS=0,curChk=0,maxL,maxS,usebefore,first=-1,last=-1,point=i,memo,ans=0,remain,tmpa,tmpb,tmpChk;\n scanf (\"%d%d\",&b,&d);\n scanf (\"%s%s\",a,c);\n while (a[lenL]!=0)lenL++;\n while (c[lenS]!=0)lenS++;\n if (lenL*blenS){\n printf (\"0\");\n exit(0);\n }\n if (before[i%lenL][curChk%lenS]==0){\n before[i%lenL][curChk%lenS]=curChk;\n beforeI[i%lenL][curChk%lenS]=i;\n if (a[i%lenL]==c[curChk%lenS]) curChk++;\n //printf (\"test\\n\");\n }else if (maxL-i>i-beforeI[i%lenL][curChk%lenS]){\n tmpChk=curChk;\n tmpa=beforeI[i%lenL][curChk%lenS];\n tmpb=before[i%lenL][curChk%lenS];\n before[i%lenL][curChk%lenS]=curChk;\n beforeI[i%lenL][curChk%lenS]=i;\n //printf (\"GG\\n\");\n curChk+=(curChk-tmpb)*((maxL-i)/(i-tmpa));\n i+=(i-tmpa)*((maxL-i)/(i-tmpa))-1;\n //curChk+=(curChk-before[i%lenL][curChk%lenS])*tmpb;\n //i+=(i-tmpa)*tmpb;\n //curChk+=tmpChk-before[i%lenL][curChk%lenS];\n //i+=i-tmpa;\n }else{\n if (a[i%lenL]==c[curChk%lenS])curChk++;\n }\n /*if (curChk==lenS){\n last=i;\n }*/\n //curChk++;\n //if (curChk%maxS==0) ans++;\n\n /*\n if (curChk>=maxS&&first%lenL==i%lenL&&curChk%lenS==1){\n point=i;\n remain = maxL-i;\n memo=point-first;\n ans += remain/memo*ans;\n //printf (\"%d %d\\n\",maxL-i,memo);\n i+=(remain/memo)*memo;\n //i=maxL;\n }*/\n /*\n if (first%lenL==i%lenL&&curChk%lenS==0){\n point=i;\n remain = maxL-i;\n memo=point-first+1;\n curChk += (remain/memo)*curChk;\n //printf (\"%d %d\\n\",maxL-i,memo);\n i=(remain/memo)*i;\n //i=maxL;\n }\n */\n }\n //printf (\"%d\",curChk/maxS);\n //printf (\"%d : %d\\n\",i,curChk);\n printf (\"%d\",curChk/maxS);\n exit(0);\n\n}\n", "lang": "GNU C", "bug_code_uid": "c93ff6272ddc18dc7825da0ab8428390", "src_uid": "5ea0351ac9f949dedae1928bfb7ebffa", "apr_id": "339a58748b8ad57bb7f5d92c6c2f4f12", "difficulty": 2000, "tags": ["dfs and similar", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6350832266325224, "equal_cnt": 22, "replace_cnt": 9, "delete_cnt": 9, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "#include \n#include \nint main()\n{\n char array[100];\n int i=0,t,l=0;\n for (i=0; i<100; i++)\n {\n scanf(\"%c\",array[i]);\n if (array[i]=='\\n')\n break;\n l++;\n }\n for (t=0; t\nusing namespace std;\nlong long int mini (long long int a, long long int b)\n{\n if (a <= b)\n return a;\n\n return b;\n}\nint main()\n{\n long long int n,ans,x;\n scanf (\"%lld\",&n);\n ans = mini(n,9);\n\n if (n >= 10)\n ans += (mini(n,99)-9)*2;\n\n if (n >= 100)\n ans += (mini(n,999)-99)*3;\n\n if (n >= 1000)\n ans += (mini(n,9999)-999)*4;\n\n if (n >= 10000)\n ans += (mini(n,99999)-9999)*5;\n\n if (n >= 100000)\n ans += (mini(n,999999)-99999)*6;\n\n if (n >= 1000000)\n ans += (mini(n,9999999)-999999)*7;\n\n if (n >= 10000000)\n ans += (mini(n,99999999)-9999999)*8;\n\n if (n >= 100000000)\n ans += (mini(n,999999999)-99999999)*9;\n\n if (n >= 1000000000)\n ans += (mini(n,9999999999)-999999999)*10;\n\n printf (\"%lld\\n\",ans);\nreturn 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "51a0b41a6e486185a885a8b7c2468f23", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "ae74a2f3eb27bae02db0f32eccc4ea7a", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9963369963369964, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint SEGMENTS(int s)\n{\nint Total , p , quired ;\np=2;\ntotal = 1 ;\nwhile(1)\n{\nTotal= Total + p/2 ;\nif (s\n#include\n#define max 1000000+10\nint prime[max];\nint meiprime[max];\nint suhe(int gu)\n{\n\tint sum=0;\n\twhile(gu)\n\t{\n\t\tsum+=gu%10;\n\t\tgu=gu/10;\n\t}\n\treturn sum;\n}\nint main()\n{\n\tint n,l,m,i,su,b,j;\n\tfor(i=1;i<=max;i++)\n\tprime[i]=1;\n\tfor(i=2;i<=max;i++)\n\t{\n\t\tif(prime[i]==1)\n\t\t{\n\t\t\tfor(j=2*i;j<=max;j+=i)\n\t\t\t{\n\t\t\t\tprime[j]=0;\n\t\t\t}\n\t\t}\n\t}\n\tprime[1]=0;\n\tmemset(meiprime,0,sizeof(meiprime));\n\tfor(i=1;i<=max;i++)\n\t{\n\t\tif(prime[i]&&prime[suhe(i)])\n\t\tmeiprime[i]=meiprime[i-1]+1;\n\t\telse\n\t\tmeiprime[i]=meiprime[i-1];\n\t}\n\tb=1;\n\tscanf(\"%d\",&n);\n\twhile(n--)\n\t{\n\t\tscanf(\"%d %d\",&l,&m);\n\t\tprintf(\"Case #%d: %d\\n\",b,meiprime[m]-meiprime[l-1]);\n\t\tb++;\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "55e7c34d36354626e2e0ee45a4d388bc", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "0573f01a42287f4fe27f19518e08c8da", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9032258064516129, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nmain(){\n\tint x;\n\tscanf(\"%d\",&x);\n\n\twhile(x>0){\n\t\tif(x%1000==144){\n\t\t\tx=x/1000;\n\t\t\t}\n\t\telse if(x%100==14){\n\t\t\tx=x/100;\n\t\t\t}\n else if(x%10==1){\n\t\t\tx=x/10;\n\t\t\t}\n else{\n printf(\"NO\");\n\n\t\t\t}\n\n\t\t\t}\n\t\t\tprintf(\"YES\");\n\n\t\t\treturn 0;\n\t\t\t}", "lang": "GNU C11", "bug_code_uid": "0f252f05c207df7f3a773b891f51f957", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "f612fda89fc2bf62d1195590110ecd0b", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41275797373358347, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main(){\n\tlong long n,min,max,i;\n\tscanf(\"%lld\",&n);\n\tmin=n*2/7;\n\twhile (i<=n){\n\t\tif((i%7)<2){\n\t\t\tmax=min+i%7;\n\t\t}\n\t\telse {\n\t\t\tmax=min+2;\n\t\t}\n\t\tif((i*2)%7==6){\n\t\t\tmin++;\n\t\t}\n\t}\n\tprintf(\"%lld %lld\",min,max);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "6b915637f4a0aed767cf1b08d83344fd", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "f7cbcc6c3188ce6d8f21f9c8da2a4eb2", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.32947232947232946, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "#include \n\nint p[]={2,3,5,7,11,13,17,19,23,29,31,37};\n\nint d[20];\n\nint main() {\n\tlong long i,j,n;\n\tscanf(\"%lld\\n\",&n);\n\tfor (j=i=0;p[i]*p[i]<=n;i++)\n\t\twhile (n%p[i]==0) d[j++]=p[i],n/=p[i];\n\tif (n>1) d[j++]=n;\n\tn=1;\n\ti=0;\n\twhile (j) {\n\t\tj--;\n\t\twhile (--d[j])\n\t\t\tn*=p[i];\n\t\ti++;\n\t}\n\tprintf(\"%lld\\n\",n);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "117fcefef046df45530bf78f664f46f6", "src_uid": "62db589bad3b7023418107de05b7a8ee", "apr_id": "e01ddd15c186ff5221f759d9e7b7658e", "difficulty": 2000, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16234718826405867, "equal_cnt": 20, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 19, "bug_source_code": "#include\n#include\n#include\n\nint n,l,r; \n\nint check(int a ,int b)\n{\n int r;\n\n if(l<0) l=0;\n \n if(a%3==0)\n {\n r = r/3 - l/3 + 1;\n }\n else r = r/3 -l/3 ;\n\n return r;\n}\n\nint func(int n,int rem)\n{\n if(n!=1)\n {\n if(rem==0)\n func(n,0) = check(l-1,r-1) * func(n-1,2) + check(l-2,r-2) * func(n-1,1) + check(l,r) * func(n-1,0);\n if(rem==1)\n func(n,1) = check(l,r) * func(n-1,0) + check(l-1,r-1) * func(n-1,2) + check(l-2,r-2) * func(n-1,1);\n if(rem==2)\n func(n,2) = check(l-2,r-2) * func(n-1,1) + check(l,r) * func(n-1,0) + check(l-1,r-1) * func(n-1,2);\n }\n else\n {\n if(rem==1)\n return check(l-1,r-1);\n if(rem==2)\n return check(l-2,r-2);\n if(rem==0)\n return check(l,r);\n }\n\n\n}\n\nint main()\n{\n //int n,l,r,i;\n scanf(\"%d%d%d\",&n,&l,&r);\n\n int res = func(n,0);\n printf(\"%d\",res);\n\n}", "lang": "GNU C11", "bug_code_uid": "6168603678b6b6371617cef6ab55ffd3", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "e64ad9295eeb70bd35383fdc7f9b90e9", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8062977099236641, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n#include\n#define mod 1000000007\nlong long n,l,r,x,y,z; \n\n/*long long check(long long a ,long long b)\n{\n long long c;\n\n c = b/3 - (a-1)/3;\n\n return c;\n}*/\n\nlong long func(long long n,long long rem)\n{\n if(n==1)\n {\n if(rem==1)\n return y;\n if(rem==2)\n return z;\n if(rem==0)\n return x;\n }\n \n if(rem==0)\n return (y*func(n-1,2) + z*func(n-1,1) + x*func(n-1,0))%mod;\n \n else if(rem==1)\n return (y*func(n-1,0) + z*func(n-1,2) + x*func(n-1,1))%mod;\n \n else\n return (y*func(n-1,1) + z*func(n-1,0) + x*func(n-1,2))%mod;\n \n if(n==1)\n {\n if(rem==1)\n return y;\n if(rem==2)\n return z;\n if(rem==0)\n return x;\n }\n\n\n}\n\nint main()\n{\n //long long n,l,r,i;\n scanf(\"%I64d%I64d%I64d\",&n,&l,&r);\n x=r/3-(l-1)/3;\n y=(r+2)/3-(l+1)/3;\n z=(r+1)/3-(l)/3;\n\n long long res = func(n,0);\n printf(\"%I64d\",res);\n\n}", "lang": "GNU C11", "bug_code_uid": "075c4f859d2340862251af3bbe5fb31e", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "e64ad9295eeb70bd35383fdc7f9b90e9", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8186173853524983, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n\n#define mod 1000000007\n\nlong long dp[200005][3];\n\nint main() {\n int n, l, r;\n\n scanf(\"%d %d %d\", &n, &l, &r);\n\n dp[0][0] = 0;\n dp[0][1] = 0;\n dp[0][2] = 0;\n dp[1][0] = 0;\n dp[1][1] = 0;\n dp[1][2] = 0;\n\n for(long long i = l; i <=r; i++) {\n long long temp = i%3;\n dp[1][temp]++;\n dp[1][temp] %= mod;\n }\n\n for(long long i = 2; i <= n; i++) {\n dp[i][0] = (dp[i-1][2] * dp[1][1] + dp[i-1][1] * dp[1][2] + dp[i-1][0] * dp[1][0]) % mod;\n dp[i][1] = (dp[i-1][2] * dp[1][2] + dp[i-1][1] * dp[1][0] + dp[i-1][0] * dp[1][1]) % mod;\n dp[i][2] = (dp[i-1][2] * dp[1][0] + dp[i-1][1] * dp[1][1] + dp[i-1][0] * dp[1][2]) % mod;\n }\n\n printf(\"%lld\", dp[n][0]);\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "f0756d75cef8891460409013782e4343", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "bce55185f73a5f3f1b3d8422bf64ae4a", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3963666391412056, "equal_cnt": 22, "replace_cnt": 21, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 22, "bug_source_code": "#include\n\nint main()\n{\n\tlong x,y,x1,x2,y1,y2;\n\twhile(1) {\n\t\tscanf(\"%ld%ld\",&x,&y);\n\t\tif(x>0) {\n\t\t\tif(y>0) {\n\t\t\t\tx2 = x + y;\n\t\t\t\ty2 = 0;\n\t\t\t\ty1 = x2;\n\t\t\t\tx1 = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tx2 = x + y;\n\t\t\t\ty2 = 0;\n\t\t\t\tx1 = 0;\n\t\t\t\ty1 = -x2;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(y>0) {\n\t\t\t\tx1 = x - y;\n\t\t\t\tx2 = 0;\n\t\t\t\ty1 = 0;\n\t\t\t\ty2 = -x1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tx1 = x + y;\n\t\t\t\tx2 = 0;\n\t\t\t\ty1 = 0;\n\t\t\t\ty2 = x1;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%ld %ld %ld %ld\\n\",x1,y1,x2,y2);\n\t}\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "f19e06293faa90e6422912690bfb02d6", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "cacd1ff35cc6aa801dd1ce6fc70aa30f", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9977876106194691, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main()\n{\n long x,y,x1,y1,x2,y2;\n scanf(\"%ld%ld\",&x,&y);\n if(x>0 && y>0)\n {\n printf(\"0 %ld %ld 0\",x+y,x+y);\n }\n else if(x<0 && y>0)\n {\n printf(\"%ld 0 0 %ld\",-(labs(x)+y),(labs(x)+y));\n }\n else if(x<0 && y<0)\n {\n printf(\"%ld 0 0 %ld\"-(labs(x)+labs(y)),-(labs(x)+labs(y)));\n\n }\n else\n printf(\"0 %ld %ld 0\",-(x+labs(y)),(x+labs(y)));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "959c9c02146898e74a2d890a71ddd420", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "c228f3d827d5c9675f112f24d9f9d310", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8328199383926072, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n\ntypedef enum ESCAPE_STAGES {\n\tEST_DRAGON_WAKE_UP,\n\tEST_DRAGON_REACH_PRINCESS,\n\tEST_DRAGON_BACK,\n\tEST_DRAGON_MAKE_CLEAN,\n} EscapeStages;\n\nint main(int argc, char **argv) {\n\t\n// \tint vp = 1; // predkosc ksiezniczki w milach na godzine\n// \tint vd = 100;\t// predkosc smoka w milach na godzine\n// \tint t = 10;\t // czas po kt\u00f3rym smok spostrzega ze ksiezniczka uciekla\n// \tint f = 10;\t // czas spedzony w skarbcu przez smoka na uporzadkowanie\n// \tint c = 1000;\t// liczba mil od cave'a smoka do zamku\n\t\n\tint vp;\n\tint vd;\n\tint t;\n\tint f;\n\tint c;\n\t\n\tif( scanf(\"%d\", &vp) == -1 ) return -1;\n\tif( scanf(\"%d\", &vd) == -1 ) return -1;\n\tif( scanf(\"%d\", &t) == -1 ) return -1;\n\tif( scanf(\"%d\", &f) == -1 ) return -1;\n\tif( scanf(\"%d\", &v) == -1 ) return -1;\n\t\n\tEscapeStages es = EST_DRAGON_WAKE_UP;\n\tdouble princessDistance = 0;\n\tdouble dragonDistance = 0;\n\tint numberOfDroppedDiamond = 0;\n\tint vc = (vd-vp);\n\t\n\t// if dragons speed is smaller or equal then princess', return 0 diamonds\n\tif(vc<=0) {\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\n\t}\n\t\n\twhile( princessDistance < c ) {\n\t\tswitch(es) {\n\t\t\tcase EST_DRAGON_WAKE_UP:\n\t\t\t\tprincessDistance += vp*f;\n\t\t\t\tes = EST_DRAGON_REACH_PRINCESS;\n\t\t\t\tbreak;\n\t\t\tcase EST_DRAGON_REACH_PRINCESS:\n\t\t\t\tprincessDistance += (double)vp*(double)(princessDistance/(double)vc);\n\t\t\t\tdragonDistance = princessDistance;\n\t\t\t\tif(princessDistance\n#include\nint main()\n{\n long long dab, dbc, area,abx,aby,bcx,bcy,axl,ayl,bxl,byl,cxl,cyl;\n int ax,ay,bx,by,cx,cy;\n scanf(\"%d%d%d%d%d%d\",&ax,&ay,&bx,&by,&cx,&cy);\n axl=ax; bxl=bx; cxl=cx; ayl=cy; byl= by; cyl=cy;\n abx=(ax-bx);\n aby=(ay-by);\n dab=abx*abx + aby*aby;\n bcx=(bx-cx);\n bcy=(by-cy);\n dbc=bcx*bcx + bcy*bcy;\n area= axl*byl + bxl*cyl + cxl*ayl - axl*cyl - cxl*byl - bxl*ayl;\n if(dab!=dbc || area==0 || (ax==cx && ay==cy))printf(\"No\\n\");\n else printf(\"Yes\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "98c93dd24864d52ae65e82fba41950a8", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "d4e9531dac431b88552fb6743a099e88", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3403805496828753, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include\n#include\nmain()\n{\n int a,d,count=0,j;\n scanf(\"%d\",&a);\n int s[a],c[a];\n for(int i=0;is[j])\n {\n d=s[i];\n s[i]=s[j];\n s[j]=d;\n }\n }\n }\n for(int k=1;k\nint main()\n{\n\tint m,n,a[100],i,j,t,k,sum=0;\n\tscanf(\"%d\",&n);\n\tfor(i=0;ia[j+1])\n\t \t{\n\t \t\tk=a[j];a[j]=a[j+1];a[j+1]=k;\n\t\t\t}\n\t\t}\n\tfor(i=0;i\n\n/* http://codeforces.com/contest/411/submission/25959252 (Dukkha) */\n\nint win(int a1, int b1, int a2, int b2) {\n\treturn a1 > b2 && b1 > a2;\n}\n\nint main() {\n\tint a1, b1, a2, b2, a3, b3, a4, b4;\n\n\tscanf(\"%d%d%d%d%d%d%d%d\", &a1, &b1, &a2, &b2, &a3, &b3, &a4, &b4);\n\tif ((win(a1, b2, a3, b4) && win(a1, b2, a4, b3))\n\t\t\t|| (win(a2, b1, a3, b4) && win(a2, b1, a4, b3))) {\n\t\tprintf(\"Team 1\\n\");\n\t\treturn 0;\n\t}\n\tif ((win(a3, b4, a1, b2) || win(a4, b3, a1, b2))\n\t\t\t|| (win(a3, b4, a2, b1) && win(a4, b3, a2, b1))) {\n\t\tprintf(\"Team 2\\n\");\n\t\treturn 0;\n\t}\n\tprintf(\"Draw\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "304dc15f7b10082e7e559d51444b0409", "src_uid": "1a70ed6f58028a7c7a86e73c28ff245f", "apr_id": "10b7a9fc62fd73e4470a3384cbb84f5c", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9858712715855573, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main(){\n int i,j,k,l,a[3],b[3],c[3],d[3];\n while(1){\n for(i=0;i<2;i++)\n scanf(\"%d\",&a[i]);\n for(i=0;i<2;i++)\n scanf(\"%d\",&b[i]);\n for(i=0;i<2;i++)\n scanf(\"%d\",&c[i]);\n for(i=0;i<2;i++)\n scanf(\"%d\",&d[i]);\n if((a[0]>c[1]&&a[0]>d[1]&&b[1]>c[0]&&b[1]>d[0])||(a[1]>c[0]&&a[1]>d[0]&&b[0]>c[1]&&b[0]>d[1]))\n printf(\"Team 1\\n\");\n else\n if((((a[0]\n\nint main()\n{\n int x1, x2, y1, y2, ymove, xmove;\n long int summ=0;\n\n scanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2);\n\n if (x1>x2)\n xmove = -1;\n if (x1==x1)\n xmove = 0;\n if (x1y2)\n ymove = -1;\n if (y1==y1)\n ymove = 0;\n if (y1\nint main()\n{\n\tint n;\n\tscanf(\"%164d\",&n);\n\tif(n%2==0) {\n\t\treturn 2;\n\t}\n\telse \n\treturn 1;\n}", "lang": "GNU C11", "bug_code_uid": "9f881f897eee60ff7e1cf992534d7059", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "apr_id": "4c277e9ee362e9767075411170d9393c", "difficulty": 1200, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9781021897810219, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main()\n{\n\twhile(1)\n\t{\n\tint n,i;\n\tscanf(\"%d\",&n);\n\tint a[n];\n\tfor(i=0;ia[i])\n\t\t{\n\t\t\ti++;\n\t\t}\n\t\telse\n\t\tbreak;\n\t\t\n\t}\n\twhile(i\nint a[51],ans;\nvoid count(int h,int n,int flag){\n\tif(h==0)\n\t\treturn ;\n\tif(flag==0){\n\t\tif(n <= a[h]/2){\n\t\t\tans++;\n//\t\t\tprintf(\"%d \",ans);\n\t\t\tcount(h-1,n,1);\n\t\t}\n\t\telse{\n\t\t\tans = ans + a[h];\n//\t\t\tprintf(\"%d \",ans);\n\t\t\tcount(h-1,n-a[h]/2,0);\n\t\t}\n\t}\n\telse{\n\t\tif(n > a[h]/2){\n\t\t\tans++;\n//\t\t\tprintf(\"%d \",ans);\n\t\t\tcount(h-1,n-a[h]/2,0);\n\t\t}\n\t\telse{\n\t\t\tans = ans + a[h];\n//\t\t\tprintf(\"%d \",ans);\n\t\t\tcount(h-1,n,1);\n\t\t}\n\t}\n\treturn ;\n}\nint main(){\n\tint h,i,j,k,l,n,m;\n\tans=0;\n\ta[0] = 1;\n\tfor(i=1;i<=50;i++)\n\t\ta[i]=a[i-1]*2;\n//\tfor(i=0;i<10;i++)\n//\t\tprintf(\"%d \",a[i]);\n\tscanf(\"%d%d\",&h,&n);\n\tcount(h,n,0);\n\tprintf(\"%d\\n\",ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "37a8919907a5e5f9dfb5f01aeaa22a05", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "67642ec3530da1e3728b18127efe4c23", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.09774436090225563, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \n\nint check(int n)\n{\n\tif((n / 2) % 2 == 0) return 1;\n\telse return 0;\n}\n\nint answer(long long num,int n,int h)\n{\n\tint i,j,total = 0,check,temp = 1,temp1 = 0;\n\tfor(i = h;i > 0;i--)\n\t{\n\t\ttemp = 1;\n\t\tif(i == 1 && (n % 2) == 0)\n\t\t{\t\n\t\t\tfor(j = 0;j < h - i + 1;j++) temp *= 2;\n\t\t\ttotal += temp;\n\t\t\tcontinue;\n\t\t}\n\t\tif((n % 2 == 0 && (n / 2) % 2 == 0) || (n % 2 != 0 && ((n + 1) / 2) % 2 != 0))\n\t\t{\n\t\t\tif(i == h)\n\t\t\t{\n\t\t\t\ttotal += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor(j = 0;j < h - i + 1;j++) temp *= 2;\n\t\t\ttotal += temp;\n\t\t}\n\t\telse \n\t\t\ttotal++;\n\t\ttemp1 = n;\n\t\tn /= 2;\n\t\tif(temp1 % 2 > 0) \n\t\t\tn++;\n\t}\n\treturn total;\n}\n\nint main()\n{\n\tint h,n,i,total = 0;\n\tlong long time,num = 1;\n\tscanf(\"%d%d\",&h,&n);\n\tfor(i = 0;i < h;i++)\n\t\tnum *= 2;\n\ttotal += answer(num,n,h);\n\tprintf(\"%d\",total);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "bcb0437b1c97395bd1941eeeb2c927d9", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "8361358a5930a518100506b532bbd8d4", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.23501199040767387, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "#include\nint main()\n{\n long long int n,sum=0,i;\n for(i=1;i<=n;i++)\n {\n if(n<10)\n sum+=1;\n else if(n>=10&&n<100)\n sum+=2\n else if(n>=100&&n<1000)\n sum+=3\n else if(n>=100&&n<10000)\n sum+=4\n else if(n>=10000&&n<100000)\n sum+=5\n else if(n>=100000&&n<1000000)\n sum+=6\n else if(n>=1000000&&n<10000000)\n sum+=7\n else if(n>=10000000&&n<100000000)\n sum+=8\n else if(n>=100000000&&n<1000000000)\n sum+=9\n \n }\n printf(\"%lld\\n\",sum);\n}", "lang": "GNU C", "bug_code_uid": "a30e539af24dc6883f7ad04cc2596119", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "e2855ba95c7a73fb6619f9cafe5fc131", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.19611470860314523, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\ndouble sub(int w, int b) {\n double win, buf;\n\n if (w == 0) return 0;\n\n win = (double)w / (w + b);\n buf = (double)b / (w + b);\n b--;\n if (b <= 0) return win;\n buf = buf * b / (w + b);\n b--;\n if (b == 0)\n win = win + buf * w/(w+b) * sub(w-1, b);\n else\n win = win + buf * w/(w+b) * sub(w-1, b) + buf * b/(w+b) * sub(w, b-1);\n return win;\n}\n\nint main() {\n int w, b;\n double win;\n\n scanf(\"%d%d\", &w, &b);\n win = sub(w, b);\n printf(\"%.9f\", win);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0420166151b78285c8f7e4f72f2acf43", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "d30d8a12d1bf5f283cc583afd0192a5d", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7008681925808997, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "#include\ndouble pri(double w,double b);\ndouble dra(double w,double b);\nint main(){\nint w,b;\nscanf(\"%d%d\",&w,&b);\nprintf(\"%.9lf\\n\",pri((double)w,(double)b));\n}\n\ndouble pri(double w,double b){\nif(w==0)return 0;\nelse if(b==0) return 1;\nreturn (w/(w+b))+(b/(w+b))*dra(w,b-1);\n}\n\ndouble dra(double w,double b){\nif(b==0)return 0;\nelse if(w==1&&b==1)return 0;\nelse if(b==1)return 1/(1+w);\nreturn (b/(b+w))*( (w/(b+w-1))*pri(w-1,b-1) + ((b-1)/(b+w-1))*pri(w,b-2) );\n}\n", "lang": "GNU C", "bug_code_uid": "da8c2e6ea45b9715eb4ebe5859dd4ebb", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "008e7187d9bc1b7027818bb05c39d4bf", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7110415035238841, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include\ndouble pri(double w,double b);\ndouble dra(double w,double b);\nint main(){\nint w,b;\nscanf(\"%d%d\",&w,&b);\nprintf(\"%.9lf\\n\",pri((double)w,(double)b));\nreturn 0;\n}\n\ndouble pri(double w,double b){\nif(w==0)return 0;\nelse if(b==0) return 1;\nreturn (w/(w+b))+(b/(w+b))*dra(w,b-1);\n}\n\ndouble dra(double w,double b){\nif(b==0)return 0;\nelse if(w==1&&b==1)return 0;\nelse if(b==1)return 1/(1+w);\nreturn (b/(b+w))*( (w/(b+w-1))*pri(w-1,b-1) + ((b-1)/(b+w-1))*pri(w,b-2) );\n}\n", "lang": "GNU C", "bug_code_uid": "f89eac2644404051e026ff2518018b89", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "008e7187d9bc1b7027818bb05c39d4bf", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.145985401459854, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\ndouble tree[1000000]={0};\ndouble prob(int node,double w,double b,double pass)\n{\n if(w<=0 || b<=0)\n return;\n tree[2*node]=pass*(b/(w+b))*((b-1)/(w+b-1))*(w/(w+b-2));\n tree[2*node+1]=pass*(b/(w+b))*(w/(w+b-1))*((w-1)/(w+b-2));\n prob(2*node,w,b-3,pass*(b/(w+b))*((b-1)/(w+b-1))*((b-2)/(w+b-2)));\n prob(2*node+1,w-1,b-2,pass*(b/(w+b))*(w/(w+b-1))*((b-1)/(w+b-2)));\n}\nint main()\n{\n double w,b,ans=0;\n int i;\n scanf(\"%lf%lf\",&w,&b);\n tree[1]=w/(b+w);\n prob(1,w,b-1,b/(w+b));\n for(i=1;i<1000000;i++)\n ans+=tree[i];\n printf(\"%0.9f\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "23d267701b04185624b2b8f821f92520", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "dfc630d9210ae5926d3121b7f062e193", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6947368421052632, "equal_cnt": 14, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "#include \nint main()\n{\n long long int n, k, i, sasha=0, lena=0;\n scanf(\"%lld %lld\", &n, &k);\n i=0;\n while(n>=k)\n {\n n-=k;\n if(i%2==0)\n sasha++;\n else lena++;\n i++;\n }\n if(sasha>lena) printf(\"YES\");\n else printf(\"NO\");\n}\n", "lang": "GNU C", "bug_code_uid": "40db8d8c546cc806e7d12a0635cb9cde", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "cf98fcc00d23eb353c97f5fb8a7f9bf8", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.10305192231470471, "equal_cnt": 18, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "#include\n#include\nlong int v,e,f[505],a[501][501],univ,deg[503];\nchar s[505];\nvoid dfs(long int i)\n{\n\tf[i]=1;long int j;\n\tfor(j=1;j<=v;j++)\n\t{\n\t\tif(i!=j)\n\t\t{\n\t\tif(a[i][j])\n\t\t{\n\t\t\tif(abs(s[i]-s[j])<=1)\n\t\t\t{if(!f[j])\n\t\t\t\t\tdfs(j);}\n\t\t\telse\n\t\t\t{univ=1;}\n\t\t}\n\t\telse if (!a[i][j])\n\t\t{\n\t\t\tif(abs(s[i]-s[j])<=1)\n\t\t\t\tuniv=1;\n\t\t}\n\t\tif(univ)\n\t\t\treturn ;\n\t\t}\n\t}\n}\nint main()\n{univ=0;long int bet[4];\nlong int i,j,k;\n\tchar fold[3][6];\n\tfold[0][0]='a';fold[1][0]='b';fold[2][0]='c';\n\tfold[0][1]='a';fold[1][1]='c';fold[2][1]='b';\n\tfold[0][2]='b';fold[1][2]='a';fold[2][2]='c';\n\tfold[0][3]='b';fold[1][3]='c';fold[2][3]='a';\n\tfold[0][4]='c';fold[1][4]='b';fold[2][4]='a';\n\tfold[0][5]='c';fold[1][5]='a';fold[2][5]='b';\n\tscanf(\"%ld %ld\",&v,&e);\n\tif(v==417)\n\tfprintf(stderr,\"HERE\\n\");\n\tfor(i=0;i\n#include \n#include \n\n#define N\t500\n\nchar *color;\nint dsu[N];\n\nint find(int x) {\n\treturn dsu[x] < 0 ? x : (dsu[x] = find(dsu[x]));\n}\n\nvoid join(int x, int y) {\n\tx = find(x);\n\ty = find(y);\n\tif (x == y)\n\t\treturn;\n\tif (dsu[x] < dsu[y])\n\t\tdsu[y] = x;\n\telse if (dsu[x] > dsu[y])\n\t\tdsu[x] = y;\n\telse {\n\t\tdsu[x]--;\n\t\tdsu[y] = x;\n\t}\n}\n\nint main() {\n\tint i, n, m, g1, g2, gcnt1, gcnt2, yes;\n\tstatic char cnt[N];\n\tstatic int uu[N], vv[N]; \n\n\tscanf(\"%d%d\", &n, &m);\n\tcolor = calloc((n + 1), sizeof(*color));\n\tfor (i = 0; i < m; i++) {\n\t\tscanf(\"%d%d\", &uu[i], &vv[i]);\n\t\tuu[i]--, vv[i]--;\n\t\tcnt[uu[i]]++;\n\t\tcnt[vv[i]]++;\n\t}\n\tfor (i = 0; i < n; i++) {\n\t\tcolor[i] = '-';\n\t\tdsu[i] = -1;\n\t\tif (cnt[i] == n - 1)\n\t\t\tcolor[i] = 'b';\n\t\tcnt[i] = 0;\n\t}\n\tfor (i = 0; i < m; i++)\n\t\tif (color[uu[i]] == '-' && color[vv[i]] == '-') {\n\t\t\tjoin(uu[i], vv[i]);\n\t\t\tcnt[uu[i]]++;\n\t\t\tcnt[vv[i]]++;\n\t\t}\n\tg1 = g2 = -1;\n\tgcnt1 = gcnt2 = 0;\n\tyes = 1;\n\tfor (i = 0; i < n; i++)\n\t\tif (color[i] == '-') {\n\t\t\tint group = find(i);\n\n\t\t\tif (g1 == -1 || g1 == group) {\n\t\t\t\tg1 = group;\n\t\t\t\tcolor[i] = 'a';\n\t\t\t\tgcnt1++;\n\t\t\t} else if (g2 == -1 || g2 == group) {\n\t\t\t\tg2 = group;\n\t\t\t\tcolor[i] = 'c';\n\t\t\t\tgcnt2++;\n\t\t\t} else {\n\t\t\t\tyes = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\tfor (i = 0; i < n; i++)\n\t\tif (color[i] == '-') {\n\t\t\tint group = find(i);\n\n\t\t\tif (g1 == group && cnt[i] != gcnt1 - 1) {\n\t\t\t\tyes = 0;\n\t\t\t\tbreak;\n\t\t\t} else if (g2 == group && cnt[i] != gcnt2 - 1) {\n\t\t\t\tyes = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\tprintf(\"%s\\n\", yes ? \"Yes\" : \"No\");\n\tif (yes)\n\t\tprintf(\"%s\\n\", color);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5ee4cdc83b92069b91e8d1e7f3b9f61b", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "b6e7dd99d5873f343b3a622f71e6bdf7", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7767114523352527, "equal_cnt": 26, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 9, "fix_ops_cnt": 25, "bug_source_code": "#include \n\ntypedef struct scan\n{\n\tint from;\n\tint to;\n}scan;\n\nint graph[550][550];\nint color[550];\nchar out[550];\n\nint cmp(const void *a, const void *b)\n{\n\tscan a1 = * (scan *)a;\n\tscan b1 = * (scan *)b;\n\tif(a1.from > b1.from)\n\t return 1;\n\telse if(a1.from < b1.from)\n\t return -1;\n\telse\n\t return a1.to - b1.to;\n}\n\nint ulta(int a)\n{\n\tif(a==1)\n\t\treturn 2;\n\treturn 1;\n}\n\nint colorable(int n)\n{\n\tint i, j;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tint k=0;\n\t\tfor(j=1;j<=n;j++)\n\t\t\tif(graph[i][j] == 0)\n\t\t\t\tk++;\n\n\t\tif(color[i]==0)\n\t\t{\n\t\t\tif(k==n)\n\t\t\t\tcolor[i] = 3;\n\t\t\telse\n\t\t\t\tcolor[i] = 1;\n\t\t}\n\n\t\tint green = ulta(color[i]);\n\n\t\tfor(j=1;j<=n;j++)\n\t\t{\n\t\t\tif(graph[i][j] > 0)\n\t\t\t{\n\t\t\t\tif(color[j] == 0)\n\t\t\t\t\tcolor[j] = green;\n\t\t\t\telse if(color[j] == color[i])\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn(0);\n}\n\nint print(int n)\n{\n\tint i;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tif(color[i]==1)\n\t\t\tout[i-1] = 'a';\n\t\tif(color[i]==2)\n\t\t\tout[i-1] = 'c';\n\t\tif(color[i]==3)\n\t\t\tout[i-1] = 'b';\n\t}\n\tout[n] = '\\0';\n\tprintf(\"%s\\n\", out);\n\treturn(0);\n}\n\nint main(void)\n{\n\tint n,m,i,j;\n\tscanf(\"%d\", &n);\n\tscanf(\"%d\", &m);\n\tscan input[1200];\n\tfor(i=0;i<2*m;i+=2)\n\t{\n\t\tscanf(\"%d %d\", &input[i].from, &input[i].to);\n\t\tinput[i+1].from = input[i].to;\n\t\tinput[i+1].to = input[i].from;\n\t}\n\t\n\tqsort(input, 2*m, sizeof(scan), cmp);\n\n\tfor(i=0;i<550;i++)\n\t\tfor(j=0;j<550;j++)\n\t\t\tgraph[i][j]=0;\n\n\tint count=0;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tfor(j=i+1;j<=n;j++)\n\t\t{\t\n\t\t\twhile(i > input[count].from && count < 2*m)\n\t\t\t\tcount++;\n\t\t\twhile(j > input[count].to && count < 2*m)\n\t\t\t\tcount++;\n\n\t\t\tif(count < 2*m)\n\t\t\t{\n\t\t\t\tint from = input[count].from;\n\t\t\t\tint to = input[count].to;\n\n\t\t\t\tif(from!=i || to!=j)\n\t\t\t\t{\n\t\t\t\t\tif(graph[j][i]==0 && graph[i][j]==0)\n\t\t\t\t\t\tgraph[i][j]++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(graph[j][i]==0 && graph[i][j]==0)\n\t\t\t\t\tgraph[i][j]++;\n\t\t\t}\n\t\t}\n\t}\n\n\tint a = colorable(n);\n\tif(a==0)\n\t{\n\t\tprintf(\"Yes\\n\");\n\t\tprint(n);\n\t}\n\telse\n\t\tprintf(\"No\\n\");\n\t\n\treturn(0);\n}", "lang": "GNU C", "bug_code_uid": "0a4898513a2f3397b1b352691f039fa0", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "b1bc6b678920d1a87cdd581db44ca0e9", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.03470213996529786, "equal_cnt": 27, "replace_cnt": 20, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 27, "bug_source_code": "#include \n#include \n#include \n#include \n\ntypedef long long int LL;\n\n#define din(n) scanf(\"%d\",&n)\n#define dout(n) printf(\"%d\\n\",n)\n#define llin(n) scanf(\"%lld\",&n)\n#define llout(n) printf(\"%lld\\n\",n)\n#define strin(n) scanf(\" %s\",n)\n#define strout(n) printf(\"%s\\n\",n)\n#define power(a, b) po(a, b)\n\nint mod=1000000007;\nint graph[550][550];\nint color[550];\nchar out[550];\n\nlong long po(long long x, long long y)\n{\n\tlong long pro=1;\n\twhile(y>0)\n\t{\n\t\tif(y&1 != 0)\n\t\t\tpro=((pro%mod)*(x%mod))%mod;\n\t\tx=(x*x)%mod;\n\t\ty=y>>1;\n\t}\n\treturn pro%mod;\n}\n\ntypedef struct scan\n{\n\tint from;\n\tint to;\n}scan;\n\nint cmp(const void *a, const void *b)\n{\n\tscan a1 = * (scan *)a;\n\tscan b1 = * (scan *)b;\n\tif(a1.from > b1.from)\n\t return 1;\n\telse if(a1.from < b1.from)\n\t return -1;\n\telse\n\t return a1.to - b1.to;\n}\n\nint ulta(int a)\n{\n\tif(a==1)\n\t\treturn 2;\n\treturn 1;\n}\n\nint colorable(int n)\n{\n\tint i, j;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tint k=0;\n\t\tfor(j=1;j<=n;j++)\n\t\t\tif(graph[i][j] == 0)\n\t\t\t\tk++;\n\n\t\tif(color[i]==0)\n\t\t{\n\t\t\tif(k==n)\n\t\t\t\tcolor[i] = 3;\n\t\t\telse\n\t\t\t\tcolor[i] = 1;\n\t\t}\n\n\t\tint green = ulta(color[i]);\n\n\t\tfor(j=1;j<=n;j++)\n\t\t{\n\t\t\tif(graph[i][j] > 0)\n\t\t\t{\n\t\t\t\tif(color[j] == 0)\n\t\t\t\t\tcolor[j] = green;\n\t\t\t\telse if(color[j] == color[i])\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn(0);\n}\n\nint print(int n)\n{\n\tint i;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tif(color[i]==1)\n\t\t\tout[i-1] = 'a';\n\t\tif(color[i]==2)\n\t\t\tout[i-1] = 'c';\n\t\tif(color[i]==3)\n\t\t\tout[i-1] = 'b';\n\t}\n\tout[n] = '\\0';\n\tstrout(out);\n\treturn(0);\n}\n\nint main(void)\n{\n\tint n,m,i,j;\n\tscanf(\"%d\", &n);\n\tscanf(\"%d\", &m);\n\tscan input[1200];\n\tfor(i=0;i<2*m;i+=2)\n\t{\n\t\tscanf(\"%d %d\", &input[i].from, &input[i].to);\n\t\tinput[i+1].from = input[i].to;\n\t\tinput[i+1].to = input[i].from;\n\t}\n\t\n\tqsort(input, 2*m, sizeof(scan), cmp);\n\n\tfor(i=0;i<550;i++)\n\t\tfor(j=0;j<550;j++)\n\t\t\tgraph[i][j]=0;\n\n\tint count=0;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tfor(j=i+1;j<=n;j++)\n\t\t{\t\n\t\t\twhile(i > input[count].from && count < 2*m)\n\t\t\t\tcount++;\n\t\t\twhile(j > input[count].to && count < 2*m)\n\t\t\t\tcount++;\n\n\t\t\tif(count < 2*m)\n\t\t\t{\n\t\t\t\tint from = input[count].from;\n\t\t\t\tint to = input[count].to;\n\n\t\t\t\tif(from!=i || to!=j)\n\t\t\t\t{\n\t\t\t\t\tif(graph[j][i]==0 && graph[i][j]==0)\n\t\t\t\t\t\tgraph[i][j]++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(graph[j][i]==0 && graph[i][j]==0)\n\t\t\t\t\tgraph[i][j]++;\n\t\t\t}\n\t\t}\n\t}\n\n\tint a = colorable(i, n);\n\tif(a==0)\n\t{\n\t\tprintf(\"Yes\\n\");\n\t\tprint(n);\n\t}\n\telse\n\t\tprintf(\"No\\n\");\n\t\n\treturn(0);\n}", "lang": "GNU C", "bug_code_uid": "6dadf44fe1dd18c143cb0204cbde210f", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "b1bc6b678920d1a87cdd581db44ca0e9", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9933598937583001, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n \n int i,a,s=0,num,j,x;\n scanf(\"%d\",&a);\n for(i=0;i0)\n {\n s=s+num%i;\n num=num/i;\n }\n \n }\n x=a-2;\n for(i=0;i<=x;i++)\n while(s%i==0&&x%i==0)\n {\n s=s/i;\n x=x/i;\n }\n printf(\"%d/%d\",s,x);\n \n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "e6407fab406982bfa6b8f6f7e2141103", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "129d65981705dcfa939cab9845ff2738", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7459954233409611, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\nchar a[6];\nscanf(\"%s\",a);\nb0=(a[0]-48)*10000;\nb1=(a[2]-48)*1000;\nb2=(a[4]-48)*100;\nb3=(a[3]-48)*10;\nb4=(a[1]-48);\nc=b0+b1+b2+b3+b4;\n\n", "lang": "GNU C11", "bug_code_uid": "ca6059219002ec2ab1ea1fe21a077152", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "8e81e7fcb6edc42e1cb5dcfc24d345fd", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9112081513828238, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main ()\n{\n char s[6];\n scanf(\"%s\",s);\n long long int s=1;\n long long int i;\n long long int n=((s[0]-48)*10000)+((s[2]-48)*1000)+((s[4]-48)*100)+((s[3]-48)*10)+(s[1]-48);\n for(i=0;i<5;i++)\n {\n s=s*n;\n s=s%100000;\n \n }\nprintf(\"%05lld\",s);\nreturn 0;\n \n}", "lang": "GNU C11", "bug_code_uid": "588e03a2f21e324ba2836bd9421b8509", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "d873fd090a784e62988796560f7a9431", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8226691042047533, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main()\n{\n int n, k, sum = 0, temp, val, i;\n scanf(\"%d%d\", &n, &k);\n for(i = 0; i < n; i++){\n scanf(\"%d\", &temp);\n sum += temp;\n }\n val = n * (2 * k - 1) - 2 * sum;\n printf(\"%d\", val);\n return val;\n}\n", "lang": "GNU C11", "bug_code_uid": "414a05bdb55945dda0652423d096a7de", "src_uid": "f22267bf3fad0bf342ecf4c27ad3a900", "apr_id": "2c7d2bd901022e7e2377dd348a1ea4b3", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9967923015236567, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\n#define MAX 102\n#define LIM 303\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nbool visited[MAX][MAX][LIM][2];\nint n, t, counter[1010], ar[MAX], dp[MAX][MAX][LIM][2];\n\nint F(int i, int l, int r, int flag){\n if (i > n){\n if (r == t || r == LIM){\n if (!flag) return (counter[ar[l]] * (t - r));\n else return 0;\n }\n else return F(0, l, r + 1, flag);\n }\n if (visited[i][l][r][flag]) return dp[i][l][r][flag];\n\n int x, res = F(i + 1, l, r, flag);\n if (ar[i] >= ar[l]){\n x = 1 + F(i + 1, i, r, flag);\n if (x > res) res = x;\n }\n if (!flag && t > LIM){\n x = F(i, l, r, 1) + (counter[l] * (t - LIM));\n if (x > res) res = x;\n }\n\n visited[i][l][r][flag] = true;\n return (dp[i][l][r][flag] = res);\n}\n\nint main(){\n int i, j, k;\n\n while (scanf(\"%d %d\", &n, &t) != EOF){\n if (!n) break;\n\n ar[0] = 0;\n clr(counter);\n for (i = 1; i <= n; i++){\n scanf(\"%d\", &ar[i]);\n counter[ar[i]]++;\n }\n\n clr(visited);\n int res = F(1, 0, 1, 0);\n printf(\"%d\\n\", res);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d9989901beabff87ec9e80c7f0ac6e67", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "857d4b8e128c6157540ee2674f3bb961", "difficulty": 1900, "tags": ["matrices", "dp", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999462654486835, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\n// observations:\n// mixed holes (any size) will always be 1 complexity no matter what, so they get leftovers at end\n// even/odd holes (any size) will always add 0 or 2 (unless on the end)\n// ^ these should definitely be filled from small to large (should i sort then?)\n// only question is how to handle the ends with regard to order of filling\n// i think you'd want to remove as many 2's as possible then try to fill 1's (might require some backtracking)\n\ntypedef struct {\n short parity;\n int size;\n} Hole;\n\nint compare(const void *a, const void *b) {\n return ( ((Hole *)a)->size - ((Hole *)b)->size );\n}\n\nint main() {\n int n, i;\n int nums[105];\n //int evencnt, mixcnt, oddcnt; //holes\n //int endholeparity[2] = {0,0};\n int parity[2] = {0,0}; //existing evens,odds\n int complexity = 0;\n\n int ss,ee;\n Hole start_hole;\n Hole end_hole;\n Hole same_holes[55];\n int same_holes_cnt = 0;\n\n int last = -1;\n\n scanf(\"%d\", &n);\n for (i=0; i < n; i++) {\n scanf(\"%d\", &nums[i]);\n if (nums[i] != 0 && (nums[i] % 2) + last == 1) {\n complexity += 1;\n }\n if (nums[i] != 0) {\n parity[nums[i] % 2]++;\n last = nums[i] % 2;\n }\n else {\n last = -1;\n }\n }\n //printf(\"base complexity: %d\\n\", complexity);\n\n parity[0] = n/2 - parity[0]; //existing/placed -> missing/available evens\n parity[1] = (n+1)/2 - parity[1];\n \n //printf(\"Have %2d evens\\n %2d odds\\n\", parity[0], parity[1]);\n\n for (i=0; nums[i] == 0 && i < n; i++);\n if (i == n) { // all zeros\n if (n == 1)\n printf(\"0\\n\");\n else\n printf(\"1\\n\"); \n return 0;\n }\n ss = i;\n start_hole.size = i;\n start_hole.parity = nums[i] % 2;\n for (i=n-1; nums[i] == 0 && i >= 0; i--);\n ee = i;\n end_hole.size = (n-1) - i;\n end_hole.parity = nums[i] % 2;\n\n //printf(\"start_size: %2d\\n\", start_hole.size);\n //printf(\"end_size: %2d\\n\", end_hole.size);\n\n int cur_start = 0;\n \n for (i = ss; i <= ee; i++) {\n if (nums[i] == 0) {\n Hole hnew;\n cur_start = i;\n while (nums[++i] == 0 && i <= ee);\n hnew.size = i - cur_start; // ee guaranteed nonzero so no off by one\n hnew.parity = nums[cur_start-1] % 2;\n if (nums[i] % 2 != hnew.parity)\n complexity++;\n else \n same_holes[same_holes_cnt++] = hnew;\n }\n }\n //printf(\"Found %d holes\\n\", same_holes_cnt);\n qsort(same_holes, same_holes_cnt, sizeof(Hole), compare);\n for (i=0; i < same_holes_cnt; i++) {\n Hole tt = same_holes[i];\n if (parity[tt.parity] >= tt.size) {\n parity[tt.parity] -= tt.size;\n }\n else {\n complexity += 2;\n //printf(\"adding complexity\\n\");\n }\n }\n if (start_hole.size <= end_hole.size && end_hole.size != 0) {\n if (parity[start_hole.parity] < start_hole.size)\n complexity += 1;\n else\n parity[start_hole.parity] -= start_hole.size\n if (parity[end_hole.parity] < end_hole.size)\n complexity += 1;\n else\n parity[end_hole.parity] -= end_hole.size\n }\n else if (end_hole.size < start_hole.size) {\n if (parity[end_hole.parity] < end_hole.size)\n complexity += 1;\n else\n parity[end_hole.parity] -= end_hole.size\n if (parity[start_hole.parity] < start_hole.size)\n complexity += 1;\n else\n parity[start_hole.parity] -= start_hole.size\n }\n printf(\"%d\\n\", complexity);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "10e12def6aae58df71c0cf45bb35de7c", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "8ec3ed6db6f18f40633b8c16144a19bf", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9531669073653807, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n#include \n#include \n#define rep(E, F) for (E = 0; E < (F); E++)\n#define INF 1000000000\n\nint mabs(int a) { if (a > 0) { return a; } return -a; }\nint min(int a, int b) { if (a > b) { return b; } return a; }\nint max(int a, int b) { if (a < b) { return b; } return a; }\nint get_int();\ndouble get_double();\nint get_string(char* b, char t);\nint n;\nint d[2][100][100][100], a[100];\nint chi(int a, int b) { return a == b ? 0 : 1; }\n\nint foo(int b, int x, int y, int z)\n{\n\tif (x == n) return 0;\n\tif (z < 0 || y < 0) return INF;\n\tif (d[b][x][y][z] != -1) return d[b][x][y][z];\n\tif (a[x] != -1 && a[x] != b) return INF;\n\tif (a[x] != -1) return d[b][x][y][z] = min(chi(0, b) + foo(0, x + 1, y, z), chi(1, b) + foo(1, x + 1, y, z));\n\treturn d[b][x][y][z] = min(chi(0, b) + foo(0, x + 1, y - 1, z), chi(1, b) + foo(1, x + 1, y, z - 1));\n}\n\nint main()\n{\n\tint i, j, k;\n\tn = get_int();\n\trep(i, n) rep(j, n) rep(k, n) d[0][i][j][k] = d[1][i][j][k] = -1;\n\tint d[2] = {n/2, (n + 1)/2};\n\trep(i, n) a[i] = get_int();\n\trep(i, n) { rep(j, n) if (a[j] == i + 1) break; if (j < n) d[(i + 1)%2]--; }\n\trep(i, n) if (a[i] == 0) a[i] = -1; else a[i] %= 2;\n\tint r = min(foo(0, 0, d[0], d[1]), foo(1, 0, d[0], d[1]));\n\tassert(r < INF);\n\tprintf(\"%d\\n\", r);\n\treturn 0;\n}\n\nint get_string(char* b, char t)\n{\n\tint i = 0; b[i++] = getchar();\n\twhile (b[i - 1] != t) b[i++] = getchar();\n\tb[i - 1] = '\\0';\n\treturn i - 1;\n}\n\nint get_int()\n{\n\tint sgn = 1, ret = 0;\n\tchar c = getchar();\n\twhile (1)\n\t{\n\t\tif (c == EOF) return EOF;\n\t\tif (c >= '0' && c <= '9') break;\n\t\tif (c == '-')\n\t\t{\n\t\t\tc = getchar();\n\t\t\tif (c < '0' || c > '9') continue;\n\t\t\tsgn = -1;\n\t\t\tbreak;\n\t\t}\n\t\tc = getchar();\n\t}\n\n\twhile (1)\n\t{\n\t\tret = ret*10 + c - '0';\n\t\tc = getchar();\n\t\tif (c < '0' || c > '9') return sgn*ret;\n\t}\n}\n\ndouble get_double()\n{\n\tdouble ret = 0;\n\tchar c = getchar();\n\tint sgn;\n\n\twhile (1)\n\t{\n\t\tif (c == EOF)\n\t\t{\n\t\t\treturn EOF;\n\t\t}\n\t\tif (c >= '0' && c <= '9')\n\t\t{\n\t\t\tsgn = 1;\n\t\t\tbreak;\n\t\t}\n\t\tif (c == '-')\n\t\t{\n\t\t\tc = getchar();\n\n\t\t\tif (c < '0' || c > '9')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tsgn = -1;\n\t\t\tbreak;\n\t\t}\n\t\tc = getchar();\n\t}\n\n\twhile (1)\n\t{\n\t\tret = ret*10 + c - '0';\n\n\t\tc = getchar();\n\n\t\tif (c == '.')\n\t\t{\n\t\t\tdouble pos = 0.1;\n\n\t\t\tc = getchar();\n\t\t\twhile (c >= '0' && c <= '9')\n\t\t\t{\n\t\t\t\tret += pos*(c - '0');\n\t\t\t\tpos /= 10;\n\t\t\t\tc = getchar();\n\t\t\t}\n\n\t\t\treturn sgn*ret;\n\t\t}\n\t\telse if (c < '0' || c > '9')\n\t\t{\n\t\t\treturn sgn*ret;\n\t\t}\n\t}\n}\n", "lang": "GNU C11", "bug_code_uid": "9d0b67cd72588b856adad7570c11334f", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "651cadc3c6ee078c91bcb0a552ace01f", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9134948096885813, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nint main (void)\n{\n\tint n ,m ,k ;\n\tscanf(\"%d %d %d\",&m,&k);\n\tif (m<=n && k<=n)\n\t\tprintf(\"yes\");\n\telse\n\t\tprintf(\"no\");\t\n}", "lang": "GNU C11", "bug_code_uid": "960bf8761acd83783f4fa99858a5c1d9", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "ea76f0fc140fa8f59774524416ac521a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.524328249818446, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\nint len;\n\nint main()\n{\n int n,grade;\n float sum=0,avg;\n int temp;\n scanf(\"%d\",&n);\n int a[n];\n\n for(int i=0;i\nint main(){\n int n;\n scanf(\"%d\",&n);\n int ar[n];\n float sum=0.0;\n for(int i=0;i=4.5){\n count++;\n break;\n }\n else{\n if(ar[i]!=5){\n sum=sum-ar[i]+5;\n ar[i]=5;\n }\n }\n }while(i\n#include \nusing namespace std;\n\nint main()\n{\n char seq[][3] = {\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"29\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\"};\n char inp[24][3];\n int n, flag;\n cin >> n;\n for(int i = 0; i < n; i++)\n cin >> inp[i];\n for(int i = 0; i < 48; i++)\n {\n if(strcmp(inp[0], seq[i]) == 0)\n {\n flag = 0;\n for(int j = 0; j < n; j++)\n {\n if(strcmp(inp[j], seq[j + i]))\n {\n flag = 1;\n break;\n }\n }\n }\n if(!flag)\n {\n cout << \"Yes\" << endl;\n return 0;\n }\n }\n cout << \"No\" << endl;\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8d91857c3781a4bbbe7305b3a95e259f", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "apr_id": "9e7cfc1c1965c37e1c5bee11df936302", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9102272727272728, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n\tint n,m[30],i,pd=0,js1=0,js2=0,t=0;\n\tscanf(\"%d\",&n);\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tscanf(\"%d\",&m[i]);\n\t\tif(m[i]==29)\n\t\t\tpd++;\n\t}\n\tif(pd>=2) \n\t{\n\t\tprintf(\"NO\\n\");\n\t\treturn 0;\n\t}\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tif(m[i]==28&&t==0||m[i]==29&&t==0)\n\t\t{\n\t\t\tjs1=i;\n\t\t\tt=1;\n\t\t}\n\t\telse if(m[i]==28&&t==1||m[i]==29&&t==1)\n\t\t{\n\t\t\tjs2=i;\n\t\t\tt=0;\n\t\t}\n\t}\n\t//printf(\"%d %d\\n\",js1,js2);\n\tif((js2-js1)!=12&&js2!=0)\n\t{\n\t\tprintf(\"NO\\n\");\n\t\treturn 0;\n\t}\n\tif(n>=2)\n\t{\n\t\tfor(i=1;i<=n-1;i++)\n\t\t{\n\t\t\tif(m[i]==28&&m[i+1]==31)\n\t\t\tcontinue;\n\t\t\telse if(m[i]==29&&m[i+1]==31) continue;\n\t\t\telse if(m[i]==30&&m[i+1]==31) continue;\n\t\t\telse if(m[i]==31&&m[i+1]==31&&m[i+2]!=31) continue;\n\t\t\telse if(m[i]==31&&m[i+1]!=31) continue;\n\t\t\telse \n\t\t\t{\n\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\tprintf(\"YES\\n\");\n\t}\n\telse printf(\"YES\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "254704790ad9c8aafc4d25a926f58c2f", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "apr_id": "4a280521fa5b6419ec042a84e7f2b0d1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9844851904090268, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main(void)\n{\n long long int b,count = 0;\n int i;\n scanf(\"%lld\",&b);\n if(b==1)\n {\n printf(\"1\");\n }\n else\n {\n for(i=1;i*i\nint main()\n{long long int t,s,x,i,d,e;\nscanf(\"%I64d %I64d %I64d\",&t,&s,&x);\nfor(i=1;;i++)\n{\nd=t+i*s;\ne=t+i*s+1;\nif(d==x ||e==x)\n{ printf(\"YES\\n\");\n exit(1);\n}\nif(d>x)\n{ printf(\"NO\\n\");\n exit(1);\n}\n\nd=0;\ne=0;}\t\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4f08d32588b16f448e2ff358368c2f5c", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "ba65a408fcb4ce3b34d9541edd9e099e", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6632911392405063, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n long i,j,n,sum=0;\n scanf(\"%ld\", &n);\n int integer[n];\n for(i=0; i\nint main()\n{\n\tint n,m,i;\n\tscanf(\"%d %d\",&n,&m);\n\tint a[n+m];\n\tint end=n+m;\n\tint turn=0;\n\tint k=0;\n\tint maxs=0,maxd=0;\n\tfor(k=0;k<2;k++)\n\t{\n\t\tif(k%2==0)\n\t\t\ta[0]=1;\n\t\telse\n\t\t\ta[0]=2;\n\tfor(i=1;i0)\n\t\t\t{\ta[i]=2;m--;}\n\t\t\telse if(n>0)\n\t\t\t{\ta[i]=1;n--;}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(a[i-1]==1)\n\t\t\t{\t\n\t\t\t\tif(n>0){a[i]=1;n--;}\n\t\t\t\telse if(m>0){a[i]=2;m--;}\n\t\t\t}\n\t\t\telse if(a[i-1]==2)\n\t\t\t{\n\t\t\t\tif(m>0){a[i]=2;m--;}\n\t\t\t\telse if(n>0){a[i]=1;n--;}\n\t\t\t}\n\n\t\t}\n\t\tturn++;\n\t}\n\tint same=0;\n\tint diff=0;\n//\tprintf(\"%d \",a[0]);\n\tfor(i=1;i\n\nint main ()\n{\n int n, i;\n scanf (\"%d\", &i);\n if (i == 0) {\n printf (\"1\"); \n return;\n }\n while (i > 4) i -= 4;\n if (i == 4) printf (\"6\");\n else if (i == 3) printf (\"2\");\n else if (i == 2) printf (\"4\");\n else if (i == 1) printf (\"8\");\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cbb2b7a73382ed8159cd463a8fe9316e", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "ba7fb1567d6551d69cd329c8c6439410", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5465761875385564, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 10, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "#include\n\nint main()\n{\n int n,m,count=0;\n scanf(\"%d%d\",&n,&m);\n if(n<=1 && n<=1)\n {\n printf(\"0\");\n return;\n }\n else if(n<=m)\n {\n while(n<=m)\n {\n if(n==0 || n>m)\n break;\n n--;\n m-=2;\n count++;\n }\n if(n==0 || n==1)\n {\n printf(\"%d\",count);\n }\n else\n {\n while(n>1)\n {\n n-=2;\n m--;\n count++;\n }\n printf(\"%d\",count);\n }\n }\n else\n {\n while(m<=n)\n {\n if(m==0 || m>n)\n break;\n m--;\n n-=2;\n count++;\n }\n if(m==0 || m==1)\n {\n printf(\"%d\",count);\n }\n else\n {\n while(m>1)\n {\n m-=2;\n n--;\n count++;\n }\n printf(\"%d\",count);\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "4645a4541dfa2c298284b1d4f76ef59d", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "cc78c32e71c7632b2414c05bdc20161f", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.995850622406639, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main(){\n\tlong x=1,min,p,n;\n\tscanf(\"%d\",&n);\n\tmin=(n+x)*2;\n\twhile(x<=(n/2)){\n\t\tx++;\n\t\tif(n%x>0){\n\t\t\tp=(((n/x)+(x+1))*2);\n\t\t}\n\t\telse{\n\t\t\tp=(((n/x)+x)*2);\n\t\t}\n\t\tif (p<=min){\n\t\t\tmin=p;\n\t\t}\n\t}\n\tprintf(\"%d\",min);\n\treturn 0;", "lang": "GNU C", "bug_code_uid": "b7de74a5d91da29079c2f3cc99315cfd", "src_uid": "414cc57550e31d98c1a6a56be6722a12", "apr_id": "bb2e3e45256ff540459c7c3b052cb9b0", "difficulty": 1000, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6365007541478129, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int n,m,r,d=2,s;\n scanf(\"%d\",&n);\n for(m=1;m*m<=n;m++)\n {\n if(m*m==n)\n {\n r=4*(m);\n }\n else\n {\n d++;\n s=4*d;\n }\n }\nprintf(\"%d\",r||s);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "bfc22aa6770ba6de12745fb2ec9426a7", "src_uid": "414cc57550e31d98c1a6a56be6722a12", "apr_id": "810272bb28ff858ebe25eead6bd9b08a", "difficulty": 1000, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9577804583835947, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main(){\n\n int n,m,x;\n scanf(\"%d%d\",&n,&m);\n if(n==1){\n printf(\"1\\n\");\n exit(1);\n }\n if(n%2){\n x=n/2+1;\n if(m\nint main()\n{\n int n,a,b;\n scanf(\"%d %d %d\",&n,&a,&b);\n int d[n],i;\n for(i=0;i\nint gcd(int a,int b)\n{\n\treturn (a==0) ? b : gcd(b%a,b);\n}\n/*int gcd(int a, int b)\n{\n\tif (a == b)\n\t{\n\t\treturn a;\n\t}\n\tif (a > b)\n\t{\n\t\treturn gcd(a-b, b);\n\t}\n\treturn gcd(a, b-a);\n}\nint gcd(int n1,int n2)\n{\n\n\twhile(n1!=n2)\n\t{\n\t\tif(n1>=n2-1)\n\t\t{\n\t\t\tn1=n1-n2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tn2=n2-n1;\n\t\t}\n\t}\n\treturn n1;\n}*/\nint main()\n{\n\tint a,b,n,i=0;\n\tscanf(\"%d %d %d\",&a,&b,&n);\n\twhile(n>=0)\n\t{\n\t\t++i;\n\t\tn-=gcd((i&1) ? a : b,n);\n\t}\n\tif(i&1)\n\t{\n\t\tprintf(\"1\");\n\t}\n\telse\n\t{\n\t\tprintf(\"0\");\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "06148aa74b63ecdd41a98ff9d97f301f", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "83ac83cf499fecd19871bd9a34b646d0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8353413654618473, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nchar main()\n{\n int n,m;\n scanf(\"%d %d\",&n,&m);\n printf(\"%d\",n+m);\n return 'c';\n}\n", "lang": "GNU C11", "bug_code_uid": "6a5254baa52f5db1f8ac2713f9d56c07", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "1343af14500760c7c1b90ff60fe5c04b", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9890909090909091, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main()\n{\n\tint i, n, k, flag, Gpos, Tpos;\n\tchar field[101];\n\t\n\tscanf(\"%d %d %s\", &n, &k, field);\n\t\n\tfor(i=0; field[i]!='\\0'; i++)\n\t{\n\t\tif(field[i]=='G')\n\t\t\tGpos=i;\n\t\telse if(field[i]=='T')\n\t\t\tTpos=i;\n\t}\n\t\n\tif(Gpos>Tpos)\n\t\tk*=-1;\n\t\n\twhile(1)\n\t{\n\t\tif(Gpos+k>=n)\n\t\t{\n\t\t\tflag=0;\n\t\t\tbreak;\n\t\t}\n\t\telse if(field[Gpos+k]=='#')\n\t\t{\n\t\t\tflag=0;\n\t\t\tbreak;\n\t\t}\n\t\telse if(field[Gpos+k]=='.')\n\t\t\tGpos+=k;\n\t\telse if(field[Gpos+k]=='T')\n\t\t{\n\t\t\tflag=1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tif(flag==1)\n\t\tprintf(\"YES\");\n\telse\n\t\tprintf(\"NO\");\n\t\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b8fbbf19535e6d7760229649d1d56a5b", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "5c3bfbc765dbb236ce7d63891ff28551", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.08907048008171603, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \n#include \n#define DIJKSTRA\n#ifndef _TJYTLXWXHYZQFW_HEAP_H\n#define _TJYTLXWXHYZQFW_HEAP_H\n#include \n#include \nstruct heap {\n int cap, last;\n void **cell; \n\tint (*cmp)(const void *, const void *);\n\t#ifdef DIJKSTRA\n\tvoid (*set)(void *, const int);\n\tvoid (*swap)(void *, void *);\n\t#endif\n};\nstruct heap *heap_new(int cap, int (*cmp)(const void *, const void*)\n\t#ifdef DIJKSTRA\n\t,void (*set)(void *, const int), void (*swap)(void *, void *)\n\t#endif\n)\n{\n struct heap *h;\n assert(h = malloc(sizeof(struct heap)));\n h->cap = ++cap;\n\th->last = 0;\n assert(h->cell = malloc(sizeof(void*) * cap));\n\th->cmp = cmp;\n\t#ifdef DIJKSTRA\n\th->set = set;\n\th->swap = swap;\n\t#endif\n return h;\n}\nvoid heap_destroy(struct heap *h)\n{\n if (h)\n free(h->cell);\n free(h);\n}\nvoid heap_pdown(int x, struct heap *h)\n{\n int c, d;\n void *tmp;\n while ((c = 2 * x) <= h->last) {\n d = c + 1;\n if (d <= h->last && h->cmp(h->cell[d], h->cell[c]) < 0)\n c = d;\n if (h->cmp(h->cell[x], h->cell[c]) < 0)\n break;\n tmp = h->cell[c];\n h->cell[c] = h->cell[x];\n h->cell[x] = tmp;\n\t\t#ifdef DIJKSTRA\n\t\th->swap(h->cell[c], h->cell[x]);\n\t\t#endif\n x = c;\n }\n}\nvoid heap_pup(int x, struct heap *h)\n{\n int p;\n void *tmp;\n while ((p = x / 2) >= 1) {\n if (h->cmp(h->cell[p], h->cell[x]) < 0)\n break;\n tmp = h->cell[x];\n h->cell[x] = h->cell[p];\n h->cell[p] = tmp;\n\t\t#ifdef DIJKSTRA\n\t\th->swap(h->cell[x], h->cell[p]);\n\t\t#endif\n x = p;\n }\n}\nint heap_insert(void *e, struct heap *h)\n{\n if (h->last >= h->cap)\n return -1;\n h->cell[++h->last] = e;\n\t#ifdef DIJKSTRA\n\th->set(h->cell[h->last], h->last);\n\t#endif\n heap_pup(h->last, h);\n return 0;\n}\nvoid *heap_del(struct heap *h)\n{\n void *ret;\n if (h->last <= 0)\n return NULL;\n ret = h->cell[1];\n h->cell[1] = h->cell[h->last--];\n\t#ifdef DIJKSTRA\n\th->set(h->cell[1], 1);\n\t#endif\n heap_pdown(1, h);\n return ret;\n}\n#endif\n\n#define LEN 20000001\nstruct node {\n\tlong long cost;\n\tchar color;\n\tlong long id;\n\tint hidx;\n};\nint compare(const void *x, const void *y)\n{\n\treturn ((struct node *)x)->cost - ((struct node *)y)->cost;\n}\nvoid sethidx(void *node, const int idx)\n{\n\t((struct node *)node)->hidx = idx;\n}\nvoid swaphidx(void *x, void *y)\n{\n\tint tmp;\n\ttmp = ((struct node *)x)->hidx;\n\t((struct node *)x)->hidx = ((struct node *)y)->hidx;\n\t((struct node *)y)->hidx = tmp;\n}\nlong long len;\n#define OOS(x) ((x) < 0 || (x) > len)\nlong long x, y;\nstruct node nodes[LEN];\nvoid handle(int id, long long cost, struct heap *h)\n{\n\tstruct node *next;\n\tif (OOS(id))\n\t\treturn;\n\tnext = &nodes[id];\n\tif (next->color == 2)\n\t\treturn;\n\tif (cost >= next->cost)\n\t\treturn;\n\tnext->cost = cost;\n\tif (next->color == 0) {\n\t\theap_insert(next, h);\n\t\tnext->color = 1;\n\t} else {\n\t\theap_pup(next->hidx, h);\n\t}\n}\nlong long dijkstra(void)\n{\n\tstruct heap *h;\n\tstruct node *node;\n\th = heap_new(LEN, compare, sethidx, swaphidx);\n\theap_insert(&nodes[0], h);\n\tnodes[0].color = 1;\n\tnodes[0].cost = 0;\n\twhile ((node = heap_del(h)) != NULL) {\n\t\tnode->color = 2;\n\t\tif (node->id == len)\n\t\t\treturn node->cost;\n\t\thandle(node->id + 1, node->cost + x, h);\n\t\thandle(node->id - 1, node->cost + x, h);\n\t\thandle(node->id * 2, node->cost + y, h);\n\t}\n\treturn -1;\n}\nint main(void)\n{\n\tlong long i, imax;\n\tscanf(\"%lld%lld%lld\", &len, &x, &y);\n\tfor (imax = len * 2, i = 0; i <= imax; ++i) {\n\t\tnodes[i].id = i;\n\t\tnodes[i].cost = LLONG_MAX;\n\t\tnodes[i].color = 0;\n\t}\n\tprintf(\"%lld\\n\", dijkstra());\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "038fc052e64fb9f557fbf9e7293bfbd1", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "d4ea81748fbe19e69539aeac1e850bb1", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9348171701112877, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n{\n int s,v1,v2,t1,t2,r1,r2;\n while(scanf(\"%d %d %d %d %d\",&s,&v1,&v2,&t1,&t2)){\n r1=(t1*2)+(v1*s);\n r2=(t2*2)+(v2*s);\n if(r1==r2)\n printf(\"Friendship\\n\");\n else if(r1\n\nint i(long long x) {\n int ix = 0;\n while (x > 0)\n {\n x /= 10;\n ix++;\n }\n return ix;\n}\n\nint main()\n{\n long long w, m, k, sum = 0, time = -1;\n scanf(\"%lld%lld%lld\", &w, &m, &k);\n while (w >= sum)\n {\n time++;\n sum += i(m++) * k;\n }\n printf(\"%lld\", time);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "725d0bf4f7cf3d72f03153e6c7f6c96e", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "f43d7185c48627a9e42a87d8debb6be5", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998766954377312, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(void){\n\tlong long int l, r, x, y, k;\n\tscanf(\"%lld%lld%lld%lld%lld\",&l,&r,&x,&y,&k);\n\tlong long int a = 1;\n\ta = x;\n\twhile(1){\n\t\tif(k*a < l || a < x){\n\t\t\ta++;\n\t\t} else{\n\t\t\tbreak;\n\t\t}\n\t}\n\tlong long int flag = 0;\n\twhile(k*a <= r && a <= y){\n\t\tif(k*a <= r && a <= y){\n\t\t\tflag = 1;\n\t\t\tbreak;\n\t\t}\n\t\ta++;\n\t}\n\tif(flag == 1){\n\t\tprintf(\"YES\\n\");\n\t} else{\n\t\tprintf(\"NO\\n\");\n\t}\n\treturn 0;\n", "lang": "GNU C", "bug_code_uid": "340e1761fd3886f9bd65ecc57aaf8463", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "176a4862545f0e30cc9232e2f16b8047", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9642248722316865, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \nusing namespace std;\n\nint main(){\n\tint l,r,x,y;\n\tdouble k;\n\tscanf(\"%d%d%d%d%lf\",&l,&r,&x,&y,&k);\n\t\n\tfor (int i=x;i<=y;i++){\n\t\tdouble tar = i*k;\n\t\tint tari = (int)tar;\n\t\tif (tari-tar==0){\n\t\t\tif (tari<=r&&tari>=l){\n\t\t\t\tprintf(\"YES\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"NO\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "8506d919a9166bc8a521e80e810ad8ff", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "1a3bb7f8f49e1826d525523f177f2ae1", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8464566929133859, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n{\n\tlong long int l,r,x,y,k,i;\n\tscanf(\"%d%d%d%d%d\",&l,&r,&x,&y,&k);\n\t\n\tfor(i= x; i<=y ; i++)\n\t{\n\t\tlong long int val;\n\t\tval = i*k;\n\t\tif(val>=l && val<=r)\n\t\t{\n\t\t\tprintf(\"YES\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\tprintf(\"NO);\n\t\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f82a0ffd4a6b753c791b839d1cf781b8", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "1037f40353afc878c52d16bbf748332b", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.860125260960334, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint main(){\n\tint l,r,x,y,k;\n\tscanf(\"%d%d%d%d%d\", &l, &r, &x, &y, &k);\n\tfor(float i=x; i<=y;i++)\n\t\tif(k*i>=l && k*i<=r && (k*i)%1==0)\n\t\t{\n\t\t\tprintf(\"YES\\n\");\n\t\t\treturn 0;\n\t\t}\n\tprintf(\"NO\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7f7785bf0ec3918efcb2ff51bb66d7ba", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "1c1ec5aae00a1936f9d42fc43f5a6f15", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.05388017691998392, "equal_cnt": 15, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main(){\n\tint i,j,k,l,n,m,a,b,c,d;\n\tscanf(\"%d%d%d%d\",&a[0],&a[1],&a[2],&a[3]);\n\tmerge(a,b,0,3);\n", "lang": "GNU C", "bug_code_uid": "07f8e759371188be3a1d739af5289c1b", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "dc4db8519048b86d495f2867080ad7c0", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8044090056285178, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n#include \n\ntypedef struct p{\n\tint x, y;\n}ponto;\n\nfloat isColinear(ponto a, ponto b, ponto c){\n\treturn ( (a.x == b.x && a.y == b.y)||\n\t\t(c.x == c.x && a.y == c.y)||\n\t\t(b.x == c.x && b.y == c.y)||\n\t\t(b.y-a.y)/(b.x-a.x) == (c.y-a.y)/(c.x-a.x));\n}\n\n// retorna o angulo no v\u00e9rtice \"a\"\nfloat isRightAngle(ponto a, ponto b, ponto c){\n\tif( isColinear(a, b, c)){\n\t\treturn 0;\n\t}\n\n\tint del_x1 = (b.x - a.x),\n\t\tdel_x2 = (c.x - a.x),\n\t\tdel_y1 = (b.y - a.y),\n\t\tdel_y2 = (c.y - a.y);\n\n\treturn (del_x1*del_x2 + del_y1*del_y2) == 0;\n}\n\n// triangulo, t, \u00e9 um vetor de pontos\nint check(ponto *t){\n\tif(isRightAngle(t[0], t[1], t[2]) ||\n\t\tisRightAngle(t[1], t[0], t[2]) ||\n\t\tisRightAngle(t[2], t[1], t[0]))\n\t\treturn 0;\n\n\tint i;\n\tponto triangulos[12]; // cont\u00e9m as 4 configura\u00e7\u00f5es poss\u00edvels para o triangulo em cada ponto\n\t// circula os inteiros vizinhos, come\u00e7ando \u00e0 esquerda, sentido antihor\u00e1rio\n\tfor (i = 0; i < 3; i++){\n\t\ttriangulos[4*i] = t[i]; triangulos[4*i].x -=1;\n\t\ttriangulos[4*i+1] = t[i]; triangulos[4*i+1].y -=1;\n\t\ttriangulos[4*i+2] = t[i]; triangulos[4*i+2].x +=1;\n\t\ttriangulos[4*i+3] = t[i]; triangulos[4*i+3].y +=1;\n\t}\n\n\tfor(i=0; i<4; i++){\n\t\tif(isRightAngle(triangulos[i], t[1], t[2]) ||\n\t\t\tisRightAngle(t[1], triangulos[i], t[2]) ||\n\t\t\tisRightAngle(t[2], t[1], triangulos[i]))\n\t\t\treturn 1;\n\t\tif(isRightAngle(t[0], triangulos[i+4], t[2]) ||\n\t\t\tisRightAngle(triangulos[i+4], t[0], t[2]) ||\n\t\t\tisRightAngle(t[2], triangulos[i+4], t[0]) )\n\t\t\treturn 1;\n\t\tif(isRightAngle(t[0], t[1], triangulos[i+8]) ||\n\t\t\tisRightAngle(t[1], t[0], triangulos[i+8]) ||\n\t\t\tisRightAngle(triangulos[i+8], t[1], t[0]) )\n\t\t\treturn 1;\n\t}\n\n\treturn -1;\n\n}\n\nvoid main(){\n\tponto p[3], origem;\n\tscanf(\"%d %d %d %d %d %d\", &p[0].x, &p[0].y, &p[1].x, &p[1].y, &p[2].x, &p[2].y);\n\tif( isColinear(p[0], p[1], p[2])){\n\t\tprintf(\"NEITHER\\n\");\n\t\treturn;\n\t}\n\n\tswitch(check(p)){\n\t\tcase 0:\n\t\t\tprintf(\"RIGHT\\n\");\n\t\tbreak;\n\t\tcase 1:\n\t\t\tprintf(\"ALMOST\\n\");\n\t\tbreak;\n\t\tdefault:\n\t\t\tprintf(\"NEITHER!\\n\");\n\t}\n}\n", "lang": "GNU C", "bug_code_uid": "e70e1f70daf91b18e311a9ee1ab09c6e", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "9685f89d912b2687eb3b545f0b1676b7", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.961335676625659, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int i,j,a[10000][10000];\n for(i=0;i\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int i,j,a[10000][10000];\n for(i=0;i\n\nint main() {\n long long number;\n long long nap_time;\n long long messiness = 0;\n\n scanf(\"%lld\", &number);\n scanf(\"%lld\", &nap_time);\n\n if (nap_time >= (number / 2)) {\n messiness = ((number) * (number - 1)) / 2;\n printf(\"%lld\\n\", messiness);\n } else {\n for (long long i = 0; i < nap_time && (number - i - 1) > 0; i++) {\n messiness += (number - i - 1);\n }\n printf(\"%lld\\n\", messiness);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "5fc29377d492a5affcdd06f74b11eeb1", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "31d13b9a991b8a909271e92752a20d43", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9758562605277934, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \n\n#define N_MAX 100000\nint shed[N_MAX] = {0,};\nint messi_max = 0;\n\nlong operations = 0;\n\nvoid initialize(int n)\n{\n\tint i;\n\n\tfor(i = 0 ; i < n ; i++)\n\t\tshed[i] = i + 1;\n}\n\nint find_messiness(int n)\n{\n\tint i,j;\n\tint messiness = 0;\n\n\tfor(i = 0 ; i < n ; i++){\n\t\tfor(j = i + 1 ; j < n ; j++){\n\t\t\toperations++;\n\t\t\tif(shed[i] > shed[j])\n\t\t\t\tmessiness++;\n\t\t}\n\t}\n\n\treturn messiness;\n}\n\n\n/*int GetAnswer(int n, int k)\n{\n\tint i;\n\tint p,q;\n\tint messiness = 0;\n\tint local_mess;\n\tint tmp;\n\n\tif(n == 1)\n\t\treturn 0;\n\n\tlocal_mess = find_messiness(n);\n\toperations++;\n\n\tif(operations % 10 == 0)\n\t\tprintf(\"Operations: %ld\\n\",operations);\n\n\tif(local_mess > messi_max)\n\t\tmessi_max = local_mess;\n\n\tif(k == 0)\n\t\treturn messi_max;\n\n\t// For each pair, check if its already messed up\n\t// If not ... make move\n\t// Make move: mess, reduce timer by 1\n\t// Bactrack\n\t// Unmake move\n\tfor(p = 0 ; p < n ; p++){\n\t\tfor(q = n - 1 ; q > p ; q--){\n\t\t\tif(shed[p] <= shed[q]){\n\t\t\t\t// Not messed up\n\t\t\t\ttmp = shed[q];\n\t\t\t\tshed[q] = shed[p];\n\t\t\t\tshed[p] = tmp;\n\t\t\t\tmessiness = GetAnswer(n,k-1);\n\t\t\t\t// Unmake move\n\t \ttmp = shed[q];\n\t\t\t shed[q] = shed[p];\n\t\t\t shed[p] = tmp;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn messi_max;\n}*/\n\nint find_mess(int n, int k)\n{\n\tint i,j;\n\tint messiness = 0;\n\n\tif(n == 1)\n\t\treturn 0;\n\n\tfor(i = 1 ; i <= 2*k ; i++){\n\t\tif(n - i >= 0)\n\t\t\tmessiness += (n - i);\n\t\t//printf(\"i: %d ... messiness: %d\\n\",i,messiness);\n\t}\n\n\treturn messiness;\n}\n\nint GetAnswer(int n, int k)\n{\n\tint i;\n\tint messiness = 0;\n\tint p,q;\n\tint tmp;\n\tint prev_p, prev_q;\n\n\tif(n == 1)\n\t\treturn 0;\n\n\tprev_p = 0;\n\tprev_q = n - 1;\n\n\t// Swap maximally separated entities if it increases messiness\n\tfor(i = 0 ; i < k ; i++){\n\t\tfor(p = prev_p ; p < n ; p++){\n\t\t\tfor(q = prev_q ; q > p ; q--){\n\t\t\t\tif(shed[p] < shed[q]){\n\t\t\t\t\t// Swap and break\n\t\t\t\t\ttmp = shed[q];\n\t\t\t\t\tshed[q] = shed[p];\n\t\t\t\t\tshed[p] = tmp;\n\t\t\t\t\t//printf(\"i: %d ... messiness: %d\\n\",i+1,find_messiness(n));\n\t\t\t\t\tgoto RESULT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\nRESULT:\n prev_p = p;\n\t prev_q = q;\n\t}\n\n\t//messiness = find_messiness(n);\n\t//printf(\"m1: %d ... m2: %d\\n\",find_messiness(n),find_mess(n,k));\n\tmessiness = find_mess(n,k);\n\n\treturn messiness;\n}\n\n\nint main()\n{\n\tint n, k;\n\tint answer = 0;\n\n\t/* handle the program options */\n\t//freopen(\"C:/Users/Subh/Desktop/Work/Coding/C_code/test43.txt\",\"rt\",stdin);\n\n\tscanf(\"%d %d\",&n,&k);\n\n\tinitialize(n);\n\tmessi_max = 0;\n\toperations = 0;\n\t//printf(\"Operations: %ld\\n\",operations);\n\t//printf(\"Messiness after initialization is %d\\n\",find_messiness(n));\n\n\t/* The code of your application goes here */\n\t//answer = GetAnswer(n, k);\n\tanswer = find_mess(n,k);\n\n\tprintf(\"%d\\n\",answer);\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "6dd427f39bebfa45433e7221479a1b4f", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "2509174f5d752af4cee90ab9b30e8505", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.781563126252505, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nmain()\n{\n char tmp[100];\n int j=0,t;\n int se,na;\n scanf(\"%d\",&t);\n\n while(1)\n {\n sprintf(tmp,\"%d\",t);\n j = strlen(tmp);\n if(tmp[j-1]!='4' && tmp[j-1]!='7')\n\t{\n\t t++;\n\t continue;\n\t}\n j=0;\n se=0;\n na=0;\n while(tmp[j]!='\\0')\n\t{\n\t if(tmp[j]=='4')\n\t se++;\n\t else if(tmp[j]=='7')\n\t na++;\n\t else\n\t {\n\t se=-1; \n\t break;\n\t }\n\t j++;\n\t}\n if(se==na)\n\tbreak;\n j = strlen(tmp)-1;\n if(tmp[j]=='4')\n\t{\n\t t+=3;\n\t}\n else t+=7;\n \n }\n printf(\"%d\\n\",t);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "4958d23340a5faba9b63ac046fe4b405", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "5f7b2e7ffe3df2c2c2912b6ac143b44a", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9946409431939979, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nusing namespace std;\n\nint main(){\n\tchar c[7]={'^','>','v','<','^','>','v'};\n\tint n,i,t,s;\n\tchar u,v;\n\tscanf(\"%c %c\",&u,&v);\n\tgetchar();\n\tscanf(\"%d\",&n);\n\tn=n%4;\n\tif(n==0||n==2){\n\t\tprintf(\"undefined\");\n\t\treturn 0;\n\t}\n\tfor(i=0;i<4;i++){\n\t\tif(c[i]==u) t=i;\n\t\tif(c[i]==v) s=i;\n\t}\n\tint tm=t-n+4;\n//\tprintf(\"**%d %d %d %d**\",t,s,n,tm);\n//\tprintf(\"%c\",c[tm%4]);\n\tif(c[t+n]==v){\n\t\tprintf(\"cw\\n\");\n\t} else if(c[tm%4]==v){\n\t\tprintf(\"ccw\\n\");\n\t}\n\treturn 0;\n} ", "lang": "GNU C", "bug_code_uid": "a2b69bdb321e3ae370d37eb4ae87310e", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "38fb59b2d0ce79d1b94769d4c38042dc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.25635478637101133, "equal_cnt": 33, "replace_cnt": 21, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 33, "bug_source_code": "#include\nusing namespace std;\nint main()\n{\n int t,i,k,j,l,m,n,count,sum,count1;\n char s[10005],s1[10005];\n scanf(\"%d\",&n);\n scanf(\"%s\",s);\n s1[0]=s[0];\n m=1;\n count=1;\n for(i=1;i\nint check(char str[],int i,int j,int n)\n{\n\tint len=j-i+1;\n\tint k=0;\n\twhile(k!=len)\n\t{\n\t\tif(str[k+i]!=str[k+i+len])\n\t\treturn 0;\n\t\tk++;\n\t}\n\treturn 1;\n}\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tchar str[n+1];\n\tscanf(\"%s\",str);\n\tchar str1[2*n];\n\tint temp=0;\n\twhile(temp!=n)\n\t{\n\t\tstr1[temp]=str[temp];\n\t\ttemp++;\n\t}\n\twhile(temp!=2*n)\n\t{\n\t\tstr1[temp]=' ';\n\t\ttemp++;\n\t}\n\tint mid = n/2-1;\n\tint i=0,j=0;\n\tint len=0,start=0,end=0;\n\tfor(i=0;i\n#include \n\nunsigned long long int pgcd(unsigned long long int x,unsigned long long int y)\n {\n if ((x==1) || (y==1)) return 1;\n if (x==y) return x;\n if (x\nusing namespace std;\nint main(int argc, char const *argv[])\n{\n\tint cnt1, cnt2, x, y, v;\n\tcin >>cnt1>>cnt2>>x>>y;\n\tv = cnt2 + cnt1 + cnt1/x + cnt2/y;\n\tv -= (cnt1>cnt2)? cnt1/(x*y) : cnt2/(x*y);\n\tcout <\n#include \n\nint main () {\n int a,b;\n int x,y;\n \n scanf(\"%i %i\", &a, &b);\n scanf(\"%i %i\", &x, &y);\n \n int i = 0;\n while(a > 0 || b > 0){\n ++i;\n \n if((i%x != 0) && (i%y != 0)){\n if(a>b && a>0) a--;\n else b--;\n }\n else if((i%x != 0) && (a>0)){\n a--;\n \n }\n else if((i%y != 0) && (b>0)){\n b--;\n }\n }\n \n printf(\"%i\\n\", i);\n}\n \n", "lang": "GNU C", "bug_code_uid": "488e3a5932ebbcb27e2f51cf0ca13b00", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "c011840a03d27b68fe9cbf55fec5faa1", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2608108108108108, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "//friends and presents Federico Bellini\n#include \n#include \n\nint main () {\n int a,b;\n int x,y;\n \n scanf(\"%i %i\", &a, &b);\n scanf(\"%i %i\", &x, &y);\n \n int i = 0;\n while(a > 0 || b > 0){\n ++i;\n \n if((i%x != 0) && (i%y != 0)){\n if(a>b && a>0) a--;\n else b--;\n }\n else if((i%x != 0) && (a>0)){\n a--;\n \n }\n else if((i%y != 0) && (b>0)){\n b--;\n }\n }\n \n printf(\"%i\\n\", i);\n \n return 0;\n}\n \n", "lang": "GNU C", "bug_code_uid": "d9cf2e50b6eb9c8b5d19558c14f325c4", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "c011840a03d27b68fe9cbf55fec5faa1", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9338235294117647, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nusing namespace std;\n\nint c1, c2, x, y, ans;\nint main()\n{\n scanf(\"%d%d%d%d\", &c1, &c2, &x, &y);\n\n ans = c1+c2;\n while(ans - ans/x < c1)\n {\n ans += c1 - (ans - ans/x);\n }\n while(ans - ans/y < c2)\n {\n ans += c2 - (ans - ans/y);\n }\n while(ans - ans/(x*y) < c1+c2)\n {\n ans += (c1+c2) - (ans - ans/(x*y));\n }\n printf(\"%d\\n\", ans);\n}", "lang": "GNU C", "bug_code_uid": "0d7adcf972f59e74518d93196052843e", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "c5f26115ea9458798088e942ea633cfa", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.08517699115044247, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "#include\n\nlong long int b[10000000];\nint main()\n{\n\tint x,y,p=0;\n\tlong long int i,cnt1,cnt2,n;\n\tscanf(\"%llu%llu%d%d\",&cnt1,&cnt2,&x,&y);\n\tn=cnt1+cnt2;\n\tif(n<=x&&n<=y)\n\t{\n\t\tprintf(\"%lld\\n\",n);\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\tfor(i=1;i<=n;i++)\n\t\t{\n\t\t\tif(i%x!=0&&i%y!=0&&cnt1!=0&&cnt2!=0)\n\t\t\t{\n\t\t\t\tb[p++]=i;\n\t\t\t}\n\t\t\telse if(i%x!=0&&cnt1>0)\n\t\t\t\tcnt1--;\n\t\t\telse if(i%y!=0&&cnt2>0)\n\t\t\t\tcnt2--;\n\t\t\tif(i==n&&(cnt1!=0||cnt2!=0))\n\t\t\t{\n\t\t\t\tif(p==(cnt1+cnt2)||(p==cnt1)&&(cnt1!=0)||(p==cnt2&&cnt2!=0))\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%llu\\n\",n);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\tn++;\n\t\t\t}\n\t\t}\n\t}\t\t\n}\n", "lang": "GNU C", "bug_code_uid": "b9dd47434a0c1d5e760fcf5775ee925d", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "5ac249ab9402f37f7553f3ff01221ebd", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9043887147335423, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include\nint a[30001];\nlong long int lcm(long long int x,long long int y)\n{\n\tlong long int pro=1,p,q,c,i;\n\tif(x>y)\n\t{\n\t\tc=x;\n\t\tx=y;\n\t\ty=c;\n\t}\n\tif(y%x==0)\n\t\treturn y;\n\telse if((a[x]==0||a[y]==0))\n\t\treturn x*y;\n\telse \n\t{\n\t\t//prime factorisation\n\t\tfor(i=2;ib)\n\t\treturn a;\n\telse \n\t\treturn b;\n}\n\nint main()\n{\n\tint i,j;\n\ta[0]=1;a[1]=1;\n\tlong long int p,q,l,f1,f2,mid2,both,start=1,end=1000000,k,mid,cnt1,cnt2,x,y;\n\tfor(i=2;i<=30000;i++)//ceiving\n\t\tif(a[i]!=1)\n\t\t\tfor(j=2*i;j<=30000;j+=i)\n\t\t\t\ta[j]=1;\n\n\tscanf(\"%lld%lld%lld%lld\",&cnt1,&cnt2,&x,&y);\n\tl=lcm(x,y);\n\ti=0;j=0;\n\twhile(1)\n\t{\n\t\tmid=(start+end)/2;\n\t\tf1=mid/x;//divisible by x\n\t\tf2=mid/y;//divisible by y\n\t\tboth=mid/l;//divi by both\n\t\tp=max(0,cnt1-(f2-both));//gives no. of nums divisible only by y\n\t\tq=max(0,cnt2-(f1-both));//only by x;\n\t\tk=mid-(f1+f2-both);\n\t\tif(p+q==k)\n\t\t{\n\t\t\tend=mid;\n\t\t\tmid2=mid;\n\t\t\ti=1;\n\t\t\tj=0;\n\t\t\t//return 0;\n\t\t}\n\t\telse if(p+q>k)\n\t\t{\n\t\t\tstart=mid;\n\t\t\tj=1;\n\t\t}\n\t\telse if(p+q\n#include \n\n# define F first\n# define S second\n# define mp make_pair\n# define pii pair\n\n# define long long long\n# define pb push_back\n# define sz(a) (int)(a.size())\n\n# define y1 tipa_y1\n# define left tipa_left\n# define right tipa_right\n\nconst int Mod = (int)1e9 + 7;\nconst int MX = 1073741822;\nconst long MXLL = 4611686018427387903;\nconst int Sz = 1110111;\n\nint n, k;\n\nchar a[11011];\n\nint len = 0, mx = 0;\n\nint main()\n{\n scanf (\"%d %d\", &n, &k);\n for (int i = 1;i <= n;i ++) {\n scanf (\" %c\", &a[i]);\n if (a[i] == 'N')\n len ++;\n else\n { \n len = 0;\n }\n if (mx < len)\n mx = len;\n } \n if (mx > k)\n printf (\"NO\");\n else \n { \n len = 0;\n bool ok = 0;\n for (int i = 1;i + k - 1 <= n;i ++) {\n if (i == 1 || a[i - 1] != 'N') {\n bool y = 1;\n for (int j = i;j <= i + k - 1;j ++) {\n if (a[j] == 'Y')\n y = 0;\n } \n if (i + k <= n && a[i + k] == 'N') \n y = 0;\n if (y) \n {\n ok = 1;\n break;\n }\n }\n } \n if (ok)\n printf (\"YES\");\n else\n printf (\"NO\");\n }\n\n\n return 0;\n}\n\n\n\n\n\n\n\n\n\n// Coded by Z...\n", "lang": "GNU C11", "bug_code_uid": "ce3686bed57ad873f4c76e78b684d1d8", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "e8467973fc4f838dfe445c5ec73d90e4", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7569204152249135, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 16, "bug_source_code": "#include\n#define Inf 1LL<<61\n#define ll long long\n#define NewLine cout<b;i--)\n#define R(i,b) REP(i,0,b)\n#define r(b)REP(_,0,b)\n#define RR(i,b) RREP(i,b,-1)\n#define R1(i,b) REP(i,1,b)\n#define pb push_back\n#define IN ll k,q;cin>>k>>q;cin.get()\n#define CInt(x)cin>>x;cin.get()\n#define CBuff(x)cin.getline(x, sizeof(x))\n#define Outl(x)cout << x << '\\n'\n#define all(x) begin(x),end(x)\nusing namespace std;\n\nint n, k;\nchar b[110];\nint N[110], m = 0;\nint main()\n{\n\tscanf(\"%d%d\", &n, &k);\n\tscanf(\"%s\", &b);int l = 0;\n\tR(i, n) {\n\t\tif (b[i] == 'N') {\n\t\t\tl++;\n\t\t}\n\t\telse {\n\t\t\tif (l > 0)\n\t\t\t\tN[m++] = l;l = 0;\n\t\t}\n\t}l = 0;\n\tR(i, n) {\n\t\tif (b[i] == 'N'|| b[i] == '?') {\n\t\t\tl++;\n\t\t}\n\t\telse {\n\t\t\tif (l > 0)\n\t\t\t\tN[m++] = l;l = 0;\n\t\t}\n\t}int u = 0, d = 0;\n\tR(i, m) {\n\t\tif (N[i] >= k)u = 1;\n\t\tif (N[i] <= k)d = 1;\n\t}if (u&&d)printf(\"YES\");else printf(\"NO\");\n\n", "lang": "GNU C11", "bug_code_uid": "28b104bea51a3a7e34991eb70d4f0659", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "b6614cf002efa9c38734951dd28cdaec", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9993050729673384, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main() {\n\tint n, k;\n\tchar s[110];\n\tchar t[110];\n\tscanf(\"%d%d\", &n, &k);\n\tscanf(\"%s\", t + 1);\n\tn += 2;\n\tt[0] = 'Y';\n\tn[n - 1] = 'Y';\n\tfor(int i = 0; i < n; i++) {\n\t\tif(t[i] == 'N')\n\t\t\tcontinue;\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\ts[j] = t[j];\n\t\t}\n\t\tif(i - k >= 0) {\n\t\t\tint ok = 1;\n\t\t\tfor(int j = i - k; j < i; j++) {\n\t\t\t\tif(s[j] == 'Y')\n\t\t\t\t\tok = 0;\n\t\t\t\ts[j] = 'N';\n\t\t\t}\n\t\t\tif(i - k - 1 >= 0) {\n\t\t\t \tif(s[i - k - 1] == 'N')\n\t\t\t\t\tok = 0;\n\t\t\t\ts[i - k - 1] = 'Y';\n\t\t\t}\n\t\t\tint cnt = 0, mc = 0;\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(s[i] == 'N')\n\t\t\t\t\tcnt++;\n\t\t\t\telse\n\t\t\t\t\tcnt = 0;\n\t\t\t\tif(mc < cnt)\n\t\t\t\t\tmc = cnt;\n\t\t\t}\n\t\t\tok &= mc == k;\n\t\t\tif(ok) {\n\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\treturn(0);\n\t\t\t}\n\t\t}\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\ts[j] = t[j];\n\t\t}\n\t\tif(i + k < n) {\n\t\t\tint ok = 1;\n\t\t\tfor(int j = i + 1; j < i + k + 1; j++) {\n\t\t\t\tif(s[j] == 'Y')\n\t\t\t\t\tok = 0;\n\t\t\t\ts[j] = 'N';\n\t\t\t}\n\t\t\tif(i + k + 1 < n) {\n\t\t\t\tif(s[i + k + 1] == 'N')\n\t\t\t\t\tok = 0;\n\t\t\t\ts[i + k + 1] = 'Y';\n\t\t\t}\n\t\t\tint cnt = 0, mc = 0;\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tif(s[i] == 'N')\n\t\t\t\t\tcnt++;\n\t\t\t\telse\n\t\t\t\t\tcnt = 0;\n\t\t\t\tif(mc < cnt)\n\t\t\t\t\tmc = cnt;\n\t\t\t}\n\t\t\tok &= mc == k;\n\t\t\tif(ok) {\n\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\treturn(0);\n\t\t\t}\n\t\t}\n\t}\n\n\tint cnt = 0, mc = 0;\n\tfor(int i = 0; i < n; i++) {\n\t\tif(s[i] == 'N' || s[i] == '?')\n\t\t\tcnt++;\n\t\telse\n\t\t\tcnt = 0;\n\t\tif(mc < cnt)\n\t\t\tmc = cnt;\n\t}\n\tif(mc == k) {\n\t\tprintf(\"YES\\n\");\n\t\treturn(0);\n\t}\n\n\tprintf(\"NO\\n\");\n\treturn(0);\n}\n", "lang": "GNU C11", "bug_code_uid": "f1833ed1fb9a56a9edd563353f9f97f5", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "789293ff0f8e1aaf87e3f4456cb8c163", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4594775619557937, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 19, "bug_source_code": "#include \n#include \n\nint main() {\n int n, k;\n scanf(\"%d%d\", &n, &k);\n\n char s[n + 1];\n scanf(\"%s\", s);\n\n char last = '.';\n int cnt = 0, mxN = 0;\n for(int i = 0; i < n; ++i) {\n if(s[i] == last) {\n cnt++;\n } else {\n last = s[i];\n cnt = 1;\n }\n if(last == 'N') {\n mxN = max(mxN, cnt);\n }\n }\n\n if (mxN <= k) {\n for (int i = 0; i + k <= n; ++i) {\n bool f = true;\n for (int j = i; j < i + k; ++j)\n f &= s[i] != 'Y';\n\n if (i != 0)\n f &= s[i - 1] != 'N';\n if (i + k != n)\n f &= s[i + k] != 'N';\n\n if (f) {\n puts(\"YES\");\n return 0;\n }\n }\n }\n\n puts(\"NO\");\n}", "lang": "GNU C11", "bug_code_uid": "54a07fe39d8d5e27cadf42f552cdf4dd", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "7f5e824dc2b14d1a2dcd488817792d5c", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7539531941808981, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "#include \nusing namespace std;\n\nchar a[101];\n\nint main()\n{\n #ifdef LOCAL\n freopen(\"input.txt\",\"r\",stdin);\n freopen(\"output.txt\",\"w\",stdout);\n #endif \n \n \tint n, k, sch = 0, ans = 0;\n \tscanf(\"%d%d%s\", &n, &k, a);\n\n \ta[n] = 'E';\n\n \tfor (int i = 0; i <= n; i++)\n \t{\n \t\tif (a[i] != a[i - 1])\n \t\t{\n \t\t\tans = max(ans, sch);\n \t\t\tsch = 0;\n \t\t}\n \t\tif (a[i] == 'N') sch++;\n \t}\n\n \tif (ans > k)\n \t{\n \t\tprintf(\"NO\");\n \t\treturn 0;\n \t}\n\n \tans = sch = 0;\n\n \tfor (int i = 0; i <= n; i++)\n \t{\n \t\tif (a[i] != a[i - 1])\n \t\t{\n \t\t\tans = max(ans, sch);\n \t\t\tsch = 0;\n \t\t}\n \t\tif (a[i] == 'N' || a[i] == '?') sch++;\n \t}\n\n \tif (ans >= k)\n \t\tprintf(\"YES\");\n \telse printf(\"NO\");\n \treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f6e36a7239c66c3f796652d917c97774", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "05c8631d8e2fd84df059151b43b7c7be", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9992810927390366, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": " #include \n\tint mod=1000000007;\n long long int power(long long int base,long long int exponent)\n {\n \tlong long int res=1;\n \twhile(exponent) \n \t{\n \t\tif(exponent%2) \n \t\t\tres=(res*base)%mod;\n \t\tbase=(base*base)%mod;\n \t\texponentexponent/=2;\n \t}\n \treturn res%mod;\n }\n \n long long int geometricsum(long long int r,long long int n)\n {\n \tif(r==1) \n \t\treturn n%mod;\n \treturn (1-power(r,n))*power(1-r,mod-2)%mod;\n }\n \n int main()\n {\n \tlong long int a,b,n,x;\n \tscanf(\"%lld %lld %lld %lld\", &a,&b,&n,&x);\n \tlong long int answer=(power(a,n)*x+b*geometricsum(a,n))%mod;\n \tprintf(\"%lld\", answer);\n \treturn 0;\n\n }", "lang": "GNU C11", "bug_code_uid": "ce29ff8bc96fa151e1da53cfaeaef360", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "e94b4b920b59883505d9f7d9f4c0c29a", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.34551750673335896, "equal_cnt": 21, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "#include \ntypedef long long ll;\nll MOD = 1000000007 ;\nll MOD2 = 1000000006 ;\n\nint main(int argc, char const *argv[])\n{\n ll A,B,n,x; \n scanf(\"%lld %lld %lld %lld\",&A,&B,&n,&x);\n ll answer = 0;\n ll apart = 1;\n ll itna = n%(MOD2);\n if(itna==0)\n {\n printf(\"%lld\\n\",x%MOD);\n }\n else\n {\n ll second = 1;\n for (ll i = 2; i <= itna; i++)\n {\n apart = (apart*(A%MOD))%MOD ;\n second = (second+apart)%MOD;\n }\n second = ((second%MOD)*(B%MOD))%MOD ;\n ll fed = ((apart%MOD)*(A%MOD))%MOD ;\n fed = (fed%MOD*(x%MOD))%MOD ;\n answer = (answer+second+fed)%MOD ;\n printf(\"%lld\\n\",answer);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "cb8bebde566227d2c76475fc2ee7a84a", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "2dab2cc1b198b406d1075717c4cfd3d2", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9617777777777777, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nlong long int power(long long int x,long long int y)\n{\n\tint hel=1;\n\tx= x%1000000007;\n\twhile(y>0)\n\t{\n\t\tif((y&1)==1)\n\t\t{\n\t\t\thel=(hel*x)%1000000007;\n\t\t}\n\t\tx= (x*x)%1000000007;\n\t\ty= y>>1;\n\t}\n\treturn hel%1000000007;\n}\nlong long int cal(long long int x,long long int y)\n{\n\tif(x==1)\n\t{\n\t\treturn y%1000000007;\n\t}\n\telse\n\t{\n\t\treturn (power(x,y)-1);\n\t}\n}\n\nint main()\n{\n\tlong long int a,b,n,x,sum;\n\tscanf(\"%lld%lld%lld%lld\",&a,&b,&n,&x);\n\tsum=(power(a,n)*x+(b*cal(a,n)/(a-1)))%1000000007;\n\tprintf(\"%lld\\n\",sum);\n\treturn 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "a9b84bab20b07244b2bb742308dab0d9", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "c0cdbb51fcbfb968b7984f549f9f304d", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8768267223382046, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main(void)\n{\n int number,count,sum=0;\n while(scanf(\"%d\",&number)!=EOF)\n {\n while(number)\n count++;\n number>>=1;\n }\n printf(\"%d\",count);\n }\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9ea0e83c3e6a2f3b35f4246657116028", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "cdd73c34c5154bba475c80cb98f9ed37", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9955375253549695, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#define M 1000000007LL\nconst long long MSQ = M * M;\ninline int mul(int a, int b) { return int(a * 1LL * b % M); }\ninline int powr(int a, int b) {\n int ans = 1;\n while (b) {if (b & 1) ans = mul(ans, a); a = mul(a, a); b >>= 1;}\n return ans;\n}\nint main(){\n int n, k, i, j, c, d;\n long long x, y, z, u, v, res;\n scanf(\"%d %d\", &n, &k);\n if (k == 0) res = n;\n else{\n if (n <= (k + 1)){\n for (i = 1, res = 0; i <= n; i++) res += powr(i, k);\n }\n else{\n res = 0;\n u = 1, v = 1, z = 0;\n for (i = 0; i <= (k + 1); i++){\n u = (u * (n - i)) % M;\n if (i) v = ((v * -i) + MSQ) % M;\n }\n for (i = 0, c = 1, d = k + 1; i <= (k + 1); i++, c++, d--){\n z = (z + powr(i, k)) % M;\n x = (u * z) % M;\n x = (x * powr(n - i, M - 2)) % M;\n y = ((x * powr(v, M - 2)) % M);\n v = (v * c) % M;\n if (d) v = (v * powr(d, M - 2)) % M;\n if (i & 1) y = M - y;\n res += y;\n }\n }\n }\n printf(\"%lld\\n\", res % M);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "849d8b2f797c98c2b35603b9dd7f44df", "src_uid": "6f6fc42a367cdce60d76fd1914e73f0c", "apr_id": "6bdbc98bd4519f7b81b3f4b4cdd8874f", "difficulty": 2600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9960159362549801, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define M 1000000007\nint n,k,i,c,d;\nlong long y,z,u,v,r;\nint F(int a,int b){\n int r=1;\n for (;b;b>>=1,a=(long long)a*a%M){\n if (b&1)r=(long long)r*a%M;\n }\n return r;\n}\nint main(){\n scanf(\"%d%d\",&n,&k);\n if (n<=++k){for(i=1;i<=n;i++)r+=F(i,k-1);}\n else{\n for (u=v=1;i<=k;i++){u=(u*(n-i))%M;if (i)v=((v*-i)%M+M)%M;}\n for (i=0,c=1,d=k;i<=k;i++,c++,d--){\n z=(z+F(i,k-1))%M;\n y=u*z%M*F(n-i,M-2)%M*F(v,M-2)%M;\n v=v*c%M*F(d,M-2)%M;\n if(i&1)y=M-y;\n r+=y;\n }\n }\n if (!--k)r--;\n printf(\"%lld\\n\",r%M);\n}\n", "lang": "GNU C", "bug_code_uid": "015934b4e21365077d8004d2e67f1d6c", "src_uid": "6f6fc42a367cdce60d76fd1914e73f0c", "apr_id": "77663d047b33ae8d081bfef21ff98dd3", "difficulty": 2600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5571725571725572, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "#include \n\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n if(n==35)\n {\n printf(\"57\\n\");\n }\n if(n==57)\n {\n printf(\"319\\n\");\n }\n if(n==391)\n {\n printf(\"1723\\n\");\n }\n if(n==1723)\n {\n printf(\"35\\n\")\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "fb38781a417c4f3fd740d077587b3656", "src_uid": "7220f2da5081547a12118595bbeda4f6", "apr_id": "b8fdbb025419527278cff1786ee86447", "difficulty": null, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9953271028037384, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n int num, i;\n scanf(\"%d\", &num);3\n for(i = 2;i < num;i++){\n if(num % i == 0){\n printf(\"%d%d\\n\", i, num/i);\n break;\n }\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "7f49a12e8d18c1082a0caf147af4f63b", "src_uid": "7220f2da5081547a12118595bbeda4f6", "apr_id": "e19b91f66ce403456259c333b23905a0", "difficulty": null, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9704142011834319, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main(void)\n{\n int x, i = 2;\n \n scanf(\"%d\", &x);\n \n while(1) if(!(x%i++)) printf(\"%d%d\\n\", i-1, x/(i-1));\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "72123fa278e553e7dfd77227bb5aceee", "src_uid": "7220f2da5081547a12118595bbeda4f6", "apr_id": "115f658eb486420e2e26ed1a1a6224d1", "difficulty": null, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8255992962392786, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint convert(char a){\n\tif(a == 'x' || a == 'X') return 1;\n\tif(a == '0') return 2;\n\tif(a == '.') return 0;\n\treturn -1;\n}\n\nint main(){\n\tchar str[100];\n\tint a[3][3], tmp, tmp1, tmp2;\n\tint nx, no, n, cx, co, sub;\n\tchar x,o;\n\t\n\tfor(;;){\n\t\n\tscanf(\"%s\",str);\n\ta[0][0] = convert(str[0]);\n\ta[0][1] = convert(str[1]);\n\ta[0][2] = convert(str[2]);\n\tscanf(\"%s\",str);\n\ta[1][0] = convert(str[0]);\n\ta[1][1] = convert(str[1]);\n\ta[1][2] = convert(str[2]);\n\tscanf(\"%s\",str);\n\ta[2][0] = convert(str[0]);\n\ta[2][1] = convert(str[1]);\n\ta[2][2] = convert(str[2]);\n\tx = o = 0;\n\tnx = no = n = cx = co = 0;\n\ttmp = a[0][0];\n\tif(tmp == a[0][1] && tmp == a[0][2]){\n\t\tif(tmp == 1) {x |= 0x80; cx++;}\n\t\telse if(tmp == 2) {o |= 0x80; co++;}\n\t}\n\ttmp = a[1][0];\n\tif(tmp == a[1][1] && tmp == a[1][2]){\n\t\tif(tmp == 1) {x |= 0x40; cx++;}\n\t\telse if(tmp == 2) {o |= 0x40; co++;}\n\t}\n\ttmp = a[2][0];\n\tif(tmp == a[2][1] && tmp == a[2][2]){\n\t\tif(tmp == 1) {x |= 0x20; cx++;}\n\t\telse if(tmp == 2) {o |= 0x20; co++;}\n\t}\n\ttmp = a[0][0];\n\tif(tmp == a[1][0] && tmp == a[2][0]){\n\t\tif(tmp == 1) {x |= 0x10; cx++;}\n\t\telse if(tmp == 2) {o |= 0x10; co++;}\n\t}\n\ttmp = a[0][1];\n\tif(tmp == a[1][1] && tmp == a[2][1]){\n\t\tif(tmp == 1) {x |= 0x08; cx++;}\n\t\telse if(tmp == 2) {o |= 0x08; co++;}\n\t}\n\ttmp = a[0][2];\n\tif(tmp == a[1][2] && tmp == a[2][2]){\n\t\tif(tmp == 1) {x |= 0x04; cx++;}\n\t\telse if(tmp == 2) {o |= 0x04; co++;}\n\t}\n\ttmp = a[0][0];\n\tif(tmp == a[1][1] && tmp == a[2][2]){\n\t\tif(tmp == 1) {x |= 0x02; cx++;}\n\t\telse if(tmp == 2) {o |= 0x02; co++;}\n\t}\n\ttmp = a[0][2];\n\tif(tmp == a[1][1] && tmp == a[2][0]){\n\t\tif(tmp == 1) {x |= 0x01; cx++;}\n\t\telse if(tmp == 2) {o |= 0x01; co++;}\n\t}\n\tfor(tmp1=2; tmp1 >=0; --tmp1){\n\t\tfor(tmp2=2; tmp2 >=0; --tmp2){\n\t\t\tif(a[tmp1][tmp2] == 1) nx++;\n\t\t\telse if(a[tmp1][tmp2] == 2) no++;\n\t\t\telse n++;\n\t\t}\n\t}\n\t\n\tsub = nx -no;\n\tprintf(\"Debug: nx:%d no:%d\\n\",nx,no);\n\tif( (sub >1 || sub <0) \n\t || ((x & 0xFF) && (o & 0xFF))\n\t || (nx > 5 || no > 4)\n\t || (cx > 2 || co > 1)\n\t){\n\t\tprintf(\"illegal\\n\");\n\t\tcontinue;\n\t}\n\t\n\tif(x){\n\t\tprintf(\"the first player won\\n\");\n\t\tcontinue;\n\t}else if(o){\n\t\tprintf(\"the second player won\\n\");\n\t\tcontinue;\n\t}\n\t\n\tif(n>0){\n\t\tif(sub==0) printf(\"first\\n\");\n\t\telse printf(\"second\\n\");\n\t}else{\n\t\tprintf(\"Draw\\n\");\n\t\tcontinue;\n\t}\n\t\n\t}// for\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0a61766ddb3692ffeeb768af478cf79a", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "feabb1aa88730c89bb6acf946c90593e", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9109707064905227, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nlong long int GCD(long long int a,long long int b){\n\tif(b==0)return a;\n\tif(a\nint main()\n{\n\tlong long int n, m;\n\tscanf(\"%lld %lld\", &n, &m);\n\tlong long int p = 1000000007;\n\tlong long int s[2][2], t[2][2];\n\tint i;\n\ts[0][0] = s[0][1] = 1;\n\tfor (i = 1; i < n; i++)\n\t{\n\t\ts[1][0] = s[0][0] + s[0][1];\n\t\ts[1][1] = s[0][0];\n\t\ts[0][0] = s[1][0] % p;\n\t\ts[0][1] = s[1][1] % p;\n\t}\n\tt[0][0] = t[0][1] = 1;\n\tfor (i = 1; i < m; i++)\n\t{\n\t\tt[1][0] = t[0][0] + t[0][1];\n\t\tt[1][1] = t[0][0];\n\t\tt[0][0] = t[1][0] % p;\n\t\tt[0][1] = t[1][1] % p;\n\t}\n\tprintf(\"%lld\\n\", (s[0][0] + s[0][1] + t[0][0] + t[0][1]) % p);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "be31d55800e8d990a98c785f4ab00c65", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "f5dad70757edef4389064a5dd40af09e", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.700587084148728, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "f[111111], p = 1e9 + 7;\nmain(n, m, i, j) {\n\tscanf(\"%d%d\", &n, &m);\n\tf[1] = 2;\n\tfor (i = 2; i <= m + 1; i++) f[i] = (f[i - 1] + f[i - 2]) % p;\n\tprintf(\"%lld\", (1ll * f[m + 1] + f[n + 1] - 2 + p) % p);\n}", "lang": "GNU C11", "bug_code_uid": "67e5c03a8cf8e3963587f3f847184d22", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "fc2e128d15a981850d75b5e42303ecea", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9614299153339605, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \nint max(int a, int b)\n{\n\tif(a> b) return a;\n\telse return b;\n}\nmain()\n{\n\tint x, y, a1, b1, a2, b2;\n\tscanf(\"%d%d%d%d%d%d\", &x, &y, &a1, &a2, &b1, &b2);\n\tif(a1 + b1 <= x && max(a2, b2)<= y || a1 + b2 <= x && max(a2, b1)<= y|| a2+ b2 <= x && max(a1, b1)<= y || a2 + b1 <= x && max(a1, b2)<= y || a1 + b1 <= y && max(a2, b2)<= x || a1 + b2 <= y && max(a2, b1)<= x ||a2 + b1<= y && max(a1, b2)<= x|| a2 + b2 <= y && max(a1, b1)<= x)\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse\n\t{\n\t\tprintf(\"NO\");\n\t}\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "0c85d57a2f04bf7bc188e57e4d39f9a6", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "b91cf6ed88bf2c2d4bc5ea2917c64900", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9993690851735015, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint min(int a,int b){\n if(a<=b)\n return a;\n else\n return b;\n}\nint max(int a,int b){\n if(a<=b)\n return b;\n else\n return a;\n}\n\nint main()\n{\n int a1,a2,b1,b2,a,b,k;\n scanf(\"%d%d\",&a,&b);\n scanf(\"%d%d\",&a1,&b1);\n scanf(\"%d%d\",&a2,&b2);\n int x=max(a1,b1);\n int y=a1+(b1-x);\n int x1=max(a2,b2);\n int y2=a2+(b2-x1);\n int z=max(a,b);\n k=a+(b-z);\n if(x+x1<=z&&max(y,y2)<=k||x+x1<=k&&max(y,y2)<=z)\n printf(\"YES\");\n else if(x+y2<=z&&max(x1,y)<=k||x+y2<=k&&max(x1,y)<=z)\n printf(\"YES\");\n else if(y+x1<=z&&max(x,y2)<=k||x+y2<=k&&max(x1,y)<=z)\n printf(\"YES\");\n else if(y+y2<=z&&max(x,x1)<=k||y+y2<=k&&max(x,x1)<=z)\n printf(\"YES\");\n else\n printf(\"NO\");\n\n\n\n return 0;", "lang": "GNU C", "bug_code_uid": "7a81b4ad0943e4a81aed2e6d57148ab8", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "a4df7f1dd6ed7c8a01f2c98ee8673d9e", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.989247311827957, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\nint a,b,x1,y1,x2,y2;\nclrscr();\nscanf(\"%d%d%d%d%d%d\",&a,&b,&x1,&y1,&x2,&y2);\nif(((x1+x2<=a)&&(max(y1,y2)<=b))||((y1+x2<=b)&&(max(y2,x1)<=a))||((y2+x1<=b)&&(max(x2,y1)<=a))||((x1+x2<=b)&&(max(y1,y2)<=a))||((y1+y2<=b)&&(max(x1,x2)<=a))||((y1+y2<=a)&&(max(x1,x2)<=b))||((y2+x1<=a)&&(max(x2,y1)<=b))||((y1+x2<=a)&&(max(x1,y2)<=b)))\nprintf(\"YES\");\nelse\nprintf(\"NO\");\nreturn 0;\n}\nint max(int x ,int y)\n{\nint t;\nif(x>=y)\nt=x;\nelse\nt=y;\nreturn t;\n}", "lang": "GNU C", "bug_code_uid": "141ce204fd9e7cf6521bac1595c1a7a4", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "86b101a80ef2647554c1cd92ca54f2b8", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.13202614379084968, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "#include \n#define MAX 1000000007\nlong long int ncr(int n, int k)\n{\n if(k > n)\n return 0;\n if(k == n)\n return 1;\n long long int r = n;\n int i;\n for(i=2;i<=k;++i)\n {\n r *= (n-i+1);\n r = r/i;\n }\n return r;\n}\nint main()\n{\n int n,i, sum = 0, ans = 0;\n scanf(\"%d\", &n);\n sum = n+2;\n for(i = 1; i <=n; i++){\n ans = ans + ncr(n+1,i);\n }\n ans = (ans+n)%MAX;\n if(n == 2){\n ans = 4;\n }\n printf(\"%d\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c9d84cae57ef596d7aa682688e70e88c", "src_uid": "13a9ffe5acaa79d97df88a069fc520b9", "apr_id": "b861edcba4fc99399cc9c07a05c8953b", "difficulty": 1900, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9663865546218487, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n#define P 1000000007\nint n,i,j;__int64 t=1,s;\nvoid main(){\n\tscanf(\"%d\",&n);\n\tfor(i=1;i<=n;++i)t=t*i%P;\n\tfor(j=P-3,s=t;j;j>>=1,s=s*s%P)\n\t\tif(j&1)t=t*s%P;\n\tfor(i=n;i\nint main()\n{\n\tint n,k,i,j=0,max=0;\n\tscanf(\"%d%d\",&n,&k);\n\tint a[n];\n\tfor(i=0;imax)\n\t\t\tmax=j;\n\t\t}\n\t}\n\tprintf(\"%d\",k/max);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "54a4ce4865b5f4212227f17e5a1c9f79", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "b38377379805f22dde60f30fad31c119", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9850136239782016, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main(int argc, char *argv[])\n{\n int k, a, b, c;\n int ans;\n while(scanf(\"%d %d %d %d\", &k, &a, &b, &c) != EOF)\n {\n ans = 0;\n while(1)\n {\n if(b < k - 1)\n {\n a = a - (b + 1)*c;\n ans++;\n break;\n }\n if(b > k - 1)\n {\n b = b - k + 1;\n if((a- k * c) > 0)\n {\n a = a - k * c;\n ans++;\n }\n }\n }\n while(a > 0)\n {\n ans++;\n a -= k;\n }\n if(a > 0)\n ans++;\n printf(\"%d\\n\", ans);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b80a6731f452516f3cb9d7d86d405898", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "3bb7b178e1c92c3e22e4aa26158407a9", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.18461538461538463, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int k,a,b,v,s,e=0,m=0;\n scanf(\"%d %d %d %d\",&k,&a,&b,&v);\n while(b>0)\n {\n if(b+1>k&&a>0)\n {\n a-=k*v;\n b-=k-1;\n m++;\n }\n else if(k>(b+1)&&a>0)\n {\n a-=(b+1)*v;\n b=0;\n m++;\n }\n }\n if(a>0)\n {\n e=a%v;\n s=a/v;\n m+=s;\n }\n if(e>0)\n m++;\n printf(\"%d\\n\",m);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2770bdf7a290fb6e212281556e2929bb", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "ad06d825ae7c451607228234ebdc52e2", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16473072861668428, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int k,a,b,v,s=0,e=0,m=0,l=0,h=0,i;\n scanf(\"%d %d %d %d\",&k,&a,&b,&v);\n if(b+1>k&&a>0)\n {\n l=b/(k-1);\n h=b%(k-1);\n for(i=1; i<=l; i++)\n if(a-(i*v*k)>=k*v&&a-(i+1)*v*k0&&a>0)\n {\n a-=(h+1)*v;\n m++;\n }\n }\n else if(b+10)\n {\n a-=(b+1)*v;\n m++;\n }\n if(a>0)\n {\n e=a%v;\n s=a/v;\n m+=s;\n }\n if(e>0)\n m++;\n printf(\"%d\\n\",m);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "7209f39ee88ca9d3f576fe0a7a017ec1", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "ad06d825ae7c451607228234ebdc52e2", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4007561436672968, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nmain(){\n\tint x1,y1,x2,y2,x3,y3;\n\tscanf(\"%d %d %d %d %d %d\",&x1,&y1,&x2,&y2,&x3,&y3);\n\tif((x1==x2&&x1==x3)||(y1==y2&&y1==y3))\n\tprintf(\"1\");\n\telse if(x1==x2&&(y3-y1)*(y3-y2)>=0)\n\tprintf(\"2\");\n\telse if(x1==x3&&(y2-y1)*(y2-y3)=>0)\n\tprintf(\"2\");\n\telse if(x2==x3&&(y1-y2)*(y1-y3)>=0)\n\tprintf(\"2\");\n\telse if(y1==y2&&(x3-x1)*(x3-x2)>=0)\n\tprintf(\"2\");\n\telse if(y1==y3&&(x2-x1)*(x2-x3)>=0)\n\tprintf(\"2\");\n\telse if(y2==y3&&(x1-x2)*(x1-x3)>=0)\n\tprintf(\"2\");\n\telse \n\tprintf(\"3\");\n}", "lang": "GNU C", "bug_code_uid": "9c562187b8eb98f6dcd5e115cbfaf49a", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "b9d0ba69d9cc1f3ff77176c67ace9de1", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8415584415584415, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n\n\nusing namespace std;\n\n\n\nint main()\n{\n\tlong long t,n,i,j,k;\n\t\n\tscanf(\"%lld\",&n);\n\t\n\tprintf(\"%lld\",(n-2)*(n-2));\n\t\n\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "89459cd5b2da15169dbbe375cede14ea", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "6b678af942db84ceb9bd4ba64c760ff1", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9931972789115646, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "-2#include\nint main() {\n int n;\n scanf(\"%d\",&n);\n long long res=(long long)(n-2)*(long long)(n-2);\n printf(\"%lld\\n\",res);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "1123c5d786c6133f76ed9f8dd9a82051", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "ecae0d4224b1217b60bd5342b45b768b", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.22274881516587677, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint m, n, a, a1; count_m = 1, count_n = 1;\n\nvoid main()\n{\n scanf(\"%d %d %d\", &m, &n, &a);\n\n a1 = a;\n\n while (a1 < m)\n {\n a1+=a1;\n count_m++;\n }\n\n while (a < n)\n {\n a += a;\n count_n++;\n }\n printf(\"%d\", count_m * count_n);\n}\n", "lang": "GNU C11", "bug_code_uid": "320e5b07a94d7718c1b5fa04a6bc6ac7", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "1a3b93e942eb8904de460b35ec4911dd", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3202511773940345, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\nint m,n;\nint main()\n{\n scanf(\"%d %d\",&m,&n);\n int a=0;\n int i,j;\n for(i=0;i\nint main ()\n{\n int a,b,c,d,sum=0;\n scanf(\"%d%d\",&a,&b);\n c=a;\n while(1)\n {\n c=c/b;\n d=c%b;\n sum=sum+c;\n c=c+d;\n if(c\n#define MIN(a,b) ((a)>(b)?(b):(a))\nint main()\n{\n int x,hh,mm,hourCount=0,snoozeCount=0,temp;\n scanf(\"%d%d%d\",&x,&hh,&mm);\n if(hh%10==7 || hh/10==7 || mm%10==7 || mm/10==7)\n printf(\"0\");\n else\n {\n // printf(\"the time is %d:%d\\n\",hh,mm);\n\n while(hourCount<24)\n {\n mm-=x;\n // printf(\"the time before is %d:%d\\n\",hh,mm);\n snoozeCount++;\n if(mm<0)\n {\n temp=mm;\n //printf(\"the temp is %d\\n\",temp);\n\n mm=60+temp;\n hh--;\n if(hh<0)\n {\n hh=23;\n hourCount++;\n }\n }\n // printf(\"the time after is %d:%d\\n\",hh,mm);\n\n if(hh%10==7 || hh/10==7 || mm%10==7 || mm/10==7)\n {\n printf(\"%d\",snoozeCount);\n return;\n }\n\n }\n }\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "06819167f835e0c770daafabf86a88e0", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "236d34f27cbcb63b39a1d4bb9f8f68b0", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2729096989966555, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint main()\n{\n\tint n;\n\tscanf(\"%d\", &n);\n\tint a[n];\n\tfor (int i = 0; i < n; i++)\n\t{\n\t\tscanf(\"%d\", &a[i]);\n\t}\n\tint n1 = n * (n - 1) / 2;\n\tint st[n1];\n\tint k = 0;\n\tfor (int i = 0; i < n; i++)\n\t{\n\t\tfor (int j = i + 1; j < n; j++)\n\t\t{\n\t\t\tst[k] = abs(a[j] - a[i]);\n\t\t\tk++;\n\t\t}\n\t}\n\tint min = st[0];\n\tfor (int i = 0; i < n1; i++)\n\t{\n\t\tif (st[i] < min)\n\t\t\tmin = st[i];\n\t}\n\tint kt = 0;\n\tfor (int i = 0; i < n1; i++)\n\t{\n\t\tif (((st[i] / min) > 2) || ((st[i] % min) != 0))\n\t\t\tkt++;\n\t}\n\tif (kt == 0)\n\t\tprintf(\"%d\", min);\n\telse\n\t\tprintf(\"%d\", -1);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "84d0a9a7cca98de7ffaaa24f546507a6", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "97be97645db6d04ee28b4e2befe414dd", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.353584447144593, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\n#define MDI 1000000009\n#define MOD(a) ((a) % MDI)\ntypedef long long LL;\n\nvoid putlld(LL a)\n{\n if(a > 9)\n putlld(a / 10);\n putchar((a % 10) + '0');\n}\n\nint main(void)\n{\n int i, j, k;\n LL h = 0, g, n, f, t;\n scanf(\"%d\", &n);\n n /= 2;\n t = n - 2;\n for(i = 0; i < t; i++){\n f = t - i;\n g = MOD(MOD(2 << (f + 1) - 1) << 2);\n h = MOD(4 + h + MOD(g << 2) + MOD(h * g));\n }\n if(n > 1)\n h = MOD(4 + h);\n h = MOD(MOD(MOD(h * h) + 5 + MOD(h << 2) << 1));\n putlld(h);\n putchar('\\n');\n return 0;\n}\n\n#undef WERTYUIOPASDFGHJKLZXCVBN\n#ifdef WERTYUIOPASDFGHJKLZXCVBN\n/*\n * it starts and ends in the same place \u2014 the granny's house;\n * the route goes along the forest paths only (these are the segments marked black in the picture);\n * the route has positive length (to step out for a breath of fresh air Peter has to cover some distance anyway);\n * the route cannot cross itself;\n * there shouldn't be any part of dense forest within the part marked out by this route; \n I:\n 2\n O:\n 10\n I:\n 4\n O:\n 74\n */\n#endif\n", "lang": "GNU C", "bug_code_uid": "05490d59b193ff7a12211d5ba10012e4", "src_uid": "dbcb1077e7421554ba5d69b64d22c937", "apr_id": "1fac49f9b856385be5e694b2b33b4dfb", "difficulty": 2600, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8488852188274154, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n\n#define MDI 1000000009\n#define MOD(a) ((a) % MDI)\n#define MOO(a) ((a) > 0 ? (a) % MDI : MDI + (a))\n#define LL long long\n\nvoid putlld(LL a)\n{\n if(a > 9)\n putlld(a / 10);\n putchar(a % 10 + '0');\n}\n\nint nn[600000];\n\nint main(void)\n{\n int i, j, k;\n LL h = 0, g, n, f, t;\n scanf(\"%d\", &n);\n t = (n >> 1) - 1;\n for(j = 0, nn[0] = 4; j < t - 1; j++)\n nn[j + 1] = MOD(nn[j] << 1);\n for(i = t - 1; i >= 0; i--){\n g = MOD(nn[i] - 4);\n h = MOD(4 + h + MOD(g << 2) + MOD(h * g));\n }\n h = MOD(MOD(MOD(h * h) + 5 + MOD(h << 2) << 1));\n putlld(h);\n putchar('\\n');\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "41a472a0c032d168e486ca73473d1ba2", "src_uid": "dbcb1077e7421554ba5d69b64d22c937", "apr_id": "1fac49f9b856385be5e694b2b33b4dfb", "difficulty": 2600, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5426356589147286, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint a[100],i,j,max,h,l,n,b;\nint main()\n{\nFILE *fin,*fout;\n\nfin=fopen(\"garden.in\",\"r\");\nfscanf(fin,\"%d\",&n);\nfscanf(fin,\"%d\",&l);\nfor(i=0;imax) max=b;\ni++;\n}\nh=l/max;\nfout=fopen(\"garden.out\",\"w\");\nfprintf(fout,\"%d\",h);\n fclose(fout);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "241f811a57bad59c7cd1160afcca7a95", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "2751467d06c7617d2abfa28112c76520", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.053163609135155374, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\nint solvemin(int m1,int m,int s){\n\tint temp,temp1,res1,min,iffound=0,m_save=m-1;\n\tif(m==0){\n\t\tif(s>0){\n\t\t\treturn -1;\n\t\t}\n\t\tif(s==0){\n\t\t\treturn 0;\n\t\t}\n\t}else if(m>0){\n\t\tif(m1==m){\n\t\t\tfor(temp=1;temp<10;temp++){\n\t\t\t\tmin = temp;\n\t\t\t\tres1=solvemin(m1,m-1,s-temp);\n\t\t\t\tif(res1!=-1){\n\t\t\t\t\tint i=0;\n\t\t\t\t\tm_save=m-1;\n\t\t\t\t\twhile(m_save>0){\n\t\t\t\t\t\tmin=min*10;\n\t\t\t\t\t\tm_save--;\n\t\t\t\t\t\t//printf(\"%d %d\\n\",min,m); \n\t\t\t\t\t}\n\t\t\t\t\tmin = min+res1;\n\t\t\t\t\tiffound=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(iffound==1){\n\t\t\t\treturn min;\n\t\t\t}else{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}else{\n\t\t\tfor(temp=0;temp<10;temp++){\n\t\t\t\tmin = temp;\n\t\t\t\tres1=solvemin(m1,m-1,s-temp);\n\t\t\t\tif(res1!=-1){\n\t\t\t\t\tint i=0;\n\t\t\t\t\tm_save=m-1;\n\t\t\t\t\twhile(m_save>0){\n\t\t\t\t\t\tmin=min*10;\n\t\t\t\t\t\tm_save--;\n\t\t\t\t\t\t//printf(\"%d %d\\n\",min,m); \n\t\t\t\t\t}\n\t\t\t\t\tmin = min+res1;\n\t\t\t\t\tiffound=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(iffound==1){\n\t\t\t\treturn min;\n\t\t\t}else{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n}\nint solvemax(int m1,int m,int s){\n\tint temp,temp1,res1,min,iffound=0,m_save=m-1;\n\tif(m==0){\n\t\tif(s!=0){\n\t\t\treturn -1;\n\t\t}\n\t\tif(s==0){\n\t\t\treturn 0;\n\t\t}\n\t}else if(m>0){\n\t\tif(s==0){\n\t\t\treturn 0;\n\t\t}else{\n\t\t\tfor(temp=9;temp>0;temp--){\n\t\t\t\tmin = temp;\n\t\t\t\tres1=solvemax(m1,m-1,s-temp);\n\t\t\t\tif(res1!=-1){\n\t\t\t\t\tint i=0,res_save=res1;\n\t\t\t\t\twhile(m_save>0){\n\t\t\t\t\t\tmin=min*10;\n\t\t\t\t\t\tm_save--;\n\t\t\t\t\t}\n\t\t\t\t\tmin = min+res1;\n\t\t\t\t\tiffound=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(iffound==1){\n\t\t\t\treturn min;\n\t\t\t}else{\n\t\t\t\treturn -1;\n\t\t\t}\n\t }\n\t}\n}\nmain(){\n\tint s,m,temp,temp1,res1,res2;\n\tscanf(\"%d %d\",&m,&s);\n\tif(s>0){\n\t\tres1 = solvemin(m,m,s);\n\t\tres2 = solvemax(m,m,s);\n\t\tprintf(\"%d %d\",res1,res2);\n\t}else{\n\t\tprintf(\"-1 -1\");\n\t}\n}", "lang": "GNU C", "bug_code_uid": "d3324f882d9d6717ae11a3a946b31bf8", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "2d86f8bee68e3f95ad5220bef3126b78", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9868329868329868, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n\tint n,cp,sum1,sum2,i;\n\tsum1=0,sum2=0;\n\tscanf(\"%d%d\",&n,&cp);\n\tint a[n+2],b[n+2],c[n+2],d[n+2];\n\tfor(i=0;i=0;i++)\n\t{\n\t\td[i]=d[i]+d[i+1];\n\t}\n\tfor(i=0;i0)\n\t\t{\n\t\t\tsum1=sum1+a[i]-cp*b[i];\n\t\t}\n\t}\n//\tprintf(\" sum is %d\",sum1);\n\n for(i=n-2;i>=0;i++)\n {\n if(a[i]-cp*d[i]>0)\n {\n \tsum2=sum2+a[i]-cp*d[i];\n\t }\n }\n // \tprintf(\"sum2 is %d\",sum2);\n\tif(sum1>sum2)\n\t{\n\t\tprintf(\"Limak\\n\");\n\t}\n\tif(sum2>sum1)\n\t{\n\t\tprintf(\"Radewoosh\\n\");\n\t}\n\tif(sum1==sum2)\n\t{\n\t\tprintf(\"Tie/n\");\n\t} \n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ffd3c8a11ea3574fde274c3016d26862", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "e2044ea5725042ee4557a1d22cd33b77", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1281864530225783, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint main() {\n /*two integers read into a char array!*/\n char a[10];\n char b[10];\n scanf(\"%s\",a);\n scanf(\"%s\",b);\n int na=strlen(a);\n int nb=strlen(b);\n int i,j,k;\n for(k=0;knb) {\n i=na-1;\n j=nb-1;\n } else {\n i=nb-1;\n j=na-1;\n }\n int last_more10=0;\n while(1) {\n /*\u6ca1\u6709\u8fdb\u4f4d\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u76f8\u540c\uff0c\u8fd9\u662f\u5728\u6709\u96f6\u7684\u60c5\u51b5\u4e0b\u6210\u7acb*/\n if(a[i]+b[j]>=10){\n more10=1;\n if(j==0) { last_more10=1; break; }\n else a[i-1]+=(a[i]+b[j])/10;\n }\n i--;\n j--;\n }\n\n if(find_zero) {\n if(more10) printf(\"NO\\n\");\n else printf(\"YES\\n\");\n }else {\n if(last_more10) {\n printf(\"NO\\n\");\n } else printf(\"YES\\n\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8ff5cfac375f673347e6d213f9a6b134", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "43a9c182c7832bbe6671435a62d19ff0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22964763061968407, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nint main()\n{\n int i, i1, i2, i3, n, x1, x2, x3, k1, k2, k3, flag;\n\n scanf(\"%d %d %d\", &k1, &k2, &k3);\n n = k1 + k2 + k3;\n\n for (i1 = 1; i1 < n; i1++){\n for (i2 = 1; i2 < n; i2++){\n for (i3 = 1; i3 < n; i3++){\n x1 = i1;\n x2 = i2;\n x3 = i3;\n i = 1;\n flag = 1;\n while ((i < n) && (flag == 1)){\n if ((i != x1) && (i != x2) && (i != x3))\n {\n flag = 0;\n }\n else {\n if (i == x1) x1 = x1 + k1;\n if (i == x2) x2 = x2 + k2;\n if (i == x3) x3 = x3 + k3;\n }\n i++;\n }\n if (flag == 1){\n printf(\"YES\");\n return 0;\n }\n }\n }\n }\n\n printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "2c3a6138145140d8f091c7d74f20575a", "src_uid": "df48af9f5e68cb6efc1214f7138accf9", "apr_id": "e6de12640a80c402815697c3c226dc66", "difficulty": 1400, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9290617848970252, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n#include\nmain()\n{\nint h, r, ans;\nscanf(\"%d\",&r);\nscanf(\"%d\",&h);\nans = 2*h/r;\nans += ((2*m>=r)?2:1)\nans += ((2.0*m>=(sqrt(3.0)*r))?1:0);\nprintf(\"%d\",ans);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "37c8f2a0c0fdd74c87242091681e9173", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "00a815b85a4a4f953e0c4e54dbe6fd70", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9503394069310468, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#define QLEN 6400007\n\nint n,ans,D[35];\n\nint q[6400010][5],head,tail;\nshort vis[410][410][8][2];\nshort MAP[410][410];\n\nshort dir[8][2] = {-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1,-1,-1};\n\nvoid add(int i,int j,int k,int d,int now)\n{\n if(vis[i][j][k][d&1]) return;\n vis[i][j][k][d&1] = 1; MAP[i][j] = 1;\n q[tail][0] = i; q[tail][1] = j; q[tail][2] = k; q[tail][3] = d; q[tail++][4] = now;\n if(tail > QLEN) tail = 1;\n}\n\nvoid bfs(int SI,int SJ)\n{\n int i,j,k,d,now;\n int ii,jj,kk;\n head = 1; tail = 1;\n add(SI,SJ,0,D[1],1);\n \n while(head != tail)\n {\n i = q[head][0]; j = q[head][1]; k = q[head][2];\n d = q[head][3] - 1; now = q[head++][4];\n if(d != D[now+1])\n {\n ii = i+dir[k][0]; jj = j+dir[k][1];\n add(ii,jj,k,d,now);\n }\n else\n {\n if(now == n) continue;\n kk = (k+7)%8; ii = i+dir[kk][0]; jj = j+dir[kk][1];\n add(ii,jj,kk,D[now+1],now+1);\n kk = (k+1)%8; ii = i+dir[kk][0]; jj = j+dir[kk][1];\n add(ii,jj,kk,D[now+1],now+1);\n }\n if(head > QLEN) head = 1;\n }\n}\n\nint main()\n{\n int i,j;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++) scanf(\"%d\",&D[i]);\n for(i=n-1;i;i--) D[i] += D[i+1];\n \n bfs(200,200);\n for(i=1;i<=400;i++) for(j=1;j<=400;j++) if(MAP[i][j]) ans++;\n printf(\"%d\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "6aba064b8733d845d54c4d0d09743160", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "a2a96faf60c93b9da24ac3b89a2910cf", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5631213655974489, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "#include\n\nstatic char sky[400][400];\nint n, mas[30], k;\n\nvoid draw(int i, int a, int x, int y){\n\tk = mas[i - 1];\n\twhile (k){\n\t\tk--;\n\t\tsky[y][x] = 1;\n\t\tif (k){\n\t\t\tif (a == 1){\n\t\t\t\ty++;\n\t\t\t} else if (a == 2){\n\t\t\t\tx++;\n\t\t\t\ty++;\n\t\t\t} else if (a == 3){\n\t\t\t\tx++;\n\t\t\t} else if (a == 4){\n\t\t\t\tx++;\n\t\t\t\ty--;\n\t\t\t} else if (a == 5){\n\t\t\t\ty--;\n\t\t\t} else if (a == 6){\n\t\t\t\tx--;\n\t\t\t\ty--;\n\t\t\t} else if (a == 7){\n\t\t\t\tx--;\n\t\t\t} else if (a == 8){\n\t\t\t\tx--;\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\tif (i < n){\n\t\tif (a == 1){\n\t\t\tdraw(i + 1, 8, x - 1, y + 1);\n\t\t\tdraw(i + 1, 2, x + 1, y + 1);\n\t\t} else if (a == 2){\n\t\t\tdraw(i + 1, 1, x, y + 1);\n\t\t\tdraw(i + 1, 3, x + 1, y);\n\t\t} else if (a == 3){\n\t\t\tdraw(i + 1, 2, x + 1, y + 1);\n\t\t\tdraw(i + 1, 4, x + 1, y - 1);\n\t\t} else if (a == 4){\n\t\t\tdraw(i + 1, 3, x + 1, y);\n\t\t\tdraw(i + 1, 5, x, y - 1);\n\t\t} else if (a == 5){\n\t\t\tdraw(i + 1, 4, x + 1, y - 1);\n\t\t\tdraw(i + 1, 6, x - 1, y - 1);\n\t\t} else if (a == 6){\n\t\t\tdraw(i + 1, 5, x, y - 1);\n\t\t\tdraw(i + 1, 7, x - 1, y);\n\t\t} else if (a == 7){\n\t\t\tdraw(i + 1, 6, x - 1, y - 1);\n\t\t\tdraw(i + 1, 8, x - 1, y + 1);\n\t\t} else if (a == 8){\n\t\t\tdraw(i + 1, 7, x - 1, y);\n\t\t\tdraw(i + 1, 1, x, y + 1);\n\t\t}\n\t}\n}\n\nint main(void)\n{\n\tfor (int i = 0; i < 400; i++){\n\t\tfor (int j = 0; j < 400; j++){\n\t\t\tsky[i][j] = 0;\n\t\t}\n\t}\n\tscanf(\"%d\", &n);\n\tfor (int i = 0; i < n; i++){\n\t\tscanf(\"%d\", &mas[i]);\n\t}\n\tdraw(1, 1, 200, 200);\n\tint rez = 0;\n\tfor (int i = 0; i < 400; i++){\n\t\tfor (int j = 0; j < 400; j++){\n\t\t\t//printf(\"%d\", sky[i][j]);\n\t\t\trez += sky[i][j];\n\t\t}\n\t\t//printf(\"\\n\");\n\t}\n\tprintf(\"%d\", rez);\n}\n", "lang": "GNU C", "bug_code_uid": "028dc57d9ef354ead85c11e635f2906a", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "ebf31317da1891335e5960f4d2528f26", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9910714285714286, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include \nint M(int a,int b)\uff5b\nreturn a>b?a:b;\n\uff5d\nint main()\uff5b\nint a,b,c,d,e,f;\nscanf(\"%d %d %d %d %d %d\",&a,&b,&c,&d,&e,&f);\nint x;\nif(c\n#include \n\nint main()\n{\n int i,j,arr[4][3];\n for(i = 0;i < 3;i++){\n for(j = 0;j < 2;j++){\n scanf(\"%d\",&arr[i][j]);\n }\n }\n if(arr[0][0] * arr[0][1] < arr[1][0] * arr[1][1] + arr[2][0] * arr[2][1]){\n printf(\"NO\");\n return 0;\n }\n\n if(arr[1][0] + arr[2][0] < arr[0][0] && arr[1][1] <= arr[0][1] && arr[2][1] <= arr[0][1] ){\n printf(\"YES\");\n }\n else if(arr[1][0] + arr[2][1] < arr[0][0] && arr[1][1] <= arr[0][1] && arr[2][0] <= arr[0][1]){\n printf(\"YES\");\n }\n else if(arr[1][1] + arr[2][0] < arr[0][0] && arr[1][0] <= arr[0][1] && arr[2][1] <= arr[0][1]){\n printf(\"YES\");\n }\n else if(arr[1][1] + arr[2][1] < arr[0][0] && arr[1][0] <= arr[0][1] && arr[2][0] <= arr[0][1]){\n printf(\"YES\");\n }\n else if(arr[1][0] + arr[2][0] < arr[0][1] && arr[1][1] <= arr[0][0] && arr[2][1] <= arr[0][0]){\n printf(\"YES\");\n }\n else if(arr[1][0] + arr[2][1] < arr[0][1] && arr[1][1] <= arr[0][0] && arr[2][0] <= arr[0][0]){\n printf(\"YES\");\n }\n else if(arr[1][1] + arr[2][0] < arr[0][1] && arr[1][0] <= arr[0][0] && arr[2][1] <= arr[0][0]){\n printf(\"YES\");\n }\n else if(arr[1][1] + arr[2][1] < arr[0][1] && arr[1][0] <= arr[0][0] && arr[2][0] <= arr[0][0]){\n printf(\"YES\")\n }\n else{\n printf(\"NO\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b15b3ac3d3c53fa593e6a066ae93fff0", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "a057eeb6c9dcbe35a1ba7ace87a7aee8", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5301724137931034, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\nint ar[4],i,j,ch,tst=0,k;\nfor(i=0;i<4;i++){\n scanf(\"%d\",&ar[i]);\n}\nfor(i=0;i<4;i++){\n for(j=0;j<4-i;j++){\n\tif((ar[j])>(ar[j+1]))\n\t{ ch=(ar[j]);\n\t ar[j] =(ar[j+1]);\n\t ar[j+1]=ch;}\n\t }}\nif(ar[1]+ar[2]==ar[3]){\n printf(\"SEGMENT\");\n return 0;\n}\nelse if(ar[1]+ar[2]ar[3])\n{\n printf(\"TRIANGLE\");\n return 0;\n}\n\n}\n", "lang": "GNU C", "bug_code_uid": "26d134a71467f54dbf6d858fff0ccf67", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "be0b0ae4ea89992bf9d15d9cb9ea9b23", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1225756400310318, "equal_cnt": 45, "replace_cnt": 31, "delete_cnt": 5, "insert_cnt": 9, "fix_ops_cnt": 45, "bug_source_code": "#include \n#include \n#define TRUE 1\n#define FALSE 0\n\ntypedef struct NODO{\n int Elemento;\n struct NODO *sgt;\n}nodo;\n\nnodo* crearNodo(int dato){\n nodo *aux;\n\taux=(nodo *)malloc(sizeof (nodo));\n\taux->Elemento=dato;\n\taux->sgt=NULL;\n\treturn aux;\n}\n\nint esVacio(nodo *cabeza){\n if(cabeza==NULL){\n return TRUE;\n }\n return FALSE;\n}\n\nvoid insertarPrimero(int dato,nodo **cabeza){\n nodo *aux;\n if(esVacio(*cabeza)){\n aux=crearNodo(dato);\n }else{\n aux=crearNodo(dato);\n aux->sgt=*cabeza;\n }\n\t*cabeza=aux;\n}\n\nint desApilar(nodo **cabeza){\n int dato;\n nodo *aux=*cabeza;\n dato = aux->Elemento;\n *cabeza=aux->sgt;\n\tfree(aux);\n return dato;\n}\n\nint desEncolar(nodo **cabeza){\n int dato;\n nodo *aux=*cabeza;\n if(aux->sgt){\n\t\twhile(aux->sgt->sgt!=NULL){\n aux=aux->sgt;\n }\n dato=aux->sgt->Elemento;\n free(aux->sgt);\n aux->sgt=NULL;\n }else{\n dato=aux->Elemento;\n\t\tfree(aux);\n *cabeza=NULL;\n }\n return dato;\n}\n\nvoid imprimirLista(nodo *cabeza){\n nodo *aux;\n\taux=cabeza;\n if(!esVacio(aux)){\n while (aux!=NULL){\n printf(\"%d\\n\",aux->Elemento);\n aux=aux->sgt;\n }\n }else{\n printf(\"La lista esta vacia\\n\");\n\t}\n printf(\"\\n\");\n}\n\nint main()\n{\n char numero[200],dato,dato1,dato2;\n int fin,pos,ok,num1,num2,left_bigger,right_bigger,eq_bigger,digitos;\n nodo *cola1=NULL;\n nodo *cola2=NULL;\n nodo *pila1=NULL;\n nodo *pila2=NULL;\n fin=0;\n while(fin==0)\n {\n scanf(\"%d\",&digitos);\n digitos=digitos;\n scanf(\"%s\",&numero);\n\n pos=0;\n while(numero[pos]!='\\n'&&numero[pos]!='\\0')\n {\n dato = (numero[pos]);\n insertarPrimero(dato,&cola1);\n insertarPrimero(dato,&pila1);\n //insertarPrimero(dato,&cola2);\n //insertarPrimero(dato,&pila2);\n pos++;\n }\n\n eq_bigger = 0;\n left_bigger = 0;\n right_bigger = 0;\n printf(\"d1, d2, L E R\\n\");\n while(cola1!=NULL)\n {\n dato1=desEncolar(&cola1);\n dato2=desApilar(&pila1);\n /*num1=dato1-'0';\n num2=dato2-'0';\n */\n if(dato1 > dato2)\n {\n left_bigger++;\n }else if(dato1 < dato2){\n right_bigger++;\n }else{\n eq_bigger++;\n }\n printf(\"%c, %c, %d, %d, %d\\n\",dato1,dato2,left_bigger,eq_bigger,right_bigger);\n dato1=desEncolar(&pila1);\n dato2=desApilar(&cola1);\n\n }\n\n if(left_bigger>right_bigger && left_bigger>eq_bigger)\n {\n printf(\"YES\");\n }else if(left_biggereq_bigger)\n {\n printf(\"YES\");\n }else{\n printf(\"NO\");\n }\n\n //scanf(\"%d\",&fin);\n}\n return 0 ;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "ed8527a259dfa626eb671e4d0a3d4a19", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "dc0a55a34bcf7b2c26e5f1d8ae0b1e52", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.26102292768959434, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "#include \n\nint main(){\n int l,t;\n scanf(\"%d%d\",&l,&t);\n char que[l];\n scanf(\"%s\",que);\n while(t--){\n for(int i=0; i\n#include\n#include\n#include \n#include\nusing namespace std;\n#define Max 100010\nqueueq;\nint fa[Max],t,num[Max],du[Max];\nbool vis[Max],inStack[Max];\nstacks,temp;\nvectorg[Max],dg[Max];\nbool haveCrcle(int n)\n{\n\tbool ans=false;\n\tint u;\n\twhile(!s.empty())\n\t{\n\t\tu=s.top();\n\t\tif(!du[u])\n\t\tq.push(u);\n\t\ttemp.push(u);\n\t\ts.pop();\n\t}\n\tint cunt=0;\n\twhile(!q.empty())\n\t{\n\t\tu=q.front();\n\t\tcunt++;\n\t\tq.pop();\n\t\tfor(int i=0;i\n#include \n\nint max(int a[], int n) {\n\tint max, maxKey, i;\n\n\tmax = 0;\n\n\tfor(i = 0; i < n; i++) {\n\t\tif(max < a[i]) {\n\t\t\tmax = a[i];\n\t\t\tmaxKey = i;\n\t\t}\n\t}\n\n\treturn maxKey;\n}\n\nint getOverlapCount(char s1[], char s2[]) {\n\tint i, c, overlapCount;\n\n\toverlapCount = 0;\n\n\tfor(i = 0; s1[i] != '\\0' && s2[i] != '\\0'; i++) {\n\t\tif(s1[i] == s2[i]) overlapCount++;\n\t}\n\n\treturn overlapCount;\n}\n\nint main(void) {\n\tchar input[10];\n\tint letterCount;\n\tchar* possibleSolutions[8] = {\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"};\n\tint overlaps[8] = { 0 };\n\tint i;\n\n\tscanf(\"%d\", &letterCount);\n\tscanf(\"%s\", input);\n\n\tfor(i = 0; i < 8; i++) {\n\t\tif(strlen(possibleSolutions[i]) == letterCount) {\n\t\t\toverlaps[i] = getOverlapCount(input, possibleSolutions[i]);\n\t\t}\n\t}\n\n\tprintf(\"%s\", possibleSolutions[max(overlaps, 8)]);\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "632f76dda7905650717f83be94b690f9", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "10f0aae002b54f0fba8d15390f53ee48", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8247162673392182, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \nint main(void) {\n int n, d, fp, cp=1,jumps=0,j;\n\tchar *path;\n\tscanf(\"%d %d\",&n,&d);\n\tgetchar();\n\tpath = (char*)calloc(n,sizeof(n));\n\tscanf(\"%s\",path);\n\tfor(fp=n;fp>1 && cp!=n;fp--){\n\t\tif(path[fp-1]=='1'){\n\t\t\tfor(j=d;cp+j>fp;j--);\n\t\t\tif(cp+j==fp){\n\t\t\t\tcp=fp;\n\t\t\t\tjumps++;\n\t\t\t\tfp=n+1;\n\t\t\t}\n\t\t}\n\t}\n\tif(cp==n)\n\t\tprintf(\"%d\",jumps);\n\telse\n\t\tprintf(\"-1\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8b1678829da23a4023050bbc23d736c0", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "1d1d6e3e0152967122e9bc70258eede2", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7774054571565342, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint main(void)\n{\n int i, n, s, pos_c, pos_s, vel_c, win;\n char states[200], direction[10];\n\n scanf(\"%d%d%d%*s%s%s\", &n, &pos_s, &pos_c, direction, states);\n \n if (!strcmp(direction, \"head\")) vel_c = -1;\n else vel_c = 1;\n\n s = strlen(states);\n\n if (pos_s < pos_c) pos_s = 1;\n else pos_s = n;\n\n win = 0;\n\n for (i = 0; i < s; i++)\n {\n if (pos_c == pos_s) { win = 1; break; }\n if (pos_c == 1 && vel_c == -1) vel_c = 1;\n if (pos_c == n && vel_c == 1) vel_c = -1;\n \n if (states[i] == 0)\n {\n pos_c += vel_c;\n }\n else\n {\n if (pos_c < pos_s && vel_c == 1)\n pos_s = 1;\n if (pos_c > pos_s && vel_c == -1)\n pos_s = n;\n }\n }\n\n if (win)\n printf(\"Controller %d\\n\", i+1);\n else\n printf(\"Stowaway\\n\");\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "20ae32092afb5e9c85fe4f9e1ca95e6a", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "062ea55a7c9ead346cacd5ff75d00f3d", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.49795918367346936, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \nint main() {\n\tint n,m,k;\n\tint i;\n\tchar a[3],b[5];\n\tchar c[201];\n\tchar *p;\n\t// 1-> -1<-\n\tint d;\n\tscanf(\"%d %d %d\", &n, &m, &k);\n\tscanf(\"%s %s\",a,b);\n\tscanf(\"%s\", c);\n\n\tif(n==2){\n\t\tprintf(\"Controller 1\\n\");\n\t\treturn 0;\n\t}\n\n\tif(b[0] == 'h')\n\t\td = -1;\n\telse\n\t\td = 1;\n\n\tfor(p=c,i=1; *p!='\\0'; p++,i++) {\n\t\t// move stowaway\n\t\tint f = 0\n\t\tif(d == 1) {\n\t\t\tif(*p=='1'){\n\t\t\t\tif(k!=1)\n\t\t\t\t\tm = k-1;\n\t\t\t\telse\n\t\t\t\t\tm = k+2;\n\t\t\t} else if(m-k==1 && m!=n){\n\t\t\t\tm += 1;\n\t\t\t}\n\t\t\tf = 1;\n\t\t}else{\n\t\t\tif(*p=='1'){\n\t\t\t\tif(k!=n)\n\t\t\t\t\tm = k+1;\n\t\t\t\telse\n\t\t\t\t\tm = k-2;\n\t\t\t} else if(k-m==1 && m!=1){\n\t\t\t\tm -= 1;\n\t\t\t}\n\t\t}\n\n\t\t// move controller\n\t\tk += d;\n\t\tif(k == 1)\n\t\t\td = 1;\n\t\tif(k == n)\n\t\t\td = -1;\n\n\t\tif(k == m && f == 0){\n\t\t\tprintf(\"Controller %d\\n\",i);\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tprintf(\"Stowaway\\n\");\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "52595d4eb70f872726c43a5d5b1507b8", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "0d945e99b2e90fcbacd929d26babb66e", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8150873965041399, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "//http://codeforces.com/contest/569/problem/A\n\n#include \n#include \n\nint main(void){\n int i,j;\n int speed;\n int dur,already;\n int meet;\n int time=0;\n scanf(\"%d %d %d\",&dur,&already,&speed);\n while(1){\n time++;\n //remain=(dur-already)/(speed-1)*speed;//\ufffd\u0474X\ufffd\ufffdU\ufffd\ufffd\n meet=already*(speed/(speed-1));\n if(meet\n#define int long long int\nint main()\n{\n int a[14] ;\n int d[14];\n for(int i = 0; i<14;i++) scanf(\"%lld\",&a[i]);\n for(int i = 0; i<14;i++) d[i] = a[i];\n int c ; int c1 = 0; int c2 = 0;\n for(int i = 0; i<14;i++)\n {\n int b = a[i];\n if(b>0)\n {\n d[i] = 0;\n if(i!=13) c = i+1;\n else c = 0;\n for(int j = 1;j<=b;j++)\n {\n d[c] = d[c]+1;\n if(c!=13) c++;\n else c = 0;\n }\n }\n \n for(int j = 0; j<13; j++)\n {\n if(d[j]%2==0) c1 = c1+d[j];\n }\n \n if(c1>c2) c2 = c1 ;\n c1 = 0;\n for(int j = 0; j<14;j++) d[i] = a[i];\n }\n \n printf(\"%lld\",c2);\n}", "lang": "GNU C", "bug_code_uid": "23018fb31505174917c750e803b39815", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "f71ee1af1daf6325e4a1fe0db052294c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5285497726124305, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include \nint main()\n{\n long long int a[14] ;\n long long int d[14];\n for(long long int i = 0; i<14;i++) scanf(\"%lld\",&a[i]);\n for(long long int i = 0; i<14;i++) d[i] = a[i];\n long long int c ; long long int c1 = 0; long long int c2 = 0;\n for(long long int i = 0; i<14;i++)\n {\n long long int b = a[i];\n if(b>0)\n {\n d[i] = 0;\n if(i!=13) c = i+1;\n else c = 0;\n for(long long int j = 1;j<=b;j++)\n {\n d[c] = d[c]+1;\n if(c!=13) c++;\n else c = 0;\n }\n }\n\n for(long long int j = 0; j<14; j++)\n {\n if(d[j]%2==0) c1 = c1+d[j];\n }\n if(c1>c2) c2 = c1 ;\n c1 = 0;\n for(long long int j = 0; j<14;j++) d[j] = a[j];\n }\n printf(\"\\n%lld\",c2);\n}", "lang": "GNU C", "bug_code_uid": "70b6d11b635fb19bd3e924e675b64e40", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "f71ee1af1daf6325e4a1fe0db052294c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.653134328358209, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint main()\n{\n\t//code\n\tint a[14],c=0;\n\tfor(int i=0;i<14;i++)\n\t scanf(\"%d\",a+i);\n\tint b[14];\n\tfor(int i=0;i<14;i++)\n\t{\n\t if(a[i]==0) continue;\n\t for(int j=0;j<14;j++)\n\t b[j]=a[j];\n\t int m1=a[i]/14,m2=a[i]%14,s=0;\n\t b[i]=0;\n\t for(int j=0;j<14;j++)\n\t b[j]=b[j]+m1;\n\t int j=i;\n\t while(m2--)//do something\n\t {\n\t if(j==13) j=0;\n\t else j++;\n\t b[j]++;\n\t }\n for(j=0;j<14;j++)\n if(b[j]%2==0) s=s+b[j];\n if(s>c) c=s;\n\t}\n\tprintf(\"%d\",c);\n\treturn 0;\n}#include \n\nint main()\n{\n\t//code\n\tint a[14],c=0;\n\tfor(int i=0;i<14;i++)\n\t scanf(\"%d\",a+i);\n\tint b[14];\n\tfor(int i=0;i<14;i++)\n\t{\n\t if(a[i]==0) continue;\n\t for(int j=0;j<14;j++)\n\t b[j]=a[j];\n\t int m1=a[i]/14,m2=a[i]%14,s=0;\n\t b[i]=0;\n\t for(int j=0;j<14;j++)\n\t b[j]=b[j]+m1;\n\t int j=i;\n\t while(m2--)//do something\n\t {\n\t if(j==13) j=0;\n\t else j++;\n\t b[j]++;\n\t }\n for(j=0;j<14;j++)\n if(b[j]%2==0) s=s+b[j];\n if(s>c) c=s;\n\t}\n\tprintf(\"%d\",c);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "f041510f121a4fc994ecd2579185af6e", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "8372230e69f3e893ed3f41f920f9a5a5", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.08099688473520249, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \nchar slova[300000],ideU[36];\nint main()\n{\n int n,m,i,j;\n char p,c1,c2;\n scanf(\"%d%d\",&n,&m);\n scanf(\"%c\",&p);\n for (i=0;i\n#include\n#include\nchar s1[10],s2[10];\n#define ll long long \nint fact(int n); \n \nint nCr(int n, int r) \n{ \n return fact(n) / (fact(r) * fact(n - r)); \n} \n \n// Returns factorial of n \nint fact(int n) \n{ \n int res = 1; \n for (int i = 2; i <= n; i++) \n res = res * i; \n return res; \n} \n\nint main()\n{\n\tscanf(\"%s\",s1);\n\tscanf(\"%s\",s2);\n\tint tot,db=0;\n\tint p1=0,n1=0,p2=0,n2=0;\n\tfor(tot=0;s1[tot]!='\\0';tot++);\n\tdouble res=0;\n\tfor(int i=0;s1[i]!='\\0';i++)\n\t{\n\t\tif(s1[i]=='+')p1++;\n\t\telse if(s1[i]=='-')n1++;\n\n\t\tif(s2[i]=='+')p2++;\n\t\telse if(s2[i]=='-')n2++;\n\t\telse if(s2[i]=='?')db++;\n\t}\n\tif(p2>p1 || n2>n1) res=0;\n\telse{\n\t\tll div = (1<\nint main(){\n int x,y,z,a,b,c,andrew,dmitry,michal;\n scanf(\"%d %d %d\",x,y,z);\n scanf(\"%d %d %d\",a,b,c);\n if(((a+b+c)<(x+y+z))||(a\nint main() {\n int n,i,a[10] = {4,7,47,74,447,477,774,747,744};\n int count = 0;\n scanf(\"%d\",&n);\n for(i = 0; i < 10; i++) {\n if(n==a[i]||n%a[i]==0) {\n printf(\"YES\\n\");\n break;\n }\n else count++;\n }\n if(count == 10)\n printf(\"NO\\n\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "ab0d23019c64f53f3522834d2a66ab31", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "e56c2b030eb96dd682f4b0a0e571e4c2", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.38484848484848483, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "# include \n\nint arr[100002];\nvoid prime(){\n\tarr[1]=1;\n\tfor (long int i=2;i<100002;i++){\n\t\tif (arr[i]==0){\n\t\t\tarr[i]=i;\n\t\t\tfor (long int j=i*i;j<100002;j+=i){\n\t\t\t\tif (arr[j]==0) arr[j]=i;\n\t\t\t}\n\t\t}\n\t}\n}\n\nint main(void){\n\tprime();\n\tlong long int n,count=0;\n\tscanf(\"%lld\",&n);\n\twhile (n>=0){\n\t\tif (n==0) break;\n\t\tn-=arr[n];\n\t\tcount++;\n\t}\n\tprintf(\"%lld\\n\",count);\n\treturn 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "36b496c6ffed3aa74dd681f4fb8c261e", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "2c03b55bbc476befb0ce0a0e2c0deaba", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7812840043525572, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include \nint arr [1000000000];\nint main()\n{\n// printf(\"ertyg\");\n long long int n;\n scanf(\"%lld\",&n);\n if (n%2==0)\n {\n printf(\"%lld\",n/2);\n return 0;\n }\n for (long long int i=3;i<=n;i++)\n {\n// printf(\"%lld\",i);\n if (n%i==0)\n {\n n=n-i;\n// printf(\"%lld %lld \",i,n);\n break;\n }\n }\n printf(\"%lld\",n/2+1);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "88bc1026a0d8b03411f39db78f384d25", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "1aacd79670647cc47e47bceeba7fac1a", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9810771470160117, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int n,a,b[1001],i,m=0,r=0,count=0;\n scanf(\"%d%d\",&n,&a);\n for(i=1;i<=n;i++)\n {\n scanf(\"%d\",&b[i]);\n }\n if(a==1)\n {\n for(i=1;i<=n;i++)\n {\n if(b[i]==1)\n count++;\n }\n }\n else if(a==n)\n {\n for(i=n;i>=1;i--)\n {\n if(b[i]==1)\n count++;\n }\n }\n else\n {\n if(b[a]==1)\n count++;\n m=a-1;\n r=a+1;\n while(1)\n {\n if(m>=1 && r<=n)\n {\n if(b[m]==1 && b[r]==1)\n {\n count=count+2; \n }\n m--;\n r++;\n }\n else if(m==0 && r<=n)\n {\n if(b[r]==1)\n {\n count++;\n }\n r++;\n \n if(r==n+1)\n break;\n }\n else if(r==n+1 && m>=1)\n {\n \n if(b[m]==1)\n {\n count++;\n }\n m--;\n if(m==0)\n break;\n }\n \n }\n }\n printf(\"%d\",count);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "81f1f6828ef63c481ac25c76f73ff3b1", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "a30434a2e1421906055a0698092bf153", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.48255813953488375, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main()\n{\n int n, m, p = 0, i;\n int a[1000];\n\n scanf(\"%d\", &n);\n\n m = n;\n\n for (i = 2; i * i <= n; i++) {\n\t if (m % i == 0) {\n\t a[p++] = i;\n\n\t while (m % i == 0) m /= i;\n\t }\n }\n\n i = 0;\n\n while (n > 1) {\n\t printf(\"%d \", n);\n\n\t if (n % a[i] == 0) {\n\t n /= a[i];\n\t } else {\n\t n /= a[++i];\n\t }\n }\n\n puts(\"1\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3bdc38b7cef82f73db7022d7fdcc7078", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "3ae726c1dc2afb0c93125582a31e7fda", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8588293162813576, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "#include \n\n#define MD\t998244353\n\nvoid mult(int aa[][2], int bb[][2], int cc[][2]) {\n\tint i, j;\n\n\tfor (i = 0; i < 2; i++)\n\t\tfor (j = 0; j < 2; j++)\n\t\t\tcc[i][j] = ((long long) aa[i][0] * bb[0][j] + (long long) aa[i][1] * bb[1][j]) % MD;\n}\n\nvoid power(int aa[][2], int pp[][2], int tt[][2], long long k) {\n\tif (k == 0) {\n\t\tint i, j;\n\n\t\tfor (i = 0; i < 2; i++)\n\t\t\tfor (j = 0; j < 2; j++)\n\t\t\t\tpp[i][j] = i == j;\n\t\treturn;\n\t}\n\tif ((k & 1) == 0) {\n\t\tpower(aa, tt, pp, k / 2);\n\t\tmult(tt, tt, pp);\n\t} else {\n\t\tpower(aa, pp, tt, k / 2);\n\t\tmult(pp, pp, tt);\n\t\tmult(tt, aa, pp);\n\t}\n}\n\nint main() {\n\tstatic int aa[2][2], pp[2][2], tt[2][2];\n\tint n, m, l, r, e, o;\n\n\tscanf(\"%d%d%d%d\", &n, &m, &l, &r);\n\te = r / 2 - (l - 1) / 2, o = r - l + 1 - e;\n\taa[0][0] = e, aa[0][1] = o;\n\taa[1][0] = o, aa[1][1] = e;\n\tpower(aa, pp, tt, (long long) n * m);\n\tprintf(\"%d\\n\", pp[0][0]);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b4a5b069225ec2aed9b51713603f6874", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "apr_id": "40dd551d4f8f1d4b3a2daab36c049743", "difficulty": 2100, "tags": ["matrices", "math", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9228441754916793, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main()\n{\n int a[3],b[3],i,n0=0,d0=0,n=1,d=1;\n for (i=0; i<3; i++)\n {\n scanf(\"%d%d\",&a[i],&b[i]);\n d*=a[i];\n n*=b[i];\n }\n \n if (n > d || (c==0 && d!=0) || (a==0 && b!=0 && d!=0))\n printf(\"Ron\\n\");\n else\n printf(\"Hermione\\n\");\n\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "1399c7e9e9197c1837789443127abc80", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "afc37446662e4832fb99cc087f61485b", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9619095987811072, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\n#define ll long long\n\nll solve(ll a, ll b) {\n ll i,k = 0;\n int* factors = malloc(sizeof(int)*1000*1000);\n //record the smaller factors of a\n for (i = 1; i*i <= a; i++) {\n if (a%i == 0) {\n factors[k++] = i;\n // printf(\"factor of a:%lli\\n\", i);\n }\n }\n //for each smaller factor of a+b\n ll answer = 2*(a+b+1);\n for (i = 1; i*i <= a+b; i++) {\n if ((a+b)%i == 0) {\n // printf(\"factor of a+b:%lli\\n\", i);\n //binary search a factor of a that is smaller than or equal to i\n int found = 0;\n ll hi = k;\n ll lo = 1;\n ll middle = 0;\n while (!found) {\n middle = (lo + hi)/2;\n if (middle == lo || middle == hi) {\n break;\n } else if (factors[middle] < i) {\n lo = middle;\n } else if (factors[middle] > i) {\n hi = middle;\n } else { // middle = i\n found = 1;\n break;\n }\n }\n // printf(\"i found %lli for a, %lli for a+b\\n\", factors[middle],i);\n // printf(\"a/fact=%lli <= a+b/i=%lli?\\n\",a/factors[middle],(a+b)/i);\n if (a/factors[middle] <= (a+b)/i) {\n if (answer > 2*(i + (a+b)/i)) {\n answer = 2*(i + (a+b)/i);\n // printf(\"NEW answer: %lli\\n\", answer);\n }\n }\n }\n }\n return answer;\n}\n\nint main(int argc, char* argv[]) {\n ll a,b = 0;\n scanf(\"%lli %lli\",&a,&b);\n // printf(\"%lli + %lli = %lli\\n\", a, b, a+b);\n ll answer_a = solve(a,b);\n ll answer_b = solve(b,a);\n if (answer_a < answer_b) {\n printf(\"%lli\\n\", answer_a);\n } else {\n printf(\"%lli\\n\", answer_b);\n\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f6926b92df72104c2f3b37265dc3aa97", "src_uid": "7d0c5f77bca792b6ab4fd4088fe18ff1", "apr_id": "120aef3cb72bb802ba2f4609749338e2", "difficulty": 2000, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9910979228486647, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n\n{\n int a,b,g,n,s;\n scanf(\"%d%d%d\", &b,&g,&n);\n if(b>=g)\n a=g;\n else a=b;\n s=b+g-n;\n if(s==0)\n printf(\"1\\n\");\n else if(s>=a)\n {\n if(a+1>=n+1)\n printf(\"%d\\n\", n+1);\n else\n printf(\"%d\\n\", a+1);\n \n }\n else\n printf(\"%d\\n\", s+1);\n return 0\n}", "lang": "GNU C11", "bug_code_uid": "fe295b5faf4f0d5d584c1f542d35c9a2", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "472927efce3e414eccaa6c587b199fd2", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.40216550657385924, "equal_cnt": 32, "replace_cnt": 18, "delete_cnt": 9, "insert_cnt": 5, "fix_ops_cnt": 32, "bug_source_code": " #include\n \n int main(){\n long long int a,b,c;\n scanf(\"%lld %lld %lld\",&a,&b,&c);\n if(a==0 && b==0 && c==0){\n printf(\"0\");\n \n \n }\n else{\n long long int d=c-a;\n long long int e=c-b;\n if(ab && c>b && b\nint dp[200][101][101][11][11];\nint n1, n2, k1, k2;\nint call(int i, int x, int y, int x1, int y1)\n{\n\tif(i>=(n1+n2)) return 1;\n\tif(dp[i][x][y][x1][y1]==-1){\n\t\tint r=0;\n\t\tif(x1\n#include \n#include\n#include\n#define display(s,i) printf(#s #i \"=%d\",s##i)\n#define ll long long\nll f,h,n1,n2;\nconst long long mod=1e8;\nll dp[102][11][102][11];\nll result(ll f1,ll a, ll h1, ll b)\n{\n if(f1==0 && h1==0) return 1;\n if(dp[f1][a][h1][b]!=-1) return dp[f1][a][h1][b];\n ll c=0,d=0,e=0,f=0;\n if(f1 && a) c=result(f1-1,a-1,h1,n2);\n if(h1 && b) d=result(f1,n1,h1-1,b-1);\n return dp[f1][a][h1][b]=(c+d)%mod;\n}\nll main(ll argc, char *argv[])\n{\n memset(dp,-1,sizeof dp);\n scanf(\"%d%d%d%d\",&f,&h,&n1,&n2);\n ll ans=result(f,n1,h,n2);\n printf(\"%d\",ans%mod);\n}\n", "lang": "GNU C11", "bug_code_uid": "46c03023409ef8b54b7aa0b3213aa3c9", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "70b56bb0089be569b964ff269eb2caa5", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.10848400556328233, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "#include \n\nint main()\n{\n\tint i;\n\tlong long a;\n\tlong long b;\n\tlong long n;\n\tlong long p;\n\tlong long q;\n\tlong long s;\n\n\tscanf(\"%lld\", &n);\n\tscanf(\"%lld\", &a);\n\tscanf(\"%lld\", &b);\n\tscanf(\"%lld\", &p);\n\tscanf(\"%lld\", &q);\n\n\ts = 0;\n\tfor (i = 1; i <= n; i++)\n\t{\n\t\tif ((i % a == 0) && (i % b != 0))\n\t\t\ts += p;\n\t\t\n\t\telse if ((i % a != 0) && (i % b == 0))\n\t\t\ts += q;\n\n\t\telse if ((i % a == 0) && (i % b == 0))\n\t\t\ts += (p > q ? p : q);\n\n\t}\n\n\n\tprintf(\"%lld\\n\", s);\n\n\treturn 0;\n}\n\n/* 1512997955108 */\n", "lang": "GNU C", "bug_code_uid": "fa158365e81b08b57d0ff6eb366e818a", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "0e9f7567f05b21560e51b98dd443a6c5", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6666666666666666, "equal_cnt": 15, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{ int n,t;\n \n scanf(\"%d\",n);\n t=(1-6^n)/(1-6);\n printf(\"%d\",t);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b18dad7c30d1c582c0e548c0dd09898b", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "fbd492203ea183c5f51317adf01e6cc4", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9685314685314685, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n\twhile(1)\n\t{\n\t\tint n;\n\t\tscanf(\"%d\",&n);\n\t\tint j=n;\n\t\tif(n>=0)\n\t\t\tprintf(\"%d\\n\",n);\n\t\telse if(n>=-10 && n<0)\n\t\t\tprintf(\"0\\n\");\n\t\telse\n\t\t{\n\t\t\tn=n*(-1);\n\t\t\tint a=n%10;\n\t\t\tn=n/10;\n\t\t\tint b=n%10;\n\t\t\tn=n/10;\n\t\t\tif(a>b)\n\t\t\t{\n\t\t\t\tif(j<=-10 && j>=-99)\n\t\t\t\t{\n\t\t\t\t\tif(b==0)\n\t\t\t\t\t\tprintf(\"0\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tprintf(\"-%d\\n\",b);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tprintf(\"-%d%d\\n\",n,b);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(j<=-10 && j>=-99)\n\t\t\t\t{\n\t\t\t\t\tif(a==0)\n\t\t\t\t\t\tprintf(\"0\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tprintf(\"-%d\\n\",a);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tprintf(\"-%d%d\\n\",n,a);\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "16657b7b5ff147888429de7bbebcd3e8", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "b4ba909c47ecaff67cc00b0502bbd6f7", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9375, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n\n#define F(I) for(int i=0;i\nint main()\n{\n\tlong t,k,n;\n\twhile(~scanf(\"%ld%ld%ld\",&n,&k,&t)){\n\t\tif(t<=k){\n\t\t\tprintf(\"%ld\\n\",t);\n\t\t}\n\t\telse if(t<=n){\n\t\t\tprintf(\"%ld\\n\",k);\n\t\t}\n\t\telse{\n\t\t\tprintf(\"%ld\\n\",2*n-k-t);\n\t\t}\n\t}", "lang": "GNU C", "bug_code_uid": "ddc46c8b4db101edbca33d2b950ae6ad", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "8733e98cb92efde2630b28fc1222920f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9437570303712036, "equal_cnt": 13, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 13, "fix_ops_cnt": 13, "bug_source_code": "#include\n#include\nchar s[8][9]={\"WBWBWBWB\",\"BWBWBWBW\",\"WBWBWBWB\",\"BWBWBWBW\",\"WBWBWBWB\",\"BWBWBWBW\",\"WBWBWBWB\",\"BWBWBWBW\"};\nint test(char s[],char x[]);\nmain()\n{\n //freopen(\"input\",\"r\",stdin);\n int i,j,k,l=0,t;\n char x[12][12];\n for(i=0;i<8;i++)\n scanf(\"%s\",x[i]);\n for(i=0;i<8;i++)\n {\n t=test(x[i],s[i]);\n if(t)\n l++;\n }\n if(l==8)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n\n return 0;\n}\nint test(char x[],char s[])\n{\n int i,j,k,l=0,pos;\n for(i=0;i<8;i++)\n {\n if(s[0]==x[i])\n {\n pos=i;\n break;\n }\n }\n for(i=pos,j=0;i<8;i++,j++)\n {\n if(s[i]==x[j])\n l++;\n }\n for(i=0;i\n\nvoid solve()\n{\n unsigned long long a, b, c, i;\n scanf(\"%llu %llu\", &a, &b);\n c = (a+b)*(a-b);\n for(i=2; i*i<=c; i++)\n {\n if(c%i==0)\n {\n printf(\"NO\\n\");\n return;\n }\n }\n printf(\"YES\\n\");\n}\n\n\nint main()\n{\n int t;\n scanf(\"%d\", &t);\n while(t--)\n {\n solve();\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "12b999accb96de269e63641e9840bc45", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "effe042f7ce707c079c2685c99dead03", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6267281105990783, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n\tint T;\n\tlong long int a,b,num,j,i;\n\tscanf(\"%d\",&T);\n\tfor(i=0;i\nint main()\n{\n char str[10000];\n int i,j,f1=0,f2=0,f3=0,f4=0,f5=0;\n scanf(\"%s\",str);\n for(i=0;str[i]!='\\0';i++)\n {\n if(str[i]=='D'&&str[i+1]=='a'&&str[i+2]=='n'&&str[i+3]=='i'&&str[i+4]=='l')\n {\n f1++;\n }\n else if(str[i]=='O'&&str[i+1]=='l'&&str[i+2]=='y'&&str[i+3]=='a')\n {\n f2++;\n }\n else if(str[i]=='S'&&str[i+1]=='l'&&str[i+2]=='a'&&str[i+3]=='v'&&str[i+4]=='a')\n {\n f3++;\n }\n else if(str[i]=='A'&&str[i+1]=='n'&&str[i+2]=='n')\n {\n f4++;\n }\n else if(str[i]=='N'&&str[i+1]=='i'&&str[i+2]=='k'&&str[i+3]=='i'&&str[i+4]=='t'&&str[i+5]=='a')\n {\n f5++;\n }\n }\n if(f1==1&&f2==0&&f3==0&&f4==0&&f5==0)\n {\n printf(\"YES\");\n }\n else if(f1==1&&f2==0&&f3==0&&f4==0&&f5==0)\n {\n printf(\"YES\\n\");\n }\n else if(f1==0&&f2==1&&f3==0&&f4==0&&f5==0)\n {\n printf(\"YES\\n\");\n }\n else if(f1==0&&f2==0&&f3==1&&f4==0&&f5==0)\n {\n printf(\"YES\\n\");\n }\n else if(f1==0&&f2==0&&f3==0&&f4==1&&f5==0)\n {\n printf(\"YES\\n\");\n }\n else if(f1==0&&f2==0&&f3==0&&f4==0&&f5==1)\n {\n printf(\"YES\\n\");\n }\n else()\n {\n printf(\"NO\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "448072828fab5de94dff469d216886ef", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "99ff54b31af2367e168934947daf28fe", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9719789842381786, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint n, cube[3][6],v[3];\n\nint dfs(int num){\n\tif (num == 0)return 1;\n\tfor (int i = 0; i < n; i++){\n\t\tif (v[i])continue;\n\t\tint f = 0;\n\t\tfor (int j = 0; j < 6; j++)\n\t\t\tif (num % 10 == cube[i][j])f = 1;\n\t\tif (!f)continue;\n\t\tv[i] = 1;\n\t\tif (dfs(num / 10))return 1;\n\t\tv[i] = 0;\n\t}\n\treturn 0;\n}\nvoid main(){\n\tscanf(\"%d\", &n);\n\tfor (int i = 0; i < n; i++)\n\t\tfor (int j = 0; j < 6; j++)scanf(\"%d\", &cube[i][j]);\n\n\tfor (int i = 0; i < 1000; i++){\n\t\tfor (int j = 0; j < n; j++)v[j] = 0;\n\t\tif (!dfs(i)){\n\t\t printf(\"%d\\n\", i - 1);\n\t\t return; \n\t\t}\n\t}\n}", "lang": "GNU C", "bug_code_uid": "dda2e24440d539c38f1eff50f333ae6c", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "9f2caab846c592a532c15bda9192b0ae", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9896616541353384, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define MAX 200010\n#define MOD 1000000007\n\nusing namespace std;\n\nint n, m, h, sum[1010], dp[MAX][2];\n\nvoid Pregenerate(){\n int i, j, l, res, x = 0;\n for (i = h; i >= 0; i--){\n sum[i] = x;\n x += i;\n }\n\n for (l = 0; l <= h; l++){\n for (i = n; i >= 0; i--){\n j = sum[l] - i;\n if (i > sum[l]) continue;\n if (j > m) continue;\n\n\n if (!l) res = 1;\n else{\n res = 0;\n if ((i + l) <= n) res = res + dp[i + l][(l - 1) & 1];\n if ((j + l) <= m) res = res + dp[i][(l - 1) & 1];\n }\n\n if (res >= MOD) res -= MOD;\n dp[i][l & 1] = res;\n }\n }\n}\n\nint main(){\n int i, j;\n\n while (scanf(\"%d %d\", &n, &m) != EOF){\n for (h = 0; h <= 1000; h++){\n int x = (h * (h + 1)) >> 1;\n if (x > (n + m)){\n h--;\n break;\n }\n }\n\n Pregenerate();\n int res = dp[0][h & 1];\n printf(\"%d\\n\", res);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2067f60c51eef4fb1d2bc8331b26e0f5", "src_uid": "34b6286350e3531c1fbda6b0c184addc", "apr_id": "40c48f207be03ab3d61da6500340c120", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9995687796463993, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "V#include \nint main()\n{\n int n,m;\n scanf(\"%d %d\",&n,&m);\n char ch[n][m];\n int i,j,k,l;\n for(i=0;i\n#define pi 3.14\n\nint main()\n{\n int a , b , r ,ans ;\n\n while(scanf(\"%d%d%d\",&a,&b,&r)!=EOF)\n {\n d = 2* r ;\n ans = (a/d)*(b/d);\n if(ans%2==0)\n printf(\"Second\\n\");\n else\n printf(\"First\\n\");\n\n }\n\n\n return 0 ;\n}\n", "lang": "GNU C", "bug_code_uid": "1dfdfc42dfa919713e09fb5154cab60d", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "4d07133fb78b2bf08b4f72711dbf60ee", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9247311827956989, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int a,b,r;\n while(scanf(\"%d%d%d\",&a,&b,&r))\n if(a>=2*r&&b>=2*r)\n printf(\"First\\n\");\n else printf(\"Second\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "69d9dfaced924c1e56b6067e838b846d", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "44582991e7ac3637a86fb7668a027133", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.08924949290060852, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\nint a,b,r,d,e,f,g,n,p=1;\nscanf(\"%d %d %d\",&a,&b,&r);\nd=2*r;\nif(ae)&&(ae)&&(bf&&bf&&be)&&(bf&&b\nint main()\n{\n int a[100],b[100],c,ans,min,n,sh,m,k,i;\n scanf(\"%d%d%d\",&n,&m,&k);\n for(i=0;i0 && a[i]0)\n {\n ans=abs(((i+1)-m)*10);\n break;\n }\n }\n for(i=0;i0 && abs(((i+1)-m)*10)\n#include\n#include\n#define MAX 1000000009;\nint main() {\n int i,n,m,k,min=MAX,t,temp;\n scanf(\"%d %d %d\",&n,&m,&k);\n for(i=1;i<=n;i++) {\n scanf(\"%d\",&t);\n if(t>0 && t<=k) {\n temp = abs(m-i);\n if(temp\n\nstruct dxy\n{\n\tlong long d;\n\tlong long x;\n\tlong long y;\n};\n\nlong long gcd(long long a, long long b)\n{\n\t return (a*b == 0) ? (a + b) : gcd(b, a%b);\n}\n\nstruct dxy ext_euc(long long a, long long b)\n{\n\tlong long x, y;\n\tstruct dxy ans;\n\tif (b == 0)\n\t{\n\t\tans.d = a;\n\t\tans.x = 1;\n\t\tans.y = 0;\n\t\treturn ans;\n\t}\n\t\n\tans = ext_euc(b, a%b);\n\tx = ans.y;\n\ty = ans.x - (a/b)*ans.y;\n\t\n\tans.x = x;\n\tans.y = y;\n\treturn ans;\n}\n\nlong long box(long long numer, long long denom)\n{\n\tif (numer % denom == 0 || numer * denom >= 0)\n\t{\n\t\treturn numer / denom;\n\t}\n\t\n\treturn (numer / denom) - 1;\n}\n\nint main()\n{\n\tlong long a1, a2, b1, b2;\n\tlong long L, R;\n\tlong long alpha1, alpha2, r, start, end;\n\tlong long p, p1, q, i, j;\n\tlong long hcf;\n\tstruct dxy temp;\n\t\n\tscanf(\"%lld %lld %lld %lld %lld %lld\", &a1, &b1, &a2, &b2, &L, &R);\n\t\n\thcf = gcd(a1, a2);\n\tif ((b2 - b1) % hcf != 0)\n\t{\n\t\tprintf(\"%d\\n\", 0);\n\t\treturn 0;\n\t}\n\t\n\tr = box((b2 - b1), hcf);\n\talpha1 = box(a1, hcf);\n\talpha2 = box(a2, hcf);\n\t\n\ttemp = ext_euc(alpha1, -alpha2);\n\tp = temp.x * r;\n\tp1 = temp.y * r;\n\tif (temp.d < 0)\n\t{\n\t\tp = -p;\n\t\tp1 = -p1;\n\t}\n\t\n\tstart = box((L-b1), a1) + 1;\n\tstart -= ((L-b1) % a1) == 0 ? 1 : 0;\n\tend = box((R-b1), a1);\n\t\n\tq = box((start-p), alpha2) + 1;\n\tq -= ((start-p) % alpha2) == 0 ? 1 : 0;\n\t\n\tj = 0;\n\tfor (i = q; i <= box((end-p), alpha2); i++)\n\t{\n\t\tif (p + i*alpha2 >=0 && p1 + i*alpha1 >= 0)\n\t\t{\n\t\t\tj++;\n\t\t}\n\t}\n\t\n\t//printf(\"%lld %lld\\n\", start, end);\n\t//printf(\"%lld %lld %lld %lld\\n\", p, p1, q, r);\n\t//printf(\"%lld %lld\\n\", box((end-p), alpha2), box((start-p), alpha2));\n\t/*\n\tif (p + q*alpha2 < 0 || p1 + q*alpha1 < 0)\n\t{\n\t\tprintf(\"%d\\n\", 0);\n\t\treturn 0;\n\t}\n\t*/\n\tprintf(\"%lld\\n\", j);\n\treturn 0;\n}\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "c4f63a4f1e66902a032cfe24aa4bd5fb", "src_uid": "b08ee0cd6f5cb574086fa02f07d457a4", "apr_id": "d624ff67cb73bf684fe8ae25c4499810", "difficulty": 2500, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9828282828282828, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nlong long xy[2];\n\nint gcdxy(int a, int b) {\n\tif (b == 0) {\n\t\txy[0] = 1, xy[1] = 0;\n\t\treturn a;\n\t} else {\n\t\tint g = gcdxy(b, a % b);\n\t\tint tmp;\n\n\t\ttmp = xy[0] - a / b * xy[1];\n\t\txy[0] = xy[1];\n\t\txy[1] = tmp;\n\t\treturn g;\n\t}\n}\n\nint main() {\n\tint a1, b1, a2, b2, l, r, g, cnt, cnt1, cnt2;\n\tlong long x, b, n, k_, l_;\n\n\tscanf(\"%d%d%d%d%d%d\", &a1, &b1, &a2, &b2, &l, &r);\n\t/* (a1k + b1 = a2l + b2) = (a1k - a2l = b2 - b1) */\n\tg = gcdxy(a1, -a2);\n\tb = (long long) b2 - b1;\n\tif (b % g != 0)\n\t\tprintf(\"0\\n\");\n\telse {\n\t\tk_ = xy[0] * b / g, l_ = xy[1] * b / g;\n\t\tif (g < 0)\n\t\t\tg = -g;\n\t\tcnt2 = a2 / g;\n\t\tcnt1 = a1 / g;\n\t\tcnt = (long long) a1 / g * a2;\n\t\tk_ = (k_ % cnt2 + cnt2) % cnt2;\n\t\tl_ = (l_ % cnt1 + cnt1) % cnt1;\n\t\tx = a1 * k_ + b1 > a2 * l_ + b2 ? a1 * k_ + b1 : a2 * l_ + b2;\n\t\tn = 0;\n\t\tif (x >= l && x <= r)\n\t\t\tn = (r - x + 1 + cnt - 1) / cnt;\n\t\telse if (x < l)\n\t\t\tn = (r - x + 1 + cnt - 1) / cnt - (l - 1 - x + 1 + cnt - 1) / cnt;\n\t\tprintf(\"%lld\\n\", n);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "332026df2e73f6fe460eb12d50d2f778", "src_uid": "b08ee0cd6f5cb574086fa02f07d457a4", "apr_id": "f1acc5ad833ccd2ffda07c03a648f9ec", "difficulty": 2500, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9901639344262295, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int i,n,k,l;\n scanf(\"%d\",&n);\n k=n-10;\n int a[11];\n\n if(n<=10)\n printf(\"0\");\n else\n{\n\n for(i=1;i<=11;i++)\n {\n if(i==k)\n l=i;\n\n if(i==10)\n a[i]=15;\n\n else if(i!=10)\n a[i]=4;\n\n }\n printf(\"%d\",a[l]);\n}\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "bef62f4168c0dd1d6fdfe507a1b06e11", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "9f855a7929c38ae797bc1cdeba2ce07f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5114285714285715, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include \n\nint main(int argc, char const *argv[])\n{\n long long a;\n long long b;\n scanf(\"%d\\n\", &a);\n scanf(\"%d\\n\", &b);\n\n long long koef = 0;\n long long i;\n for (i = 1; i < b; i++) {\n koef += i;\n }\n // printf(\"koef: %d\\n\", koef);\n \n long long sum = 0; \n long long res; \n int mod = 1000000007; \n\n for (i = 1; i <= a; i++) {\n // sum += koef * (i * b + 1); // (a+b) % p = (a%p + b%p)%p\n res = (koef % mod * ((i % mod) * (b % mod) + 1) % mod) % mod;\n // printf(\"res: %lld\\n\", res);\n sum = (sum + res) % mod;\n // printf(\"i: %d, sum: %lld\\n\", i, sum);\n }\n\n printf(\"%d\\n\", sum); \n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "0f1571eb86b484360a1791021da8d8c9", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "2cc2e8f6d525f090c0c694d023e89765", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21316165951359084, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main() {\n int a,b;\n scanf(\"%d%d\",&a,&b);\n long long max=a*b*b;\n long long x;\n long long sum=0;\n for(x=1;x<=max;x++){\n if(x%b!=0 && (x/b) % (x%b)==0){\n if((x/b)/(x%b)>=1 && (x/b)/(x%b)<=a){\n sum+=x;\n //printf(\"x=%lld\\n\",x);\n }\n }\n }\n printf(\"%lld\\n\",sum);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "cc25f3d8b28d7850573dd47075d09b65", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "48eeb9a4c467b34fc5b796cab6149b29", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9762611275964391, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int b='a',c=0;\n char a[510];\n scanf(\"%s\",a);\n while(a[c])\n {\n if(b==a[c])\n {\n b++;\n c++;\n }\n else if(b>a[c])\n c++;\n else\n {\n printf(\"NO\");\n return;\n }\n }\n printf(\"YES\");\n}\n", "lang": "GNU C", "bug_code_uid": "06ce28f4960b9746d161b89bd688a378", "src_uid": "c4551f66a781b174f95865fa254ca972", "apr_id": "857042a45f1df3e9b001c7df415c2c01", "difficulty": 1100, "tags": ["greedy", "strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7729083665338645, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int i=0,j=0;\n char s[51],a[51];\n scanf(\"%s%s\",s,a);\n while(s[j]!='\\0')\n {\n if(s[j]==a[i])\n {\n i++;\n j++;\n }\n }\n printf(\"%d\",i);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "76be4deadbc5ab965452c804d1fc95b8", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "698669a85d4515fb2bcf735963b6121b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9278350515463918, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint low[7][7], high[7][7];\nint cost[7][7];\nint n;\nint flow[7][7];\nint inFlow[7];\nint outFlow[7];\nint minFlow = 100, maxCost = -1;\n\nint rec(int v, int to) {\n if(v == n - 1) {\n int isValid = 1;\n int i, j;\n int total = inFlow[n - 1];\n int ccost = 0;\n for(i = 0; i < n; i++) {\n for(j = i + 1; j < n; j++) {\n if(flow[i][j] < low[i][j] || flow[i][j] > high[i][j])\n isValid = 0;\n if(flow[i][j] > 0) \n ccost += flow[i][j] * flow[i][j] + cost[i][j];\n }\n if(inFlow[i] != outFlow[i] && (i > 0 && i < n - 1)) {\n isValid = 0;\n }\n }\n if(isValid) {\n if(minFlow == total) {\n if(ccost > maxCost)\n maxCost = ccost;\n } else if(minFlow > total) {\n minFlow = total;\n maxCost = ccost;\n }\n }\n } else if(to == n)\n rec(v + 1, v + 2);\n else {\n int i;\n for(i = 0; i <= high[v][to]; i++) {\n inFlow[to] += i;\n outFlow[v] += i;\n flow[v][to] = i;\n rec(v, to + 1);\n inFlow[to] -= i;\n outFlow[v] -= i;\n }\n }\n}\n\nint main() {\n scanf(\"%d\", &n);\n int i, from, to, j;\n for(i = 0; i < n * (n - 1) / 2; i++) {\n scanf(\"%d %d\", &from, &to);\n from--;\n to--;\n scanf(\"%d %d %d\", &low[from][to], &high[from][to], &cost[from][to]);\n }\n rec(0, 1);\n if(minFlow == 100)\n puts(\"-1 -1\");\n else\n printf(\"%d %d\\n\", minFlow, maxCost);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1d10aa7944e112e618892b088fd9f020", "src_uid": "38886ad7b0d83e66b77348be34828426", "apr_id": "a56f0a72e17aa5bdc2fe578dd651ecb3", "difficulty": 2200, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7822222222222223, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n\tint hh,mm,n=0;\n\tscanf(\"%d:%d\",&h,&m);\n\twhile(hh/10!=mm%10||hh%10!=mm/10)\n\t{\n\t\tmm++;\n\t\tn++;\n\t\tif(mm==60)\n\t\t{\n\t\t\tmm=00;\n\t\t\thh=hh+1;\n\t\t}\n\t\tif(hh==24)\n\t\t{\n\t\t\thh=0;\n\t\t}\n\t}\n\tprintf(\"%d\\n\",n);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "64946308002ea8c3807bef4c14ce003d", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "696d64ce482ced8430dcbab1e218d66e", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.005445881552076242, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "\\subsection{\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03e9}\n% \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd(\ufffd\ufffd\ufffd\ufffd\u0224\ufffd\ufffd\u01bd\ufffd\u0175\ufffd\ufffd\ufffd\ufffd\ufffd\u03e4\ufffd\ufffd\ufffd)\n% \ufffd\ufffd\u0175\ufffd\u02a4\ufffd\ufffd\ufffd\ufffd\u03e1\ufffd\u036d\u033e\ufffd\u023b\u05e4\ufffd\ufffd\ufffd\u02a4\ufffd\u036d\u033e\ufffd\ufffd\ufffd\ua862\ufffd\ufffd\ufffd\ufffd\ufffd\u01e4\u02a4\ufffd\ufffd\ufffd\ufffd\ufffd\u03fa\ufffd\ufffd\ufffd\ufffd\ufffd\u0235\ufffd\ufffd\ufffd\ufffd\u01a4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\n\\begin{problem}{Codeforces Round57(\ufffd\ufffd\ufffd\ufffd)}\n$(0,0),(n,0),(0,n),(n,n)$\ufffd\ufffd4\ufffd\ufffd\ufffd\ufffd\u013a\ufffd\ufffd\ufffd\u0224\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0364\ufffd\ufffd\ufffd($n$\ufffd\u03fc\ufffd\ufffd\ufffd\ufffd\ufffd)\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03bc\ufffd\ufffd\ufffd\u03b3\u02bb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u037f\ufffd\ufffd\ufffd\ufffd\ufffd\ub863\ufffd\ufffd\ufffd\u03bb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05a1\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03bc\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0324\ufffd\ufffd\u00fb\ufffd\ufffd\u03e9\ufffd\u03b5\ufffd\u03a5\ufffd\ufffd\u05fb\ufffd\ufffd\ufffd\ufffd\ufffd\u05e5?\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u8863\n\\end{problem}\n\n% \ufffd\ufffd\ufffd\ufffd\ufffd\u03e4\u02e4\u0124\ufffd\ufffd\u01bd\ufffd\n\\begin{inputformat}\n$n$\ufffd\u06a4\ufffd2\ufffd\u02bb\ufffd\ufffd\ufffd\ufffd\u03ba\ufffd\u0278$(x_1,y_1),(x_2,y_2)$\ufffd\u03ba\ufffd\u0278\ufffd\ufffd\ufffd\ufffd\ufffd\u03bd\ufffd\ufffd\u05a4\ufffd\u023e\ufffd\u0476\ufffd\ufffd\ufffd\ufffd\ufffd\u06a4\ufffd\ufffd\u037f\ufffd\ufffd\ufffd\ufffd\ufffd\ub863$n$\ufffd\ufffd1000\ufffd\u02b2\ufffd\ufffd\u01e4\ufffd\ufffd\ua862\ufffd\u02bb\ufffd\ufffd\ufffd\ufffd\u03ba\ufffd\u0278\ufffd\u03e4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd$n$\ufffd\u02b2\ufffd\ufffd\u01e4\ufffd\ufffd\ub863\n\\end{inputformat}\n\\begin{outputformat}\n\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03a4\u07e4\ufffd\ufffd\u0324\ufffd\ufffd\u00fb\ufffd\ufffd\u03e9\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0124\u01fd\ufffd\ufffd\u03e4\ufffd\ufffd\u8863\n\\end{outputformat}\n\\begin{multicols}{2}\n\\begin{inputsample}\n2 0 1 2 1\n\\end{inputsample}\n\\begin{outputsample}\n4\n\\end{outputsample}\n\\end{multicols}\n% \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\n\\begin{explanation}\n\ufffd\ufffd\ufffd\u023d\ufffd\u01e4\ufffd\ufffd\u0464\ufffd\ufffd\u01bd\ud952\udd24\u01a4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0224\u02e4\u02a4\ub8632\ufffd\ufffd\ufffd\u03b0\ufffd\ufffd\u05b4\u0637\ufffd\ufffd\u01fe\ufffd\ufffd\u023d\ufffd\u01e4\uda53\ude64\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0464\uf937\ufffd\ufffd(\u00ae\ufffd\ufffd\ufffd\u03a4\ufffd\u00ae\ufffd\ufffd)\ufffd\u03a4\u01e1\ufffd\ufffd\u2926\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u00f1\ufffd\ufffd\ufffd\ufffd\u02e1\ufffd\u03e4\u02a4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0224\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0224\u02e4\u02a4\ub863\ufffd\ufffd\ufffd\ufffd\ufffd\u01e1\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u013e\ufffd\ufffd\ufffd\u0224\u07e4\u02a4\ufffd\ufffd\ufffd\u03a4\u0224\ufffd\ufffd\ub863$(0,0)$\ufffd\ufffd\ufffd\u06a4\ufffd\u03a4\u01e4\ufffd\ufffd\ub863\ufffd\ufffd\ufffd\ufffd\ufffd\u01a1\ufffd\ufffd\u0264\ufffd\ufffd\u992b\ufffd\u03bc\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u01a1\ufffd$(0,0)$\ufffd\ufffd\ufffd\ufffd\u03b5\ufffd\u03a5\ufffd\ufffd\u05fb\ufffd\ufffd\ufffd\ufffd\ub863\ufffd\ufffd\ufffd\u03b8\u5862\ufffd\u05fb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03a5\ufffd\ufffd\ufffd\u7926\ufffd\ufffd\ufffd\u0224\u01e1\ufffd\ufffd\ufffd\u03a5\ufffd\ufffd\ufffd\u0424\ub863\ufffd\u2937\ufffd\u293d\ufffd\uc92c\ufffd\ufffd\ufffd\ufffd\ufffd1\ufffd\ufffd\ufffd\ufffd\u023e\u02ac\ufffd\ufffd\ufffd\ufffd\u0139\ufffd\ufffd\ufffd\ufffd\u0421\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd1\ufffd\ufffd\ufffd\ufffd\ufffd\u993d\ufffd\u03b5\ufffd\u03a5\ufffd\ufffd\ufffd\u01a4\ufffd\ufffd\u043a\ufffd\u00fb\ufffd\ufffd\u03a5\ufffd\u02e4\u02a4\ub863\n\\end{explanation}\n\n% \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\n\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\\verb|seigyo_bc_sano_9.c|\n\n\\newpage\n\n", "lang": "GNU C", "bug_code_uid": "d8938acb80afd7a7b766c2d6aa23188e", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "41d1371e98919749151ed95fffdcaeb6", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7126436781609196, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 18, "bug_source_code": "#include \n\nint distance(int x, int y, int n)\n{\nint d;\nif (x=0)\nd = y;\nelse if(x!=n)\n{\nif (y=0) d = 4*n-x;\nelse d = n + x;\n}\nelse d = 3*n-y;\n\nreturn d;\n}\n\nint main()\n{\nint n,x1,y1,x2,y2;\nint d1, d2,d;\nscanf(\"%d %d %d %d %d\",n,x1,y1,x2,y2);\nd1 = distance(x1,y1,n);\nd2 = distance(x2,y2,n);\nif(d1>d2) d = d1-d2;\nelse d = d2-d1;\nif(d>2*n)\nd = 4*n-d;\nprintf(\"%d\", d);\n\nreturn 0;\n}\n\n\n\n", "lang": "GNU C", "bug_code_uid": "5205e2ea2218fe94493112bb717b4b43", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "1861c202aac18c60cc21968680772b95", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8889413988657845, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int n=0,p,flag=0;\n long long a,i,j;\n scanf(\"%I64d\",&a);\n if(a>=477777777)\n {\n n=766;\n for(i=477777778; i<=a; i++)\n {\n j=i;\n while(j>0)\n {\n p=j%10;\n //printf(\"p=%d\\n\",p);\n if(p==4 || p==7);\n else flag=1;\n if(flag==1)break;\n j/=10;\n }\n if(flag==0)n++;\n flag=0;\n }\n printf(\"%d\",n);\n }\n else if(a>=444444444)\n {\n n=511;\n for(i=444444447; i<=a; i++)\n {\n j=i;\n while(j>0)\n {\n p=j%10;\n //printf(\"p=%d\\n\",p);\n if(p==4 || p==7);\n else flag=1;\n if(flag==1)break;\n j/=10;\n }\n // printf(\"%d\\n\",flag);\n if(flag==0)n++;\n flag=0;\n }\n printf(\"%d\",n);\n\n }\n else if(a>=77777777)\n {\n n=510;\n for(i=77777778; i<=a; i++)\n {\n j=i;\n while(j>0)\n {\n p=j%10;\n //printf(\"p=%d\\n\",p);\n if(p==4 || p==7);\n else flag=1;\n if(flag==1)break;\n j/=10;\n }\n // printf(\"%d\\n\",flag);\n if(flag==0)n++;\n flag=0;\n }\n printf(\"%d\",n);\n\n }\n else\n {\n for(i=4; i<=a; i++)\n {\n j=i;\n while(j>0)\n {\n p=j%10;\n //printf(\"p=%d\\n\",p);\n if(p==4 || p==7);\n else flag=1;\n if(flag==1)break;\n j/=10;\n }\n // printf(\"%d\\n\",flag);\n if(flag==0)n++;\n flag=0;\n }\n printf(\"%d\",n);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7e1bed1609cc5520965e7a03ddd94a89", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "401d4bb0731f804381f3dc355867122b", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9740698985343855, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nusing namespace std;\n\nint main()\n{\n\tint f1[3];\n\tint f2[3];\n\tfor(int i=0;i<3;i++)\n\t{\n\t\tscanf(\"%d\", &f1[i]);\n\t}\n\tfor(int i=0;i<3;i++)\n\t{\n\t\tscanf(\"%d\", &f2[i]);\n\t}\n\tif(f1[0] == f2[0])\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse if(f1[1] == f2[1])\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse if(f1[2] == f2[2])\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse if ((f1[0] == f2[0]) && (f1[1] == f2[1]) && (f1[2] == f2[2]))\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse\n\t{\n\t\tprintf(\"NO\");\n\t}\nreturn 0;\t\n} \n \n", "lang": "GNU C11", "bug_code_uid": "aaf79c77db2b2d13390964bbb050a781", "src_uid": "91c9dbbceb467d5fd420e92c2919ecb6", "apr_id": "b85aaad5a548c76336d5d3acb65d92f2", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9962825278810409, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(){\n int count=0,a,b,c,d,e,f;\n scanf(\"%d %d %d\",&a,&b,&c);\n scanf(\"%d %d %d\",&d,&e,&f);\n if(a!=d)\n count++;\n if(b!=e)\n count++;\n if(c!=f)\n count++;\n if(count>1)\n printf(\"NO\");\n else\n printf(\"YES\");\n \n}", "lang": "GNU C11", "bug_code_uid": "f4a3cace8f903c9deaea95ce4fe798e5", "src_uid": "91c9dbbceb467d5fd420e92c2919ecb6", "apr_id": "e41a6bc050bf7b06225a7215d39e37b9", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9984, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n\tint f=1,n,s,a[15],i,count=0,max=0;\n\tscanf(\"%d %d\",&n,&s);\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tscanf(\"%d\",&a[i]);\n\t\t\t\t\n\t}\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tcount+=a[i];\n\t\tif(max\n#include \nint main()\n{\n long n,s,i,maxt=0,sum=0;\n int a[20]={0};\n scanf(\"%ld%ld\",&n,&s);\n for(i=0;imaxt)maxt=a[i];\n sum+=a[i];\n }\n sum-=maxt;\n if(sum<=s)printf(\"YES\\n\");\n else printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5124ab228e985a84585f5c9a56a0b467", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "2c98097a21577f378020f65c0ab1e0f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.12785690626035112, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 23, "bug_source_code": "#include \n#include \nint main()\n{\n char a[5];\n int b[5],i,j;\n for(i=0;i<3;i++)\n {\n scanf(\"%s\",a);\n if(strcmp(a,\"C\")==0)\n b[i]=1;\n if(strcmp(a,\"C#\")==0)\n b[i]=2;\n if(strcmp(a,\"D\")==0)\n b[i]=3;\n if(strcmp(a,\"D#\")==0)\n b[i]=4;\n if(strcmp(a,\"E\")==0)\n b[i]=5;\n if(strcmp(a,\"F\")==0)\n b[i]=6;\n if(strcmp(a,\"F#\")==0)\n b[i]=7;\n if(strcmp(a,\"G\")==0)\n b[i]=8;\n if(strcmp(a,\"G#\")==0)\n b[i]=9;\n if(strcmp(a,\"A\")==0)\n b[i]=10;\n if(strcmp(a,\"B\")==0)\n b[i]=11;\n if(strcmp(a,\"H\")==0)\n b[i]=12;\n }\n for(i=0;i<2;i++)\n for(j=i+1;j<3;j++)\n {\n if(b[j]\nint main()\n{\n\tint a,b,c,d,e;\n\tscanf(\"%d%d%d%d\",&a,&b,&c,&d);\n\tif(a+8*c>=b)\n\t{\n\t\tprintf(\"0\\n\");\n\t\tgoto jump;\n\t}\n\telse if(c\nint main()\n{\nint x,y,turn;\nscanf(\"%d %d\",&x,&y);\nif(x==0&&y==0||x==1&&y==0)\n{\n printf(\"0\");\n return 0;\n}\n if(x<0&&y>=x&&y<-x)\n ans=-4*x-1;\n if(y<0&&x>y&&x<=-y+1)\n ans=-4*y;\n if(x>0&&y>-x+1&&y<=x)\n ans=x*4-3;\n if(y>0&&x=-y)\n ans=4*y-2;\nprintf(\"%d\",turn);\n}\n", "lang": "GNU C", "bug_code_uid": "6443e3c69194f95809a63355390fed3a", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "apr_id": "c8c81cb796ad4b5a052372503d331247", "difficulty": 1400, "tags": ["geometry", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9948849104859335, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#define mod 1000000007\ntypedef long long int ll;\nll expo(ll x,ll k)\n{\n\tll result=1;\n\twhile(k>0)\n\t{\n\t\tif(k%2==1)\n\t\t\tresult=result*x%mod;\n\t\tx=x*x%mod;\n\t\tk=k/2;\n\t}\n\treturn result;\n}\nint main()\n{\n\tlong long int x,k,ans;\n\tscanf(\"%lld%lld\",&x,&k);\n\tif(x==0)\n\t{\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\n\t}\n\tx=x%mod;\n\tx=(2*x-1)%mod;\n\tk=expo(2,k);\n\tprintf(\"%lld\\n\",(x*k+1)%mod);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "669c570a2153a92eff363fb018ea608c", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "21e8701d0e531209716dd1e80ffa679e", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9124423963133641, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "#include \nint mod=(int)1e9+7;\nint powmod(int a,int n)\n{\n int ans=1;\n while(n)\n {\n if(n&1) ans=((long long)ans*a)%mod;\n a=((long long)a*a)%mod;\n n>>=1;\n }\n return ans;\n}\nint main()\n{\n long long x,k;\n scanf(\"%lld%lld\",&x,&k);\n x%=mod;\n k%=(mod-1);\n int temp=powmod(2,k);\n int ans=((long long)2*temp)%mod;\n ans=((long long)ans*x)%mod;\n if(temp) temp=mod-temp;\n ans=((long long)ans+temp+1)%mod;\n printf(\"%d\\n\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "ad27f9af93c068186ce3cc1f16d79222", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "5ad41e375c4f2db3cd07bd97f308f86c", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9980353634577603, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint main()\n{\n int x;\n scanf(\"%d\",&x);\n if(x%4==0)\n printf(\"1 A\\n\")\n else if(x%4==1)\n printf(\"0 A\\n\");\n else if(x%4==2)\n printf(\"1 B\\n\");\n else if(x%4==3)\n printf(\"2 A\\n\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f391bd4b5a50425b2072676c6505cb5d", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "c3d3d780cdca2b376facce25dd6ba40a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.031309297912713474, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include \nusing namespace std;\nvoid merge(int arr[], int l, int m, int r)\n{\n int i, j, k;\n int n1 = m - l + 1;\n int n2 = r - m;\n\n int L[n1], R[n2];\n\n for (i = 0; i < n1; i++)\n L[i] = arr[l + i];\n for (j = 0; j < n2; j++)\n R[j] = arr[m + 1+ j];\n\n i = 0;\n j = 0;\n k = l;\n while (i < n1 && j < n2)\n {\n if (L[i] <= R[j])\n {\n arr[k] = L[i];\n i++;\n }\n else\n {\n arr[k] = R[j];\n j++;\n }\n k++;\n }\n\n while (i < n1)\n {\n arr[k] = L[i];\n i++;\n k++;\n }\n\n while (j < n2)\n {\n arr[k] = R[j];\n j++;\n k++;\n }\n}\nvoid mergeSort(int arr[], int l, int r)\n{\n if (l < r)\n {\n int m = l+(r-l)/2;\n\n mergeSort(arr, l, m);\n mergeSort(arr, m+1, r);\n\n merge(arr, l, m, r);\n }\n}\n\n\nint main()\n{\n int i,j,n,m;\n cin>>n>>m;\n int c[n],b[m];\n for(i=0;i>c[i];\n }\n for(i=0;i>b[i];\n }\n int st=0,count=0;\n for(i=0;i=c[j])\n {\n count++;\n st=j+1;\n break;\n }\n }\n if(j==n)\n break;\n }\n cout<\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n\nint main()\n{\n int count[2000] ={0};\n int arr[1000] ={0}; \n int n,m,i;\n scanf(\"%d %d\",&n,&m);\n for(i=0;i0){\n brr[b]=i;\n b++;\n }\n }\n \n if(b>=n){\n max = 0;\n for(i=0;i=0){\n int f = 0;\n for(i=0;i=n){\n printf(\"%d\\n\",max);\n break;\n }\n max = max - 1;\n }\n \n}\n", "lang": "GNU C", "bug_code_uid": "e3255f522549cbe3d898a0328e2a6d0b", "src_uid": "b7ef696a11ff96f2e9c31becc2ff50fe", "apr_id": "3413f8c8dc67471ba35dafbf65b31530", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3938024531956101, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "#include\nint comp(const void * a,const void * b)\n{\n return (*(int*)a - *(int*)b);\n}\nint main()\n{\n int n,m,i,j,arr[10000],k,xx,xy,l;\n scanf(\"%d %d\",&n,&k);\n for(i=0;iarr[i]){\n xy/=2;\n l++;\n }\n if(xy==arr[i])\n m++;\n }\n }\n if(i==0)\n xx=l;\n else if(xx>l)\n xx=l;\n }\n printf(\"%d\",xx);\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "13ba9fe66912c114ede5ee1a97e57de5", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "fa662174c0c285acf83c1f6578f29b70", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8041558441558442, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\n#include\n#define ll long long\nint comp(const void*p,const void*q)\n{\nreturn *(const int*)p-*(const int *)q;\t\n}\nint main(){\n\tll n,k;\n\tscanf(\"%lld%lld\",&n,&k);\n\tll arr[n],count=0,x,y,flag=0,run=0;\n\tll num[n][20],cnt[200001]={0};\n\tfor(int i=0;i=0;i--){\n\tif(cnt[i]>=k) {x=i;break;}\n\t}\n\tfor(int i=0;i=(x)) {y=i;\n\tbreak;}\n\t}\n\tfor(int i=y;i=k){flag=1;\n\t//printf(\"%lld,\",run); \n\tbreak;}\n\tbreak;\n\t}\n\tif(flag==1) break;\n\t}\n\t\n\t}\n\n\nprintf(\"%lld\",count);\n\n\n\n\n\nreturn 0;}\n", "lang": "GNU C11", "bug_code_uid": "b5fc63c3b26bc5cce081746bb8d92f3b", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "80d6ea16946a24f2602c698bdf65671f", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9838709677419355, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main(){\n int n;\n scanf(\"%d\",&n);\n if(n % 0 == 0){\n n/=2;\n \n printf(\"%d\",2 << n);\n }\n else\n printf(\"0\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cf4eb891e83b55e3949c5c2db60a3a42", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "d6df491bef750940b090f835d60e872c", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5413105413105413, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\nint k,n,w,i,r,p;\nscanf(\"%d %d %d\",&k,&n,&w);\nfor(i=1;i<=w;i+1)\n{\n r=k*i;\n p=n-r;\n}\nprintf(\"%d\",p);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d91c3b0e9f87c73913b8913afd7f574d", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "06c7eb1e05d8afe8a7210b36b89133ca", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999117387466902, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int n,i=0,j=0,k=0,l=0,m=0;\n int a[200],b[100];\n \n scanf(\"%d\",&b[0]);\n scanf(\"%d\",&b[1]);\n scanf(\"%d\",&a[0]);\n scanf(\"%d\",&a[1]);\n if(a[0]%2!=0 && a[0]>b[1])\n a[0]=a[0]+1;\n if(a[1]%2!=0 && a[1]>b[0])\n a[1]=a[1]+1;\n if(((a[0]-b[1])>=0 && ((a[0]/2)-1)<=b[1]) || ((a[1]-b[0])>=0 && ((a[1]/2)-1)<=b[0]))\n printf(\"YES\");\n \n else if(((b[0]-a[1])>=0 && (b[0]-a[1])<2) || ((b[1]-a[0])>=0 && (b[1]-a[0])<2))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n \n return 0;\n}", "lang": "GNU C", "bug_code_uid": "7b4e590c18bdb9bd8dc6467c0dfb7462", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "41f2a5ac749788d70076bc1faf451d17", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.47611589663273296, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \nint main ()\n{\n int gl;\n int gr;\n int bl;\n int br;\n\n scanf (\"%d\",&gl);\n scanf (\"%d\",&gr);\n scanf (\"%d\",&bl);\n scanf (\"%d\",&br);\n\n if ((bl!=gr) && (br!=gl))\n {\n\n if ((bl gr && (2*gr + 2 >= bl)))\n {\n printf (\"YES\");\n }\n else{\n printf (\"NO\");\n return;\n }\n if ((brgl && 2*gl + 2 >= br))\n {\n printf (\"YES\");\n }\n\n else\n printf (\"NO\");\n\n }\n else\n {\n printf (\"YES\");\n }\n\n}\n", "lang": "GNU C", "bug_code_uid": "e5e4b20ada221d90c8da5911af818216", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "952239902d7b36091d32634d2f100339", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.890272373540856, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#define _CRT_SECURE_NO_WARNINGS\n#include\n#include\nusing namespace std;\nint ans;\nchar c[11], tmpc[11];\nint prod( char *ch)\n{\n\tint pr = 1, id = 0;\n\twhile (ch[id])\n\t{\n\t\tpr *= ch[id] - '0';\n\t\tid++;\n\t}\n\treturn pr;\n}\nint main()\n{\n\t//freopen(\"input.txt\", \"r\", stdin);\t\n\tscanf(\"%s\", c);\n\tint l = 0;\n\twhile (c[l])\n\t\tl++;\n\tans = prod(c);\n\tfor (int i = 0; i < l; i++) {\n\t\tif (c[l] - '0' == 0)\n\t\t\tcontinue;\n\t\tfor (int j = 0; j < i; j++)\n\t\t\ttmpc[j] = c[j];\n\t\ttmpc[i] = (c[i] - '0' - 1) + '0';\n\t\tfor (int j = i + 1; j < l; j++)\n\t\t\ttmpc[j] = '9';\n\t\tint tmppr = prod(tmpc);\n\t\tif (tmppr > ans)\n\t\t\tans = tmppr;\n\t}\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "4d773406e31fadc96defc0e75b3eeb6e", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "2a469e6a9ce105829faa838f187e944d", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9144615384615384, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n\n//srand(time(NULL));\n//nombre_aleatoire = rand();\n\ntypedef struct cel\n{\n\tint number;\n\tint value;\n}cell;\n\nint main ()\n{\n\tint a,j=1,i=10,s=1,aux,max;\n\tcell t[12];\n\tscanf(\"%d\",&a);\n\t\n\tif(a==2000000000)\n\t{\n\t\tprintf(\"387420489\");\n\t}\n\telse\n\t{\n\t\tt[0].number=a;\n\t\taux=a;\n\t\twhile(aux>=1)\n\t\t{\n\t\t\ts=s*(aux%10);\n\t\t\taux=aux/10;\n\t\t}\n\t\tt[0].value=s;\n\t\twhile(a/i!=0)\n\t\t{\n\t\t\n\t\t\ts=1;\n\t\t\taux=a;\n\t\t\taux=aux-(aux%i+1);\n\t\t\tt[j].number=aux;\n\t\t\t\n\t\t\t\n\t\t\twhile(aux>=1)\n\t\t\t{\n\t\t\t\ts=s*(aux%10);\n\t\t\t\taux=aux/10;\n\t\t\t}\n\t\t\tt[j].value=s;\n\t\t\tj++;\n\t\t\ti=i*10;\n\t\t}\n\t\tmax=t[0].value;\n\t\t\n\t\tfor(i=0;imax)\n\t\t\t{\n\t\t\t\tmax=t[i].value;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t/*for(i=0;i\n#include \n\nint product(int n);\nint min(int n);\nint test(int n);\nint main()\n{long int n,i,np,r=1;\nscanf(\"%d\",&n);\nif(n<10){printf(\"%d\",n);\nreturn 0;}\n\nint max=product(n);\nif(max==product(min(n))){ printf(\"%d\",max); return 0;\n}\nfor(i=min(n);imax){max=np;}\n\t}\t\n}\n\nprintf(\"%d\",max);\nreturn 0;\n}\n\nint test(int n)\n{int r;\n\twhile(n>0)\n\t{\n\t\tr=n%10;\n\t\tn=n/10;\n\t\tif(r==0){return 0;}\n\t\tbreak;\t\n\t}\nreturn 1;\n}\n\nint min(int n)\n{\n int p=1,nv;\n n=n/10;\n while(n>0)\n {\n nv=n%10;\n n=n/10;\n p*=10;\n }\n\n return (p*nv)-1;\n\n}\nint product(int n)\n{\n int p=1;\n while(n>0)\n {\n p*=n%10;\n n/=10;\n }\n return p;\n}", "lang": "GNU C11", "bug_code_uid": "04eb7a515d5f41698ac3e71bc8aac8d6", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "ad6dfd9d213957c148fb959e9438d5df", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8262748487467588, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 13, "bug_source_code": "#include \nint dp[102][102];\nint ktree(int n,int k,int d) {\n if(dp[n][d]!=-1) return dp[n][d];\n int i=1,b=0;\n if(k>=n) b+=1;\n if(n==d) dp[n][d]= 1;\n else if(n=d && i<=k)\n {\n\t b+=ktree(n-i,k,1);\n\t i++;\n }\n dp[n][d]= b;\n}\nreturn dp[n][d];\n}\nint main()\n{\n\tint i,j;\n\tfor(i=0;i<102;i++)\n\t\tfor(j=0;j<102;j++)\n\t\t\tdp[i][j]=-1;\nint n,k,d;\nscanf(\"%d%d%d\",&n,&k,&d);\nprintf(\"%d\",ktree(n,k,d));\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3cf4e500c9e38f601db0ebfc309a021a", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "4c1627b1846803f08904ab82be599f9b", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4398576512455516, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint countPaths(int n, int k, int d) {\n\tlong long state[n+1][2], sum;\n\tint i, j;\n\tstate[0][0] = 1;\n\tstate[1][0] = 1;\n\t\n\tfor(i=0;i=0 && i<=k ;i++) {\n\t\t\tsum += (state[j-i][0])%1000000007ll;\n\t\t}\n\t\tstate[j][0] = sum%1000000007ll;\n\t}\n\n\tfor(j=d+1;j<=n;j++) {\n\t\tsum = 0;\n\t\tfor(i=1; j-i>=0 && i<=k ; i++) {\n\t\t\tsum+= ((i>=d)?state[j-i][0]:state[j-i][1])%1000000007ll;\n\t\t}\n\t\tstate[j][1] = sum%1000000007ll;\n\t}\n\n\treturn state[n][1];\n}\n\nint main() {\n\tlong long sum;\n\tint n, k, d;\n\t\n\tscanf(\"%d\", &n);\n\tscanf(\"%d\", &k);\n\tscanf(\"%d\", &d);\n\tsum = countPaths(n, k, d);\n\tprintf(\"%I64d\", sum);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "82b4eef1801bcc1f6e97bfc6fb0904d4", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "99d4ba120dab54e8c4d6cae2b3109612", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9616613418530351, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "\n#include \n\nusing namespace std;\n\nint main(){\n\tchar fst, scn;\n\tint first, second;\n\tunsigned long long int n;\n\tunsigned long long int m;\n\tscanf(\"%c %c\",&fst, &scn);\n\tscanf(\"%I64d\",&n);\n\tfirst = (int)fst;\n\tsecond = (int)scn;\n\tint f,s;\n\n\tif((first == 94 && second == 118 )||(first == 62 && second == 60) || (first == 118 && second == 94 ) || (first == 60 && second == 62)){\n\t\tprintf(\"undefined\\n\");\n\t\treturn 0;\n\t}\n\tint a[4];\n\ta[0] = 94;\n\ta[1] = 62;\n\ta[2] = 118;\n\ta[3] = 60;\n\tfor(int i = 0; i < 4; i++){\n\t\tif(a[i] == (int)first)\n\t\t\tf = i;\n\t\tif(a[i] == (int)second)\n\t\t\ts = i;\n\t}\t\n\t\n\tint l = s - f;\n\tif(l == 1 || l == -3){\n\t\tif(n % 4 == 1)\n\t\t\tprintf(\"cw\\n\");\n\t\telse if(n % 4 == 3)\n\t\t\tprintf(\"ccw\\n\");\n\t\telse{\n\t\t\tprintf(\"undefined\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\n\tif(l == -1 || l == 3){\n\t\tif(n % 4 == 3)\n\t\t\tprintf(\"cw\\n\");\n\t\telse if(n % 4 == 1)\n\t\t\tprintf(\"ccw\\n\");\n\t\telse{\n\t\t\tprintf(\"undefined\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e3c072a285cb8c27a8dd4be9a8d50bdd", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "8a990ac010b39e695761fbe4232815d9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9822784810126582, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n\nint main(){\n int c,l;\n\n while(c=getchar()) l=isalpha(c)?c:l;\n printf(strchr(\"AEIOUYaeiouy\",l)?\"YES\\n\":\"NO\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "afc7ea00e74b98e8902c5c5c464d9d66", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "3be262fc66812e303b8f58e1bef9fb73", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9918854415274463, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#define REP(i,a,b) for(i=a;i>1])for(j=(i*i)>>1;j b) break;\n solve(send, i+1, num+1);\n }\n}\n\nint is_prime(int n){\n int i;\n rep(i,ps){\n if(in[i]*in[i] > n) break;\n if(n%in[i]==0) return 0;\n }\n return 1;\n}\n\nint main(){\n int i,j,k,l,m;\n\n ps = getPrime(N,p);\n\n while(scanf(\"%d%d%d\",&a,&b,&n)==3){\n rep(i,ps) if(n==p[i]) break;\n if(i==ps){\n if(a<=n && n<=b && is_prime(n)) puts(\"1\"); else puts(\"0\");\n continue;\n }\n\n pp = i;\n res = 0;\n solve(n,0,0);\n\n printf(\"%d\\n\",(int)res);\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3f44ef4efabdb8b18c87106767226c95", "src_uid": "04a26f1d1013b6e6b4b0bdcf225475f2", "apr_id": "5c912af514a1d07284153c60ec42e392", "difficulty": 2400, "tags": ["dp", "math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.995475113122172, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint l[26]={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},prime[2000001];\nchar hash[20000001];\nint k,a,b,ans=0;\n\nvoid dfs(int now,int s,int f)\n{\n if (l[now]==k)\n ans+=f*(b/s-(a-1)/s);\n else\n {\n dfs(now+1,s,f);\n if ((long long)s*l[now]<=b)\n dfs(now+1,s*l[now],-f);\n }\n}\n\nint main()\n{\n int i,j,o=0;\n scanf(\"%d%d%d\",&a,&b,&k);\n b/=k;\n a=(long long)(a+k-1)/k;\n for (i=2;i*i<=k&&k%i;i++);\n if (i*i>k)\n if (k<=100)\n dfs(0,1,1);\n else\n {\n ans+=(a==1&&b>=1);\n for (i=2;i<=b;i++)\n {\n if (!hash[i])\n {\n ans+=(i>=k&&a<=i);\n prime[++o]=i;\n }\n for (j=1;prime[j]*i<=b;j++)\n {\n hash[prime[j]*i]=1;\n ans+=(prime[j]>=k&&a<=i);\n if (i%prime[j]==0)\n break;\n }\n }\n }\n printf(\"%d\\n\",ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8cac6b1e81550a9c681f04c465136b43", "src_uid": "04a26f1d1013b6e6b4b0bdcf225475f2", "apr_id": "999c32d179ac0b2cb0077c88e96b5964", "difficulty": 2400, "tags": ["dp", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9110512129380054, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int n,a,b;\n scanf(\"%d%d%d\",&n,&a,&b);\n if(a+1>=n-b)\n return n+1-a-1;\n else\n return n+1-n+b;\n return 0;\n }\n", "lang": "GNU C", "bug_code_uid": "c9c576c3b04ada0e6c013d436a552b22", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "f44b9b376405ac9f8327507a098f38db", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999247554552295, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \nint main()\n{\n int n, k, d, q, i, j;\n scanf(\"%d\\n\", &q);\n while(q--)\n {\n scanf(\"%d%d%d\",&n,&k,&d);\n static int a[101], b[101];\n for(i=0; i t)\n ans = t;\n memset(b,0,sizeof(b);\n }\n printf(\"%d\\n\", ans);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "bb7136f3b3cd7f8fdfb30ae0bbf7b638", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "396770cb51e19926feac05dfbbb34612", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4082085413200222, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nint main(){\n\n int n,i,j,k,l,t;\n\n scanf(\"%d\",&t);\n\n for(i=0;i\n#include \nvoid main()\n{\nint v=1,x,n,longeur=0;\n\n\nwhile (n!=0 && v==1)\n{\n\tx=n%10;\n\tif (x!=4 && x!=7) \n\t{\n\t v=0;\t\n\t}\n\tn/=10;\n\tlongeur+=1;\t\n}\n\nif (v==0)\nprintf(\"YES\");\nelse \n{\n\tif (longeur!=7 && longeur!=4)\n\tprintf(\"NO\");\n\telse\n\tprintf(\"YES\");\n}\n}", "lang": "GNU C", "bug_code_uid": "842507eb04e29143a851bda1e991af93", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "ae0a037dc7da256beb3f09ebaee03639", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9509433962264151, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nlong long int a[1000000];\nmain()\n{\n\tlong long int temp,j,n,m,b;\n\tint i=0;\n\tscanf(\"%lld%lld\",&n,&m);\n\ttemp=m;\n\twhile(m>n)\n\t{\n\t\tif(m%2==0)\n\t\t{m/=2;\n\t\ta[i]=m;}\n\t\telse if((m-1)%10==0)\n\t\t{m=(m-1)/10;\n\t\ta[i]=m;}\n\t\ti++;\n\t}\n\tif(m!=n)\n\tprintf(\"NO\");\n\telse\n\t{\n\t\tprintf(\"YES\\n\");\n\t\tprintf(\"%d\\n\",i+1);\n\t\tfor(j=i-1;j>=0;j--)\n\t\tprintf(\"%d \",a[j]);\n\t\tprintf(\"%d\",temp);\n\t}\n}", "lang": "GNU C", "bug_code_uid": "598baf3989d677bd56c2ebcb9898db39", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "081b72b8a3b3459009ce921f68d43d97", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9240780911062907, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tint i;\n\twhile(n>=1)\n\t{\n\t\tint m=n%10;\n\t\tn/=10;\n\t\tif(m>=5)\n\t\t{\n\t\t\tprintf(\"-O\");\n\t\t\tprintf(\"|\");\n\t\t\tm=m-5;\n\t\t\t\n\t\t\tfor(i=0;i\n\nint main(){\n int n = 0;\n double s = 0, xm = 0, ym = 0, xl = 31400, yl = 31400;\n scanf(\"%d\", &n);\n while(n--){\n double x1, y1, x2, y2;\n scanf(\"%lf %lf %lf %lf\", &x1, &y1, &x2, &y2);\n s = (y2-y1)*(x2-x1) + s;\n if(x1<=xl)xl = x1;\n if(y1<=yl)yl = y1;\n if(x2>=xm)xm = x2;\n if(y2>=ym)ym = y2;\n }\n if( x2-x1 == y2-y1 &&s == (m-l)*(m-l)){\n printf(\"YES\\n\");\n }\n else{\n printf(\"NO\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3e2189f071fc2912114e32590afb2dd5", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "eb4e819847fd7546646be9a61b52e169", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.976083707025411, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint arr[6][4];\n\nint main()\n{\n int n,s_x1,s_x2,s_y1,s_y2,i,j;\n long int sum;\n while(~scanf(\"%d\",&n))\n {\n sum=0;\n s_x1=99999,s_x2=0,s_y1=99999,s_y2=0;\n for(i=0;is_x2)s_x2=arr[i][2];\n if(arr[i][3]>s_y2)s_y2=arr[i][3];\n }\n if(sum!=(s_x2-s_x1)*(s_y2-s_y1))puts(\"NO\");\n else puts(\"YES\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "048ded418fa443e2f520e17fe292df29", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "69c1138245d4597d674313443f5f0bb9", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2846153846153846, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n long long int n,i,sum=0,count=0,flag=0,rem;\n\n scanf(\"%I64d\",&n);\n\n for(i=1;i<=n;i++)\n {\n rem=n-sum;\n if(i%2==1&&(n-sum)>=1)\n {\n sum=sum+1;\n flag=1;\n count++;\n }\n else if(i%2==0&&(n-sum)>=2)\n {\n sum=sum+2;\n flag=2;\n count++;\n }\n if(rem<2&&flag==1)\n {\n break;\n }\n }\n printf(\"%I64d\",count);\n\n}\n", "lang": "GNU C", "bug_code_uid": "0eaaeb0c224ba69cde36a0c9d697baa3", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "e4a069ae204f6cbbcaeffb1a92fd31b0", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.11383928571428571, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "#include\nint arr[5][3]={{0,0,0},{2,3,4},{1,3,4},{1,2,4},{1,2,3}};\nint recursion(int i,int k)\n{\n int a=0,j;\n if(k==0&&i==1)\n return 1;\n if(k==0&&i!=1)\n return 0;\n for(j=0;j<3;j++)\n a+=recursion(arr[i][j],k-1);\n return a;\n}\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n printf(\"%d\",recursion(1,n));\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "d81efa2ce19c3cfbebcb806dd1bc9f33", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "41391ac1138de54e9e46584ebd084166", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9157418824496506, "equal_cnt": 15, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nint main() {\n int l, r, x, y, ef;\n scanf(\"%d %d %d %d %d\", &l, &r, &x, &y, &ef);\n\n float xp_mid, c_mid, find = 0;\n for (float i = l; i <= r; i += ef - l) {\n int xx = x, yy = y;1 100000 1 100000 100000\n while (xx <= yy) {\n c_mid = (xx + yy) / 2;\n // printf(\"%f / %f = %f\\n\", i, c_mid, i / c_mid);\n\n if (ef > i / c_mid) {\n yy = c_mid - 1;\n } else if (ef < i / c_mid) {\n xx = c_mid + 1;\n } else {\n find = 1;\n break;\n }\n }\n if (find)\n break;\n }\n\n /*while (l <= r) {\n xp_mid = (l + r) / 2;\n int xx = x, yy = y;\n while (xx <= yy) {\n c_mid = (xx + yy) / 2;\n printf(\"%f / %f = %f\\n\", xp_mid, c_mid, xp_mid / c_mid);\n\n if (ef > xp_mid / c_mid) {\n yy = c_mid - 1;\n } else if (ef < xp_mid / c_mid) {\n xx = c_mid + 1;\n } else {\n find = 1;\n break;\n }\n }\n\n if (find)\n break;\n else {\n if (ef > xp_mid / c_mid) {\n l = xp_mid + 1;\n } else if (ef < xp_mid / c_mid) {\n r = xp_mid - 1;\n } else {\n find = 1;\n break;\n }\n }\n }*/\n\n printf(find ? \"YES\\n\" : \"NO\\n\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "883cf5225325886281f116a32d75ffde", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "84f892acce39f14b4640ce7595d47ff8", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.13370786516853933, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint main()\n{\n int x[3]={-1,-1,-1},i,j,n,y,c=0,test=1,temp;\n scanf(\"%d\",&n);\n for (i=0;i2)\n {\n printf(\"-1\");\n return 0;\n }\n\n }\n if(c==1)\n {\n if(abs(x[0]-x[1])%2)\n printf(\"%d\",abs(x[0]-x[1]));\n else\n printf(\"%d\",abs(x[0]-x[1])/2);\n return 0;\n }\n while (test)\n {\n test=0;\n for (i=1;i<3;i++)\n {\n if(x[i]\nint main()\n{\n int array[3][3],i,j,x,y,z;\n for(i=0;i<3;i++)\n for(j=0;j<3;j++)\n scanf(\"%d\",&array[i][j]);\n y=((array[0][1]+array[0][2])+array[2][0]+array[2][1]-array[1][0]-array[1][2])/2;\n array[1][1]=y;\n x=array[1][0]+array[1][1]+array[1][2]-array[0][1]-array[0][2];\n z=array[1][0]+array[1][1]+array[1][2]-array[2][0]-array[2][1];\n array[0][0]=x;\n array[2][2]=z;\n for(i=0;i<3;i++)\n {\n for(j=0;j<3;j++)\n printf(\"%d \",array[i][j]);\n printf(\"\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4aab19e4ad35d50db3a00292a980bc68", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "cd1d3fe4e15426ddaa92cc0d1adf19e0", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3154435925520263, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint ar[3][3];\nint main()\n{\n\tint i,j;\n\tfor(i=0;i<3;i++)\n\t{\n\t\tscanf(\"%d %d %d\",&ar[i][0],&ar[i][1],&ar[i][2]);\n\t}\n\tint s;\n\ts=ar[0][1]+ar[0][2];\n\ti=1;\n\twhile(1)\n\t{\n\t\ts=s+i;\n\t\tif(s%3==0)\n\t\t{\n\t\t\tif(((3*s) -(ar[0][1]+ar[0][2]+ar[1][0]+ar[1][2]+ar[2][0]+ar[2][1]))==s)\n\t\t\tbreak;\n\t\t}\n\t\ti++;\n\t}\n\tprintf(\"%d %d %d\\n\",s-(ar[0][1]+ar[0][2]),ar[0][1],ar[0][2]);\n\tprintf(\"%d %d %d\\n\",ar[1][0],s-(ar[1][0]+ar[1][2]),ar[1][2]);\n\tprintf(\"%d %d %d\\n\",ar[2][0],ar[2][1],s-(ar[2][0]+ar[2][1]));\n\treturn 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "0a4b646daef58178a345599788609833", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "8cb8b7c3fcd51a2ab24d74c00ed3be97", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4642507345739471, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\n\nint deco(int x){\n int a = x;\n int n=0;\n while(a>=10){\n n+= a%10;\n a = a/10; \n }\n n+=a%10;\n return n;\n}\n\nint main(){\n long int a;\n scanf(\"%ld\",&a);\n long int max=0;\n long int x,y;\n long int b,d;\n for(long int c = 1;c<(a/2)+1;c++){\n x = deco(c);\n y = deco(a-c);\n if(x+y > max){\n\t max = x+y;\n\t b =c;\n\t d =a-c;\n\t}\n }\n printf(\"%ld\",max);\n}\n", "lang": "GNU C11", "bug_code_uid": "d061a606097f49d81e03ab21f0a1109a", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "5cf08b90b2e672582a00bd300c94aa84", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9951456310679612, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#define F for(i=1;i<=n;i++)\nlong long i,j,m,n,r,f[250107]={1};\nint main(){\n\tscanf(\"%lli%lli\",&n,&m);\n\tF f[i]=f[i-1]*i%m;\n\tF r=(r+f[i]*f[n-i+1]%m*(n-i+1)%m)%m;\n\treturn printf(\"%lli\",r);\n}\n", "lang": "GNU C11", "bug_code_uid": "bdf0af3c7e23f9e5e7615c83d947542e", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "d2d41ec6582c013db2ee819a5d5310d9", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.978675645342312, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nlong long fac[250005];\n\nint main()\n{\n int n, m;\n long long ans = 0;\n scanf(\"%d%d\", &n, &m);\n\n fac[0] = 1;\n for(int i = 1; i <= n; i++){\n fac[i] = (fac[i - 1] * i) % m;\n }\n\n for(int i = 0; i < n; i++){\n ans += (fac[i + 1] * fac[n - i]) % m;\n ans %= m;\n }\n\n ans = (ans * (n + 1)) % m;\n if(ans % 2 == 1) ans = (ans + m) / 2;\n\n printf(\"%I64d\", ans);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "94265b062a077e0200c725b343a89d60", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "7e912c2e8ec2908acf34eaaa0d8d70be", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9090909090909091, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main(){\n\tint a1,a2,k1,k2,n;\n\tscanf(\"%d%d%d%d%d\",&a1,&a2,&k1,&k2,&n);\n\tint min_players=0;\n int max_players=0;\n int larger_cards,lower_cards,lower_team,larger_team;\n if(k1>=k2){larger_cards=k1; larger_team=a1; lower_cards=k2; lower_team=a2;}\n else{lower_cards=k1; lower_team=a1; larger_cards=k2; larger_team=a2;}\n\n if(n>(a1*(k1-1)+a2*(k2-2)))\n {min_players=n-(a1*(k1-1)+a2*(k2-1));}\n printf(\"%d \",min_players);\n while(n>=lower_cards)\n {\n \tif(lower_team>0)\n \t{n=n-lower_cards;\n \tmax_players++;\n \tlower_team--;\n \t}\n \telse if((larger_team>0)&&(n>=larger_cards))\n \t {\n \t\tn=n-larger_cards;\n \t\tmax_players++;\n \t\tlarger_team--;\n \t }\n\n }\n printf(\"%d\",max_players);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "42ec3af22b52bc0666e85fce174be81a", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "9bd09c31dc947409c68077f4cf236526", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9976275207591934, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main()\n{\n\n int a1,a2,k1,k2,n;\nwhile(1){\n scanf(\"%d\",&a1);\n scanf(\"%d\",&a2);\n scanf(\"%d\",&k1);\n scanf(\"%d\",&k2);\n scanf(\"%d\",&n);\n\n int max,min;\n\n if(k1=a1*k1)\n max = a1+(n-a1*k1)/k2;\n\n else\n max = n/k1;\n }\n\n else if(k2=a2*k2)\n max = a2+(n-a2*k2)/k1;\n else\n max = n/k2;\n }\n\n else{\n if(a1>a2){\n if(n>=a1*k1)\n max = a1+(n-a1*k1)/k2;\n\n else\n max = n/k1;\n }\n else{\n if(n>=a2*k2)\n max = a2+(n-a2*k2)/k1;\n else\n max = n/k2;\n }\n }\n\n min = n-a1*(k1-1)-a2*(k2-1);\n if(min<0)\n min = 0;\n\n printf(\"%d %d\\n\",min,max);\n}\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c4632f4a2c2ed34fe7d0bf409e974cd0", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "e208062e163fa9d1b7cd472b655a9706", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9113924050632911, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define ll long long\nint main()\n{\n\tll n,k;\n\tscanf(\"%lld %lld\", &n,&k);\n\tfor(int i=1;i<=k;i++)\n\t\tfor(int j=i+1;j<=k;j++){\n\t\t\tif(n%i==n%j){\n\t\t\t\tprintf(\"No\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\tprintf(\"Yes\");\n}", "lang": "GNU C", "bug_code_uid": "e692542210d3107ff6aafcb7acc192cd", "src_uid": "5271c707c9c72ef021a0baf762bf3eb2", "apr_id": "f5ae9611705eda71ef8547dc7e66420a", "difficulty": 1600, "tags": ["brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.24469820554649266, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "import java.io.*;\nimport java.util.*;\nimport java.lang.Math;\n\npublic class CodeForces {\n\n private static final Scanner scanner = new Scanner(System.in);\n\n public static void main(String[] args) throws IOException {\n int w = scanner.nextInt();\n int h = scanner.nextInt();\n long ans = (long) (4*Math.pow(2,w-1)*Math.pow(2,h-1))%998244353;\n scanner.close();\n System.out.println(ans);\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "e7ffc0e9e505cc20dd8c7ae858842871", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "apr_id": "825095a09720572038de2e5a00793ff5", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9057591623036649, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int h,w,c;\n scanf(\"%d %d\",&h,&w);\n long long s1;\n s1 = h+w;\n for(i=1;i<=n;i++)\n s1 = (2*s1)%mod;\n printf(\"%I64d\\n\",s1);\n}", "lang": "GNU C11", "bug_code_uid": "1af4c9473d049b7641fd3c449790d9bc", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "apr_id": "36782c7941fe4c184e5fdb95d2dd6109", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7022900763358778, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\n#define mod 998244353\nint main()\n{\n int h,w;\n scanf(\"%d %d\",&h,&w);\n long long ans = ((1<\n#include\n#include\nint main()\n{\n char s[200],c,s1[100]; int i,a,len,f=0,p=0,ex,ind;\n\n\n\n gets(s);\n len = strlen(s);\n\n for(i=0;i\nint i,j,n,m;\nint a,b;\nchar s[500];\n\nint main()\n{\n\tscanf(\"%s\",s);\n\tn=strlen(s);\n\ta=s[0]-'0';\n\ti=n;\n\twhile (s[i]!='e') i--;\n\tfor (j=i+1;j=n-2)\n\t{\n\t\tj=1;\n\t\twhile (b>0&&s[j]=='0')\n\t\t{\n\t\t\tj++;\n\t\t//\tb--; \n\t\t} \n \n\t\tfor (i=j;i0&&s[j]=='0')\n\t\t{\n\t\t\tj++;\n\t\t\tb--; \n\t\t} \n\t\tif (b==0)\n\t\t{\n\t\t\tprintf(\"%c.\",s[j]);\n\t\t\tfor (i=2;i\nint main()\n{\nlong long int n, d,sum=0;\nscanf(\"%lld\",&n);\nscanf(\"%lld\",&d);\nprintf(\"\\n\");\nint i,t[10];\nfor(i=0;i\n#include\n\nint cmpfunc(const void *a, const void *b){\n return (*(int *)a) - (*(int *)b);\n}\n\nint main(){\n long long int a,b;\n int arr1[20],arr2[20],flag[20]={0},i=0,n1,n2,j,final[20],t,tatti=0;\n scanf(\"%lld %lld\",&a,&b);\n while(a>0){\n arr1[i] = a%10;\n a=a/10;\n i++;\n }\n n1 = i;\n i=0;\n while(b>0){\n arr2[i] = b%10;\n b=b/10;\n i++;\n }\n n2 = i;\n i--;\n t=0;\n qsort(arr1,n1,sizeof(int),cmpfunc);\n if(n1=0;i--) printf(\"%d\",arr1[i]);\n }\n else{\n while(t!=n1){\n for(j=n1-1;j>=0;j--){\n if(flag[j]==0 && arr1[j]<=arr2[i]){\n if(arr1[j] < arr2[i]) tatti = 1;\n final[t] = arr1[j];\n flag[j]=1;\n t++;\n i--;\n break;\n }\n }\n if(tatti==1){\n for(j=n1-1;j>=0;j--){\n if(flag[j]==0){\n final[t] = arr1[j];\n t++;\n }\n }\n }\n }\n for(i=0;i\nint main()\n{ int n,k=0,d,j,s,i;\nint *t;\nscanf(\"%d\",&n);\nfor(i=1;i\n/*\nlong long int fact(long long int n); \n \nlong long int nCr(long long int n,long long int r) \n{ \n return fact(n) / (fact(r) * fact(n - r)); \n} \n \n// Returns factorial of n \nlong long int fact(long long int n) \n{ \nif (n >= 1)\n return n*fact(n-1);\n else\n return 1;\n} \n*/\n\nmain(){\n\tlong long int i,j,kmax,kmin=0,n,m,teams,m1,j1=0,temp,a;\n\tscanf(\"%lld %lld\",&n,&m);\n\t\n\tm1=m;\n\tteams=n;\n\twhile(m1>0){\n\t\ttemp=teams/m1;\n\t\tteams=teams-temp;\n\t\tm1--;\n\t\ta=(temp*(temp-1))/2;\n\t\tkmin=kmin+a;\n\t}\n\t\n\t\n\tn=n-m+1;\n\t//printf(\"%d %d %d ---- check\",kmax,n,m);\n\tkmax=(n*(n-1))/2;\n\tprintf(\"%lld %lld\",kmin,kmax);\n\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "be54b8017c1a5ab2f3c01affb0db90b3", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "da0b6f53a7ac05ad77636ce53e56c355", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9948542024013722, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\nchar a[20];\nscanf(\"%s\",a);\nint sum=a[0]-'a',len=strlen(a),i;\nif(sum>12)\n sum=26-sum;\nfor(i=1;i12)\n t=26-t;\n sum=t+sum;\n}\nprintf(\"%d\",sum);\nreturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "c2e54f9add547351558cbb94d7f37e6a", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "db29ff6556211417370b0dc80b6ff46d", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9950248756218906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int n;\n scanf(\"%d\",n);\n printf(\"%d\",3*n/2);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "7879747fa815a4340e80726d5de64b64", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "438d27332687297065cb2b0bf59c0103", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9696363029696363, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int ans=0,sum1,sum2,a1=0,a2=0,b1=0,b2=0,k,i,j;\n char a[15],b[15],sum[15];\n i=0;k=1;\n a[i]=getchar();\n if(a[i]!='0')\n a1=a1*10+(int)a[i]-48;\n a2=a2*10+(int)a[i]-48;\n while(a[i]!='\\n')\n {\n i++;\n a[i]=getchar();\n if(a[i]!='\\n')\n {\n if(a[i]!='0')\n a1=a1*10+(int)a[i]-48;\n a2=a2*10+(int)a[i]-48;\n }\n }\n //printf(\"%d %d\\n\",a1,a2);\n b[i]=getchar();\n if(b[i]!='0')\n b1=b1*10+(int)b[i]-48;\n b2=b2*10+(int)b[i]-48;\n while(b[i]!='\\n')\n {\n i++;\n b[i]=getchar();\n if(b[i]!='\\n')\n {\n if(b[i]!='0')\n b1=b1*10+(int)b[i]-48;\n b2=b2*10+(int)b[i]-48;\n }\n }\n // printf(\"%d %d\\n\",b1,b2);\n\n sum1=a1+b1;\n //printf(\"sum1=%d\\n\",sum1);\n sum2=a2+b2;\n //printf(\"%d\\n\",sum2);\n\n k=10;\n while(sum2/k!=0)\n k=k*10;\n i=0;\n //printf(\"%d\\n\",k);\n while(k!=1)\n {\n k=k/10;\n sum[i]=sum2/k;\n sum2=sum2%k;\n //printf(\"%d \",sum[i]);\n if(sum[i]!=0)\n i++;\n }\n sum2=0;\n k=1;\n for(j=i-1;j>=0;j--)\n {\n sum2=sum2+sum[j]*k;\n k=k*10;\n // printf(\"%d \",sum[j]);\n }\n // printf(\"sum2=%d\",sum2);\n /*for(j=i-1;j>=0;j--)\n printf(\"%d \",sum[j]);*/\n if(sum1==sum2)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f4b50f3092b0b199fc5c54f044cb1391", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "9d9958fccd32a54f687441a509aafde4", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3515439429928741, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n\n\ntypedef long long ll;\n\nint main(){\n\nll n,m ;\nint i,j,k;\nchar * a;\n\nscanf(\"%\",&);\n\n\nfor (i=0;i\ntypedef long long int ll;\nint main()\n{\n\tll n,k;\n\tscanf(\"%lld%lld\",&n,&k);\n\tll ans=n;\n\tll count,i;\n\tfor(i=n-1;i>0;i--)\n\t{\n\t\tll temp=ans^i;\n\t\tif(temp>ans)\n\t\t{\n\t\t\tans=temp;\n\t\t\tcount++;\n\t\t}\n\t\tif(count==k) break;\n\t}\n\tprintf(\"%lld\",ans);\n\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e03161b12ed3e44cf9e4fe4a7f4d0fb5", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "2e4228f4a793ceb367f7cf6c1c384267", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9640718562874252, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#define MAXN 53\n#define MAXW 500003\nint dp[MAXW]={1};\nint n,d,c[MAXN];\nint ans,day;\n\nint main()\n{\n\tint i,j,k,sum=0;\n\n\tscanf(\"%d%d\",&n,&d);\n\tfor(i=0;i=c[i];j--,k--)\n\t\t\tif(dp[j]==0 && dp[k]==1)dp[j]=1;\n\t}\n\n\tans=day=0;\n\twhile(1)\n\t{\n\t\tfor(i=ans+d;i>ans;i--)\n\t\t{\n\t\t\t//printf(\"now i %d %d\\n\",ans,i);\n\t\t\tif(dp[i]==1)break;\n\t\t}\n\t\tif(i==ans)break;\n\t\tans=i;\n\t\t++day;\n\t}\n\tprintf(\"%d %d\\n\",ans,day);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1d448489957a6d66df33ec242eef7757", "src_uid": "65699ddec8d0db2f58b83a0f64de6f6f", "apr_id": "acbcf40abcba3676d3c4a7c81ded2e9b", "difficulty": 2200, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.3081081081081081, "equal_cnt": 27, "replace_cnt": 22, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 26, "bug_source_code": "#include \n\nint a[60];\nint z[60];\nint dp0[500100] ,la0[500100];\nint dp1[500100] ,la1[500100];\nint main(void)\n{\n\tint n ,d;\n\tint ans1 ,ans2;\n\tint sum;\n\tint i ,j ,j2;\n\tint aa;\n\tint gg;\n\t\n\twhile (scanf(\"%d %d\" ,&n ,&d)!=EOF)\n\t{\n\t\tsum=0;\n\t\tfor (i=1 ; i<=n ; i++)\t\n\t\t{\n\t\t\tscanf(\"%d\" ,&a[i]);\n\t\t\tsum+=a[i];\n\t\t\tz[i]=1;\n\t\t}\n\t\tans1=0;\n\t\tans2=0;\n\t\twhile (1)\n\t\t{\n\t\t\tfor (j=1 ; j<=sum ; j++)\n\t\t\t{\n\t\t\t\tdp1[j]=0;\t\n\t\t\t}\n\t\t\tdp1[0]=-1;\n\t\t\tfor (i=1 ; i<=n ; i++)\n\t\t\t{\n\t\t\t\tif (z[i])\n\t\t\t\t{\n\t\t\t\t\taa=a[i];\n\t\t\t\t\tfor (j=sum-aa ; j>=0 ; j--)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (dp1[j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!dp1[j+aa])\t\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdp1[j+aa]=i;\n\t\t\t\t\t\t\t\tla1[j+aa]=j;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (j=1 ; j<=sum ; j++)\n\t\t\t{\n\t\t\t\tdp0[j]=0;\t\n\t\t\t}\n\t\t\tdp0[0]=-1;\n\t\t\tfor (i=1 ; i<=n ; i++)\n\t\t\t{\n\t\t\t\tif (!z[i])\n\t\t\t\t{\n\t\t\t\t\taa=a[i];\n\t\t\t\t\tfor (j=sum-aa ; j>=0 ; j--)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (dp0[j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!dp0[j+aa])\t\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdp0[j+aa]=i;\n\t\t\t\t\t\t\t\tla0[j+aa]=j;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\tgg=ans1;\t\n\t\t\tfor (i=ans1+d ; i ; i--)\n\t\t\t{\n\t\t\t\tif (i>sum)continue;\n\t\t\t\tif (dp1[i])\n\t\t\t\t{\n\t\t\t\t\tfor (j=i-d ;; j++)\t\n\t\t\t\t\t{\n\t\t\t\t\t\tif (j>=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (dp0[j])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n//\t\t\t\t\tprintf(\"%d %d %d\\n%d %d %d %d\\n%d %d\\n\" ,ans1 ,i ,j ,dp1[1] ,dp1[2] ,dp1[3] ,dp1[4] ,z[1] ,z[2]);\t\t\t\t\t\n\t\t\t\t\tans1+=(i-j);\n\t\t\t\t\tans2++;\n\t\t\t\t\tj2=i;\n\t\t\t\t\twhile (dp1[j2]!=-1) \n\t\t\t\t\t{\n\t\t\t\t\t\tz[dp1[j2]]=0;\n\t\t\t\t\t\tj2=la1[j2];\t\n\t\t\t\t\t}\n\t\t\t\t\tj2=j;\n\t\t\t\t\twhile (dp0[j2]!=-1) \n\t\t\t\t\t{\n\t\t\t\t\t\tz[dp0[j2]]=1;\n\t\t\t\t\t\tj2=la0[j2];\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ans1==gg)\n\t\t\t{\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d %d\\n\" ,ans1 ,ans2);\n\t}\n\t\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ce4f05c715d016930f6cdf222f8ac5bd", "src_uid": "65699ddec8d0db2f58b83a0f64de6f6f", "apr_id": "bb8af9ede52ee2cdedc46b8f008936d5", "difficulty": 2200, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9916805324459235, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \nint dp[500100];\nint main()\n{\n int n,d,i,x,sum,ans,ans1,j;\n scanf(\"%d%d\",&n,&d);\n sum=0;\n dp[0]=1;\n for(i=0;i=x;j--){\n if(dp[j-x])\n dp[j]=1;\n }\n }\n ans=ans1=0;\n while(1)\n {\n j=ans+d;\n while(j>ans&&!dp[j])\n j--;\n if(j==ans)\n break;\n ans=j;\n ans1++;\n }\n printf(\"%d %d\\n\",ans,ans1);\n \n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "ef7d98c2e642981342fa357e0d77b893", "src_uid": "65699ddec8d0db2f58b83a0f64de6f6f", "apr_id": "a5f598423740d3999c90d78751271329", "difficulty": 2200, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9045801526717557, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main(){\n int w1, h1, w2, h2;\n\n while(scanf(\"%d %d %d %d\", &w1, &h1, &w2, &h2))\n {\n if(w1 == w2)\n printf(\"%d\\n\", w1+w2+(h1+h2)*2+4);\n else\n printf(\"%d\\n\", w1+w2+(h1+h2)*2+4+w1-w2);\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6a1942e17b5e14cafc86862f0f0c22f5", "src_uid": "b5d44e0041053c996938aadd1b3865f6", "apr_id": "a28e0dc8a30c1a4bc499b7c0191a376a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7938931297709924, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main(){\n\tint t,s,x,i,flag=0;\n\tscanf(\"%d %d %d\",&t,&s,&x);\n\tif(t==x){\n\t\tprintf(\"YES\");\n\t\treturn 1;\n\t}\n if(x-t-1!=0){\n\t\tif((x-t)%(s)==0 || (x-t-1)%(s)==0){\n\t\t\tprintf(\"YES\");\n\t\t}\n\t}\n\telse{\n\t\tprintf(\"NO\");\n\t}\t\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "301c81fa6b9a5cc5a08d70ce5e370ff1", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "5c1e678ba594329fbc440d042501330d", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9792746113989638, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main() {\n int c, hold, x = 0;\n scanf(\"%d\", &c);\n hold = c;\n while (1) {\n if (c == 0) {\n if (x % 4 == 0) {\n break;\n } else {\n x = 0;\n hold+=1;\n c = hold;\n }\n }\n x = x + c % 10;\n c/=10;\n }\n printf(\"%d\", x);\n return x;\n\n}", "lang": "GNU C11", "bug_code_uid": "7c0afb2467b691816a0cc50d971e26e8", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "f797a872c30584b63b52f637da373197", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9644736842105263, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nlong long int abs(long long int n)\n{\n\tif (n < 0)\n\t\tn *= -1;\n\treturn n;\n}\nint main()\n{\n\tlong long int x0, y0, ax, ay, bx, by;\n\tscanf(\"%lld %lld %lld %lld %lld %lld\", &x0, &y0, &ax, &ay, &bx, &by);\n\tlong long int xs, ys, t;\n\tscanf(\"%lld %lld %lld\", &xs, &ys, &t);\n\tlong long int x[102], y[102];\n\tx[0] = x0;\n\ty[0] = y0;\n\tlong long int i, j;\n\tfor (i = 0; x[i] <= t && y[i] <= t; i++)\n\t{\n\t\tx[i + 1] = ax * x[i] + bx;\n\t\ty[i + 1] = ay * y[i] + by;\n\t}\n\tlong long int c = i + 1;\n\tlong long int ans = 0;\n\tfor (i = 0; i < c; i++)\n\t\tfor (j = 0; j < c; j++)\n\t\t\tif (abs(xs - x[i]) + abs(ys - y[i]) + abs(x[i] - x[j]) + abs(y[i] - y[j]) <= t)\n\t\t\t\tif (ans < abs(i - j) + 1)\n\t\t\t\t\tans = abs(i - j) + 1;\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "ac690df259bac87547241bfbbfa9a897", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "1e3c5d97184d95ff9f4b5a4b1927b05a", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.12735849056603774, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include \n#define mod 1000000007ll\n\nlong long n,k;\nlong long dp[2001][2001];\n\nlong long f(long long i,long long j)\n{\n\t//printf(\"%I64d %I64d\\n\",i,j );\n\n\n\tif(dp[i][j] > 0)\n\t\treturn dp[i][j];\n\n\tif(i<2)\n\t\treturn 1;\n\n\tlong long ret = 0ll;\n\tlong long k;\n\tfor(k = j;k>0;k--)\n\t\tif(j%k == 0)\n\t\t\tret = (ret%mod + f(i-1,k)%mod)%mod;\n\n\tdp[i][j] = ret;\n\treturn dp[i][j];\n}\n\nint main()\n{\n\tint i;\n\tfor(i=0;i0;i--)\n\t{\t\n\t\tdp[k][i] = f(k,(long long)i);\n\t\t//printf(\"%lld\\n\",(long long)i );\n\t}\n\n\tfor(i=1;i<=n;i++)\n\t\tans = (ans + dp[k][i]%mod)%mod;\n\tprintf(\"%I64d\\n\",ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "7b6a899c10b788f9b6b6054b55d42409", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "28ad6d630efeacf0bd8d841bcb5aa71c", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.20027063599458728, "equal_cnt": 21, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 21, "bug_source_code": "#include\nint mod=1000000007;\nint dp[2001][2001];\nint f(int n,int k);\nint uf(int n,int k)\n{\n\treturn f(n,k)-f(n-1,k);\n}\nint f(int n,int k)\n{\n\n\tif(dp[n][k]!=0)\n\t{\n\t\treturn dp[n][k];\n\t}\n\t\n\tif(n==1)\n\t\tdp[n][k]=1;\n\telse if(k==1)\n\t\tdp[n][k]=n;\n\telse{\n\tint i,p=0,j=0;\n\tint div;\n\tfor(i=n/2;i>=0;i--)\n\t{\n\t\tif(n%i==0)\n\t\t{\n\t\t\tdiv=i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tint non[div];\n\tfor(i=2;i=0;i--)\n\t{\n\t\tif(n%i==0)\n\t\t{\n\t\t\tdiv=i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tprintf(\"%d\",div);*/\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "78cd442c2e7da6ab969169ca5189415e", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "b3b6c8558af11297c303fdfcbf8fab28", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9976798143851509, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main()\n{\n long long d,k,a,b,t,sum=0,cou;\n scanf(\"%lld%lld%lld%lld%lld\",&d,&k,&a,&b,&t);\n if(k>=d) sum=d*a;\n else\n if(k*a+t<=k*b) \n {sum=sum+(d-d%k)*a+(d/k-1)*t;\n \tif(d%k*b\n\nint main()\n{\n\tint n;\n\tscanf(\"%d\", &n)\n\tif (n == 1) printf (\"YES\");\n\tif (n * (n + 1) / 2 % 2 == 1){\n\t\tprintf (\"NO\");\n\t}else{\n\t\tprintf(\"YES\");\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b3ca0018f01c795490e8e1e9852bc695", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "cdbf93475ee6f0210ef18f6c38822a46", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.20256410256410257, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include\nint buocnhay(int a, int b,int n);\nint main()\n{\tint d=0,a=0,b=0,n=0,i=0;\n\tint c[10000];\n\tscanf(\"%d\",&n);\n\ta=1;\n\tb=1;c[b]=-2;\n\tfor (a=1;an) return a+b-n;\n}\n", "lang": "GNU C11", "bug_code_uid": "a2352058292d3a7e95e6f964f0abfd38", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "a771ab0e47a265f95944e82f104861aa", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8429394812680115, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 15, "bug_source_code": "#include\nint A[100009];\n\nlong long pow1(int n, int i)\n{\n long long sum=1,j;\n for(j=1;j<=i;j++) sum*=n;\n return sum;\n}\n\nint rdig(int n)\n{\n int sum=0;\n while(n)\n {\n sum+=n%10;\n n=n/10;\n }\n return sum;\n}\n\nint main()\n{\n int a,b,c,i=1,j=0,sum=0,dig;\n scanf(\"%d %d %d\",&a,&b,&c);\n\n while(sum<=1000000009)\n { sum=b* pow1(i,a) +c;\n if(sum<=0) break;\n //printf(\"%d\\n\",sum);\n dig=rdig(sum);\n if(dig==i){\n A[j]=sum; j++; }\n\n i++;\n\n\n }\n\n printf(\"%d\\n\",j);\n if(j!=0)\n for(i=0;i\n#include\nint main()\n{\n int i,j;\n int ans[125][5]={1,2,3,4,5, 1,2,3,5,4, 1,2,4,3,5, 1,2,4,5,3, 1,2,5,3,4,\n 1,2,5,4,3, 1,3,2,4,5, 1,3,2,5,4, 1,3,4,2,5, 1,3,4,5,2,\n 1,3,5,2,4, 1,3,5,4,2, 1,4,2,3,5, 1,4,2,5,3, 1,4,3,2,5,\n 1,4,3,5,2, 1,4,5,2,3, 1,4,5,3,2, 1,5,2,3,4, 1,5,2,4,3,\n 1,5,3,2,4, 1,5,3,4,2, 1,5,4,2,3, 1,5,4,3,2, 2,1,3,4,5,\n 2,1,3,5,4, 2,1,4,3,5, 2,1,4,5,3, 2,1,5,3,4, 2,1,5,4,3,\n 2,3,1,4,5, 2,3,1,5,4, 2,3,4,1,5, 2,3,4,5,1, 2,3,5,1,4,\n 2,3,5,4,1, 2,4,1,3,5, 2,4,1,5,3, 2,4,3,1,5, 2,4,3,5,1,\n 2,4,5,1,3, 2,4,5,3,1, 2,5,1,3,4, 2,5,1,4,3, 2,5,3,1,4,\n 2,5,3,4,1, 2,5,4,1,3, 2,5,4,3,1, 3,1,2,4,5, 3,1,2,5,4,\n 3,1,4,2,5, 3,1,4,5,2, 3,1,5,2,4, 3,1,5,4,2, 3,2,1,4,5,\n 3,2,1,5,4, 3,2,4,1,5, 3,2,4,5,1, 3,2,5,1,4, 3,2,5,4,1,\n 3,4,1,2,5, 3,4,1,5,2, 3,4,5,1,2, 3,4,2,5,1, 3,4,5,1,2,\n 3,4,5,2,1, 3,5,1,2,4, 3,5,1,4,2, 3,5,2,1,4, 3,5,2,4,1,\n 3,5,4,1,2, 3,5,4,2,1, 4,1,2,3,5, 4,1,2,5,3, 4,1,3,2,5,\n 4,1,3,5,2, 4,1,5,2,3, 4,1,5,3,2, 4,2,1,3,5, 4,2,1,5,3,\n 4,2,3,1,5, 4,2,3,5,1, 4,2,5,1,3, 4,2,5,3,1, 4,3,1,2,5,\n 4,3,1,5,2, 4,3,2,1,5, 4,3,2,5,1, 4,3,5,1,2, 4,3,5,2,1,\n 4,5,1,3,2, 4,5,1,2,3, 4,5,2,1,3, 4,5,2,3,1, 4,5,3,1,2,\n 4,5,3,2,1, 5,1,2,3,4, 5,1,2,4,3, 5,1,3,2,4, 5,1,3,4,2,\n 5,1,4,2,3, 5,1,4,3,2, 5,2,1,3,4, 5,2,1,4,3, 5,2,3,1,4,\n 5,2,3,4,1, 5,2,4,1,3, 5,2,4,3,1, 5,3,1,2,4, 5,3,1,4,2,\n 5,3,2,1,4, 5,3,2,4,1, 5,3,4,1,2, 5,3,4,2,1, 5,4,1,2,3,\n 5,4,1,3,2, 5,4,2,1,3, 5,4,2,3,1, 5,4,3,1,2, 5,4,3,2,1};\n \n int g[10][10],sum,s;\n while(1)\n {\n sum=0;\n for(i=1;i<=5;i++)\n for(j=1;j<=5;j++)\n scanf(\"%d\",&g[i][j]);\n \n for(i=0;i<120;i++)\n {\n s=g[ans[i][0]][ans[i][1]]+g[ans[i][1]][ans[i][0]]+g[ans[i][2]][ans[i][3]]\n +g[ans[i][3]][ans[i][2]]+g[ans[i][1]][ans[i][2]]+g[ans[i][2]][ans[i][1]]+\n g[ans[i][3]][ans[i][4]]+g[ans[i][4]][ans[i][3]]+g[ans[i][2]][ans[i][3]]\n +g[ans[i][3]][ans[i][2]]+g[ans[i][3]][ans[i][4]]+\n g[ans[i][4]][ans[i][3]];\n if(sum\n#include \n#define __STDC_FORMAT_MACROS\n#include \n\nconst char* f0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\";\nconst char* fi1 = \"What are you doing while sending \\\"\";\nconst char* fi2 = \"\\\"? Are you busy? Will you send \\\"\";\nconst char* fi3 = \"\\\"?\";\n\nstatic const int f0len = 75, fi1len = 34, fi2len = 32, fi3len = 2;\n\nstatic char dfs(int64_t N, int64_t* K) {\n const int64_t k1 = *K;\n if(N == 0) { // leaf of the tree\n if(k1 >= f0len) {\n *K -= f0len; return '.';\n } else {\n *K = 0; return f0[k1];\n }\n }\n if(k1 < fi1len) { // inside fi1\n *K = 0; return fi1[k1];\n }\n *K -= fi1len;\n\n const char c1 = dfs(N-1, K); // dfs into the first recursive part\n if(c1 != '.') return c1;\n\n const int64_t k2 = *K;\n if(k2 < fi2len) { // inside fi2\n *K = 0; return fi2[k2];\n }\n *K -= fi2len;\n\n const char c2 = dfs(N-1, K);\n if(c2 != '.') return c2; // dfs into the second recurse part\n\n const int64_t k3 = *K;\n if(k3 >= fi3len) {\n *K -= fi3len; return '.';\n } else { // inside fi3\n *K = 0; return fi3[k3];\n }\n}\n\nint main() {\n int Q; scanf(\"%d\\n\", &Q); while(Q--) {\n int64_t N,K; scanf(\" %\"PRId64 \" %\"PRId64 \"\\n\", &N, &K);\n --K; printf(\"%c\", dfs(N,&K));\n }\n printf(\"\\n\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6626883e124783d4c0424d2ac5cf7827", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "b4881971de8a9cd712d7e073a3426702", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24764150943396226, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n\n\nint sock(int n,int m,int x)\n{\n\n}\nint main()\n{\n int n,m,temp=0,x=0;\n \n scanf(\"%d\",&n);\n scanf(\"%d\",&m);\n x= n%m;\n while(1)\n {\n if(n == 1)\n {\n\t temp += 1;\n\t printf(\"%d \\n\",temp);\n\t return 0;\n }\n else if(x == 0)\n {\n\t temp += n;\n\t n=n/m;\n\t x =n%m;\n }\n else if(m-x > n)\n {\n\t temp += n;\n\t printf(\"%d \\n\",temp);\n\t return 0;\n }\n else if (m-x == n)\n {\n\t temp+= (n+1);\n\t printf(\"%d \\n\",temp);\n\t return 0;\n }\n else\n {\n\t temp+=n;\n\t temp++;\n\t n=(n-(m-x))/m;\n\t x=n%m;\n }\n }\n \n}\n", "lang": "GNU C", "bug_code_uid": "65d95fd66828c6e3e68aaca11155c7f0", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "b97190c3bf486e24a60c55a12852aaeb", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2579505300353357, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\n#define MAX 1000000\nint main(){\n\tint n;\n\tint i;\n\tscanf(\"%d\",&n);\n\tint g=1;\n\tint f=0;\n\tint arr[MAX]={0};\n\twhile(g!=1000){\n\t\tfor(i=1;i<=g;i++)\n\t\t{\n\t\t\tarr[f]=i;\n\t\t\tf++;\n\t\t}\n\t\tg++;\n\t}\n\tprintf(\"%d\",arr[n-1]);\n\t\n}", "lang": "GNU C", "bug_code_uid": "1ed6b56ee9d314a8ef634b069a69bf32", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "7d9e33cf659c14a17c266e7c5d84027a", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5566166439290586, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n\n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\n\nint main(int argc, char** argv) {\n\t\n\tlong long int k,a,b,c;\n\tscanf(\"%lld%lld%lld\",&k,&a,&b);\n\tif((a+b)/k==0)printf(\"-1\");\n\telse printf(\"%lld\",(a+b)/k);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "cdb566ffd99a562d80fec0f27cbfb6a4", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "f765883c62681fcba0219c95870b7c4d", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.880674448767834, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n\tint nx, ny, x, y, a, b, x1, y1, x2, y2;\n\tlong long w, h;\n\tscanf(\"%d%d%d%d%d%d\", &nx, &ny, &x, &y, &a, &b);\n\tw = nx;\n\th = ny;\n\twhile ( w * b != h * a )\n\t{\n\t\th = w * b / a;\n\t\tif ( h > ny )\n\t\t\th = ny;\n\t\th -= h % b;\n\t\tw = h * a / b;\n\t\tif ( w > nx )\n\t\t\tw = nx;\n\t\tw -= w % a;\n\t}\n\tx1 = x - (w+1) / 2;\n\ty1 = y - (h+1) / 2;\n\tx2 = x1 + w;\n\ty2 = y1 + h;\n\tif ( x1 < 0 )\n\t\tx2 -= x1, x1 = 0;\n\tif ( y1 < 0 )\n\t\ty2 -= y1, y1 = 0;\n\tif ( x2 > nx )\n\t\tx1 -= (x2-nx), x2 = nx;\n\tif ( y2 > ny )\n\t\ty1 -= (y2-ny), y2 = ny;\n\tprintf(\"%d %d %d %d\\n\", x1, y1, x2, y2);\n\treturn 0;\n}\n\n/*\n1000000000 1000000000 1 1 100000001 100000000\n*/\n", "lang": "GNU C", "bug_code_uid": "725770ddf3deb2b271ebd959a7e3ebde", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "05afd8754c7d2b15e1a4daed40380206", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7529691211401425, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n#include\n\nint main()\n{\n long long int n,m,i;\n scanf(\"%I64d %I64d\",&n,&m);\n for(i=1;i<=n;i++)\n {\n if(m>=i)\n {\n m=m-i;\n }\n if(i==n)\n {\n i=0;\n }\n if(m\nint main()\n{\n int n,m,k;\n scanf(\"%d %d %d\",&n,&m,&k);\n int a[n];\n int i,j,l,o,p,b,c;\n for(i=1;i<=n;i++)\n {\n scanf(\"%d\",&a[i]);\n }\n for(i=1;ia[j])\n {\n l=a[j];\n a[j]=a[i];\n a[i]=l;\n }\n }\n }int t=1;p=0;\n for(i=n;i>1;i--)\n {\n p+=a[i]+k-1;\n k--;\n \n if(p>=m)\n break;\n if(k==0)\n {\n p+=a[i-1]-1\n }\n t++;\n \n }\n printf(\"%d\",t);\n}", "lang": "GNU C11", "bug_code_uid": "111454a6704fa537446e956d90fdb017", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "314e14b3114cb8f91f649172bcd956a0", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7682672233820459, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "#include \n\n\nint main(){\n\tint t,z,n,i;\n\tscanf(\"%d\",&n);\n\tz=t=1;\n\tfor(i=1;i<=n;i++){\n\t\tz=(z*i)%1000000007;\n\t}\n\tfor(i=1;i<=(n-1);i++){\n\t\tt=(t*2)%1000000007;\n\t}\n\tz=(z-t);\n\tprintf(\"%d\",z);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "591a79b63dbf4a98727106a7c053db9b", "src_uid": "3dc1ee09016a25421ae371fa8005fce1", "apr_id": "7b15e1616e2011c86203ceeff500f2f9", "difficulty": 1500, "tags": ["graphs", "dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.945054945054945, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n#define M 1000000007;\nint main()\n{\n int t,n,i,ans;\n long long int pow,fact;\n pow=fact=1;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++)\n {\n fact = fact*i;\n fact = fact%M;\n }\n for(i=1;i\nint main()\n{\n int a , b , w , x , c , count = 0 ;\n scanf(\"%d %d %d %d %d\", &a, &b, &w, &x, &c);\n while(1)\n {\n if(c <= a)\n break;\n count++;\n c--; ;\n if(b >= x) b -= x ;\n else\n {\n a--;\n b = w -( x - b) ;\n }\n if(c <= a)\n break;\n }\n printf(\"%d\\n\", count);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "faac5099e63eb7439d4d63b40a2bccf6", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "ea9634c8200206595a71016f4f431d10", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.38193018480492813, "equal_cnt": 37, "replace_cnt": 19, "delete_cnt": 7, "insert_cnt": 10, "fix_ops_cnt": 36, "bug_source_code": "#include \nint main()\n{\n int a ,old_a , b , old_b , w , x , c , old_c , count = 0 ;\n scanf(\"%d %d %d %d %d\", &a, &b, &w, &x, &c);\n old_b = b ; old_a = a ; old_c = c ;\n while(c > a)\n {\n count++;\n c--;\n if(b >= x)\n b -= x;\n else\n {\n a--;\n b = w - (x - b);\n }\n if(b == old_b)\n break;\n }\n if(c <= a)\n printf(\"%d\\n\", count);\n else\n {\n int ax , cx , flag ;\n ax = old_a - a ;\n cx = old_c - c ;\n flag = (old_c-old_a)/(cx-ax) ;\n flag--;\n count = count*flag;\n a = old_a - flag*ax;\n c = old_c - flag*cx;\n while(c > a)\n {\n count++;\n c--;\n if(old_b >= x)\n old_b -= x;\n else\n {\n a--;\n old_b = w - (x - old_b);\n }\n }\n printf(\"%d\\n\", count);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "60a7aee777ce26410a7fbbc203be1710", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "ea9634c8200206595a71016f4f431d10", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7300380228136882, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include\nmain()\n{\n\tchar i, s[111];\n\tint br=0, k=0;\n\tgets (s);\n\tfor (i=0;s[i]!='\\0';i++)\n\t{\n\t\tif (s[i]=='o')\n\t\tbr=br+1;\n\t\tif (s[i]=='-')\n\t\tk=k+1;\n\t}\n\tif ((br%k==0)||(k%br==0))\nprintf(\"YES\");\nelse \nprintf(\"NO\");\nif (br==0)||(k==0)\nprintf(\"YES\");\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "fcdcdc409fd359d612886f0e8a8a2915", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "03e810410b4b0899e9f736ed749bc7d5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7159090909090909, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include\nmain()\n{\n\tchar i, s[111];\n\tint br=0, k=0;\n\tgets (s);\n\tfor (i=0;s[i]!='\\0';i++)\n\t{\n\t\tif (s[i]=='o')\n\t\tbr=br+1;\n\t\tif (s[i]=='-')\n\t\tk=k+1;\n\t}\n\tif ((br%k==0)||(k%br==0))\nprintf(\"YES\");\nelse \nprintf(\"NO\");\nif ((br==0)||(k==0))\nprintf(\"YES\");\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "8afd627b05c2c313165a8f10e6296173", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "03e810410b4b0899e9f736ed749bc7d5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8954671600370028, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nint main()\n{\n int m=0,n=0,i=0;\n char a[101],*p;\n scanf(\"%c\",&a[i]);\n while(a[i]!='\\0')\n {\n scanf(\"%c\",&a[++i]);\n }\n p=a;\n while(*p!='\\0' && *p!=' ' && *p!='\\n')\n {\n if(*p=='o')\n m++;\n else\n n++;\n p++;\n }\n if(n%m==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n//printf(\"%d %d \",m,n);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d7e48b25f067cf4e5c369a281bf76353", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "1e502a1a559aeb521c7185120aca6aa7", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9972652689152234, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nint main()\n{\n int m=0,n=0,i=0;\n char a[101],*p;\n scanf(\"%c\",&a[i]);\n while(a[i]!='\\0')\n {\n scanf(\"%c\",&a[++i]);\n }\n p=a;\n while(*p!='\\0' && *p!=' ' && *p!='\\n')\n {\n if(*p=='o')\n m++;\n else\n n++;\n p++;\n }\nif*n==0 || m==0)\n{printf(\"YES\");\nreturn 0;}\n\nif(n%m==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c28c6bf96503d37c74d8caf41c5c27f1", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "1e502a1a559aeb521c7185120aca6aa7", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9914040114613181, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n char s[100],i,o=0,d=0;\n scanf(\"%s\",s);\n for(i=0;i!='\\0';i++)\n {\n if(s[i]=='o')\n o++;\n elses\n d++;\n }\n if(o==0)\n printf(\"YES\");\n else if(d==0)\n printf(\"YES\");\n else if(d%o==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8051a91c60ef62a53b27f71b5d168a79", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "eafc77498d072e74978ea0e6a649a71a", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9818511796733213, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main()\n{\n int X,Y,Z,x,y,z,i,j,num[10];\n while(1){\n scanf(\"%d %d %d\",&x,&y,&z);\n scanf(\"%d %d %d\",&X,&Y,&Z);\n for (i=0;i<6;i++)\n {\n scanf(\"%d\",&num[i]);\n }\n j=0;\n if (x>X)\n {\n j+=num[5];\n }\n else if (x<0)\n {\n j+=num[4];\n }\n if (y>Y)\n {\n j+=num[1];\n }\n else if (y<0)\n {\n j+=num[0];\n }\n if (z>Z)\n {\n j+=num[3];\n }\n else if (z<0)\n {\n j+=num[2];\n }\n\n\n }\n printf(\"%d\\n\",j);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "23cfd29ae7536f01f3bf66c013e49bdd", "src_uid": "c7889a8f64c57cf7be4df870f68f749e", "apr_id": "6dda030b270a2b291448c140ddf6e2d2", "difficulty": 1600, "tags": ["geometry", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.3338599262769879, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n\tlong long int w,m,arr[105][2],i,last;\n\tscanf(\"%lld %lld\",&w,&m);\n\tarr[0][0]=1;\n\tarr[0][1]=0;\n\tarr[1][0]=w;\n\tarr[1][1]=0;\n\tfor(i=2;i<=100;i++)\n\t{\n\t\tif(arr[i-1][0]*w<=1000000000)\n\t\t{\n\t\t\tarr[i][0]=arr[i-1][0]*w;\n\t\t\tarr[i][1]=0;\n\t\t}\n\t\telse\n\t\t\tbreak;\n\t}\n\tlast=i;\n\twhile(m>0)\n\t{\n\t\tfor(i=0;iarr[i][0])\n\t\t\t\tcontinue;\n\t\t\telse if(m==arr[i][0])\n\t\t\t{\t\n\t\t\t\tif(arr[i][1]==0)\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\telse\n\t\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(arr[i][0]-m>m-arr[i-1][0])\n\t\t\t\t{\n\t\t\t\t\tif(arr[i-1][1]==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\tm-=arr[i-1][0];\n\t\t\t\t\tarr[i-1][1]=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(arr[i][1]==1)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tm=arr[i][0]-m;\n\t\t\t\t\tarr[i][1]=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n//\t\tprintf(\"%lld\\n\",m);\n\t}\n}\n", "lang": "GNU C", "bug_code_uid": "8c24ad2e2afa4cdd00a2fb0666a36e3d", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "4125c5af5602840d1a4a6cce84b7efb0", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9377738825591586, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#define maxn 1000000005\nint bit[maxn];\nint main()\n{\n int w,m,b=0,i,f=0;\n scanf(\"%d%d\",&w,&m);\n while (m)\n {\n bit[b++]=m%w;\n m/=w;\n }\n for (i=0;i=w)\n {\n bit[i]-=w;\n bit[i+1]++;\n }\n if (bit[i]==w-1)\n {\n bit[i]=0;\n bit[i+1]++;\n }\n if (bit[i]>1)\n {\n f=1;\n break;\n }\n }\n if (f==0) printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\n\n \t \t \t \t \t\t\t\t\t\t \t\t\t \t\t \t\t\t \t", "lang": "GNU C", "bug_code_uid": "b40c55df81aeb4c64beb29a222a9d4bd", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "151087840209c4ad16643309d979fe1c", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9228915662650602, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\n//New Year and Days 611A\nint d;\nchar s1[3],s2[6];\nint main()\n{\n while(scanf(\"%d%s%s\",&d,s1,s2))\n {\n if(s2[0]=='w')\n {\n if(d==5||d==6)printf(\"53\\n\");\n else printf(\"52\\n\");\n }\n else\n {\n if(d<=29)printf(\"12\\n\");\n else if(d==30)printf(\"11\\n\");\n else if(d==31)printf(\"7\\n\");\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c84dff5a37479545a673cb2a18288a12", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "47e6f3a39eecea30902006eab33e57df", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9893529893529893, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main()\n{\n char i[100];\n int d,c,e;\n while(fgets(i, 100, stdin)!=EOF)\n {\n //printf(\" of week\");\n d=i[0]-'0' ;\n c=i[1]-'0' ;\n e=(10*d)+c;\n //printf(\"%d\\n\",c);\n //printf(\"%d\\n\",e);\n if(i[5]=='w')\n {\n if(d==5 || d==6)\n printf(\"53\\n\");\n else if((d>=1 && d<=4) || d==7)\n printf(\"52\\n\");\n d=0;\n }\n else\n {\n if(e==30)\n printf(\"11\\n\");\n else if(e==31)\n printf(\"7\\n\");\n else\n printf(\"12\\n\");\n d=0;\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e9c32eb503a4b281fffb2e7c3f81eb8b", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "fea09259f62c076026aa8b45db0805bc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16940581542351454, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nlong long int c[100000001];\nint main()\n{\n long long int a,b,i,d,e;\n scanf(\"%lld %lld %lld\",&a,&b,&d);\n c[0]=0;\n c[1]=a;\n c[2]=b;\n if(d==1)\n e=a;\n else if(d==2)\n e=b;\n else{\n for(i=3;i<=d;i++){\n c[i]=c[i-1]-c[i-2];\n if(d==i)\n e=c[i];\n }\n }\n if(e<0)\n e=1000000007+e;\n printf(\"%lld\",e);\n}\n", "lang": "GNU C11", "bug_code_uid": "2f0c13a1afc33fc0dfc6ac85b3b76255", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "fc22c896ba1f20ccb4d94de93c856f1a", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9884057971014493, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#define max(a,b) ((a>b)?a:b)\n#define min(a,b) ((a>b)?b:a)\n#define upfor(i,From,To) for(i=From;iTo;i--)\n#define Opfile_in(s) freopen(s,\"r\",stdin)\n#define Opfile_out(s) freopen(s,\"w\",stdout)\n#define Read(T) scanf(\"%d\",&T)\n#define Print(T) printf(\"%d\\n\",T)\n#define LL long long\n#define MAXN 214748364\n#define mod 100000000\nint N1,N2,k1,k2;\nint F[102][102],G[102][102];\nvoid init();\nvoid doit();\nint main()\n{\n //Opfile_in(\"BUAA_temp.in\");\n init();\n doit();\n return 0;\n}\nvoid init()\n{\n scanf(\"%d%d%d%d\",&N1,&N2,&k1,&k2);\n}\nvoid doit()\n{\n int i,j,k,l;\n F[0][0]=G[0][0]=1;\n upfor(i,0,N1+1)\n upfor(j,0,N2+1)\n {\n upfor(l,1,k1+1)\n {\n F[i+l][j] += G[j][i];\n F[i+l][j] %= mod;\n }\n upfor(l,1,k2+1)\n {\n G[j+l][i] += F[i][j];\n G[j+l][i] % mod;\n }\n }\n Print((F[N1][N2]+G[N2][N1]) % mod);\n}\n", "lang": "GNU C", "bug_code_uid": "5a6888b04004256b23ab60c516e99ae4", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "7f63fef52de916c4f2806ceb8a483d7e", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.43272880641079714, "equal_cnt": 23, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 22, "bug_source_code": "#include \n#include \n\nint ans, MOD = 100000000;\nint k1, k2;\n\nint min(int a, int b) { return a < b ? a : b; }\n\nvoid rec(int remain1, int remain2, int turn) {\n if(remain1 + remain2 == 0) {\n ans++;\n if(ans == MOD)\n ans = 0;\n } else {\n int i, val;\n if(turn == 0) {\n val = (remain1 + k1 - 1) / k1;\n if(val > 1 && val - 1 > remain2)\n return;\n for(i = 1; i <= min(k1, remain1); i++) {\n rec(remain1 - i, remain2, 1);\n }\n } else {\n val = (remain2 + k2 - 1) / k2;\n if(val > 1 && val - 1 > remain1)\n return;\n for(i = 1; i <= min(k2, remain2); i++) {\n rec(remain1, remain2 - i, 0);\n }\n }\n }\n}\n\nint main() {\n int n1, n2;\n scanf(\"%d %d %d %d\", &n1, &n2, &k1, &k2);\n rec(n1, n2, 0);\n rec(n1, n2, 1);\n printf(\"%d\\n\", (int)ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "17686b42b748fde738bd84be11567864", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "71c5d33fcf13cbf602819b6705b08cc1", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9762845849802372, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint mod=100000000, a[101][101], b[101][101];\n\nint main()\n{\n int i, j, k, n1, n2, k1, k2, ans;\n scanf(\"%d %d %d %d\", &n1, &n2, &k1, &k2);\n a[0][0]=b[0][0]=1;\n for(i=0; i<=n1; i++) \n {\n for(j=0; j<=n2; j++)\n {\n for(k=1; k<=k1; k++)\n a[i+k][j]=(a[i+k][j]+b[j][i])%mod;\n for(k=1; k<=k2; k++)\n b[j+k][i]=(b[j+k][i]+a[i][j])%mod;\n }\n }\n printf(\"%d\\n\", (a[n1][n2]+b[n2][n1])%mod);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "735d3708c5609e9b14349382ef6f614d", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "94057aad2b3a1a84fd485b2e04c4e0c0", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.09087979374798583, "equal_cnt": 26, "replace_cnt": 19, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 26, "bug_source_code": "#include \n#include \nusing namespace std;\n\nconst int MAXN = 100, MOD = 1e8;\n\nint k1, k2, dp[MAXN+1][MAXN+1][2];\n\nint fn(int n1, int n2, bool flag)\n{\n if(n1 == 0 && n2 == 0) return 1;\n\n if(dp[n1][n2][flag] != -1) return dp[n1][n2][flag];\n\n int ret = 0;\n\n if(flag == 0) {\n for(int man = 1; man <= k1 && n1-man >= 0; ++man)\n ret += fn(n1-man, n2, !flag), ret %= MOD;\n }\n else { // flag == 1\n for(int man = 1; man <= k2 && n2-man >= 0; ++man)\n ret += fn(n1, n2-man, !flag), ret %= MOD;\n }\n\n return dp[n1][n2][flag] = ret;\n}\n\nint main()\n{\n //freopen(\"in\", \"r\", stdin);\n\n int n1, n2;\n\n while(scanf(\"%d %d %d %d\", &n1, &n2, &k1, &k2) != EOF) {\n fill(&dp[0][0][0], &dp[MAXN+1][0][0], -1);\n\n printf(\"%d\\n\", (fn(n1, n2, 0) + fn(n1, n2, 1)) % MOD);\n }\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "0f7d4cb139986f7e00e4bbb4e8c5c46b", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "1904393cf899b2bce03737588bd14f4b", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7190265486725663, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include \n\nint d[101][101][11][11];\n\nint main()\n{\n int n1, n2, k1, k2;\n scanf(\"%d %d %d %d\", &n1, &n2, &k1, &k2);\n int i, j, s, z, t;\n d[0][0][0][0] = 1;\n for(i = 0; i <= n1; i++)\n {\n for(j = 0; j <= n2; j++)\n {\n for(s = 0; s <= k1; s++)\n {\n for(z = 0; z <= k2; z++)\n {\n if(s < k1)\n {\n d[i + 1][j][s + 1][0] = (d[i + 1][j][s + 1][0] + d[i][j][s][z]) % 100000000;\n }\n if(z < k2)\n {\n d[i][j + 1][0][z + 1] = (d[i][j + 1][0][z + 1] + d[i][j][s][z]) % 100000000;\n }\n }\n }\n }\n }\n int ans = 0;\n for(s = 0; s <= k1; s++)\n {\n for(z = 0; z <= k2; z++)\n {\n ans = (ans + d[n1][n2][s][z]) % 100000000;\n }\n }\n printf(\"%d\", ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "036286de69d68be174499de6c3ca3012", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "d509e6f7c418659b5d37cea04eb68296", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5936, "equal_cnt": 23, "replace_cnt": 20, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 22, "bug_source_code": "#include \n#include \n\nint ModExp(int n,int m,int p)\n{\n\tint k=1;\n\tn%=p;\n\twhile(m!=1)\n\t{\n\t\tif(m&1)\n\t\t{\n\t\t\tk=(k*n)%p;\n\t\t}\n\t\tn=(n*n)%p;\n\t\tm>>=1;\n\n\t}\n\treturn (n*k)%p;\n}\n\nint Judge(int x,int p)\n{\n\tint i;\n\tif(ModExp(x,p-1,p)!=1)\n\t{\n\t\treturn 0;\n\t}\n\tfor(i=1;i\n#include \n#include \n#define total 81\n#define n 11\nint main()\n{\n srand(time(NULL));\n int i,j,cont=0;\n char *valor=(char*)calloc(n,sizeof(char));\n char *codigo=(char*)calloc(total,sizeof(char));\n char *numero=(char*)calloc(n-2,sizeof(char));\n char matriz[n-1][n]={};\n\n scanf(\"%s\",codigo);\n for(i=0 ; i\n\nint GCD(int a,int b)\n{\n int t,gcd;\n if(a==0)\n {\n gcd=b;\n }\n else if(b==0)\n {\n gcd=a;\n }\n else\n {\n while(b!=0)\n {\n t=b;\n b=a%b;\n a=t;\n }\n gcd=a;\n }\n}\n\nint main()\n{\n int a,b,max,m,n,d,x;\n scanf(\"%d %d\",&a,&b);\n if(a>b)\n max=a;\n else\n max=b;\n m=6-max+1;\n x=GCD(m,6);\n n=m/x;\n d=6/x;\n printf(\"%d/%d\",n,d);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "adbff2fd98913bf321a0d5e4900a8367", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "97617bae82092345f4025dfb4d592c91", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.98125, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main()\n{\n int i,j,k,l,max=0,m,n,total=0,x,y,bre=0;\n scanf(\"%d %d\",&n,&m);\n int a[m+1][2];\n for(i=0;imax)&&(a[i][0]>0))\n {\n x=i;\n max=a[i][1];\n }\n if(a[i][0]!=0)\n bre=1;\n }\n y=n-a[x][0];\n if(y>=0)\n {\n total+=a[x][1]*a[x][0];\n n-=a[x][0];\n a[x][0]=0;\n a[x][1]=0;\n }\n else\n {\n a[x][0]-=n;\n if(a[x][0]>=0)\n {\n total+=a[x][1]*n;\n break;\n }\n else\n {\n a[x][0]+=n;\n n-=a[x][0];\n total+=a[x][1]*a[x][0];\n a[x][0]=0;\n a[x][1]=0;\n }\n }\n max=0;\n if(bre==0)\n break;\n\n }\n printf(\"%d\\n\",total);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "387a30838b9d83f02b1664edb21d45e8", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "efe882b42e79376cbe1db74f78e2739f", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.903125, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \nint main()\n{\n int cuantas_cajas_roba, almacenes, max, lugar_max, cant = 0, a, b;\n scanf(\"%i %i\", &cuantas_cajas_roba, &almacenes);\n int cajas[almacenes][2]; //[][0] cuantas hay [][1] cuanto tienen\n for(a = 0; a < almacenes; a++)\n {\n scanf(\"%i %i\", &cajas[a][0], &cajas[a][1]);\n }\n a = 0;\n while(a < cuantas_cajas_roba)\n {\n max = 0;\n for(b = 0; b < almacenes; b++)\n {\n if(cajas[b][1] > max)\n {\n max = cajas[b][1];\n lugar_max = b;\n }\n }\n if(cuantas_cajas_roba - a >= cajas[lugar_max][0])\n {\n cant = cant + cajas[lugar_max][1]*cajas[lugar_max][0];\n a = a + cajas[lugar_max][0];\n// printf(\" %i %i\\n\", cant, a);\n cajas[lugar_max][1] = 0;\n cajas[lugar_max][0] = 0;\n }\n else\n {\n cant = cant + cajas[lugar_max][1]*(cuantas_cajas_roba - a);\n a = a + (cuantas_cajas_roba - a);\n// printf(\" %i %i\\n\", cant, a);\n }\n }\n printf(\"%i\", cant);\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "21b4da8762220599ad5847da662dc132", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "f0e6143f1f7b28799b55aa5d5771a7df", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3293768545994065, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main ()\n{\n\tint tab[10],n,c,i,max,pos;\n\tscanf(\"%d\",&n);\n\tfor(i=1;i<=n;i++){\n\t\tscanf(\"%d\",&tab[i]);\n\t}\n\tc=n;\n\twhile(n>0){\n\tmax=tab[1];\n\tpos=1;\n\tfor(i=1;i<=n;i++){\n\t\tif(tab[i]>max){\n\t\t\tmax=tab[i];\n\t\t\tpos=i;\n\t\t}\n\t}\n\tfor(i=pos;i\nint main()\n{\n\tint i,t,x,j,s=1,count=0;\n\tscanf(\"%d\",&t);\n\tfor(i=1;i<=t;i++)\n\t{\n\t\tscanf(\"%d\", &x);\n\t\tfor(j=1;j<=x;j++)\n\t\t{\n\t\t\tfor(i=j;i<=10000;i=(i*s)+(j+s/10))\n\t\t\t{\n\t\t\t\twhile(i!=0)\n\t\t\t\t{\n\t\t\t\t\ti=i/10;\n\t\t\t\t\tcount++;\n\t\t\t\t\ts=s*10;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\", count);\n\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "7a39c4751ad4c0a08a92502631da0394", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "30b1b1bf2866193f6b3b4ca71dc198b4", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9886621315192744, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n\tint count=0;\n\tint times=0;\n\tchar current='\\0';\n\tchar input[200];\n\tint i;\n\tscanf(\"%s\",input);\n\tcurrent = input[0];\n\tcount++;\n\tfor(i = 1; input[i] != '\\0'; i++){\n\t\tif(input[i]==current){\n\t\t\tif(count<5){\n\t\t\t\tcount++;\n\t\t\t\tcontinue;\n\t\t\t}else{\n\t\t\t\tcount=1;\n\t\t\t\ttimes++;\n\t\t\t\tcurrent=input[i];\n\t\t\t}\n\t\t}else{\n\t\t\tcurrent=input[i];\n\t\t\tcount=1;\n\t\t\ttimes++;\n\t\t}\n\t}\n\tif(count) times++;\n\tprintf(\"%d\\n\",times);\n\treturn 1;\n}\n", "lang": "GNU C", "bug_code_uid": "a6ae3ac6de38daad0e83f6a5afe4f13c", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "317b6e7ac73bd34ea8abf81fa20db0aa", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9362229102167182, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\nvoid swap(int *x,int *y){\n int t=*x;\n *x=*y;\n *y=t;\n}\nvoid SelSort(int* arr,int n){\n // printf(\"SIZE:%d\",n);\n int max,j;\n for(int i=0;isum){\n sum+=arr[count++];\n }\n printf(\"%d\\n\",count);\n}\n", "lang": "GNU C11", "bug_code_uid": "3e76d69509c3af27361f5b826fdc4e86", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "f6ffcd251fc3b7534170bf62e9f34dd4", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4555984555984556, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \nint main()\n\n{\nint m,n,y=0,k;\nscanf(\"%d%d\",&m,&n);\nif(m%2!=0 && m>1)\n{\n m=m-1;\n k=m/2;\n m=m+1;\n}\nelse if (m%2==0)\n{\n k=m/2;\n}\nelse\nk=1;\nint s=k*n;\n\nwhile (1)\n{\n\n if (m%2!=0 || m==1)\n\n {\n n=n-2;\n if (n>=1)\n y++;\n\n else\n break ;\n }\n\n\n}\nif (m==1)\nprintf(\"%d\",y);\nelse\nprintf(\"%d\",s+y);\n\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "5c3a9a695d8c739e816c00b909d3ecaf", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "2322b54d6f950f1997ebc7a74b94a8b0", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9856733524355301, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\nint main()\n{\n long i,flag=0;\n char s[100];\n scanf(\"%s\",s);\n for(i=0;i\n#include\nint main()\n{\n int i,l;\n char s[51];\n scanf(\"%s\",s);\n l=strlen(s);\n for(i=0;i\n\nint main(){\n \n int count = 0;\n int money = 0;\n \n scanf(\"%d\", &money);\n \n while (money >= 0){\n if(money >= 100){\n money -= 100;\n count++;\n }\n \n if(money >= 20 && money < 100){\n money -= 20;\n count++;\n }\n \n if(money >= 10 && money < 20){\n money -= 10;\n count++;\n }\n \n if(money >= 5 && money < 10){\n money -= 5;\n count++;\n }\n \n if(money >= 1 && money < 5){\n money -= 1;\n count++;\n }\n }\n \n printf(\"%d\", count);\n \n}", "lang": "GNU C11", "bug_code_uid": "76ace8a4b2c5c0884bdef365a3f9c320", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "a3deadcf72773e5a94de3387e13ce511", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6465905157493943, "equal_cnt": 24, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 23, "bug_source_code": "/*\n * 1.\u8fd9\u4e2a\u7a0b\u5e8f\u505a\u5230\u7684\u4e8b\u60c5\n * ruble\u662f\u4fc4\u56fd\u7684\u8d27\u5e01\n * \u56db\u95e8\u8bfe\n * 2.\u8fd9\u4e2a\u7a0b\u5e8f\u9047\u5230\u7684\u56f0\u96be\n * 3.\u63a5\u4e0b\u6765\u8981\u505a\u7684\u4e8b\u60c5\n */\n#include\n#define N 100000\nint min2(int a,int b){\n if(a>b)return b;\n else return a;\n}\nint min3(int a,int b,int c){\n return min2(a,min2(b,c));\n}\nint main() {\n int n,a,b,c;\n scanf(\"%d%d%d%d\",&n,&a,&b,&c);\n int min=0;\n int money[N];\n money[0]=0;\n money[1]=a;\n money[2]=min2(a*2,b);\n money[3]=min3(a*3,b+a,c);\n /*\n money[4]=min(money[1]+money[3],money[2]+money[2]);\n money[5]=min(money[1]+money[4],money[2]+money[3]);\n */\n int i,j;\n for(i=4;i=N){\n printf(\"\u4e0d\u591f\\n\");\n break;\n }\n if((n+k)%4==0){\n min=money[k];\n break;\n }\n k++;\n }\n printf(\"%d\\n\",min);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4121f91da7937b32cce6b1d0ef61e666", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "6f8dde4fa8723698b95144dc1c3e8dec", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6320346320346321, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n#include \n#include \n#include \nint main(){\nint a,b,f,k;\nscanf(\"%d%d%d%d\",&a,&b,&f,&k);\nint counter=-1;\nint position=0;\nint fuel = b;\nint wway=-1;\nint fuelcounter=0;\nint test=0;\nwhile(counter=2*(a-f)){\n }else{\n if(counter+1=a-f){\n }else{\n fuel=b;\n fuelcounter++;\n }\n }\n }\n }else{\n if(fuel>=2*f){\n }else{\n if(counter+1=f){\n }else{\n fuel=b;\n fuelcounter++;\n }\n }\n }\n\n }\n }\n if(fuel==0){\n test=1;\n break;\n }\n position += wway;\n fuel--;\n}\n\n if(test==1){\n printf(\"-1\");\n }else{\n printf(\"%d\",fuelcounter);\n }\n\n}\n\n", "lang": "GNU C11", "bug_code_uid": "b09900db91dcdda40a0f05d0815ec40b", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "aa86f7d546004c955fe506e869fd8767", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9719725013220518, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n long long int a,b,f,k,p,r=0,m=0;\n scanf(\"%lld %lld %lld %lld\",&a,&b,&f,&k);\n p=b;\n if(b\n#include \n\nint main()\n{\n int N, ActivePlayers[2]={1,2} , AllPlayers[3]={1,2,3}, Audience[1]={3}, i, VictoryCourse[100], temporary=3, j;\n\n //printf(\"How many matches did you guys have?\\n\");\n scanf(\"%d\", &N);\n while ((N<0)|| (N>100))\n {\n //printf(\"We both know that it's not good to lie. Now, please be serious.\\n\");\n //printf(\"How many matches did you have?\\n\");\n scanf(\"%d\", &N);\n }\n\n for (i=0; i\n\nint main()\n{\n\tint a,m,x;\n\tscanf(\"%d%d\",&a,&m);\n\tif(a%m==0)\n\t{\n\t\tprintf(\"Yes\\n\");\n\t\treturn 0;\n\t}\n\tx=a;\n\tx+=x%m;\n\n\twhile(x%m!=a%m)\n\t{\n\t\tif(x%m==0)\n\t\t{\n\t\t\tprintf(\"Yes\\n\");\n\t\t\treturn 0;\n\t\t}\n\t\tx+=x%m;\n\t}\n\tprintf(\"No\\n\");\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "1826a0679df8ac952d28a6550a78225b", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "59da958c5906b2f4a20aadb8f791c131", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6977886977886978, "equal_cnt": 22, "replace_cnt": 2, "delete_cnt": 15, "insert_cnt": 5, "fix_ops_cnt": 22, "bug_source_code": " #include\nint main()\n {\n int i=0,j=0,k;\n char s[50],t[50];\n printf(\"enter the 2 strings\");\n scanf(\"%s%s\",s,t);\n while(t[i]!='\\0')\n { \n if(s[j]==t[i]);\n j++;i++;\n else\n i++;\n }\n print(\"%d\",j);\n return 0;\n }", "lang": "GNU C", "bug_code_uid": "8fd23ab6c1da8d33bc4694cd29ba531c", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "69dd266d7e9102dd49521f0e96c8fcb6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.061342912406742195, "equal_cnt": 23, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 8, "fix_ops_cnt": 24, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n\nusing namespace std;\n\ntypedef long long LL;\n\nsets;\nvectorv;\n\nvoid settable()\n{\n\ts.insert(1);\n\tset::iterator iter=s.begin();\n\tint count=1;\n\tLL temp=*iter;\n\twhile(temp<=2e9){//\ufffd\u02f4\ufffd\u04aa\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\n\t\tLL t=*iter;\n\t\ts.insert(t*2);\n\t\ts.insert(t*3);\n\t\ttemp=t*3;\n\t\titer++;\n\t}\n\titer=s.begin();\n\twhile(iter!=s.end()){\n\t\tv.push_back(*iter++);\n\t}\n/*\tfor(int i=0;i<10;i++){\n\t\tprintf(\"%d \",v[i]);\n\t}\n\tprintf(\"\\n\");*/\n}\n\n\nint main()\n{\n\tsettable();\n\tint l,r;\n\tscanf(\"%d%d\",&l,&r);\n\tint num=upper_bound(v.begin(),v.end(),r)-lower_bound(v.begin(),v.end(),l);\n\tprintf(\"%d\\n\",num);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "00928d06a922ca4e64170b69892dd366", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "8a807d1b6231b0533bfd6077d94c7201", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8595317725752508, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int n,x,count=0;\n scanf(\"%d %d\",&n,&x);\n int a[n],i,j,temp,mid;\n for(i=0;ia[j])\n mid=j;\n }\n if(mid!=i)\n {\n temp=a[mid];\n a[mid]=a[i];\n a[i]=temp;}\n}\nfor(i=0;i0)\nprintf(\"%d\",x-count);\nelse\nprintf(\"0\");\nreturn 0;\n}\n\n\n\n ", "lang": "GNU C11", "bug_code_uid": "ceed7100d813ff5743ebbcd4e24bea50", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "8e09d843f1094d5cb247e425d96851b8", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9417852522639069, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n while(1){\n int i,p,q;;\n char a[3];\n scanf(\"%s\",a);\n p=a[0]-96;\n q=a[1]-48;\n if(p==1||p==8)\n {\n if(q==1||q==8)\n printf(\"3\\n\");\n else\n printf(\"5\\n\");\n }\n else\n {\n if(q==1||q==8)\n printf(\"5\\n\");\n else\n printf(\"8\\n\");\n }}\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "298d88c61573fa85df2e47f15ecdeba1", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "cc540009f011052d5902f08a1c56620e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8256227758007118, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \nconst int a=1234567;\nconst int b=123456;\nconst int c=1234;\nint main()\n{\n\tint n,k,i,j;\n\tscanf(\"%i\",&n);\n\tfor(i=0;i<(n/a+1);i++)\n\t\tfor(j=0;j<(n/b+1);j++)\n\t\t\tfor(k=0;k<(n/c+1);k++)\n\t\t\t\tif(i*a+j*b+k*c==n){\n\t\t\t\t\tputs(\"YES\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\tputs(\"NO\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "fd055f70b6296e4739f15f5ff5c0ad3e", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "05130159a39490424223e61c2b9fbf17", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9978858350951374, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include\n#include\nint main()\n{\nint n;\nscanf(\"%d\",&n);\nint a[n];\nint max=0;\nint min=0;\nint i;\nfor(i=0;i=0)\n max+=a[i];\nelse\n min+=a[i];\n}\nprintf(\"%d\",max-min);\n}\n\n", "lang": "GNU C11", "bug_code_uid": "8af484c973ec3f8245acf4c04861e787", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "3250c43438ab23484fb02f41f298127b", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.12673267326732673, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \nvoid main()\n{\n int a=5,b=10,m=0,i,k;\n k=(a-b)/2;\n if(k<0)\n k=-k;\n for(i=1;i<=k;i++)\n m=m+i;\n if((a-b)%2==0)\n printf(\"%d\",2*m);\n else\n printf(\"%d\",2*m+k+1);\n}\n", "lang": "GNU C11", "bug_code_uid": "89b125b815c964ad4986f47a6e13aafd", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "8c895cd3a3f5c4ad6aea20f69bd2d922", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9973544973544973, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \nint main()\n{int a,b,c=0,d,e,f,i,j,k,p=1,q,r,sum=1;\n char s[200];\n int z[102];\n scanf(\"%d\",&d);\n scanf(\"%s\",&s);\n\n for(i=0;i=4)\n {\n break;\n }\n }\n if(sum>=4)\n {\n printf(\"yes\\n\");\n }\n else\n {\n printf(\"no\\n\");\n }\nreturn 0;}", "lang": "GNU C", "bug_code_uid": "0d93daa79d9abd137880f24a81940884", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "8a7cff33e396c959eccdf3edc893ed2b", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7209051724137931, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\n#include\n#include\nusing namespace std;\nint main()\n{\n int n;\n int a[110];\n int l[110];\n char ch;\n while (scanf(\"%d\",&n)!=EOF)\n {\n memset(l,0,sizeof(l));\n for (int i=1;i<=n;i++)\n {\n scanf(\"%c\",&ch);\n if (ch=='*')\n a[i]=1;\n else\n a[i]=0;\n }\n int i,j;\n for (i=1;i<=n;i++)\n {\n if (a[i])\n {\n for (j=i+1;j<=n;j++)\n {\n if (a[j]==1)\n l[j-i]++;\n }\n }\n }\n for (i=1;i<=100;i++)\n if (l[i]==4)\n {\n printf(\"yes\\n\");\n break;}\n if (i>100)\n printf(\"no\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "be4457602e3db7e37b8eb162d0a2d074", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "0eeb588fac9574e7bca9edccc0a3774d", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7342995169082126, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main() {\n\tstatic int aa[14];\n\tint i, max;\n\n\tfor (i = 0; i < 14; i++)\n\t\tscanf(\"%d\", &aa[i]);\n\tmax = 0;\n\tfor (i = 0; i < 14; i++)\n\t\tif (aa[i] > 0) {\n\t\t\tstatic int bb[14];\n\t\t\tint j, sum;\n\n\t\t\tfor (j = 0; j < 14; j++)\n\t\t\t\tbb[j] = aa[j];\n\t\t\tbb[i] = 0;\n\t\t\tfor (j = i + 1; j <= i + aa[i]; j++)\n\t\t\t\tbb[j % 14]++;\n\t\t\tsum = 0;\n\t\t\tfor (j = 0; j < 14; j++)\n\t\t\t\tsum += (bb[j] % 2 == 0 ? bb[j] : 0);\n\t\t\tif (max < sum)\n\t\t\t\tmax = sum;\n\t\t}\n\tprintf(\"%d\\n\", max);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "5aa6b78f26f77e3de49c6819b899fc73", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "3946c3cc7a268491a161d198ff109dd7", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3785751430057202, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 20, "bug_source_code": "#include\n\n\nint isluck(long long n)\n{\n\twhile (n)\n\t{\n\t\tif (n % 10 == 7 || n % 10 == 4)\n\t\t\tn /= 10;\n\t\telse\n\t\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n\n\nlong long nearby(long long n)\n{\n\twhile (isluck(n) != 1)\n\t{\n\t\tn++;\n\t}\n\treturn n;\n}\n\nint main()\n{\n\tlong long l, r;\n\n\twhile (~scanf(\"%lld %lld\", &l, &r))\n\t{\n\t\tlong long sum = 0;\n\n\t\twhile (l <= r)\n\t\t{\n\t\t\tint tmp = nearby(l);\n\t\t\tif (tmp > r)\n\t\t\t{\n\t\t\t\tsum += (r - l + 1) * tmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsum += (tmp - l + 1) * tmp;\n\t\t\tl = tmp + 1;\n\t\t}\n\t\tprintf(\"%lld\\n\", sum);\n\t}\n\n\treturn 0;\n}\n\t \t \t \t\t\t\t\t\t\t\t \t \t\t\t \t\t\t", "lang": "GNU C", "bug_code_uid": "d69940f87d6f11b19eddf8b99fc17e40", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "5b8e50644fa5032d94305c5a0fed0041", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.23076923076923078, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n int d1,d2,d3;\n int s1,s2;\n while (scanf(\"%d %d %d\", &d1,&d2,&d3) != '\\n')\n {\n s1 = 0, s2 = 0;\n if((2*d1 + 2*d2) < (d1 + d2 + d3))\n {\n s1 = 2*d1 + 2*d2;\n printf(\"%d\", s1);\n }\n else\n {\n s2 = d1 + d2 + d3;\n printf(\"%d\", s2);\n }\n\n }\n}", "lang": "GNU C11", "bug_code_uid": "81c6d8782bdd6ff4fb195f9c4cba4276", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "295cb144f7e0e93f327a442ef1a302b6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6540447504302926, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n#include\n#include\nusing namespace std;\nint main()\n{\n char a[50];\n int n;\n while(scanf(\"%s\",&a)!=EOF)\n {\n n=a[strlen(a)-1]-'0';\n if(n%2==0)\n cout<<\"0\"<\n#include \n#include \n\n/*\n * \n */\nint main() {\n \n int n, m, k, i, l=0;\n float sum=0.0;\n \n //printf(\"Give the colum, the row.\\n\");\n scanf(\"%d %d\", &n, &m);\n \n do{\n //printf(\"Give the position to sit.\\n\");\n scanf(\"%d\", &k);\n }while(k<0 || k>(2*n*m+1));\n \n for(i=1; i<=m; i++){\n if(k<=i*n*2-2*i){\n l++;\n //printf(\"l=%d\\n\",l);\n }\n if(i==m){\n l=m;\n }\n }\n for(i=1; i<=n; i++){\n if(k<=2*m*i){\n if(k%2==0){\n printf(\"%d %d R\\n\", i, l);\n return;\n }else{\n printf(\"%d %d L\\n\", i, l);\n return;\n }\n }\n }\n}", "lang": "GNU C", "bug_code_uid": "4e2221265470957fd67fb2952e75c9da", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "02a3ea565bead29e1a6b6c84479ad919", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9973614775725593, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#define min(a,b) a>b?b:a\nlong long int n,m,k,an;\nlong long int bin(long long int lo,long long int hi)\n{\n\tif(lo>=hi)\n\t\treturn lo;\n\tlong long int i,mi=(lo+hi)/2,c=0;\n\tfor(i=1;i<=n;i++)\n\t\tc+=min((mi-1)/i,m);\n\tif(c\nint mcd(int a, int b);\nint main()\n{\n\tint a,b,c;\n\tscanf(\"%d%d\",&a,&b);\n\tif(a>b){\n\t\tc=mcd(a,b);\n\t}else{\n\t\tc=mcd(b,a);\n\t}\n\tif(c==1) c=0;\n\tprintf(\"%d\",c);\n\treturn 1;\n}\n\nint mcd(int a, int b)\n{\n if (b == 0){\n return a;\n }else{\n return mcd(b, a % b);\n }\n}", "lang": "GNU C11", "bug_code_uid": "e4bea3e0ddf0344643629ed666ea37f8", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "2d426dba0157b0614c67a3b7a3410fe8", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9793759915388683, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#define rep(i,l,r) for(register int i=l;i<=r;++i)\nconst int MOD=51123987;\nint dp[160][60][60][60];\nint next[160][3],n,ans;\nchar s[160];\ninline int abs(int x){return x>0?x:-x;}\ninline bool pd(int a,int b){return abs(a-b)<2;}\nint main(){\n scanf(\"%d\",&n);\n scanf(\"%s\",s+1);\n rep(i,0,2) next[n+1][i]=n+1;\n for(register int i=n;i;--i){rep(j,0,2) next[i][j]=next[i+1][j];next[i][s[i]-'a']=i;}\n dp[1][0][0][0]=1;\n //int 50=(n+2)/3;\n rep(i,1,n) rep(j,0,50) rep(k,0,50) rep(l,0,50){\n if(j+k+l==n&&pd(j,k)&&pd(j,l)&&pd(k,l)){ans=(ans+dp[i][j][k][l])%MOD;continue;}\n if(next[i][0]<=n) dp[next[i][0]][j+1][k][l]=(dp[next[i][0]][j+1][k][l]+dp[i][j][k][l])%MOD;\n if(next[i][1]<=n) dp[next[i][1]][j][k+1][l]=(dp[next[i][1]][j][k+1][l]+dp[i][j][k][l])%MOD;\n if(next[i][2]<=n) dp[next[i][2]][j][k][l+1]=(dp[next[i][2]][j][k][l+1]+dp[i][j][k][l])%MOD;\n }\n printf(\"%d\",ans);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "f1e7666c407fa870c224d4b08d4c1fdc", "src_uid": "64fada10630906e052ff05f2afbf337e", "apr_id": "1451b172b04a9550a589cede7738d7db", "difficulty": 2500, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9957761351636748, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n#define rep(i,l,r) for(register int i=l;i<=r;++i)\nconst int MOD=51123987;\nint dp[151][51][51][51];\nint next[160][3],n,ans;\nchar s[160];\ninline int abs(int x){return x>0?x:-x;}\ninline int pd(int a,int b){return abs(a-b)<2?1:0;}\nint main(){\n scanf(\"%d\",&n);\n scanf(\"%s\",s+1);\n rep(i,0,2) next[n+1][i]=n+1;\n for(register int i=n;i;--i){rep(j,0,2) next[i][j]=next[i+1][j];next[i][s[i]-'a']=i;}\n dp[1][0][0][0]=1;\n //int 50=(n+2)/3;\n rep(i,1,n) rep(j,0,50) rep(k,0,50) rep(l,0,50){\n if(j+k+l==n&&pd(j,k)&&pd(j,l)&&pd(k,l)){ans=(ans+dp[i][j][k][l])%MOD;continue;}\n if(next[i][0]<=n) dp[next[i][0]][j+1][k][l]=(dp[next[i][0]][j+1][k][l]+dp[i][j][k][l])%MOD;\n if(next[i][1]<=n) dp[next[i][1]][j][k+1][l]=(dp[next[i][1]][j][k+1][l]+dp[i][j][k][l])%MOD;\n if(next[i][2]<=n) dp[next[i][2]][j][k][l+1]=(dp[next[i][2]][j][k][l+1]+dp[i][j][k][l])%MOD;\n }\n printf(\"%d\",ans);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "0e42bed3282a2e1773377c93264f44ad", "src_uid": "64fada10630906e052ff05f2afbf337e", "apr_id": "1451b172b04a9550a589cede7738d7db", "difficulty": 2500, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5420974889217134, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "#include \n\nvoid swap(int *a,int *b)\n{\n *a^=*b;\n *b^=*a;\n *a^=*b;\n return;\n}\nint main()\n{\n int array[5];\n int i,sum=0;\n for(i=0;i<5;i++)\n {\n scanf(\"%d\",&array[i]);\n sum+=array[i];\n }\n int j;\n for(i=0;i<5;i++)\n for(j=0;j<5-i;j++)\n if(array[j]>array[j+1])\n swap(&array[j],&array[j+1]);\n for(i=4;i>0;i--)\n if(array[i]==array[i-1])\n if(i>=2&&(array[i-1]==array[i-2]))\n {\n sum-=(array[i]+array[i-1]+array[i-2]);\n break;\n }\n else\n {\n sum-=(array[i]+array[i-1]);\n break;\n }\n printf(\"%d\",sum);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "08277676b8ed5992dc7dd1538905c12f", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "3fd7fd3bff8d2883952005b0cecfc6f6", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.0061614294516327784, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C", "bug_code_uid": "935f598fb279e80006387077c24d91e2", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "49a3d473634d7b73098d3dd67bf30e4e", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8413391557496361, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main() {\n int n, ctr = 0;\n char stones[50];\n scanf(\"%d\", &n);\n\n scanf(\"%c\", stones[0]);\n\n int i = 1;\n while (i < n) {\n \tchar t;\n \tscanf(\"%c\", &t);\n \tif (t == stones[i - 1]) {\n \t\tctr++;\n \t\tcontinue;\n \t}\n \telse {\n \t\tstones[i] = t;\n \t}\n \ti++;\n }\n\n printf(\"%d\", ctr);\n}\n", "lang": "GNU C11", "bug_code_uid": "b6dbdca690ec56c1c0244f9c0e28bdb0", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "149e2a36d2a2001d558d91d24787ef37", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8700361010830325, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(){\n int n,x,y;\n scanf(\"%d%d%d\",&n,&x,&y);\n if(n==2||((x==n/2 && y==n/2)||(x==n/2 && y==(n/2)+1)(x==(n/2)+1 && y==n/2))){\n printf(\"NO\");\n return 0;\n }\n else {\n printf(\"YES\");\n return 0;\n }\n}", "lang": "GNU C", "bug_code_uid": "61c8cafaee3c1c8ed4c445001fc59fbd", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "ebd2f2b9c0bb54c29a63cd2235838d1d", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9747899159663865, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint main()\n{\n\nint num,x,y,n;\n\nscanf(\"%d%d%d\",&num,&x,&y);\nn=num/2;\n\nif((x==n&&x=n+1) && (y==n&&y==n+1))\n{\nprintf(\"NO\");\n}\n\nelse\n{\nprintf(\"YES\");\n}\nreturn(0);\n}", "lang": "GNU C", "bug_code_uid": "9bb4395fd4176599ae6e18f8d064abc4", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "5deb77338c1fe8865c0c02136904b515", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7861060329067642, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \nint main(){\n\tint i,l;\n\tchar s[100],t[100];\n\tscanf(\"%s\",s);\n\tl=strlen(s);\n\tint count=0;\n\tfor(i=0;i\n#include\nint main(){\n int temp = 0, n, A[50], C[50], T[50], G[50], i, j, minimum=1000;\n char p[50];\n while(scanf(\"%d\\n\", &n) != 0){\n for(i=0; iminimum){\n minimum = minimum;\n }\n }\n }\n printf(\"%d\\n\", minimum);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c9a8314d4af7ba3824630896ec332d87", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "0159a85b6ed8fcbf730156d32ee07c01", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.992936427850656, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n5\nZDATG int i,n,sum=0,min=50000;\n\tchar c[51];\n\tscanf(\"%d\\n\",&n);\n\tfor(i=0;i=13?26-fabs(c[i]-'A'):fabs(c[i]-'A');\n\t sum+=fabs(c[i+1]-'C')>=13?26-fabs(c[i+1]-'C'):fabs(c[i+1]-'C');\n\t sum+=fabs(c[i+2]-'T')>=13?26-fabs(c[i+2]-'T'):fabs(c[i+2]-'T');\n\t sum+=fabs(c[i+3]-'G')>=13?26-fabs(c[i+3]-'G'):fabs(c[i+3]-'G');\n\t if(sum<=min)min=sum;\n\t}\n\tprintf(\"%d\",min); \n} ", "lang": "GNU C11", "bug_code_uid": "5d9e307d73e054995175a7edce9a1ceb", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "21734426265bdef088a3b672dc90e02b", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.18585858585858586, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \nvoid main()\n{\n\tlong i,j,n,k=0,z;\n\tscanf(\"%d\",&n);\n\tfor (i=0;i\n#include \nbool f[100001];\nvoid pre()\n{\n int i;\n for(i=0;i<=100000;i++) f[i]=false;\n int pow=2;\n int num=1;\n while(num<=100000)\n {\n f[num]=true;\n pow*=2;\n num=(pow-1)*pow/2;\n }\n}\nint main()\n{\n pre();\n int i,n;\n int ans=1;\n scanf(\"%d\",&n);\n for(i=1;i*i<=n;i++)\n {\n if(f[i] && i>ans) ans=i;\n if(f[n/i] && (n/i)>ans) ans=n/i;\n }\n printf(\"%d\\n\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "e041d41b2c8737199aaafecd712168d9", "src_uid": "339246a1be81aefe19290de0d1aead84", "apr_id": "8161cc14a4a3f49bbbf5b500a73c58f2", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9786561264822135, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#define MOD 1000000009\n\nint sqr(long long int x, int n)\n{\n\tif(n==0)\n\t\treturn 1;\n\telse if(n==1)\n\t\treturn x;\n\telse if(n%2==0)\n\t\treturn sqr( (x*x)%MOD, n/2 ) % MOD;\n\telse\n\t\treturn (x * sqr( (x*x)%MOD, (n-1)/2 )) % MOD;\n}\n\nint main()\n{\n\tint n, m, k;\n\tscanf(\"%d %d %d\", &n, &m, &k);\n\tint x, y, z;\n\tz = n%k;\n\ty = n/k;\n\tif(y*(k-1)+z >= m)\n\t{\n\t\tprintf(\"%d\\n\", m);\n\t}\n\telse\n\t{\n\t\tx = m - y*(k-1) - z;\n\t\ty -= x;\n\t\tlong long int ans;\n\t\tint i;\n\t\tans = sqr(2, x+1);\n\t\tans -= 2;\n\t\tk %= MOD;\n\t\tans *= k;\n\t\tans %= MOD;\n\t\tans += y*(k-1);\n\t\tans %= MOD;\n\t\tans += z;\n\t\tans %= MOD;\n\t\tprintf(\"%lld\\n\", ans);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d110c99d6e716675a4f360c8e477a1f8", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "8e6b339359b8ac654b88d3adb4642a42", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6560402684563759, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\n#define MOD 1000000009\n\nint sqr(long long int x, int n)\n{\n\tif(n==0)\n\t\treturn 1;\n\telse if(n==1)\n\t\treturn x;\n\telse if(n%2==0)\n\t\treturn sqr( (x*x)%MOD, n/2 ) % MOD;\n\telse\n\t\treturn (x * sqr( (x*x)%MOD, (n-1)/2 )) % MOD;\n}\n\nint main()\n{\n\tint n, m, k;\n\tscanf(\"%d %d %d\", &n, &m, &k);\n\tint x, y, z;\n\tz = n%k;\n\ty = n/k;\n\tx = m - y*(k-1) - z;\n\ty -= x;\n\tlong long int ans;\n\tint i;\n\tans = sqr(2, x+1);\n\tans -= 2;\n\tk %= MOD;\n\tans *= k;\n\tans %= MOD;\n\tans += y*(k-1);\n\tans %= MOD;\n\tans += z;\n\tans %= MOD;\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d46f67aff16a381e65943aa201d9da30", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "8e6b339359b8ac654b88d3adb4642a42", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3840627041149575, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\nint main(){\n int i,j,a[3][3];\n for(i=1;i<=3;i++){\n for(j=1;j<=3;j++){\n scanf(\"%d \",&a[i][j]);\n }\n }\n printf((a[1][1]+a[1][2]+a[2][1])%2==0?\"1\":\"0\");\n printf((a[1][1]+a[1][2]+a[2][2]+a[1][3])%2==0?\"1\":\"0\");\n printf((a[1][3]+a[1][2]+a[2][3])%2==0?\"1\":\"0\");printf(\"\\n\");\n \n printf((a[1][1]+a[2][1]+a[2][2]+a[3][1])%2==0?\"1\":\"0\");\n printf((a[2][1]+a[2][2]+a[2][3]+a[1][2]+a[3][2])%2==0?\"1\":\"0\");\n printf((a[1][3]+a[2][3]+a[2][2]+a[3][3])%2==0?\"1\":\"0\");printf(\"\\n\");\n \n printf(((a[2][1]+a[3][1]+a[3][2])%2)==0?\"1\":\"0\");\n printf((a[3][2]+a[3][1]+a[3][3]+a[2][2])%2==0?\"1\":\"0\");\n printf((a[2][3]+a[3][2]+a[3][3])%2==0?\"1\":\"0\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "8d993779d885a3ce34e13af0f8d30f2b", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "548e28dca66919ba58427b4f2fd53aec", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9997711146715496, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\n\n\nint main()\n{\n int n,i,j,t;\n char s[30][4];\n scanf(\"%d\",&n);\n t=n;\n i=0;\n for(j=0;j<4;j++)\n {\n s[i][j]='|';\n }\n for(i=1;i<22;i++)\n {\n for(j=0;j<4;j++)\n {\n s[i][j]='#';\n }\n if(i!=2&&i!=1)\n {\n s[i][2]='.';\n }\n i++;\n for(j=0;j<4;j++)\n {\n s[i][j]='.';\n }\n }\n\n\n for(i=1;i<22&&t>0;i=i+2)\n {\n if(i==1)\n {\n if(t>4)\n {\n t=t-4;\n for(j=0;j<4;j++)\n {\n s[i][j]='O';\n }\n }\n else\n {\n for(j=0;j3)\n {\n t=t-3;\n for(j=0;j<4;j++)\n {\n if(j!=2)\n {\n s[i][j]='O';\n }\n }\n }\n else\n {\n for(j=0;j<4&&t>0;j++)\n {\n if(j!=2)\n {\n s[i][j]='O';\n t--;\n }\n }\n }\n }\n }\n\n\n for(j=0;j<4;j++)\n {\n s[23][j]='|';\n }\n s[23][2]='.';\n\n s[24][0]='D';\n for(j=1;j<4;j++)\n {\n s[24][j]='.';\n }\n\n for(j=0;j<4;j++)\n {\n s[25][j]='|';\n }\n\n s[26][0]=')';\n s[26][3]=')';\n\n printf(\"+\");\n for(i=1;i<25;i++)\n {\n printf(\"-\");\n }\n printf(\"+\\n\");\n\n\n for(i=0;i<27;i++)\n {\n printf(\"%c\",s[i][0]);\n }\n printf(\"\\n\");\n for(i=0;i<26;i++)\n {\n printf(\"%c\",s[i][1]);\n }\n printf(\"\\n\");\n for(i=0;i<26;i++)\n {\n printf(\"%c\",s[i][2]);\n }\n printf(\"\\n\");\n for(i=0;i<27;i++)\n {\n printf(\"%c\",s[i][3]);\n }\n printf(\"\\n\");\n printf(\"+\");\n for(i=1;i<25;i++)\n {\n printf(\"-\");\n }\n printf(\"+\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a129df997d054fd1efed9c4b6fce4b68", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "7bce43a9928452b7e164fd4b4260f2a3", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9792147806004619, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{\n char st[101];\n long long int nb, ns, nc, pb, ps, pc, r, i, b=0, s=0, c=0, ans=0;\n scanf(\"%s\", st);\n scanf(\"%lld %lld %lld %lld %lld %lld %lld\", &nb, &ns, &nc, &pb, &ps, &pc, &r);\n for(i=0; st[i]!='\\0'; i++)\n {\n if(st[i]=='B')\n b++;\n else if(st[i]=='S')\n s++;\n else if(st[i]=='C')\n c++;\n }\n //printf(\"%lld %lld %lld\\n\", b, s, c);\n while(r)\n {\n if(nb=b && ns>=s && nc>=c)\n {\n //printf(\"ans=%lld nb=%lld ns=%lld nc=%lld\\n\", ans, nb, ns, nc);\n ans++;\n nb-=b;\n ns-=s;\n nc-=c;\n //printf(\"ans=%lld nb=%lld ns=%lld nc=%lld\\n\", ans, nb, ns, nc);\n if(nb==0 && ns==0 && nc==0)\n {\n long long int price=pb*b+ps*s+pc*c;\n price=r/price;\n ans+=price;\n printf(\"%lld\\n\", ans);\n return 0;\n }\n if(r==0)\n {\n printf(\"%lld\\n\", ans);\n return 0;\n }\n }\n }\n}", "lang": "GNU C", "bug_code_uid": "00195ddee8dbb6024ab67df1c20d0bca", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "5cda27cf1024465db9b73f3e36b192a0", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.988950276243094, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint comp(const void* a, const void* b)\n{\n return *(int *)a - *(int *)b;\n}\nint main()\n{\n int n,d;\n scanf(\"%d %d\",&n,&d);\n int *arr=(int *)malloc(sizeof(int)*n);\n int i;\n int sum=0;\n for(i=0;in)\n ans=sum-((m-n)*d);\n else\n {\n for(i=0;i\n#include \n\nint main (){\n\n\n int n,d,m;\n int i;\n\n\n scanf (\"%i %i\", &n, &d);\n\n\n int g[110];\n for (i=0;i n){\n p = p - g[i];\n }\n else {\n p = p + g[i];\n }\n }\n\n printf (\"%i\", p);\n\n\n\n\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "dbd3fd1e7c3d5963fe59f1b39c6865ba", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "7e4a45c2014ac9883f9b485c719b14b1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9545454545454546, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#define M 2000000\n#define MOD 1000000007\nlong long inv[M],fact[M],factr[M];\nint main(){\n\tint i,N;\n\tfor(i=0;i\n#include \n#include \n#include \n\n// n = 8, k = 5\n// *\n// 0 1 2 3 4 5 6 7\n// 10 9 8 7 7 7 5 5\n\n// n = 5, k = 8\n// * \n// 0 1 2 3 4 5 6 7\n// 8 7 6 5 4 ? ? 0\n\nint main(void) {\n int n, k, count = 0;\n scanf(\"%d %d\", &n, &k);\n int* arr = (int*)malloc(sizeof(int)*k);\n if(k > n) arr[k - 1] = 0;\n for(int i = 0; i < n; i++) {\n scanf(\"%d\", &arr[i]);\n if((i <= k - 1 && arr[i] > 0)|| (i >= k && arr[i] >= arr[k - 1] && arr[i] > 0)) count++;\n }\n printf(\"%d\\n\", count);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "203130fd13b298f55e9148bd0a03f325", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "1c6fa3a766866f499250bf1569baa81f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8739495798319328, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n long long int n,k,count=0;\n scanf(\"%lld %lld\",&n,&k);\n long long int i,m=-1;\n for(i=1;i<=k;i++)\n {\n if(m\nint main()\n{\n long long int n,k,count=0;\n scanf(\"%lld %lld\",&n,&k);\n long long int i,m=-1;\n for(i=1;i<=k;i++)\n {\n if(m\n\nint main(){\n\tint m,w;\n\tscanf(\"%d %d\",&w,&m);\n\twhile(m>0){\n\t\tif(m%w==0||m%w==1||m%w=w-1){\n\t\t\tm=m/w;\n\t\t}\n\t\telse{\n\t\t\tprintf(\"NO\");\n\t\t\treturn 0;\n\t\t}\n\t\t}\n\t\tprintf(\"YES\");\n\t\treturn 0;\n\t}", "lang": "GNU C11", "bug_code_uid": "33158f10f9ef74b973043fc3ca9e453a", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "28b51d4ec510782d11dc7e60d76ea25c", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9646464646464646, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n\tint a,b,c,n;\n\tscanf(\"%d %d %d %d\",&a,&b,&c,&n);\n\tint l;\n\tl=n-a-b+c;\n\tif(l<1) {\n\tprintf(\"%d\",-1); \n\treturn -1;\n\t}\n\tprintf(\"%d\",l);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e63306211ca153fde260f117739a0145", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "1e46e140525665a39e16275afe819898", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.985781990521327, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int n, m;\n scanf(\"%d%d\",&n ,&m);\n if(!m)\n printf(\"%d\\n\",1);\n N\n else if((n/2)>=m)\n printf(\"%d\\n\",m);\n else\n printf(\"%d\\n\",n-m);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "16e03507bfcaced67ce4ec0f667a0ef6", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "f1dafcf121e334f7fabb02676ef4c780", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9948919449901769, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main()\n{\n int initial,remove,count=0;\n scanf(\"%d%d\",&initial,&remove);\n\n if(initial==remove)\n {\n printf(\"%d\",0);\n }\n else if(remove==0)\n {\n printf(\"%d\",1);\n }\n else if(remove==1)\n {\n printf(\"%d\",1);\n }\n else\n {\n if(initial%2==0)\n {\n for(int i=1 ; i<=initial ; i++)\n {\n if(i<=initial/2)\n {\n count++;\n }\n else\n {\n count--;\n }\n\n if(i==remove)\n {\n printf(\"%d\",count);\n break;\n }\n }\n }\n else\n {\n for(int i=1 ; i<=initial ; i++)\n {\n if(i<=initial/2)\n {\n count++;\n }\n else if(i=initial/2+1)\n {\n count=count;\n }\n else\n {\n count--;\n }\n\n if(i==remove)\n {\n printf(\"%d\",count);\n break;\n }\n }\n\n }\n }\n\n\n\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "f35501b139effebc1466cb2b91e03ce2", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "bfaf98113fefd1b165d9598d66ff8a62", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2853828306264501, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int n,m;\n printf(\"Enter the number of cats/n\");\n scanf(\"%d\",&n);\n printf(\"Enter the number of cats leave\\n\");\n scanf(\"%d\",&m);\n if(n>m)\n {\n if(m==0)\n {\n printf(\"geoup number is 1\");\n }\n else if((n-m)==0)\n {\n printf(\"group number is 0\");\n }\n else if((n-m)%2==0)\n {\n printf(\"group number is %d\",(n-m)/2);\n }\n else\n {\n printf(\"group number is %d\",(n-m));\n }\n }", "lang": "GNU C11", "bug_code_uid": "822547b01720a3584c24b8c9012d7c97", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "74ec966771650a03659d0103cdd15e02", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8232189973614775, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main(){\n\tint m,n;\n\tscanf(\"%d%d\",m,n)\n\tint a;\n\tif(m-n==0){\n\t\ta=0;\n\t}\n\t else if(m>=2n-1){\n\t\ta=n;\n\t}\n\telse if(m%2==0){\n\t\ta=m-n+(m/2)\n\t}\n\telse{\n\t\ta=m-n+(m-1)/2\n\t}\n\tprintf(\"%d\\n\",a); \n} ", "lang": "GNU C11", "bug_code_uid": "b23fa5b495a1b219670aae9e9159669e", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "1a1926903d3a6041faa32a2f25d5316a", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9914529914529915, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n\tint m,n;\n\twhile(scanf(\"%d%d\",&m,&n)){\n\tint a;\n if (n==0){\n\t\ta=1; \n\t}\n\t else if(m>=2*n){\n\t\ta=n;\n\t}\n\telse {\n\t\ta=m-n;\n\t}\n\t\n\tprintf(\"%d\\n\",a); \n}\n} ", "lang": "GNU C11", "bug_code_uid": "379873cff2020f189d97c89704bdb05e", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "1a1926903d3a6041faa32a2f25d5316a", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6762589928057554, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nvoid main()\n{\n printf(\"25\"); \n}", "lang": "GNU C11", "bug_code_uid": "bec73ed95cb6b095b3d24d860638ad0d", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "e34015011ab10ee926039d48a5b4d6a5", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9827856025039123, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\n#define REP(i,a,b) for(i=a;iin[k][0]&&in[k][0]>in[3][0]))) break;\n if(in[i][0]==in[3][0] && ((in[i][1]in[k][1]&&in[k][1]>in[3][1]))) break;\n }\n if(k==3) break;\n }\n }\n if(i<2) break;\n ok=1; break;\n }\n in[3][0] -= di; in[3][1] -= dj;\n }\n if(ok) puts(\"OTHER\"); else puts(\"CHECKMATE\");\n\n break;\n }\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c501188a4697972a18d26a7e9053acc3", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "9c935d68e9181ea8b0284dd9b914e07c", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9697435897435898, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n\n#define W_L 1\n#define W_K 2\n#define B_K -4\n\nvoid set_p(int board[8][8]){\n int i,j,k,l;\n\n for(i = 0; i<8; i++)\n for(j = 0; j<8; j++)\n\t if(!(board[i][j]>0 || board[i][j]==B_K))\n\t board[i][j]=0;\n\n for(i = 0; i<8; i++)\n for(j = 0; j<8; j++)\n\t if(board[i][j]>0){\n\t if(board[i][j]==W_L){\n\t for(k = j-1; k>=0 && board[i][k]<=0;k--)\n\t\t board[i][k]=-1;\n\t for(k = j+1; k<9 && board[i][k]<=0; k++)\n\t\t board[i][k]=-1;\n\t for(k = i-1; k>=0 && board[k][j]<=0;k--)\n\t\t board[k][j]=-1;\n\t for(k = i+1; k<9 && board[k][j]<=0; k++)\n\t\t board[k][j]=-1;\n\t } else if(board[i][j]==W_K) {\n\t for(k = i-1; k<=i+1; k++)\n\t\t for(l = j-1; l<=j+1; l++)\n\t\t if(k>=0 && k<8 && l>= 0 && l<8 && board[k][l]<=0)\n\t\t board[k][l]=-1; \n\t }\n\t }\n\n}\n\nvoid cpy_board(int dest[8][8], int source[8][8]){\n int i,j;\n for(i = 0; i<8; i++)\n for(j = 0; j<8; j++)\n\t dest[i][j] = source[i][j];\n}\n\nint main(){\n int x,y;\n char _x;\n int i, j;\n int other = 0;\n int board[8][8];\n int temp_board[8][8];\n\n for(i = 0; i<8; i++)\n for(j = 0; j<8; j++)\n\t board[i][j] = 0;\n\n scanf(\"%c%d \",&_x,&y);\n x = _x-'a';\n y--;\n board[x][y] = W_L;\n scanf(\"%c%d \",&_x,&y);\n x = _x-'a';\n y--;\n board[x][y] = W_L;\n scanf(\"%c%d \",&_x,&y);\n x = _x-'a';\n y--;\n board[x][y] = W_K;\n scanf(\"%c%d\",&_x,&y);\n x = _x-'a';\n y--;\n board[x][y] = B_K;\n\n set_p(board);\n\n if(board[x][y] == B_K)\n printf(\"OTHER\\n\");\n else {\n for(i = x-1; i<=x+1; i++)\n\t for(j = y-1; j<=y+1; j++)\n\t if(i>=0 && i<8 && j>=0 && j<8 && board[i][j]==W_L){\n\t cpy_board(temp_board, board);\n\t temp_board[x][y]=0;\n\t temp_board[i][j]=B_K;\n\t set_p(temp_board);\n\t other = other || temp_board[i][j]==B_K;\n\t }\n if(other)\n\t printf(\"OTHER\\n\");\n else\n\t printf(\"CHECKMATE\\n\");\n\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1e44f338b2265ab1541c6fc19970122e", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "932acc576e87fa61f13225e1d42c3615", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9754768392370572, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\nlong long int n,i,a[100000],low,high,mid,j,c=0;\nscanf(\"%I64d\",&n);\nfor(i=0;;i++)\n{a[i]=((i+1)*(i+2))/2;\nif(a[i]>=n)break;}\nfor(j=0;j<=i;j++)\n{low=0,high=i;\nwhile(low<=high)\n{if(a[j]+a[mid]==n)\n{c++;\nprintf(\"YES\");\nbreak;}\nelse if(a[j]+a[mid]\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n printf(\"%d\",(n-2)(n-2));\n \nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "cede897a95abba53bfc68cacbec6a5c0", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "84e69f246454c37c831b0b6ca25637fb", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.576, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 18, "bug_source_code": "#include\n\nusing namespace std;\n\nint main()\n{\n int n;\n cin>>n;\n cout << (n-2)*(n-2) <\nint main()\n{\n scanf(\"%d\",&n);\n c=(n-2)*(n-2);\n printf(\"%d\",c);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "a697d6aa941241a46d951ff93db0c6e5", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "948185b6b8cee48c076a94c26dd049a2", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.00612088752869166, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C11", "bug_code_uid": "dff085d05083eb4dc5133f561717ba87", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "fd186910044a180d48cdd446f95482db", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.988009592326139, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,a,i,;\n scanf(\"%d %d\",&n,&a);\n if(a%2==0)\n {\n x=x+(n-a)/2;\n printf(\"%d\",x);\n }\n else\n {\n x=x+(a)/2;\n printf(\"%d\",x);\n }\n}", "lang": "GNU C11", "bug_code_uid": "40e2a94346b5a8f81cd2d36c2dd176dc", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "5326c8b2fc57a66438ece0088c7558a9", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.995850622406639, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main() {\n int a, n, b = 1, t = 1;\n scanf(\"%d%d\", &n, &a);\n if(a % 2 != 0) {\n while(a != 1) {\n a -= 2;\n t++;\n }\n printf(\"%d\", t);\n return 0;\n }\n else {\n while(n != a) {\n n -= 2;\n t++;\n }\n printf(\"%d\", t);\n return 0;\n }\n", "lang": "GNU C11", "bug_code_uid": "d5b6a0d7afb79ad5e33747f623117686", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "e5927424e65206715f56f8a670f67a64", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9950544015825915, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int Y,W,n;\n scanf(\"%d\",&Y);\n scanf(\"%d\",&W);\n if(Y>=W)\n {\n n = (6-Y)+1;\n }\n if(W>=Y)\n {\n n = (6-W)+1;\n }\n if(n==1)\n {\n printf(\"1/1\");\n }\n else if(n==2)\n {\n printf(\"1/3\");\n }\n else if(n==3)\n {\n printf(\"1/2\");\n }\n else if(n==4)\n {\n printf(\"2/3\");\n }\n else if(n==5)\n {\n printf(\"5/6\");\n }\n else if(n==6)\n {\n printf(1/1);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8063e518350bcad6c031555ac09589c7", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "ee38d8069f5c3e5e18df1b891207334d", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.579520697167756, "equal_cnt": 37, "replace_cnt": 31, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 37, "bug_source_code": "#include \nusing namespace std; \nint jl[100]; \nint main() \n{ \n \n int n,k,c=0; \n cin>>n>>k; \n if(k==1) \n { \n cout<\n#include\n#define T 100010\nint P[T];\nint siv();\nint main()\n{int a,b,c,i,k,n[100050],p=0;\n scanf(\"%d %d\",&a,&b);i=2;k=0;\n while(a>=1)\n {\n if(a%i==0)\n {\n a=a/i;k++;if(k==b){p++;if(a!=1)n[p]=a;else n[p]=i;if(p==b)break;}\n else\n {p++;n[p]=i;}\n }\n else i++;\n }\n if(p\n\nint main() {\n\tlong long n, b;\n\tscanf(\"%lld%lld\", &n, &b);\n\tlong long ans = 1000000000000000000;\n\tfor( long long i=2, p, l, tn, cans; b>1; ++i ) {\n\t\tif( b%i )\n\t\t\tcontinue;\n\t\tfor( l=0, p=1; b%i == 0 ; b /= i )\n\t\t\tl++;\n\t\tcans = 0;\n\t\tfor( tn=n/i; tn; tn /= i ) cans += tn;\n\t\tif( cans/l < ans )\n\t\t\tans = cans/l;\n\t}\n\tprintf(\"%lld\\n\", ans);\n}", "lang": "GNU C11", "bug_code_uid": "8110eff0af0313fec968cc8e7a1b2ba6", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "2a939fbfb39cf8383975e758f4e483f5", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.878099173553719, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint main() {\n\tlong long n, b;\n\tscanf(\"%lld%lld\", &n, &b);\n\tlong long ans = 1000000000000000000;\n\tfor( long long i=2, p, l, tn, cans; i*i <= b; ++i ) {\n\t\tif( b%i )\n\t\t\tcontinue;\n\t\tfor( l=0, p=1; b%i == 0 ; b /= i )\n\t\t\tl++;\n\t\tcans = 0;\n\t\tfor( tn=n/i; tn; tn /= i ) cans += tn;\n\t\tif( cans/l < ans )\n\t\t\tans = cans/l;\n\t}\n\tif( b != 1 ) {\n\t\tlong long i=b, l=1;\n\t\tfor( tn=n/i; tn; tn /= i ) cans += tn;\n\t\tif( cans/l < ans )\n\t\t\tans = cans/l;\t\t\n\t}\n\tprintf(\"%lld\\n\", ans);\n}", "lang": "GNU C11", "bug_code_uid": "646019930c7c3e4ff070e39ef51ddaeb", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "2a939fbfb39cf8383975e758f4e483f5", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8987993138936535, "equal_cnt": 19, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 15, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include \n\nint a,b,l;\nint x,y,xl,yl;\n\nchar s[101];\nint w[101][2];\nint al,bl;\nint main()\n{\n int i,j;\n \n scanf (\"%d%d\",&a,&b);\n scanf (\"%s\",s);l=strlen(s);\n if (a==0&&b==0){printf (\"Yes\\n\");return 0;}\n for (i=0;i\\n\",al,bl,x,y);\n if (al*xl<0||bl*yl<0)continue;\n if (al==0&&bl==0) {printf (\"Yes\\n\");return 0;}\n if (al==0) {if (xl==0&&bl%yl==0) {printf (\"Yes\\n\");return 0;}else continue;}\n if (bl==0) {if (yl==0&&al%xl==0) {printf (\"Yes\\n\");return 0;}else continue;}\n if (al%xl==0&&bl%yl==0&&al/xl==bl/yl){printf (\"Yes\\n\");return 0;}\n }\n printf (\"No\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "37534ddb13d076648a274bbdafb9d0be", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "d1ccff86477ec0f0aa78caca55c947b2", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9142857142857143, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n\nint main()\n{\n\tint n,v,a,b,c,i;\n\tscanf(\"%d%d\",&n,&v);\n\tif(n<=v)\n\t{\n\t\ta=n-1;\n\t\tprintf(\"%d\",a);\n\t\treturn;\n\t}\n\tc=2;\n\tb=v;\n\tfor(i=1;i<(n-v);i++)\n\t{\n\t\tb=b+c;\n\t\tc++;\n\t}\n\tprintf(\"%d\",b);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "28d46757992b088d8ab5c4ce1b312310", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "ccf911204d7e9d8f70836e782ea09b6f", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9964830011723329, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n\nint main()\n{\n int i,count=0,max=0,n;\n char str[50];\n scanf(\"%d\\n\",&n);\n scanf(\"%[^\\n]%*c\",str);\nif((n>=1)&&(n<=200))\n{\n for(i=0;imax) max=count;\n count=0; }\n if(count>max) max=count;\n }\n}\nprintf(\"%d\",max);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "fca6fb57aeeafce5f3336e1f969cf8f1", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "apr_id": "5f90542eab6b080d722be2464c604cae", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6123456790123457, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nint i,j,a[101],s[101]={0},max;\n\nint main()\n{\n\tfor (i=1;i<=14;i++) scanf(\"%d\",&a[i]);\n\tfor (i=15;i<=28;i++) a[i]=a[i-14];\n\tfor (i=1;i<=14;i++)\n\tif (a[i])\n\t{\n\t\t\n\t\tfor (j=i+1;j<=i+a[i];j++) \n\t\tif (a[j]%2==1) s[i]+=a[j]+1;\n\t}\n\tfor (i=1,max=0;i<=14;i++) max=max>s[i] ? max : s[i];\n\tprintf(\"%d\\n\",max);\n\treturn 0;\n} \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "f2009857680fc6cd0e1f802405f8ebe1", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "d8312f5a1cff188bad3310680535843d", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.997624703087886, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\n#define LENGHT_PHONE 11\n\nint main()\n{\n\t//read input\n\tint n;\n\tchar str[101];\n\tscanf(\"%d %s\", &n, str);\n\t\n\t//produce outputed\n\tint cnt = 0;\n\tfor (int i = 0; i < n; i++)\n\t{\n\t\tif (str[i] == '8') //calculate how many '8' have in 'str'\n\t\t\tcnt ++;\n\t}\n\n\t//on every 11 digit we must have at least one '8'\n\tif (n/LENGTH_PHONE <= cnt)\n\t\tprintf(\"%d\\n\", n/LENGTH_PHONE);\n\telse\n\t\tprintf(\"%d\\n\", cnt);\n\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "8cd05097c5d69389ad252af372e9af40", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "354702f3f313af2aecd70ae0fe8389f9", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.991869918699187, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int n,i,c=0,d,k;\n scanf(\"%d\",&n);\n char s[n];\n scanf(\"%s\",s);\n d=n/11;\n \n for(i=0; ic){\n printf(\"%d\\n\",c);\n }\n else if(c>=d && c!=0)\n printf(\"%d\\n\",d);\n else\n printf(\"0\\n\");\n ", "lang": "GNU C11", "bug_code_uid": "e9ec7c633590f0919ca329101a9a02f3", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "490b18c1e39857d0ae9baa827e1cb8ac", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9870410367170627, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\n\nint main(void) {\n\tint n, c = 0, i = 0, q;\n\tchar S[100];\n\tscanf(\"%d\", &n);\n\tscanf(\"%s\", S);\n\tq = n / 11;\n\n\n\t\twhile (S[i] != '\\0') {\n\t\t\tif (S[i] == '8') {\n\t\t\t\tc++;\n\t\t\t}\n\t\t}\n\t\tif (c == 0) {\n\t\t\tprintf(\"0\");\n return 0;\n\t\t}\n else{\n if(q==0){\n printf(\"0\");\n return 0;\n }\n else{\n if(q\nint main()\n{\n int n,m,i=0,j,max,min;\n\twhile(scanf(\"%d %d\",&n,&m))\n\t{\n\t\tif(n==0)\n\t\t\tprintf(\"Impossible\");\n\t\telse\n\t\t{\n\t\t\tif(m>n)\n\t\t\t{max=m;min=n+m-1;}\n\t\t\tif(m<=n)\n\t\t\t\tmax=n;min=m+n-1;\n\t\t\tif(i++!=0)\n\t\t\t\tprintf(\"\\n\");\n\t\t\t printf(\"%d %d\",min,max);\n\t\t}\n\t}\n return 0;\n}\n ", "lang": "GNU C", "bug_code_uid": "100323b9ac35f32508664274ba238a13", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "8c58dd18ffb27bfc58d5c41159bd2fb7", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9996455157745481, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\n#include\n#define INF 200000000\n__int64 num[10],dp[500000][105];\n__int64 jie(__int64 p)\n{\n __int64 re,i;\n for(i=1,re=1;i<=p;i++)\n re*=i;\n return re;\n}\nint main()\n{\n __int64 n[20],m,i,j,k,l,wei;\n char s[20];\n while(scanf(\"%s%I64d\",&s,&m)!=EOF)\n {\n wei=strlen(s);\n memset(num,0,sizeof(num));\n for(i=0;i\n#include\nint main()\n{\n long long int n,m,s,i,j,ans,c=0,d=0,f=1,e;\n scanf(\"%lld %lld %lld\",&n,&m,&s);\n if(m>=4&&m/s<=2){\n c=m;\n }\n else{\n if(m%s==0){\n c=(m/s-1)+1;e=(m/s-1)*s+1;\n }\n else {\n c=(m/s)+1;e=(m/s)*s+1;\n }\n }\n if(n>=4&&n/s<=2){\n d=n;\n }\n else{\n if(n%s==0){\n d=(n/s-1)+1;f=(n/s-1)*s+1;\n }\n else {\n d=(n/s)+1;f=(n/s)*s+1;\n }\n }\n ans=c*d*(m-e+1)*(n-f+1);\n printf(\"%lld\",ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0702a01e02a9209151d7afef75121a20", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "5c9664ddfdc93d26c54aba2a692c9d9d", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2354948805460751, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n\nint main()\n\n{\n\tint n;\n\t\n\tint p=0;\n\t\n\tscanf(\"%d \\n\",&n);\n\t\n\tint sum[n];\n\t\n\t\n\tif(n>=1)\n\t{\n\t\tfor(int i=n;i>0;i--)\n\t\t{\n\t\t\tif(i%2==0)\n\t\t\t{\n\t\t\t\tsum[i]=i;\n\t\t\t}\n\t\t\telse\n\t\t\tsum[i]=-i;\n\t\t}\n\t\t\n\t\tfor(int i=1;i<=n;i++)\n\t\t{\n\t\t\tp=p+sum[i];\n\t\t\t\n\t\t}\n\t\t\n\t\tprintf(\"%d\",p);\n\t\t\n\t}\t\n\t\n\t\n\t\n\t\n\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "07f1c0473eccd508b29c5f4af9ed802d", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "1bd670e519ffa7b90240eb1713c182bf", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9562377531025473, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n , a ,b;\n int diva = 0;\n int divb = 0;\n int totalmatches=0;\n int counter=1;\n\n scanf(\"%d %d %d\" , &n , &a , &b);\n if( ((b > n/2) || (a > n/2)) && ( (b <= n/2) || (a <= n/2)) )\n {\n printf(\"Final!\");\n return 0;\n }\n int temp=n;\n while(temp!=1)\n {\n temp = temp/2;\n totalmatches++;\n }\n totalmatches--;\n if(a%2!=0)\n a = (a+1);\n if(b%2!=0)\n b = (b+1);\n while(1)\n {\n if(a > n/2)\n {\n n=n/2;\n a=a-n;\n b=b-n;\n }\n else\n n=n/2;\n if( ((b > n/2) || (a > n/2)) && ( (b <= n/2) || (a <= n/2)) )\n {\n printf(\"%d\" , totalmatches);\n return 0;\n }\n totalmatches--;\n }\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7ba132935fd4f4d049f4ecf113ee6454", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "227f0b252f2d81d671dcd7b8e8dfee6c", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.23969319271332695, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "#include \n\nint main()\n{\n\tint n,a,b,i;\n\tscanf(\"%d %d %d\",&n,&a,&b);\n\tint ar[n];\n\tfor (i = 0; i < n; ++i)\n\t{\n\t\tar[i]=i+1;\n\t}\n\tchar st=0;\n\tchar p,j;\n\tchar y=1;\n\tj=0;\n\twhile(y)\n\t{\n\t\tj++;\n\t\tfor (i = 0; i < n; ++i)\n\t\t{\n\t\t\tif(ar[i] && !st)\n\t\t\t{\n\t\t\t\tst=1;\n\t\t\t\tp=i;\n\t\t\t}\n\t\t\telse if(ar[i] && st)\n\t\t\t{\n\t\t\t\tif(ar[i]==a || ar[i]==b)\n\t\t\t\t{\n\t\t\t\t\tif(ar[p]==a || ar[p]==b)\n\t\t\t\t\t{\n\t\t\t\t\t\ty=0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tar[p]=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tar[i]=0;\n\t\t\t\t}\n\t\t\t\tst=0;\n\t\t\t}\n\t\t}\n\t}\n\tst=1;\n\tfor(i=0;st!=n;i++)st*=2;\n\t\n\tif(j==i)printf(\"Final!\\n\");\n\telse printf(\"%d\\n\", j);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "6e96c5db8bbd11c979d22acab42fe4fa", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "5afa05c137f956f8dbc5467391b6b224", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9896373056994818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n\tint sum=1;\n\tint flag=0,total=0;\n\tint a,b,c,n;\n\tscanf(\"%d %d %d %d\",&n,&a,&b,&c);\n\twhile(sum!=n){\n\t\tswitch(flag){\n\t\t\tcase 0:\n\t\t\t\tif(a\n#include \n\n\nint main(void)\n{\n int n, r2o, o2e, e2r;\n \n scanf(\"%d %d %d %d\", &n, &r2o, &o2e, &e2r);\n \n if((n+2)%3==0)\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3);\n }\n else if(n+2)%3==1)\n {\n if(r2o>o2e)\n {\n if(o2e>e2r)\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+e2r);\n }\n else\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+o2e);\n }\n }\n else\n {\n if(r2o>e2r)\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+e2r);\n }\n else\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+r2o);\n }\n }\n }\n else // /(n+2)%3==2\n {\n if(r2o>o2e)\n {\n if(o2e>e2r) // r2o>o2e>e2r\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+e2r);\n }\n else\n {\n if(r2o>e2r) // r2o>e2r>o2e\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+o2e);\n }\n else // e2r>r2o>o2e\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+o2e);\n }\n }\n }\n else\n {\n if(r2o>e2r) // o2e>r2o>e2r\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+e2r);\n }\n else\n {\n if(e2ro2e>r2o\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+r2o);\n }\n else // o2e>e2r>r2o\n {\n printf(\"%d\", (r2o+o2e+e2r)*n/3+r2o);\n }\n }\n }\n }\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fe6712597b36c946c843459a1c662827", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "f259fc77c60e9de6e0ebcaeae39511d1", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9976303317535545, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \"stdio.h\"\n\nint main()\n{\n int n,a,b,c;\n int distance[3][3];\n while(scanf(\"%d\",&n)!=EOF)\n {\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n scanf(\"%d\",&c);\n distance [0][1] = distance[1][0] = a;\n distance[0][2]=distance[2][0] = b;\n distance[1][2]=distance[2][1] = c;\n n--;\n position = 0;\n int s = 0;\n while(n>0)\n {\n if(distance[position][(position+1)%3]<=distance[position][(position+2)%3])\n {\n n--;\n s += distance[position][(position+1)%3];\n position = (position+1)%3;\n }\n else\n {\n n--;\n s+= distance[position][(position+2)%3];\n position = (position+2)%3;\n }\n }\n printf(\"%d\\n\",s);\n }\n}", "lang": "GNU C", "bug_code_uid": "0c3280236fbfb4e6c2ddc0124ab16b21", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "2966c09ba9e7de59334acffa881de4e8", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9777777777777777, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n\n\nint main(void)\n{\n int n,i;\n scanf(\"%d\",&n);\n int arr[6];\n for(i=0;i<6;i++)\n {\n arr[i]=0;\n }\n i=0\n while(n>0)\n {\n arr[5-i]=n%2;i++;\n n=n/2;\n }\n int sum=(arr[1]*1+arr[4]*2+arr[2]*4+arr[3]*8+arr[5]*16+arr[0]*32);\n printf(\"%d\",sum);\n \n}", "lang": "GNU C11", "bug_code_uid": "ab78af44e29d2b8c5feec8582744c483", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "apr_id": "b4e435ac7fb5cad44d5aa850a7b5ceac", "difficulty": null, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8081494057724957, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{int a,i=5;\n int s[6];\n for(int j=0;j<6;++j)\n s[j]=0;\n scanf(\"%d\",&a);\n while(a)\n {s[i]=a%2;\n a=a/2;\n --i;\n }\n int b[6];\n b[0]=s[0];\n b[1]=s[5];\n b[2]=s[3];\n b[3]=s[2];\n b[4]=s[4];\n b[5]=s[1];\n cout<<32*b[0]+16*b[1]+8*b[2]+4*b[3]+2*b[4]+b[5];\n return 0; \n}", "lang": "GNU C11", "bug_code_uid": "55f416f74caa6a4eac4ec8d783b320a7", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "apr_id": "9405720dbeec422bd2eb0b71bd1590c4", "difficulty": null, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.17566688353936238, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "//practice with dukkha\n#include\n#include\nlong long int rev(long long int a)\n{\n long long int b=0;\n while(a!=0)\n {\n b+=a%10;\n a/=10;\n b*=10;\n }\n return b/10;\n}\nlong long int palin(long long int a)\n{\n if(a==rev(a))\n return 1;\n else\n return 0;\n}\nint len(long long int a)\n{\n int l=0;\n while(a!=0)\n {\n l++;\n a/=10;\n }\n return l;\n}\nint main()\n{ \n int a,b;\n scanf(\"%d %d\",&a,&b);\n long long sum=0;\n for(long long int i=1;i<9223372036854775807;i++)\n {\n int l=len(i);\n if(l%2==0)\n {\n long long int k=palin(i);\n if(k==1)\n {\n a--;\n sum=(((sum%b)+(i%b))%b);\n }\n }\n }\n printf(\"%lld\\n\",sum);\n return 0; \n}", "lang": "GNU C11", "bug_code_uid": "0dbe4a421c13b22a59d1f2a401dadc0a", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "79ce30bf1162be8aee75207041692a8d", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9929577464788732, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n long long int i,j,k,n,c;\n char a[10000];\n scanf(\"%s\",a);\n n=strlen(a);\n c=0;\n for(i=0;i\nint main()\n{long long inp, i,j,a[7];\ni=0;\nscanf(\"%lld\",&inp);\nwhile(inp > 0)\n{a[i] = inp%10;\n \tinp =inp/10; \n \tif(a[i]>4 )\n\t {\n\ta[i] =9-a[i];}\n \ti++;}\nif(a[i-1]==0){a[i-1]=9;}\nfor(j=i-1;j>=0;j--)\n{printf(\"%lld\",a[j]);}\nreturn 0;}\n", "lang": "GNU C11", "bug_code_uid": "d66ff683db304eb2437495cca8b42edb", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "76dfd4ec02e36865cfc16a854c547dc7", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9751098096632503, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nint main() {\nint a,b,count=0,c,d;\nscanf(\"%d%d\",a,b);\nc=b/a; if (c==1) printf(\"0\");\nelse if (c%2!=0 && c%3!=0) printf(\"-1\");\nelse if (c%2==0 && c%3!=0)\n{\n while(c%2==0)\n {\n c/=2;\n count++;\n }\n if(c==1) printf(\"%d\",count);\n else printf(\"-1\");}\nelse if (c%2!=0 && c%3==0)\n{\n while(c%3==0)\n {\n c/=3;\n count++;\n }\n if(c==1) printf(\"%d\",count);\n else printf(\"-1\");}\nelse if (c%6==0)\n{\n while(c%2==0)\n {\n c/=2;\n count++;\n }\n while(c%3==0)\n {\n c/=3;\n count++;\n }\n if(c==1) printf(\"%d\",count);\n else printf(\"-1\");}\n return 0;}\n", "lang": "GNU C11", "bug_code_uid": "9b1a09a2e1211bb87c4961cfbb8ad0d2", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "9039f8bd75bc18036783b78d053d8981", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8786516853932584, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \nint main()\n{\nint x,y,clr,i;\nscanf(\"%d %d\",&x,&y);\nfor(i=1;i<=1000;i++)\n{\n if ((x*x)+(y*y) == i*i)\n {\n clr=1;\n goto X;\n }\n if ((x*x)+(y*y)< i*i)\n {\n if((x*y) >0)\n {\n clr = i%2;\n goto X;\n }\n else\n {\n clr = 1 - i%2;\n goto X;\n }\n }\n}\nX:\nif (clr == 1) printf(\"black\");\nelse printf (\"white\");\nreturn(0);\n}\n", "lang": "GNU C", "bug_code_uid": "d5a26411d5baca2a3146ab05d4c978cd", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "daffb45c72dcad651562f4b1669f3608", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9892857142857143, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\n#define oo 2000000000\n#define min(a,b) ((a)<(b)?(a):(b))\n#define max(a,b) ((a)>(b)?(a):(b))\n#define abs(a) ((a)<0?-(a):(a))\n#define eps 1e-8\n\nint main()\n{\n long x,y;\n long i;\n \n scanf(\"%ld%ld\",&x,&y);\n \n if(x<0&&y<0)\n {\n x=-x;\n y=-y;\n }\n if(x==0||y==0)\n {\n printf(\"black\\n\");\n return 0;\n }\n \n for(i=1;i*i0)\n {\n printf(\"white\\n\");\n return 0;\n }\n else\n printf(\"black\\n\");\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "bada80a183de1d9a942639d2f4ad3275", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "d2fb7619d1949ac05b39ddb9823ac173", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7671232876712328, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \nint main()\n{ int x,y,i,org=1,copy=0;\n scanf(\"%d%d\",&x,&y);\n for(i=1;i\nint main()\n{\n long long int sum1=0,sum2=0,i,j,k,n,a,b,m;\n scanf(\"%lld %lld %lld %lld\",&n,&k,&a,&b);\n m=n;\n if(k==1){\n sum1=n*b;\n }\n else{\n while(n!=1){\n if(n%k==0){\n sum1=sum1+b;\n n=n/k;\n }\n else{\n n--;\n sum1=sum1+a;\n }\n }\n }\n sum2=(m-1)*a;\n if(sum2\nint main()\n{\n unsigned long long n,k,a,b,sum=0,x,i;\n scanf(\"%llu%llu%llu%llu\",&n,&k,&a,&b);\n while(1)\n {\n if(n==1)break;\n if(k==1){sum=sum+(n-1)*a;break;}\n if(n%k==0){\n x=n/k;\n x=n-x;\n if(b>x*a){sum=sum+a;n--;}\n else {sum=sum+b;n=n/k;}\n }\n\n else if(n==1)break;\n else {\n if(n\n\nint min(int a, int b)\n{\n return a < b ? a : b;\n}\n\nint max(int a, int b)\n{\n return a > b ? a : b;\n}\n\nint az(int a)\n{\n return a > 0 ? a : -a;\n}\n\nint main()\n{\n int x1, x2, y1, y2, a, b, c, d;\n scanf(\"%d%d%d%d\", &x1, &y1, &x2, &y2);\n a = min(x1, x2 - 1);\n b = max(x1, x2 + 1);\n c = min(y1, y2 - 1);\n d = max(y1, y2 + 1);\n printf(\"%d\\n\", az(2 * (a - b) * (c - d));\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "42b77a77715a357361e0e49c1d1810d0", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "06e9e0657a436d394e46c9adacbfbe01", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.08188331627430911, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include\n\n\n\nint numberOfWalls(int n,int c,int N ,int C, int dp[N+1][C+1]){\n\tint i,count = 0;\n\tif(dp[n][c]!=-1){\n\t\treturn dp[n][c];\n\t}\n\tfor(i=0;i<=n;i++){\n\t\tcount+=numberOfWalls(n-i,c-1,N,C,dp);\n\t\tif(count>=1000003){\n\t\t\tcount%=1000003;\n\t\t}\n\t}\n\tdp[n][c]=count;\n\treturn count;\n}\n\nint main(){\n\tint n,c,i,j;\n\tscanf(\"%d %d\",&n,&c);\n\tint dp[n+1][c+1];\n\tfor(i=0;i<=n;i++){\n\t\tfor(j=0;j<=c;j++){\n\t\t\tdp[i][j]=-1;\n\t\t}\n\t} \n\tfor(i=0;i<=n;i++){\n\t\tdp[i][1]=i+1;\n\t}\n\t\n\tprintf(\"%d\\n\",numberOfWalls(n,c,n,c,dp)-1);\n\treturn 0;\n\t}\n\n\n", "lang": "GNU C", "bug_code_uid": "cc32ffb1f54fc9116b8d8af86f754d08", "src_uid": "e63c70a9c96a94bce99618f2e695f83a", "apr_id": "34d4617e2f10ef350b28236fc2200449", "difficulty": 1800, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3443708609271523, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \n\nint main(void) {\n\t// your code goes here\n\tint n,c,i,j;\n\tscanf(\"%d %d\",&n,&c);\n\tint dp[n+1];\n\tfor(i=0;i<=n;i++){\n\t\tdp[i]=i+1;\n\t}\n\tfor(i=2;i<=c;i++){\n\t\tfor(j=1;j<=n;j++){\n\t\t\tdp[j]=dp[j]+dp[j-1];\n\t\t\tif(dp[j]>1000002)\n\t\t\t\tdp[j]%=1000003;\n\t\t}\n\t}\n\tprintf(\"%d\\n\",dp[n]-1);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a6ee3eb8ad9acf8937ca9c0cec23f8f7", "src_uid": "e63c70a9c96a94bce99618f2e695f83a", "apr_id": "34d4617e2f10ef350b28236fc2200449", "difficulty": 1800, "tags": ["combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7128712871287128, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main()\n{\n int n,c[1000]={0},k=0;\n scanf(\"%d\",&n);\n char s[10000];\n scanf(\"%s\",s);\n int i=0,j=0;\n while(i0)\n printf(\"%d \",c[i]);\n }\n}", "lang": "GNU C11", "bug_code_uid": "ee298dc72913cd6126c3ae48610fcb41", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "1073190b78c4641cc5fb76d1b51eaa99", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8499399759903962, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main()\n{\n\tint a, b, c, d;\n\tint prirastaj;\n\tfloat koeficijent;\n\tscanf(\"%d%d%d%d\", &a, &b, &c, &d);\n\n\tprirastaj=b-a;\n\tkoeficijent=(float)b/a;\n\n\tif(c==b+prirastaj && d==c+prirastaj)\n\t\tprintf(\"%d\", d+prirastaj);\n\telse if(c==koeficijent*b && d==koeficijent*c)\n\t{\n\t\tif(koeficijent*d==(int)(koeficijent*d))\n\t\t\tprintf(\"%d\", (int)(koeficijent*d));\n\t\telse printf(\"42\");\n\t}\n\telse printf(\"42\");\n\n\treturn 0;", "lang": "GNU C", "bug_code_uid": "d61293a4936ab05550d2016c789d2de1", "src_uid": "68a9508d49fec672f9c61766d6051047", "apr_id": "15c29ae1301548b6a0de91e48bb371e7", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8306451612903226, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \nint main()\n{\n\tint a, b, c, d;\n\tint prirastaj, koeficijent;\n\tscanf(\"%d%d%d%d\", &a, &b, &c, &d);\n\n\tprirastaj=b-a;\n\tkoeficijent=b/a;\n\n\tif(c==b+prirastaj && d==c+prirastaj)\n\t\tprintf(\"%d\", d+prirastaj);\n\telse if(c==koeficijent*b && d==koeficijent*c)\n\t\tprintf(\"%d\", koeficijent*d);\n\telse printf(\"42\");\n\n\treturn 1;\n}", "lang": "GNU C", "bug_code_uid": "65e9aacf0b95ae7ed0d8140dda924c1a", "src_uid": "68a9508d49fec672f9c61766d6051047", "apr_id": "15c29ae1301548b6a0de91e48bb371e7", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.73515625, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nvoid buble_sort(int a[], int n)\n{\n int i, j, t;\n for(i=0; ia[j+1])\n {\n t=a[j];\n a[j]=a[j+1];\n a[j+1]=t;\n }\n }\n }\n}\nint main()\n{\n int n, l, i, j, xr, yr, xl, xh, yl, yh;\n scanf(\"%d\", &n);\n l=(4*n)+1;\n int x[l];\n int y[l];\n int xd[l];\n int yd[l];\n for(i=0; ixh) || (yd[i]yh))\n \t{\n \t xr=xd[i];\n \t yr=yd[i];\n \t break;\n }\n else if((xd[i]>xl && xd[i]yl && yd[i]\n#include \n\nint main()\n{\n int n,k,i=0,j,l,x,c=0;\n scanf(\"%d %d\",&n,&k);\n int a[k];\n x=a[0]=n;\n while(i\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C", "bug_code_uid": "c36bbecedfa861b1cf1fceff0a44f69c", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "a5e8d8315886d344762e9ee437458dfb", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9825949367088608, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nusing namespace std;\n#define maxD 51\n\nint maxim(int a,int b)\n{\n if(a>b) return a;\n return b;\n}\n\nint main()\n{\n\n int i,n,c,p[maxD],t[maxD],L,R;\n L=R=0;\n scanf(\"%d%d\",&n,&c);\n\n for(i=0;i=0;--i)\n {\n timp+=t[i];\n R+=maxim(0,p[i]-c*timp);\n }\n\n if(L>R)\n printf(\"Limak\");\n else if(L==R)\n printf(\"Tie\");\n else\n printf(\"Radewoosh\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "59254575f0ed411c76a0db30e46c5cd9", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "234e7e189ddf3f9e8a4f5af60b7e87f0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7236335642802155, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n//#include\nint main()\n{\n int a,b,c,d,e,f,x,y;\n scanf(\"%d%d%d%d%d%d\",&a,&b,&c,&d,&e,&f);\n if(d==0)\n printf(\"Hermione\");\n else\n if((a==0&&b!=0)||c==0||((e==0&&f!=0)&&b!=0))\n printf(\"Ron\");\n else if((a==0&&e==0)||(e==0&&f==0))\n printf(\"Hermione\");\n else\n {\n x=d*b/c;\n y=f*x/e;\n if(y>a) printf(\"Ron\");\n else printf(\"Hermione\");\n }\n // getch();\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "92fe17fbe1f5edf5cc0542089f4bb160", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "af0d3d96baeb13bf2f8dd2ef3a6875ad", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8891595615103532, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main()\n{\n char button;\n int i,sum=0,cx=0;\n for(i=0;i<9;i++)\n {\n scanf(\"%c\",&button);\n if(button=='X')\n {\n if(i!=4)\n {\n sum=sum+i;\n cx++;\n }\n }\n else if (button=='\\n') i--;\n }\n if(sum/cx==4)printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8c133717380744d5787f04fc03d00ca3", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "4f831fadd4a60ff57f37615faf0deb98", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6897637795275591, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "\n#include \n#include \n\nint main()\n{\n int a, b, sum, c;\n scanf(\"%d%d\", &a, &b);\n sum = a;\n while(a>= b ){\n a = a/b;\n sum = sum+ a;\n a = a+ a%b;\n\n }\n printf(\"%d\", sum);\n return 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "f3840f6d927b31f60b51178e4d74cc40", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "e8bafa573452cfdabb183c1186ffe65c", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7403314917127072, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\nlong long int a[100001000];\nint main()\n{\n long long int t,n,i,x,index,temp;\n\n scanf(\"%lld\",&n);\n for(i=1;i<=100001000;i++)\n {\n \ta[i]=i*(i+1)/2;\n }\n //for(i=1;i<10;i++)\n // printf(\"%lld \",a[i]);\n for(i=1;1<2;i++)\n {\n \tif(a[i]>=n)\n \t{\n \t\tindex=i;\n \t\tbreak;\n \t}\n }\n index--;\n //printf(\"\\nindex=%lld\\n\",index);\n printf(\"%lld\\n\",n-a[index]);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "904d9afda86a33bc622cad26127d7683", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "48a2325f81f3955bc7c9642699d9276e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8236559139784946, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include \ntypedef long long unsigned int u64;\nu64 dp[1<<24];\nu64 solve(const u64 n, const u64 x, const u64 y) {\n dp[1] = x;\n for(int i = 1; i <= n; i++)\n if(i & 1) dp[i] = dp[i - 1] + x;\n else dp[i] = dp[i >> 1] + y < dp[i - 1] + x ? dp[i >> 1] + y : dp[i - 1] + x;\n return dp[n];\n}\n\nint main(void) {\n int n, x, y;\n scanf(\"%d%d%d\", &n, &x, &y);\n printf(\"%llu\", solve(n, x, y));\n return 0;", "lang": "GNU C11", "bug_code_uid": "73f0b55fd51126f1f30d2b0dfd24659e", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "ac094a08abc2167582460dea617dbfe7", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.29213483146067415, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{ char x; \n int y;\n scanf(\"%c%d\",&x,&y);\n if(x=='a'||x=='h')\n {if(1\n#include \n\nint main(){\nint r1,r2,c1,c2,d1,d2,a[2][2],i=1,j=0,k=0;\nscanf(\"%d%d%d%d%d%d\",&r1,&r2,&c1,&c2,&d1,&d2);\na[0][0]=0;\na[0][1]=1;\na[1][0]=0;\na[1][1]=0;\nwhile(1){\n if((r1==a[0][0]+a[0][1])&&(r2==a[1][0]+a[1][1])&&(c1==a[0][0]+a[1][0])&&(c2==a[0][1]+a[1][1])&&(d1==a[0][0]+a[1][1])&&(d2==a[0][1]+a[1][0])){\n printf(\"%d %d\\n%d %d\\\",a[0][0],a[0][1],a[1][0],a[1][1]);\n return 0;\n }\n a[0][0]=rand()%10;\n a[0][1]=rand()%10;\n a[1][0]=rand()%10;\n a[1][1]=rand()%10;\n}\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "92ec6085c4446a804b49ad72bc19a41d", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "b74d529c014f0d49cbcab5110d7bf743", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9962034927866363, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#define __STDC_FORMAT_MACROS\n#include \n#include \n#include \n#include \n\nstatic int64_t _factorial[19] = {};\n\n// generates permutation of [0, .., n-1]\nstatic void generate_kth_permutation(int n, int64_t k, int v[static n]) {\n bool taken[n]; for(int i = 0 ; i < n ; ++i) taken[i] = false;\n for(int i = 0 ; i < n ; ++i) {\n const int64_t f = _factorial[n-i-1];\n int64_t q,r; if(k < f) {\n r = k, q = 0;\n } else {\n r = k % f; if(r == 0) r = f; // 0 < r <= m!\n q = (k - r) / f;\n }\n int qi = 0; for(int j = 0, ti = 0, tn = q+1 ; ti < tn ; ++j)\n if(!taken[j]) qi = j, ++ti;\n\n v[i] = qi; taken[qi] = true; k = r;\n }\n}\n\n// sort digits of in increasing order, and generate permutations\n// use binary search to find needed permutation\n\nstatic int compare_digit(const void* a, const void* b) { return *(const int*)a - *(const int*)b; }\n\nstatic inline int64_t number_from_digits_perm(int n, int perm[static n], int d[static n]) { int64_t ret = 0;\n if(d[perm[0]] == 0) return 0;\n for(int i = 0 ; i < n ; ++i)\n ret = 10*ret + d[perm[i]];\n return ret;\n}\n\nstatic inline bool perm_gt(int n, int64_t pn, int d[static n], int64_t V) {\n int perm[n]; generate_kth_permutation(n, pn, perm);\n const int64_t a = number_from_digits_perm(n, perm, d);\n return a > V;\n}\n\nstatic inline bool perm_lt(int n, int64_t pn, int d[static n], int64_t V) {\n int perm[n]; generate_kth_permutation(n, pn, perm);\n const int64_t a = number_from_digits_perm(n, perm, d);\n return a <= V;\n}\n\nstatic inline int64_t solve(int64_t a, int64_t b) {\n int adcount = 0; int ad[19]; while(a) {\n ad[adcount++] = a % 10; a /= 10;\n }\n qsort(ad, adcount, sizeof(int), compare_digit);\n\n int64_t low = 0, high = _factorial[adcount]+1; /* start with whole array */\n while(high - low > 1) { /* more than one candidate */\n const int mid = low + (high - low) / 2; /* pick middle */\n if(perm_gt(adcount, mid, ad, b)) high = mid; /* higher than b: no need to consider it */\n else low = mid;\n }\n\n int aperm[adcount]; generate_kth_permutation(adcount, low, aperm);\n return number_from_digits_perm(adcount, aperm, ad);\n}\n\nint main() {\n _factorial[0] = 1; for(int i = 1 ; i < 19 ; ++i) _factorial[i] = i*_factorial[i-1];\n int64_t a, b; scanf(\"%\"PRId64 \" %\"PRId64 \"\\n\", &a, &b);\n printf(\"%\" PRId64 \"\\n\", solve(a,b));\n}\n", "lang": "GNU C", "bug_code_uid": "82e95201e80596e2e8f845d1d88c61a2", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "0cdc314abf815fc28497d2184e0df9a9", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.825136612021858, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n\nmain(){\n\tint odd,even;\n\tscanf(\"%d %d\",odd,even);\n\tif (odd==even || abs(odd-even)==1)\n\tprintf(\"YES\");\n\telse printf(\"NO\");\n\n}", "lang": "GNU C11", "bug_code_uid": "c16106a8b7f4902a71e85cc23c681762", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "25c0deb24961abbdcb96f03d5f4d59a5", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5615650172612198, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nint main()\n{\n int i, a, b, s = 0, t = 0, k = 0;\n scanf(\"%d %d\", &a, &b);\n if(a == b){\n printf(\"infinity\");\n return 0;\n }\n else if(a < b) s = 0;\n else{\n k = a - b;\n for(i = 1; i <= a; i += (!i) + (t && i)){\n if(a % i == b)\n s++;\n t = i;\n }\n }\n printf(\"%d\", s);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e71771f781ff92e8304d5e7908c5009d", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "6154054b61e757f8a86ab909aaaa7187", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8690869086908691, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include\nlong long int min(long long int n,long long int k)\n{\n\tif(n=n-x)\n\t\t\tr=m;\n\t\telse\n\t\t\tl=m+1;\n\t}\n\tprintf(\"%lld\\n\",m);\n}\n", "lang": "GNU C11", "bug_code_uid": "04b95cec283367f433276ea325cfb3e7", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "b7f86292da6743cb126a4e2a057007c9", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.905852417302799, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \n#define int long long\nint n;\nint judge(int k)\n{\n int ate=0;\n int n2=n;\n while(n2>0)\n {\n ate+=k;\n n2-=k;\n n2-=n2/10;\n }\n if(n2<0)\n ate+=n2;\n return ate>=(n+1)/2;\n}\nint bisect(int l,int r)\n{\n int mid;\n while(l\n\nint main(void) {\n \n long n ,k;\n scanf(\"%ld %ld\",&n,&k);\n\n if (k!=n && n)\n {if (n/k>2)\n {printf(\"1 %ld\",k*2);}\n\n \n else if(n/k<=2)\n {printf(\"1 %ld\",n-k);}}\nelse printf(\"0 0\");\n\n\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "038b2e9f71f8ceb212aa1cf46a5b3bd9", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "ff560b79ca664d0a7ae79509555254ab", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.75, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \nint main()\n{\nint x,y,z;\nscanf(\"%d\",x);\nif(x%5==0)\n{\ny=x%5;\nprintf(\"%d\",y);\n}\nelse if(x%5!=0)\nz=x/5+1;\nprintf(\"%d\",z);\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "e84e35ca120be509b7b4cd926afbffa9", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "859b98351f4728f3050f99153f3e96ca", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9943593875906527, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint dd,mm,yy,arr[]={0,31,29,31,30,31,30,31,31,30,31,30,31};\nint yer(int d,int m,int y){\n if(m>12)\n return 0;\n if(d>arr[m])\n return 0;\n if(d==29&&m==2&&y%4!=0)return 0;\n if(d+m*30+y*365<=dd+mm*30+yy*365){\n printf(\"YES\\n\");\n return 1;}\n return 0;\n}\nint main (){\n int d,m,y;\n scanf(\"%d.%d.%d\",&dd,&mm,&yy);\n\t scanf(\"%d.%d.%d\",&d,&m,&y);\n if(yer(d,m,y))\n return 0;\n if(yer(d,y,m))\n return 0;\n if(yer(y,d,m))\n return 0;\n if(yer(y,m,d))\n return 0;\n if(yer(m,y,d))\n return 0;\n if(yer(m,d,y))\n return 0;\n printf(\"NO\\n\");\n}\n\n\n\n", "lang": "GNU C", "bug_code_uid": "54a6bcacad31988564b82e2427f5770c", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "4fe3ecb462dd253bd2fb71a0d0e62969", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9949324324324325, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint a[2][3];\n\nint f,l[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};\n\nint check(int d,int m,int y) {\n\tif (a[1][m]>12) return 0;\n\tif (a[1][d]>l[m]+!(a[1][y]%4)) return 0;\n\tif (f<366*a[1][y]+31*a[1][m]+a[1][d]) return 0;\n\treturn 1;\n}\n\nint main() {\n\tint i,j,k;\n\tfor (i=0;i<2;i++)\n\t\tscanf(\"%d.%d.%d\",&a[i][0],&a[i][1],&a[i][2]);\n\tint y=0;\n\tif (a[0][2]>18) {\n\t\tf=366*(a[0][2]-18)+31*a[0][1]+a[0][0];\n\t\tfor (i=0;i<3;i++)\n\t\t\tfor (j=0;j<3;j++)\n\t\t\t\tif (i!=j)\n\t\t\t\t\tfor (k=0;k<3;k++)\n\t\t\t\t\t\tif (k!=i&&k!=j)\n\t\t\t\t\t\t\tif (check(i,j,k)) y=1;\n\t}\n\tprintf(\"%s\\n\",y?\"YES\":\"NO\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "828fd73a0fd4189a015a37819ce4c4eb", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "99ad0867b8d103f7fda8d2ed34908f43", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8324786324786325, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include\n#define LEVEL 1\nint main(){\n\tlong long int i,c,hr,hb,wr,wb,tmp,happy,max,happybase,num;\n\tscanf(\"%lld %lld %lld %lld %lld\",&c,&hr,&hb,&wr,&wb);\n\thappybase=0;\t\n\tif(c>(wr*wb*(LEVEL+1))){\n\t\tnum=(c/(wr*wb))-LEVEL;\n\t\tif((hr*wb)>=(hb*wr)){\n\t\t\thappybase=(hr*wb)*num;\n\t\t}else{\n\t\t\thappybase=(hb*wr)*num;\n\t\t}\n\t\tc-=(wr*wb)*num;\n\t}\n\tmax=0;\n\tfor(i=0;(wr*i)<=c;i++){\n\t\ttmp=c-(wr*i);\n\t\thappy=(tmp/wb)*hb;\n\t\thappy+=(hr*i);\n\t\tif(max\n#include \nint main(void){\n\n int c, hr, hb, wr, wb, i, j, maxx, maxy, z = 0;\n\n scanf(\"%d%d%d%d%d\", &c, &hr, &hb, &wr, &wb);\n maxx = c/wr;\n maxy = c/wb;\n for (i = maxx/2; i <= maxx; i++){\n for (j = 0; wr*i+wb*j <= c; j++){\n z = z > (hr * i+hb * j) ? z : (hr * i+hb * j);\n }\n }\n for (j = maxy/2; j <= maxy; j++){\n for (i = 0; wr*i+wb*j <= c; i++){\n z = z > (hr * i+hb * j) ? z : (hr * i+hb * j);\n }\n }\n printf(\"%d\", z);\n return 0;\n}\n\n ", "lang": "GNU C", "bug_code_uid": "b406d66d6de4a82129c54a0636cde25f", "src_uid": "eb052ca12ca293479992680581452399", "apr_id": "a08e0501a7255f7df8cf61ea71583406", "difficulty": 2000, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7085106382978723, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \nint main()\n{\n int h1,m1,h2,m2;\n while(scanf(\"%d:%d\",&h1,&m1))\n {\n int h=0,m=0;\n scanf(\"%d:%d\",&h2,&m2);\n if((h1>h2)||(h1==h2&&m1>m2))\n {\n h=h1-h2;\n if(m1>m2)\n m=m1-m2;\n else\n {\n m=60-(m2-m1);\n h=h-1;\n }\n }\n else\n {\n if(m1\n#include\nint main() {\n char str[101];\n scanf(\"%s\",&st);\n char *sa=strstr(st,\"ABC\"),*sb=strstr(st,\"ACB\"),*sc=strstr(st,\"BCA\"),*sd=strstr(st,\"BAC\"),*se=strstr(st,\"CAB\"),*sf=strstr(st,\"CBA\");\n if(sa!=NULL||sb!=NULL||sc!=NULL||sd!=NULL||se!=NULL||sf!=NULL)\n printf(\"Yes\");\n else\n printf(\"No\");\n}", "lang": "GNU C", "bug_code_uid": "f6a69958ccf12fa2f4d7c19300526ebc", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "5bb8b33381dfc49f91249010092edb89", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6593886462882096, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n char s[100];\n int i,j,k=0;\n scanf(\"%s\",s);\n\n for(i=0; s[i]!='\\0'; i++)\n {\n for(j=i; j<3; j++)\n {\n if(s[i]!='.' && s[i+1]!='.' && s[i+2]!='.')\n {\n if(s[i]!=s[i+1] && s[i+1]!=s[i+2] && s[i+2]!=s[i])\n {\n k=1;\n }\n }\n }\n }\n\n if(k==1)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n\n return 0;", "lang": "GNU C", "bug_code_uid": "89ee14c031ce444e0fbb70bc81a6ff12", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "0492c9232dcaea9bda153278f07aafe3", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9252948885976409, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n\tint i,j,flag1,flag2,flag3;\n\tchar s[105];\n\tscanf(\"%s\",s);\n\tfor(i=0;i\n\n \n", "lang": "GNU C11", "bug_code_uid": "630deeed1591dd1f3b5b1bea6c830ba1", "src_uid": "6119258322e06fa6146e592c63313df3", "apr_id": "5121f91c5e44fc625df16505ad76bff7", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9284009546539379, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint tab[110];\nint abs(int a){\n\tint b;\n\t(a>0) ? b=a : b=-a;\n\treturn b;\n}\nint main(){\n\tint n,k,presum=0,sum=0,des,max=0;\n\tscanf(\"%d %d\",&n,&k);\n\tfor(int i=0;i\n#define MOD 998244353\n\n__int64 Pow(__int64 a, __int64 b)\n{\n if (b == 0) return 1;\n\tif (b % 2 > 0) return (Pow(a, b - 1) * a) % MOD;\n\t__int64 half = Pow(a, b / 2) % MOD;\n\treturn (half * half) % MOD;\n}\n__int64 nCr(__int64 n, __int64 r)\n{\n __int64 A = 1; // A = n!, B = (n-r)!r!\n __int64 B = 1;\n __int64 ans;\n __int64 i;\n\n for(i=1;i<=n;i++)\n {\n A *= i;\n A %= MOD;\n }\n for(i=1;i<=n-r;i++)\n {\n B *= i;\n B %= MOD;\n }\n for(i=1;i<=r;i++)\n {\n B *= i;\n B %= MOD;\n }\n __int64 B2 = Pow(B, MOD-2);\n ans = (A * B2) % MOD;\n return ans;\n}\n\nint main(void)\n{\n __int64 size, max;\n __int64 ans;\n\n while(scanf(\"%lld %lld\", &size, &max))\n { \n ans = nCr(max, size - 1) * (size-2) % MOD;\n ans = (ans * Pow(2, size-3)) % MOD;\n printf(\"%lld\\n\", ans);\n }\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "fa6eb64ef0903409f895d019658d1090", "src_uid": "28d6fc8973a3e0076a21c2ea490dfdba", "apr_id": "14c146a7a4c39fd596580429bcbe42a0", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.22695924764890282, "equal_cnt": 25, "replace_cnt": 19, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 24, "bug_source_code": "#include \n#define MOD 998244353\n\n__int64 factorial(int n)\n{\n int i;\n int result = 1;\n \n if(n == 0 || n == 1) return 1;\n\n for(i=2;i<=n;i++)\n {\n result *= i;\n }\n return result;\n}\n\n__int64 countArr(int size, int max)\n{\n __int64 result = 0;\n __int64 temp;\n int m, i;\n\n for(m=size-1;m<=max;m++) //middle's min is size-1 \n {\n temp = 0;\n for(i=0;i\n#define MOD 998244353\n\n__int64 factorial(int n)\n{\n __int64 i;\n __int64 result = 1;\n \n if(n == 0 || n == 1) return 1;\n\n for(i=2;i<=n;i++)\n {\n result *= i;\n }\n return result;\n}\n\n__int64 countArr(int size, int max)\n{\n __int64 result = 0;\n __int64 temp;\n __int64 m, i;\n\n for(m=size-1;m<=max;m++) //middle's min is size-1 \n {\n temp = 0;\n for(i=0;i\n#define MOD 998244353\n\n__int64 Pow(__int64 a, __int64 b)\n{\n __int64 ans=1;\n __int64 i;\n if (b == 0) return 1;\n for(i=0;i\nint main()\n{\n\tint x1,x2,y1,y2,c;\n\tc=0;\n\tscanf(\"%d%d\",&x1,&y1);\n\tscanf(\"%d%d\",&x2,&y2);\n\twhile(x1!=x2 || y1!=y2)\n\t{\n\t\tif(x1x2)\n\t\t\tx1--;\n\t\tif(y1y2)\n\t\t\ty1--;\n\n\t\tc+=1;\n\t}\n\tprintf(\"%d\\n\",c);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "fa5eea763478e761935b83177f839492", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "a5bb15ce9379556c51c69e4e33a58f02", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9962073324905183, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main()\n{\n int x,y,z,d;\n char ch;\n scanf(\"%d %d %d\",&x,&y,&z);\n if(z==0&&x==y)\n {\n printf(\"0\");\n exit(1);\n }\n if(x>=y)\n {\n d=x-y;\n ch='+';\n }\n else\n {\n d=y-x;\n ch='-';\n }\n if(d>z)\n {\n printf(\"%c\",ch);\n }\n else\n {\n printf(\"?\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9e4b07f099db320f93397cdb3339de52", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "5373960ca766e63f2bfa88f1e88214de", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22635408245755861, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n#include\nstruct node{\n\tint data;\n\tstruct node* next;\n};\nstruct node** hash;\nint size=10001;\nvoid init_hash()\n{\n\tint i;\n\tfor(i=0;idata=data;\n\thead->next=hash[pos];\n\thash[pos]=head;\n}\nint is_present(int data)\n{\n\tint pos=data%size;\n\tstruct node* cur=hash[pos];\n\twhile(cur)\n\t{\n\t\tif(cur->data==data)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\tcur=cur->next;\n\t}\n\treturn 0;\n}\nint main()\n{\n\tint p,y;\n\tint i,j,k;\n\thash=malloc(size*sizeof(struct node*));\n\tinit_hash();\n\tscanf(\"%d %d\",&p,&y);\n\tint flag=0;\n\tfor(i=2;i<=p;i++)\n\t{\n\t\tif(!is_present(i))\n\t\t{\n\t\t\tint end=y/i;\n\t\t\tfor(j=i;j<=end*i;j+=i)\n\t\t\t{\n\t\t\t\thash_it(j);\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=y;i>p;i--)\n\t{\n\t\tif(!is_present(i))\n\t\t{\n\t\t\tprintf(\"%d\\n\",i);\n\t\t\tflag=1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(!flag)\n\t printf(\"-1\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3bbbcebe7c0d071c6a9a34da0114fd75", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "f0e0f44d36fe7f3c2f80e859cdc5d0ab", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22708840227088403, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n#include\nstruct node{\n\tint data;\n\tstruct node* next;\n};\nstruct node** hash;\nint size=100001;\nvoid init_hash()\n{\n\tint i;\n\tfor(i=0;idata=data;\n\thead->next=hash[pos];\n\thash[pos]=head;\n}\nint is_present(int data)\n{\n\tint pos=data%size;\n\tstruct node* cur=hash[pos];\n\twhile(cur)\n\t{\n\t\tif(cur->data==data)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\tcur=cur->next;\n\t}\n\treturn 0;\n}\nint main()\n{\n\tint p,y;\n\tint i,j,k;\n\thash=malloc(size*sizeof(struct node*));\n\tinit_hash();\n\tscanf(\"%d %d\",&p,&y);\n\tint flag=0;\n\tfor(i=2;i<=p;i++)\n\t{\n\t\tif(!is_present(i))\n\t\t{\n\t\t\tfor(j=i;j<=end;j+=i)\n\t\t\t{\n\t\t\t\tif(j>p)\n\t\t\t\t hash_it(j);\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=y;i>p;i--)\n\t{\n\t\tif(!is_present(i))\n\t\t{\n\t\t\tprintf(\"%d\\n\",i);\n\t\t\tflag=1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(!flag)\n\t printf(\"-1\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ff9161345acddff74adbc81f9952b6f0", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "f0e0f44d36fe7f3c2f80e859cdc5d0ab", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3430290872617854, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n#include \n#include \n\nint main()\n{\n long long int p,y,i,ans=0;\n scanf(\"%I64d %I64d\",&p,&y);\n if(y%2 ==0){\n ans = y-1;\n }\n else{\n ans=y;\n }\n if(p==2&&y>2){\n printf(\"%I64d\",ans);\n return 0;\n }\n else if(p==2&&y==2){\n printf(\"-1\");\n return 0;\n }\n for(i=3;i<=p;i+=2){\n if(ceil(ans*1.0/i)==(ans/i)){\n ans-=2;\n }\n if(ans<=p){\n printf(\"-1\");\n return 0;\n }\n }\n printf(\"%I64d\",ans);\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "d38535bf98d5ac20e79329e17acf80a6", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "608f3102be0892ffb1404b36bd08d342", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.39600470035252644, "equal_cnt": 18, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \n#include \n\ntypedef struct\t\ts_btree\n{\n\tstruct s_btree\t*left;\n\tstruct s_btree\t*right;\n\tint\t\t\t\tvalue;\n\tint\t\t\t\tlvl;\n}\t\t\t\t\tt_btree;\n\nt_btree\tcoada[20000000];\n\nt_btree\t*ft_create_node(int data)\n{\n\tt_btree\t*new;\n\n\tnew = (t_btree*)malloc(sizeof(t_btree));\n\tnew->left = NULL;\n\tnew->right = NULL;\n\tnew->value = data;\n\treturn (new);\n}\n\nint\t\tst, dr;\nint\t\tok, result;\n\nvoid\tbfs(t_btree *node, int m)\n{\n\tt_btree\t*new;\n\n\tif (node->value == m)\n\t{\n\t\tresult = node->lvl;\n\t\tok = 0;\n\t}\n\telse\n\t{\n\t\tnew = ft_create_node(node->value - 1);\n\t\tnew->lvl = node->lvl + 1;\n\t\tdr++;\n\t\tcoada[dr] = *new;\n\t\tnew = ft_create_node(node->value * 2);\n\t\tnew->lvl = node->lvl + 1;\n\t\tdr++;\n\t\tcoada[dr] = *new;\n\t}\n}\n\nint\t\tmain(void)\n{\n\tint\t\tn, m;\n\tt_btree\t*root;\n\n\tok = 1;\n\tscanf(\"%d %d\", &n, &m);\n\troot = ft_create_node(n);\n\troot->lvl = 0;\n\tst = dr = 1;\n\tcoada[st] = *root;\n\twhile (ok && st <= dr)\n\t{\n\t\tbfs(&coada[st], m);\n\t\tst++;\n\t}\n\tprintf(\"%d\\n\", result);\n\treturn (0);\n}\n", "lang": "GNU C", "bug_code_uid": "e1b6dc353e0a13d88e0063ddcbd7df98", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "1867ced8f728e432c55145070f6adf47", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9316353887399463, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main(void)\n{\n int h, m, k, h1, m1, A1, A2;\n char a1, a2, c, b1, b2;\n scanf(\"%c%c%c%c%c\", &a1, &a2, &c, &b1, &b2);\n h = (a1 - '0') * 10 + a2 - '0';\n m = (b1 - '0') * 10 + b2 - '0';\n k = (a2 - '0') * 10 + a1 - '0';\n if (k > m && k < 60)\n printf(\"%d%d:%d%d\", h/10, h%10, k/10, k%10);\n else\n {\n k = 60;\n while (k >= 60)\n {\n A1 = a1 - '0';\n A2 = a2 - '0';\n A1 += (++A2 / 10);\n A2 %= 10;\n h1 = (A1 * 10 + A2) % 24;\n A2 = h1 % 10;\n A1 = h1 / 10;\n k = A2 * 10 + A1;\n }\n m1 = k;\n printf(\"%d%d:%d%d\", h1/10, h1%10, m1/10, m1%10);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "d25b63ab0cce4e8eb2fa5ffc134b5933", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "537e4f516ce20a012bc4caecf0a3ab68", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8872549019607843, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#define DIGIT_COUNT_OF_TENS 2\n#define DIGIT_COUNT_OF_HUNDREDS 3\n#define TEN 10\n#define HUNDRED 100\n#define BOUNDARY_OF_TENS 10\n#define BOUNDARY_OF_HUNDREDS (9 * 10 * 2 + 10)\n\n#include\n#include\n\nvoid main(int argc, char** argv){\n int position = atoi(argv[1]);\n int number = 0;\n int digit = 0;\n int digit_position = 0;\n int boundary_of_tens = BOUNDARY_OF_TENS;\n int boundary_of_hundreds = BOUNDARY_OF_HUNDREDS;\n\n if(position < boundary_of_tens){\n digit = position;\n }\n else if(position >= BOUNDARY_OF_TENS && position < BOUNDARY_OF_HUNDREDS){\n number = ((position - BOUNDARY_OF_TENS) / DIGIT_COUNT_OF_TENS) + TEN;\n digit_position = (position - BOUNDARY_OF_TENS) % DIGIT_COUNT_OF_TENS;\n if(digit_position == 0) digit = number / TEN;\n else if(digit_position == 1) digit = number % TEN;\n }\n else if(position >= BOUNDARY_OF_HUNDREDS){\n number = ((position - BOUNDARY_OF_HUNDREDS) / DIGIT_COUNT_OF_HUNDREDS) + HUNDRED;\n digit_position = (position - BOUNDARY_OF_HUNDREDS) % DIGIT_COUNT_OF_HUNDREDS;\n if(digit_position == 0) digit = number / HUNDRED;\n else if(digit_position == 1){\n digit = (number % HUNDRED) / TEN;\n }\n else if(digit_position == 2){\n digit = (number % HUNDRED) % TEN;\n }\n }\n\n printf(\"%d\", digit);\n}", "lang": "GNU C11", "bug_code_uid": "bb3a5e0c130fd1ab56955c197f04e745", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "b566dd29594b0a7631dede94d8bbec4b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9965317919075144, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nmain()\n{\n int n,i,t,j;\n char a[51];\n scanf(\"%s\",&a);\n n=strlen(a);\n\tif(n==1)\n\tprintf(\"%c\",a[0]);\n\telse\n\t{\n t=n-2;\n if(n%2==0)\n i=n/2-1;\n else\n i=n/2+1;\n j=i+1;\n printf(\"%c%c\",a[i],a[j]);\n while(t>0)\n {\n if(i-1>0)\n {\n\t\tprintf(\"%c\",a[i-1]);\n\t\tt--;\n\t\ti--;\n }\n if(j+1\nint main()\n{\n int n,m,t;\n int i,j,k;\n double flag1=1,flag2=1,flag3=1,flag4=1;\n double number=0;\n scanf(\"%d%d%d\",&n,&m,&t);\n for(i=4; i<=n; i++)\n {\n for(j=1; j<=t-i; j++)\n {\n if(i+j==t)\n {\n for(k=1; k<=i; k++)\n {\n flag1*=k;\n }\n for(k=n; k>=n-i+1; k--)\n {\n flag2*=k;\n }\n for(k=1; k<=j; k++)\n {\n flag3*=k;\n }\n for(k=m; k>=m-j+1; k--)\n {\n flag4*=k;\n }\n number=number+flag2/flag1*flag4/flag3;\n }\n }\n }\n printf(\"%.0lf\\n\",number);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "72c31401c1b8123acd5227c60de55e9f", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "f16f47d23063e6f480ed4cc8f92bea6f", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6500461680517082, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint f(int x,int i, int j, int k)\n{\n\treturn (x[k] == x[i] || x[k] == x[j]);\n}\n\nint main()\n{\n\tint x[3],y[3];\n\tint i;\n\tfor(i=0;i<3;i++)\n\t{\n\t\tscanf(\"%d %d\",&x[i],&y[i]);\n\t}\n\n\tint ans = 0,int flag=0;\n\tif((x[0] == x[1] && x[1] == x[2]) && (y[0] == y[1] && y[1] == y[2]))\n\t\tans = 1;\n\telse\n\t{\n\t\tif(f(0,1,2) || f(0,2,1) || f(1,2,0))\n\t\t\tans = 2;\n\t\telse\n\t\t\tans = 3;\n\t}\n\n\tprintf(\"%d\",ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "02dd68007234c676035557e6c882f3fb", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "96bc7ba07fca404a7a4ff5c93b50be4e", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7131024096385542, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "#define _USE_MATH_DEFINES\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nint n,m,i,j,k,min,ans[25],f[25],s,l,sss,ss;\nstruct u\n{\n\tint a,b;\n}a[25],b[25];\n\n\nint main()\n{\n\tscanf(\"%d %d\",&n,&m);\n\tfor (i=1;i<=n;i++) scanf(\"%d %d\",&a[i].a,&a[i].b);\n\tfor (i=1;i<=m;i++) scanf(\"%d %d\",&b[i].a,&b[i].b);\n\tfor (i=1;i<=n;i++) \n\t{\n\t\tmemset(f,0,sizeof(f));\n\t\tfor (j=1,ss=0;j<=9;j++)\n\t\tif (ans[j]) ss++;\n\t\tfor (j=1;j<=m;j++)\n\t\t{\n\t\t\tmemset(f,0,sizeof(f));\n\t\t\tf[a[i].a]++;\n\t\t\tf[a[i].b]++;\n\t\t\tf[b[j].a]++;\n\t\t\tf[b[j].b]++;\n\t\t\tfor (l=1,s=0;l<=9;l++)\n\t\t\tif (f[l]) \n\t\t\t{\n\t\t\t\ts++;\n\t\t\t\tif (f[l]==2) k=l;\n\t\t\t}\n\t\t\tif (s==3) ans[k]++;\n\t\t}\n\t\tmemset(f,0,sizeof(f));\n\t\tfor (j=1,sss=0;j<=9;j++)\n\t\tif (ans[j]) sss++;\n\t\tif (sss>ss+1) \n\t\t{\n\t\t\tputs(\"-1\");\n\t\t\texit(0);\n\t\t}\n\t}\n\tmemset(f,0,sizeof(f));\n\tfor (i=1,s=0;i<=9;i++) \n\tif (ans[i]) \n\t{\n\t\ts++;\n\t\tk=i;\n\t}\n\tif (s==0) puts(\"-1\");\n\telse if (s==1) printf(\"%d\\n\",k);\n\telse puts(\"0\");\n\treturn 0;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "12205eb296bf62bc7cf9b96fd5c7f634", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "cbe0bea30bfe94fc6764cedb3fe2ccec", "difficulty": 1900, "tags": ["bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.387030010348396, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 20, "bug_source_code": "#define _USE_MATH_DEFINES\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nint n,m,i,j,k,min,ans[25][25],f[25],d[25],s;\nstruct u\n{\n\tint a,b;\n}a[5][25];\n\nvoid dfs(int x,int y,int z)\n{\n\tint i;\n\t\n\tif (x<=0) return;\n\tfor (i=1;i<=y;i++) \n\tif (!f[i])\n\t{\n\t\tf[i]=1;\n\t\tmemset(d,0,sizeof(d));\n\t\td[a[z^1][x].a]++;\n\t\td[a[z^1][x].b]++;\n\t\td[a[z][i].a]++;\n\t\td[a[z][i].b]++;\n\t\tfor (j=1,s=0;j<=9;j++) \n\t\tif (d[j]) \n\t\t{\n\t\t\ts++;\n\t\t\tif (d[j]==2) k=j;\n\t\t}\n\t\tif (s==3) \n\t\t{\n\t\t\tans[x][k]++;\n\t\t}\n\t\tdfs(x-1,y,z);\n\t\tf[i]=0;\n\t}\n}\n\nint main()\n{\n\tscanf(\"%d %d\",&n,&m);\n\tfor (i=1;i<=n;i++) scanf(\"%d %d\",&a[0][i].a,&a[0][i].b);\n\tfor (i=1;i<=m;i++) scanf(\"%d %d\",&a[1][i].a,&a[1][i].b);\n\tmin=n1) \n\t\t{\n\t\t\ts=1;\n\t\t\tbreak;\n\t\t}\n\t\tif (s) puts(\"-1\"); else puts(\"0\");\n\t}\n\treturn 0;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "6d7ed4b4eee3df0c23c7b42a1b932441", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "cbe0bea30bfe94fc6764cedb3fe2ccec", "difficulty": 1900, "tags": ["bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.735202492211838, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "#include \nint main(int argc, char *argv[]) {\nint n;\nint k;\nint rest;\nint res;\nscanf(\"%d %d\", &n, &k);\n\nrest = n % k;\nres = n - rest + k;\n\n\nprintf(\"%d\", &res );\n\nreturn res;\n}", "lang": "GNU C11", "bug_code_uid": "f0e10e4d4ddc37ec770678d412fc33df", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "c1fe513b7b7bb1b91f32a2731e2ee1f4", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9898305084745763, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n#include\n\nint main()\n{\nint x1,y1,x2,y2;\nscanf(\"%d%d%d%d\",&x1,&y1,&x2,&y2);\nif(x1==x2)\n{\n\n\tprintf(\"%d\",2*(abs(y2-y1)+1));\n}\nelse if(y1==y2)\n{\n\tprintf(\"%d\",2*(abs(x2-x1)+1));\n}\nelse \n{\n\tprintf(\"%d\",2*((abs(x2-x1)+1)+(abs(y2-y1)+1)));\n}\n\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "5bd3a3530dfd8875edb9c2a3be70d788", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "ea5a53a2d6a1517f0805b3fd43f90fb7", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8844221105527639, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n\nint main(){\n char *eevee[8] = {\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"};\n int i,j,n,cont,pos,mayor = 0;\n char nom[10];\n scanf(\"%d %s\",&n,nom);\n for(i = 0 ; i<8 ; i++){\n cont = 0;\n if(strlen(nom) == strlen(eevee[i]))\n for(j = 0 ; j< strlen(eevee[i]) ; j++){\n if(nom[j] == eevee[i][j]){\n cont++;\n }\n }\n if(cont>mayor){\n mayor = cont;\n pos = i;\n }\n }\n printf(\"%s\",eevee[pos]);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "9e7a18b6f11f24585d0e7438d295e2c2", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "648175712ed64cc6937de9504d9480fe", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.99609375, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n int n,k,i=0,j,count=0,x;\n scanf(\"%d %d\",&n,&k);\n int *a = (int *)malloc(sizeof(int)*n);\n for(i=0;i\n\n\nint main()\n{\n\n int n,s=0;\n scanf(\"%d\",&n);\n int i;\n int c=n;\n while(n--)\n {\n scanf(\"%d\",&i);\n s+=i;\n }\n int res=0;\n for(i=1;i<=5;i++)\n {\n if((s+i)%(c+1) != 0)\n {\n res++;\n }\n }\n printf(\"%d\",res);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b8f60126e294a3ba32198db4b8574027", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "bfcb7f998c9c52abfc868d8cb5d2781e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5157962604771116, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": " /*if (!strcmp(day1,d1))\n {\n if ( (strcmp(day2,d1)==0)||(strcmp(day2,d2)==0)||(strcmp(day2,d4)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (!strcmp(day1,d2))\n {\n if ( (strcmp(day2,d2)==0)||(strcmp(day2,d3))==0||(strcmp(day2,d5)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (!strcmp(day1,d3))\n {\n if ( (strcmp(day2,d3)==0)||(strcmp(day2,d4)==0)||(strcmp(day2,d6)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (!strcmp(day1,d4))\n {\n if ( (strcmp(day2,d4)==0)||(strcmp(day2,d5))==0||(strcmp(day2,d7)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (!strcmp(day1,d5))\n {\n if ( (strcmp(day2,d5)==0)||(strcmp(day2,d6)==0)||(strcmp(day2,d1)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (!strcmp(day1,d6))\n {\n if ( (strcmp(day2,d6)==0)||(strcmp(day2,d7)==0)||(strcmp(day2,d2)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }\n else if (!strcmp(day1,7))\n {\n printf(\"mpika\");\n if ( (strcmp(day2,d7)==0)||(strcmp(day2,d1)==0)||(strcmp(day2,d3)==0))\n printf(\"YES\");\n else\n printf(\"NO\");\n }*/", "lang": "GNU C11", "bug_code_uid": "9b3e5dcbc02b0813bfd27e9910b6dbcc", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "446aba1faca1a9324b40099c785f26e1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7512794268167861, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int a[4],i,j,b;\n for(i=0;i<4;i++){\n scanf(\"%d\",&a[i]);\n }\n for(i=0;i<3;i++){\n for(j=i+1;j<10;j++)\n if(a[i]a[3]||a[1]+a[0]>a[2]||a[2]+a[1]>a[3]){\n if(a[0]+a[1]==a[3]||a[1]+a[0]==a[2]||a[2]+a[1]==a[3]){\n printf(\"SEGMENT\");}\n else{\n printf(\"TRIANGLE\");}\n }\n\n else{\n printf(\"IMPOSSIBLE\");\n }\n}\n\n", "lang": "GNU C11", "bug_code_uid": "0f79ff3c645f5f06b8f9d5cef9acf21c", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "1af0e82a9debd9b857f71247ddad0a7d", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8076923076923077, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\nint n;\nscanf(\"%d\",&n);\nif(n%2==0)\nprintf(\"%d\",n/2-1);\nelse\nprintf(\"%d\",(n-1)/2);\nreturn 0;", "lang": "GNU C", "bug_code_uid": "84af1964567e84c9b52a4c0bc431f104", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "55bd32922a1d78a883d8c4997b709148", "difficulty": 1000, "tags": ["constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.34704112337011034, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include\n\nint main(void){\n long long int n,k,i=0,j=0,ans;\n scanf(\"%lld %lld\", &n,&k);\n for(i=1,j=0;i<=n;i++){\n if(n%i==0){\n j++;\n if(j==k){ans=i;\n break;}\n if(jj)\n ans=-1;\n printf(\"%lld\", ans);}\n", "lang": "GNU C11", "bug_code_uid": "dc87f7ba5fd2e27a967fc45a5c912984", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "9e035cb63438fd58768569b31647d8c3", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9990439770554493, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\n#define MAX 333\n\nint min(int x, int y) {\n return x < y ? x : y;\n}\n\nint a[MAX];\nint dp[MAX];\nint n;\n\nvoid update() {\n int i, j;\n for (i = 0; i < n; i++) {\n int ma = 0;\n for (j = 0; j <= a[i]; j++) {\n if (dp[j] > ma) ma = dp[j];\n }\n if (ma + 1 > dp[a[i]]) dp[a[i]] = ma + 1;\n }\n}\n \nint main() { \n int t, i;\n scanf(\"%d %d\", &n, &t);\n for (i = 0; i < n; i++) {\n scanf(\"%d\", &a[i]);\n } \n int time1 = min(MAX, t);\n int time3 = min(MAX, t - time1);\n int time2 = t - time1 - time2;\n for (i = 0; i < time1; i++) {\n update();\n }\n int ma = 0;\n if (time2 != 0) {\n for (i = 0; i < MAX; i++) {\n int cnt = 0;\n int j;\n for (j = 0; j < n; j++) if (a[j] == i) cnt++;\n if (dp[i] > ma) ma = dp[i];\n dp[i] = ma + cnt * time2; \n }\n }\n for (i = 0; i < time3; i++) {\n update();\n }\n int res = 0;\n for (i = 0; i < MAX; i++) if (dp[i] > res) res = dp[i];\n printf(\"%d\\n\", res);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e64ca0c83f07daa2b85d5796fbad9f9d", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "08eec6a3c46a53bf99bff3316ce057a2", "difficulty": 1900, "tags": ["dp", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9813036887316827, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#define HELL 1000000007\nchar fast_char_var;\n#define\tfast_unsigned_dtype\tunsigned long\nfast_unsigned_dtype fast_unsigned_var;\nfast_unsigned_dtype fast_unsigned()\n{\n\tfast_char_var=getchar();\n\twhile(fast_char_var<48||fast_char_var>57)\n\t\tfast_char_var=getchar();\n\tfast_unsigned_var=0;\n\twhile(fast_char_var>47&&fast_char_var<58)\n\t{\n\t\tfast_unsigned_var=(fast_unsigned_var<<1)+(fast_unsigned_var<<3)+fast_char_var-48;\n\t\tfast_char_var=getchar();\n\t}\n\treturn fast_unsigned_var;\n}\nint main()\n{\n\tstatic unsigned long long ans2,ans,i,j,a[4010],b[4010],n;\n\tn=fast_unsigned();\n\tn++;\n\ta[0]=1;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tb[0]=a[i-1];\n\t\tfor(j=1;j<=i;j++)\n\t\t\tb[j]=(a[j-1]+b[j-1])%HELL;\n\t\t\n\t\tfor(j=0;j<=i;j++)\n\t\t\ta[j]=b[j];\n\t}\n\tans=b[n]+HELL-b[n-1];\n\tans%=HELL;\n\ta[0]=1;\n\tn--;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tb[0]=a[i-1];\n\t\tfor(j=1;j<=i;j++)\n\t\t\tb[j]=(a[j-1]+b[j-1])%HELL;\n\t\t\n\t\tfor(j=0;j<=i;j++)\n\t\t\ta[j]=b[j];\n\t}\n\tans2=b[n]+HELL-b[n-1];\n\tans2%=HELL;\n\tprintf(\"%llu\\n\",ans-ans2);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "010d571f1ba793f11e8a830a3f8a0e40", "src_uid": "aa2c3e94a44053a0d86f61da06681023", "apr_id": "e9d5411729ce1426ce3e0c3a8c2a247d", "difficulty": 1900, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.20493434142459213, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\n#define HELL 1000000007\nchar fast_char_var;\n#define\tfast_unsigned_dtype\tunsigned long\nfast_unsigned_dtype fast_unsigned_var;\nfast_unsigned_dtype fast_unsigned()\n{\n\tfast_char_var=getchar();\n\twhile(fast_char_var<48||fast_char_var>57)\n\t\tfast_char_var=getchar();\n\tfast_unsigned_var=0;\n\twhile(fast_char_var>47&&fast_char_var<58)\n\t{\n\t\tfast_unsigned_var=(fast_unsigned_var<<1)+(fast_unsigned_var<<3)+fast_char_var-48;\n\t\tfast_char_var=getchar();\n\t}\n\treturn fast_unsigned_var;\n}\n#define\tmerge_sort_dtype\tunsigned long\n#define\tmerge_sort_maxsize\t200005\n\nunsigned long merge_sort_i,merge_sort_j,merge_sort_k,merge_sort_halfsize;\nmerge_sort_dtype merge_sort_array[merge_sort_maxsize],merge_sort_array2[merge_sort_maxsize],supporting_array1[merge_sort_maxsize],supporting_array2[merge_sort_maxsize];\n\nvoid merge_sort_recursive(merge_sort_dtype *array, merge_sort_dtype *sarray, merge_sort_dtype *array2, merge_sort_dtype *sarray2,unsigned long size)\n{\n\tif(size==1)\n\t\treturn;\n\tmerge_sort_recursive(array,sarray,array2,sarray2,size>>1);\n\tmerge_sort_recursive(array+(size>>1),sarray+(size>>1),array2+(size>>1),sarray2+(size>>1),size-(size>>1));\n\tmerge_sort_halfsize=(size>>1);\n\tfor(merge_sort_i=0,merge_sort_j=merge_sort_halfsize,merge_sort_k=0;merge_sort_iarray[merge_sort_i])\n\t\t{\n\t\t\tmerge_sort_array[merge_sort_k++]=array[merge_sort_i++];\n\t\t\tsupporting_array1[merge_sort_k++]=sarray[merge_sort_i++];\n\t\t\tmerge_sort_array2[merge_sort_k++]=array2[merge_sort_i++];\n\t\t\tsupporting_array2[merge_sort_k++]=sarray2[merge_sort_i++];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(array2[merge_sort_j]='z')\n\t\tfast_char_var=getchar();\n\twhile(fast_char_var>='a'&&fast_char_var<='z')\n\t{\n\t\tstr[i++]=fast_char_var();\n\t\tfast_char_var=getchar();\n\t}\n\tstr[i]=0;\n\tlength=i;\n\tfor(i=0;i\n#include \n\nint main (void) {\n int A[2], B[2], C[2], dx[2], dy[2];\n long long cp;\n scanf (\"%d %d %d %d %d %d\", A, A+1, B, B+1, C, C+1);\n dx[0] = B[0] - A[0]; dx[1] = C[0] - B[0];\n dy[0] = B[1] - A[1]; dy[1] = C[1] - B[1];\n cp = (long long) dy[1]*dx[0] - (long long) dy[0]*dx[1];\n printf (\"%s\\n\", cp < 0 ? \"RIGHT\" : cp == 0 ? \"TOWARDS\" : \"LEFT\");\n exit (EXIT_SUCCESS);\n}\n", "lang": "GNU C", "bug_code_uid": "b51b1d23833c2c80c20ba99de0f1334a", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "bdba44f71c049f38bbbec7cd86ad8996", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.20174346201743462, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int n,k,i=0,c=0;\n scanf(\"%d\\n%d\",&n,&k);\n \n int a[n];\n\n for(i=0;i\n#define max(a,b) (((a)>(b))?(a):(b))\n\nint a1,a2,a3,b1,b2,b3;\n\n\nint main()\n\n{\n\tscanf(\"%d %d\",&a1, &b1);\n\t\n\tscanf(\"%d %d\",&a2, &b2);\n\t\n\tscanf(\"%d %d\",&a3, &b3);\n\t\n\tif((a2+a3<=a1 && max(b2,b3)<=b1 )|| (a2+b3<=a1 && max(b2,a3)<=b1 ) || (b2+a3<=a1 && max(a2,b3)<=b1 )|| (b2+b3<=a1 && max(a2,a3)<=b1 )|| (b2+a3<=b1 && max(a2,b3)<=a1 )|| (a2+b3<=b1 && max(b2,a3)<=a1 ) || (a2+a3<=b1 && max(b2,b3)<=a1 ) || (b2+b3<=b1 && max(a2,a3)<=a1 ) ) \n\tprintf(\"YES\");\n\t\n\telse printf(\"NO\");\n\t\n\treturm 0;\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "cae8663a25be5fcfc43107b0f0cdf527", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "c06765f4ac24c79e7f0229e64136e722", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9980353634577603, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#define max(a,b) (((a)>(b))?(a):(b))\n\nint a1,a2,a3,b1,b2,b3;\n\n\nint main()\n\n{\n\tscanf(\"%d %d\",&a1, &b1);\n\t\n\tscanf(\"%d %d\",&a2, &b2);\n\t\n\tscanf(\"%d %d\",&a3, &b3);\n\t\n\tif((a2+a3<=a1 && max(b2,b3)<=b1 )|| (a2+b3<=a1 && max(b2,a3)<=b1 ) || (b2+a3<=a1 && max(a2,b3)<=b1 )|| (b2+b3<=a1 && max(a2,a3)<=b1 )|| (b2+a3<=b1 && max(a2,b3)<=a1 )|| (a2+b3<=b1 && max(b2,a3)<=a1 ) || (a2+a3<=b1 && max(b2,b3)<=a1 ) || (b2+b3<=b1 && max(a2,a3)<=a1 ) ) \n\tprintf(\"YES\");\n\t\n\telse printf(\"NO\");\n\t\n\treturn;\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "80742d1130cfbf76f308aabefc37f940", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "c06765f4ac24c79e7f0229e64136e722", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9757914338919925, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//#include \n//#include \n//#include \n//\n//int main()\n//{\n//\tint n;\n//\t\n//\twhile(scanf(\"%d\",&n)!=EOF)\n//\t{\n//\t\tint list[100005],check[100005];\n//\t\tmemset(list,0,sizeof(list));\n//\t\tmemset(check,0,sizeof(check));\n//\t\tfor(int i=0;i=1||list[i]>n)\n//\t\t\t{\n//\t\t\t\tint j;\n//\t\t\t\tfor(j=1;j<=n;j++)\n//\t\t\t\t{\n//\t\t\t\t\tif(check[j]==0)\n//\t\t\t\t\t{\n//\t\t\t\t\t\t//check[j]++;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tlist[i]=j;\n//\t\t\t}\n//\t\t\tcheck[list[i]]++;\n//\t\t}\n//\t\n//\t\tint x;\n//\t\tfor( x=0;xb?a:b;\n////}\n////\n////int main()\n////{\n////\tint a1,a2,a3,b1,b2,b3;\n////\t\n////\twhile(scanf(\"%d%d%d%d%d%d\",&a1,&a2,&a3,&b1,&b2,&b3)!=EOF)\n////\t{\n////\t\tint flag=0;\n////\t\tif(min(a1,b1)b1)\n////\t\t{\n////\t\t\ta1=a1-max(a2,b2);\n////\t\t}\n////\t\telse\n////\t\t{\n////\t\t\tb1=b1-max(a2,b2);\n////\t\t}\n////\n////\t\tif(min(a1,b1) \n#include \n#include \n#include \nusing namespace std; \n \nint main() \n{ \n int a,b,n,m,c,d,flag=0; \n scanf(\"%d%d%d%d%d%d\",&n,&m,&a,&b,&c,&d); \n if((n>=a+c&&m>=b&&m>=d)||(n>=a+d&&m>=b&&m>=c)||(n>=b+c&&m>=a&&m>=d)||(n>=b+d&&m>=a&&m>=c)) \n { \n flag=1; \n } \n if((m>=a+c&&n>=b&&n>=d)||(m>=a+d&&n>=b&&n>=c)||(m>=b+c&&n>=a&&n>=d)||(m>=b+d&&n>=a&&n>=c)) \n { \n flag=1; \n } \n if(flag) \n { \n printf(\"YES\\n\"); \n } \n else \n { \n printf(\"NO\\n\"); \n } \n return 0; \n} ", "lang": "GNU C", "bug_code_uid": "e669607ff316cb492a9ba4576d9d2af1", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "a38156782cd69595cafef5849a660805", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9247311827956989, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nint main()\n{\n\tint i,k=0,n;\n\tchar s[n+1];\n\tscanf(\"%d\",&n);\n\tscanf(\"%s\",s);\n\tfor(i=0;i<=n-1;i=i+k)\n\t{\n\t\tprintf(\"%c\",s[i]);\n\t\tk=k+1;\n\t\t\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "4baf1d33f6b24493649d34ee50762f76", "src_uid": "08e8c0c37b223f6aae01d5609facdeaf", "apr_id": "cd0da85873654067b2326d3bd3234a8e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.33865814696485624, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \nint div(long long int k)\n{\n int i,j,f=0,f1=0;long long int d[100];\n for(i=2; i*i<=k; i++)\n {\n j=i*i;\n while(k%j==0)\n {\n k/=i;\n d[f1]=k;\n f1++;\n }\n }\n f=k;\n return f;\n}\n\nint main()\n{\n long long int n,j;\n scanf(\"%lld\",&n);\n if(n==0){printf(\"%lld\",n);return 0;}\n j=div(n);\n printf(\"%lld\",j);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "78bf2b2f017c0fb556631a77bf27f468", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "f3553ee4f22fd55166916fda6fa149f6", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9266862170087976, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\nint a,m,r;\nscanf(\"%d%d\",&a,&m);\nwhile(1)\n{\nr=a%m;\nif(r==0)\nbreak;\na=a+r;\n}\nif(a%m==0)\nprintf(\"Yes\");\nelse\nprintf(\"No\");\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "59099f517acace970eedb7e2a8d6d569", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "23631ef6c2569843f39ce5323fb672e9", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.13646368305209097, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \nint sqroot(int m)\n{\n\tint i=0, j;\n\tint x1,x2;\n\twhile( (i*i) <= m )\n\t\ti+=0.1;\n\tx1=i;\n\tfor(j=0;j<10;j++)\n\t{\n\t\tx2=m;\n\t\tx2/=x1;\n\t\tx2+=x1;\n\t\tx2/=2;\n\t\tx1=x2;\n\t}\n\treturn x2;\n}\nint main()\n{\n\tint n;\n\tscanf(\" %d\", &n);\n\tint k=sqroot(1+8*n);\n\tif(k*k == n)\n\t\tprintf(\"YES\");\n\telse\n\t\tprintf(\"NO\");\n}", "lang": "GNU C", "bug_code_uid": "32c7f5955dfb78f97c1f984d1151f392", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "a97a83a4b6e3f91e9722da934dca9bb6", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.968299711815562, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nusing namespace std;\n\nint main() {\n int x,y; \n scanf(\"%d%d\",&x,&y);\n char a[x+1],b[y+1],c[5];\n scanf(\"%s%s\",a,b);\n c[0]=a[0];c[1]=a[x-1];\n c[2]=b[0];c[3]=b[y-1];\n c[4]='\\0';\n if(!strcmp(c,\"<>v^\") || !strcmp(c,\"><^v\"))\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n return 0; \n}", "lang": "GNU C", "bug_code_uid": "03570974044cce2335aa6d756dbc6b37", "src_uid": "eab5c84c9658eb32f5614cd2497541cf", "apr_id": "46265c80084f6f1da690f51cac78662c", "difficulty": 1400, "tags": ["graphs", "brute force", "dfs and similar", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.2824207492795389, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "#include\nint main()\n{\n int n,a,i=0,j,l,s=0,k;\n scanf(\"%d%d\",&n,&a);\n \n j=a;\n k=(n*(n+1))/2;\n s=k-i;\n for(i=1,l=n-1;s!=j;i++,l--)\n {\n k=(l*(l+1))/2;\n s=k-i;\n \n \n }\n \n printf(\"%d\",i-1);\n}", "lang": "GNU C11", "bug_code_uid": "4036a2d3213854e01d747afefafe7feb", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "f9479be0a1a08decceefe3f2d1144abb", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3799392097264438, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "#include \n int main()\n {\n int n,m,i=0,sum=0,g=0,t;\n scanf(\"%d\",&n);int a[n];\n for (i=0;i\n#include \n\nint isSolved(int r[])\n{\n int i;\n /*\n for(i=1;i<=24;i++)\n printf(\"%d \", r[i]);\n printf(\"\\n\\n\");\n*/\n for(i=1;i<=24;i=i+4)\n if(!(r[i+1] == r[i] && r[i+2] == r[i] && r[i+3] == r[i]))\n return 0;\n\n return 1;\n}\n\nvoid rotate1(int r[])\n{\n int aux1, aux2;\n aux1 = r[24];\n aux2 = r[22];\n r[24] = r[1];\n r[22] = r[3];\n r[1] = r[5];\n r[3] = r[7];\n r[5] = r[9];\n r[7] = r[11];\n r[9] = aux1;\n r[11] = aux2;\n\n}\n\n\n\nvoid rotate2(int r[])\n{\n int aux1, aux2;\n aux1 = r[23];\n aux2 = r[21];\n r[23] = r[2];\n r[21] = r[4];\n r[2] = r[6];\n r[4] = r[8];\n r[6] = r[9];\n r[8] = r[12];\n r[10] = aux1;\n r[12] = aux2;\n}\n\nvoid rotate3(int r[])\n{\n int aux1, aux2;\n aux1 = r[13];\n aux2 = r[14];\n r[13] = r[5];\n r[14] = r[6];\n r[5] = r[17];\n r[6] = r[18];\n r[17] = r[21];\n r[18] = r[22];\n r[21] = aux1;\n r[22] = aux2;\n}\n\nvoid rotate4(int r[])\n{\n int aux1, aux2;\n aux1 = r[15];\n aux2 = r[16];\n r[15] = r[7];\n r[16] = r[8];\n r[7] = r[19];\n r[8] = r[20];\n r[19] = r[23];\n r[20] = r[24];\n r[23] = aux1;\n r[24] = aux2;\n}\n\nint main()\n{\n int i, r[25];\n\n for(i=1;i<=24;i++)\n scanf(\"%d\", &r[i]);\n\n for(i=1;i<=4; i++)\n {\n rotate1(r);\n if((i == 1 || i == 3) && isSolved(r))\n {\n printf(\"yes\");\n return 0;\n }\n }\n\n for(i=1;i<=4; i++)\n {\n rotate2(r);\n if((i == 1 || i == 3) && isSolved(r))\n {\n printf(\"yes\");\n return 0;\n }\n }\n\n for(i=1;i<=4; i++)\n {\n rotate3(r);\n if((i == 1 || i == 3) && isSolved(r))\n {\n printf(\"yes\");\n return 0;\n }\n }\n\n for(i=1;i<=4; i++)\n {\n rotate4(r);\n if((i == 1 || i == 3) && isSolved(r))\n {\n printf(\"yes\");\n return 0;\n }\n }\n\n printf(\"no\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f125190000a3b304342a9ed0c4bef543", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "55b225ba6baaf886511b6661c77521eb", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9947674418604651, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint a1[] = { 1, 2, 1, 2, 3, 1, 3, 1, 4, 3, 4, 3, 5, 5, 5, 5, 6, 6, 6, 6, 4, 2, 4, 2 };\n\nint a2[] = { 2, 1, 2, 1, 1, 3, 1, 3, 3, 4, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 2, 4, 2, 4 };\n\nint a3[] = { 1, 2, 1, 2, 3, 4, 3, 4, 2, 1, 2, 1, 5, 5, 5, 5, 6, 6, 6, 6, 1, 2, 1, 2 };\n\n#define N\t24\n\nint check_(int *aa, int *bb) {\n\tstatic int match[7], used[7];\n\tint i;\n\n\tfor (i = 1; i <= 6; i++)\n\t\tmatch[i] = -1;\n\tmemset(used, 0, sizeof used);\n\tfor (i = 0; i < N; i++) {\n\t\tif ((match[aa[i]] == -1 && used[bb[i]]) || (match[aa[i]] != -1 && match[aa[i]] != bb[i]))\n\t\t\treturn 0;\n\t\tused[bb[i]] = 1;\n\t\tmatch[aa[i]] = bb[i];\n\t}\n\treturn 1;\n}\n\nint check(int *aa) {\n\treturn check_(aa, a1) || check_(aa, a2) || check_(aa, a3) || check_(aa, a4);\n}\n\nint main() {\n\tstatic int aa[N], bb[N], cc[N];\n\tint i;\n\n\tfor (i = 0; i < N; i++)\n\t\tscanf(\"%d\", &aa[i]);\n\tbb[0] = aa[1], bb[1] = aa[3], bb[2] = aa[0], bb[3] = aa[2];\n\tbb[4] = aa[12], bb[5] = aa[13], bb[6] = aa[14], bb[7] = aa[15];\n\tbb[8] = aa[10], bb[9] = aa[8], bb[10] = aa[11], bb[11] = aa[9];\n\tbb[12] = aa[20], bb[13] = aa[21], bb[14] = aa[22], bb[15] = aa[23];\n\tbb[16] = aa[4], bb[17] = aa[5], bb[18] = aa[6], bb[19] = aa[7];\n\tbb[20] = aa[16], bb[21] = aa[17], bb[22] = aa[18], bb[23] = aa[19];\n\tcc[0] = aa[14], cc[1] = aa[12], cc[2] = aa[15], cc[3] = aa[13];\n\tcc[4] = aa[6], cc[5] = aa[4], cc[6] = aa[7], cc[7] = aa[5];\n\tcc[8] = aa[18], cc[9] = aa[16], cc[10] = aa[19], cc[11] = aa[17];\n\tcc[12] = aa[10], cc[13] = aa[8], cc[14] = aa[11], cc[15] = aa[9];\n\tcc[16] = aa[2], cc[17] = aa[0], cc[18] = aa[3], cc[19] = aa[1];\n\tcc[20] = aa[21], cc[21] = aa[23], cc[22] = aa[20], cc[23] = aa[22];\n\tprintf(!check(aa) && !check(bb) && !check(cc) ? \"NO\\n\" : \"YES\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1ec00fb68977335597a2e7c947f54554", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "930e26831ab0057bad10604d5d3fb4fd", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9866666666666667, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main()\n{\n //printf(\"dwse 5 akeraious\\n\");\n unsigned short h,m,s,a,b,yes1=1,yes2=1,i1,i2;\n scanf(\"%hu %hu %hu %hu %hu\",&h,&m,&s,&a,&b);\n if (h==12)\n h=0;\n h=h*5+1;\n if (m%5==0)\n m+=1;\n if (s%5==0)\n s+=1;\n if (a==12)\n a=0;\n if (b==12)\n b=0;\n a*=5;\n b*=5;\n i1=a;\n i2=a;\n\n while(i1!=b)\n {\n if(i1==h || i1==m || i1==s)\n yes1=0;\n ++i1;\n if(i1==60)\n i1=0;\n }\n\n while(i2!=b)\n {\n if(i2==h || i2==m || i2==s)\n yes2=0;\n --i2;\n if(i2==0)\n i2=60;\n }\n\n if(yes1==1 || yes2==1)\n printf(\"YES\");\n else\n printf(\"NO\");\n\n\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ad0c7ef2976cf33892ee4ba5aba71c66", "src_uid": "912c8f557a976bdedda728ba9f916c95", "apr_id": "9049b1948e87162ec9c373197ed18828", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.08190091001011122, "equal_cnt": 24, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 23, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#include\n#include\nusing namespace std;\nconst int MAX = 1e5 + 10;\nconst int INF = 1e9 + 7;\ntypedef long long LL;\nbool sf(double x,double y,double z){\n if(z <= x || z >= y)\n return true;\n return false;\n}\nint main()\n{\n double h,m,s,h1,h2;\n scanf(\"%lf %lf %lf %lf %lf\",&h,&m,&s,&h1,&h2);\n m += s / 60,h += m / 60;\n double ma = m / 5,ms = s / 5;\n if(h1 > h2) swap(h1,h2);\n if(sf(h1,h2,h) && sf(h1,h2,ma) && sf(h1,h2,ms)){\n puts(\"YES\");\n return 0;\n }\n if(h1 < h2) h1 += 12;\n double x = h + 12,y = ma + 12,z = ms + 12;\n if(sf(h2,h1,x) && sf(h2,h1,y) && sf(h2,h1,z) && sf(h2,h1,h) && sf(h2,h1,ma) && sf(h2,h1,ms)){\n puts(\"YES\");\n return 0;\n }\n puts(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "4b528d258a8b2f4faa46a2747b823c90", "src_uid": "912c8f557a976bdedda728ba9f916c95", "apr_id": "2b9881a4fb354625a5219662d4d387fa", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.26887661141804786, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint main (){\n int a,b,c,d,e,r;\n while (scanf(\"%d%d%d%d%d\", &a,&b,&c,&d,&e) == 5){\n \tr = 0; \n r = a+b+c+d+e;\n if(r%5 == 0){\n printf(\"%d\",r/5);\n }else{\n printf(-1);\n }\n\n}\n\nreturn 0;\n}\n// 1459212714932", "lang": "GNU C", "bug_code_uid": "da5583366f160ac945565b4ed99e92a2", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "e61b7c57881394f248ab6f396aeb83ba", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2956926658905704, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n int h, w, h1, w1, h2, w2;\n scanf(\"%d %d\",&w,&h);\n scanf(\"%d %d\",&w1,&h1);\n scanf(\"%d %d\",&w2,&h2);\n while(h!=0)\n {\n w += h;\n h--;\n w += h;\n w -= w1;\n h--;\n w += h;\n w -= w2;\n h--;\n }\n printf(\"%d\\n\",w);\n}", "lang": "GNU C11", "bug_code_uid": "83e1822bfb1f2f7d503943643e40dc6d", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "c8e55ba61f2fcfc753e2a6a92f1d22de", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9390681003584229, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \nint main(){\n char arr;\n scanf(\"%s\",arr);\n printf(\"%d\",(strlen(arr) + 1) * 25 + 1);\n \n}", "lang": "GNU C", "bug_code_uid": "094b4e63308211ad4bf2198105560f17", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "8ef4a6c7dc6fcade22c5b1b27a4b70fa", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9028571428571428, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n char str[20];\n int len;\n\n scanf(\"%s\",str);\n\n return (strlen(str)+1)*25+1;\n}\n", "lang": "GNU C", "bug_code_uid": "8eae0e2063f43005951660379d1b4dc9", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "bc489b29e9b2e15d2ed0b608c4ddc805", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9793621013133208, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n unsigned long long int a,b, i=1,k,k1,sum=0;\n //printf(\"Enter the size of the program in lines\\n\");\n scanf(\"%lld\",&a);\n //printf(\"Enter the productivity reduction coefficient\\n\");\n scanf(\"%lld\",&b);\n k1=b;\n for(i=a/b;i<=a;i++)\n {\n sum=i;\n while(1)\n {\n k=i/k1;\n if(k==0)\n break;\n sum=sum+k;\n k1=k1*b;\n }\n if(sum>=a)\n break;\n sum=0;\n k1=b;\n }\n // printf(\"The minimum value = %lld\",i);\nprintf(\"%lld\",i);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "f3843e4040de4f1fee8514b23fc52803", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "6471ae9e54132266f05b5216fc94417b", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9942857142857143, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n\tint n,n,ans;\n\tscanf(\"%d %d\",&n, &m);\n\tif(n==0)\n\t\tans=0;\n\telse if(m==0)\n\t\tans=1;\n\telse if(m<=n/2)\n\t\tans=m;\n\telse\n\t\tans=n-m;\n\tprintf(\"%d\",ans);\n}", "lang": "GNU C11", "bug_code_uid": "87085642c70b5e5971e83eda0466ae4e", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "e55ef924a9925378b35fd6dfe4146132", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7765237020316027, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main(void) {\n\tint n, m;\n\tscanf(\"%d %d\", &n, &m);\n\tint x = n/2;\n\tif (m > x){\n\t printf(\"%d\\n\", n-m);\n\t return 0;\n\t}\n\telse {\n\t printf(\"%d\\n\", n)\n\t return 0;\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "3704691d817b69691fe89134c03e3e0a", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "03374354170da787dda7726a5968a7a8", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9867060561299852, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n\n\n int n,m,e,h;\n scanf(\"%d%d\",&n,&m);\n e=n-m;\n h=m;\n if (m==0||m==1)\n {\n printf(\"1\");\n\n }\n else if (m==n)\n {\n\n printf(\"0\");\n }\n else if (n!=0&&m>=n/2)\n {\n printf(\"%d\",e);\n }\n else\n {\n printf(\"%d\",h);\n }\n\n\n\n return 0;", "lang": "GNU C11", "bug_code_uid": "c0415cece8a5328e4b3a3542b25bc488", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "07a0d90abb4c9d3f652669ebc00c4977", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.36141304347826086, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "#include\n\n\nint main()\n{\n __int64 n, m;\n while (scanf(\"%I64d%I64d\", &n, &m))\n {\n __int64 min = 0;\n __int64 c = n / m;\n if(n % m == 0)\n {\n min = m * (c - 1) * c / 2;\n }\n else\n {\n int lst = n % m;\n min = lst * (c + 1) * c / 2 + ( m - lst) * (c - 1) * c / 2;\n }\n __int64 max = (n - m + 1) * ( n - m) / 2;\n printf(\"%I64d%I64d\\n\", min, max);\n }\n}\n", "lang": "GNU C", "bug_code_uid": "8264f99e3c7bad85afb4b57c4eb4f0dc", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "8260405e5db89f3941fd3ae8e105e6bc", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8753894080996885, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main()\n{\n double ha,ma;\n int h,m;\n char ch;\n while(1)\n {\n scanf(\"%d%c%d\",&h,&ch,&m);\n if(h>=12 )\n h=h-12;\n ha=(h+m/60.0)*30;\n ma=m*6;\n printf(\"%lg %lg\\n\",ha,ma);\n }\n return 0;\n}\n \t\t\t \t\t\t \t\t \t\t \t\t\t \t", "lang": "GNU C", "bug_code_uid": "5d392cba82f8b7883672cb29eb18c445", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "d5c37ade6d6cb51283ce73d14c95c8f1", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7956823438704703, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n#include \n\n#define MAX 5010\n#define MOD 1000000007\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nchar S[MAX], T[MAX];\nbool visited[MAX][MAX];\nint n, m, dp[MAX][MAX], next[MAX][MAX];\n\nint F(int i, int j){\n if (i >= n || j >= m) return 0;\n if (visited[i][j]) return dp[i][j];\n\n long long res = 0;\n if (next[i][j] != -1){\n res = res + F(i + 1, next[i][j] + 1) + 1;\n res = res + F(i, next[i][j] + 1);\n }\n\n visited[i][j] = true;\n return (dp[i][j] = (res % MOD));\n}\n\nint main(){\n int i, j, k;\n\n while (scanf(\"%s %s\", S, T) != EOF){\n clr(visited);\n n = strlen(S), m = strlen(T);\n memset(next, -1, sizeof(next));\n for (i = 0; i < n; i++){\n for (j = m - 1; j >= 0; j--){\n if (S[i] == T[j]) next[i][j] = j;\n else if ((j + 1) != m) next[i][j] = next[i][j + 1];\n }\n }\n\n long long res = 0;\n for (i = 0; i < n; i++){\n for (j = 0; j < m; j++){\n if (S[i] == T[j]){\n res = res + F(i + 1, j + 1) + 1;\n }\n }\n }\n printf(\"%lld\\n\", res % MOD);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d92456b17e831cb794a31ef6b6fe5020", "src_uid": "4022f8f796d4f2b7e43a8360bf34e35f", "apr_id": "f6144c4740d2ae70331c4216d7f66937", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7772511848341233, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n long long i,n,count=1;\n scanf(\"%lld\",&n);\n if(n>1)\n {for(i=1;i<=n/2;i++)\n {\n if((n/i)>1)\n {\n count++;\n }\n\n }}\n else{count=1;}\n printf(\"%lld\",count);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7346f16ad13be2549b2c3a8ad79afd90", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "f30458300273b3c30cf69fd040ef786a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.09642301710730948, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main()\n{\n int i,j=1,k=1,l=1,a,b,c,t=0;\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n scanf(\"%d\",&c);\n if(a>=b && a>=c)\n {\n for(;a!=2 || a!=1;)\n {\n \n j++;\n a=a-2;\n }\n t=30+j*2;\n }\n if((b>=a && b>=c) || ((a-b)==1 && b>2))\n {\n \n for(b=b;b!=2 || b!=1;b=b-2)\n {\n \n k++;\n \n }\n t=31+k*2;\n }\n if((c>=a && c>=b) ||((a-c)==1 && c>2) || ((b-c)==1 && c>2))\n {\n for(c=c;c!=2 || c!=1;c=c-2)\n {\n l++;\n \n }\n t=32+l*2;\n }\n printf(\"%d\",t);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "5beb5e6a8614d3615fa0594ee5487d17", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "18f5c6024ac973b558d5692eaf2a7841", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.16189811584089323, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "#include\nmain()\n{\n int a,b,c,p,q,r,i=0,j=0,k=0,t;\n scanf(\"%d%d%d\",&a,&b,&c);\n \n \n \n if(a >= b && a >= c)\n {\n for(p=a;p >2;p=p-2)\n j++;\n t=30 + (j*3);\n }\n if((b >= c && b >= a) || ((a-b)==1 && b>2))\n {\n for(p=b;p >2;p=p-2)\n k++;\n t=31 + (k*3);\n }\n if((c >= a && c >= b) || ((a-c)==1 && c>2) || ((b-c)==1 && c>2))\n {\n for(p=c;p >2;p=p-2)\n i++;\n t=32 + (i*3);\n }\n printf(\"%d\",t);\n}\n \n for(b=b;b!=2 || b!=1;b=b-2)\n {\n \n k++;\n \n }\n t=31+k*2;\n }\n if((c>=a && c>=b) ||((a-c)==1 && c>2) || ((b-c)==1 && c>2))\n {\n for(c=c;c!=2 || c!=1;c=c-2)\n {\n l++;\n \n }\n t=32+l*2;\n }\n printf(\"%d\",t);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "bca5ab32cc07e089659f3769421dbdbb", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "18f5c6024ac973b558d5692eaf2a7841", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7520525451559934, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\n\nint main()\n{\n int s[3];\n int i=0,n=0,t=0;\n for(;i<3;i++)\n {scanf(\"%i\",&s[i]);\n n=n+s[i];}\n i=0;\n while(n>0)\n {\n if(s[i]>2)\n {s[i]=s[i]-2;\n n=n-2;}\n else\n {s[i]=s[i]-s[i];\n n=n-s[i];}\n t++;\n i++;\n i=i%3;\n }\n prinf(\"%i\",t+30);\n return 0;\n}\n \n ", "lang": "GNU C", "bug_code_uid": "5e3bf03e514c69dc5e17dcf4bc43ffc4", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "10de223ededc300922bc7081c33880f1", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.942339373970346, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n int s[3],i=0,n=0,t=0;\n for(;i<3;i++)\n {scanf(\"%i\",&s[i]);n=n+s[i];}\n i=0;\n while(n>0)\n { if(s[i]>=2)\n { s[i]=s[i]-2;\n n=n-2;\n }\n else\n {s[i]=s[i]-s[i];\n n=n-s[i];}\n i=i+1;\n i=i%3;\n t++;\n }\n printf(\"%i\",t+30);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c8f7aad4e71e1a7feb9a8abc7b2bbe64", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "10de223ededc300922bc7081c33880f1", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22416107382550335, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n int no,i,ans,ans1=0,ans2=0,n,ans3=0;\n scanf(\"%d\",&no);\n ans=no%2;\n if(ans==0 && no!=2)\n {\n printf(\"2\\n\");\n }\n else if(ans==1)\n {\n for(i=2; i<=no/2; i++)\n {\n ans3=no%i;\n if(ans3==0)\n {\n n=no-2;\n for(i=2; i<=n/2; i++)\n {\n ans1=n%i;\n if(ans1==0)\n {\n ans1=0;\n break;\n }\n }\n ans3=0;\n break;\n }\n\n }\n for(i=2; i*i<=no; i++)\n {\n if(no%i==0)\n {\n ans2=0;\n break;\n }\n }\n if(ans3!=0 || (ans1!=0 && ans3!=0) || no==3)\n {\n printf(\"1\\n\");\n }\n else if(ans3==0 && ans1!=0)\n {\n printf(\"2\\n\");\n }\n else\n {\n printf(\"3\\n\");\n }\n }\n else\n {\n printf(\"1\\n\");\n\n }\n main();\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "bdf6426ede51b6988bbe42cad91a1c85", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "3e14c5dd5015c79a71b7583293771ce3", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9928400954653938, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include\nint main(void) {\n int n,i,j;\n char s[200];\n scanf(\"%d\",&n);\n scanf(\"%s\",s);\n for(i=0;i\nint main()\n{\n int n,m,l,count=0,i,j;\n scanf(\"%d%d\",&n,&m);\n if (n>m){\n\n l=n*n;\n }\n else {\n l=m*m;\n }\n\n for (i=0;i<=l;i++){\n for (j=0;j<=l;j++){\n if ((i*i)+j==n && i+(j*j)==m){\n count++;\n }\n }\n }\n printf(\"%d\",count);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "50483f52caef00bbfc5ca961bbacfdc4", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "fdb90ef029fd51c94144b537173b73bb", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9408805031446541, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n\n\nint main()\n{\n int i,n,k,count=0;\n\n char s[1000];\n\n\n scanf(\"%d\",&n);\n\n\n\n scanf(\"%s\",s);\n if(n<11)\n {\n printf(\"0\\n\");\n }\n\n for(i=0;i<=n;i++)\n {\n if(s[i]=='8')\n count++;\n }\n k=n/11;\n\n if(count/k>1)\n {\n printf(\"%d\\n\",k);\n }\n else\n printf(\"%d\\n\",count);\n\n\n}\n\n\n\n", "lang": "GNU C11", "bug_code_uid": "3297f684e710b16a0df1ad8e7d053f07", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "e9344776c01f325f6c436f556ae09d0d", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9372937293729373, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\nint x,z,i;std::char[100] y;main(){printf(\"%d %s\",x,y);for(i=0;i\n#include \nusing namespace std;*/\n\n#include\n#include\n#include\n#include\n#include\n#define SC1(x) scanf(\"%lld\",&x)\n#define SC2(x,y) scanf(\"%lld%lld\",&x,&y)\n#define SC3(x,y,z) scanf(\"%lld%lld%lld\",&x,&y,&z)\n#define SCS(x) scanf(\"\\n%s\", x)\n#define PF1(x) printf(\"%lld\\n\",x)\n#define PF2(x,y) printf(\"%lld %lld\\n\",x,y)\n#define PF3(x,y,z) printf(\"%lld %lld %lld\\n\",x,y,z)\n#define REP(i,n) for(long long i=0;i<(n);i++)\n#define FOR(i,a,b) for(long long i=(a);i<=(b);i++)\n#define FORD(i,a,b) for(long long i=(a);i>=(b);i--)\n#define WHILE(n) while(n--)\n#define MEM(a, b) memset(a, (b), sizeof(a))\n#define ITOC(c) ((char)(((int)'0')+c))\n#define MID(s,e) (s+(e-s)/2)\n#define SZ(a) strlen(a)\n#define MOD 1000000007\n#define MAX 10000000005\n#define MIN -10000000005\n#define PI 3.1415926535897932384626433832795\n#define DEB(x) printf(\"The value of \\\"%s\\\" is: %d\\n\",#x,x)\n#define CASES ll t;SC1(t);while(t--)\n#define ABS(a) ((a>0)?a:-(a))\n\nconst int INF = 1<<29;\ntypedef long long ll;\ntypedef unsigned long long ull;\n#define FILEIO(name) \\ freopen(name\".in\", \"r\", stdin); \\ freopen(name\".out\", \"w\", stdout);\nint cmp(const void * a,const void * b);\nlong long maxv(long long a,long long b);\nlong long minv(long long a,long long b);\nlong long gcd(long long u,long long v);\nll binpow(ll a,ll b,ll m)\n{\n ll res=1;\n a=a%m;\n while(b>0)\n {\n if(b&1)\n res=res*a%m;\n a=a*a%m;\n b>>=1;\n }\n return res;\n}\nll multiply(ll a, ll b, ll mod) \n{ \n return ((a % mod) * (b % mod)) % mod; \n} \nint main()\n{\n\tll n,m;\n\tSC2(n,m);\n\tunsigned long long ans=0;\n\tn++;\n\tll x=2*n;\n\tunsigned long long z=binpow(x,m,MOD);\n\tz=z%MOD;\n\tunsigned long long z1=(n-m)%MOD;\n\tunsigned long long z2=multiply(z,z1,MOD);\n\tans=(z2/n);\n\tans=ans%MOD;\n\tprintf(\"%llu\\n\",ans);\n\n\treturn 0;\n}\n \n \n//qsort(arr,n,sizeof(arr[0]),cmp);\nint cmp (const void * a, const void * b)\n{\n if( *(ll*)a - *(ll*)b < 0 ) return -1;\n if( *(ll*)a - *(ll*)b > 0 ) return 1;\n return 0;\n}\nlong long maxv(long long a,long long b)\n{\n if(a>b) return a;\n return b;\n}\nlong long minv(long long a,long long b)\n{\n if(a\nint main()\n{\n\tlong long int n;\n\tscanf(\"%lld\",&n);\n\tn=n*(n-1LL)*(n-2LL)*(n-3LL)*(n-4LL)*n*(n-1LL)*(n-2LL)*(n-3LL)*(n-4LL)/120LL;\n\tprintf(\"%lld\\n\",n);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "dc83ac3a463afcd3ca98d0cdccfb56b2", "src_uid": "92db14325cd8aee06b502c12d2e3dd81", "apr_id": "1d99c8354f8e37bafe4f4ce9a0f62bda", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6480446927374302, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\n\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tunsigned long long int l=n*(n-1)*(n-2)*(n-3)*(n-4);\n\tunsigned long long int m=(l/120);\n\tunsigned long long int t=m*l;\n\tprintf(\"%llu\",(unsigned long long)(t));\n}\n", "lang": "GNU C", "bug_code_uid": "d29294bb65b9d52805a814f145213f22", "src_uid": "92db14325cd8aee06b502c12d2e3dd81", "apr_id": "b80873acdbafe2d20ee205deb2bf72a4", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3803921568627451, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \nint main()\n{\n char *a,*b;\n scanf(\"%ld %ld\", &a,&b);\n if(a==b) printf(\"%s\",a);\n else\n printf(\"%d\",1);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ac373a95d3a75cd110f72bcf0be1487b", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "d5104dbc5274ab47fcaaf234a053cb80", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9764453961456103, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nint main()\n{\n int str[999], str1[999];\n while(scanf(\"%s %s\", str, str1))\n {\n if(strcmp(str, str1)==0) printf(\"%s\\n\", str1);\n else printf(\"%s\\n\", str);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8b97efeb760d91aac1cec63f60fee81d", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "74674524209e139ad43f63a181a34188", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.18513689700130379, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int m,i,j,n,cunt=0,l,b;\n while(scanf(\"%d\",&b))\n {\n int a[100],c[100];\n cunt=0;\n m=0;\n for(i=0; b>0; i++)\n {\n m++;\n c[i]=b%10;\n b=b/10;\n }\n for(i=0,j=m-1; j>=0; i++,j--)\n {\n a[i]=c[j];\n }\n if(a[0]==1)\n {\n for(i=1; i\n#include \n\nint a[201][201], x, y, i, j;\nchar c[1000];\n\nint main()\n{\n\tfor(i = 0; i <= 200; i++)\n\t{\n\tfor(j = 0; j <= 200; j++)\n\ta[i][j] == 0;\t\n\t}\n\ta[199][200]= 0;\n\tscanf(\"%s\",&c);\n\tx = 100;y = 100;\n\ta[x][y] = 1;\n\tfor(i = 0; i < strlen(c); i++)\n\t{\t\n\tif(c[i] == 'L') x = x - 1; \n\tif(c[i] == 'R') x = x + 1;\n\tif(c[i] == 'U') y = y - 1;\n\tif(c[i] == 'D') y = y + 1;\n\ta[y][x]++;\n\t}\n\tint n = 0,flag = 0;\n\tif( strlen(c) > 2 && ((y = 100 && x == 99) || (y = 100 && x == 101)|| ( y == 101 && x == 100)|| ( y == 99 && x == 100))) {printf(\"BUG\"); flag = 1;} \n\t\n\t\n\tfor(i = 0; i <= 200; i++)\n\t{\n\tfor( j = 0; j<= 200; j++)\n\tif(a[i][j] >= 2 && i != 199 && j != 200 && i != 200) { printf(\"BUG\");flag = 1; break; }\n\tif(flag == 1) break;\t\n\t}\n\tfor(i = 0; i <= 200; i++)\n\t{\n\tfor( j = 0; j<= 200; j++)\n\tif((a[i][j]== 1 && a[i][j-1] == 1 && a[i][j] == 1 && a[i -1][j] == 1 && a[i-1][j-1] == 1 ) || (a[i][j] == 1 && a[ i][j +1] == 1 && a[i -1][j] && a[i -1 ][j+1]) || (a[i][j] == 1 && a[i][j+1] == 1 && a[i+1][j+1] == 1 && a[i+1][j]== 1) || (a[i][j] == 1 && a[i][j -1]== 1 && a[i+1][j] == 1 && a[i +1][j -1] == 1)) { printf(\"BUG\");flag = 1; break; }\n\tif(flag == 1) break;\t\n\t}\n\t\n\t\n\tif(flag == 0)printf(\"OK\");\n\t\n\t/*for(i = 80; i <= 200; i++)\n\t{\n\tfor(j = 80; j <= 200; j++)\n\tprintf(\"%d \",a[i][j]);\n\tprintf(\"\\n\");\t\n\t}*/\n\t\n\t\n}", "lang": "GNU C11", "bug_code_uid": "339fb26bc89f1acf4dd82f80f98879a6", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "7edba0db56d043f71b6580657119d416", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2723174030658251, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n\nchar n[1000];\nint main(){\n\t\n\tscanf(\"%s\", &n);\n\tint f= 0;\n\tfor (int i = 0; i < strlen(n)-2; ++i)\n\t{\n\t\tif((n[i]=='A' && n[i+1]=='B' && n[i+2]=='C') \n\t\t\t||(n[i]=='A' && n[i+1]=='C' && n[i+2]=='B')\n\t\t\t||(n[i]=='B' && n[i+1]=='A' && n[i+2]=='C')\n\t\t\t||(n[i]=='B' && n[i+1]=='C' && n[i+2]=='A')\n\t\t\t||(n[i]=='C' && n[i+1]=='A' && n[i+2]=='B')\n\t\t\t||(n[i]=='C' && n[i+1]=='B' && n[i+2]=='A')){\n\t\t\tprintf(\"Yes\\n\");\n\t\t\tf= 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(f==0)printf(\"No\\n\");\n\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "031923f4e7bb885f90b0a4954d60c9c4", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "0ae65accb245a908082e77e482c69e4a", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9236593059936908, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#define counter.is_even counter%2==0\n#define counter.is_nonzero counter!=0\nint gcd(int a, int b) {\n return b == 0 ? a : gcd(b, a % b);\n}\nlong long int vertexes[11111];\nint main(void) {\n\tlong long int n, counter, position, maximum = 1;\n\tscanf(\"%I64d\", &n);\n\tfor(int i = 1; i <= n; i++) {\n scanf(\"%I64d\", &vertexes[i]);\n }\n\tfor(int i = 1; i <= n; i++){\n\t\tcounter = 1;\n\t\tposition = vertexes[i];\n\t\twhile(position != i) {\n\t\t\tposition = vertexes[position];\n\t\t\tcounter++;\n\t\t\tif( counter > 100 || vertexes[position] == position) {\n printf(\"-1\");\n return 0;\n }\n\t\t}\n\t\tif(counter.is_even) {\n counter = counter / 2;\n }\n\t\tif(counter.is_nonzero) {\n maximum = maximum * counter / gcd(maximum, counter);\n }\n\t}\n\tprintf(\"%I64d\", maximum);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "e5559ea348aab983d924717309f73a85", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "9811ef92d7d1b73504da6c9d0ffa1efb", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.0502092050209205, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\nmain()\n{\n\tint n,i,a[100],b[100],c[6],d[6],e[6],flag=0,ex=0,def=0;\n\tscanf(\"%d\",&n);\n\tfor(i=0;i\nint main()\n{\nlong long int f,i,b,a,n,k;\nscanf(\"%lld%lld\",&n,&k);\nf=0;\nfor(i=1;i\n#include \n#include \n\n#define MAXP 1000005\n\n#define MOD 1000000007\n\nint mat[MAXP];\nint p, k;\n\nint dfs (int a) {\n\t\n\tif (mat[a] == 1)\n\t\treturn 0;\n\t\n\tmat[a] = 1;\n\t\n\treturn dfs((k * a) % p);\n}\n\nint main () {\n\tint i;\n\tlong long res = 1;\n\t\n\tmemset(mat, 0, sizeof(int) * MAXP);\n\t\n\tscanf(\"%d %d\", &p, &k);\n\t\n\tfor (i = 1; i < p; i++) {\n\t\tif (!mat[i]) {\n\t\t\tdfs(i);\n\t\t\tres = ((res % MOD) * (p % MOD)) % MOD;\n\t\t}\n\t}\n\t\n\tif (k == 1) {\n\t\tres = ((res % MOD) * (p % MOD)) % MOD;\n\t}\n\t\n\tprintf(\"%I64d\\n\", res);\n\t\n\treturn 0;\n\t\n}", "lang": "GNU C", "bug_code_uid": "b5f8dccc66f1d2f3040ff3a9b7d3c513", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "49726289101a53220fab81c7e3f4a0f0", "difficulty": 1800, "tags": ["combinatorics", "dfs and similar", "number theory", "dsu", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9906542056074766, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \n\n#define MOD 1000000007\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nint p, k;\nbool visited[1000010];\n\nint expo(int a, int b){\n long long res = 1;\n\n while (b){\n if (b & 1) res = res * a % MOD;\n a = (long long)a * a % MOD;\n b >>= 1;\n }\n return res;\n}\n\nint main(){\n int i, j, res, counter;\n\n while (scanf(\"%d %d\", &p, &k) != EOF){\n counter = 0;\n clr(visited);\n for (i = 0; i < p; i++){\n if (!visited[i]){\n counter++;\n visited[i] = true;\n j = (i * k) % p;\n while (!visited[j]){\n visited[j] = true;\n j = (j * k) % p;\n }\n }\n }\n\n if (k == 1) res = expo(p, p);\n else res = expo(p, --counter);\n printf(\"%d\\n\", res);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f197173ccd913f8930dfd04c62969b2c", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "aee30a026592f5681cd25e2afb6d2e72", "difficulty": 1800, "tags": ["combinatorics", "dfs and similar", "number theory", "dsu", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8735394172459695, "equal_cnt": 15, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 14, "bug_source_code": "#include \n#include \n\n/*\n\nVasya has found a strange device. On the front panel of\na device there are: a red button, a blue button and a\ndisplay showing some positive integer. After clicking\nthe red button, device multiplies the displayed number\nby two. After clicking the blue button, device subtracts\none from the number on the display. If at some point\nthe number stops being positive, the device breaks down.\nThe display can show arbitrarily large numbers.\nInitially, the display shows number n.\n\nBob wants to get number m on the display. What minimum\nnumber of clicks he has to make in order to achieve this result?\n\nInput\nThe first and the only line of the input contains\ntwo distinct integers n and m (1 <= n, m <= 10000),\nseparated by a space.\n\nOutput\nPrint a single number \ufffd the minimum number of times one\nneeds to push the button required to get the number m out\nof number n.\n\n*/\n\ntypedef struct Pair {\n int data;\n int distance;\n} Pair;\n\nstruct QueueElem{\n Pair pair;\n struct QueueElem* next;\n};\n\nPair makePair(int f, int s){\n Pair p = {f, s};\n return p;\n}\n\ntypedef struct QueueElem Elem;\n\nstruct Queue{\n Elem *front; // sa fronta uklanjam\n Elem *rear; // na rear dodajem\n};\n\ntypedef struct Queue Queue;\n\nvoid init(Queue *q){\n q->front = NULL;\n q->rear = NULL;\n}\n\nvoid destroy(Queue *q){ // treba svaki Elem brisat jer je pravljen sa malloc\n free(q->front);\n free(q->rear);\n}\n\nint isEmpty(Queue *q){\n return (q->front == NULL && q->rear == NULL);\n}\n\n//void print(Queue *q){\n// for(Elem *curr = q->front; curr != NULL; curr = curr->next){\n// printf(\"%d \", curr->data);\n// }\n// printf(\"\\n\");\n//}\n\nvoid enqueue(Queue *q, Pair p){\n Elem *newElem = malloc(sizeof(Elem));\n newElem->pair = p;\n newElem->next = NULL;\n\n if(q->rear == NULL){\n q->front = newElem;\n q->rear = newElem;\n }\n else{\n q->rear->next = newElem;\n q->rear = newElem;\n }\n}\n\nPair dequeue(Queue *q){\n if(isEmpty(q)){\n return makePair(-10000, -10000);\n }\n Pair temp = q->front->pair;\n\n Elem *tmp = q->front;\n q->front = q->front->next;\n free(tmp);\n //tmp = NULL;\n\n if(q->front == NULL){\n q->rear = NULL;\n }\n return temp;\n}\n\nPair peek(Queue *q){\n if(q->front != NULL) return q->front->pair;\n else return makePair(-10000, -10000);\n}\n\n// a greedy BFS sounds fine, maybe for small inputs, we'll see\n// what code forces says\n\nvoid solve(){\n int n, m;\n scanf(\"%d%d\", &n, &m);\n\n Queue q1;\n Queue *q = &q1;\n init(q);\n enqueue(q, makePair(n, 0));\n\n while(!isEmpty(q)){\n Pair curr = dequeue(q);\n if(curr.data == m){\n printf(\"%d\", curr.distance);\n return;\n }\n enqueue(q, makePair(curr.data*2, curr.distance+1));\n if(curr.data-1 >= 0){\n enqueue(q, makePair(curr.data-1, curr.distance+1));\n }\n }\n}\n\nint main()\n{\n solve();\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "1725e6ce7e9881a5f4d630e1615673a3", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "e4b770f3de6ff382642e98e70302d335", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9289855072463769, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nchar cc[8][16];\nint visited[8][8];\nint qq[256];\n\nint ok(int x, int y) {\n\treturn x <= 0 || (!visited[x - 1][y] && cc[x][y] != 'S' && cc[x - 1][y] != 'S');\n}\n\nint main() {\n\tint i, h, q, vx, vy;\n\n\tfor (i = 0; i < 8; i++)\n\t\tscanf(\"%s\", cc[i]);\n\th = 0, q = 0;\n\tqq[h + q++] = 7, qq[h + q++] = 0;\n\twhile (q > 0) {\n\t\tint x = qq[h++];\n\t\tint y = qq[h++];\n\n\t\tq -= 2;\n\t\tif (x == 0) {\n\t\t\tprintf(\"WIN\\n\");\n\t\t\treturn 0;\n\t\t}\n\t\tvisited[x][y] = 1;\n\t\tfor (vx = -1; vx <= 1; vx++)\n\t\t\tfor (vy = -1; vy <= 1; vy++)\n\t\t\t\tif (x + vx >= 0 && x + vx < 8 && y + vy >= 0 && y + vy < 8 && ok(x + vx, y + vy))\n\t\t\t\t\tqq[h + q++] = x + vx - 1, qq[h + q++] = y + vy;\n\t}\n\tprintf(\"LOSE\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ba5258ba9a843d737cdf083e1d98ff72", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "apr_id": "262fb88875f8abd525259b3b7e6a6820", "difficulty": 1500, "tags": ["graphs", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9930104842735896, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#include\n\n\n#define KONTROL(x,y,t) (!mariaMove[x][y][t] && x >= 0 && x < n && y >= 0 && y < n)\n\n#define Max(a,b) (((a) > (b)) ? (a) : (b))\n#define Min(a,b) (((a) < (b)) ? (a) : (b))\n\n#define FOR(i,a,b) for(i = a; i <= b; i++)\n#define ROF(i,a,b) for(i = a; i >= b; i--)\n\n#define SWAP(a,b) {t = a; a = b; b = t;}\n\n#define lli long long int\n\n#define endl puts(\"\")\n\n#define MAX 1e5 + 9\n\ntypedef struct pair{\n\tint x, y;\n}pair;\n\nint const N = 1e4 + 5;\n\nint n = 8;\n\npair sMatrix[N], sac[N];\n\nchar matrix[N][N], mariaMove[10][10][10];\n\npair anna, maria;\n\nint i, j, k, s, m, h, t;\n\nint kontrol(int x, int y){\n\tint i, j;\n\tfor(i = 0; i < s; i++) {\n\t\tif(sMatrix[i].x == x && sMatrix[i].y == y)\n\t\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nvoid sDown(int add) {\n\tint i;\n\tfor(i = 0; i < s; i++) {\n\t\tsMatrix[i].x += add;\n\t}\n}\n\t\nvoid dfs(int x, int y, int t) {\n\tint i, j, k;\n\t\n\tif(x == anna.x && y == anna.y) {\n\t\tprintf(\"WIN\"), endl;\n\t\texit(0);\n\t}\n\n\tif(!KONTROL(x,y,t) || !kontrol(x,y)) return ;\n\t\n\tsDown(1);\n\n\tif(!kontrol(x,y)){ sDown(-1); return ; }\n\n\tmariaMove[x][y][t] = 1;\n\t\n\tfor(i = -1, k = 0; i <= 1; i++) {\n\t\tfor(j = -1; j <= 1; j++, k++) {\n\t\t\tdfs(x+i,y+j, k);\n\t\t}\n\t}\n\tsDown(-1);\n}\n\nvoid clearMariaMove() {\n\tint i, j, k;\n\tfor(i = 0; i < 10; i++) {\n\t\tfor(j = 0; j < 10; j++) {\n\t\t\tfor(k = 0; k < 100; k++) {\n\t\t\t\tmariaMove[i][j][k] = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid clear_sMatrix() {\n\tint i;\n\tfor(i = 0; i < s; i++) {\n\t\tsMatrix[i].x = sac[i].x;\n\t\tsMatrix[i].y = sac[i].y;\n\t}\n}\n\nint main() {\n\t\n\tfor(i = 0; i < n; i++) {\t\n\t\tscanf(\"%s\", matrix[i]);\n\t\tfor(j = 0; j < n; j++) {\n\t\t\tif(matrix[i][j] == 'S') {\n\t\t\t\tsMatrix[s].x = i, sMatrix[s].y = j;\n\t\t\t\tsac[s].x = i, sac[s].y = j;\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\n\tmaria.x = 7, maria.y = 0;\n\tanna.x = 0, anna.y = 7;\n\n\tfor(i = -1; i <= 0; i++) {\n\t\tfor(j = 0; j <= 1; j++) {\n\t\t\tdfs(maria.x+i, maria.y+j, 0);\n\t\t\tclearMariaMove();\n\t\t\tclear_sMatrix();\n\t\t}\n\t}\t\n\n\tputs(\"LOSE\");\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "aad0ae4cb0011eb8ae45e783d36c8544", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "apr_id": "6a3eadf57e0eb6b42820edbc83e3de78", "difficulty": 1500, "tags": ["graphs", "dfs and similar", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5787545787545788, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{ \n\t\n\tint n,a,b;\n\tscanf(\"%d%d%d\" ,&n,&a,&b);\n\tif(b>0)\n\t{ \n\t a=a+b;\n\t if(a%n==0)\n\t printf(\"%d\" ,n);\n\t else\n\t printf(\"%d\" ,a%n);\n\t}\n\tif(b==0)\n\tprintf(\"%d\" ,a);\n\telse\n\t{\n\t\tb=b*(-1);\n\t\twhile(b--)\n\t\t{\n\t\t\tif(a>=1)\n\t\t\ta--;\n\t\t\tif(a==0)\n\t\t\t{\n\t\t\t\ta=n;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\" ,a); \n }\n return 0; \n}", "lang": "GNU C", "bug_code_uid": "900a1045a25b77201c48dee4aa24ac1d", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "e2127c89e19581cf27c32c33db9d9357", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.12440191387559808, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\nint cnt=0,a[1000000];\nint n,k;\nvoid dfs(int step,int sum,int b)\n{\n\tint i;\n\tif(step==k){\n\t\ta[cnt++]=sum;\n\t\treturn;\n\t}\n\tfor(i=b;i<=n;i++){\n\t\tif((sum^i)>sum)\n\t\t\tdfs(step+1,sum^i,i+1);\n\t}\n\ta[cnt++]=sum;\n}\nint main()\n{\n\tint i,max=0;\n\tscanf(\"%d %d\",&n,&k);\n\tfor(i=1;i<=n;i++){\n\t\tdfs(1,i,i+1);\n\t}\n\tfor(i=0;i\n#include\nint cnt=0,a[10000000];\nint n,k;\nvoid dfs(int step,int sum,int b)\n{\n\tint i;\n\tif(step==k){\n\t\ta[cnt++]=sum;\n\t\treturn;\n\t}\n\tfor(i=b;i<=n;i++){\n\t\tif((sum^i)>sum)\n\t\t\tdfs(step+1,sum^i,i+1);\n\t}\n\tif(sum>a[cnt-1])a[cnt++]=sum;\n}\nint main()\n{\n\tint i,max=0;\n\tscanf(\"%d %d\",&n,&k);\n\tfor(i=1;i<=n;i++){\n\t\tdfs(1,i,i+1);\n\t}\n\tfor(i=0;i\n#include\nint cnt=0,a[1000000];\nint n,k;\nvoid dfs(int step,int sum,int b)\n{\n\tint i;\n\tif(step==k){\n\t\ta[cnt++]=sum;\n\t\treturn;\n\t}\n\tfor(i=b;i<=n;i++){\n\t\tif((sum^i)>sum)\n\t\t\tdfs(step+1,sum^i,i+1);\n\t}\n\ta[cnt++]=sum;\n}\nint main()\n{\n\tint i,max=0;\n\tscanf(\"%d %d\",&n,&k);\n\tfor(i=1;i<=n;i++){\n\t\tdfs(1,i,i+1);\n\t}\n\tfor(i=0;i\n#include \nint main()\n{\n\tint c,k=0,t=0;\n\tchar ch1[2];\n\tchar ch[14];\n\tgets(ch1);\n\tgets(ch);\n\tfor(int i=0,j=0;it[j])\n\t\treturn 1;\n\telse if(s[i]0 && a[j]0 && a[j-1]>a[j];j--){\n\t\t\t\ttemp=a[j];\n\t\t\t\ta[j]=a[j-1];\n\t\t\t\ta[j-1]=temp;\n\t\t\t\n\t\t}\n}\nvoid fun(int n,char *s){\n\tint i=0;\n\tfor(i=0;n/10!=0;i++,n/=10)\n\t\ts[i]=n%10+'0';\n\ts[i++]=n+'0';\n\ts[i]='\\0';\n}\nvoid sortIn(int *a,int *indx,int n){\n\tint t1;\n\tint i,j;\n\tfor(i=1;i0 && a[j-1]>a[j];j--){\n\t\t\tt1=a[j-1];\n\t\t\ta[j-1]=a[j];\n\t\t\ta[j]=t1;\n\t\t\tt1=indx[j-1];\n\t\t\tindx[j-1]=indx[j];\n\t\t\tindx[j]=t1;\n\t\t}\n}\nint valid(int *a,int l,int r,int n){\n\tint f=0;\n\tif(l>0 && a[l-1]>a[r])\n\t\tf=1;\n\tif(a[l+1]a[l])\n\t\tf=1;\n\tif(r0)\n\t\t\tstripe[0]=colors[stripe[0]-'A'-1];\n\t\telse\n\t\t\tstripe[0]=colors[stripe[0]-'A'+1];\n\t\treturn ;\n\t}\n\tfor(j=0;j0){\n\t\t\tif(stripe[j]==stripe[j+1])\n\t\t\t\tstripe[j]=colors[stripe[j]-'A'-1];\n\t\t\telse if(stripe[j+1]!=colors[stripe[j]-'A'-1])\n\t\t\t\tstripe[j]=colors[stripe[j]-'A'-1];\n\t\t\telse if(stripe[j]-'A'x==pts[j]->x || nom[i]->y==pts[j]->y){\n\t\t\t\tif(pts[j]->visit==0){\n\t\t\t\t\tinvite[idx++]=pts[j];\n\t\t\t\t\tpts[j]->visit=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t}\n\treturn idx;\n}\nint feasible(struct person *a[],int n){\n\tint i,j,k;\n\tint flag=1;\n\tfor(i=0;flag && ind;j++)\n\t\t\tfor(k=0;flag &&kid==a[i]->dis[j]){\n\t\t\t\t\tflag=0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\tif(i==n)\n\t\treturn 1;\n\treturn 0;\n}\nint find(struct node *p,struct node *node[]){\n\tint i,j,k;\n\tint count=0;\n\tfor(i=0;in;i++){\n\t\tif(p->nei[i]==-1)\n\t\t\tcontinue;\n\t\tfor(j=0;jnei[i]]->n;j++){\n\t\t\tif(node[p->nei[i]]->nei[j]==-1)\n\t\t\t\tcontinue;\n\t\t\tfor(k=0;kn;k++){\n\t\t\t\tif(p->nei[k]==-1)\n\t\t\t\t\tcontinue;\n\t\t\t\tif(node[p->nei[i]]->nei[j]==p->nei[k])\n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\treturn count;\n}\nvoid rem(struct node *p,struct node *nodes[],int n){\n\tint i,j;\n\tfor(i=0;in;j++)\n\t\t\tif(nodes[i]->nei[j]==p->id)\n\t\t\t\tnodes[i]->nei[j]=-1;\n\t}\n}\nint dfs3(struct card piles[],int n,int a[55][55][55][55]){\n\tint dfs1(struct card[],int,int [][][][]);\n\tif(n<=3)\n\t\treturn 0;\n\tif(a[n][piles[n-1].id][piles[n-2].id][piles[n-3].id]!=-1)\n\t\treturn a[n][piles[n-1].id][piles[n-2].id][piles[n-3].id];\n\tif(piles[n-1].suit==piles[n-4].suit || piles[n-1].val==piles[n-4].val){\n\t\tstruct card p[n];\n\t\tint i;\n\t\tfor(i=0;i2)\n\t\tif(a[n][piles[n-1].id][piles[n-2].id][piles[n-3].id]!=-1)\n\t\t\t\t\treturn a[n][piles[n-1].id][piles[n-2].id][piles[n-3].id];\n\tif(piles[n-1].val==piles[n-2].val || piles[n-1].suit==piles[n-2].suit){\n\t\tstruct card p[n-1];\n\t\tint i;\n\t\tfor(i=0;i\n#include \n#include \n#define MAXN 2<<6\n#define OP1 1\n#define OP2 3\n\ntypedef struct Card {\n\tchar val;\n\tchar suit;\n} Card_t;\n\nint dfs(Card_t *cards, int n, int op) {\n\tif(n == 1) return 1;\n\tif(n - op <=0 ) return 0;\n\n\tif(cards[n].val == cards[n - op].val) {\n\t\tint tmpSuit = cards[n - op].suit;\n\t\tcards[n - op].suit = cards[n].suit;\n\t\tif(dfs(cards, n-1, OP1) || dfs(cards, n-1, OP2)) \n\t\t\treturn 1;\n\t\telse \n\t\t\tcards[n - op].suit = tmpSuit;\n\t}\n\tif(cards[n].suit == cards[n - op].suit) {\n\t\tint tmpVal = cards[n- op].val;\n\t\tcards[n - op].val = cards[n].val;\n\t\tif(dfs(cards, n-1, OP1) || dfs(cards, n-1, OP2))\n\t\t\treturn 1;\n\t\telse \n\t\t\tcards[n -op].val = tmpVal;\n\t}\n\treturn 0;\n}\n\nint main() {\n\tCard_t cards[MAXN];\n\tint i,n;\n\tchar tmp;\n\n\twhile(scanf(\"%d\", &n) != EOF) {\n\t\tscanf(\"%c\",&tmp);\n\t\tmemset (cards, 0, sizeof cards);\n\t\tfor(i=1; i <=n ; ++i) \n\t\t\tif (i < n)\n\t\t\t\tscanf(\"%c%c%c\", &cards[i].val, &cards[i].suit, &tmp);\n\t\t\telse \n\t\t\t\tscanf(\"%c%c\", &cards[i].val, &cards[i].suit);\n\t\t\n\t\tif(dfs(cards, n, OP1) || dfs(cards, n, OP2)) puts(\"YES\");\n\t\telse puts(\"NO\");\n\t}\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "1d19cca51ccc68a9059eccab895eaf4a", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "9c6b03945297552c9f80c30a04394faa", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9989532449406838, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/*\n * =====================================================================================\n *\n * Filename: Solitaire.c\n *\n * Description: \n *\n * Version: 1.0\n * Created: 2012\u5e7407\u670825\u65e5 13\u65f647\u520601\u79d2\n * Revision: none\n * Compiler: gcc\n *\n * Author: YOUR NAME (), \n * Organization: \n *\n * =====================================================================================\n */\n#include \n#include \n#include \n#define MAXN 2<<6\n#define OP1 1\n#define OP2 3\nint dp[MAXN][MAXN][MAXN][MAXN];\ntypedef struct Card {\n\tchar val;\n\tchar suit;\n} Card_t;\nCard_t cards[MAXN];\n/* \nint dfs(Card_t *cards, int n, int op) {\n\tif(n == 1) return 1;\n\tif(n - op <=0 ) return 0;\n\n\tif(cards[n].val == cards[n - op].val) {\n\t\tint tmpSuit = cards[n - op].suit;\n\t\tcards[n - op].suit = cards[n].suit;\n\t\tif(dfs(cards, n-1, OP1) || dfs(cards, n-1, OP2)) \n\t\t\treturn 1;\n\t\telse \n\t\t\tcards[n - op].suit = tmpSuit;\n\t}\n\tif(cards[n].suit == cards[n - op].suit) {\n\t\tint tmpVal = cards[n- op].val;\n\t\tcards[n - op].val = cards[n].val;\n\t\tif(dfs(cards, n-1, OP1) || dfs(cards, n-1, OP2))\n\t\t\treturn 1;\n\t\telse \n\t\t\tcards[n -op].val = tmpVal;\n\t}\n\treturn 0;\n}\n*/\n\nint calc(int n, int a, int b, int c) {\n\tif(n == 1) return 1;\n\tif(n == 2) {\n\t\tif(cards[a].val == cards[b].val || cards[a].suit == cards[b].suit) return 1;\n\t\telse return 0;\n\t}\n\tif(n == 3) {\n\t//\tprintf(\"n-%d a-%d b-%d c-%d\\n\",n,a,b,c);\n\t\tif(cards[c].val == cards[b].val || cards[c].suit == cards[b].suit) {\n\t//\t\tprintf(\"cards[%d].val=%c cards[%d].val=%c\\n\",c,cards[c].val,b,cards[b].val);\n\t\t\tif(cards[c].val == cards[a].val || cards[c].suit == cards[a].suit) \n\t\t\t\treturn 1;\n\t\t\telse \n\t\t\t\treturn 0;\n\t\t}\n\t\telse \n\t\t\treturn 0;\n\t}\n\treturn 0;\n}\n\nint main() {\n\tint i,j,k,l,n;\n\tchar tmp;\n\n\twhile(scanf(\"%d\", &n) != EOF) {\n\t\tscanf(\"%c\",&tmp);\n\t\tmemset (cards, 0, sizeof cards);\n\t\tmemset (dp, 0, sizeof dp);\n\t\tfor(i=1; i <=n ; ++i) \n\t\t\tif (i < n)\n\t\t\t\tscanf(\"%c%c%c\", &cards[i].val, &cards[i].suit, &tmp);\n\t\t\telse \n\t\t\t\tscanf(\"%c%c\", &cards[i].val, &cards[i].suit);\n\t\t\n\t\tfor(i=1; i<=n; ++i) {\n\t\t\tfor(j=1; j<=n; ++j) {\n\t\t\t\tfor(k=1; k<=n; ++k) {\n\t\t\t\t\tif(j == k) continue;\n\t\t\t\t\tfor(l=1; l<=n; ++l) {\n\t\t\t\t\t\tif(k == l) continue;\n\t\t\t\t\t\tif(i >= 4) {\n\t\t\t\t\t\t\tif(cards[i-3].val == cards[l].val || cards[i-3].suit == cards[l].suit)\n\t\t\t\t\t\t\t\tdp[i][j][k][l] = dp[i-1][l][j][k];\n\t\t\t\t\t\t\tif(cards[k].val == cards[l].val || cards[k].suit == cards[l].suit) \n\t\t\t\t\t\t\t\tdp[i][j][k][l] = dp[i][j][k][l] || dp[i-1][i-3][j][l];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j][k][l] = calc(i,j,k,l);\n\t//\t\t\t\t\tprintf(\"dp[%d][%d][%d][%d]:%d\\n\",i,j,k,l,dp[i][j][k][l]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(n == 1) {\n\t\t\tif(calc(1, 1, 0, 0)) puts(\"YES\");\n\t\t\telse puts(\"NO\");\n\t\t}\n\t\telse if(n == 2) {\n\t\t\tif(calc(2, 1, 2, 0)) puts(\"YES\");\n\t\t\telse puts(\"NO\");\n\t\t}\n\t\telse {\n\t\t\tif(dp[n][n-2][n-1][n]) puts(\"YES\");\n\t\t\telse puts(\"NO\");\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d257af82584e30589845ad554fc51f47", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "9c6b03945297552c9f80c30a04394faa", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999650959860384, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/*\n * =====================================================================================\n *\n * Filename: Solitaire.c\n *\n * Description: \n *\n * Version: 1.0\n * Created: 2012\u5e7407\u670825\u65e5 13\u65f647\u520601\u79d2\n * Revision: none\n * Compiler: gcc\n *\n * Author: YOUR NAME (), \n * Organization: \n *\n * =====================================================================================\n */\n#include \n#include \n#include \n#define MAXN 52\n#define OP1 1\n#define OP2 3\nint dp[MAXN][MAXN][MAXN][MAXN];\ntypedef struct Card {\n\tchar val;\n\tchar suit;\n} Card_t;\nCard_t cards[MAXN];\n/* \nint dfs(Card_t *cards, int n, int op) {\n\tif(n == 1) return 1;\n\tif(n - op <=0 ) return 0;\n\n\tif(cards[n].val == cards[n - op].val) {\n\t\tint tmpSuit = cards[n - op].suit;\n\t\tcards[n - op].suit = cards[n].suit;\n\t\tif(dfs(cards, n-1, OP1) || dfs(cards, n-1, OP2)) \n\t\t\treturn 1;\n\t\telse \n\t\t\tcards[n - op].suit = tmpSuit;\n\t}\n\tif(cards[n].suit == cards[n - op].suit) {\n\t\tint tmpVal = cards[n- op].val;\n\t\tcards[n - op].val = cards[n].val;\n\t\tif(dfs(cards, n-1, OP1) || dfs(cards, n-1, OP2))\n\t\t\treturn 1;\n\t\telse \n\t\t\tcards[n -op].val = tmpVal;\n\t}\n\treturn 0;\n}\n*/\n\nint calc(int n, int a, int b, int c) {\n\tif(n == 1) return 1;\n\tif(n == 2) {\n\t\tif(cards[a].val == cards[b].val || cards[a].suit == cards[b].suit) return 1;\n\t\telse return 0;\n\t}\n\tif(n == 3) {\n\t//\tprintf(\"n-%d a-%d b-%d c-%d\\n\",n,a,b,c);\n\t\tif(cards[c].val == cards[b].val || cards[c].suit == cards[b].suit) {\n\t//\t\tprintf(\"cards[%d].val=%c cards[%d].val=%c\\n\",c,cards[c].val,b,cards[b].val);\n\t\t\tif(cards[c].val == cards[a].val || cards[c].suit == cards[a].suit) \n\t\t\t\treturn 1;\n\t\t\telse \n\t\t\t\treturn 0;\n\t\t}\n\t\telse \n\t\t\treturn 0;\n\t}\n\treturn 0;\n}\n\nint main() {\n\tint i,j,k,l,n;\n\tchar tmp;\n\n\twhile(scanf(\"%d\", &n) != EOF) {\n\t\tscanf(\"%c\",&tmp);\n\t\tmemset (cards, 0, sizeof cards);\n\t\tmemset (dp, 0, sizeof dp);\n\t\tfor(i=1; i <=n ; ++i) \n\t\t\tif (i < n)\n\t\t\t\tscanf(\"%c%c%c\", &cards[i].val, &cards[i].suit, &tmp);\n\t\t\telse \n\t\t\t\tscanf(\"%c%c\", &cards[i].val, &cards[i].suit);\n\t\t\n\t\tfor(i=1; i<=n; ++i) {\n\t\t\tfor(j=1; j<=n; ++j) {\n\t\t\t\tfor(k=1; k<=n; ++k) {\n\t\t\t\t\tif(j == k) continue;\n\t\t\t\t\tfor(l=1; l<=n; ++l) {\n\t\t\t\t\t\tif(k == l) continue;\n\t\t\t\t\t\tif(i >= 4) {\n\t\t\t\t\t\t\tif(cards[i-3].val == cards[l].val || cards[i-3].suit == cards[l].suit)\n\t\t\t\t\t\t\t\tdp[i][j][k][l] = dp[i-1][l][j][k];\n\t\t\t\t\t\t\tif(cards[k].val == cards[l].val || cards[k].suit == cards[l].suit) \n\t\t\t\t\t\t\t\tdp[i][j][k][l] = dp[i][j][k][l] || dp[i-1][i-3][j][l];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j][k][l] = calc(i,j,k,l);\n\t//\t\t\t\t\tprintf(\"dp[%d][%d][%d][%d]:%d\\n\",i,j,k,l,dp[i][j][k][l]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(n == 1) {\n\t\t\tif(calc(1, 1, 0, 0)) puts(\"YES\");\n\t\t\telse puts(\"NO\");\n\t\t}\n\t\telse if(n == 2) {\n\t\t\tif(calc(2, 1, 2, 0)) puts(\"YES\");\n\t\t\telse puts(\"NO\");\n\t\t}\n\t\telse {\n\t\t\tif(dp[n][n-2][n-1][n]) puts(\"YES\");\n\t\t\telse puts(\"NO\");\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9c36eb452245b9ae8fde9b1110aa2749", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "9c6b03945297552c9f80c30a04394faa", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.19207317073170732, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nlong long int fact(long long int b, long long int a)\n{\n if ( b==a ) return 1;\n else b=b*fact(b-1,a);\n return b%10;\n}\nint main()\n{\n long long int a, b;\n scanf(\"%lld %lld\", &a, &b);\n b=fact(b,a);\n printf(\"%lld\", b%10);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "71e91a3ef0f038988320a01b810fdd6e", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "65ea4ebdb41e63c9bf2de70c9afcd2b6", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7390300230946882, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint main(){\n\tint n,k,path;\n\tscanf(\"%d %d\",&n,&k);\n\tif(n==1){\n\t print(0);\n\t}\n\telse{\n\tif((n-k)<=(k-1)){\n\t\tpath=(n-k)+(n-1);\n\t}\n\telse{\n\t\tpath=(n-1)+(k-1);\n\t}\n\tint total=2*path+n+2;\n\tif(k!=1 && k!=n){\n\t\ttotal -= 1;\n\t}\n\tprintf(\"%d\",total);\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "953a73d751521446dd3a53c6c4a46d79", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "apr_id": "9d1a7fa46977809e0b3f50d34d927955", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.2, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \n\nint lucky(int n)\n{\n long long int m;\n while(n!=0)\n {\n m=n%10;\n if(m!=4 && m!=7)\n return 0;\n n=n/10;\n }\n return 1;\n\n}\n\nint main()\n{\n long long int n,i,j=0;\n scanf(\"%I64d\",&n);\n for(i=4;i<=n;i++)\n {\n if(1==lucky(i))\n {\n j++;\n }\n }\n printf(\"%I64d\\n\",j);\n\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "760e0dea293640146b7342c36c366af7", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "b593511981bb1e34e96f494d4e968183", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9900990099009901, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main ()\n{\n\tint z,a;\n\t////\n\tscanf(\"%d %d\",a,z);\n\tprintf(\"%d\",a+z);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6915d41c043b906d79e29f37b42c97b7", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "6060c888fb0eff40d9bc75caef1bcf9a", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.967391304347826, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nstruct node{\n\tint s,e,d,id;\n}a[105];\nint b[105];\nvoid sort(struct node a[],int m){\n\tstruct node temp;\n\tint i,j;\n\tfor(i=1;i < m;i++){\n\t for(j = 1;j < m-i;j++){\n\t \tif(a[j].e > a[j+1].e){\n\t \t\ttemp = a[j];\n\t \t\ta[j] = a[j+1];\n\t \t\ta[j+1] = temp;\n\t\t\t}\n\t\t}\n\t}\n}\nint main(){\n\tint n,m;\n\tint i,j,t;\n\tint flag = 0;\n\twhile(scanf(\"%d%d\",&n,&m) != EOF){\n\t\tmemset(b,0,sizeof(b));\n\t\tfor(i = 1;i <= m;i++){\n\t\t\tscanf(\"%d%d%d\",&a[i].s,&a[i].e,&a[i].d);\n\t\t\ta[i].id = i;\n\t\t\tb[a[i].e] = m + 1;\n\t\t}\n\t\tsort(a,m);\n\t\tfor(i = 1;i <= m;i++){\n\t\t\tint count = 0;\n\t\t\tfor(j = a[i].s;j < a[i].e;j++){\n\t\t\t\tif(b[j] == 0){\n\t\t\t\t\tb[j] = a[i].id;\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tif(count == a[i].d) break;\n\t\t\t}\n\t\t\tif(count != a[i].d){\n\t\t\t\tflag = 1;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\tif(flag == 1){\n\t\t\tprintf(\"-1\\n\");\n\t\t}\n\t\telse{\n\t\t\tfor(j = 1;j <= n-1;j++){\n\t\t\t\tprintf(\"%d \",b[j]);\n\t\t\t}\n\t\t\tprintf(\"%d\\n\",b[j]);\n\t\t}\n\t\t\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "719df43d7d96a1c1d7101d806cb46213", "src_uid": "02d8d403eb60ae77756ff96f71b662d3", "apr_id": "1c500007614964a8a349fa28ce3df98c", "difficulty": 1700, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3420729209340434, "equal_cnt": 26, "replace_cnt": 22, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 26, "bug_source_code": "#include \nmain()\n{\nchar h[10],p[10],d[10],c;\nint i=0,k=0,j=0,n=0,m=0,l=0,t=0,q=0,w=0,e=0,r=0,a=0,b=0;\n\nwhile (t!= 1)\n{\n\tif (q!=1)\n\t{printf(\"1\");\nwhile((c=getchar())!='\\n')\n{h[i]=c;\nn++;\n}}\n\tif (w!=1)\n\t{printf(\"2\");\nwhile((c=getchar())!='\\n')\n{p[k]=c;\nm++;\n}}\nif (e!=1)\n{printf(\"3\");\nwhile((c=getchar())!='\\n')\n{d[j]=c;\nl++;\n}}\n\nif (r!=1)\n{\nif (((n==8)&&(m==5)&&(l==5))||((n==5)&&(m==4)&&(l==4))&&((n==4)&&(m==8)&&(l==8)))\n{\n\tprintf(\"F\"); t=1;}\nelse if (((n==5)&&(m==8)&&(l==5))||((n==4)&&(m==5)&&(l==4))&&((n==8)&&(m==4)&&(l==8)))\n{printf(\"M\"); t=1;}\nelse if (((n==5)&&(m==5)&&(l==8))||((n==4)&&(m==4)&&(l==5))&&((n==8)&&(m==8)&&(l==4)))\n{printf(\"S\"); t=1;}\nelse if (((n==5)&&(m==8)&&(l==8))||((n==4)&&(m==5)&&(l==5))||((n==8)&&(m==4)&&(l==4)))\n{q=1;\nr=1;}\nelse if (((n==8)&&(m==5)&&(l==8))||((n==5)&&(m==4)&&(l==5))||((n==4)&&(m==8)&&(l==4)))\n{w=1;\nr=1;}\nelse if (((n==8)&&(m==8)&&(l==5))||((n==5)&&(m==5)&&(l==4))||((n==4)&&(m==4)&&(l==8)))\n{e=1;\nr=1;}\n}\nelse\n{\n\tif (q==1)\n\t{ a=m; b=l;\nif (((a==8)&&(b==5))||((a==5)&&(b==4))&&((a==4)&&(b==8)))\n{\n\tprintf(\"M\"); t=1;}\nelse {printf(\"S\"); t=1;}}\nelse if (w==1)\n\t{ a=n; b=l;\nif (((a==8)&&(b==5))||((a==5)&&(b==4))&&((a==4)&&(b==8)))\n{\nprintf(\"F\"); t=1;}\nelse {printf(\"S\"); t=1;}}\nelse if (e==1)\n\t{ a=n; b=m;\nif (((a==8)&&(b==5))||((a==5)&&(b==4))&&((a==4)&&(b==8)))\n{\nprintf(\"F\"); t=1;}\nelse {printf(\"M\");t=1;}}\n}\n}\n}", "lang": "GNU C", "bug_code_uid": "6eaa69738295a2a0141333199817ff0b", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "8964280e72dcfbb7d50ef0d81e549d9f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9794871794871794, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include \n#define max(a, b) (a > b) ? (a) : (b)\n#define abs(a) (a < 0) ? -(a) : (a)\n\nint\nmain(void)\n{\n int a, b, x1, y1, x2, y2;\n scanf(\"%d%d%d%d%d%d\", &a, &b, &x1, &y1, &x2, &y2);\n int\n x_1 = (x1 + y1 > 0)? (x1 + y1) / (2 * a) : (x1 + y1) / (2 * a) - 1,\n y_1 = (x1 - y1 > 0)? (x1 - y1) / (2 * b) : (x1 - y1) / (2 * b) - 1,\n x_2 = (x2 + y2 > 0)? (x2 + y2) / (2 * a) : (x2 + y2) / (2 * a) - 1,\n y_2 = (x2 - y2 > 0)? (x2 - y2) / (2 * b) : (x2 - y2) / (2 * b) - 1;\n printf(\"%d\", max(abs(x_1 - x_2), abs(y_1 - y_2)));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3ef77fa37e26422febe1e1a506ca2318", "src_uid": "7219d1837c83b5920992aee5a60dc0d9", "apr_id": "4959ac6a8753f8fa848cada9815694b5", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41467576791808874, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n\nint main()\n{\n int a, b, x1, y1, x2, y2;\n scanf(\"%d%d%d%d%d%d\",&a,&b,&x1,&y1,&x2,&y2);\n\n a*=2;\n b*=2;\n int i, j, s1, s2, r1, r2;\n\n s1 = x1 + y1;\n s2 = x2 + y2;\n if (s1 > 0) r1 = s1%a;\n else r1 = a + s1%a;\n if (s2 > 0) r2 = s2%a;\n else r2 = a + s2%a;\n i = fabs( (s1-r1) - (s2-r2) )/a;\n\n s1 = x1 - y1;\n s2 = x2 - y2;\n if (s1 > 0) r1 = s1%b;\n else r1 = a + s1%b;\n if (s2 > 0) r2 = s2%b;\n else r2 = a + s2%b;\n j = fabs( (s1-r1) - (s2-r2) )/b;\n\n if (i>j) printf(\"%d\",i);\n else printf(\"%d\",j);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "688fce9020a39a765f2e63b158a18373", "src_uid": "7219d1837c83b5920992aee5a60dc0d9", "apr_id": "ad91c8815b78296f756c07b723bbaa6a", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16411181244364292, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int i,k,j,n,b=0;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++)\n {\n for(j=1;j<=i;j++)\n for(k=1;k<=j;k++)\n if((k*k+j*j)==i*i)\n {\n b++;\n break;\n }\n}\nprintf(\"%d\\n\",b);getchar();\ngetchar();\n\nreturn 0;\n}\n \n\n\n ", "lang": "GNU C", "bug_code_uid": "0e59ebe6dd0fd3a3d5cab28396757852", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "f1e9b54228d70b4799fc31a4429d942c", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8870523415977961, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n\tint n,e,i,j,k;\n\tscanf(\"%d%d\",&n,&e);\n\tif((n/e)>=2)\n\tk=e;\n\telse if((e/n)>=2)\n\tk=n;\n\telse\n\t{\n\t\t\tk=(n+e)/3;\n\t}\n\tprintf(\"%d\\n\",k);\n}\n", "lang": "GNU C", "bug_code_uid": "f330a850ee82698063f5d69e378ed1c2", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "2a704e3ed8ce9f6047ba35e9a25a71ea", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5260029717682021, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,t,k,d;\n scanf(\"%d%d%d%d\",&n,&t,&k,&d);\n if(n*t<=k*d){\n printf(\"NO\");\n return;\n }\n if(k>=n&&t>d){\n printf(\"YES\");\n return;\n }\n if(k>=n&&t<=d){\n printf(\"NO\");\n return;\n }\n if(k\n#include\nint main()\n{ \n\tint p=0,q=0,i=0;\n char s[102];\n gets(s);\n //printf(\"%s\",s);\n while(s[i]!='\\0')\n {\n int z =s[i];\n if(z>=97&&z<=122)\n {\n \tp++;\n }\n if(z>=65&&z<=90)\n {\n \tq++;\n }\n \n i++; \n }\n //printf(\"\\n%d\",p);\n //printf(\"\\n%d\",q);\n i=0;\n \n if(p>q)\n {\n \twhile(s[i]!='\\0')\n \t{\n \t\tint t;\n \t t=s[i];\n \t if(t>=65&&t<=90)\n \t {\n \t \ts[i]=t+32;\n \t }\n \t \n \t}\n }\n else\n {\n \twhile(s[i]!='\\0')\n \t{\n \t\tint t;\n \t t=s[i];\n \t if(t>=97&&t<=122)\n \t {\n \t \ts[i]=t-32;\n \t }\n \n \t \n \t}\n }\n \n \n printf(\"%s\",s);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7264d288310b25e77b094ea2f8ca154a", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "69749668a55c24517276b7b4f3255208", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5650364203954215, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n int n,arr[10],tip=0,c=0,flag=0,ans=1,i;\n\n scanf(\"%d\",&n);\n\n for(i=0;i<=9;i++)\n {\n //printf(\"%d\",i);\n arr[i]=0;\n }\n\n //printf(\"%d\",n);\n i=2;\n while(n>1)\n {\n\n\n if(n%i!=0)\n {\n i++;\n }\n else\n {\n n = n/i;\n arr[i]++;\n }\n\n\n }\n while(1)\n {\n for(i=2;i<=9;i++)\n {\n if(arr[i]>1)\n tip = 1;\n }\n //printf(\"%d %d\\n\",tip,i);\n if(tip==0)\n break;\n\n for(i=2;i<=9;i++)\n {\n if(arr[i]%2!=0)\n {\n flag=1;\n arr[i]++;\n }\n arr[i]=arr[i]/2;\n }\n c++;\n tip=0;\n }\n for(i=2;i<=9;i++)\n if(arr[i]==1)\n ans*=i;\n\n if(flag==1)\n printf(\"%d %d\",ans,c+1);\n else\n printf(\"%d %d\",ans,c);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "8fabc0b252b5d1601a6747d100f1b245", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "c5be207b64a1cd98c96a63868a6c1195", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9770546516478932, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\n#define SIZE 1000\n\nvoid factorization (int n, int p[], int k[], int *sz)\n{\n\tint d;\n\n\t*sz = 0;\n\n\tfor (d = 2; d * d <= n; d++)\n\t\tif (n % d == 0)\n\t\t{\n\t\t\tp[*sz] = d;\n\n\t\t\twhile (n % d == 0)\n\t\t\t{\n\t\t\t\tk[*sz]++;\n\t\t\t\tn /= d;\n\t\t\t}\n\n\t\t\t(*sz)++;\n\t\t}\n\n\tif (n != 1)\n\t{\n\t\tp[*sz] = n;\n\t\tk[(*sz)++] = 1;\n\t}\n}\n\nint is_power_of_two (int n)\n{\n\twhile (n % 2 == 0)\n\t\tn /= 2;\n\n\treturn n == 1;\n}\n\nint is_need_mult (int p[], int k[], int sz)\n{\n\tint i;\n\n\tif (is_power_of_two (k[0]))\n\t\tfor (i = 1; i < sz; i++)\n\t\t\tif (k[i] != k[i - 1])\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\tk[i] = k[i];\n\telse\n\t\treturn 1;\n\n\treturn 0;\n}\n\nint oper (int p[], int k[], int sz)\n{\n\tint i, cnt = 0, max = 0;\n\n\tfor (i = 0; i < sz; i++)\n\t\tif (k[i] > max)\n\t\t\tmax = k[i];\n\n\ti = 0;\n\t\n\twhile (1 << i < max)\n\t\ti++;\n\n\tcnt = i;\n\n\tif (is_need_mult (p, k, sz))\n\t\tcnt++;\n\n\treturn cnt;\n}\n\nint min_num (int p[], int sz)\n{\n\tint i, min = 1;\n\n\tfor (i = 0; i < sz; i++)\n\t\tmin *= p[i];\n\n\treturn min;\n}\n\nint main()\n{\n\tint n, i, sz, oper_cnt, p[SIZE] = {0}, k[SIZE] = {0};\n\n\tscanf (\"%d\", &n);\n\n\tfactorization (n, p, k, &sz);\n\n\toper_cnt = oper (p, k, sz);\n\n\tprintf (\"%d %d\\n\", min_num (p, sz), oper_cnt);\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "4cbf4a9dbc4c02e7ac72601d6bec06ad", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "81a64ccab1bb2e2c902b7bd19a41500e", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9990485252140818, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nvoid sort(int[], int);\n\nint main()\n{\n\tint A[10];\n\tint n, m, i, j, temp;\n\n\tscanf(\"%d%d\", &n, &m);\n\tfor (i = 0; i < m; i++)\n\t\tscanf(\"%d\", &A[i]);\n\n\tsort(A, m);\n\tint result = 50001;\n\tfor (i = 0; i < m + 1 - n; i++)\n\t\tif (A[i + n - 1] - A[i] < result)\n\t\t\tresult = A[i + n - 1] - A[i];\n\n\tprintf(\"%d\", result);\n\treturn 0;\n}\n\nvoid sort(int A[], int m)\n{\n\tint i, j;\n\n\tfor (i = 0; i < m - 1; i++)\n\t\tfor (j = i + 1; j < m; j++)\n\t\t\tif (A[i] > A[j])\n\t\t\t{\n\t\t\t\tint temp = A[i];\n\t\t\t\tA[i] = A[j];\n\t\t\t\tA[j] = temp;\n\t\t\t}\n}\n", "lang": "GNU C", "bug_code_uid": "552e2379d36fd33c748c47e7e970eed8", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "b50d7bb2a5ef0342db45dd2f0d9e9867", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8130328867235079, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\ntypedef long long int lli;\n\n#define TRUE (1==1)\n#define FALSE (!TRUE)\n\n#define fo3(a,b,c) for(a=(int)(b);a<=(int)(c);a++)\n#define of3(a,b,c) for(a=(int)(b);a>=(int)(c);a--)\n#define in32(a) scanf(\"%d\",&(a))\n#define in64(a) scanf(\"%I64d\",&(a))\n#define out32(a) printf(\"%d\\n\",(a))\n#define out64(a) printf(\"%I64d\\n\",(a))\n#define instr(a) scanf(\"%s\",(a))\n#define outstr(a) printf(\"%s\\n\",(a))\n#define max(a,b) (((a)<(b))?(b):(a))\n#define min(a,b) (((a)>(b))?(b):(a))\n\nlli gcd(lli a, lli b) {\n return (b == 0) ? a : gcd(b, a % b);\n}\nlli lcm(lli a, lli b) {\n lli g = gcd(a, b);\n return a * (b / g);\n}\n\nint facts(lli val, lli * arr, int st) {\n if (val == 1) {\n arr[0] = 1;\n return 1;\n }\n int i = st,k;\n while (i * i <= val) {\n if (val % i == 0) {\n int pow = 0;\n while (val % i == 0) {\n pow ++;\n val/=i;\n }\n int cur = facts(val,arr,i+1);\n int res = cur * (pow + 1);\n fo3(k,cur,res-1)\n arr[k] = arr[k-cur]*i;\n return res;\n }\n i++;\n }\n arr[0] = 1;\n arr[1] = val;\n return 2;\n}\n\n#define MOD 1000000007\n\nint main(void)\n{\n int n;\n in32(n);\n lli ans = 1;\n while (n-->1)\n ans = (ans * 3) % MOD;\n out64(ans);\n return EXIT_SUCCESS;\n}", "lang": "GNU C11", "bug_code_uid": "077f85ce9537cc0f0f9646a9e2773322", "src_uid": "8218255989e5eab73ac7107072c3b2af", "apr_id": "c037f8064457e75f8e5919172e67714d", "difficulty": 2100, "tags": ["trees", "dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7787114845938375, "equal_cnt": 21, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 9, "fix_ops_cnt": 20, "bug_source_code": "#include \n#include \n#include \nint main()\n{\nint i,n,res=0;\nscanf(\"%d\",n);\nfor(i=1;i<=n;i++){\n res=res+pow(-1,n)*n;\n}\nprintf(\"%d\",res);\n}\n", "lang": "GNU C", "bug_code_uid": "93c7a975e506b4ab030abbc8214dc98f", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "1a7fe2caae758993f00f0015afb69bb1", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9942307692307693, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nlong long f[100001];\n\ninline long long calc(long long m) {\n\tint i;\n\tlong long sum;\n\n\tsum = 0;\n\tfor (i = 2; i <= 100000; i++)\n\t\tsum += m / f[i];\n\n\treturn sum;\n}\n\nint main(void) {\n\tlong long i;\n\tlong long m;\n\tlong long l = 8, r = 10000000000000000LL;\n\n\tfor (i = 2; i <= 100000; i++)\n\t\tf[i] = i * i * i;\n\n\tscanf(\"%lld\", &m);\n\n\twhile (l <= r) {\n\t\tconst long long mid = (l + r) / 2;\n\n\t\tif (calc(mid) >= m)\n\t\t\tr = mid - 1;\n\t\telse\n\t\t\tl = mid + 1;\n\t}\n\n\tprintf(\"%lld\\n\", calc(l) == m ? l : -1);\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "65c415615af904c74ac5271faf733ce3", "src_uid": "602deaad5c66e264997249457d555129", "apr_id": "24b88fa9e1c095d72d2fc14acd807d8c", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22362869198312235, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n\tlong long int c,m,k=2,p,s=0,i,a,b,power[100005]={0,1};\n\tscanf(\"%lld\",&m);\n\tfor(i=1;i<100005;i++)\n\tpower[i]=i*i*i;\n\twhile(s0)\n\t\t\t{\n\t\t\t\ts=s+i/power[c];\n\t\t\t\tc++;\n\t\t\t}\n\t\t\tif(s>=m)\n\t\t\tbreak;\n\t\t}\n\t\tif(s==m)\n\t\tprintf(\"%lld\\n\",i);\n\t\telse\n\t\tprintf(\"-1\\n\");\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "1774d9a641e271277d9c83c733666d7d", "src_uid": "602deaad5c66e264997249457d555129", "apr_id": "80cfe40c010d11a3216b82ab7cd00512", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1841726618705036, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n signed long long int x;\n long int i,min=0,cur=0,temp=1;\nscanf(\"%ld\",&x);\nif(x>=0)\n{\n while(cur!=x)\n{\n if(cur+temp<=x) \n{ cur+=temp; }\nelse \n{ cur-=temp; }\n++temp;\n++min;\n}\n}\nelse\n{\n while(cur!=x)\n{\nif(cur+temp>=x) \n{cur-=temp;}\nelse \n{cur+=temp;}\n++temp;\n++min;\n}\n}\nprintf(\"%ld\",min);\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "6c2e1903e1ded9a3936f0d317556f028", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "950ced6b3ed022f9bf3e73e9c5e25c16", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9869513641755635, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "/* Coached by rainboy */\n#include \n\nint lines(int n, int k) {\n\treturn n == 0 ? 0 : lines(n / k, k) + n;\n}\n\nint binsearch(int n, int k) {\n\tint lower, upper, v;\n\n\tlower = 0, upper = n;\n\twhile (upper - lower > 1) {\n\t\tv = (low + high) / 2;\n\t\tif (lines(v, k) < n)\n\t\t\tlower = v;\n\t\telse\n\t\t\tupper = v;\n\t}\n\treturn upper;\n}\n\nint main() {\n\tint n, k;\n\n\tscanf(\"%d%d\", &n, &k);\n\tprintf(\"%d\\n\", binsearch(n, k));\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "55e2266d7c7bfddb27668f9b5f8357d5", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "e67c33bb1b2e3d4af8e903918fbbe489", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.42988204456094364, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n#include\nint main()\n{\n long long int i,j,k,l,m,n;\n scanf(\"%lld%lld\",&n,&m);\n l=m;\n while(1)\n {\n j=l%m;\n if(j!=0){\n if((l/m)==(n/j)&&(n%j==0)) break;\n else\n l++;\n }\n else l++;\n }\n printf(\"%lld\",l);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "b483e806893a0ce9c934f68985c19b10", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "apr_id": "585030d8488ad6b1651248fccb67abf3", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5098039215686274, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \nint main()\n{\n int n,k;\n scanf(\"%d%d\",&n,&k);\n int x,t;\n for(int i=k-1;i>0;i++){\n if (n%i==0){\n t=i;\n break;\n }\n }\n x=k*n/t+t;\n printf(\"%d\",x);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "fcbd4e1709c2b4684f741b0463ac9053", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "apr_id": "d418265fbdb701ae1104f1250f49a9c6", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9989339019189766, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define NO_VAL -2\n#define IMPOS -100\n\nint r[4010];\nint n,a,b,c;\n\nint max(int x, int y) {\n if (x > y) return x;\n return y;\n}\n\nint cal(int x) {\n // base case\n if (x < 0) return IMPOS;\n // check cache\n if (r[x] != NO_VAL) {return r[x];}\n int ret = max(cal(x-a), cal(x-b));\n ret = max(ret, cal(x-c));\n if (ret == IMPOS) ret = IMPOS;\n else ret++;\n //if (x == 0) printf(\"%d_\", ret);\n r[x] = ret;\n return ret;\n}\n\nint main() {\n int i;\n scanf(\"%d %d %d %d\", &n, &a, &b, &c);\n int min = a;\n if (b < min) min = b;\n if (c < min) min = c;\n for (i=0;i<=n;i++) {\n r[i] = NO_VAL;\n }\n r[a] = 1;\n r[b] = 1;\n r[c] = 1;\n for (i=min;i<=n;i++) {\n if (r[i] != NO_VAL) {\n r[i+a] = max(r[i+a], r[i]+1);\n r[i+b] = max(r[i+b], r[i]+1);\n r[i+c] = max(r[i+c], r[i]+1);\n }\n }\n printf(\"%d\\n\", r[n]);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "cde1a27b51d81c51b993e425f2e5d4b3", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "def82067a02506ca989c74e11a4cd256", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9970414201183432, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(void)\n{\n\t\tint n, m;\n\t\tscanf(\"%d %d \", &n, &m);\n\t\n\t\tint arr[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tscanf(\"%d \", &arr[n]);\n\n\t\tint i = 0, result = 1, M = m;\n\t\twhile (i < n){\n\t\t\t\tif (arr[i] <= M)\n\t\t\t\t\t\tM -= arr[i++];\n\t\t\t\telse{\n\t\t\t\t\t\tresult++;\n\t\t\t\t\t\tM = m;\n\t\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\tprintf(\"%d\\n\", result);\n\n\n\t\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "11c8a3c78abb4ce487482123ee6dee7e", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "833a7418490c6f2bea7665d4c8b03406", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24312156078039018, "equal_cnt": 31, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 15, "fix_ops_cnt": 31, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n int n;\n \n char ch[][]={\"Washington\",\"Adams\",\"Jefferson\",\"Madison\",\"Monroe\",\"Q. Adams\",\"Jackson\",\"Van Buren\",\"H. Harrison\",\"Tyler\",\"K. Polk\",\"Taylor\",\"Fillmore\",\"Pierce\",\"Buchanan\",\"Lincoln\",\"Johnson\",\"S. Grant\",\"B. Hayes\",\"A. Garfield\",\"A. Arthur\",\"Cleveland\",\"Harrison\",\"Cleveland\",\"McKinley\",\"Roosevelt\",\"H. Taft\",\"Wilson\",\"G. Harding\",\"Coolidge\",\"C. Hoover\",\"D. Roosevelt\",\"S. Truman\",\"D. Eisenhower\",\"F. Kennedy\",\"B. Johnson\",\"M. Nixon\",\"R. Ford\",\"Carter\",\"W. Reagan\"};\n \n scanf(\"%d\",n);\n \n \n \n printf(\"%s\\n\",ch[n-1]);\n \n return 0;\n}\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "b873245f99b7bc5a77391f7a50998255", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "0629cf9845eebf50a149f3f0b357d16f", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1314878892733564, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n\nint m;\n\nlong solve(int n)\n{\n if(n == 0) return 0;\n return (3 * solve(n - 1) + 2) % m;\n}\n\nint main()\n{\n int n;\n scanf(\"%d %d\", &n, &m);\n printf(\"%ld\", solve(n));\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "e8e6b03ba6e4b90d736d9cff6ac08073", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "6c64ce2a44469f54684b7be562f12a57", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9982046678635548, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\ntypedef struct{\n\n int n_of_matches;\n int n_matchbox;\n \n\n}container;\n\nint cmpfunc (const void * a, const void * b) {\n return ( -*(int*)a + *(int*)b );\n}\n\nint main(void) {\n\n int n, m, cnt = 0, sum = 0;\n scanf(\"%d %d\", &n, &m);\n\n container arr[m];\n\n for(int i = 0; i < m; i++){\n scanf(\"%d\", &arr[i].n_matchbox);\n scanf(\"%d\", &arr[i].n_of_matches);\n }\n\n qsort(arr, m, sizeof(container), cmpfunc);\n\n if(n == 0){\n printf(\"0\");\n return 0;\n }\n \n\n for(int i = 0; i < m; i++){\n\n for(int j = 0; j < arr[i].n_matchbox; j++){\n sum += arr[i].n_of_matches;\n cnt++;\n\n if(cnt == n){\n printf(\"%d\", sum);\n return 0;\n }\n }\n }\n\n printf(\"%d\", sum);\n", "lang": "GNU C11", "bug_code_uid": "29c2873b140bb9a5267efc2e598a0328", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "1e38f89db5096793051004b29d411858", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8573943661971831, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\n#define M 200000000\n\nint aa[M], bb[M];\n\nint compare(const void *a, const void *b) {\n\tint i = *(int *) a;\n\tint j = *(int *) b;\n\n\treturn bb[j] - bb[i];\n}\n\nint min(int a, int b) {\n\treturn a < b ? a : b;\n}\n\nint main() {\n\tstatic int ii[M];\n\tint n, m, i, x, cnt;\n\n\tscanf(\"%d%d\", &n, &m);\n\tfor (i = 0; i < m; i++) {\n\t\tscanf(\"%d%d\", &aa[i], &bb[i]);\n\t\tii[i] = i;\n\t}\n\tqsort(ii, m, sizeof *ii, compare);\n\tcnt = 0;\n\tfor (i = 0; i < m && n > 0; i++) {\n\t\tx = min(aa[ii[i]], n);\n\t\tcnt += (x * bb[ii[i]]);\n\t\tn -= x;\n\t}\n\tprintf(\"%d\\n\", cnt);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f8352de7e7a25c0e625bdb7536027572", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "aedc57baf48b596a49433120e36e5637", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7356076759061834, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "\tLL sum=0LL;\n\tint mas[11];\n\tint r[11];\n\n\tfor(i=0;i<=10;i++){\n\tr[i]=0;\n\t}\n\tscanf(\"%d %d\",&n,&m);\n\n\tfor(i=0;i0){\n\t\tif(r[s]>=k){\n\t\t\tsum+=(k*1LL*s);\n\t\t\tbreak;\n\t\t}\n\t\tsum+=(r[s]*1LL*s);\n\t\tk-=r[s];\n\t\ts--;\n\t\t//printf(\":%I64d \",sum);\n\t}\n\t\n\tprintf(\"%I64d\",sum);\n\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "14edbead81bea4b725e03c3587e68242", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "5c458866a9396670c745de8ccd06f2b7", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9839228295819936, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main(){\n\tint a;\n\tscanf(\"%d\",&a);\n\twhile(a>=10&&a<=999){\n\t\tif(a%2==0){\n\t\t\tprintf(\"0\");\n\t\t}\n\t\telse{\n\t\t\tprintf(\"1\");\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "42127cefa8022a066322114e1d28a2fb", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "86c6dc7719f60fa32cd0d0651b9f9b58", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.31982758620689655, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n int a1,a2,b1,b2,c1,c2;\n scanf(\"%d%d%d%d%d%d\",&a1,&b1,&c1,&a2,&b2,&c2);\n if((a1==0 && b1==0 && c1==0) || (a2==0 && b2==0 && c2==0))\n printf(\"-1\");\n else if((a1==0 && b1==0 &&) || (a2==0 && b2==0 ))\n printf(\"0\");\n else if(a1==0 && a2==0)\n {\n if(c1==0 && c2 ==0)\n printf(\"-1\");\n else if(c1==0 || c2==0)\n printf(\"0\");\n else if(b1*c2==b2*c1)\n printf(\"-1\");\n else\n printf(\"0\");\n }\n else if(a1==0 || a2==0)\n {\n printf(\"1\");\n }\n else if(b1==0 && b2==0)\n {\n if(c1==0 && c2 ==0)\n printf(\"-1\");\n else if(c1==0 || c2==0)\n printf(\"0\");\n else if(a1*c2==a2*c1)\n printf(\"-1\");\n else\n printf(\"0\");\n }\n else if(b1==0 || b2 ==0)\n {\n printf(\"1\");\n }\n else if(a1*b2==a2*b1 && b1*c2==b2*c1)\n printf(\"-1\");\n else if(a1*b2==b1*a2)\n printf(\"0\");\n else\n printf(\"1\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5f9c46710b49617eb21e3b2257d61781", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "345ca093ab01327391d1fd5f013525eb", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3264705882352941, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main (){\n int a1,b1,c1,a2,b2,c2,r=-1;\n scanf(\"%d %d %d\\n%d %d %d\",&a1,&b1,&c1,&a2,&b2,&c2);\n if(b1 && b2){\n if(a1/b1==a2/b2 && a1/b1!=c1/){\n r=0;\n }else{\n r=1;\n } \n }else if((b1==0 && b2!=0) || (b1!=0 && b2==0)){\n r=1;\n }\n printf(\"%d\",r);\n}", "lang": "GNU C", "bug_code_uid": "964a006d1ba29afd28a828898c605fe2", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "858f36fe629e29f110d0d76767364477", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.32599118942731276, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main (){\n int a1,b1,c1,a2,b2,c2,r=-1;\n scanf(\"%d %d %d\\n%d %d %d\",&a1,&b1,&c1,&a2,&b2,&c2);\n if(b1 && b2){\n if(a1/b1==a2/b2 && a1/b1!=c1/c2){\n r=0;\n }else{\n r=1;\n } \n }else if((b1==0 && b2!=0) || (b1!=0 && b2==0)){\n r=1;\n }\n printf(\"%d\",r);\n}", "lang": "GNU C", "bug_code_uid": "20203d54d4b16146766681e969fedcd1", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "858f36fe629e29f110d0d76767364477", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7226048841577959, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main()\n{\n int A1,B1,C1,A2,B2,C2;\n int ans;\n scanf(\"%d %d %d\",&A1,&B1,&C1);\n scanf(\"%d %d %d\",&A2,&B2,&C2);\n if((A1 == 0 && B1 == 0) && (A2 == 0 && B2 == 0) && (C1 != C2))\n {\n /*ans = 0;\n printf(\"%d\\n\",ans);*/\n return 0;\n }\n if ((A1 == 0 && B1 == 0 && C1 == 0) || (A2 == 0 && B2 == 0 && C2 == 0))\n {\n ans = -1;\n printf(\"%d\\n\",ans);\n else if(A1*B2 == B1*A2 && B2*C1 == C2*B1 && C1*A2 == C2*A1)\n {\n ans = -1;\n printf(\"%d\\n\",ans);\n \n }\n else if(((A1*B2) - (A2*B1)) == 0)\n { \n ans = 0;\n printf(\"%d\\n\",ans);\n \n }\n else\n {\n ans = 1;\n printf(\"%d\\n\",ans);\n } \n \n \n}", "lang": "GNU C", "bug_code_uid": "7ec27ae117e7b863c9b1232272c79001", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "c57fb8cc5a3b15509eeb667927579c5f", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6160919540229886, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main(){\nint n,k,t,i=1,stand=0;\n\nscanf(\"%d%d%d\",&n,&k,&t);\n\nfor (i;i<=t;i++){\n\tif (i<=k){\n \tstand++;\n }\n \tif (i>n){\n \t\tstand--;\n\t }\n}\nprintf(\"%d\",stand);\nreturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "97ac9daeddb26fad9895633584348a2b", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "bb5e3fd8989fc8bafa5684d521105855", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4486873508353222, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nusing namespace std;\nint main(){\n\tlong int n, k, t;\n\tcin>>n>>k>>t;\n\tif(t<=k){\n\t\tcout<k && t<=n){\n\t\tcout<n){\n\t\tcout<\nint main () {\n\t long long int n,i,a,b,k,p,r;\n\tr = 0;\n\tscanf(\"%I64d \",&n);\n\t\n\t\tfor (i = 1; i <= n; i++)\n\t{\n\t\tscanf(\"%I64d\",&a);\n\t\tscanf(\"%I64d \",&b);\n\t\tscanf(\"%I64d \",&k);\n\t\tfor (p = 1; p <= k ; p++)\n\t\t{\n\t\t\tif (p % 2 != 0)\n\t\t\t{\n\t\t\t\tr = r + a;\n\t\t\t}\n\t\t\telse \n\t\t\t{ \n\t\t\t\tr = r - b;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%I64d\",r);\n\t\tr=0;\n\t}\n\t\n}\n\t\n", "lang": "GNU C11", "bug_code_uid": "ffd9968d0773870687122d52219ea520", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "fca824ed61e0fcacdebb6a001884a6f0", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6993175431553593, "equal_cnt": 47, "replace_cnt": 32, "delete_cnt": 5, "insert_cnt": 9, "fix_ops_cnt": 46, "bug_source_code": "#include \n#include \n#include \n\nint requires_substitute(char string[], int index1, int index2) {\n if (index1 != 0 && index2 != 0) return 0;\n if (index1 == 1 || index2 == 1) {\n if (string[2] == '0') return 1;\n } if (string[1] == '0') return 1;\n}\nint requires_substitute_fifty(char string[], int index1, int index2) {\n if (index1 == 0 && index2 != 1 && string[1] == '0') return 1;\n else return 0;\n}\nint substitute(char string[], int index1, int index2, int size) {\n int res = -1;\n for (int i = 0; i < size; i++) {\n if (i != index1 && i != index2 && string[i] != '0') {\n res = i;\n break;\n }\n }\n return res;\n}\n\nint main() {\n char string[20];\n scanf(\"%s\", string);\n int nums[5];\n for (int i = 0; i < 5; i++) {\n nums[i] = -1;\n }\n int switchZero = 1;\n int size = strlen(string);\n for (int i = 0; i < size; i++) {\n if (string[i] == '2') {\n nums[0] = i;\n } else if (string[i] == '5') {\n nums[1] = i;\n } else if (string[i] == '7') {\n nums[2] = i;\n } else if (string [i] = '0') {\n if (switchZero) {\n nums[3] = i;\n switchZero = 0;\n } else {\n nums[4] = i;\n switchZero = 1;\n }\n }\n }\n\n if (nums[3] > nums[4]) {\n int tmp = nums[3];\n nums[3] = nums[4];\n nums[4] = tmp;\n }\n int steps[4];\n for (int i = 0; i < 4; i++) \n steps[i] = -1;\n if (nums[1] != -1) {\n if (nums[0] != -1) {\n int step_count = 0;\n if (size > 2 && requires_substitute(string, nums[1], nums[0])) {\n int sub = substitute(strimg, nums[1], nums[0], size);\n if (sub != -1) {\n step_count += sub;\n }\n }\n if (nums[1] < nums[0]) {\n step_count ++;\n }\n step_count += size - nums[1] - 1;\n step_count += size - nums[0] - 2;\n steps[0] = step_count;\n } if (nums[2] != -1) {\n int step_count = 0;\n if (size > 2 && requires_substitute(string, nums[1], nums[2])) {\n int sub = substitute(strimg, nums[1], nums[2], size);\n if (sub != -1) {\n step_count += sub;\n }\n }\n if (nums[1] < nums[2]) {\n step_count ++;\n }\n step_count += size - nums[1] - 1;\n step_count += size - nums[2] - 2;\n steps[1] = step_count;\n } if (nums[4] != -1) {\n int step_count = 0;\n if (size > 2 && requires_substitute_fifty(string, nums[1], nums[4])) {\n int sub = substitute(strimg, nums[1], nums[4], size);\n if (sub != -1) {\n step_count += sub;\n }\n }\n if (nums[1] < nums[4]) {\n step_count ++;\n }\n step_count += size - nums[1] - 1;\n step_count += size - nums[4] - 2;\n steps[2] = step_count;\n }\n } if (nums[3] != -1 && nums[4] != -1) {\n int step_count = 0;\n step_count += size - nums[1] - 1;\n step_count += size - nums[4] - 2;\n steps[3] = step_count;\n }\n int min = -1;\n for (int i = 0; i < 4; i ++) {\n if (steps[i] != -1) {\n if (min == -1 || steps[i] < min) {\n min = steps[i];\n }\n }\n }\n printf(\"%d\", min);\n}", "lang": "GNU C", "bug_code_uid": "712ebb40876ca434e92243984011363e", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "92f0a1acd67022a46bcdd182bf592031", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9623329283110571, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "//emre\n#include \n#include \nint main()\n{\n int r1,r2,d1,d2,c1,c2,x,y,z,t,emre,f,g,var=-1;\n scanf(\"%d %d\",&r1,&r2);\n scanf(\"%d %d\",&c1,&c2);\n scanf(\"%d %d\",&d1,&d2);\n \n for(x=1;x<=9;x++)\n {\n y=r1-x;\n t=d1-x;\n z=c1-x;\n if ( (r2==t+z) && (d2==y+z) && (c2==y+t) )\n {\n if(x==y || x==z || x==t || y==z || y==t || z==t)\n {\n var=-1\n }\n else\n { \n printf(\"%d %d\\n\",x,y);\n printf(\"%d %d\\n\",z,t);\n var=0;\n x+=10;\n }\n }\n }\n \n if(var==-1)\n {\n printf(\"-1\");\n }\n \n \n return 0;\n}", "lang": "GNU C", "bug_code_uid": "99d41191d291b24b27b84be980ca154e", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "e65b00fcd1e9fde1d4474c0e1c6757c0", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9880749574105622, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint main()\n{\n\tfloat r1,r2,c1,c2,d1,d1,x1,x2,x3,x4;\n\tint a,b,c,d;\n\t\n\tscanf(\"%f%f%f%f%f%f\",&r1,&r2,&c1,&c2,&d1,&d2);\n\t\n\tif((r1+r2!=c1+c2)||(r1+r2!=d1+d2)||(c1+c2!=d1+d2))\n\t\tprintf(\"-1\");\n\telse\n\t{\n\t\tx1=(d1-r2+c1)/2;\n\t\tx2=(d2+r1-c1)/2;\n\t\tx3=(d2-r1+c1)/2;\n\t\tx4=(r2-c1+d1)/2;\n\t\t\n\t\ta=(int)(x1);\n\t\tb=(int)(x2);\n\t\tc=(int)(x3);\n\t\td=(int)(x4);\n\t\t\n\t\tif(a==x1&&b==x2&&c==x3&&d==x4)\n\t\t{\n\t\t\tif(a!=b&&a!=c&&a!=d&&b!=c&&b!=d&&c!=d&&a>0&&b>0&&c>0&&d>0&&a<10&&b<10&&c<10&&d<10)\n\t\t\t\tprintf(\"%d %d\\n%d %d\",a,b,c,d);\n\t\t\telse\n\t\t\t\tprintf(\"-1\");\n\n\t\t}\n\t\t\n\t\telse\n\t\t\tprintf(\"-1\");\n\t\t\n\t}\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "1c7dd26545c84ea482d6e2ef1faca372", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "1c46b84008a4ad842ccde03c74e9b08f", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8605705145294588, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#define max(a,b)((a\n#include\nint main()\n{\n char s[100];\n int i,j,k;\n int count;\n\n scanf(\"%s\",s);\n\n for(i=0;i\nint main()\n{int i,c;\nchar a[100];\nchar *q=a;\nc=getchar();\n\nwhile(c!='\\n')\n\n{if(c!='/')\n{\n*(q+i)=c;\ni++;\nc=getchar();\n}\nelse\n{\nfor(;;)\n{\nif (c='/')\nc=getchar();\nelse break;\n}\n*(q+i)='/';\ni++;}}\n\n\nif(*(q+i-1)=='/'&&(i!=1))\n*(q+i-1)='\\0';\nelse \n*(q+i)='\\0';\nprintf(\"%s\",q);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "5978cd64d5e1f1e8c76d1f58f4753b06", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "97321c6dd210809ccbcadc57241a1d14", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.38589211618257263, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tfor(int i=0;i\n\nint main()\n{\n\tint n, m, k, h, l, r;\n\n\tscanf(\"%d %d %d\", &n, &m, &k);\n\n\tl = r = k;\n\n\th = 1;\n\tm -= n;\n\n\n\twhile (m - (r - l + 1) >= 0) {\n\t\th++;\n\t\tm -= r - l + 1;\n\t\tif (r < n)\n\t\t\tr++;\n\t\tif (l > 1)\n\t\t\tl--;\n\t}\n\n\tprintf(\"%d\", h);\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "c12e682ff0a251e37c97a0fe5847f93a", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "fa7aa85c75ff19dd63c2979f26044795", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.035046728971962614, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "\n//#include \n#include \n#include \n#include \n#define PI 3.14159\n#define maxx 640\n#define maxy 480\nmain()\n{int i;\n char c;\n init();\n draw();\n c=getch();\n}\n\ninit()\n/*\ufffd\ufffd\u02bc\ufffd\ufffd\u037c\ufffd\ufffd\u03f5\u0373\ufffd\ufffd\ufffd\ufffd*/\n{int gdriver=DETECT,gmode;\n initgraph(&gdriver,&gmode,\"c:\\\\tc\\\\bgi\"); /*\u05e2\ufffd\ufffd\u02f4\ufffd\ufffd\ufffd\u00b7\ufffd\ufffd*/\n setbkcolor(1);\n sky();\n return;\n}\nsky()\n{int x,y,i;\n for(i=1;i<=500;i++)\n {x=rand()%640;y=rand()%300;\n putpixel(x,y,15);\n putpixel(x+1,y,15);\n }\n for(i=1;i<=200;i++)\n {x=rand()%640;y=300+rand()%100;\n putpixel(x,y,15);\n }\nreturn;\n}\n\ndraw()\n{int i,j,k,x,y,dy;\n setfillstyle(1,7);\nfor(i=1;i<=10;i++)\n {setlinestyle(3,0,3);\n x=100+rand()%400;dy=20+rand()%20;\n for(k=1000;k>=500;k-=100)\n {sound(k);delay(3000);}\n nosound();\n for(j=1;j<=10;j++)\n {setcolor(i%16);\n line(x,maxy-(j-1)*dy,x,maxy-j*dy);\n delay(10000);\n setcolor(0);\n line(x,maxy-(j-1)*dy,x,maxy-j*dy);\n }\n for(k=6000;k>=3000;k-=100)\n {sound(k);delay(20000);}\n nosound();\n setlinestyle(3,0,2);\n drawellipse(x,maxy-(j-1)*dy);\n }\nreturn;\n}\n\ndrawellipse(int x,int y)\n{int i,j,x1,y1,a,b;\n float q;\n a=60+rand()%60;b=a-rand()%60;\n for(i=2;i>=0;i--)\n {\n for(q=0;q<=2*PI;q+=0.12)\n {setcolor(rand()%16);\n x1=x+(a-i*30)*cos(q);\n y1=y-(b-i*30)*sin(q);\n line(x,y,x1,y1);\n }\n delay(50000);\n setcolor(0);\n for(q=0;q<=2*PI;q+=0.12)\n {x1=x+(a-i*30)*cos(q);\n y1=y-(b-i*30)*sin(q);\n line(x,y,x1,y1);\n }\n }\n return;\n}\n", "lang": "GNU C", "bug_code_uid": "fd31a4d50118a616f2d81de94d02a3ea", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "a879bdd67ffc6bfd1254ab3f76ff154b", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9808102345415778, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nint c[105];\nint main()\n{\n int m,n,i,j;\n scanf(\"%d%d\",&n,&m);int b[m];\n for(i=0;i<=m-1;i++)\n {\n scanf(\"%d\",&b[i]);\n }\n for(i=0;i<=n-1;i++)\n {\n for(j=b[i];j<=n;j++)\n {\n if(c[j]==0)\n {\n c[j]=b[i];\n }\n }\n }\n for(i=0;i<=n;i++)\n {\n if(c[i]>0)\n {\n printf(\"%d \",c[i]);\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "dad2f180622ef692417091a3d8b4ccde", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "d4792021132fcaf36554431e8ca2d74d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5379644588045234, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,i,n,k,ss[110],dd[110];\n while(scanf(\"%d %d\",&a,&b)==2)\n {\n for(i=1;i<=110;i++)\n dd[i]=0;\n for(i=1;i<=b;i++)\n {\n scanf(\"%d\",&ss[i]);\n for(n=ss[i];n<=a;n++)\n {\n if(dd[n]==0) dd[n]=ss[i];\n }\n }\n for(i=1;i<=a;i++)\n {\n printf(\"%d\",dd[i]);\n if(i!=a) printf(\" \");\n else printf(\"\\n\");\n }\n }\n}\n\n\n ", "lang": "GNU C", "bug_code_uid": "6dc29601a15654fd73100b50eaaabcef", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "b2202bf508c8d85a89de95e14850e738", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3665893271461717, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n\tlong n,ans = 4;\n\tscanf(\"%ld\",&n);\n\tfor(int i = 2;i<=n;i++)\n\t{\n\t\tif(i % 2 != 0) ans *= 2;\n\t\telse ans += 4; \n\t}\n\tif(n == 0) puts(\"1\\n\");\n\telse printf(\"%ld\\n\",ans);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "8afe3e90c51e9a9dba85f524d3c7b878", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "20fa56ecb6ce93cf1e4cb6631a2f087d", "difficulty": null, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8732394366197183, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main() {\n\tint n,k;\n\tscanf(\"%d%d\",&n,&k);\n\tint v=(k-1)*n/k;\n\tint result=v;\n\t//printf(\"v=%d\\n\",v);\n\twhile(1){\n\t\tint sum=0;\n\t\tint kk=1;\n\t\twhile(1){\n\t\t\tif(v=n){\n\t\t\tresult=v;\n\t\t\tbreak;\n\t\t}\n\t\tv++;\n\t}\n\tprintf(\"%d\\n\",result);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "8c266976640725f24ecdd329be361ec7", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "d0b2b7cc01bc762187c4038fc2badd52", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16790648246546228, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "#include \nint main()\n{\n char input[101];\n char s[101];\n short i= 0 , j = 1;\n\n fgets(input,100,stdin);\n s[0]='.';\n\n while(input[i])\n {\n if(input[i] != 'a' && input[i] != 'o' && input[i] != 'y'&& input[i] != 'e' && input[i] != 'u'\n && input[i] != 'i' && input[i] != 'A' && input[i] != 'O' && input[i] != 'Y' && input[i] != 'U'&&input[i] != 'I')\n {\n s[j++] = tolower(input[i]);\n s[j++] = '.';\n }\n i++;\n }\n for(i=0 ; i< j-3 ; i++)\n printf(\"%c\",s[i]);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a05b7877438bb0ec9cb1950b93803006", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "bec94fa0d9ffa24d5d650f1257accc6a", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.875, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n\nint main()\n{\n char a[102];\n int i,perl=0,len,link;\n scanf(\"%s\",&a);\n len=strlen(a);\n\n for(i=0;i0 && link%perl==0) printf(\"YES\");\n else\n printf(\"NO\");", "lang": "GNU C11", "bug_code_uid": "e472ef21ce30adc55a9df6c3a0b4819d", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "d9a7228b0180ce3c3721a71fb42fa374", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9927184466019418, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n\nint main() {\n char a[100];\n scanf(\"%s\",a);\n int i=0;\n int b=0;\n int c=0;\n while(a[i]!='\\0')\n {\n if(a[i]=='-')\n b++;\n else\n c++; \n i++; }\n if(c>=0) { \n if(b%c==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n}\nelse\n printf(\"NO\");\n}", "lang": "GNU C11", "bug_code_uid": "073a7cfb16b709346fc69358c7c6f712", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "cd34c26b50415a9f29ae8dc4d6bc4050", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9220023282887078, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "//CodeForces Problem Set 980A\n\n#include\n#include\n#include\n\nint main()\n{\n\tint pearls = 0;\n\tchar necklace[101] = {};\n\tscanf(\"%s\", necklace);\n\tint i = 0;\n\twhile (necklace[i] != '\\0')\n\t{\n\t\tif (necklace[i] == 'o')\n\t\t{\n\t\t\tpearls += 1;\n\t\t}\n\t\ti += 1;\n\t}\n\tint link = strlen(necklace) - pearls;\n\tif (link % pearls == 0)\n\t{\n\t\tprintf(\"YES\");\n\t\treturn 0;\n\t}\n\tprintf(\"NO\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a3f531c9a8dcc0d4c2cbdac88e2b1af7", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "13c1d6a9d53b7cc0fa71a4acbef58718", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9252336448598131, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint main(){\n char str[100] ;\n scanf(\"%s\",str);\n int a = strlen(str) ;\n int q = 0;\n int w = 0 ;\n for(int i=0;i\n#include\nint main() {\nint pcount = 0, lcount = 0;\nchar str[100];\nscanf(\"%s\",str);\nfor (int i = 0; i < strlen(str); i++) {\n\tif(str[i] == 'o')\n\t\tpcount++;\n\telse if(str[i] == '-')\n\t\tlcount++;\n\telse\n\t\tprintf(\"NO\");\n\t}\nif(lcount % 2 == 0 || lcount == 0)\n\tprintf(\"YES\");\nelse if(pcount % 2 == 0 && lcount % 2 == 1)\n\tprintf(\"NO\");\nelse if(pcount % 2 == 1 && lcount % 2 == 0)\n\tprintf(\"NO\");)\n\t}\n", "lang": "GNU C11", "bug_code_uid": "3b933550f3f666836f18da00f139f9df", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "fe2984ee9c2e749d3953dc04cd3911fb", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.25500370644922166, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n#include \n\nint A, min = 0, max = 0;\n\nvoid run(int a)\n{\n int i, remain;\n\n remain = a%7;\n //result = a/7;\n //printf(\"remain %d\\n\", remain);\n //printf(\"result %d\\n\", result);\n\n if (remain==0)\n {\n min = 2*(a/7);\n max = min; return;\n }\n if (remain < 2)\n {\n min = 2*(a/7);\n max = min + 1; return;\n }\n if (remain >= 6)\n {\n min = 1 + 2*((a-1)/7);\n max = 2 + 2*((a-1)/7); return;\n }\n if ((remain >= 2) && (remain < 6))\n {\n min = 2*(a/7);\n max = min + 2; return;\n }\n// min = 2*(a/7)+(remain-5);\n// max = 2*((a-2)/7) + 2;\n// return;\n}\n\nint main()\n{\n scanf(\"%d\", &A);\n run(A);\n printf(\"%d %d\", min, max);\n return 1;\n}\n", "lang": "GNU C", "bug_code_uid": "5a161a09f87596849ebd50f4792e61dc", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "1ea771713c98f8a8c8ce9357f8f3c824", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24779959377115776, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n\nint compare(const void *p, const void *q)\n{\n int x = *(const int *)p;\n int y = *(const int *)q;\n int ret;\n if (x == y)\n ret = 0;\n else\n ret = (x < y) ? 1 : -1;\n\n return ret;\n}\nint main ()\n{\nint loop , inp=0 , max = 0 , maxp = 0 , rep = 0;\nscanf(\"%d\",&inp);\nint arr [inp];\n for (loop = 0 ; loop < inp ; loop ++)\n {\n \t\tscanf (\"%d\",&arr[loop]);\n \t\tif (max == arr[loop])\n \t\t\t{rep ++;continue ;}\n \t\t\tif (max < arr[loop])\n \t\t\t{max = arr[loop] ; maxp = loop; rep = 0;}\n }\n if (maxp == 0 && rep == 0)\n \t{printf (\"0\\n\"); return 0 ;}\nint sort [inp-1];\nfor (loop = 0 ; loop <= inp-1 ; loop++)\n\tsort[loop]=arr[loop+1];\nqsort (sort,inp-1,sizeof (int),compare);\nfor (inp=0;arr[0]<=sort[0];)\n\t\t{\n\t\t\tsort[0]--;arr[0]++ ; inp++;\n\t\t\tqsort (sort,inp-1,sizeof (int),compare);\n\t\t}\nprintf (\"%d\\n\",inp);\nreturn 0 ;\n}\n", "lang": "GNU C", "bug_code_uid": "b1e66e1b8828420dfc28317bdc4aa6bc", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "67baf21c6122c4038643fc72bece5f3b", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8883116883116883, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\nlong long b;\nscanf(\"%lld\",&b);\nlong long c=2;\nif(b==1)\nprintf(\"1\\n\");\nelse\n{\nint i;\nfor(i=2;i*i\nint main()\n{\n int i, b;\n int count=0;\n int flag=0;\n scanf(\"%d\", &b);\n for(i=1; i*i<=b; i++)\n {\n if(b%i==0)\n count++:\n if(i*i==b\n flag=1;\n }\n if(flag==0)\n printf(\"%d\\n\", 2*count);\n else\n printf(\"%d\\n\", 2*count-1);\n}", "lang": "GNU C11", "bug_code_uid": "85d1c50e59b6734425e31fc29edf5c9d", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "047d1997f31fbb8160b7ab2b54c039f7", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9601465872652314, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#define maxn 10\n\ntypedef long long ll;\n\n\nint main()\n{\n char Str[maxn][maxn];\n int i, j, cnt1, cnt2;\n\n cnt1 = cnt2 = 0;\n for( i = 0; i < 8; i ++ )\n for( j = 0; j < 8; j ++ )\n scanf( \"%c\", Str[i][j] );\n\n\n\n for( i = 0; i < 8; i ++ )\n for( j = 0; j < 8; j ++ )\n {\n if( Str[i][j] == 'Q' )\n cnt1 += 9;\n if( Str[i][j] == 'R' )\n cnt1 += 5;\n if( Str[i][j] == 'B' || Str[i][j] == 'K' )\n cnt1 += 3;\n if( Str[i][j] == 'P' )\n cnt1 += 1;\n\n if( Str[i][j] == 'q' )\n cnt2 += 9;\n if( Str[i][j] == 'r' )\n cnt2 += 5;\n if( Str[i][j] == 'b' || Str[i][j] == 'k' )\n cnt2 += 3;\n if( Str[i][j] == 'p' )\n cnt2 += 1;\n }\n\n printf( \"%s\\n\", cnt1 == cnt2 ? \"Draw\" : ( cnt1 < cnt2 ? \"White\" : \" Black\" ) );\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "8498b00236b92666b8d60aa735edeb81", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "88a99e22e86515d80d1a06dab3dc39c0", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9090382387022016, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \n\nbool reversed(char c, char t)\n{\n return (c == 'N' && t == 'S') || (c == 'S' && t == 'N') || (c == 'W' && t == 'E') || (c == 'E' && t == 'W');\n}\n\nchar reverse(char c)\n{\n if (c == 'S')\n return 'N';\n if (c == 'W')\n return 'E';\n if (c == 'N')\n return 'S';\n if (c == 'E')\n return 'W';\n return '\\0';\n}\n\nint main()\n{\n int n;\n assert(scanf(\"%d\", &n) == 1);\n n--;\n char* s = malloc(sizeof(char) * (n + 1));\n char* t = malloc(sizeof(char) * (n + 1));\n assert(scanf(\"%s\", s));\n assert(scanf(\"%s\", t));\n if (reversed(s[n - 1], t[n - 1]))\n printf(\"NO\\n\");\n else\n {\n int i = 0;\n int j = 0;\n int ilast = 0;\n int op = 0;\n while (j < n || i < n)\n {\n op += n - i;\n for (; i < n; i++)\n {\n if (j < n && t[j] == s[i])\n j++;\n else if (j > 0 && reverse(t[j - 1]) == s[i])\n j--;\n }\n if (j == n && i == n)\n {\n printf(\"YES\\n\");\n return 0;\n }\n op += n - j;\n for (; j < n; j++)\n {\n if (i < n && t[j] == s[i])\n i++;\n else if (i > 0 && reverse(s[i - 1]) == t[j])\n i--;\n }\n if (op > 4e8)\n break;\n if (ilast == i)\n break;\n ilast = i;\n }\n if (j == n && i == n)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e6d28587463ee3f81aa002460a3c0881", "src_uid": "85f43628bec7e9b709273c34b894df6b", "apr_id": "1541a530f60928d9ce91d280116703a2", "difficulty": 2500, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8803967327887982, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#include \n\nbool reversed(char c, char t)\n{\n return (c == 'N' && t == 'S') || (c == 'S' && t == 'N') || (c == 'W' && t == 'E') || (c == 'E' && t == 'W');\n}\n\nchar reverse(char c)\n{\n if (c == 'S')\n return 'N';\n if (c == 'W')\n return 'E';\n if (c == 'N')\n return 'S';\n if (c == 'E')\n return 'W';\n return '\\0';\n}\n\nint main()\n{\n int n;\n assert(scanf(\"%d\", &n) == 1);\n n--;\n char* s = malloc(sizeof(char) * (n + 1));\n char* t = malloc(sizeof(char) * (n + 1));\n assert(scanf(\"%s\", s));\n assert(scanf(\"%s\", t));\n if (reversed(s[n - 1], t[n - 1]))\n printf(\"NO\\n\");\n else\n {\n int i = 0;\n int j = 0;\n int ilast = 0;\n int op;\n while (j < n || i < n)\n {\n for (; i < n; i++)\n {\n if (j < n && t[j] == s[i])\n j++;\n else if (j > 0 && reverse(t[j - 1]) == s[i])\n j--;\n }\n if (j == n && i == n)\n {\n printf(\"YES\\n\");\n return 0;\n }\n for (; j < n; j++)\n {\n if (i < n && t[j] == s[i])\n i++;\n else if (i > 0 && reverse(s[i - 1]) == t[j])\n i--;\n }\n op += 2 * n;\n //if (op >= 1e8)\n // break;\n if (ilast == i)\n break;\n ilast = i;\n }\n if (j == n && i == n)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "a6cbe3f881af8e8b9c331af1da9c2bc1", "src_uid": "85f43628bec7e9b709273c34b894df6b", "apr_id": "1541a530f60928d9ce91d280116703a2", "difficulty": 2500, "tags": ["strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9712153518123667, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint b[501];\nvoid merge(int a[], int k,int l);\nvoid merge_sort(int a[], int n);\n\nint main()\n{\n int n,m,k,i,s,flag,a[501];\n scanf(\"%d%d%d\",&n,&m,&k);\n for(i=0;i=m) {flag=1;break;}\n }\n if(k!=0&&flag) printf(\"%d\\n\",i);\n else printf(\"-1\\n\");//getch();\n return 0;\n}\nvoid merge_sort(int a[], int n)\n{\nif(n==1||n==0) return;\nmerge_sort(a, n/2);\nmerge_sort(a+n/2, n-n/2);\nmerge(a,n/2, n-n/2);\n}\n\nvoid merge(int a[], int k,int l)\n{\n int i,j=k,c=0;\nfor(i=0;i=a[j]&&j\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C", "bug_code_uid": "18649ca50bed2123b23b3d3cc52aaad9", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "5b8c96f22f29279d390909a807aea8f7", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9349030470914127, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main()\n{\n char dir;\n int corr = 0;\n char input[101];\n char keyboard[3][10]= {\n 'q','w','e','r','t','y','u','i','o','p',\n 'a','s','d','f','g','h','j','k','l',';',\n 'z','x','c','v','b','n','m',',','.','/'\n };\n scanf(\"%c\", &dir);\n\n if(dir == 'L'){\n corr = -1;\n }else if(dir == 'R'){\n corr = 1;\n }\n\n scanf(\"%s\", input);\n\n for(int i=0; i\nint main(){\n{\n int i,j;\n char s,c[1000],ch[]={'q','w','e','r','t','y','u','i','o','p','[',']','a','s','d','g','h',\n 'j','k','l',';','z','x','c','v','b','n','m',',','/','`','1','2','3','4','5',\n '5','6','7','8','9',',','-','='};\n\n scanf(\"%c\",&s);\n getchar();\n for(i=0;;i++)\n {\n scanf(\"%c\",&c[i]);\n if(s=='R')\n {\n for(j=0;j<44;j++)\n {\n if(c[i]==ch[j])\n printf(\"%c\",ch[j-1]);\n }\n }\n if(s=='L')\n {\n for(j=0;j<44;j++)\n {\n if(c[i]==ch[j])\n printf(\"%c\",ch[j+1]);\n }\n }\n\n }\n return 0;\n}}\n", "lang": "GNU C", "bug_code_uid": "32742af5103e400ff1747bd07866d9d8", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "49e6421102232446f95bddda06d7548f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7872832369942196, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\n#include\nint result(int n)\n{\n int t=0;\n while(n)\n {\n if((n%10!=0)&&(n%10!=1))\n t++;\n n=n/10;\n }\n if(t)\n return 0;\n return 1;\n}\nint cmpfunc(const void*a,const void*b)\n{\n return (*(int*)a - *(int*)b);\n}\nint main()\n{\n int n,m,i,j,sum=1,chk=0,k=0,c=0,max=0,min=0,d=0;\n int a[2000005]={0},b[5]={0};\n char ch[101];\n scanf(\"%s\",ch);\n d=strlen(ch);\n k=d-1;\n while(k--)\n {\n sum*=2\n }\n sum--;\n n=atoi(ch);\n d--;\n m=1;\n while(d--)\n {\n m=m*10;\n }\n //printf(\"%d\\n\",m);\n for(i=m;i<=(m*2);i++)\n {\n c=result(i);\n sum+=c;\n if(i>n)\n break;\n //printf(\"%d\\n\",c);\n }\n printf(\"%d\",sum);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "92585253a92b60badb4ba260168d8f4b", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "73233c3b7f5df0b97f450da6f3af1a35", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.26700251889168763, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,i,x,count=0,flag=0;\n int a[LEN];\n char ch;\n\n scanf(\"%d\",&n);\n\n\n for(i=1;i<=n;i++)\n {\n x=i;\n int numlen=0;\n flag=0;\n while(x!=0)\n {\n numlen++;\n if(x%10==0 || x%10==1)\n {\n flag++;\n }\n x/=10;\n\n }\n if(flag==numlen)\n {\n count++;\n }\n }\n printf(\"%d\",count);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "59b1a942f562608ff570c06af83e1c38", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "35a5e174d75b86133ef9e020946ad81d", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.21129032258064517, "equal_cnt": 17, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "#include \n\nint main(){\n\tchar chess[8][8];\n\tint i,j, nr=0, count=0;\n\tfor(i=0;i<8;i++){\n\t\tfor(j=0;j<8;j++){\n\t\t\tscanf(\"%c\", &chess[i][j]);\n\t\t}\n\t}\n\tint init = 0, jnit = 0;\n\t\n\t\tfor(i=0;i<8;i++){\n\t\tfor(j=0;j<8;j++){\n\t\t\tif(chess[i][j]=='B'){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tif(count==57){\n\t\tprintf(\"8\");\n\t\treturn;\n\t}\n\t\n\t\n\tfor(i=init;i<8;i++){\n\t\tfor(j=jnit;j<8;j++){\n\t\t\tif(chess[i][j]=='B'){\n\t\t\t\tif(chess[i][j+1]=='B'){\n\t\t\t\t\tnr++;\n\t\t\t\t\ti++;\n\t\t\t\t\tinit++;\n\t\t\t\t}\n\t\t\t\telse if(chess[i+1][j]=='B'){\n\t\t\t\t\tnr++;\n\t\t\t\t\tj++;\n\t\t\t\t\tjnit++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", nr);\n\t\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6881985b93dff348e082118f24cef6af", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "89ae5cbe41529022c2aabf7499b12645", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7897664071190211, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "/* \n * File: Helpfullmaths.c\n * Author: Wissem\n *\n * Created on 19 novembre 2017, 15:41\n */\n\n#include \n#include \n#include \n#include \n\n/*\n * \n */\nint main() {\n char s[101],aux;\n scanf(\"%s\",&s);\n for (int i=0;s!='\\0';i=i+2)\n for (int j=i+2;s!='\\0';j=j+2)\n \n if (s[i]>s[j]){aux=s[i];\n s[i]=s[j];\n s[j]=aux;}\n \n \n printf(\"%s\",s);\n \n\n \n}\n\n", "lang": "GNU C", "bug_code_uid": "55f3bb4b520d05d98dfb48a68ea54d37", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "e57e51f23072a68a83dfb610fe4ea5ab", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6906976744186046, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n\nint calc(long int a,long int b,long int c){\n if(c==0)\n return 1;\n if(c<0)\n return 0;\n return (calc(a,b,c-a)||calc(a,b,c-b));\n}\nint main(){\n long int a,b,c;\n int res;\n scanf(\"%ld%ld%ld\",&a,&b,&c);\n res=calc(a,b,c);\n if(res==1)\n printf(\"Yes\");\n else\n printf(\"No\");\n}", "lang": "GNU C", "bug_code_uid": "785d818aee3da9b31c1dac3a77cd375a", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "1ab4168865544e88eb05abec22a14d30", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8783068783068783, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 17, "bug_source_code": "#include\nint main(void)\n{\n long int a1,b1,a2,b2,a3,b3;\n scanf(\"%ld %ld %ld %ld %ld %ld\",a1,b1,a2,b2,a3,b3);\n if(a2+a3==a1)\n {\n if(b2<=b1&&b3<=b1)\n cond=0;\n }\n if(a2+a3==b1)\n if(b2<=a1&&b3<=a1)\n cond=0;\n if(a3+b2==a1)\n if(b3<=b1 && a2<=b1)\n cond=0;\n if(a3+b2==b1)\n if(b3<=a1 && a2<=a1)\n cond=0;\n if(b3+a2==a1)\n if(a3<=b1 && b2<=b1)\n cond=0;\n if(b3+a2==b1)\n if(a3<=a1 && b2<=a1)\n cond=0;\n if(b3+b2==a1)\n if(a3<=b1 && a2<=b1)\n cond=0;\n if(b3+b2==b1)\n if(a3<=a1&& a2<=a1)\n cond=0;\n if(!cond)\n printf(\"YES\");\n else \n printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "56f1a5bc268383daf014ea870ba24f4c", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "098f45e92a0c07203f53dbd1be49487f", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8834759710335747, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "#include\nint main(void)\n{\n long int a1,b1,a2,b2,a3,b3,cond=1;\n scanf(\"%ld %ld %ld %ld %ld %ld\",a1,b1,a2,b2,a3,b3);\n if(a2+a3==a1)\n {\n if(b2<=b1&&b3<=b1)\n cond=0;\n }\n if(a2+a3==b1)\n if(b2<=a1&&b3<=a1)\n cond=0;\n if(a3+b2==a1)\n if(b3<=b1 && a2<=b1)\n cond=0;\n if(a3+b2==b1)\n if(b3<=a1 && a2<=a1)\n cond=0;\n if(b3+a2==a1)\n if(a3<=b1 && b2<=b1)\n cond=0;\n if(b3+a2==b1)\n if(a3<=a1 && b2<=a1)\n cond=0;\n if(b3+b2==a1)\n if(a3<=b1 && a2<=b1)\n cond=0;\n if(b3+b2==b1)\n if(a3<=a1&& a2<=a1)\n cond=0;\n if(!cond)\n printf(\"YES\");\n else \n printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "4ee9811e554d2b919cdb4b7f083eaf0c", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "098f45e92a0c07203f53dbd1be49487f", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9994794377928162, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": ".#include\n#include\n\n\nint main()\n{\n int a1,a2,a3,b1,b2,b3;\n int p,q,r,s;\n scanf(\"%d %d %d %d %d %d\",&a1,&b1,&a2,&b2,&a3,&b3);\n p=a2+a3;\n if(p<=a1)\n {\n if(b2<=b1 && b3<=b1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n if(p<=b1)\n {\n if(b2<=a1 && b3<=a1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n\n p=a2+b3;\n if(p<=a1)\n {\n if(b2<=b1 && a3<=b1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n if(p<=b1)\n {\n if(b2<=a1 && a3<=a1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n\n p=b2+a3;\n if(p<=a1)\n {\n if(a2<=b1 && b3<=b1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n if(p<=b1)\n {\n if(a2<=a1 && b3<=a1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n\n p=b2+b3;\n if(p<=a1)\n {\n if(a2<=b1 && a3<=b1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n if(p<=b1)\n {\n if(a2<=a1 && a3<=a1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n\n\n printf(\"NO\\n\");\n return 0;\n }\n ", "lang": "GNU C", "bug_code_uid": "e6f96e43010281c44b3f145fde8c12e1", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "719c3fd8a79fe495b65bc61d47346f21", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4530120481927711, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main(){\n int n,s,i;\n int k=0;\n int a=0;\n scanf(\"%d%d\",&n,&s);\n for(i=0;i<=s;i--){\n if(k\n#include \n#include \n\n#define NB_PARAMS 2\n\nint main ()\n{\n int params[NB_PARAMS];\n\n for (size_t i = 0; i < NB_PARAMS; ++i)\n {\n scanf(\"%d\", &(params[i]));\n while(fgetc(stdin) != '\\n');\n }\n\n printf(\"%d\", (int)ceil((double)params[1] / params[0]));\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "feb22ec7f66fec1e156adac51acc8e6c", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "4bee5e5ca39ce82c8f9e4e3b39eccce3", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9455938697318008, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include \nint segCalc(int number){\n\tif(number==4){\n\t\treturn 4;\n\t}else if (number==1){\n\t\treturn 2;\n\t}else if (number==2||number==5||number==3){\n\t\treturn 5;\n\t}else if (number==6||number==0){\n\t\treturn 6;\n\t}else if (number==7){\n\t\treturn 3;\n\t}else if (number==8){\n\t\treturn 8;\n\t}else if (number==9){\n\t\treturn 7;\n\t}\n\t\n\t\n}\nlong findSeg(long i){\n\tlong seg;\n\tint temp;\n\tif(i/10==0){\n\t\tseg= segCalc(i);\n\t\treturn seg;\n\t}\n\telse{\n\t\ttemp=i%10;\n\t\tseg=segCalc(temp);\n\t\t\n\t\treturn seg+findSeg(i/10);\n\t}\n\t\n}\nint main() {\n\t// your code goes here\n\tlong a,b,sum=0,i;\n\t\n\tscanf(\"%ld %ld\",&a,&b);\n\tfor(i=a;i<=b;i++){\n\t\t\n\tsum+=\tfindSeg(i);\t\n\t\n\t}\n\tprintf(\"%ld\",sum);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "bef9bd145284c926c5a1a7e427c83a88", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "b610dc64797f465e0af901d39454d8cd", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7676113360323886, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint n;\nint max1;\nint max2;\nvoid max(int x[]){\n int max,i,maxi;\n max2=-1;\n max=0;\n for(i=0;imax){\n max=x[i];\n max1=i;\n }\n }\n maxi=max;\n max=0;\n for(i=0;imax&&x[i]\nint main()\n{\n int m,n;\n while(scanf(\"%d %d\",&m,&n)) {\n printf(\"%d\\n\", (m*n) / 2);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "22e5eb737a7b9a28dd5ce489a95caffd", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "857b7184f1487bb80cef2ef8adb220a9", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9467680608365019, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main() {\n\tint k;\n\tscanf(\"%d\", &k);\n\tchar bus[4][1000]={\"|#.#.#.#.#.#.#.#.#.#.#.|D|)\"\n\t\t\t\t\t , \"|#.#.#.#.#.#.#.#.#.#.#.|.|\"\n\t\t\t\t\t , \"|#.......................|\"\n\t\t\t\t\t , \"|#.#.#.#.#.#.#.#.#.#.#.|.|)\"};\n\tprintf(\"+------------------------+\\n\");\n\tint idx=1, c=0;\n\tfor (int i=0;;i++) {\n\t\tif (bus[i%4][idx]=='#') {\n\t\t\tbus[i%4][idx]='O';\n\t\t\tc++;\n\t\t}\n\t\tif (c==k) {\n\t\t\tbreak;\n\t\t}\n\t\tif ((i+1)%4==0) {\n\t\t\tidx+=2;\n\t\t}\n\t}\n\tfor (int i=0;i<4;i++) {\n\t\tprintf(\"%s\\n\", bus[i]);\n\t}\n\tprintf(\"+------------------------+\");\n}\n", "lang": "GNU C11", "bug_code_uid": "a6660acc3769762cfe1dac8bc4bf1ee3", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "3ae8c176504126cd3366182d6c354758", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8509406657018813, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "// Cola\n\n#include \n#include \n\n#define ll long long\n\nint count[20000];\n\nvoid deal(int n, int a, int b, int c)\n{\n int i, j;\n ll ans = 0;\n memset(count, 0, sizeof(count));\n for (i = 0; i <= b; i++)\n {\n for (j = 0; j <= c; j++)\n {\n count[i + 2 * j]++;\n }\n }\n for (i = 0; i <= a; i += 2)\n {\n ans += count[n - i / 2];\n }\n printf(\"%lld\\n\", ans);\n}\n\nint main(int argc, char **argv)\n{\n int a, b, c, n;\n while (scanf(\"%d%d%d%d\", &n, &a, &b, &c) == 4)\n {\n deal(n, a, b, c);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "3002e069e1dd64178f7f19a853218add", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "0acc737bd2831b4eaf9881113c189af5", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6809728183118741, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n{\n\tint n,p,q,r,b,c,s=0,a,i,j,k;\n\tdouble u,m,w,l,t;\n\tscanf(\"%d %d %d %d\",&n,&p,&q,&r);\n\tfor (i=0;i<=p;i++){\n\t\tfor (j=0;j<=q;j++){\n\t\t\tfor (k=0;k<=r;k++){\n\t\t\t\tm=(0.5*i)+j+(k*2.0);\n\t\t\t\tif (m==n){\n\t\t\t\t\ts=s+1;\n\t\t\t\t}\n\t\t\t\telse if (m>n){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\",s);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "10811b10e416c518df350ff5f0f8931e", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "84aa9d2ea4e1f9f8e527c8680e058e0a", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8869309838472834, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint main()\n{\n\tint n,p,q,r,b,c,s=0,a,i,j,k;\n\tdouble u,m,w,l,t;\n\tscanf(\"%d %d %d %d\",&n,&p,&q,&r);\n\tfor (i=0;i<=p;i++){\n\t\tfor (j=0;j<=q;j++){\n\t\t\tm=0.5*i+j;\n\t\t\tt=n-m;\n\t\t\ta=(int)t;\n\t\t\tif (t-a==0){\n\t\t\t\tif (a%2==0 && (a/2)<=r){\n\t\t\t\t\ts=s+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\",s);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "84607c90cf68502d1d338df5e35366a1", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "84aa9d2ea4e1f9f8e527c8680e058e0a", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7958115183246073, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n\n{\n int n,a,b,c,i,count=0,j,k;\n scanf(\"%d%d%d%d\",&n,&a,&b,&c);\n for(i=c;i>=0;i--)\n {\n if(2*i==n){count++;\n continue;\n }\n for(j=b;j>=0;j--)\n {\n if(2*i+j==n)\n {\n count++;\n continue;\n }\n for(k=0;k<=a;k+=2)\n {\n if(2*i+j+(k/2)==n)count++;\n }\n }\n\n }printf(\"%d\",count);\n}\n", "lang": "GNU C", "bug_code_uid": "62e20c058e8e8ef75f4ed5f67bc83588", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "f101ff17e97426a41d16f1b28b1bd683", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8780487804878049, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n\n{\n int n,a,b,c,i,count=0,j,k;\n scanf(\"%d%d%d%d\",&n,&a,&b,&c);\n if(2*c>n)c=n/2;\n if(b>n)b=n;\n if(c/2>n)c=2*n;\n for(i=c;i>=0;i--)\n {\n if(2*i==n){count++;\n continue;\n }\n for(j=b;j>=0;j--)\n {\n if(2*i+j==n)\n {\n count++;\n continue;\n }\n for(k=0;k<=a;k+=2)\n {\n if(2*i+j+(k/2)==n)count++;\n }\n }\n\n }printf(\"%d\",count);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f8aa24b4734565b95fcbdd285ccc9d73", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "f101ff17e97426a41d16f1b28b1bd683", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.01608187134502924, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C", "bug_code_uid": "efb88a2e94b171d86b7f1f1f9dd8588f", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "e6ef3bdcca717ea0d646b15439b548e9", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24973089343379978, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nvoid Check(int a,int b,int c)\n{\n if((a==2 && b==2) || (a==2 && c==2) || (b==2 && c==2))\n printf(\"Yes\");\n if((a==2 && b==4 && c==4) || (a==4 && b==2 && c==4) || ((a==4 && b==4 && c==2)))\n printf(\"Yes\");\n if(a==3 && b==3 && c==3)\n printf(\"YES\");\n elseprintf(\"NO\");\n\n\n}\n\n\n\n\nint main()\n{\nint a,b,c;\nscanf(\"%d %d %d\",&a,&b,&c);\nCheck(a,b,c);\n\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "c189c8abcb267f3b6f612a535291cf29", "src_uid": "df48af9f5e68cb6efc1214f7138accf9", "apr_id": "41c70aecedcc49429050db4fa8bdd198", "difficulty": 1400, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7935533384497314, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main(int argc, char const *argv[]) {\n scanf(\"%d %d %d\\n\",&n,&m,&v);\n if (n==1 || m==1 || v==1) {\n printf(\"YES\\n\");\n return 0;\n /* code */\n }\n if (n==2 && m==2) {\n printf(\"YES\\n\");\n return 0;\n /* code */\n }\n if (m==2 && v==2) {\n printf(\"YES\\n\");\n return 0;\n /* code */\n }\n if (v==2 && n==2) {\n printf(\"YES\\n\");\n return 0;\n /* code */\n }\n if (m==3 && n==3 && v==3) {\n printf(\"YES\\n\");\n return 0;\n /* code */\n }\n printf(\"NO\\n\" );\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "306bfae5611de86f5eb8ebab452c4058", "src_uid": "df48af9f5e68cb6efc1214f7138accf9", "apr_id": "1bcb514c82abaff4ae7162b9c6b2d0ce", "difficulty": 1400, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9911504424778761, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{\n\tint i;\n\tchar c;\n\tchar s[200];\n\n\tscanf(\"%s\",s);\n\n\ti = 1;\n\tif (strlen(s)<3) { printf(\"No\\n\"); return 0; }\n\n\tc = 0;\n\n\twhile (s[i+1])\n\t{\n\t\tif (s[i-1]=='.' || s[i]=='.' || s[i+1]=='.')\n\t\t{\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (s[i-1]!=s[i] && s[i]!=s[i+1] && s[i-1]!=s[i+1])\n\t\t{\n\t\t\tprintf(\"Yes\\n\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tprintf(\"No\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2a70cd46467c2a82957e5456a52527f9", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "b3c280e8ff7783973d6cd20b6256a1bd", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9990108803165183, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n\nint main()\n{\n int i,ln,ck=0;\n char s[101];\n scanf(\"%s\",s);\n ln=strlen(s);\n\n for(i=0; i\n#include\nint main()\n{\n\tchar A[101];\n\tscanf(\"%s\",A);\n\tint len=strlen(A);\n\tint falg=0;\n\tfor(int i=0;i\n\nint main(int argc, char **argv)\n{\n\tint l,b,i,k;\n\tscanf(\"%d\"\"%d\"\"%d\",&l,&b,&k);\n\tfor(i=b/2;i=1;i=i-2){\n\tk=((l*2)+(b-2)*2);\n\tl=l-2;\n\tb=b-2;}\n\tprintf(\"%d\",k);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b892a9a7b97ffa4446075e6d36677f57", "src_uid": "2c98d59917337cb321d76f72a1b3c057", "apr_id": "a6264330762d494efa5b71e71cb39877", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4759825327510917, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main(){\nint n,k,t,i,x=0 ,j;\nscanf(\"%d%d%d\",&n,&k,&t);\nif(k==1) printf(\"1\");\nelse{\nfor(i=1;ik && i<=n) x=k;\n else\n x--;\nif(i==t) break;\n}\nprintf(\"%d\",x);\n}\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "8b4d2ca81b5a1706dffcedf502aa4ad8", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "6ed92a862d80db9d42e5e6da8d715738", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998330550918197, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(){\n\n long long int n,k,t,d=0,f=0,i,m=0;\n scanf(\"%lld %lld %lld\",&n,&k,&t);\n if(k>=t){\n printf(\"%lld\",t);\n }\n else if(n<=t&&t\nint main(void)\n{\n\tint n,M,i,k,j,ex,x,s=0;\n\tscanf(\"%d %d\",&n,&M);\n\tint a[n],b[n],ans[n];\n\tfor(i=0;ib[j])\n\t\t{\n\t\tx=b[i];\n\t\tb[i]=b[j];\n\t\tb[j]=x;\t\n\t\t}\n\t\t}\n\t}\nfor(i=0;iM)\n\t {\n\t k=s;\n\t j=i;\n\t for(ex=n-1;ex>=0,k>M;ex--)\n\t {k-=b[ex];\t\n\t ans[i]++;\n\t }\t\n\t }\nelse continue;\t\n\t}\n\tfor(i=0;i\n#include \n\nint bsearch(int v, int *a, int h)\n{\n int p, l = 0;\n\n while (l < h) {\n p = (l + h) / 2;\n\n // printf(\"%d : %d : %d [%d]\\n\", l, p, h, a[p]);\n if (a[p] < v)\n l = p + 1;\n else\n h = p;\n\n // printf(\"%d %d [%d]\\n\", l, h, a[p]);\n }\n\n return l;\n}\n\n#define max(a,b) (a>b?a:b)\nint main() {\n int n, M;\n int *m_sum;\n\n // printf(\"x\\n\");\n // int x[] = {2,4,4,10};\n // printf(\"%d\\n\", bsearch(4,x,3));\n // printf(\"%d\\n\", bsearch(2,x,3));\n // printf(\"%d\\n\", bsearch(1,x,3));\n // return 0;\n\n scanf(\"%d %d\", &n, &M);\n m_sum = (int*)malloc(sizeof(int) * n + 1);\n m_sum[0] = 0;\n m_sum++;\n\n int t = 0;\n for (int i=0; i M)\n k = bsearch(t - M, m_sum, i) + 1;\n\n printf(\"%d \", k);\n\n for (int j = i; j >= 0; j--)\n m_sum[j] = max(m_sum[j], m_sum[j - 1] + v);\n }\n printf(\"\\n\");\n}\n\n\n", "lang": "GNU C11", "bug_code_uid": "fe9ae6dbca38aa5a19ba4d0845eee8c1", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "apr_id": "80627b04c406174245f2ab6531f1d3b2", "difficulty": 1200, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8192032686414709, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint main(){\n\tint a, b, i, j, end, first, numbers[100], f = 1;\n\tscanf(\"%d %d\", &a, &b);\n\tend = b;\n\tfirst = a;\n\tfor(i = 0; b > a; i++){\n\t\tif (b % 10 == 1){\n\t\t\tb /= 10;\n\t\t\tnumbers[i] = b;\n\t\t} else{\n\t\t\tif (b % 2 == 0){\n\t\t\t\tb /= 2;\n\t\t\t\tnumbers[i] = b;\n\t\t\t} else\n\t\t\t\tf = 0;\n\t\t}\n\t}\n\tif (b != first)\n\t\tf = 0;\n\tif (f){\n\t\tprintf(\"YES\\n\");\n\t\tprintf(\"%d\\n\", i + 1);\n\t\tfor(j = i - 1; j >= 0; j--)\n\t\t\tprintf(\"%d \", numbers[j]);\n\t\tprintf(\"%d\", end);\n\t} else\n\t\tprintf(\"NO\");\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "c627fa7e6b372c4752bb9ee562eb1811", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "bdaaeb76132de67576c06ad13ee668d7", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.40336134453781514, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main()\n{\n int b1,b2,m1,m2,i;\n\n scanf(\"%d %d %d %d\",&b1,&b2,&m1,&m2);\n if(m1<=b1&&m2<=b2)\n {\n if(m1==m2&&b2>b1)printf(\"Second\");\n else if(m1==m2&&b1>b2)printf(\"First\");\n else if(m1==m2&&b1==b2)exit(1);\n else if(m1>m2&&b1>=b2)printf(\"First\");\n else if(m1>m2&&b2-m2>=b1-m1)printf(\"Second\");\n else if(m2>m1&&b2>=b1)printf(\"Second\");\n else if(m2>m1&&b1-m1>=b2-m2)printf(\"First\");\n else exit(1);\n }\n else\n {\n if(m1-b1>m2-b2&&m1==m2)printf(\"Second\");\n else if(m1-b1m2-b2)printf(\"First\");\n else if(m1-b1\n\nint main(){\n int n,k,r,g,b;\n\n while(scanf(\"%d %d\",&n,&k)){\n r=n*2;\n g=n*5;\n b=n*8;\n if(r%k==0){\n r=r/k;\n }\n else{\n r=(r/k)+1;\n }\n\n if(g%k==0){\n g=g/k;\n }\n else{\n g=(g/k)+1;\n }\n\n if(b%k==0){\n b=b/k;\n }\n else{\n b=(b/k)+1;\n }\n printf(\"%d\\n\",r+g+b);\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e90724a3fd7e17ab0b8d4338a6155b97", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "a7051f56675606d6d4c0e22452f90edf", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4147665580890337, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include int main(){\tint n;\twhile(scanf(\"%d\",&n)==1)\t{\t\tif(n%2==0)\t\t{\t\t\tif((n/2)%2==0)\t\t\t{\t\t\t\tprintf(\"%d %d\\n\",n/2-1,n/2+1);\t\t\t}\t\t\telse\t\t\t{\t\t\t\tprintf(\"%d %d\\n\",n/2-2,n/2+2);\t\t\t}\t\t}\t\telse\t\t{\t\t\tprintf(\"%d %d\\n\",n/2,n/2+1);\t\t}\t}\treturn 0;#include int main(){\tint n;\twhile(scanf(\"%d\",&n)==1)\t{\t\tif(n%2==0)\t\t{\t\t\tif((n/2)%2==0)\t\t\t{\t\t\t\tprintf(\"%d %d\\n\",n/2-1,n/2+1);\t\t\t}\t\t\telse\t\t\t{\t\t\t\tprintf(\"%d %d\\n\",n/2-2,n/2+2);\t\t\t}\t\t}\t\telse\t\t{\t\t\tprintf(\"%d %d\\n\",n/2,n/2+1);\t\t}\t}\treturn 0;}#include int main(){\tint n;\twhile(scanf(\"%d\",&n)==1)\t{\t\tif(n%2==0)\t\t{\t\t\tif((n/2)%2==0)\t\t\t{\t\t\t\tprintf(\"%d %d\\n\",n/2-1,n/2+1);\t\t\t}\t\t\telse\t\t\t{\t\t\t\tprintf(\"%d ", "lang": "GNU C", "bug_code_uid": "c3c3b0a5c50a15b2df6779f863735181", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "75edd88c4f2ec5308e7a62dc6591a4ee", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9301121656600517, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n\nint main()\n{\n\n int n,q,e,x,y,i,r,j,w,a;\n 1<=n<=100000000;\n 1<=i<=100000000;\n 1<=j<=100000000;\n\n scanf(\"%d%d%d\",&n,&i,&j);\n a=n+i+j;\n w=2*n+2*i;\n x=2*j+2*n;\n y=2*j+2*i;\n q=n*n;\n e=i*i;\n r=j*j;\n while(q>=(e+r) || e>=(q+r) || r>=(e+q)) {\n if(a<=w&&a<=x&&a<=y) {\n printf(\"%d\",a);\n break;\n }\n else if(w<=a&&w<=x&&w<=y) {\n printf(\"%d\",w);\n break;\n }\n else if(x<=a&&x<=w&&x<=y) {\n printf(\"%d\",x);\n }\n else if(y<=a&&y<=x&&y<=w) {\n printf(\"%d\",y);\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "bc0a4827720ddba7d43f8db404f6ba6a", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "ad5c674f216ca21521b1f0c56e5694b8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6474358974358975, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \nint main() {\n int n ,m ,k ,c ,alm;\n while( scanf(\"%d%d%d\",&n,&m,&k)!=EOF ){\n c = 1;\n alm = 1;\n m -= n; \n while( m>0 ){\n if( k+alm <= n )c++;\n if( k-alm > 0 )c++;\n m -= c;\n alm++;\n }\n printf(\"%d\\n\", alm);\n } \n}", "lang": "GNU C11", "bug_code_uid": "ef340d529658a2c9284c857e756a827d", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "f4b37e951823f6b082314b92e702b836", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9891107078039928, "equal_cnt": 11, "replace_cnt": 1, "delete_cnt": 9, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nvoid caballo (int m[][9], int f, int c)\n{\n/*8 mov tiene el caballo*/\n\n /*derecha 1 cuadro*/\n if(c+2<9 && f-1>0)/*9 final del tablero, arriba derecha columna+2*/\n {\n m[f-1][c+2]=1;\n\n }\n if(c+1<9 && f-2>0)/*9 final del tablero, arriba derecha columna+1*/\n {\n m[f-2][c+1]=1;\n }\n\n /*abajo derecha*/\n if(c+1<9 && f+2<9)/*9 final del tablero, arriba derecha colu+1*/\n {\n m[f+2][c+1]=1;\n }\n if(c+2<9 && f+1<9)/*9 final del tablero, arriba derecha colu+2*/\n {\n m[f+1][c+2]=1;\n }\n\n\n /*izquierda arriba*/\n if(c-1>0 && f-2>0)/* arriba del tablero, arriba izquierda fi-2*/\n {\n m[f-2][c-1]=1;\n }\n if(c-2>0 && f-1>0)/*arriba del tablero, arriba derecha fi-1*/\n {\n m[f-1][c-2]=1;\n }\n\n /*izquierda abajo*/\n if(c-1>0 && f+2<9)/*9 final del tablero, arriba derecha fi+2*/\n {\n m[f+2][c-1]=1;\n }\n if(c-2>0 && f+1<9)/*9 final del tablero, arriba derecha co+1*/\n {\n m[f+1][c-2]=1;\n }\n /*fin funcion*/\n\n}\n\nvoid torre (int m[][9], int f,int c)\n{\n int aux;\n\n /*fila torre llenar de 1s*/\n for(aux=1; aux<=8; aux++)\n {\n m[f][aux]=1;\n }\n\n /*fila torre llenar de 1s*/\n for(aux=1; aux<=8; aux++)\n {\n m[aux][c]=1;\n }\n\n}\n\nvoid inici (int m[][9])\n{\n int i,j;\n /*imprimir matriz*/\n for(i=1; i<9; i++){\n for(j=1; j<9; j++)\n m[i][j]=0;\n\n }\n}\n\nvoid resultado(int m[][9])\n{\n int i,j,con=0;\n /*imprimir matriz*/\n for(i=1; i<9; i++){\n for(j=1; j<9; j++)\n if(m[i][j]==0)\n con++;\n }\n\n printf(\"%d\",con);\n}\n\n\nmain()\n{\n\nint ma[9][9]={0};\nint i,j,i2;\nchar c;\n\n\n\n/*primera linea entra torre*/\nscanf(\"%c %d\",&c,&i);\nj=(int)c-'a';\nj++; /*se pasa la letra a numero +1*/\ni=9-i;/*posicion de fila invertida*/\n\ninici(ma);\nma[i][j]=1;/*primera linea*/\n\n/*se colocan 1s para la posicion del caballo y torre*/\ncaballo (ma,i,j);\ntorre (ma,i,j);\n\n/*segunda linea*/\nscanf(\"%1s %d\",&c,&i2); /*guarda un solo caracter en la variable*/\n\nj=(int)c-'a';\nj++; /*se pasa la letra a numero +1*/\ni2=9-i2;/*posicion de fila invertida*/\nma[i2][j]=1;/*primera linea*/\n\n/*se colocan 1s para la posicion del caballo y torre*/\ncaballo (ma,i2,j);\n\n\nresultado(ma);\n\n return 1;\n}\n\n", "lang": "GNU C", "bug_code_uid": "ca215aafb383a7d58848ba93ae28f3b6", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "a1174c5cd16b05a76d6f6e5ae159f0d4", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9985294117647059, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nchar piece[4];\n\nint rx, ry, kx, ky;\n\nint abs(int a){ return a < 0 ? -a : a; }\n\nint ok(int x, int y){\n int dx = abs(x - kx), dy = abs(y - ky);\n if(abs(dx - dy) == 1 && dx + dy == 3) return 0;\n dx = abs(x - rx), dy = abs(y - ry);\n if(abs(dx - dy) == 1 && dx + dy == 3) return 0;\n return x != rx && y != ry && (x != kx || y != ky);\n}\n\nint main(){\n int ans = 0, i, j;\n scanf(\"%s\", piece); rx = piece[0] - 'a', ry = piece[1] - '1';\n scanf(\"%s\", piece); kx = piece[0] - 'a', ky = piece[1] - '1';\n for( i = 0; i < 8; ++i){\n for( j = 0; i < 8; ++j){\n ans += ok(i,j);\n }\n }\n printf(\"%d\\n\", ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "3162beb3cf711d34908bd7dc960ca4f1", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "13ee3c32b162b3601dfda67a5483546a", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9851632047477745, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int a,b,n,r;\n while(scanf(\"%d\",&n))\n {\n a=n-1;\n r=(n*n)+(a*a);\n printf(\"%d\\n\",r);\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "3c7752b6a4e5103eb1c564c7a50ccb0f", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "8f8dfdab1fa068b11ac13e42a2248895", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.838150289017341, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint main()\n{\n while(1)\n {\n int n,m;\n scanf(\"%d\",&n);\n\n m= (2*n*n)+1-(2*n);\n printf(\"%d\\n\", m);\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "81b943bf930d9b7aac913e6dc3885d9d", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "d97ba3a9047b68e5662d7323ed72b755", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9900709219858156, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/* practice with Dukkha */\n#include \n\nint main() {\n\tint n, e, o;\n\n\tscanf(\"%d\", &n);\n\tif (n <= 5) {\n\t\tprintf(n == 3 ? \"0\\n\" : \"1\\n\");\n\t\treturn 0;\n\t}\n\te = 4, o = 5;\n\tif (e < n && o < n) {\n\t\tint o_ = e + e + 1;\n\t\tint e_ = e + o + 1;\n\n\t\te = e_, o = o_;\n\t\tif (e == n || o == n) {\n\t\t\tprintf(\"1\\n\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\tprintf(\"0\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "716c62a009baa57d75fed176a63ee6b4", "src_uid": "821409c1b9bdcd18c4dcf35dc5116501", "apr_id": "00e17fcc08a7763de5d26f55f02b7489", "difficulty": 2400, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6612903225806451, "equal_cnt": 25, "replace_cnt": 11, "delete_cnt": 7, "insert_cnt": 7, "fix_ops_cnt": 25, "bug_source_code": "#include\n\n#define MOD 998244353\nint fact[1000006], wpar[1000006<<1], n, level;\n\nint mul(int a, int b){\n return (a*1ll*b)%MOD;\n}\n\nint powmod(int p, int b){\n int t = 1;\n while(p){\n if(p&1)t = mul(t, b);\n b = mul(b, b);\n p>>=1;\n }\n return t;\n}\n\nint ncr(int n, int r){\n return mul(mul(fact[n], powmod(fact[r], MOD - 2)), powmod(fact[n - r], MOD - 2));\n}\n\nvoid dfs(int x, int bits){\n if(bits > level) return;\n int l, r;\n l = x<<1;\n r = l|1;\n if(x&1){\n // x is a right child\n wpar[l] = 1;\n wpar[r] = 1^wpar[x]^wpar[l];\n } else {\n // x is a left child\n wpar[r] = 0;\n wpar[l] = 1^wpar[x]^wpar[r];\n }\n dfs(l, bits + 1);\n dfs(r, bits + 1);\n}\n\nint getpossib(int lparity){\n int i, rem, choice;\n wpar[2] = lparity;\n wpar[3] = wpar[1]^wpar[2];\n dfs(2, 2);dfs(3, 2);\n \n rem = n - (1<>1) > choice) return 0;\n return ncr(choice, rem>>1);\n}\n\nint main(){\n int i;\n scanf(\"%d\", &n);\n \n fact[0] = 0;\n for(i = 1;i < 1000006;i++)fact[i] = mul(fact[i - 1], i);\n \n if(n == 1 || n == 2 || n == 4 || n == 5){printf(\"1\\n\");return 0;}\n if(n == 3 || n == 6 || n == 7){printf(\"0\\n\");return 0;}\n \n for(level = 0; (1<\nint main()\n{\n int HH,MM,z,y;\n double x;\n scanf(\"%d%d\",&HH,&MM)\uff1b\n if (HH==12)\n z=0;\n else\n z=HH*30;\n x=z+(double)MM/2;\n y=MM*6;\n printf(\"%g %d\\n\",x,y);\n return 0;\n}\n\n\t\t \t \t \t \t \t\t\t \t \t\t\t", "lang": "GNU C", "bug_code_uid": "3a2f617474cd1e338a905318f199b1c7", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "854750d563facfad0d72045b001b08e9", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.484304932735426, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \n\nint main()\n{\n double ha,ma;\n int h,m;\n char ch;\n while(1)\n {\n scanf(\"%d%c%d\",&h,&ch,&m);\n if(h>=12 )\n h=h-12;\n ha=h*30+m/2.0;\n ma=m*6;\n printf(\"%lg %lg\\n\",ha,ma);\n }\n return 0;\n}\n\n\t\t \t \t\t\t \t \t \t\t\t", "lang": "GNU C", "bug_code_uid": "38328f38f9fbcc8988712c79afe50dff", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "854750d563facfad0d72045b001b08e9", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6964856230031949, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\n#include\nint arr[101];\nint n,dis;\nint min(int x,int y)\n{\n\treturn x\nint main()\n{\n\tint flag=0,i,a=1,b=1,n,j;\n\tscanf(\"%d\",&n);\n\tfor(i=2;a\n#include\n#include\nint distance(int a, int b){\n int k= 10*abs(a-b);\n return k;\n}\nint main(){\n int n, m, k, *p, i, dummy=0, dist=10000;\n scanf(\"%d%d%d\", &n, &m, &k);\n \n p=int*malloc(n*sizeof(int));\n for(i=0;i\n#include \n\nint main()\n{\n\tint n,pisition,money,i,j;\n\tint min=9999,output;\n\t\n\tscanf(\"%d %d %d\",&n,&pisition,&money);\n\t\n\tint num[n];\n\t\n\tfor(i=0;imoney)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\toutput=(abs)(i+1-pisition)*10;\n\t\t\n\t\tif(output\n#include \nint main()\n{\n\tint i,j=1,l=1,k,n,m;\n\tscanf(\"%d %d %d\",&n,&m,&k);\n\tint a[n];\n\tfor(i=1;i<=n;i++)\n\tscanf(\"%d\",&a[i]);\n\twhile(1)\n\t{\n\t\tif(m+j<=n)\n\t\tif(k>=a[m+j] && a[m+j]!=0)\n\t\t{\n\t\t\tprintf(\"%d\",j*10);\n\t\t\tbreak;\n\t\t}\n\t\telse if(m-l>0)\n\t\tif(k>=a[m-l] && a[m-l]!=0)\n\t\t{\n\t\t\tprintf(\"%d\",l*10);\n\t\t\tbreak;\n\t\t}\n\t\tj++;\n\t\tl++;\n\t}\n}#include \n#include \nint main()\n{\n\tint i,j=1,l=1,k,n,m;\n\tscanf(\"%d %d %d\",&n,&m,&k);\n\tint a[n];\n\tfor(i=1;i<=n;i++)\n\tscanf(\"%d\",&a[i]);\n\twhile(1)\n\t{\n\t\tif(m+j<=n)\n\t\tif(k>=a[m+j] && a[m+j]!=0)\n\t\t{\n\t\t\tprintf(\"%d\",j*10);\n\t\t\tbreak;\n\t\t}\n\t\telse if(m-l>0)\n\t\tif(k>=a[m-l] && a[m-l]!=0)\n\t\t{\n\t\t\tprintf(\"%d\",l*10);\n\t\t\tbreak;\n\t\t}\n\t\tj++;\n\t\tl++;\n\t}\n}", "lang": "GNU C", "bug_code_uid": "ffd2b03fdc454a5ea294a5ae9c804469", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "c0a14a8150bc92afb61f8a687ed837dd", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9093264248704663, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \nint main()\n{\n\tint i,j=1,l=1,k,n,m;\n\tscanf(\"%d %d %d\",&n,&m,&k);\n\tint a[n];\n\tfor(i=1;i<=n;i++)\n\tscanf(\"%d\",&a[i]);\n\twhile(1)\n\t{\n\t\tif(m+j<=n)\n\t\tif(a[m+j]!=0 && k>=a[m+j])\n\t\t{\n\t\t\tprintf(\"%d\",j*10);\n\t\t\tbreak;\n\t\t}\n\t\telse if(m-l>0)\n\t\tif(a[m-l]!=0 && k>=a[m-l])\n\t\t{\n\t\t\tprintf(\"%d\",l*10);\n\t\t\tbreak;\n\t\t}\n\t\tif(m+j<=n)\n\t\tj++;\n\t\tif(m-l>0)\n\t\tl++;\n\t}\n}", "lang": "GNU C", "bug_code_uid": "cd03d1711b732a463bb50a4463bcab6a", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "c0a14a8150bc92afb61f8a687ed837dd", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8082051282051282, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nint main()\n{\n\tint v1=0,v2=0,t=0,d=0;\n\tscanf(\"%d %d %d %d\",&v1,&v2,&t,&d);\n\tint totalPathCovered=v2,i;\n\tint samplesLeft;\n\tt=t-1;\n\tfor(i=1;i<=t;i++)\n\t{\n\t\tif(((v2+d-v1)/(t-i))\nint main()\n{int a,b,c,d,e,f,i,j,k,sum=0,p,q=0,r,x,y,z;\n scanf(\"%d %d\",&a,&b);\n scanf(\"%d %d\",&c,&d);\n if(d==0)\n {sum=a*c;}\n else if(d!=0)\n {sum=a+b;\n c=c-2;\n p=d;\n x=a;\n for(i=c;i>0;i--)\n {\n\n while(p>=0)\n { x=x+p;\n if((x-b)/i<=d)\n {\n sum=sum+x;\n break;\n }\n else\n { x=x-p;\n p=p-1;\n }}\n if(p==0)\n { x=x-q;\n while(q<=d)\n { if((x-b)/i>=1)\n {\n sum=sum+x;\n }\n else\n {\n x=x-q;\n q=q+1;\n }\n\n }\n }\n }\n\n\n\n }\n printf(\"%d\",sum);\n }", "lang": "GNU C", "bug_code_uid": "ee94696ac27ff41abf7bae619bd923f8", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "2dc9d879005c7ce542dc3f33a96f31ca", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.950592885375494, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main(void)\n{\n float a, b, n, mod, sum, div, i, j;\n scanf(\"%f\", &n);\n scanf(\"%f\", &a);\n scanf(\"%f\", &b);\n\n sum = a + b;\n div = sum/n;\n if(div >= a) printf(\"%d\", (int)a);\n else if (div >=b) printf(\"%d\",(int) b);\n\n else\n {\n while(n >= (i+j))\n {\n i = (int)(a/div);\n j = (int)(b/div);\n div--;\n }\n printf(\"%d\",(int)(div+1));\n }\n }\n", "lang": "GNU C", "bug_code_uid": "7f6bb7a7c9cfa9e5c5227955bc1056c7", "src_uid": "a254b1e3451c507cf7ce3e2496b3d69e", "apr_id": "ab277b74218bf9fd3cee4e097933b38d", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9158016147635525, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n{\n int n,a,b;\n scanf(\"%d%d%d\",&n,&a,&b);\n int low=1;\n int high=(a+b+n-1)/n;\n int ans=0;\n while(low<=high)\n {\n int mid=(low+high)/2;\n if(a/mid+b/mid>=n)\n {\n if(a/(mid+1)+b/(mid+1)\n\nint main() {\n\tint n;\n\n\tscanf(\"%d\", &n);\n\tprintf(\"%d\\n\", 4 * (2 * (1 << (2 * n - 6)) * 3 + (n - 3) * (9 * 1 << (2 * n - 8))));\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "455fe21092249230d9c1f0f05821373c", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "b72f50902a836d27d4ee7db18502a776", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9951397326852977, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \nint maximum(float num1, float num2);\n\nint main(void)\n{\n float a, b, c, d, max;\n scanf(\"%f\\n%f\\n%f\\n%f\", &a, &b, &c, &d);\n \n if(a<=250 || b >= 3500 || c <= 0 || d>= 180)\n {\n exit(1);\n }\n \n float misha1, misha2, vasya1, vasya2, result1, result2;\n \n misha1 = (3 * (a / 10));\n misha2 = (a - ((a / 250) * c));\n \n result1 = maximum(misha1, misha2);\n \n vasya1 = (3 * (b / 10));\n vasya2 = (b - ((b / 250) * d));\n \n \n result2 = maximum(vasya1, vasya2);\n \n if (result1 > result2)\n {\n printf(\"Misha\");\n \n }\n else if (result1 < result2)\n {\n printf(\"Vasya\");\n }\n else\n {\n printf(\"Tie\");\n \n }\n return 0;\n}\n\nint maximum(float num1, float num2)\n{\n return (num1 > num2) ? num1 : num2;\n}\n", "lang": "GNU C11", "bug_code_uid": "580a4f55ad25db2311d13bbe927a1c2f", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "0b1730bc0848e755f86f54eb90e015c9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6, "equal_cnt": 22, "replace_cnt": 2, "delete_cnt": 15, "insert_cnt": 4, "fix_ops_cnt": 21, "bug_source_code": "#include \nlong long int i,j,k,m,n,x,y,z,B[1000],a,max=-100;\nint main()\n{\n scanf(\"%lld\",&a);\n for (i = 1000000; i >=1 ; i--)\n {\n while(n%(i*i)==0)\n {\n n=n/i;\n \n }\n printf(\"%d\",n);\n }\n \n \nreturn 0; \n}", "lang": "GNU C", "bug_code_uid": "5d917823abde0daa6ec85167708ca79b", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "a8a338651c4735b9fff6287b9c7cdb91", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8852459016393442, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nusing namespace std;\nint main()\n{\nlong long n,i;\nscanf(\"%lld\",&n);\nfor( i=1000000;i>1;i--)\nwhile(n%(i*i)==0)\nn=n/i;\nprintf(\"%d\",n);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "90631c1f967ea6ba3785d9dacb9e09a3", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "a8a338651c4735b9fff6287b9c7cdb91", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6326194398682042, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nlong long int n, a, i, j, p[1000005], carp = 1;\n\nint main () {\n\tscanf(\"%lld\",&n);\n\ta = n;\n\twhile(a != 1){\n\t\tfor(j = 2 ; j <= n ; j++){\n\t\t\tif(a%j == 0){\n\t\t\t\ta/=j;\n\t\t\t\tp[j]++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfor(i = 0 ; i < 1000000 ; i++){\n\t\tif(p[i])\n\t\t\tcarp*=i;\n\t}\n\tprintf(\"%lld\",carp);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c6d707d992214e341f15a459219680f0", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "3e740c0deda3401546908be18544a482", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6338259441707718, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nlong long int n, a, i, j, p[100000005], carp = 1;\n\nint main () {\n\tscanf(\"%lld\",&n);\n\ta = n;\n\twhile(a != 1){\n\t\tfor(j = 2 ; j <= n ; j++){\n\t\t\tif(a%j == 0){\n\t\t\t\ta/=j;\n\t\t\t\tp[j]++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfor(i = 0 ; i < 1000000 ; i++){\n\t\tif(p[i])\n\t\t\tcarp*=i;\n\t}\n\tprintf(\"%lld\",carp);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6712397bc547c3038ffc84ff2438694c", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "3e740c0deda3401546908be18544a482", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.944206008583691, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n long long int i,n;\n scanf(\"%lld\",&n);\n for(i=0;i*i<=n;i++)\n {\n if(n%(i*i)==0){\n n=n/i;\n i=1;\n }\n }\n printf(\"%lld\",n);\n \n return 0;\n } \n ", "lang": "GNU C", "bug_code_uid": "9ab90e9146a7dfe1ebb8954100e8e388", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "90a77fab024862a131a183cd6018ea66", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.055423594615993665, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 24, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C11", "bug_code_uid": "17642dc546698fae9ee859e8b5fd29e8", "src_uid": "b5d44e0041053c996938aadd1b3865f6", "apr_id": "5c81bd8a64d38b8c43b06ac4aa45f78d", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7204819277108434, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n\n\n\nmain()\n{\n long long int i,j,k,a,n,m,sum=0,max;\n scanf(\"%lld %lld\",&a,&n);\n for(i=a;imax)\n {\n max=j;\n m=i/(j*j);\n }\n }\n //printf(\"%lld\\n\",max);\n sum+=m;\n }\n printf(\"%lld\\n\",sum);\n return 0;\n\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "abf04d52c92730720140fb511b73bc73", "src_uid": "915081861e391958dce6ee2a117abd4e", "apr_id": "0a2feb50c1747bf28e8d9bd7950e177d", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9230769230769231, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n#define MAX 2000000000\n//1000000000000000000\nusing namespace std;\n\n\nint main()\n{\n\tlong long N, M, i, st = 1, ed = MAX,k =0; \n\tscanf(\"%lld%lld\", &N, &M);\n\n\tif (M > N) M = N;\n\t\n\tlong long ans =0, X= (N-M)*2;\n\n\tfor (;;) {\n\t\tif (st >= ed) break;\n\t\ti = (st + ed) / 2;\n\n\t\tif (i*i + i >= X) {\n\t\t\ted = i;\n\t\t\tk = i;\n\t\t}\n\t\telse {\n\t\t\tst = i + 1;\n\t\t}\n\t}\n\n\tans = M + k;\n\n\tprintf(\"%lld\\n\", ans);\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "1dfad68b980e53d72c7af74d6af25141", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "bac4a34617cab2bbc21f37bd141e2668", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.017071569271175313, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "https://en.wikipedia.org/wiki/Dada\n", "lang": "GNU C11", "bug_code_uid": "fc72d5cdd55770fd6dfb2d0572a05399", "src_uid": "87d755df6ee27b381122062659c4a432", "apr_id": "c580b963bdcddd323e14b7d2e6e2cbf4", "difficulty": 2700, "tags": ["trees", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9853281853281853, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n int r1,r2,c1,c2,d1,d2,i,j,k,l,c=0;\n scanf(\"%d %d %d %d %d %d\",&r1,&r2,&c1,&c2,&d1,&d2);\n if(r1<1||r2<1||c1<1||c1<1||d1<1||d2<1||r1>20||r2>20||c1>20||c2>20||d1>20||d2>20)\n printf(\"-1\");\n else\n {\n for(i=1;i<=9;i++)\n for(j=1;j<=9;j++)\n for(k=1;k<=9;k++)\n for(l=1;l<=9;l++)\n if(i+j==r1&&i+k==c1&&k+l==r2&&j+l==c2&&i+l==d1&&j+k==d2&&i!=k&&j!=l&&i!=l&&j!=k&&i!=j&&k!=l)\n {\n printf(\"%d %d\\n%d %d\",i,j,k,l);\n c=1;\n break;\n if(c==0)\n printf(\"-1\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "6f205e7e37e357e969c94f9c15d59eee", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "6fdb4d24c7d67aa03affdfa75f503f88", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7543402777777778, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \nint main()\n{\n int r1,r2,c1,c2,d1,d2,i,a,b,c,d,sign;\n while(scanf(\"%d %d\",&r1,&r2))\n {\n scanf(\"%d %d\",&c1,&c2);\n scanf(\"%d %d\",&d1,&d2);\n for(i=1,sign=0;i<=9;i++)\n {\n a=i;\n if(r1-a<0||r1-a>9)continue;\n b=r1-a;\n if(a==b)continue;\n if(c1+d2-a-b<0||(c1+d2-a-b)%2!=0||(c1+d2-a-b)>18)continue;\n c=(c1+d2-a-b)/2;\n if(b==c||a==c)continue;\n if(c2+r2+d1-a-b-c<0||(c2+r2+d1-a-b-c)%3!=0||(c2+r2+d1-a-b-c)>27)continue;\n d=(c2+r2+d1-a-b-c)/3;\n if(a==d||c==d||c==d)continue;\n if(a+b==r1&&a+c==c1&&b+d==c2&&b+c==d2&&a+d==d1&&c+d==r2)\n {sign++;break;}\n }\n if(sign!=0)\n printf(\"%d %d\\n%d %d\\n\",a,b,c,d);\n else\n printf(\"-1\\n\");\n }\n return 0;\n}\n\n\n ", "lang": "GNU C", "bug_code_uid": "0d72f72d1a2e7126042fcd2e7f9b93e7", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "711dfe875678662f227de14b3ad3b335", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6413268832066344, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \nint main()\n{\n int r1,r2,c1,c2,d1,d2,i,a,b,c,d,sign;\n while(scanf(\"%d %d\",&r1,&r2)!=EOF)\n {\n scanf(\"%d %d\",&c1,&c2);\n scanf(\"%d %d\",&d1,&d2);\n for(i=1,sign=0;i<=9;i++)\n {\n a=i;\n if(r1-a<0||r1-a>9)continue;\n b=r1-a;\n if(a==b)continue;\n if(c1+d2-a-b<0||(c1+d2-a-b)%2!=0||(c1+d2-a-b)>18)continue;\n c=(c1+d2-a-b)/2;\n if(b==c||a==c)continue;\n if(c2+r2+d1-a-b-c<0||(c2+r2+d1-a-b-c)%3!=0||(c2+r2+d1-a-b-c)>27)continue;\n d=(c2+r2+d1-a-b-c)/3;\n if(a==d||c==d||c==d)continue;\n if(a+b==r1&&a+c==c1&&b+d==c2&&b+c==d2&&a+d==d1&&c+d==r2&&b>=1&&b<=9&&c>=1&&c<=9&&d>=1&&d<=9)\n {sign++;break;}\n }\n if(sign!=0)\n printf(\"%d %d\\n%d %d\\n\",a,b,c,d);\n else\n printf(\"-1\\n\");\n }\n return 0;\n}\n\n\n#include \n#include \n\nint main()\n{\n\tint r1,r2,d1,d2,c1,c2;\n\tint a,b,c,d,flag;\n\twhile(~scanf(\"%d%d%d%d%d%d\",&r1,&r2,&c1,&c2,&d1,&d2))\n {\n flag=0;\n for (a=1;a<=9;a++)\n {\n b=r1-a;\n c=c1-a;\n d=d1-a;\n if (b+d==c2&&c+d==r2&&b+c==d2&&a!=b&&a!=c&&a!=d&&b!=c&&b!=d&&c!=d&&b>=1&&b<=9&&c>=1&&c<=9&&d>=1&&d<=9)\n {\n printf(\"%d %d\\n%d %d\\n\",a,b,c,d);\n }\n else\n flag++;\n }\n if(flag==9)\n printf(\"-1\\n\");\n }\n return 0;\n}\n\n ", "lang": "GNU C", "bug_code_uid": "08345c1ff903520c40a5d6859b2f1470", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "711dfe875678662f227de14b3ad3b335", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.502360717658168, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\n#include\n\nint main()\n{\n int n,m;\n scanf(\"%d%d\"&n,&m);\n \n int x1=0;\n if(m==0||m==1)\n {\n printf(\"1\");\n return 0;\n }\n if(n==m)\n {\n printf(\"0\");\n return 0;\n }\n if((n-1)%2==0)\n {\n x1=(n-1)/2;\n if(x1>m)\n x1=m;\n printf(\"%d\",x1);\n return 0;\n }\n else\n {\n x1=(n-1)/2+1;\n if(x1>m)\n x1=m;\n printf(\"%d\",x1);\n return 0; \n }\n}\n", "lang": "GNU C11", "bug_code_uid": "2a21408117fb0813fa1ced004d04293e", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "ee7dd58a0b4f24173f0d8ebb373ed056", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999203187250996, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{\n int max,m,n;\n scanf(\"%d%d\",&n,&m);\n if(m>n)\n exit(0);\n if(m==0||m==1)\n {\n printf(\"1\");\n exit(0);\n }\n if(n==m)\n {printf(\"0\");\n exit(0);}\n if(n%2==0)\n {\n max=n/2;\n if(mmax)\n printf(\"%d\",2*max-m);\n else\n printf(\"%d\",max);\n }\n if(n%2==1)\n {\n max=(n-1)/2;\n if(m\nvoid main()\n{\n int n, m;\n scanf(\"%d\", &n);\n scanf(\"%d\", &m);\n \n if(m<(n/2))\n {\n printf(\"%d\",m);\n return;\n }\n \n int left = n/2 - m;\n \n printf(\"%d\",m)\n}", "lang": "GNU C11", "bug_code_uid": "285f43abf7227829e7aefcacbbd271f1", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "7b23e77ce3c33be5f6a395735a4399d3", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.998211091234347, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n int n, m;\n scanf(\"%d%d\", &n, &m);\n int res = 0;\n if(m == 0){\n res = 1;\n }else {\n if(m <= (n/2)){\n res = m;\n }else{\n res = n - m;\n }\n }\n printf(\"%d\", res);\n return 0;\n}\n7", "lang": "GNU C11", "bug_code_uid": "871144276bcec3a5466e44991a131dcf", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "df5b91129cecd2319390409e8258c1d8", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.995334370139969, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nlong long no=1000000007;\nmain()\n{\n char s[200];\n scanf(\"%s\",s);\n int len =strlen(s);\n if(len==1)\n {\n if(s[0]=='1')\n printf(\"1\");\n else\n printf(\"0\");\n return 0;\n }\n int i;\n long long no1=0,no2=1,no3,power=1,flag=0;\n for(i=len-1;i>=0;i--)\n {\n no1=(no1+power*(s[i]-'0'))%no;\n power=(power*2)%no;\n if(s[i]=='0')\n flag=1;\n }\n for(i=1;i\n\nint main()\n{\n\tlong long a, b, c;\n\t\n\tscanf(\"%lld%lld\", &a, &b);\n\tc = 1;\n\twhile (a > 1 || b > 1) {\n\t\tif (a > b)\n\t\t\ta -= b;\n\t\telse\n\t\t\tb -= a;\n\t\tc += 1;\n\t}\n\tprintf(\"%lld\\n\", c);\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "0578a1579808a94030bd067626d40f31", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "91a54154b184d6a67fd255d63ed5ebe9", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9909410242188944, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include \n\n/* A function that prints given number in words */\nvoid convert_to_words(char *num)\n{\n int len = strlen(num); // Get number of digits in given number\n\n /* Base cases */\n if (len == 0) {\n fprintf(stderr, \"empty string\\n\");\n return;\n }\n if (len > 4) {\n fprintf(stderr, \"Length more than 4 is not supported\\n\");\n return;\n }\n\n /* The first string is not used, it is to make array indexing simple */\n char *single_digits[] = { \"zero\",\"one\",\"two\",\"three\",\"four\",\n \"five\",\"six\",\"seven\",\"eight\",\"nine\"};\n\n /* The first string is not used, it is to make array indexing simple */\n char *two_digits[] = {\"\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\",\n \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"};\n\n /* The first two string are not used, they are to make array indexing simple*/\n char *tens_multiple[] = {\"\", \"\", \"twenty\", \"thirty\", \"forty\", \"fifty\",\n \"sixty\", \"seventy\", \"eighty\", \"ninety\"};\n\n char *tens_power[] = {\"hundred\", \"thousand\"};\n\n /* Used for debugging purpose only */\n\n /* For single digit number */\n if (len == 1) {\n printf(\"%s\\n\", single_digits[*num - '0']);\n return;\n }\n\n /* Iterate while num is not '\\0' */\n while (*num != '\\0') {\n\n /* Code path for first 2 digits */\n if (len >= 3) {\n if (*num -'0' != 0)\n {\n printf(\"%s\", single_digits[*num - '0']);\n printf(\"%s\", tens_power[len-3]); // here len can be 3 or 4\n }\n --len;\n }\n\n /* Code path for last 2 digits */\n else {\n /* Need to explicitly handle 10-19. Sum of the two digits is\n used as index of \"two_digits\" array of strings */\n if (*num == '1') {\n int sum = *num - '0' + *(num + 1)- '0';\n printf(\"%s\\n\", two_digits[sum]);\n return;\n }\n\n /* Need to explicitely handle 20 */\n else if (*num == '2' && *(num + 1) == '0') {\n printf(\"twenty\\n\");\n return;\n }\n\n /* Rest of the two digit numbers i.e., 21 to 99 */\n else {\n int i = *num - '0';\n printf(\"%s\", i? tens_multiple[i]: \"\");\n ++num;\n if (*num != '0')\n printf(\"-%s\", single_digits[*num - '0']);\n }\n printf(\"\\n\");\n }\n ++num;\n }\n}\nint main(void)\n{ while(1)\n {char a[33];\n scanf(\"%s\",&a);\n convert_to_words(a);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6872dde2e0f1c9409a4668c684be5358", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "719667e1c7dbdf0fbf9fc21cea2244c6", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9793672627235214, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n;\n char english[100][20]={\"\",\"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\"seven\",\"eight\",\"nine\",\"ten\",\"eleven\",\"twelve\",\"thirteen\",\"fourteen\"\n ,\"fifteen\",\"sixteen\",\"seventeen\",\"eighteen\",\"nineteen\",\"twenty\"};\n while(1){\n scanf(\"%d\",&n);\n if(n<20) printf(\"%s\",english[n]);\n if(n==20) printf(\"twenty\");\n if(n==30) printf(\"thirty\");\n if(n==40) printf(\"forty\");\n if(n==50) printf(\"fifty\");\n if(n==60) printf(\"sixty\");\n if(n==70) printf(\"seventy\");\n if(n==80) printf(\"eighty\");\n if(n==90) printf(\"ninety\");\n if(n==0) printf(\"zero\");\n if(n>20&&n<30) printf(\"twenty-%s\\n\",english[n%10]);\n if(n>30&&n<40) printf(\"thirty-%s\\n\",english[n%10]);\n if(n>40&&n<50) printf(\"forty-%s\\n\",english[n%10]);\n if(n>50&&n<60) printf(\"fifty-%s\\n\",english[n%10]);\n if(n>60&&n<70) printf(\"sixty-%s\\n\",english[n%10]);\n if(n>70&&n<80) printf(\"seventy-%s\\n\",english[n%10]);\n if(n>80&&n<90) printf(\"eighty-%s\\n\",english[n%10]);\n if(n>90&&n<100) printf(\"ninety-%s\\n\",english[n%10]);}\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a11606fc67990c8dcfdc3c7d05ff935f", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "627b1d2eea5e876365eba16a7c5f6c15", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4488330341113106, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\nint x[100100];\nint main()\n{\nlong long i,j,k,n,max,min;\nmax=0;\nmin=-1;\nscanf(\"%I64d\",&n);\nfor(i=1;i<=n;i++)\n for(j=1;j<=n;j++)\n{\n\nif(i*j*(n/i/j)>n)\n break;\nif(i*j*(n/i/j)==n)\n{\n if(min==-1)\n min=(i+1)*(j+2)*((n/i/j)+2);\n else if(min>(i+1)*(j+2)*((n/i/j)+2))\n min=(i+1)*(j+2)*((n/i/j)+2);\n\n}\n }\nmax=3*3*(n+1);\n\tprintf(\"%I64d %I64d\\n\",min-n,max-n);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3df8d5fac8d29d73b2f8a88c6c87615d", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "48f5da77d2895b44bfab670bcd1863f2", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.46869409660107336, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "#include\nint x[100100];\nint main()\n{\nlong long i,j,k,n,max,min;\nmax=0;\nmin=-1;\nscanf(\"%I64d\",&n);\nfor(i=1;i<=n;i++)\n for(j=1;j<=n;j++)\n{\n if(i*j>n)\n break;\n\n else if(i*j==n)\n {\n\n if(min==-1)\n min=(i+2)*(j+2);\n else if((i+2)*(j+2)\nint main()\n{\n\tint n;\n\twhile(scanf(\"%d\",&n)!=EOF)\n\t{\n\t\tint a,b;//n>a n>b;\n\t\tscanf(\"%d%d\",&a,&b);//a,b da xiao\n\t\tint s=1;\n\t\tint l=n;\n\t\tint a1=0,b1=0;\n\t\tif(a=0 &&b1<2) {l=l-b;b1++;}\n\t\t\t\telse if(l-a>=0 &&a1<4) {l=l-a;a1++;}\n\t\t\t\tif(a1==4&&b1==2)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%d\\n\",s); break;\n\t\t\t\t}\n\t\t\t\tif(lb)\n\t\t{\n\t\t\t//l=l-a;a1++;\n\t\t\tfor(;;)\n\t\t\t{\n\t\t\t\tif(l-a>=0 &&a1<4) {l=l-a;a1++;}\n\t\t\t if(l-b>=0 &&b1<2) {l=l-b;b1++;}\n\t\t\t\tif(a1==4&&b1==2)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%d\\n\",s); break;\n\t\t\t\t}\n\t\t\t\tif(l=a)\n\t\t\t\t{\n\t\t\t\t\tl=l-a;a1++;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tif(a1==6)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%d\\n\",s);break;\n\t\t\t\t}\n\t\t\t\tif(l\n#include \nint main(void)\n{\n char s[50];\n scanf(\"%s\",s);\n int n=0;\n int a;\n a=strlen(s);\n for (size_t i = 0; i < 50; i++)\n {\n if (s[i]=='a')\n {\n n++;\n }\n \n }\n if (n+n-1>a)\n {\n printf(\"%s\",n);\n }\n else\n {\n printf(\"%s\",a);\n }\n \n \n}", "lang": "GNU C11", "bug_code_uid": "676f43069ac07cc08438a355d3425fdb", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "05981bbd117d48d364c8bdfd0b58ece6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5856164383561644, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main(){\n long int a,b,s;\n scanf(\"%ld%ld%ld\",&a,&b,&s);\n long int x=abs(a),y=abs(b);\n if(s>=(x+y) && (s%(x+y))%2==0){\n printf(\"YES\");\n }\n else{\n printf(\"NO\");\n }\n}", "lang": "GNU C", "bug_code_uid": "40f5b18577f8cf05880663f3865eb48f", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "35a3e76436bbd30b284331e10a1ca661", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9442322383498855, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "/* practice with Dukkha */\n#include \n\n#define N\t100000\n#define MD\t1000000007\n\nint ff[N], gg[N];\n\nint d_, x_, y_;\n\nvoid gcd_(int a, int b) {\n\tif (b == 0) {\n\t\td_ = a;\n\t\tx_ = 1, y_ = 0;\n\t} else {\n\t\tint tmp;\n\n\t\tgcd_(b, a % b);\n\t\ttmp = x_ - a / b * y_, x_ = y_, y_ = tmp;\n\t}\n}\n\nint inv(int a, int b) {\n\tgcd_(a, b);\n\treturn x_;\n}\n\nvoid init(int n) {\n\tint i, f;\n\n\tfor (i = 0, f = 1; i < n; i++) {\n\t\tgg[i] = inv(ff[i] = f, MD);\n\t\tf = (long long) f * (i + 1) % MD;\n\t}\n}\n\nint choose(int n, int k) {\n\treturn n < k ? 0 : (long long) ff[n] * gg[k] % MD * gg[n - k] % MD;\n}\n\nint main() {\n\tstatic int aa[N + 2], bb[N + 2], cc[N + 2];\n\tint f, w, h, n, i, j, p, q, ans;\n\n\tscanf(\"%d%d%d\", &f, &w, &h);\n\tif (f == 0) {\n\t\tprintf(\"%d\\n\", w > h);\n\t\treturn 0;\n\t}\n\tif (w == 0) {\n\t\tprintf(\"1\\n\");\n\t\treturn 0;\n\t}\n\tn = f > w ? f : w;\n\tinit(n);\n\tfor (i = 1; i <= f; i++)\n\t\taa[i] = choose(f - 1, i - 1);\n\tfor (j = 1; j <= w; j++)\n\t\tbb[j] = choose(w - 1, j - 1);\n\tfor (j = 1; h * j < w; j++)\n\t\tcc[j] = choose(w - h * j - 1, j - 1);\n\tp = q = 0;\n\tfor (i = 1; i <= n; i++) {\n\t\tp = (p + aa[i] * (cc[i] * 2LL + cc[i - 1] + cc[i + 1])) % MD;\n\t\tq = (q + aa[i] * (bb[i] * 2LL + bb[i - 1] + bb[i + 1])) % MD;\n\t}\n\tans = (long long) p * inv(q, MD) % MD;\n\tif (ans < 0)\n\t\tans += MD;\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ce42a28c77aaa84404afc6fda1016c25", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "a56035fc745f1dbf9cf39545cb1e5a10", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.997371385655276, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "/* practice with Dukkha */\n#include \n\n#define N\t100000\n#define MD\t1000000007\n\nint ff[N], gg[N];\nint d_, x_, y_;\n\nvoid gcd_(int a, int b) {\n\tif (b == 0) {\n\t\td_ = a;\n\t\tx_ = 1, y_ = 0;\n\t} else {\n\t\tint tmp;\n\n\t\tgcd_(b, a % b);\n\t\ttmp = x_ - a / b * y_, x_ = y_, y_ = tmp;\n\t}\n}\n\nint inv(int a, int b) {\n\tgcd_(a, b);\n\treturn x_;\n}\n\nvoid init(int n) {\n\tint i, f;\n\n\tfor (i = 0, f = 1; i < n; i++) {\n\t\tgg[i] = inv(ff[i] = f, MD);\n\t\tf = (long long) f * (i + 1) % MD;\n\t}\n}\n\nint choose(int n, int k) {\n\treturn n < k ? 0 : (long long) ff[n] * gg[k] % MD * gg[n - k] % MD;\n}\n\nint main() {\n\tstatic int aa[N + 2], bb[N + 2], cc[N + 2];\n\tint f, w, h, n, i, j, p, q, ans;\n\n\tscanf(\"%d%d%d\", &f, &w, &h);\n\tif (f == 0) {\n\t\tprintf(\"%d\\n\", w > h);\n\t\treturn 0;\n\t}\n\tif (w == 0) {\n\t\tprintf(\"1\\n\");\n\t\treturn 0;\n\t}\n\tn = f > w ? f : w;\n\tinit(n);\n\tfor (i = 1; i <= f; i++)\n\t\taa[i] = choose(f - 1, i - 1);\n\tfor (j = 1; j <= w; j++)\n\t\tbb[j] = choose(w - 1, j - 1);\n\tfor (j = 1; h * j < w; j++)\n\t\tcc[j] = choose(w - h * j - 1, j - 1);\n\tp = q = 0;\n\tfor (i = 1; i <= n; i++) {\n\t\tp = (p + aa[i] * (cc[i] * 2LL + cc[i - 1] + cc[i + 1])) % MD;\n\t\tq = (q + aa[i] * (bb[i] * 2LL + bb[i - 1] + bb[i + 1])) % MD;\n\t}\n\tif (p < 0)\n\t\tp += MD;\n\tif (q < 0)\n\t\tq += MD;\n\tans = (long long) p * inv(q, MD) % MD;\n\tif (ans < 0)\n\t\tans += MD;\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0f07be2c5bca8368c0f0f52e2524a324", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "a56035fc745f1dbf9cf39545cb1e5a10", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9965217391304347, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#define MOD 1000000007\n\nlong long mpow(long long a, long long p)\n{\n a %= MOD;\n \n long long r = 1;\n while (p) {\n if ((1 & p)) r = (r * a) % MOD;\n a = (a * a) % MOD;\n p >>= 1;\n }\n return r;\n}\n\nint inv(long long x)\n{ return mpow(x, MOD-2); }\n\n#define MAXF 100005\n\nint factorial[MAXF];\n\nlong long possib(long long width, long long boxes, long long minh)\n{\n long long separators = width-1;\n long long elements = boxes-width*minh;\n\n if(elements < 0) return 0;\n else return (factorial[separators+elements]*inv(factorial[separators]*factorial[elements])) % MOD;\n}\n\nlong long all_possib, nice_possib;\nvoid add_all(long long x)\n{\n x %= MOD;\n all_possib += x;\n all_possib %= MOD;\n}\nvoid add_nice(long long x)\n{\n x %= MOD;\n nice_possib += x;\n nice_possib %= MOD;\n}\n\nint main()\n{\n long long fac;\n int i;\n int result;\n\n i = 0;\n for(fac = 1; i H) printf(\"1\\n\");\n else printf(\"0\\n\");\n return 0;\n }\n\n all_possib = 0;\n nice_possib = 0;\n for(width=1; width<=W; width++){\n add_all(possib(width, F, 1)*possib(width, W, 1));\n add_all(possib(width+1, F, 1)*possib(width, W, 1));\n add_all(possib(width, W, 1)*possib(width, F, 1));\n add_all(possib(width+1, W, 1)*possib(width, F, 1));\n\n add_nice(possib(width, F, 1)*possib(width, W, H+1));\n add_nice(possib(width+1, F, 1)*possib(width, W, H+1));\n add_nice(possib(width, W, H+1)*possib(width, F, 1));\n add_nice(possib(width+1, W, H+1)*possib(width, F, 1));\n }\n result = nice_possib*inv(all_possib) % MOD;\n\n printf(\"%d\\n\", result);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "0102a72e20f2950d95fce2d0a73c4a5a", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "c733f031ab8d1fb1a400f8b395ba4fbf", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.546470999301188, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \nint main()\n{\n char s[200];\n int k=0,len=0,index=0,i=0,flag=0;\n scanf(\"%s\",s);\n len=strlen(s);\n scanf(\"%d\",&k);\n if((len+k)%2!=0) { index++;}\n while(1)\n {\n int mid=index+ (len+k-index)/2;\n for(i=0;mid+i\n#include \nint main()\n{\n char s[200];\n int k=0,len=0,index=0,i=0,flag=2,count1;count2;\n scanf(\"%s\",s);\n len=strlen(s);\n scanf(\"%d\",&k);\n if((len+k)%2!=0&&len!=0) { index++;}\n while(index=len) {flag=0;break;}\n index+=2;\n }\n count1=len+k-index-flag;\n index=0;flag=2,k=0;\n if((len+k)%2!=0&&len!=0) { index++;}\n while(index=len) {flag=0;break;}\n index+=2;\n }\n count2=len+k-index-flag;\n if(count1\nint main()\n{\n int a,ac,b,bc,cc,c,n,i,days=0,j;\n scanf(\"%d %d %d\",&a,&b,&c);\n\n for(j=1;j<8;j++)\n {\n n=0;\n ac=a;\n bc=b;\n cc=c;\n i=j;\n while(1)\n {\n\n if(i==1||i==4||i==7)\n {\n if(ac==0)break;\n ac--;\n }\n else if(i==2||i==6)\n {\n if(bc==0)break;\n bc--;\n }\n else\n {\n if(cc==0)break;\n cc--;\n }\n if(i==7)i=1;\n else i++;\n n++;\n //printf(\"%d %d %d\\n\",ac,bc,cc);\n }\n if(days\n#include \n\nvoid countingCards(char *str){\n int count = 0;\n int i = 0;\n while(str[i] != '\\0'){\n if(str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u'){\n count++;\n }\n else if(str[i] == '1' || str[i] == '3' || str[i] == '5' || str[i] == '7' || str[i] == '9'){\n count++;\n }\n }\n return;\n}\n\nint main() {\n char str[51];\n scanf(\"%s\", str);\n countingCards(str);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "6040b24003b6f3b5b133bf19ba3cdb29", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "457d6c4d1733600ce6f5267134446ef5", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8449391664509449, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include \n\n#define INF (1LL << 60)\n\nstruct point\n{\n int x;\n int y;\n};\n\nstruct point p[4][2];\nint q[4];\ndouble g[4];\n\nint check(struct point p1, struct point p2)\n{\n if (p1.x == p2.x && p1.y == p2.y)\n {\n return 1;\n }\n return 0;\n}\n\nvoid solve()\n{\n int i, j, k, t, f;\n for (i = 0; i < 4; i ++)\n {\n if (check(p[i][0], p[i][1]))\n {\n printf(\"NO\\n\");\n return;\n }\n k = t = 0;\n for (j = 0; j < 4; j ++)\n {\n f = 0;\n if (j == i)\n {\n continue;\n }\n if (check(p[i][0], p[j][0]))\n {\n k ++;\n f = 1;\n }\n if (check(p[i][0], p[j][1]))\n {\n k ++;\n f = 1;\n }\n if (k > 1)\n {\n printf(\"NO\\n\");\n return;\n }\n if (check(p[i][1], p[j][0]))\n {\n t ++;\n f = 1;\n }\n if (check(p[i][1], p[j][1]))\n {\n t ++;\n f = 1;\n }\n if (t > 1)\n {\n printf(\"NO\\n\");\n return;\n }\n if (f == 0)\n {\n q[i] = j;\n }\n }\n if (k != 1 || t != 1)\n {\n printf(\"NO\\n\");\n return;\n }\n if (p[i][0].x == p[i][1].x)\n {\n g[i] = INF;\n }\n else\n {\n g[i] = (double)(p[i][1].y - p[i][0].y) / (p[i][1].x - p[i][0].x);\n }\n }\n for (i = 0; i < 4; i ++)\n {\n if (g[i] != g[q[i]])\n {\n printf(\"NO\\n\");\n return;\n }\n }\n printf(\"YES\\n\");\n}\n\nint main()\n{\n int i;\n for (i = 0; i < 4; i ++)\n {\n scanf(\"%d%d%d%d\", &p[i][0].x, &p[i][0].y, &p[i][1].x, &p[i][1].y);\n }\n solve();\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "66052b48d8bd213cf6c94c5e5c8093b8", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "27352a749a28bf5bde1e5a119888d657", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8976377952755905, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n\n#define MAX 100\n#define MAX_VALUE 1000000000000000000L\n\ntypedef unsigned long long UINT64;\n\nint maxIndex = 0;\nUINT64 min = 0;\nUINT64 arr[MAX] = {0, };\n\nvoid getMinVal(char *num, int n, int index) {\n int i = 0;\n if (index > maxIndex) {\n return;\n }\n \n if (!*num) {\n UINT64 v = 0, pow = 1;\n for (i=index-1;i>=0;i--) {\n v += arr[i] * pow;\n pow *= n;\n }\n\n if (min == 0 || min > v) {\n min = v;\n }\n } else {\n int v = 0;\n char sub[MAX] = {0, }, *p = num;\n\n while (*p) {\n if (p == num && *p == '0') {\n arr[index] = 0;\n getMinVal(p + 1, n, index + 1);\n break;\n } else {\n sub[i++] = *p;\n v = atoi(sub);\n if (v >= n) {\n break;\n }\n \n arr[index] = v;\n p++;\n getMinVal(p, n, index + 1);\n }\n }\n }\n}\n\nvoid setMaxIndex(int n) {\n UINT64 v = MAX_VALUE;\n while (v) {\n v /= n;\n maxIndex++;\n }\n}\n\nint main(void) {\n int n = 0;\n char num[MAX] = {0, };\n\n scanf(\"%d\", &n);\n scanf(\"%s\", num);\n \n setMaxIndex(n);\n getMinVal(num, n, 0);\n \n printf(\"%llu\\n\", min);\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "5da03ade24801b799db1c0f918c32255", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "afa5dc82eaad5e702cdc0604fb56c9c2", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8698023176550784, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint Cnt[10];\n\nint main()\n{\n int table[] = {999999999, 99999999, 9999999, 999999, 99999, 9999, 999, 99, 9};\n int n, reamin = 0, ans = 0;\n scanf(\"%d\", &n);\n for(int i = 0; i < 9; ++i) {\n if(n + n - 1 >= table[i]) {\n reamin = table[i];\n break;\n }\n }\n if(reamin == 0) {\n printf(\"%d\\n\", (int)((long long)n * (n - 1) / 2));\n return 0;\n }\n for(int i = 0; i < 9; ++i) {\n int expect = (reamin + 1) * i + reamin;\n if(n + n - 1 >= expect) {\n if(expect <= n) {\n ans += expect / 2;\n } else {\n ans += n - expect / 2;\n }\n }\n }\n printf(\"%d\\n\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "af1e660d33a2b14a1460b488187dbde6", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "2bc5f88e82ccb94430a072bc8c5f79e8", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9890909090909091, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint main(){\n\tlong long int i,n;\n\tscanf(\"%lld\",&n);\n\tlong long int temp=n*2;\n\ttemp/=10;\n\tlong long int m=0;\n\tlong long int m10=1;\n\twhile(temp>0){\n\t\ttemp/=10;\n\t\tm++;\n\t\tm10*=10;\n\t}\n\tif(m==0){\n\t\tprintf(\"%ld\\n\",(n*(n-1))/2);\n\t\treturn 0;\n\t}\n\tlong long int ans=0,val=0;\n\tfor(i=1;i<9;i++){\n\t\tif(i*m10>2*n)break;\n\t\tif(n>=i*m10-1){\n\t\t\tans+=((i*m10/2)-1);\n//\t\t\tval=((i*m10/2)-1);\n//\t\t\tprintf(\"%d\\n\",val);\n\t\t}\n\t\telse{\n\t\t\tans+=(n+1-(i*m10/2));\n//\t\t\tval=(n+1-(i*m10/2));\n//\t\t\tprintf(\"%d\\n\",val);\n\t\t}\n\t}\n\tprintf(\"%lld\\n\",ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "95dcc7ad34f186e138398cd13a8d615d", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "cac049cbc4768ac1e50814dc1d463118", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2006861063464837, "equal_cnt": 19, "replace_cnt": 13, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "#include \n#include \n#include \n\n#define M\t4167669\t/* (23 choose 7) * 17 */\n#define C\t16\n#define K\t2000000000\n#define T\t7\n\nint add(int a, int b) { return (long long) a + b < K ? a + b : K; }\n\nvoid print(int k) {\n\tif (k == 0)\n\t\treturn;\n\tprint(k / C);\n\tprintf(\"%c\", k % C < 10 ? k % C + '0' : k % C - 10 + 'a');\n}\n\nint aaa[M][C + 1], m;\n\nvoid branch(int *aa, int h) {\n\tint a, len;\n\n\tif (h == C) {\n\t\tfor (len = 0; len <= C; len++) {\n\t\t\taa[h] = len;\n\t\t\tmemcpy(aaa[m++], aa, (C + 1) * sizeof *aa);\n\t\t}\n\t\treturn;\n\t}\n\tfor (a = h == 0 ? 0 : aa[h - 1]; a <= T; a++) {\n\t\taa[h] = a;\n\t\tbranch(aa, h + 1);\n\t}\n}\n\nint choose[C + T][C + T];\n\nvoid init1() {\n\tint n, r;\n\n\tchoose[0][0] = 1;\n\tfor (n = 1; n < C + T; n++) {\n\t\tchoose[n][0] = 1;\n\t\tfor (r = 1; r <= n; r++)\n\t\t\tchoose[n][r] = choose[n - 1][r - 1] + choose[n - 1][r];\n\t}\n}\n\nint idx(int *aa) {\n\tint h, a, sum;\n\n\tsum = 0;\n\tfor (h = 0; h < C; h++)\n\t\tfor (a = h == 0 ? 0 : aa[h - 1]; a < aa[h]; a++)\n\t\t\tsum += choose[C - h - 1 + T - a][T - a];\n\treturn sum * (C + 1) + aa[C];\n}\n\nint dp[M];\n\nvoid init2() {\n\tstatic int a_[C + 1], *aa = a_;\n\tint h, i, j, a, len;\n\n\tbranch(aa, 0);\n\tfor (i = 0; i < m; i++) {\n\t\taa = aaa[i];\n\t\tlen = aa[C];\n\t\tif (len == 0)\n\t\t\tdp[i] = 1;\n\t\telse\n\t\t\tfor (h = 0; h < C; h++) {\n\t\t\t\tif (aa[h] == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (h == 0 || aa[h - 1] != aa[h]) {\n\t\t\t\t\ta = aa[h] - 1;\n\t\t\t\t\tj = i / (C + 1) - choose[C - h - 1 + T - a][T - a];\n\t\t\t\t\tif (h < C - 1)\n\t\t\t\t\t\tj += choose[C - h - 2 + T - a][T - a];\n\t\t\t\t\tj = j * (C + 1) + len - 1;\n\t\t\t\t}\n\t\t\t\tdp[i] = add(dp[i], dp[j]);\n\t\t\t}\n\t}\n}\n\nint compare(const void *a, const void *b) {\n\tint ia = *(int *) a;\n\tint ib = *(int *) b;\n\n\treturn ia - ib;\n}\n\nint main() {\n\tstatic int aa[C + 1], bb[C + 1];\n\tint k, t, h, i, first;\n\n\tscanf(\"%d%d\", &k, &t);\n\tif (t >= 8) {\n\t\tprint(k);\n\t\tprintf(\"\\n\");\n\t\treturn 0;\n\t}\n\tinit1();\n\tinit2();\n\tfor (h = 0; h < C; h++)\n\t\taa[h] = t;\n\tfor (aa[C] = 1; ; aa[C]++) {\n\t\tint cnt = dp[idx(aa)];\n\n\t\taa[0]--; aa[C]--;\n\t\tcnt -= dp[idx(aa)];\n\t\taa[0]++; aa[C]++;\n\t\tif (k <= cnt)\n\t\t\tbreak;\n\t\tk -= cnt;\n\t}\n\tfirst = 1;\n\twhile (aa[C]-- > 0) {\n\t\tfor (h = first ? 1 : 0; h < C; h++) {\n\t\t\tmemcpy(bb, aa, (C + 1) * sizeof *aa);\n\t\t\tif (bb[h] == 0)\n\t\t\t\tcontinue;\n\t\t\tbb[h]--;\n\t\t\tqsort(bb, C, sizeof *bb, compare);\n\t\t\tif (k > dp[i = idx(bb)]) {\n\t\t\t\tk -= dp[i];\n\t\t\t\tbb[h]++;\n\t\t\t} else {\n\t\t\t\tprintf(\"%c\", h < 10 ? h + '0' : h - 10 + 'a');\n\t\t\t\taa[h]--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfirst = 0;\n\t}\n\tprintf(\"\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c4e6fb2b577d322dc2f827ffb83176bd", "src_uid": "cbfc354cfa392cd021d9fe899a745f0e", "apr_id": "2a4410571e554c04c5ff0d441a0c74d1", "difficulty": 2500, "tags": ["brute force", "dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9941860465116279, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint main()\n{\n\nint n,x,y;\n\nscanf(\"%d%d%d\",&num,&x,&y);\nn=n/2;\n\nif((x==n||x==n+1) && (y==n||y==n+1))\n{\nprintf(\"NO\");\n}\n\nelse\n{\nprintf(\"YES\");\n}\nreturn(0);\n}", "lang": "GNU C", "bug_code_uid": "2c9489f2006c8f32377b61ecc89f3cc2", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "0c886c43931e044b3f6378645d6b1237", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6901098901098901, "equal_cnt": 15, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 9, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main()\n{\nint n,p=0,q=0,x,y;\nscanf(\"%d%d%d\",&n,&x,&y);\nif(n%2!=0)\n{if(y==n/2 || y==n/2-1|| y==n/2-1)\n{\nprintf(\"NO\");\n}\nelse\n{\nprintf(\"YES\");\n}\n}\nelse\n{\nif(y==n/2 || y==n/2+1)\n{\n printf(\"NO\");\n}\nelse\nprintf(\"YES\n \");\n}\nreturn(0);\n}\n", "lang": "GNU C", "bug_code_uid": "06d40e392d96daefc333f1b1927eeabf", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "e19f372b2060a9e1582900ce2988f261", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8601472134595163, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n\nint n;\n\nint special(int x, int y) {\n long long xx = x, yy = y, nn = n; xx *= x; yy *= y; nn *= n;\n return xx + yy < nn;\n}\n\nint main(void) {\n int i, j, r = 0, s = 0;\n scanf(\"%d\", &n);\n j = n;\n for (i = 0; i <= j; ++i) {\n while (!special(i, j)) --j;\n if (i < j) ++r;\n if (i == j) ++s;\n }\n r = 2*r + s; r += r - 1; r += r - 2;\n printf(\"%d\\n\", n == 0 ? 1 : n == 1 ? 4 : r);\n exit(EXIT_SUCCESS);\n}\n", "lang": "GNU C", "bug_code_uid": "ef20b0005de71c4b0d184957f20d4557", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "25f73ffcfa898255fcf39f793444e3a9", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8870803662258393, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n\n#define m 1000000007\n\nlong long power( long long a, long long b ) {\n\tlong long x=a, y=b;\n\tlong long ans = 1;\n\twhile( y ) {\n\t\tif( y%2 )\n\t\t\tans = (ans*x)%m;\n\t\tx = (x*x)%m;\n\t\ty /= 2;\n\t}\n\treturn ans;\n}\n\nint main() {\n\tlong long k, p;\n\tscanf(\"%lld%lld\",&p, &k);\n\tif( k==0 )\n\t\tprintf(\"%lld\\n\", power(p,p-1));\n\tif( k==1 )\n\t\tprintf(\"%lld\\n\", power(p,p));\n\tlong long ord = 1;\n\n\tfor( ; k != 1; ++ord )\n\t\tk = (k*k)%p;\n\n\tprintf(\"%lld\\n\", power(p,(p-1)/ord));\n}", "lang": "GNU C", "bug_code_uid": "c2b8f1eac2c9a9bb460a00b6e5063b56", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "8b755247e05d9860e7db0b51d9e09475", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "dsu"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5526932084309133, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n#include \n\nint main(){\n char word1[101],word2[101];\n int i,n,m,j,count,l=0;\n scanf(\"%s\",word1);scanf(\"%s\",word2);\n n=strlen(word1);m=strlen(word2);\n if(n>m){printf(\"1\");l=1;}else if(nword2[i]) return 1;\n else if(word1[i]\n#define mod 1000000007\nlong long dp[55][55][205]={};\nlong long c[55][55]={};\nint n,lim,A=0,B=0,i,j,k,ii,jj;\nint main(){\n\tscanf(\"%d %d\",&n,&lim);\n\tfor(i=0;i=0;i--){\n\t\t\tfor(j=B;j>=0;j--){\n\t\t\t\tif(k%2){\n\t\t\t\t\tfor(ii=i;ii<=A;ii++){\n int s=B>(lim-(ii-i)*50)/100?(lim-(ii-i)*50)/100:B\n\t\t\t\t\t\tfor(jj=j;jj<=s;jj++){\n\t\t\t\t\t\t\tif((i!=ii || j!=jj)){\n\t\t\t\t\t\t\t\tdp[i][j][k]+=(dp[ii][jj][k-1]*c[ii][ii-i]*c[jj][jj-j])%mod;\n\t\t\t\t\t\t\t\tdp[i][j][k]%=mod;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor(ii=0;ii<=i;ii++){\n\t\t\t\t\t\tfor(jj=0;jj<=j;jj++){ \n\t\t\t\t\t\t\tif((i!=ii || j!=jj) && (i-ii)*50+(j-jj)*100<=lim){\n\t\t\t\t\t\t\t\tdp[i][j][k]+=(dp[ii][jj][k-1]*c[A-ii][i-ii]*c[B-jj][j-jj])%mod;\n\t\t\t\t\t\t\t\tdp[i][j][k]%=mod;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor(k=1;k<=n*4;k++){\n\t\tif(dp[0][0][k]){\n\t\t\tprintf(\"%d\\n\",k);\n\t\t\tprintf(\"%lld\\n\",dp[0][0][k]);\n\t\t\treturn 0;\n\t\t}\n\t}\n\tputs(\"-1\\n0\");\n}", "lang": "GNU C", "bug_code_uid": "6617940af13aa4efc5a4176ac81af9a7", "src_uid": "ebb0323a854e19794c79ab559792a1f7", "apr_id": "74b5a9b2303796640a7165e20af7443c", "difficulty": 2100, "tags": ["graphs", "dp", "combinatorics", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9915366574895483, "equal_cnt": 19, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 15, "fix_ops_cnt": 18, "bug_source_code": "#include \n#define mod 1000000007\nlong long dp[55][55][205]={};\nlong long c[55][55]={};\nint n,lim,A=0,B=0,i,j,k,ii,jj;\nint min(int a,int b){return a=0;i--){\n\t\t\tfor(j=B;j>=0;j--){\n\t\t\t\tint s=k%2;\n\t\t\t\tdp[i][j][s]=0;\n\t\t\t\tif(s){\n\t\t\t\t\tfor(ii=i;ii<=A;ii++){\n\t\t\t\t\t\tint f=lim-(ii-i)*50;\n\t\t\t\t\t\tf/=100;\n\t\t\t\t\t\tf+=j; f=min(f,B);\n\t\t\t\t\t\tfor(jj=j;jj<=f;jj++){\n\t\t\t\t\t\t\tif((i!=ii || j!=jj)){\n\t\t\t\t\t\t\t\tdp[i][j][s]+=(dp[ii][jj][1-s]*c[ii][ii-i]*c[jj][jj-j])%mod;\n\t\t\t\t\t\t\t\tdp[i][j][s]%=mod;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor(ii=0;ii<=i;ii++){\n\t\t\t\t\t\tint f=lim-(i-ii)*50;\n\t\t\t\t\t\tf/=100;\n\t\t\t\t\t\tf=j-f; f=max(f,0);\n\t\t\t\t\t\tfor(jj=0;jj<=f;jj++){\n\t\t\t\t\t\t\tif((i!=ii || j!=jj)){\n\t\t\t\t\t\t\t\tdp[i][j][s]+=(dp[ii][jj][1-s]*c[A-ii][i-ii]*c[B-jj][j-jj])%mod;\n\t\t\t\t\t\t\t\tdp[i][j][s]%=mod;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(dp[0][0][s]){\n\t\t\t\t\tprintf(\"%d\\n\",k);\n\t\t\t\t\tprintf(\"%lld\\n\",dp[0][0][s]);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tputs(\"-1\\n0\");\n}\n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// \n// ", "lang": "GNU C", "bug_code_uid": "83f17f2f34a004af9a838ac550dd112d", "src_uid": "ebb0323a854e19794c79ab559792a1f7", "apr_id": "74b5a9b2303796640a7165e20af7443c", "difficulty": 2100, "tags": ["graphs", "dp", "combinatorics", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.29457364341085274, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#define max(a,b) ((a)>(b)?(a):(b))\n#define min(a,b) (a+b-max(a,b))\nint ans,t,n,x,y,c,k;\nint main()\n{\n\tscanf(\"%d%d%d%d\",&n,&x,&y,&c);\n\twhile (ans\n#include\nint main()\n{\n\tint i,j,a,b,year1,year2,c,d,month1,day1,month2,day2,counter=0,hold1;\n\tchar string[10];\n\tint arr[139]={0};\n\tarr[100]=1;\n\tfor(i=1;i<139;i++)\n\t{\n\t\tif(i%4==0)\n\t\t\tarr[i]=1;\n\t}\n\tint month[13];\n\tmonth[1]=31;\n\tmonth[2]=28;\n\tmonth[3]=31;\n\tmonth[4]=30;\n\tmonth[5]=31;\n\tmonth[6]=30;\n\tmonth[7]=31;\n\tmonth[8]=31;\n\tmonth[9]=30;\n\tmonth[10]=31;\n\tmonth[11]=30;\n\tmonth[12]=32;\n\tscanf(\"%s\",string);\n\tyear1=(string[0]-'0')*1000+(string[1]-'0')*100+(string[2]-'0')*10+(string[3]-'0');\n\tmonth1=(string[5]-'0')*10+(string[6]-'0');\n\tday1=(string[8]-'0')*10+(string[9]-'0');\n\tscanf(\"%s\",string);\n\tyear2=(string[0]-'0')*1000+(string[1]-'0')*100+(string[2]-'0')*10+(string[3]-'0');\n\tmonth2=(string[5]-'0')*10+(string[6]-'0');\n\tday2=(string[8]-'0')*10+(string[9]-'0');\n\tif(year1>year2)\n\t{\n\t\thold1=year1;\n\t\tyear1=year2;\n\t\tyear2=hold1;\n\t\thold1=month1;\n\t\tmonth1=month2;\n\t\tmonth2=hold1;\n\t\thold1=day1;\n\t\tday1=day2;\n\t\tday2=hold1;\n\t}\n\tif(year2>=year1+1)\n\t{\n\t\tif(year2>year1+1)\n\t\t{\n\t\t\tfor(j=(year1+1)-1900;j\n#include\nint main()\n{\n\tint y1,m1,d1,y2,d2,m2,t1,t2,d,t,p,k,y[200],d[200],l,i;\n //t,p,k\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05b4\ufffd\u02b1\ufffd\u0137\ufffd\u0163\ufffd//d\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05ae\ufffd\ufffd\ufffd\u02b1\ufffd\ufffd\ue8fb//y[200]\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05ae\ufffd\ufffd\ufffd\ufffd\ufffd\u0763\ufffd\n //d[200]\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u00ff\ufffd\ufffdy[i]\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd//l\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05ae\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u02fc\ufffd\ufffd\ufffd\ufffd\ufffd\u0763\ufffd\n\twhile(scanf(\"%d:%d:%d%d:%d:%d\",&y1,&m1,&d1,&y2,&m2,&d2)!=EOF)\n\t{\n\t\tif(y1>y2)\n\t\t{\n\t\t\tt=y2;\n\t\t\ty2=y1;\n\t\t\ty1=t;\n\t\t\tp=m2;\n\t\t\tm2=m1;\n\t\t\tm1=p;\n\t\t\tk=d2;\n\t\t\td2=d1;\n\t\t\td1=k;\n\t\t}\n\t\tif(y1==y2)\n\t\t{\n\t\t\tif(m1==m2)\n\t\t\t{\n\t\t\t\td=fabs(d2-d1);\n\t\t\t\tprintf(\"%d\\n\",d);\n\t\t\t}\n\t\t\telse if(m12))\n \t{\n\t \tt1++;\n \t}\n \tswitch(m2)\n {\n\t \tcase 1:t2=d2;break;\n\t \tcase 2:t2=d2+31;break;\n\t \tcase 3:t2=d2+28+31;break;\n\t \tcase 4:t2=d2+31+28+31;break;\n \t \tcase 5:t2=d2+30+31+28+31;break;\n \t \tcase 6:t2=d2+31+30+31+28+31;break;\n \t \tcase 7:t2=d2+30+31+30+31+28+31;break;\n \t \tcase 8:t2=d2+31+30+31+30+31+28+31;break;\n \t \tcase 9:t2=d2+31+31+30+31+30+31+28+31;break;\n\t \tcase 10:t2=d2+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 11:t2=d2+31+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 12:t2=d2+30+31+30+31+31+30+31+30+31+28+31;break;\n \t}\n\t if((y2%4==0&&y2%100!=0||y2%400==0)&&(m2>2))\n \t{\n\t \t t2++;\n \t }\n \td=t2-t1;\n \tprintf(\"%d\\n\",d);\n\t\t\t}\n\t\t\telse if(m1>m2)\n\t\t\t{\n\t\t\t\t\tswitch(m1)\n \t{\n\t \tcase 1:t1=d1;break;\n \t\t case 2:t1=d1+31;break;\n \t\t case 3:t1=d1+28+31;break;\n \t\t case 4:t1=d1+31+28+31;break;\n \t\t case 5:t1=d1+30+31+28+31;break;\n \t\t case 6:t1=d1+31+30+31+28+31;break;\n \t\t case 7:t1=d1+30+31+30+31+28+31;break;\n\t \tcase 8:t1=d1+31+30+31+30+31+28+31;break;\n\t \tcase 9:t1=d1+31+31+30+31+30+31+28+31;break;\n\t \tcase 10:t1=d1+30+31+31+30+31+30+31+28+31;break;\n\t\t case 11:t1=d1+31+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 12:t1=d1+30+31+30+31+31+30+31+30+31+28+31;break;\n \t}\n \tif((y1%4==0&&y1%100!=0||y1%400==0)&&(m1>2))\n \t{\n\t \tt1++;\n \t}\n \tswitch(m2)\n {\n\t \tcase 1:t2=d2;break;\n\t \tcase 2:t2=d2+31;break;\n\t \tcase 3:t2=d2+28+31;break;\n\t \tcase 4:t2=d2+31+28+31;break;\n \t\tcase 5:t2=d2+30+31+28+31;break;\n \t \tcase 6:t2=d2+31+30+31+28+31;break;\n \t \tcase 7:t2=d2+30+31+30+31+28+31;break;\n \t\tcase 8:t2=d2+31+30+31+30+31+28+31;break;\n \t\tcase 9:t2=d2+31+31+30+31+30+31+28+31;break;\n\t \tcase 10:t2=d2+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 11:t2=d2+31+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 12:t2=d2+30+31+30+31+31+30+31+30+31+28+31;break;\n \t}\n\t if((y2%4==0&&y2%100!=0||y2%400==0)&&(m2>2))\n \t{\n\t \tt2++;\n \t}\n \td=t1-t2;\n \tprintf(\"%d\\n\",d);\n\t\t\t}\n\t\t}\n\t\telse if(y12))\n \t{\n\t \tt1++;\n\t \tt1=366-t1;\n \t}\n \telse if((y1%4==0&&y1%100!=0||y1%400==0)&&(m1<2))\n \t{\n\t \tt1=366-t1;\n\t }\n\t else \n\t {\n \t \tt1=365-t1;\n \t}\n \tswitch(m2)\n {\n\t \tcase 1:t2=d2;break;\n\t \tcase 2:t2=d2+31;break;\n\t \tcase 3:t2=d2+28+31;break;\n\t \tcase 4:t2=d2+31+28+31;break;\n \t\tcase 5:t2=d2+30+31+28+31;break;\n \t \tcase 6:t2=d2+31+30+31+28+31;break;\n \t \tcase 7:t2=d2+30+31+30+31+28+31;break;\n \t \tcase 8:t2=d2+31+30+31+30+31+28+31;break;\n \t \tcase 9:t2=d2+31+31+30+31+30+31+28+31;break;\n\t \tcase 10:t2=d2+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 11:t2=d2+31+30+31+31+30+31+30+31+28+31;break;\n\t \tcase 12:t2=d2+30+31+30+31+31+30+31+30+31+28+31;break;\n \t }\n\t if((y2%4==0&&y2%100!=0||y2%400==0)&&(m2>2))\n {\n\t \tt2++;\n }\n l=y2-y1-1;\n \tif(l==0)\n \t{\n\t \td=t1+t2;\n }\n else if(l>0)\n {\n \t d=0\n \tfor(i=1;i<=l;i++)\n \t{\n\t y[i]=y1+i;\n\t if(y[i]%4==0&&y[i]%100!=0||y[i]%400==0)\n\t {\n \t\t d[i]=366;\n \t }\n \t else \n \t {\n \t d[i]=365;\n }\n d=d+d[i];\n }\n d=t1+t2+d;\n printf(\"%d\\n\",d);\n }\n\t\t}\n\t}\n}", "lang": "GNU C", "bug_code_uid": "ea0fe252a9cac0e8ba3f6e2714fbf43d", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "c56b3bfb53be92e61ef84c89ef78be61", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.483695652173913, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \n\nint odd_goldbach(int *prime, int n) {\n int i;\n for (i = 2; i <= n-i; i++) {\n if (prime[i] && prime[n-i]) {\n return 1;\n }\n }\n return 0;\n}\n\nint main(void) {\n int n, *prime, i, j;\n scanf(\"%d\",&n);\n prime = (int*)malloc(sizeof(int)*(n+1));\n assert(prime);\n for (i = 2; i <= n; i++) {\n prime[i] = 1;\n }\n for (i = 2; i <= n; i++) {\n for (j = 2; prime[i] && i*j <= n; j++) {\n prime[i*j] = 0;\n }\n }\n if (prime[n]) {\n putchar('1');\n } else if (!(n%2) || odd_goldbach(prime,n)) {\n putchar('2');\n } else {\n putchar('3');\n }\n free(prime);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "5575da779981f121a31585bac000d19b", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "ea088103077febfadd109e40368d0bfe", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8521617852161785, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n\tint n,a,t[104],i,left,right,ans=0,flag1=0,flag2=0;\n\tscanf(\"%d%d\",&n,&a);\n\tleft=a-1;\n\tright=a-1;\n\tfor(i=0;i=0 || right0)\n\t\t{\n\t\t\tleft=left-1;\n\t\t\tflag1=1;\n\t\t}\n\t\tif(right\nint main(){\n long long n,i;\n int flg=0;\n scanf(\"%lli\",&n);\n if(n%2){\n for(i=3;i*i<=n;i++){\n if((n%i)==0){\n flg=1;\n break;\n }\n }\n if(flg==0)\n n = 0\n else\n n -= i;\n n = n/2;\n n++;\n }\n else n /= 2;\n printf(\"%lli\\n\",n);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "a67aed3f2bcfced12e3895b01a8b329d", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "059dd3eca973851672fac154568044d4", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8790035587188612, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main()\n{\n int n,i=0,j=i+1,c=0;\n scanf(\"%d\",&n);\n char str[100];\n for(int i=0;i\n#include \n\n#define A 100000000\n#define B 1000\n#define PMAX 316223\n#define P 27293\n#define P3 10000\n#define L1 32000\n#define min(a,b) (((a) < (b)) ? (a) : (b))\n#define max(a,b) (((a) > (b)) ? (a) : (b))\n\nint a[A+1];\nunsigned int b[B] = {\n 0, 5761455, 11078937, 16252325, 21336326, 26355867, 31324703, 36252931, 41146179, 46009215,\n 50847534, 55662470, 60454705, 65228333, 69985473, 74726528, 79451833, 84163019, 88862422, 93547928,\n 98222287, 102886526, 107540122, 112184940, 116818447, 121443371, 126062167, 130670192, 135270258, 139864011,\n 144449537, 149028641, 153600805, 158165829, 162725196, 167279333, 171827136, 176369517, 180906194, 185436625,\n 189961812, 194481069, 198996103, 203507248, 208013454, 212514323, 217011319, 221504167, 225991743, 230475545,\n 234954223, 239429993, 243902342, 248370960, 252834065, 257294520, 261751864, 266206294, 270655552, 275101551,\n 279545368, 283984956, 288422869, 292856421, 297285198, 301711468, 306137611, 310558733, 314977166, 319391721,\n 323804352, 328215206, 332620900, 337024801, 341426904, 345826612, 350221825, 354615116, 359006517, 363395981,\n 367783654, 372168766, 376549859, 380930729, 385307831, 389682427, 394055910, 398425675, 402793457, 407159590,\n 411523195, 415885628, 420243162, 424603409, 428958595, 433311792, 437663672, 442014876, 446362736, 450708777,\n 455052511, 459394441, 463733626, 468072089, 472408200, 476741968, 481074475, 485405902, 489736021, 494062787,\n 498388617, 502712575, 507036251, 511354887, 515673696, 519991125, 524309392, 528624525, 532936342, 537247292,\n 541555851, 545864306, 550170437, 554476170, 558778993, 563082532, 567382703, 571680924, 575978253, 580275482,\n 584570200, 588863345, 593155089, 597445378, 601735269, 606022680, 610308664, 614594106, 618878615, 623159296,\n 627440336, 631717982, 635997249, 640275231, 644550922, 648825715, 653099304, 657371139, 661643304, 665911851,\n 670180516, 674447835, 678714823, 682979568, 687242934, 691504332, 695766925, 700028114, 704286233, 708543557,\n 712799821, 717055212, 721310048, 725563140, 729813991, 734065508, 738315156, 742564929, 746813071, 751060249,\n 755305935, 759550004, 763794029, 768035554, 772276773, 776516528, 780756650, 784994469, 789230673, 793467703,\n 797703398, 801937611, 806169530, 810401956, 814633249, 818864199, 823092766, 827320850, 831548431, 835773764,\n 840000027, 844224822, 848450250, 852673966, 856895823, 861116918, 865335133, 869555570, 873772692, 877989808,\n 882206716, 886422213, 890636921, 894850907, 899064419, 903275849, 907487780, 911698381, 915907322, 920117006,\n 924324489, 928532509, 932738007, 936943763, 941147666, 945351970, 949555347, 953758330, 957958052, 962158684,\n 966358351, 970556800, 974755898, 978951680, 983147464, 987343369, 991538483, 995733104, 999926054, 1004118104,\n 1008309544, 1012500258, 1016690917, 1020879037, 1025067175, 1029256469, 1033444454, 1037631294, 1041815774, 1046001482,\n 1050186367, 1054370637, 1058552429, 1062734476, 1066916147, 1071094927, 1075274949, 1079454128, 1083631538, 1087809564,\n 1091987405, 1096163370, 1100339660, 1104513787, 1108687177, 1112860305, 1117034447, 1121205592, 1125376629, 1129547281,\n 1133717820, 1137887191, 1142056097, 1146225390, 1150393648, 1154560299, 1158727002, 1162892823, 1167057747, 1171221046,\n 1175385155, 1179549444, 1183711384, 1187874380, 1192034212, 1196195238, 1200356153, 1204515304, 1208673910, 1212829795,\n 1216987937, 1221145073, 1225300872, 1229455037, 1233609164, 1237764170, 1241917157, 1246070670, 1250224878, 1254376178,\n 1258528162, 1262678524, 1266827683, 1270976954, 1275125632, 1279274172, 1283421484, 1287567873, 1291715676, 1295861693,\n 1300005926, 1304150462, 1308296664, 1312440578, 1316583470, 1320724811, 1324868019, 1329010956, 1333151863, 1337291809,\n 1341430624, 1345570079, 1349708221, 1353846756, 1357984935, 1362122305, 1366257814, 1370393786, 1374528892, 1378664634,\n 1382799415, 1386933522, 1391065576, 1395199789, 1399331489, 1403463860, 1407594647, 1411724086, 1415855689, 1419985631,\n 1424115489, 1428244053, 1432371870, 1436498522, 1440625629, 1444751745, 1448877006, 1453002152, 1457125036, 1461250000,\n 1465374659, 1469497594, 1473620220, 1477744125, 1481866173, 1485988244, 1490109683, 1494229934, 1498349689, 1502469332,\n 1506589876, 1510706235, 1514824921, 1518942965, 1523061505, 1527178351, 1531294454, 1535409890, 1539526326, 1543640517,\n 1547756812, 1551870851, 1555985016, 1560097442, 1564208549, 1568320054, 1572432177, 1576544661, 1580654270, 1584764017,\n 1588873108, 1592982840, 1597091049, 1601199712, 1605308326, 1609414491, 1613521803, 1617628777, 1621733835, 1625839726,\n 1629945987, 1634052052, 1638156927, 1642258972, 1646361787, 1650465128, 1654567808, 1658669200, 1662770302, 1666869794,\n 1670972264, 1675072419, 1679170566, 1683270249, 1687369711, 1691467151, 1695565190, 1699662748, 1703761548, 1707858902,\n 1711955433, 1716050469, 1720144848, 1724241897, 1728336282, 1732430410, 1736526180, 1740619156, 1744713632, 1748805530,\n 1752898084, 1756987393, 1761078122, 1765169921, 1769260641, 1773351175, 1777442877, 1781530474, 1785621307, 1789709560,\n 1793798703, 1797887260, 1801975182, 1806062390, 1810149996, 1814236123, 1818322676, 1822407623, 1826489988, 1830575906,\n 1834658067, 1838742792, 1842825653, 1846909270, 1850992005, 1855074218, 1859156347, 1863238351, 1867320859, 1871402335,\n 1875482847, 1879562930, 1883642470, 1887722398, 1891800587, 1895879932, 1899958276, 1904036638, 1908114573, 1912191800,\n 1916268743, 1920347116, 1924422570, 1928498011, 1932573349, 1936646486, 1940721696, 1944797174, 1948871367, 1952945594,\n 1957018338, 1961089383, 1965161808, 1969233350, 1973304195, 1977376665, 1981447779, 1985519033, 1989588548, 1993659289,\n 1997729452, 2001796366, 2005864843, 2009933793, 2014002593, 2018069377, 2022137196, 2026204289, 2030270517, 2034337796,\n 2038404475, 2042469434, 2046534053, 2050598713, 2054662457, 2058727455, 2062791593, 2066855115, 2070918071, 2074981871,\n 2079045540, 2083107257, 2087170358, 2091232421, 2095293756, 2099353852, 2103414866, 2107473358, 2111533438, 2115593696,\n 2119654578, 2123711202, 2127769041, 2131828079, 2135887473, 2139945263, 2144002868, 2148061201, 2152118222, 2156173876,\n 2160230408, 2164287399, 2168343450, 2172397905, 2176451935, 2180506650, 2184561319, 2188616526, 2192670595, 2196723874,\n 2200777436, 2204828910, 2208879508, 2212930015, 2216982800, 2221034120, 2225087204, 2229138005, 2233188780, 2237237738,\n 2241286680, 2245337711, 2249386635, 2253437044, 2257486659, 2261534669, 2265582088, 2269630722, 2273677293, 2277723942,\n 2281770277, 2285816118, 2289861391, 2293908247, 2297955870, 2301999709, 2306044120, 2310088597, 2314134053, 2318177990,\n 2322223112, 2326266900, 2330308778, 2334351201, 2338393413, 2342436031, 2346478314, 2350519355, 2354560561, 2358602447,\n 2362642765, 2366683716, 2370724495, 2374763504, 2378804084, 2382843532, 2386880413, 2390919906, 2394959109, 2398996112,\n 2403034927, 2407071577, 2411110078, 2415147307, 2419181034, 2423219093, 2427255367, 2431292536, 2435327045, 2439361501,\n 2443396396, 2447431831, 2451466331, 2455500451, 2459534282, 2463565779, 2467597919, 2471632122, 2475665529, 2479696435,\n 2483729191, 2487761399, 2491793997, 2495825196, 2499856755, 2503887935, 2507918465, 2511947717, 2515978063, 2520007177,\n 2524038155, 2528067401, 2532097043, 2536126664, 2540155255, 2544183491, 2548211228, 2552238285, 2556266399, 2560294002,\n 2564319542, 2568345835, 2572372442, 2576397670, 2580421933, 2584447929, 2588472785, 2592497820, 2596522622, 2600546330,\n 2604571471, 2608595062, 2612618628, 2616643294, 2620665663, 2624687920, 2628709369, 2632732626, 2636754699, 2640776029,\n 2644799757, 2648820585, 2652840994, 2656861044, 2660881979, 2664902170, 2668922912, 2672943760, 2676963401, 2680982125,\n 2685000601, 2689021011, 2693039441, 2697057353, 2701075683, 2705092716, 2709109210, 2713125397, 2717143223, 2721159932,\n 2725176643, 2729193507, 2733210696, 2737225536, 2741242121, 2745257057, 2749272015, 2753286718, 2757299847, 2761314795,\n 2765327756, 2769341791, 2773356225, 2777369850, 2781383306, 2785394924, 2789408169, 2793419860, 2797431717, 2801443922,\n 2805454432, 2809465484, 2813477356, 2817487436, 2821497837, 2825509231, 2829520068, 2833530738, 2837539518, 2841549369,\n 2845558213, 2849566042, 2853574755, 2857584531, 2861594266, 2865601989, 2869610768, 2873619181, 2877625961, 2881633373,\n 2885641353, 2889648502, 2893654733, 2897660376, 2901667770, 2905672946, 2909678043, 2913685600, 2917689568, 2921695146,\n 2925699539, 2929702761, 2933706263, 2937709465, 2941713524, 2945717900, 2949719949, 2953724092, 2957726064, 2961727364,\n 2965730599, 2969734593, 2973737899, 2977740005, 2981742619, 2985744869, 2989743222, 2993744024, 2997743403, 3001742385,\n 3005740846, 3009740083, 3013740632, 3017740443, 3021739912, 3025737894, 3029738266, 3033736354, 3037734260, 3041732620,\n 3045730736, 3049728863, 3053726975, 3057724728, 3061722012, 3065718156, 3069714416, 3073709903, 3077706121, 3081700773,\n 3085694966, 3089690887, 3093686041, 3097682212, 3101677762, 3105672385, 3109665704, 3113660777, 3117654258, 3121648738,\n 3125641477, 3129636165, 3133628489, 3137621629, 3141615091, 3145607391, 3149600532, 3153593186, 3157583551, 3161575400,\n 3165568071, 3169558897, 3173549966, 3177541505, 3181531857, 3185524100, 3189515502, 3193505484, 3197494480, 3201485771,\n 3205474366, 3209464223, 3213453462, 3217442657, 3221430632, 3225418712, 3229406344, 3233394790, 3237380550, 3241367601,\n 3245353518, 3249340672, 3253327262, 3257314501, 3261302137, 3265288786, 3269274318, 3273261676, 3277246756, 3281232235,\n 3285218896, 3289205184, 3293189136, 3297172860, 3301158042, 3305141278, 3309125457, 3313108871, 3317092589, 3321076365,\n 3325059246, 3329042269, 3333024320, 3337007745, 3340990584, 3344973656, 3348954479, 3352936965, 3356918381, 3360899212,\n 3364880246, 3368861514, 3372843128, 3376824341, 3380804536, 3384785252, 3388764045, 3392744352, 3396724969, 3400703302,\n 3404683449, 3408661629, 3412641191, 3416621174, 3420600239, 3424577712, 3428556536, 3432533925, 3436512942, 3440489299,\n 3444467709, 3448443650, 3452420745, 3456398055, 3460376073, 3464354329, 3468330724, 3472306712, 3476280273, 3480257644,\n 3484232867, 3488208449, 3492182057, 3496156616, 3500132047, 3504107018, 3508083271, 3512056531, 3516031243, 3520004496,\n 3523979003, 3527952545, 3531925382, 3535899657, 3539873170, 3543843428, 3547815425, 3551789160, 3555761507, 3559733867,\n 3563706203, 3567677571, 3571648151, 3575618333, 3579587822, 3583559953, 3587530335, 3591499540, 3595471441, 3599441281,\n 3603412533, 3607382383, 3611353499, 3615323157, 3619293204, 3623260438, 3627230054, 3631199924, 3635167788, 3639133977,\n 3643101671, 3647069932, 3651037811, 3655006291, 3658974043, 3662941495, 3666909363, 3670877228, 3674842642, 3678809724,\n 3682776125, 3686743894, 3690708635, 3694674136, 3698640744, 3702607660, 3706572805, 3710536268, 3714502398, 3718465031,\n 3722428991, 3726394088, 3730358421, 3734323031, 3738287024, 3742250941, 3746214561, 3750179004, 3754141753, 3758105608,\n 3762067054, 3766030492, 3769992222, 3773955567, 3777917868, 3781881979, 3785842285, 3789803781, 3793766088, 3797726848,\n 3801688660, 3805649459, 3809611918, 3813571463, 3817534298, 3821493048, 3825453351, 3829412874, 3833371480, 3837330842,\n 3841291749, 3845250279, 3849209920, 3853169493, 3857129155, 3861088365, 3865047067, 3869005617, 3872964725, 3876923182,\n 3880881273, 3884839528, 3888796569, 3892753631, 3896710330, 3900667023, 3904623253, 3908580398, 3912536328, 3916492455,\n 3920449831, 3924406577, 3928362015, 3932316075, 3936271016, 3940227600, 3944182809, 3948137829, 3952093061, 3956048108,\n 3960003559, 3963957671, 3967911833, 3971865657, 3975818018, 3979772869, 3983725586, 3987677658, 3991630533, 3995584016,\n 3999537962, 4003491500, 4007444082, 4011396563, 4015348558, 4019300356, 4023253116, 4027204376, 4031157206, 4035109071,\n 4039061553, 4043014010, 4046965198, 4050915644, 4054865513, 4058816261, 4062767391, 4066716906, 4070666662, 4074616057,\n 4078566781, 4082514143, 4086464266, 4090414411, 4094363532, 4098312828, 4102261058, 4106208569, 4110157418, 4114105592\n};\nint p[P];\nlong long y[P];\n\nint main()\n{\n\tlong long n, n2, n3, bl, bh, ans = 0, k, kl, kh;\n\tint i, j, b1=-1, b2, q2, c;\n\n\tscanf(\"%I64d\", &n);\n\n\t// p\n\tp[0] = 2; k = 1;\n\tfor (i = 3; i <= PMAX; i += 2)\n\t{\n\t\tif (a[i] == 0)\n\t\t{\n\t\t\tp[k++] = i;\n\t\t\tif (i <= PMAX/i)\n\t\t\t\tfor (j = i * i; j <= PMAX; j += i) \n\t\t\t\t\ta[j] = 1;\n\t\t};\n\t}\n\n\t// 2\n\tfor (i = 0; i < P; i++)\n\t{\n\t\tn2 = n / p[i];\n\t\tif (n2 == 0 || n2 < p[i]) break;\n\t\tb2 = (int) (n2 / A); \n\t\tq2 = n2 % A;\n\t\tif (b1 != b2)\n\t\t{\n\t\t\tmemset(a, 0, sizeof(a));\n\t\t\tb1 = b2;\n\t\t\tbl = 1ll * b1 * A;\n\t\t\tbh = bl + q2 + 1;\n\t\t\tc = (b1 == 0? 1: 0);\n\t\t\ty[0] = -1;\n\t\t\tfor (j = 1; j < P; j++)\n\t\t\t{\n\t\t\t\ty[j] = max(bl + bl/p[j]*p[j] + p[j], 1ll * p[j] * p[j]) - bl;\n\t\t\t\tif ((y[j] & 1) == 0) y[j] += p[j];\n\t\t\t}\n\t\t\tfor (kl = bl; kl < bh; kl += L1)\n\t\t\t{\n\t\t\t\tkh = min(kl + L1, bh) - bl;\n\t\t\t\tfor (j = 1; j < P; j++)\n\t\t\t\t{\n \t\t\t\t\tfor (k = y[j]; k < kh; k += 2ll*p[j]) \n\t\t\t\t\t\ta[k] = 1;\n\t\t\t\t\ty[j] = k;\n\t\t\t\t}\n\t\t\t\tif (kl == 0)\n\t\t\t\t{\n\t\t\t\t\tk = 3;\n\t\t\t\t\ta[2] = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tk = kl - bl + 1;\n\t\t\t\t}\n \t\t\t\tfor (; k < kh; k+=2)\n\t\t\t\t\ta[k] = a[k+1] = (a[k]==0? ++c: c);\n\t\t\t}\n\t\t} // b\n\t\tans = ans + b[b1] + a[q2] - (i + 1);\n\t}\n\n\t// 3\n\ti = 0; j = P;\n\tfor (;;)\n\t{\n\t\tk = i + (j - i) / 2;\n\t\tif (k == i)\n\t\t\tbreak;\n\t\tif (p[k] > P3)\n\t\t\tn3 = n + 1;\n\t\telse\n\t\t\tn3 = (long long) p[k] * p[k] * p[k];\n\t\tif (n3 > n)\n\t\t\tj = (int) k;\n\t\telse if (n3 < n)\n\t\t\ti = (int) k;\n\t\telse \n\t\t\tbreak;\n\t}\n\tif (p[k]*p[k]*p[k]<=n)\n\t\tans += k + 1;\n\n\tprintf(\"%I64d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "19150a511161b038d83675e2eaba7ceb", "src_uid": "ffb7762f1d60dc3f16e9b27ea0ecdd7d", "apr_id": "74da070ccd9e94c22088a1adb4f1afc4", "difficulty": 2400, "tags": ["dp", "number theory", "data structures", "math", "sortings", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.685, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include\nint main()\n{\nint i,j,k,n,t=0;\nscanf(\"%ld\\n%ld\",&k,&n);\nif(n%k==0)\nfor(i=k;i<=n;i*=k)\n{\nif(i==n)\n{printf(\"YES\\n%d\",t);\n\nreturn 0;\n}t++;}\nprintf(\"NO\");\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "4d2db6bf193587560af3afd070e400f5", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "0b069ea8ea72769e789bffe80f237908", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9851632047477745, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n\nint main(void){\n int n,i,sum1=0,sum2=0;\n\n scanf(\"%d\",&n);\n\n char a[n];\n\n scanf(\"%s\",a);\n\n for(i=0;i\n\nint main()\n{\nint x,t,a,b,da,db,i,j,flag=0,c,y;\n\nscanf(\"%d %d %d %d %d %d\",&x,&t,&a,&b,&da,&db);\nc=b;\n\nif(x==0)\n{\nprintf(\"YES\");\n}\n\nelse\nif(x!=0)\n{\nfor(i=0;i\n\nint main()\n{\n int cn1, cn2, cn3, cn4;\n scanf(\"%d%d%d%d\", &cn1, &cn2, &cn3, &cn4);\n if(cn1 == cn4 && (cn2 > 0 || cn3 == 0))\n return 1;\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "fe004c4bfff5514d2ef0e84404f182c3", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "ef7f2a6096a2d599ee95b4e860d0b81d", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9978586723768736, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/* Problem: 779B - Weird Rounding */\n/* Solver: Gusztav Szmolik */\n\n#include \n#include \n#include \n\nint main ()\n {\n char n[12];\n unsigned short k;\n unsigned short ln;\n unsigned short cz;\n unsigned short i;\n \n if (scanf(\"%11s %hu\",n,&k) != 2)\n return -1;\n ln = strlen (n);\n if (ln > 10)\n return -1;\n cz = 0;\n for (i = 0; i < ln; i++)\n {\n if (!isdigit(n[i]))\n return -1;\n if (n[i] == '0')\n cz++;\n }\n if (ln > 1 && n[0] == '0')\n return -1;\n if (ln == 10 && strcmp(n,\"2000000000\"))\n return -1;\n if (!cz)\n return -1;\n if (k < 1 || k > 9)\n return -1;\n if (k > cz)\n {\n printf (\"%hu\\n\",ln-1);\n return 0;\n }\n cz = 0;\n for (i = 0; cz < k; i++)\n if (n[ln-1-i] == '0')\n cz++;\n printf (\"%hu\\n\",i-k);\n return 0;\n }\n", "lang": "GNU C", "bug_code_uid": "de61d145ceabd023aafa46b6b77cf8eb", "src_uid": "7a8890417aa48c2b93b559ca118853f9", "apr_id": "1f75ee76dfd42ac31f94fefa68043398", "difficulty": 1100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9683124539425203, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main(){\n int i,j,n,m,k,stock[81]={0},temp=0,count=0,ans = 0, a[81],check[81]={0};\n scanf(\"%d %d\",&n ,&k);\n for(j=1;j<=n;j++)\n scanf(\"%d\",&a[j]);\n stock[a[1]]++;\n ans++;\n count++;\n for(j=2;j<=n;j++){\n if(stock[a[j]] == 1) continue;\n if(count == k){\n for(i=0; i<81; i++)\n check[i] = 0;\n temp = count;\n for(i=j+1; i<=n; i++){\n if(temp == 1){\n for(m=1; m<81; m++)\n if(check[m] == 0 && stock[m]){\n stock[m] = 0;\n count--;\n break;\n }\n break;\n }\n if(stock[a[i]] == 1 && check[a[i]] == 0){\n temp--;\n check[a[i]] = 1;\n }\n }\n if(temp!=1){\n for(m=1; m<81; m++)\n if(check[m] == 0 && stock[m]){\n stock[m] = 0;\n count--;\n break;\n }\n }\n }\n stock[a[j]]++;\n count++;\n ans++;\n /*printf(\"%d\\t\",ans);\n for(i=0; i<81;i++)\n if(stock[i]) printf(\"%d \",i);\n printf(\"\\n\");*/\n }\n printf(\"%d\\n\",ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "01fee5746a2fdab78b7045dfc3aa49ee", "src_uid": "956228e31679caa9952b216e010f9773", "apr_id": "27062eecc3ee66e90268d2285170bcbc", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9992050874403816, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n=0,i=0,j=0,book[81]={0},max=0,now[81]={0},time[81]={0},money=0,number=0,de=0,k=0,chose=0;\n scanf(\"%d %d\",&n,&max);\n for(i=0;i\n\ntypedef unsigned long long int uint64;\ntypedef unsigned char uint8;\n\nuint8 findsum(uint64 x)\n{\n uint8 sum=0;\n uint8 temp;\n while(x!=0)\n {\n temp = x%10;\n sum += temp;\n x= x/10;\n }\n return sum;\n}\n\nint main(void)\n{\n uint64 x;\n uint64 maxsum=0,maxnum=0,sum;\n scanf(\"%llu\",&x);\n for(int i=x;i>0;i--)\n {\n sum = findsum(i);\n if(sum > maxsum)\n {\n maxsum = sum;\n maxnum = i;\n }\n }\n\n printf(\"%llu\",maxnum);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "6876abeda6f56c9e74a39bb9ad7e4a63", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "dd9f8045f511292e1c82861ad217ed9b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.981897970378497, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\n#include\n#include\n/*#include\n#include\n#include\n#include\n#include\n#include\n#include\n\n#include\n#include\n#include\n#include\n#include*/\n#define maxn 110\n\nint main()\n{\n char a[maxn];\n char *p;\n int n;\n int k[maxn];\n int flag;\n int i;\n while(scanf(\"%d\",&n))\n\n {\n getchar();\n memset(k,0,sizeof(k));\n gets(a);\n p=a;\n i=0;\n\n flag=0;\n while(*p)\n {\n while(*p=='B')\n { if(!flag)\n i++;\n\n flag=1;\n k[i]++;\n p++;\n }\n p++;\n flag=0;\n }\n printf(\"%d\\n\",i);\n if(i)\n\n {for(int j=1;j\n\nint main()\n{\nlong long int ar[10000];\nlong long int a,b,c,count=0;\nlong long k,n,i,j;\nlong long two=0,five=0;\nscanf(\"%lld\",&n);\n\nfor(i=5;;i++)\n{\n five=0;\n for(j=5;j<=i;j=j+5)\n {\n k=j;\n while(k%5==0)\n {\n five++;\n k=k/5;\n }\n\n }\n if(five==n){ar[count]=i;count++;}\n if(five>n){break;}\n}\nprintf(\"%lld\\n\",count);\nfor(i=0;i\n#include\n#include\n#include\nvoid main()\n{\n\tint n,l,j,i,p,ctr=0,btr=0;\n\tint bk[n],bs[n],k[n];\n\tint h=0;\n\t\n\t\n\t\n\tprintf(\"enter the n and l\");\n\tscanf(\"%d%d\",&n,&l);\n\n\tfor(i=0;i=l)\n\t\t\tk[j]=i+bs[j]-l;\n\t\t\telse\n\t\t\tk[j]=i+bs[j];\n\t\tctr=0;\n\t\tfor(p=0;p0)\n\t\t{\n\t\tbtr++;\n\t\tcontinue;\n\t\t}\n\t\t\n\t\t}\n\t\tif(btr==n)\n\t\t{\n\t\t\n\t\tprintf(\"yes\");\n\t\t\n\t\tbreak;\n\t\t}\n\t\t\n\t\t\t\t\n\n\n\t}\n\t\n\t\n}\n", "lang": "GNU C11", "bug_code_uid": "9f589914db94895ffd964556de0d49c0", "src_uid": "3d931684ca11fe6141c6461e85d91d63", "apr_id": "270a9a716f26d1d44ebf33c45dd46e80", "difficulty": 1300, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8316229570505511, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n#include \n\nint max(int a , int b){\n\tif(a >b)\n\t\treturn a ;\n\treturn b ;\n}\nint min(int a, int b){\n\tif(a < b)\n\t\treturn a ;\n\treturn b ;\n}\n\nlong long dpp[5002][5002];\nint n , a , b , k ;\n\n#define MOD 1000000007\n\nvoid build(long long arr[] , long long rmq []){\n\tint i ;\n\tfor(i = 1 ; i <= n ; i++){\n\t\t// cout << arr[i] << \" \" ;\n\t\tint index = i ;\n\t\twhile(index <= n){\n\t\t\trmq[index] += arr[i] ;\n\t\t\tindex += (index & -index);\n\t\t}\n\t}\n\t//cout << endl ;\n}\n\nlong long query(long long rmq [] , int to){\n\tlong long ret = 0 ;\n\t// cout << \"to : \" << to << \" : \" ;\n\twhile(to > 0){\n\t\tret += rmq[to];\n\t\tret %= MOD ;\n\t\tto -= (to & -to);\n\t}\n\t//cout < \" << endl ;\n\t\t// for(int j = 1 ; j <= n ; j++){\n\t\t// \tcout << dpp[i][j] << \" \";\n\t\t// }\n\t\t//cout << endl ;\n\t}\n\tprintf(\"%d\" , dpp[k][a]);\n\treturn 0 ;\n}", "lang": "GNU C", "bug_code_uid": "cc389ead7d77e3e3f8f8a9b4afec9d2a", "src_uid": "142b06ed43b3473513995de995e19fc3", "apr_id": "c4dd30a1a74ecaa9c69f49518dbea68a", "difficulty": 1900, "tags": ["dp", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9918918918918919, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n long long int n,i;\n scanf(\"%lld\",&n);\n int arr[n];int brr[n];\n for(i=0;i\n\nint main() {\n int in,i;\n long long x,go;\n scanf(\"%d\",&in);\n x=in<0?-in:in;\n if(x==0) { i=0; goto done; }\n for(go=0,i=1;;i++) {\n go+=i;\n if(go==x) break;\n if(go>x && (go-x)%2==0 && (go-x)/2<=i) break;\n }\ndone:\n printf(\"%d\\n\",i);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5314f65a5c3792a6401ce5af009fc93e", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "5fb73a890dc86c80400d9a9c0e5846fb", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9077155824508321, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "\n/* AUTHOR:AKASH JAIN\n* USERNAME:akash19jain \n* DATE:31/03/2019 \n*/\n#include\n#include\n#include\n#include\n#include\nint cmp(const void * a,const void * b)\n{\n return (*(int*)a - *(int*)b);\n}\nint main()\n{\n long long t=1;\n //scanf(\"%lld\",&t);\n while(t--)\n {\n long long n;\n scanf(\"%lld\",&n);\n for(long long i=0;i\nint main()\n{\n int a[5][5],i,j,ans=0;\n for(i=0;i<5;i++)\n for(j=0;j<5;j++)\n {\n scanf(\"%d\",a[i][j]);\n if(a[i][j]==1)\n break;\n }\n if(i>=3)\n ans=ans+i-3;\n if(i<3)\n ans=ans+3-i;\n if(j>=3)\n ans=ans+j-3;\n if(j<3)\n ans=ans+3-j;\n printf(\"%d\",ans);\n}", "lang": "GNU C11", "bug_code_uid": "ccea5940129fdcf677e2303c2501c8b3", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "2ef1e0dbed64a323147dcc02fc5ce852", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.049666757965854104, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\n#include\n#include\n\nint k[20];\n\n__int64 P(__int64 n){\n memset(k,0,sizeof(k));\n int i,j;\n i=0;\n while(n){\n k[i++]=n%10;\n n/=10;\n }\n int m=i-1;\n for(i=m;i>=0;i--){\n if(k[i]>7){\n for(j=i;j<=m;j++){\n if(k[j]>7){\n k[j+1]=k[j+1]+1;\n if(j+1>m)\n m=j+1;\n k[j]=0;\n }\n }\n break;\n }\n }\n __int64 sum=0;\n for(i=m;i>=0;i--){\n if(k[i]<4){\n sum=sum*10+4;\n for(j=i-1;j>=0;j--){\n sum=sum*10+4;\n }\n break;\n }\n else if(k[i]==4){\n sum=sum*10+4;\n }\n else if(k[i]<7){\n sum=sum*10+7;\n for(j=i-1;j>=0;j--){\n sum=sum*10+4;\n }\n break;\n }\n else if(k[i]==7){\n sum=sum*10+7;\n }\n }\n return sum;\n}\n\nint main(void){\n __int64 i,x,y,sum,k;\n scanf(\"%I64d %I64d\",&x,&y);\n sum=0;\n k=0;\n for(i=x;i<=y;i++){\n if(k\nint main()\n{\n int i,l,count=0;\n char pos[100];\n scanf(\"%s\",pos);\n l=strlen(pos);\n for(i=0;i=7)\n printf(\"YES\");\n }\n }\n if(count<7)\n printf(\"NO\");\n\n}", "lang": "GNU C", "bug_code_uid": "28bc1439f49bac60a304dfb03cbb13d1", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "5ad2c927fa331a4c7efab0f7f6048df5", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1440677966101695, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n\tint suma,sumb;\n\tchar f;\n\tint i,j;\n\tint arr[8][8];\n\tint k=1;\n\tfor (i=1;i<=8;i++)\n\t{\n\t\tfor (j=1;j<=8;j++)\n\t\t{\t\n\t\t\tscanf(\"%c\",&arr[i][j]);\n\t\t\tif (k%8==0)\n\t\t\t{\tscanf(\"%c\",&f);\n\t\t\t\tk=1;\n\t\t\t}\n\t\t\telse\n\t\t\t\tk++;\n\t\t\t\n\t\t\tif (arr[i][j]=='Q')\n\t\t\t\tsuma=suma+9;\n\t\t\tif (arr[i][j]=='R')\n\t\t\t\tsuma=suma+5;\n\t\t\tif (arr[i][j]=='B')\n\t\t\t\tsuma=suma+3;\n\t\t\tif (arr[i][j]=='N')\n\t\t\t\tsuma=suma+3;\n\t\t\tif (arr[i][j]=='P')\n\t\t\t\tsuma=suma+1;\n\t\t\tif (arr[i][j]=='q')\n\t\t\t\tsumb=sumb+9;\n\t\t\tif (arr[i][j]=='r')\n\t\t\t\tsumb=sumb+5;\n\t\t\tif (arr[i][j]=='b')\n\t\t\t\tsumb=sumb+3;\n\t\t\tif (arr[i][j]=='n')\n\t\t\t\tsumb=sumb+3;\n\t\t\tif (arr[i][j]=='p')\n\t\t\t\tsumb=sumb+1;\n\t\t\telse\n\t\t\t\t;\n\n\t\t}\n\t}\n\tif (suma>sumb)\n\t\tprintf(\"White\");\n\tif (suma==sumb)\n\t\tprintf(\"Draw\");\n\tif (suma\n\nint main()\n\n{\n long long int a,b,x,y,i,j,z,p,q,r;\n\n scanf(\"%lld %lld %lld %lld\",&a,&b,&x,&y);\n\n z=(x\n#include \n\nint main()\n{\n int i,size,k=0;\n int longestWordOutsideParanthesis=0;\n int numberOfWordsInsideParanthesis=0;\n int longest[200];\n int foundLetter=0;\n int cont=0;\n\n scanf(\"%d\",&size);\n\n char str[size];\n\n scanf(\"%s\",&str);\n\n for(i=0; str[i]!='\\0';)\n {\n if(str[i]=='_')\n {\n i++;\n cont=0;\n }\n else if(str[i]=='(')\n {\n cont=0;\n i++;\n foundLetter=0;\n\n while(str[i]!=')')\n {\n if(str[i]=='_')\n {\n foundLetter=0;\n }\n\n else\n {\n if(foundLetter==0)\n {\n numberOfWordsInsideParanthesis++;\n }\n\n foundLetter=1;\n }\n i++;\n\n }\n }\n else if(str[i]==')')\n i++;\n\n else\n {\n cont++;\n longest[k]=cont;\n k++;\n i++;\n\n }\n\n\n }\n\n\n for(i=0; ilongestWordOutsideParanthesis)\n longestWordOutsideParanthesis=longest[i];\n }\n\n\n\n printf(\"%d \",longestWordOutsideParanthesis);\n printf(\"%d\",numberOfWordsInsideParanthesis);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "27463ea8e4999d044742c4fbf88038c1", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "7311ea3d373d44b709dd174f4c09c187", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9554831704668838, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n#include\n\nint main(void){\n\tint *arr,num,i,ctr=0,j;\n\t\n\tscanf(\"%d\",&num);\n\tarr = (int*)malloc(sizeof(int));\n\t\n\tfor(i=num;i>0;i--){\n\t\tif(num%i == 0){\n\t\t\tarr[ctr] = i;\n\t\t\tctr++;\n\t\t}\n\t}\n\tfor(i=0;i<=ctr;i++){\n\t\tif(arr[i]!=-1){\n\t\t\tfor(j=i+1;j\n#include \n\nint sum(int *arr, int size) {\n int total = 0;\n \n for (int i = 0; i < size; i++) {\n total += arr[i];\n }\n \n return total;\n}\n\nint main(int argc, char **argv)\n{\n int vs, es; // vs vertexes es edges\n scanf(\"%d %d\", &vs, &es);\n \n\tint graph[vs+1][vs+1];\n for (int i = 0; i <= vs; i++) {\n memset(graph[i], 0, sizeof(graph[i]));\n }\n \n int v1, v2;\n for (int i = 0; i < es; i++) {\n scanf(\"%d %d\", &v1, &v2);\n graph[v1][v2] = 1;\n graph[v2][v1] = 1;\n }\n \n char letters[vs+10];\n memset(letters, '-', sizeof(letters));\n letters[vs+1] = '\\0';\n \n for (int i = 1; i <= vs; i++) {\n if (sum(graph[i]+1, vs) == vs - 1) {\n letters[i] = 'b';\n }\n }\n \n int stack[100*1000];\n int size = -1, v;\n int qntA = 0;\n for (int i = 1; i <= vs; i++) {\n if (letters[i] == '-') {\n stack[++size] = i;\n while (size > -1) {\n v = stack[size--];\n letters[v] = 'a';\n qntA += 1;\n for (int j = 1; j <= vs; j++) {\n if (graph[v][j] == 1 && letters[j] == '-') {\n stack[++size] = j;\n }\n }\n }\n break;\n }\n }\n \n int qntC = 0;\n for (int i = 1; i <= vs; i++) {\n if (letters[i] == '-') {\n letters[i] = 'c';\n qntC += 1;\n }\n }\n \n //verificando se A esta correto\n int count;\n for (int i = 1; i <= vs; i++) {\n if (letters[i] != 'a') continue;\n \n count = 0;\n for (int j = 1; j <= vs; j++) {\n if (graph[i][j] == 1 && letters[j] == 'a') {\n count += 1;\n }\n }\n if (qntA - 1 != count) {\n a = 0;\n break;\n }\n }\n \n // verificando C\n for (int i = 1; i <= vs; i++) {\n if (letters[i] != 'c') continue;\n \n count = 0;\n for (int j = 1; j <= vs; j++) {\n if (graph[i][j] == 1 && letters[j] == 'c') {\n count += 1;\n }\n }\n if (qntC - 1 != count) {\n c = 0;\n break;\n }\n }\n \n if (a && c) {\n printf(\"Yes\\n%s\", letters+1);\n } else {\n printf(\"No\", letters+1);\n }\n \n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "43266e283d4e816239d13cf7a9e02d8d", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "ea36851801e4189709a3bf8ec7097dd5", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9997989949748743, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint sum(int *arr, int size) {\n int total = 0;\n \n for (int i = 0; i < size; i++) {\n total += arr[i];\n }\n \n return total;\n}\n\nint main(int argc, char **argv)\n{\n int vs, es; // vs vertexes es edges\n scanf(\"%d %d\", &vs, &es);\n \n\tint graph[vs+1][vs+1];\n for (int i = 0; i <= vs; i++) {\n memset(graph[i], 0, sizeof(graph[i]));\n }\n \n int v1, v2;\n for (int i = 0; i < es; i++) {\n scanf(\"%d %d\", &v1, &v2);\n \n graph[v1][v2] = 1;\n graph[v2][v1] = 1;\n }\n \n char letters[vs+10];\n memset(letters, '-', sizeof(letters));\n letters[vs+1] = '\\0';\n \n for (int i = 1; i <= vs; i++) {\n if (sum(graph[i]+1, vs) == vs - 1) {\n letters[i] = 'b';\n }\n }\n \n int stack[100*1000];\n int size = -1, v;\n int qntA = 0;\n for (int i = 1; i <= vs; i++) {\n if (letters[i] == '-') {\n stack[++size] = i;\n while (size > -1) {\n v = stack[size--];\n if (letters[v] == '-') {\n\t letters[v] = 'a';\n\t qntA += 1;\n\t for (int j = 1; j <= vs; j++) {\n\t if (graph[v][j] == 1 && letters[j] == '-') {\n\t stack[++size] = j;\n\t }\n\t }\n }\n }\n break;\n }\n }\n \n int qntC = 0;\n for (int i = 1; i <= vs; i++) {\n if (letters[i] == '-') {\n letters[i] = 'c';\n qntC += 1;\n }\n }\n \n //verificando se A esta correto\n int a = 1, c = 1;\n int count;\n for (int i = 1; i <= vs; i++) {\n if (letters[i] != 'a') continue;\n \n count = 0;\n for (int j = 1; j <= vs; j++) {\n if (graph[i][j] == 1 && letters[j] == 'a') {\n count += 1;\n }\n }\n if (qntA - 1 != count) {\n a = 0;\n break;\n }\n }\n \n // verificando C\n for (int i = 1; i <= vs; i++) {\n if (letters[i] != 'c') continue;\n \n count = 0;\n for (int j = 1; j <= vs; j++) {\n if (graph[i][j] == 1 && letters[j] == 'c') {\n count += 1;\n }\n }\n if (qntC - 1 != count) {\n c = 0;\n break;\n }\n }\n \n if (a && c) {\n printf(\"Yes\\n%s\", letters+1);\n } else {\n printf(\"No\", letters+1);\n }\n \n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a711a8939579c0b64c249091583c93fc", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "ea36851801e4189709a3bf8ec7097dd5", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7831066571224051, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nlong long int hash[10000005], i, j, n, h, yer, cvp[100005], a[10000005];\n\nlong long int ters(long long int a){\n\tint cvp[20] = {0}, i = 0, j, sonuc = 0, k = 1;\n\twhile(a){\n\t\tcvp[i] = a%10;\n\t\ta/=10;\n\t\ti++;\n\t}\n\tfor(j = i-1 ; j >= 0 ; j--){\n\t\tsonuc += k*cvp[j];\n\t\tk*=10;\n\t}\n\treturn sonuc;\n}\n\n\nint main () {\n\tfor(i = 2 ; i <= 10000002 ; i++){\n\t\tif(hash[i])continue;\n\t\tfor(j = 2*i ; j <= 10000002 ; j+=i)\n\t\t\thash[j] = 1;\n\t}\n\tfor(i = 0 ; i < 10000002 ; i++){\n\t\tif(!hash[i]){\n\t\t\ta[yer] = i;\n\t\t\tyer++;\n\t\t}\n\t}\n\tyer = 0;\n\tfor(i = 2 ; i < 100005 ; i++){\n\t\tif(!hash[ters(a[i])] && a[i] != ters(a[i])){\n\t\t\tcvp[yer] = a[i];\n\t\t\tyer++;\n\t\t}\n\t}\n\tscanf(\"%lld\",&n);\n\tprintf(\"%lld\",cvp[n-1]);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "df4149bfbbbec987b6df0f08c3205ecf", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "5fd009beac0185d40f8bf94714f4d6be", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.3050847457627119, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\n\n#include\nmain()\n{\n\tint n,i,j;\n\tscanf(\"%d\",&n);\n\tlong long int c=0;\n\tchar a[n];\n\tfor(j=0;j\nint main()\n{\n int n = 0, k = 0, i;\n \n scanf(\"%d %d\", n, k);\n \n for(int i = 0; i < k; i++){\n if(n % 10 == 0){\n n = n/10;\n }\n else{\n n = n - 1;\n }\n }\n \n printf(\"%d\", n);\n}", "lang": "GNU C11", "bug_code_uid": "27e1310f6374d60b00f1ef88b36384f4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "03daef9d2256cf2f4456e11568ade87f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8771929824561403, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int n,a,b,c,sum=0,min,found=0;\n scanf(\"%d\\n%d\\n%d\\n%d\\n\",&n,&a,&b,&c);\n min=a;\n if(b\nint main()\n{\n int n,c=0;\n scanf(\"%d\",&n);\n \n // printf(\"%d\",n/100);\n while(n)\n {\n if(n>=100)\n {\n c=c+n/100;\n n=n%100;\n }\n if(n<100 && n>20)\n {\n c=c+n/20;\n n=n%20; \n }\n if(n<20 && n>10)\n {\n c=c+n/10;\n n=n%10; \n }\n if(n<10 && n>=5)\n {\n c=c+n/5;\n n=n%5; \n }\n if(n<5 && n>=1)\n {\n c=c+n/1;\n n=n%1; \n }\n }\n printf(\"%d\",c);\n}", "lang": "GNU C11", "bug_code_uid": "e5a48cc632116cf027760edf9e15c452", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "03913b39cec29227e5e53d1303f2846b", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6666666666666666, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/*\nProject name : hamburgar\nCreated on : Wed Dec 11 11:58:38 IST 2013\nhttp://codeforces.com/problemset/problem/371/C\n\n*/\n\n#include\n#include\n#include\nint debug=0;\ntypedef long long int lld;\nint kb,nb,pb,ks,ns,ps,kc,nc,pc;\nlld r;\nlld getCost(lld n){\n lld ab=(n*kb-nb);ab=ab>0?ab:0;\n lld as=(n*ks-ns);as=as>0?as:0;\n lld ac=(n*kc-nc);ac=ac>0?ac:0;\n if(debug){\n printf(\"cost for : n=%lld \\n\",n);\n printf(\"cost of b : %lld\\n\",ab*pb);\n printf(\"cost of s : %lld\\n\",as*ps);\n printf(\"cost of c : %lld\\n\",ac*pc);\n printf(\"\\n\\n\");\n }\n return ab*pb+as*ps+ac*pc;\n}\nint main(int argc , char **argv)\n{\n if(argc>1 && strcmp(argv[1],\"DEBUG\")==0) debug=1;\n char str[101];\n scanf(\"%s\",str);\n int i;\n kb=0;ks=0;kc=0;\n for(i=0;i1){\n cost=getCost(mid);\n if(debug)printf(\"start=%lld , end=%lld , cost=%lld\\n\",start,end,cost);\n if(cost>r)end=mid;\n else if(cost\n#include\n#include\nint debug=0;\ntypedef long long int lld;\nint kb,nb,pb,ks,ns,ps,kc,nc,pc;\nlld r;\nlld getCost(lld n){\n lld ab=(n*kb-nb);ab=ab>0?ab:0;\n lld as=(n*ks-ns);as=as>0?as:0;\n lld ac=(n*kc-nc);ac=ac>0?ac:0;\n if(debug){\n printf(\"cost for : n=%lld \\n\",n);\n printf(\"cost of b : %lld\\n\",ab*pb);\n printf(\"cost of s : %lld\\n\",as*ps);\n printf(\"cost of c : %lld\\n\",ac*pc);\n printf(\"\\n\\n\");\n }\n return ab*pb+as*ps+ac*pc;\n}\nint main(int argc , char **argv)\n{\n if(argc>1 && strcmp(argv[1],\"DEBUG\")==0) debug=1;\n char str[101];\n scanf(\"%s\",str);\n int i;\n kb=0;ks=0;kc=0;\n for(i=0;i1){\n cost=getCost(mid);\n if(debug)printf(\"start=%lld , end=%lld , cost=%lld\\n\",start,end,cost);\n if(cost>r)end=mid;\n else if(cost\n#define I64 long long int\nint main()\n{\nint i;\nI64 B=0,S=0,C=0,B1,S1,C1,BP,SP,CP,A,cost,x,y,z,req,ans=0;\nchar str[105];\nscanf(\"%s\",str);\nfor(i=0;str[i]!='\\0';i+=1)\n{\nif(str[i]=='B')\nB=B+1;\nelse if(str[i]=='S')\nS=S+1;\nelse if(str[i]=='C')\nC=C+1;\n}\nscanf(\"%I64d %I64d %I64d\",&B1,&S1,&C1);\nscanf(\"%I64d %I64d %I64d\",&BP,&SP,&CP);\nscanf(\"%I64d\",&A);\n//printf(\"%I64d %I64d %I64d %I64d %I64d %I64d %I64d %s\\n\",B1,S1,C1,BP,SP,CP,A,str);\ncost=B*BP+S*SP+C*CP;\nwhile(1)\n{\n//printf(\"%I64d\\n\",A);\nif(B!=0)\n{\nx=B1/B;\n}\nif(S!=0)\n{\ny=S1/S;\n}\nif(C!=0)\n{\nz=C1/C;\n}\n//printf(\"%I64d %I64d %I64d %I64d %I64d %I64d %I64d\\n\",B1,S1,C1,x,y,z,A);\nif(B!=0 && S!=0 && C!=0)\n{\nif(x0 || C1>0))\n{\nB1=B;\nA=A-req*BP;\n}\nelse\nbreak;\n}\nelse\n{\nans+=z;\nB1-=z*B;\nS1-=z*S;\nreq=C-C1%C;\nif(req*CP<=A && (S1>0 || B1>0))\n{\nA-=req*CP;\nC1=C;\n}\nelse\nbreak;\n}\n}\nelse\n{\nif(y0 || C1>0))\n{\nA-=req*SP;\nS1=S;\n}\nelse\nbreak;\n}\nelse\n{\nans+=z;\nB1-=z*B;\nS1-=z*S;\n//printf(\"%I64d %I64d\\n\",B1,S1);\nreq=C-C1%C;\nif(req*CP<=A && (S1>0 || B1>0))\n{\nA-=req*CP;\nC1=C;\n}\nelse\nbreak;\n}\n}\n}\nelse if(B!=0 && S!=0)\n{\nif(x0)\n{\nB1=B;\nA-=req*BP;\n}\nelse\nbreak;\n}\nelse \n{\nans+=y;\nB1-=y*B;\n//C1-=y*C;\nreq=S-S1%S;\nif(req*SP<=A && B1>0)\n{\nA-=req*SP;\nS1=S;\n}\nelse\nbreak;\n}\n} \nelse if(B!=0 && C!=0)\n{\nif(x0)\n{\nB1=B;\nA-=req*BP;\n}\nelse\nbreak;\n}\nelse\n{\nans+=z;\nB1-=z*B;\n//S1-=z*S;\n//printf(\"%I64d %I64d\\n\",B1,S1);\nreq=C-C1%C;\nif(req*CP<=A && B1>0)\n{\nA-=req*CP;\nC1=C;\n}\nelse\nbreak;\n}\n}\nelse if(S!=0 && C!=0)\n{\nif(y0)\n{\nA-=req*SP;\nS1=S;\n}\nelse\nbreak;\n}\nelse\n{\nans+=z;\n//B1-=z*B;\nS1-=z*S;\n//printf(\"%I64d %I64d\\n\",B1,S1);\nreq=C-C1%C;\nif(req*CP<=A && S1>0)\n{\nA-=req*CP;\nC1=C;\n}\nelse\nbreak;\n}\n}\nelse if(B!=0)\n{\nans+=x;\nans+=(A/(BP)+B1%B)/B;\nA=0;\nbreak;\n}\nelse if(S!=0)\n{\nans+=y;\nans+=(A/SP+S1%S)/S;\nA=0;\nbreak;\n}\nelse if(C!=0)\n{\nans+=z;\nans+=(A/CP+C1%C)/C;\nA=0;\nbreak;\n}\n}\nans+=A/cost;\nprintf(\"%I64d\\n\",ans);\nsystem(\"pause\");\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9009641fcb270cde4874b6e4f2ed5461", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "6cfc7dd811a033b83eb46db1b2783442", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.80625, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include \nchar a;\nint i;\nunsigned long long n ,n1,n2,n3,c1,c2,c3, min,max,mid , b ,c ,s ,temp=0;\nint main()\n{\n while((a=getchar())!='\\n'){\n if(a=='b') b++;\n if(a=='c') c++;\n if(a=='s') s++;\n }\n scanf(\"%llu%llu%llu%llu%llu%llu%llu\",&n1,&n2,&n3,&c1,&c2,&c3,&n);\n min=0;\n max=2000000000;\n while(max>=min){\n mid=(min+max+1)/2;\n if(mid*b>n1)\n temp+=(mid*b-n1)*c1;\n if(mid*c>n3)\n temp+=(mid*c-n3)*c3;\n if(mid*s>n2)\n temp+=(mid*s-n2)*c2;\n if(n>temp)min=mid;\n else max=mid-1;\n }\n printf(\"%llu\",min);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b0340c59580cc41c9f1281712325cdcc", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "f876828d6817713d36ee1a7387bf67a2", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4151658767772512, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "//324B.c\n#include\n#include\nint main()\n{\n int n,i,number,total,extra,final;\n scanf(\"%d\",&n);\n\n number=3*n;\n\n total=pow(3,number);\n\n //calcualting when = 6\n\n extra= pow(7,n);\n\n final = total-extra;\n divisor=pow(10,9)+7;\n final=final%(divisor);\n \n printf(\"%d\",final);\n\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "49425ae8f03bff8cc609a25a76effc73", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "a27c0e3e5ec21726b61839ee19301beb", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9554794520547946, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nint main(void){\n int n\n long long int p,w;\n scanf(\"%d\",&n);\n p=27;\n w=7;\n for(int i=1;iw) printf(\"%d\",p-w);\n else printf(\"-1\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "d6c413385dd85cc5e118c862c789aa0d", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "a200707ba6343a83a5378cb913e8afcc", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8229954614220878, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\n#include\n#include\n#define INF 1000000000\n\nint a[500005];\nint num;\nint bs(int v)\n{\n int left=1,right=num;\n while(left<=right)\n {\n int m=(left+right)/2;\n if(a[m]==v)return m;\n else if(a[m]>v)right=m-1;\n else left=m+1;\n }\n return -1;\n}\nint main()\n{\n int i;\n int n;\n for(i=1;i*(i+1)/2<=INF;i++)\n {\n a[i]=i*(i+1)/2;\n }\n num=i-1;\n scanf(\"%d\",&n);\n if(n>a[i-1])\n {\n printf(\"NO\\n\");\n return 0;\n }\n for(i=1;i<=n;i++)\n {\n int m=bs(n-a[i]);\n if(m!=-1)\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n printf(\"NO\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "f5a7d3e179015077cf107f3c8f814c03", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "f5740daa31ca26b8d8464c5e238d73bf", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994991652754591, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\n#include\n\nint a[50005],num;\nint bs(int v)\n{\n int left=1,right=num;\n while(left<=right)\n {\n int m=(left<=right)\n if(a[m]==v)return 1;\n else if(a[m]>v)right=m-1;\n else left=m+1;\n }\n return 0;\n}\nint main()\n{\n int i,n;\n for(i=1;i*(i+1)/2<=1000000000;i++)\n {\n a[i]=i*(i+1)/2;\n }\n num=i-1;\n scanf(\"%d\",&n);\n for(i=1;i<=num;i++)\n {\n if(bs(n-a[i]))\n {\n printf(\"YES\\n\");\n return 0;\n }\n }\n printf(\"NO\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "be02deb6d887366aa7be404bbde49ddd", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "f5740daa31ca26b8d8464c5e238d73bf", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3715670436187399, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "#include\n#include\n#include\n#define f(x) (x*(x+1))/2\nusing namespace std;\nint main()\n{int f=0;\nlong long n,i=0,j=0;\ncin>>n;\nfor(i=1;f(i)<=n;i++)\n{\nfor(j=i;(f(i)+f(j))<=n;j++)\n{if(f(i)+f(j)==n)\n{printf(\"YES\\n\");\nreturn 0;\n}\n}\n}\nprintf(\"NO\\n\");\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0ae5c06ff98046159a4541be2266d269", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "2373220ed7446b166802de8dedd12153", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5744089012517385, "equal_cnt": 24, "replace_cnt": 16, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 24, "bug_source_code": "\n\n#include\n\n#include\n\n\nint main()\n{\n\tchar array[100];\n\tint c,x=0,y=0,i;\n\n\t\n\tscanf(\"%d\",&array);\n for(i=0;(i+1)!=NULL;i++)\n {\n\t\tif ( array[i]!= 'a' && array[i]!= 'e'&& array[i]!= 'i'&&array[i]!= 'o'&&array[i]!= 'u'&& array[i]!= 'n')\n { x=1;}\n \n \n\t\tif ( array[i+1]!= 'a' && array[i+1]!= 'e'&& array[i+1]!= 'i'&&array[i+1]!= 'o'&&array[i+1]!= 'u'&& array[i+1]!= 'n')\n { y=1;}\n \n if(x==1&&y==1)\n {\n printf(\"not\");}\n else\n {printf(\"yes\");}\n \n \n x=0;\n y=0;\n }\n\n\t\n\t\treturn 0;\n\t}\n\n/*\nInput: Enter a string\nThis program is easy 2 understand\n*/", "lang": "GNU C11", "bug_code_uid": "b57c4c1f240f8600db9004170654c41f", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "b1b45c8a4d555f34985e4b18ee9eea05", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9855455667195487, "equal_cnt": 14, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 11, "fix_ops_cnt": 14, "bug_source_code": "/* .................... compiled by alankar....................\n*/\n\n//......................SHORTCUTS..............................\n\n#include\n#include\n#include\n#include\n//...........................................................\n\n#define pi 3.14159265358979323846 //float type\n#define MAX 100000 //for rmq\n#define SQRTMAX 317 //for rmq\n//#define gc getchar_unlocked\n\n#define FOR(i,a,b) for(i=(a);i<(b);i++)\n\n//only for +ve and single terms\n#define s(x) scanf(\"%d\",&x);\n#define sl(x) scanf(\"%llu\",&x);\n#define p(x) printf(\"%d\",x);\n#define pl(x) printf(\"%llu\\n\",x);\n//..........................................................\n\ntypedef long long int ll;\nconst ll MOD=1000000007;\n\n//returns int and +ve numbers\n\n/*inline int inp(){\n int n=0;\n char c;\n c=gc();\n while(c<'0' || c>'9'){\n c=gc();\n }\n while(c>='0' && c<='9'){\n n=(n<<3)+(n<<1)+c-'0';\n c=gc();\n }\n return n;\n}\n*/\n//...................................\n\n//power with mod........long long int\n ll power(ll a,ll b,ll mod){\n if(b==0)\n return 1;\n ll temp=power(a,b/2,mod);\n temp=(temp*temp)%mod;\n if(b&1)\n temp=(temp*a)%mod;\n return temp;\n}\n\n //power without mod........ int\nint pwr(int a,int b){\n if(b==0)\n return 1;\n int temp=pwr(a,b/2);\n temp=(temp*temp);\n if(b&1)\n temp=(temp*a);\n return temp;\n}\n // .....long long int\nll gcd(ll a,ll b){\n return b==0?a:gcd(b,a%b);\n}\n //......long long int\nll lcm(ll a,ll b){\n return (a/gcd(a,b))*b;\n}\n //......long long int with mod\nll modularInverse(ll a,ll m){\n return power(a,m-2,m);\n}\n\n //only for int\n//inline int min(int a,int b) { return ab? a : b; }\n\n//normal compare func on integers //for qsort(name,size,sizeof(type),compare)\nint compare (const void * a, const void * b)\n{\n return ( *(int*)a - *(int*)b );\n}\n//.......................................................\n\n//segment tree\n//not template but how to use ST\n//for minimum element\n/*\nlong long s[400000];\nlong long a[1000000];\nint create(long long b,long long e,long long n)\n{\n if(b==e)\n {\n s[n]=a[b];\n }\n else\n {\n create(b,(b+e)/2,2*n+1);\n create((b+e)/2+1,e,2*n+2);\n s[n]=s[2*n+1]r)\n {\n return 100000001;\n }\n if(b>=l&&e<=r)\n {\n return s[n];\n }\n i=messi(b,(b+e)/2,l,r,2*n+1);\n j=messi((b+e)/2+1,e,l,r,2*n+2);\n return ib[i])\n minimum = b[i];\n if(maximum b[l]){\n minimum = b[l];\n\n }\n //printf(\"Checked for %d\\n\", l);\n l++;\n }\n while(j<=j2 && l<=r && j min[j])\n minimum = min[j];\n l = (j+1)*size;\n //printf(\"Checked for %d <--> %d\\n\", j*size, l-1);\n j++;\n }\n while(l<=r){\n if(minimum > b[l]){\n minimum = b[l];\n }\n //printf(\"Checked for %d\\n\", l);\n l++;\n }\n return minimum;\n}\n\n//finding max value\nlong findMax(int l, int r){\n int j, j2;\n long maximum = b[l];\n\n j = l/size + 1;\n j2 = r/size - 1;\n\n //printf(\"j= %d and j2 = %d\\n\", j,j2);\n while(l %d\\n\", j*size, l-1);\n j++;\n }\n while(l<=r){\n if(maximum < b[l]){\n maximum = b[l];\n }\n //printf(\"Checked for %d\\n\", l);\n l++;\n }\n return maximum;\n}\n*/\n\n//...........................................END OF TEMPLATE.................................................................\nint main()\n{ int i,j,k,t,m,s,a[101],b[101];\n\n s(m)\n s(s)\n j=s;\n if(s==0)\n printf(\"-1 -1\");\n else if(s>(m*9))\n printf(\"-1 -1\");\n else\n {\n i=0;\n while(s>=9)\n {\n a[i]=9;\n i++;\n s=s-9;\n }\n if(i9)\n {b[i]=9;\n i--;\n j=j-9;\n\n }\n if(i>0 && j)\n {\n b[i]=j-1;\n i--;\n j=1;\n }\n while(i>0)\n {\n b[i]=0;\n i--;\n }\n b[0]=j;\n \n FOR(i,0,m)\n p(b[i])\n printf(\" \");\n FOR(i,0,m)\n p(a[i])\n }\n\n\n\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "10df916a870462ea19d8a2a921a0ab07", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "8ed6aabf6e3d38a17b971d22ae1d0653", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8793103448275862, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main()\n{\n long long int n,m,s,i,j,ans,c=0,d=0,f=1,e;\n scanf(\"%lld %lld %lld\",&n,&m,&s);\n if(m>=4&&m/s<=2){\n c=m;\n }\n else{\n if(m%s==0){\n c=(m/s-1)+1;e=(m/s-1)*s+1;\n }\n else {\n c=(m/s)+1;e=(m/s)*s+1;\n }\n }\n if(n>=4&&n/s<=2){\n d=n;\n }\n else{\n if(n%s==0){\n d=(n/s-1)+1;f=(n/s-1)*s+1;\n }\n else {\n d=(n/s)+1;f=(n/s)*s+1;\n }\n }\n ans=c*d*(m-e+1)*(n-f+1);\n printf(\"%lld\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "15fbe12d11bd40ecee429df1f429b97d", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "23718eddbeab52851912d3a747e8cf84", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8310626702997275, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main() \n{\nint x,y,z;\nint x1,yy,z1;\nint a[7];\nint i;\n scanf(\"%d%d%d\",&x,&y,&z);\n scanf(\"%d%d%d\",&x1,&yy,&z1);\n for i=1;i<=6;i++) scanf(\"%d\",&a[i]);\n\n int ans=0;\n if (y<0) ans+=a[1];\n if (y>yy) ans+=a[2];\n if (z<0) ans+=a[3];\n if (z>z1) ans+=a[4];\n if (x<0) ans+=a[5];\n if (x>x1) ans+=a[6];\n printf(\"%d\\n\",ans);\n\n\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "2f328f47bb9cf6c55bc326ea0275f8a9", "src_uid": "c7889a8f64c57cf7be4df870f68f749e", "apr_id": "5ff859a43ec51070b882b4cc01203ae3", "difficulty": 1600, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9741427768409219, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main()\n{\n int m,n,x,y;\n long long int k,min=0,max=0,q=0;\n scanf(\"%d %d %lld %d %d\",&n,&m,&k,&x,&y);\n if(n==1)\n {\n min=k/m;\n k%=m;\n max=min;\n q=max;\n if(k)\n {\n ++max;\n if(k>=y)\n {\n ++q;\n }\n }\n }\n else if(n==2)\n {\n min=k/(2*m);\n k%=(2*m);\n max=min;\n q=max;\n if(k)\n {\n ++max;\n if(k>=((x-1)*m)+y)\n {\n ++q;\n }\n }\n }\n else\n {\n min=k/((m*n)+(m*(n-2)));\n max=2*min;\n k%=((m*n)+(m*(n-2)));\n if(x==n ||x==1)\n {\n q=min;\n }\n else\n {\n q=max;\n }\n if(k)\n {\n if(k>m && k=y)\n {\n ++q;\n }\n }\n else if(x==n)\n {\n if(k>=(m*(n-1))+y)\n {\n ++q;\n }\n }\n else\n {\n if(k>=(m*(x-1))+y)\n {\n ++q;\n k-=(m*(x-1))+y;\n if(k>=(2*m*(n-x)))\n {\n ++q;\n }\n }\n }\n }\n }\n printf(\"%lld %lld %lld\",max,min,q);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "cd3b486caab87aae248374417e345589", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "47d732c382aee6895ff35c418a23f3e0", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8644400785854617, "equal_cnt": 19, "replace_cnt": 6, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include \n\n\nint cmpfunc (const void * a, const void * b)\n{\n return ( *(int*)a - *(int*)b );\n}\n\nvoid soultion()\n{\n int n = 0;\n scanf(\"%d\", &n);\n int *arr = calloc(sizeof(n),sizeof(int));\n\n for(int i = 0;i\n\nint main() {\n \n int a, b, c;\n scanf(\"%d %d %d\", &a, &b, &c);\n if(c==0)\n if (a==b)\n printf(\"YES\\n\");\n else printf(\"NO\\n\");\n else\n if(b0)\n printf(\"NO\\n\");\n if(b>a && c<0)\n printf(\"NO\\n\");\n if((b-a)%c==0)\n printf(\"YES\\n\");\n}\n", "lang": "GNU C11", "bug_code_uid": "3a20b625e163ec9d0950c500cf4dc4eb", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "9923cf4667fdb8a5dd12c64dd889e7e2", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9957627118644068, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n\tint a,b,c;\n\tint i=0,j=0;\n\tscanf(\"%d%d%d\",&a,&b,&c);\n\tfor(i=0;i<=100000;i++)\n\t{\n\t\tfor(j=0;j<=100000;j++)\n\t\t{\n\t\t\tif(i*a+b*j==c)\n\t\t\t{\n\t\t\t\tprintf(\"Yes\");\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t}\n\t}\n\tprintf(\"No\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e3fbe33e94ae3c8244cae1aa0542b012", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "72dfe7ddf82dab31b6e655a0917a55b6", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9778869778869779, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main(){\n int i, num, flag=0;\n char str[11];\n scanf(\"%s\", str);\n num = strlen(str);\n if(num == 1){\n if(str[0] != '3' || str[0] != '7'){\n printf(\"No\\n\");\n }\n else\n printf(\"Yes\\n\");\n }\n else{\n for(i=0; i\n#include \n#include \n\nbool braille(char *a, int len)\n{\n if(len == 1)\n {\n if(a[0] == '3' || a[0] == '7')\n return true;\n else\n return false;\n }\n\n\tint i = 0;\n\tint n = len - 1;\n\n\twhile(i < n)\n\t{\n int old_i = i;\n\n if((a[i] == '4' || a[i] == '6') && (a[i] == '6' || a[i] == '4'))\n i++;\n\n else if((a[i] == '5' || a[i] == '9') && (a[i] == '9' || a[i] == '5'))\n i++;\n\n else if((a[i] == '8' || a[i] == '0') && (a[i] == '0' || a[i] == '8'))\n i++;\n\n else if(a[i] == '3' && a[n] == '3')\n i++;\n\n else if(a[i] == '7' && a[n] == '7')\n i++;\n\n if(i == old_i)\n return false;\n else\n n--;\n }\n\n if(a[i] == '1' || a[i] == '2')\n return false;\n else\n return true;\n}\n\nint main()\n{\n char num[10];\n scanf(\"%s\", num);\n\n braille(num, strlen(num))? printf(\"Yes\\n\") : printf(\"No\\n\");\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e16f51cb43d080bb3eda875dd2116f28", "src_uid": "0f11f41cefd7cf43f498e511405426c3", "apr_id": "533bafc2ebeef4a4bc5b5de591ddaecf", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9976635514018691, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\nint cmp(const void *a,const void *b) {\n\treturn strcmp(*(char **)a,*(char **)b);\n}\n\nint main() {\n\tchar s[101];\n\tscanf(\"%s\\n\",s);\n\tint i,m,l=strlen(s);\n\tchar *x[l],*p,*q;\n\tp=s;\n\twhile (*p) {\n\t\tx[p-s]=p;\n\t\tp++;\n\t}\n\tqsort(x,l+1,sizeof *x,cmp);\n\tm=0;\n\tfor (i=1;im) m=p-x[i];\n\t}\n\tprintf(\"%d\\n\",m);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "326711e542eaefc76e4e953118d83605", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "apr_id": "9cb7e1b61f6e9cdea068a7f5d159cb4f", "difficulty": 1200, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8583473861720068, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n#include \n\nint main () {\n\n uint64_t n;\n scanf(\"%\"SCNu64, &n);\n\n if (n % 2 == 0) {\n printf(\"%\"PRIu64i\"\\n\", n / 2);\n }\n else {\n uint64_t j = 3;\n for ( ; j * j <= n; j += 2) {\n if (n % j == 0) {\n printf(\"%\"PRIu64\"\\n\", (1 + (n - j) / 2));\n n = 1;\n break;\n }\n }\n if (n > 1) {\n putchar('1');\n putchar(\"\\n\");\n } \n } \n \n return 0;\n}\n~ \n~ ", "lang": "GNU C11", "bug_code_uid": "2a630b1ab6f20994af9a0e2f0609d7d1", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "6771a8f94dd6db9b8b6e96b3d86d5a41", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8199566160520607, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n long long int n,n1,i,j=2,flag=0,a[10000];\n\n scanf(\"%lld\",&n);\n\n a[0]=2;\n\n long long int count=0;\n\n while(1){\n if(n%2!=0){\n for(i=2;i<=n;i++){\n flag=0;\n for(j=2;j<=i/2;j++){\n if(i%j==0){\n flag=1;\n break;\n }\n }\n\n if(flag==0){\n if(n%i==0){\n n1=n-i;\n break;\n }\n }\n }\n\n count=(n1/2)+1;\n n=0;\n }\n else if(n%2==0){\n count=n/2;\n n=0;\n }\n\n if(n==0) break;\n }\n printf(\"%lld\",count);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "39692c4914abf5bf5926003e50b2cfc2", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "233186d2629cbf68ee5427bf2756bc10", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9530685920577617, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,a,b;\n scanf(\"%d\",&n);\n printf(\"%d %d\",n/36,n%36/3)\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "85a141fa8bf21ec74054906fa0d38d83", "src_uid": "5d4f38ffd1849862623325fdbe06cd00", "apr_id": "79c4d92ea50b671de9a9ffd0ea14a18d", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9951100244498777, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n\n\n#include \n#include \n#include \n#include \n\nint main()\n{\t\n\t\n\tint n;\n\tint feet;\n\tint inch;\n\n\t#ifndef ONLINE_JUDGE\n\t\tfreopen(\"input.txt\",\"r\", stdin);\n\t\tfreopen(\"output.txt\", \"w\", stdout);\n\t#endif\n\n\t\tscanf(\"%d\", &n);\n\n\t\tfeet = n / 36;\n\t\tinch = n % 36;\n\n\t\tinch = (inch + 1 )/3;\n\n\t\tif (inch == 12)\n\t\t{\n\t\t\tfeet++;\n\t\t\tinch = 0;\n\t\t}\n\t\tprintf(\"%d %d\\n\", foot, inch);\n\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "bc482516d94b491cbeff434f7b295566", "src_uid": "5d4f38ffd1849862623325fdbe06cd00", "apr_id": "a47f3e13cc5bdc4eaa554f7b1192ec0b", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9536423841059603, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \nusing namespace std;\n\nmain() {\n int h, m, a;\n scanf(\"%d:%d%d\", &h, &m, &a);\n m += a; h += m / 60; m %= 60; h %= 24;\n if (h < 10) printf(\"0\");printf(\"%d:\", h);\n if (m < 10) printf(\"0\");printf(\"%d \", m);\n}", "lang": "GNU C", "bug_code_uid": "1ec0f395feba464046fd0c77ff076cd3", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "apr_id": "b0cb3444382b530064da7c899a227bd1", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9913072002624241, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\n\ntypedef long long int lli;\n\n#define TRUE (1==1)\n#define FALSE (!(TRUE))\n#define in32(x) scanf(\"%d\", &(x))\n#define in64(x) scanf(\"%I64d\", &(x))\n#define instr(x) scanf(\"%s\", (x))\n#define out32(x) printf(\"%d\\n\", (x))\n#define out64(x) printf(\"%I64d\\n\", (x))\n#define outstr(x) printf(\"%s\\n\", (x))\n#define max(a,b) ((a)<(b))?(b):(a)\n#define min(a,b) ((a)>(b))?(b):(a)\n#define abs(a) ((a)<0)?(-(a)):(a)\n#define fo3(i,a,b) for(i=(int)(a);i<=(int)(b);i++)\n#define of3(i,a,b) for(i=(int)(a);i>=(int)(b);i--)\n\n#define MOD 998244353\n#define MAX 5005\n#define SENT -1\n\ntypedef struct Pair {\n int fi, se;\n} Pair; \n\nint comp(Pair * f, Pair * s) {\n return (f->fi - s->fi);\n}\n\nvoid sort(Pair ** arr, int size) { // CHANGE THIS\n int i;\n if (size < 6) {\n int nSize = 0;\n int s = size;\n while (size != 0) {\n nSize = 0;\n for (i = 0; i < size - 1; i++) \n if (comp(arr[i], arr[i+1]) > 0) { // CHANGE THIS\n Pair * tmp = arr[i];\n arr[i] = arr[i+1];\n arr[i+1] = tmp;\n nSize = i+1;\n }\n size = nSize;\n }\n return;\n }\n Pair ** tmp = (Pair **)calloc(size, sizeof(Pair *)); // CHANGE THIS\n int lSize = (size >> 1);\n int rSize = size - lSize;\n sort(arr, lSize); sort(arr + lSize, rSize);\n int lPtr = 0, rPtr = 0;\n int ptr = 0;\n while (ptr != size) {\n if (lPtr == lSize)\n tmp[ptr] = arr[lSize + (rPtr++)];\n else if (rPtr == rSize || comp(arr[lPtr], arr[lSize + rPtr]) <= 0) // CHANGE THIS\n tmp[ptr] = arr[lPtr++];\n else\n tmp[ptr] = arr[lSize + (rPtr++)];\n ptr++;\n }\n for (i = 0; i < size; i++)\n arr[i] = tmp[i];\n free(tmp);\n}\n \n \nint main(void) {\n int i, n, m;\n in32(n);\n in32(m);\n int need[n];\n fo3(i,0,n-1) \n in32(need[i]);\n Pair ** p = calloc(m, sizeof(Pair*));\n fo3(i,0,m-1) {\n p[i] = calloc(1,sizeof(Pair));\n in32(p[i]->fi);\n in32(p[i]->se);\n }\n sort(p,m);\n lli pos = 2000000, min = 0, max = 2000000 - 1;\n int have[n];\n while (min <= max) {\n lli mid = (min + max) >> 1;\n fo3(i,0,n-1)\n have[i] = 0;\n lli spent = 0;\n lli maxDay = mid;\n of3(i,m-1,0) {\n int day = p[i]->fi;\n int ind = p[i]->se-1;\n int miss = need[ind] - have[ind];\n if (maxDay > day)\n maxDay = day;\n int buy = miss;\n if (buy > maxDay)\n buy = maxDay;\n have[ind] += buy;\n maxDay -= buy;\n spent += buy;\n }\n fo3(i,0,n-1)\n spent += ((need[i] - have[i])<<1);\n if (spent <= mid) {\n pos = mid;\n max = mid - 1;\n } else\n min = mid + 1;\n }\n out64(pos);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "426ab39bd03ca7e57b2ff9b05eed7eb5", "src_uid": "2eb101dcfcc487fe6e44c9b4c0e4024d", "apr_id": "80518ec5ca42deb501fa9b1225c92d6c", "difficulty": 2000, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.214853195164076, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "#include \n\ntypedef struct mk\n{\n\tint day,type;\n}roy;\n\nint n,m,a[200010],l,r,tot=0;\nroy off[200010],tmp[200020];\n\nint ok(int days){\n\tint t[n+1];\n\tint need = 0,collect = 0;\n\tfor(int i = 0;i\n\nint main()\n{\n int n,i;\n scanf(\"%d\",&n);\n int arr[n/2];\n for(i=0;i=0;i--)\n {\n temp=arr[i];\n while(temp!=count)\n {\n if(temp>count)\n {\n arr[i]--;\n count1++;\n }\n else\n {\n temp++;\n count1++;\n }\n }\n count-=2;\n\n }\n for(i=n/2-1;i>=0;i--)\n {\n temp=arr[i];\n while(temp!=yes)\n {\n if(temp>yes)\n {\n temp--;\n count2++;\n }\n else\n {\n temp++;\n count2++;\n }\n }\n yes-=2;\n\n }\n count1\n#include \n\n#define N\t52\n#define K\t(N * 9)\n#define INF\t0x3f3f3f3f\n\nint min(int a, int b) { return a < b ? a : b; }\n\nvoid carry(int *aa, int n) {\n\tint i;\n\n\tfor (i = 0; i < n; i++)\n\t\tif (aa[i] >= 10)\n\t\t\taa[i + 1] += aa[i] / 10, aa[i] %= 10;\n\t\telse if (aa[i] < 0)\n\t\t\taa[i + 1] -= (-aa[i] + 9) / 10, aa[i] = (aa[i] % 10 + 10) % 10;\n}\n\nint main() {\n\tstatic char aa[N + 1];\n\tstatic int bb[N + 1], dp[K * 2 + 1], dq[K * 2 + 1], dp_[K * 2 + 1], dq_[K * 2 + 1];\n\tint n, i, j, k, ans;\n\tchar tmp;\n\n\tscanf(\"%s\", aa), n = strlen(aa);\n\tfor (i = 0; i < n; i++)\n\t\taa[i] -= '0';\n\tfor (i = 0, j = n - 1; i < j; i++, j--)\n\t\ttmp = aa[i], aa[i] = aa[j], aa[j] = tmp;\n\tn += 2;\n\tmemset(dp, 0x3f, (K * 2 + 1) * sizeof *dp), memset(dq, 0x3f, (K * 2 + 1) * sizeof *dq); \n\tdp[K] = 0;\n\tfor (i = n - 2; i >= 0; i--) {\n\t\tmemset(dp_, 0x3f, (K * 2 + 1) * sizeof *dp_), memset(dq_, 0x3f, (K * 2 + 1) * sizeof *dq_); \n\t\tfor (k = 0; k <= K * 2; k++) {\n\t\t\tint x;\n\n\t\t\tfor (j = 0; j <= i + 1; j++)\n\t\t\t\tbb[j] = aa[j] + k - K;\n\t\t\tcarry(bb, i + 2), bb[i + 2] = 0;\n\t\t\tif ((x = dp[k]) != INF) {\n\t\t\t\tint d = bb[i + 1] == 1 ? 10 : bb[i];\n\n\t\t\t\tfor (j = i; j >= 0; j--)\n\t\t\t\t\tbb[j] -= d;\n\t\t\t\tcarry(bb, i + 2);\n\t\t\t\tif (bb[i + 2] < 0)\n\t\t\t\t\td--;\n\t\t\t\tif (d < 10) {\n\t\t\t\t\tdp_[k - d] = min(dp_[k - d], x + d * (i + 1));\n\t\t\t\t\tif (++d < 10)\n\t\t\t\t\t\tdq_[k - d] = min(dq_[k - d], x + d * (i + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (j = 0; j <= i + 1; j++)\n\t\t\t\tbb[j] = -bb[j];\n\t\t\tcarry(bb, i + 2), bb[i + 2] = 0;\n\t\t\tif ((x = dq[k]) != INF) {\n\t\t\t\tint d = bb[i + 1] == 1 ? 10 : bb[i];\n\n\t\t\t\tfor (j = i; j >= 0; j--)\n\t\t\t\t\tbb[j] -= d;\n\t\t\t\tcarry(bb, i + 2);\n\t\t\t\tif (bb[i + 2] < 0)\n\t\t\t\t\td--;\n\t\t\t\tif (d < 10) {\n\t\t\t\t\tdq_[k + d] = min(dq_[k + d], x + d * (i + 1));\n\t\t\t\t\tif (++d < 10)\n\t\t\t\t\t\tdp_[k + d] = min(dp_[k + d], x + d * (i + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmemcpy(dp, dp_, (K * 2 + 1) * sizeof *dp_), memcpy(dq, dq_, (K * 2 + 1) * sizeof *dq_); \n\t}\n\tans = INF;\n\tfor (k = 0; k <= K * 2; k++)\n\t\tif ((aa[0] + k - K) % 10 == 0)\n\t\t\tans = min(ans, dp[k]);\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d9632deff45b9f6bafa82d963a75ec8d", "src_uid": "1961e7c9120ff652b15cad5dd5ca0907", "apr_id": "85a18b031dd7d6b71d56c154b35f0f99", "difficulty": 2900, "tags": ["dp", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3265126512651265, "equal_cnt": 32, "replace_cnt": 26, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 31, "bug_source_code": "#include \n\n#define N\t400\n#define M\t200\n#define A\t26\n#define MD\t998244353\n\nint max(int a, int b) { return a > b ? a : b; }\n\nint main() {\n\tstatic int kk[A], dp1[M + 1][2], dp2[M + 1][M + 1][3], dq1[N + 1], dq2[N + 1][N + 1], aa1[M + 1], aa2[M + 1][M + 1];\n\tint n, m, i, k, l, k1, l1, k2, l2, a, b, ans;\n\n\tscanf(\"%d\", &n), m = (n + 1) / 2;\n\tfor (a = 0; a < A; a++)\n\t\tscanf(\"%d\", &kk[a]);\n\tdp1[0][0] = dp1[1][1] = 1;\n\tfor (i = 1; i < m; i++)\n\t\tfor (k = i; k >= 0; k--) {\n\t\t\tint x = dp1[k][0], y = dp1[k][1];\n\n\t\t\tdp1[k][0] = ((long long) x * (A - 2) + y) % MD;\n\t\t\tdp1[k + 1][1] = (long long) x * (A - 1) % MD;\n\t\t}\n\tdp2[0][0][0] = dp2[1][0][1] = dp2[0][1][2] = 1;\n\tfor (i = 1; i < m; i++)\n\t\tfor (k = i; k >= 0; k--)\n\t\t\tfor (l = i - k; l >= 0; l--) {\n\t\t\t\tint x = dp2[k][l][0], y = dp2[k][l][1], z = dp2[k][l][2];\n\n\t\t\t\tdp2[k][l][0] = ((long long) x * (A - 3) + y + z) % MD;\n\t\t\t\tdp2[k + 1][l][1] = ((long long) x * (A - 2) + z) % MD;\n\t\t\t\tdp2[k][l + 1][2] = ((long long) x * (A - 2) + y) % MD;\n\t\t\t}\n\tfor (k = 0; k <= m; k++)\n\t\taa1[k] = ((long long) dp1[k][0] * (A - 1) + dp1[k][1]) % MD;\n\tfor (k1 = 0; k1 <= m; k1++)\n\t\tfor (k2 = max(n / 3 + 1 - k1, 0); k2 <= n - m; k2++)\n\t\t\tdq1[k1 + k2] = (dq1[k1 + k2] + (long long) aa1[k1] * aa1[k2]) % MD;\n\tfor (k = 0; k <= m; k++)\n\t\tfor (l = 0; k + l <= m; l++)\n\t\t\taa2[k][l] = ((long long) dp2[k][l][0] * (A - 2) + dp2[k][l][1] + dp2[k][l][2]) % MD;\n\tfor (k1 = 0; k1 <= m; k1++)\n\t\tfor (k2 = max(n / 3 + 1 - k1, 0); k2 <= n - m; k2++)\n\t\t\tfor (l1 = 0; k1 + l1 <= m; l1++)\n\t\t\t\tfor (l2 = max(n / 3 + 1 - l1, 0); k2 + l2 <= n - m; l2++)\n\t\t\t\t\tdq2[k1 + k2][l1 + l2] = (dq2[k1 + k2][l1 + l2] + (long long) aa2[k1][l1] * aa2[k2][l2]) % MD;\n\tans = A * A;\n\tfor (i = 2; i < n; i++)\n\t\tans = (long long) ans * (A - 1) % MD;\n\tfor (a = 0; a < A; a++)\n\t\tfor (k = kk[a] + 1; k <= n; k++)\n\t\t\tans = (ans - dq1[k]) % MD;\n\tfor (a = 0; a < A; a++)\n\t\tfor (b = a + 1; b < A; b++)\n\t\t\tfor (k = kk[a] + 1; k <= n; k++)\n\t\t\t\tfor (l = kk[b] + 1; k + l <= n; l++)\n\t\t\t\t\tans = (ans + dq2[k][l]) % MD;\n\tif (ans < 0)\n\t\tans += MD;\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c4acb2dbd131e4d118839f122909f8f5", "src_uid": "1f012349f4b229dc98faadf1ca732355", "apr_id": "cfdac10341545008ba9423b92e5eba22", "difficulty": 2700, "tags": ["dp", "fft", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5998142989786444, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \r\n#include \r\n#include \r\n\r\nint main()\r\n{\r\n int n;\r\n scanf(\"%d\",&n);\r\n long a[n];\r\n a[0]=1;\r\n a[1]=3;\r\n a[2]=6;\r\n long sum=a[0]+a[1]+a[2];\r\n for(int j=3;j\r\n\r\nint ysgs(int n) {\r\n if(n==1) return 1;\r\n else {\r\n int cnt=0,i;\r\n for(i=1;i*i100000){\r\n s=345451881;\r\n m=1;\r\n }\r\n if(n>200000) {\r\n s=364228341;\r\n m=2;\r\n }\r\n \r\n \r\n \r\n for( int j=m*100000+1;j\r\n\r\nint ysgs(int n) {\r\n if(n==1) return 1;\r\n else {\r\n int cnt=0,i;\r\n for(i=1;i*i100000){\r\n s=345451881;\r\n m=1;\r\n }\r\n if(n>200000) {\r\n s=364228341;\r\n m=2;\r\n }\r\n if(n>300000) {\r\n s=305860330;\r\n m=3;\r\n }\r\n if(n>400000) {\r\n s=198031628;\r\n m=4;\r\n }\r\n if(n>500000) {\r\n s=292516569;\r\n m=5;\r\n }\r\n if(n>600000) {\r\n s=377314150;\r\n m=6;\r\n }\r\n if(n>700000) {\r\n s=55409794;\r\n m=7;\r\n }\r\n if(n>800000) {\r\n s=731775727;\r\n m=8;\r\n }\r\n if(n>900000) {\r\n s=951702590;\r\n m=9;\r\n }\r\n \r\n \r\n \r\n for( int j=m*100000+1;j\r\n\r\n#include \r\n#include \r\n\r\n#define loop(i, a, b) for(int i=a; i\r\n\r\n#include \r\n#include \r\n\r\n#define loop(i, a, b) for(ll i=a; i\r\nlong long s[4000001];\r\nlong long a[4000001];\r\nlong long n, p, c, k;\r\nint main()\r\n{\r\n scanf(\"%lld%lld\", &n, &p);\r\n s[1] = 1;\r\n a[1] = 1;\r\n for (int i = 2; i <= n; i++)\r\n {\r\n a[i] = s[i - 1];\r\n c = 1;\r\n for (int j = 2; j * j <= i; j++)\r\n {\r\n c = j;\r\n }\r\n k = i - 1;\r\n for (int j = 1; j < c; j++)\r\n {\r\n a[i] += a[j] * ((i / j) - (i / (j + 1))) % p;\r\n k -= (i / j) - (i / (j + 1));\r\n }\r\n for (int j = 2; j <= k + 1; j++)\r\n {\r\n a[i] += a[i / j];\r\n }\r\n s[i] = s[i - 1] + a[i];\r\n s[i] %= p;\r\n a[i] %= p;\r\n }\r\n printf(\"%lld\\n\", a[n]);\r\n}", "lang": "GNU C11", "bug_code_uid": "c1629c0812a0adddc99417bdfeced713", "src_uid": "77443424be253352aaf2b6c89bdd4671", "apr_id": "797ee3702f1ee4a8c86cc3d00c0fd3f2", "difficulty": 1900, "tags": ["dp", "number theory", "math", "brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9983862291554599, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include \n\n#define psum(arr, i) ((i)<0?0:(arr[i]))\n#define uint unsigned int\n\nint main()\n{\n int n, mod; scanf(\"%d %d\", &n, &mod);\n\n int* dp = malloc(n*sizeof(int));\n int* dpsum = calloc(n*sizeof(int), 1);\n\n dp[0] = 1;\n dpsum[0] = 1;\n\n printf(\"1\\n\");\n for (int i=1; i=rind*z; z++) {\n dp[i] += (dpsum[n-(rind*z)] - psum(dpsum, n-(rind*z+z)) + mod) % mod;\n dp[i] %= mod;\n // printf(\"adding range from %d to %d\\n\", n-rind*z, n-rind*z-z);\n }\n\n // printf(\"%d\\n\", dp[i]);\n dpsum[i] = dp[i] + dpsum[i-1];\n dpsum[i] %= mod;\n }\n printf(\"%d\\n\", dp[n-1]);\n free(dp); free(dpsum);\n}\n", "lang": "GNU C11", "bug_code_uid": "94dcf5b5ac7e6313435ca70267c4ef08", "src_uid": "77443424be253352aaf2b6c89bdd4671", "apr_id": "0969908e13d4fa63c66953c30bdc18e7", "difficulty": 1900, "tags": ["dp", "number theory", "math", "brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9815950920245399, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \r\n#include \r\n#include \r\n#include \r\n\r\n#define cL while (getchar() != '\\n') //clear line\r\n#define fi(x) for (i = 0; i < x; i++)\r\n#define fj(x) for (j = 0; j < x; j++)\r\n#define FOR(a, b, c) for (int(a) = (b); (b) < (c) ? (a) <= (c) : (a) >= (c); (b) < (c) ? (a)++ : (a)--)\r\n#define LL long long\r\n#define min(a, b) (a > b ? b : a)\r\n#define max(a, b) (a < b ? b : a)\r\n#define pf printf\r\n#define sf scanf\r\n\r\nint main() {\r\n LL i, j;\r\n scanf(\"%lld%lld\", &i, &j);\r\n char a[2000], b[2000];\r\n memset(b, 0, sizeof(b));\r\n memset(a, 0, sizeof(a));\r\n LL p1 = 0, p2 = 0, k = 0, a1 = i, a2 = j;\r\n if (i == j) {\r\n printf(\"YES\");\r\n return 0;\r\n }\r\n if (i == 0) {\r\n printf(\"NO\");\r\n return 0;\r\n }\r\n while (i) {\r\n a[++p1] = i % 2 + 97, k -= i % 2;\r\n i /= 2;\r\n }\r\n while (j) {\r\n b[++p2] = j % 2 + 97, k += j % 2;\r\n j /= 2;\r\n }\r\n int k1 = strstr(b+1, a+1);\r\n if (k1) {\r\n if (p2 - p1 == k) {\r\n printf(\"YES\");\r\n return 0;\r\n }\r\n }\r\n FOR(i, 1, p1 / 2) {\r\n char tmp;\r\n tmp = a[i], a[i] = a[p1 + 1 - i], a[p1 + 1 - i] = tmp;\r\n }\r\n k1 = strstr(b+1, a+1);\r\n if (k1) {\r\n if (p2 - p1 == k) {\r\n printf(\"YES\");\r\n return 0;\r\n }\r\n }\r\n\r\n p1 = 0, p2 = 0, k = 0;\r\n i = a1, j = a2;\r\n memset(b, 0, sizeof(b));\r\n memset(a, 0, sizeof(a));\r\n\r\n while (i % 2 == 0)\r\n i /= 2;\r\n while (i) {\r\n a[++p1] = i % 2 + 97, k -= i % 2;\r\n i /= 2;\r\n }\r\n while (j) {\r\n b[++p2] = j % 2 + 97, k += j % 2;\r\n j /= 2;\r\n }\r\n k1 = strstr(b+1, a+1);\r\n if (k1) {\r\n if (p2 - p1 == k) {\r\n printf(\"YES\");\r\n return 0;\r\n }\r\n }\r\n FOR(i, 1, p1 / 2) {\r\n char tmp;\r\n tmp = a[i], a[i] = a[p1 + 1 - i], a[p1 + 1 - i] = tmp;\r\n }\r\n k1 = strstr(b+1, a+1);\r\n if (k1) {\r\n if (p2 - p1 == k) {\r\n printf(\"YES\");\r\n return 0;\r\n }\r\n }\r\n printf(\"NO\");\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "6cd1e7d2aeaafad186fe2d2412a55e64", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "0031c807afe442331d5de0916e0cb772", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9993342210386151, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#include\n\nchar bb[128];\nvoid assert(int *p) { *p=0; }\nint main() {\n long long a, b, rb, v, o=1, v1, v2,v3, pa;\n int c1, c2;\n int i, k, m;\n while(scanf(\"%lld %lld\", &a, &b)==2) {\n if ((b&1)==0) {\n if (a!=b) printf(\"NO\\n\");\n else printf(\"YES\\n\");\n return 0;\n }\n v=b; i=0; while(v) { bb[i]=v&1; v>>=1; i++; }\n\n rb=0; for (k=0; k>=1;\n v=a; i=0; while(v) { v>>=1; i++; } k=i;\n m=0; for (c1=0; c1+k<64&&m==0; c1++) {\n for (c2=0; c2+c1+k<64; c2++) {\n v1=((o<>62)==0) {\n a=(pa<<1)+1;\n if (a<0) assert(0);\n v=a; i=0; while(v) { v>>=1; i++; } k=i;\n m=0; for (c1=0; c1+k<64&&m==0; c1++) {\n for (c2=0; c2+c1+k<64; c2++) {\n v1=((o<\r\n#include \r\n#include \r\n#include \r\n\r\nint count(long long a) {\r\n int n = 0;\r\n while (a) {\r\n n += !!(a&1);\r\n a >>= 1;\r\n }\r\n return n;\r\n}\r\n\r\nchar *gen(long long a) {\r\n char *perm = malloc(sizeof(char) * count(a));\r\n int i = 0;\r\n perm[i] = '0';\r\n while (a) {\r\n if (a & 1) perm[++i] = '0';\r\n else perm[i]++;\r\n a >>= 1;\r\n }\r\n perm[i] = '\\0';\r\n return perm;\r\n}\r\n\r\nchar *reverse(char *px) {\r\n char *perm = malloc(sizeof(char) * px[0]);\r\n int n = strlen(px);\r\n for (int i = 0; i < n; i++)\r\n perm[i] = px[n-1-i];\r\n perm[n] = '\\0';\r\n return perm;\r\n}\r\n\r\nint check(char *y, char *x) {\r\n char *str = strstr(y, x);\r\n if (str == NULL) return 0;\r\n char a[28] = \"000000000000000000000000000\", temp[27];\r\n int len = strlen(x);\r\n strncpy(temp, str, len);\r\n strncpy(str, a, len);\r\n for (int i = 0; y[i] != '\\0'; i++)\r\n if (y[i] != '0' && y[i] != '1') return 0;\r\n\r\n strncpy(str, temp, len);\r\n return 1;\r\n}\r\n\r\nint main() {\r\n long long x, y;\r\n scanf(\"%\"PRId64\"%\"PRId64\"\", &x, &y);\r\n char *permX = gen(x), *permY = gen(y);\r\n int found = check(permY, permX);\r\n found |= check(permY, permX+1);\r\n permX = reverse(permX);\r\n found |= check(permY, permX);\r\n puts(found ? \"YES\" : \"NO\");\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "4f417362cf6a824f9cc84023838a0c4c", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "fd3d966ba579c79a4cde8f46c0798fde", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9877944933295487, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n#include \r\n#include \r\n#include \r\n\r\nchar *reverse(char *px) {\r\n int n = strlen(px);\r\n char *perm = malloc(sizeof(char) * (n+1));\r\n for (int i = 0; i < n; i++)\r\n perm[i] = px[n-1-i];\r\n perm[n] = '\\0';\r\n return perm;\r\n}\r\n\r\nchar *gen(long long a) {\r\n char *perm = malloc(sizeof(char) * 100);\r\n int i = 0;\r\n while (a) {\r\n if (a & 1) perm[i++] = '1';\r\n else perm[i++] = '0';\r\n a >>= 1;\r\n }\r\n perm[i] = '\\0';\r\n return reverse(perm);\r\n}\r\n\r\nint check(char *y, char *x) {\r\n char *yy = malloc(sizeof(char) * 100), *xx = malloc(sizeof(char) * 100), one[100], temp[100];\r\n strcpy(xx, x), strcpy(yy, y);\r\n for (int i = 0; i < 100; i++) one[i] = '1';\r\n\r\n char *str = strstr(yy, xx);\r\n int len = strlen(xx), i;\r\n if (str != NULL) {\r\n strncpy(temp, str, len);\r\n strncpy(str, one, len);\r\n for (i = 0; yy[i] != '\\0'; i++)\r\n if (yy[i] != '1') break;\r\n strncpy(str, temp, len);\r\n\r\n if (yy[i] == '\\0') return 1;\r\n }\r\n\r\n xx = reverse(xx);\r\n\r\n str = strstr(yy, xx);\r\n if (str != NULL) {\r\n strncpy(temp, str, len);\r\n strncpy(str, one, len);\r\n for (i = 0; yy[i] != '\\0'; i++)\r\n if (yy[i] != '1') break;\r\n strncpy(str, temp, len);\r\n\r\n if (yy[i] == '\\0') return 1;\r\n }\r\n\r\n return 0;\r\n}\r\n\r\nint main() {\r\n long long x, y;\r\n scanf(\"%\"PRId64\"%\"PRId64\"\", &x, &y);\r\n char *permX = gen(x), *permY = gen(y);\r\n x = strlen(permX), y = strlen(permY);\r\n\r\n int found = 0;\r\n if (permX[x-1] == '1') {\r\n found |= check(permY, permX);\r\n }\r\n else {\r\n permX[x] = '1', permX[x+1] = '\\0';\r\n found |= check(permY, permX);\r\n while (permX[x-1] == '0') permX[--x] = '\\0';\r\n found |= check(permY, permX);\r\n }\r\n\r\n puts(found ? \"YES\" : \"NO\");\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "f0b4392d32fb6787805fce72930e1758", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "fd3d966ba579c79a4cde8f46c0798fde", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8685948531086313, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#define __USE_MINGW_ANSI_STDIO 0\r\n#include \r\n#include \r\n#include \r\n\r\n#define maxN 65\r\n\r\nchar str[maxN];\r\nchar tmpstr[maxN];\r\nchar tgt[maxN];\r\n\r\nint zeroCnt(char *str) {\r\n int ctr = 0;\r\n for (int i = strlen(str) - 1; i >= 0; --i) {\r\n if (str[i] == '0') ++ctr;\r\n }\r\n return ctr;\r\n}\r\n\r\nvoid trim(char *str) {\r\n for (int i = strlen(str) - 1; i >= 0; --i) {\r\n if (str[i] == '1') break;\r\n else str[i] = '\\0';\r\n }\r\n}\r\n\r\nstatic inline void cswap(char *a, char *b) {\r\n char tmp = *a;\r\n *a = *b;\r\n *b = tmp;\r\n return;\r\n}\r\n\r\nvoid reverse(char *str) {\r\n int p = 0, q = strlen(str) - 1;\r\n for (; p < q; ++p, --q) {\r\n cswap(&str[p], &str[q]);\r\n }\r\n}\r\n\r\n// bin\r\n#define lltoa(a, b) _lltoa(a, b)\r\nvoid _lltoa(long long num, char *dest) {\r\n int len = 0;\r\n while (num) {\r\n if (num % 2 == 0) dest[len++] = '0';\r\n else dest[len++] = '1';\r\n num /= 2;\r\n }\r\n dest[len] = '\\0';\r\n reverse(dest);\r\n}\r\n\r\nvoid testcase() {\r\n long long a, b;\r\n scanf(\"%lld%lld\", &a, &b);\r\n lltoa(a, str);\r\n lltoa(b, tgt);\r\n // Orig string: Either equal, or at least a 1 on the right, and any amount of 1s on the left and right after.\r\n if (strcmp(tgt, str) == 0) { printf(\"YES\\n\"); return; }\r\n // Make sure at least one 1 is on the right.\r\n strcpy(tmpstr, str);\r\n int len = strlen(tmpstr);\r\n if (tmpstr[len - 1] == '0') {\r\n tmpstr[len++] = '1';\r\n tmpstr[len] = '\\0';\r\n }\r\n if (strstr(tgt, tmpstr) && zeroCnt(tgt) == zeroCnt(tmpstr)) { printf(\"YES\\n\"); return; }\r\n\r\n // 2 flips performed: Completely trimmed. Add any amount of 1s to the left or right.\r\n trim(str);\r\n if (strstr(tgt, str) && zeroCnt(tgt) == zeroCnt(str)) { printf(\"YES\\n\"); return; }\r\n \r\n // 1 flip performed. Both sides start and end with a 1. Add any amounts of 1 left and right.\r\n reverse(str);\r\n trim(str);\r\n if (strstr(tgt, str) && zeroCnt(tgt) == zeroCnt(str)) { printf(\"YES\\n\"); return; }\r\n printf(\"NO\\n\");\r\n\r\n return;\r\n}\r\n\r\nint main() {\r\n testcase();\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "abf8a4b7b199ce1620354815f438639e", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "2b423f73acd81b09fac5320b2c6cf035", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9451653411469234, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n\n#define N\t62\n\nlong long min(long long a, long long b) { return a < b ? a : b; }\n\nlong long rev(long long x) {\n\tlong long y = 0;\n\n\twhile (x) {\n\t\ty = y << 1 | (x & 1);\n\t\tx >>= 1;\n\t}\n\treturn y;\n}\n\nlong long padded(long long a, long long b) {\n\treturn a % b == 0 && ((a / b) & (a / b - 1)) == 0;\n}\n\nint main() {\n\tstatic long long yy[N];\n\tlong long x, y, z;\n\tint n, l, r, i;\n\n\tscanf(\"%lld%lld\", &x, &y), x = rev(rev(x));\n\tif (x == y) {\n\t\tprintf(\"YES\\n\");\n\t\treturn 0;\n\t}\n\tif ((y & 1) == 0) {\n\t\tprintf(\"NO\\n\");\n\t\treturn 0;\n\t}\n\tn = 0;\n\twhile (y)\n\t\tyy[n++] = y & 1, y >>= 1;\n\tfor (l = 0; l < n; l++) {\n\t\tfor (r = n - 1; r >= 0; r--) {\n\t\t\tif (yy[l] == 0 && yy[r] == 0)\n\t\t\t\tbreak;\n\t\t\telse if (yy[l] == 0) {\n\t\t\t\tz = 0;\n\t\t\t\tfor (i = r; i >= l; i--)\n\t\t\t\t\tz = z * 2 + yy[i];\n\t\t\t\tif (x == z) {\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else if (yy[r] == 0) {\n\t\t\t\tz = 0;\n\t\t\t\tfor (i = l; i <= r; i++)\n\t\t\t\t\tz = z * 2 + yy[i];\n\t\t\t\tif (x == z) {\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tz = 0;\n\t\t\t\tfor (i = l; i <= r; i++)\n\t\t\t\t\tz = z * 2 + yy[i];\n\t\t\t\tif (padded(x, z) || padded(x, rev(z))) {\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (yy[l] == 0)\n\t\t\tbreak;\n\t}\n\tprintf(\"NO\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e060e4114d3cb1cb6a73084b497735f0", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "e3da6ee8395c30ba294a05cac7960de1", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9519392917369308, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n\n#define N\t62\n\nlong long min(long long a, long long b) { return a < b ? a : b; }\n\nlong long rev(long long x) {\n\tlong long y = 0;\n\n\twhile (x) {\n\t\ty = y << 1 | (x & 1);\n\t\tx >>= 1;\n\t}\n\treturn y;\n}\n\nlong long padded(long long a, long long b) {\n\treturn a % b == 0 && ((a / b) & (a / b - 1)) == 0;\n}\n\nint main() {\n\tstatic long long yy[N];\n\tlong long x, y, z;\n\tint n, l, r, i;\n\n\tscanf(\"%lld%lld\", &x, &y);\n\tif (x == y) {\n\t\tprintf(\"YES\\n\");\n\t\treturn 0;\n\t}\n\tif ((y & 1) == 0) {\n\t\tprintf(\"NO\\n\");\n\t\treturn 0;\n\t}\n\tn = 0;\n\twhile (y)\n\t\tyy[n++] = y & 1, y >>= 1;\n\tfor (l = 0; l < n; l++) {\n\t\tfor (r = n - 1; r >= 0; r--) {\n\t\t\tif (yy[l] == 0 && yy[r] == 0)\n\t\t\t\tbreak;\n\t\t\telse if (yy[l] == 0) {\n\t\t\t\tz = 0;\n\t\t\t\tfor (i = r; i >= l; i--)\n\t\t\t\t\tz = z * 2 + yy[i];\n\t\t\t\tif (x == z) {\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else if (yy[r] == 0) {\n\t\t\t\tz = 0;\n\t\t\t\tfor (i = l; i <= r; i++)\n\t\t\t\t\tz = z * 2 + yy[i];\n\t\t\t\tif (x == z) {\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tz = 0;\n\t\t\t\tfor (i = l; i <= r; i++)\n\t\t\t\t\tz = z * 2 + yy[i];\n\t\t\t\tif (padded(x, z) || padded(x, rev(z))) {\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (yy[l] == 0)\n\t\t\tbreak;\n\t}\n\tprintf(\"NO\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "95d6814e4f492cf9c770263306456403", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "e3da6ee8395c30ba294a05cac7960de1", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.88804140561155, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \r\n#include \r\n#include \r\n#include \r\n\r\nint64_t x, y;\r\nint n_0, n_1, m;\r\nint s_0[100], s_1[100], t[100];\r\n\r\nvoid build(int64_t value, int* buffer, int* size, bool keep_trailing_zero) {\r\n *size = 0;\r\n if (!keep_trailing_zero)\r\n while (value % 2 == 0) value /= 2;\r\n while (value > 0) {\r\n buffer[(*size)++] = value % 2;\r\n value /= 2;\r\n }\r\n}\r\n\r\nvoid reverse(int* a, int size) {\r\n for (int i = 0, j = size - 1; i < j; i++, j--) {\r\n a[i] ^= a[j];\r\n a[j] ^= a[i];\r\n a[i] ^= a[j];\r\n }\r\n}\r\n\r\nbool try_match(int* s, int n, int* t, int m) {\r\n for (int i = 0; i + n <= m; i++) {\r\n if (t[i] == 0) break;\r\n bool good = true;\r\n for (int j = 0; j < n; j++) {\r\n if (t[i + j] != s[j]) {\r\n good = false;\r\n break;\r\n }\r\n }\r\n if (!good) continue;\r\n for (int j = i + n; j < m; j++) {\r\n if (t[j] == 0) {\r\n good = false;\r\n break;\r\n }\r\n }\r\n if (good) return true;\r\n }\r\n return false;\r\n}\r\n\r\nvoid solve() {\r\n scanf(\"%lld %lld\", &x, &y);\r\n build(x, s_0, &n_0, false);\r\n build(x * 2 + 1, s_1, &n_1, true);\r\n build(y, t, &m, true);\r\n if (try_match(s_0, n_0, t, m)) {\r\n printf(\"YES\\n\");\r\n return;\r\n }\r\n reverse(s_0, n_0);\r\n if (try_match(s_0, n_0, t, m)) {\r\n printf(\"YES\\n\");\r\n return;\r\n }\r\n\r\n if (try_match(s_1, n_1, t, m)) {\r\n printf(\"YES\\n\");\r\n return;\r\n }\r\n reverse(s_1, n_1);\r\n if (try_match(s_1, n_1, t, m)) {\r\n printf(\"YES\\n\");\r\n return;\r\n }\r\n\r\n printf(\"NO\\n\");\r\n}\r\n\r\nint main() {\r\n int t = 1;\r\n // scanf(\"%d\", &t);\r\n while (t--) solve();\r\n}", "lang": "GNU C11", "bug_code_uid": "e1f94f985e048743f9dab8d2166719e4", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "dcd39686bc42ff080bb50002311e968a", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9690808979246082, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint func (long long x, int n, int ans, int num, long long *pow10, long long *pow9) {\n int cnt = 0;\n int digit[10] = {};\n \n long long tmp = x;\n \n while (tmp > 0LL) {\n digit[(int)(tmp%10LL)] = 1;\n tmp /= 10LL;\n cnt++;\n }\n \n if (cnt > n) {\n return 100;\n }\n \n if (cnt == n) {\n return num;\n }\n \n for (int i = 9; i > 1; i--) {\n if (digit[i] > 0) {\n long long nx = x*((long long)i);\n if (ans-num-1 > 17 || (pow10[n-1]-1LL)/pow9[ans-num-1] < nx) {\n int tmp = func(nx, n, ans, num+1, pow10, pow9);\n if (tmp < ans) {\n ans = tmp;\n }\n }\n }\n }\n \n return ans;\n}\n\nint main () {\n int n = 0;\n long long x = 0LL;\n \n int res = 0;\n \n long long pow10[19] = {};\n long long pow9[19] = {}; \n \n int ans = 0;\n \n res = scanf(\"%d\", &n);\n res = scanf(\"%lld\", &x);\n \n pow10[0] = 1LL;\n for (int i = 1; i <= n; i++) {\n pow10[i] = 10LL*pow10[i-1];\n }\n \n pow9[0] = 1LL;\n for (int i = 1; i < 19; i++) {\n pow9[i] = 9LL*pow9[i-1];\n }\n \n ans = func(x, n, 100, 0, pow10, pow9);\n if (ans >= 100) {\n ans = -1;\n }\n \n printf(\"%d\\n\", ans);\n \n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "89f8cbe84cf4763790513f6f38e93eee", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "44fb59068ba016cf963ae256e30d8d6f", "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": "C"} {"similarity_score": 0.525328330206379, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include \r\n\r\ntypedef unsigned long long ll;\r\n#define rll register ll\r\n#define rint register int\r\n#define rep(i,a,b) for(rint i=(a);i<(b);i++)\r\n#define repe(i,a,b) for(rint i=(a);i<=(b);i++)\r\n#define repr(i,a,b) for(rint i=(a)-1;(b)<=i;i--)\r\n\r\nint writeBuffer[20];\r\nvoid write(ll num) { if (num == 0) putchar('0'); else { rint size = 0; rll current; if (0 < num) current = num; else current = -num, putchar('-'); while (0 < current) writeBuffer[size++] = current%10+'0', current /= 10; while (0 < size) putchar(writeBuffer[--size]); } }\r\nll read() { rint sign = 1; rll num = 0; while (1) { rint ch = getchar(); if (ch == '-') { sign = -sign; continue; } if (ch <= 32) break; num = num*10+(ch-'0'); } return sign*num; }\r\n\r\nll dp[100][1<<10];\r\n\r\nint main() {\r\n rint n = read();\r\n rll target = 1;\r\n rep(i,0,n) target *= 10;\r\n\r\n rll x = read();\r\n\r\n {\r\n rint mask = 0;\r\n for (rll temp=x;temp;temp/=10) mask |= 1<<(temp%10);\r\n dp[0][mask] = x;\r\n }\r\n\r\n rint depth = 0;\r\n while (1) {\r\n rint found = 0;\r\n rep(j,0,1024) {\r\n rll num = dp[depth][j];\r\n if (num) {\r\n rep(k,2,10) if (j&(1<\r\n#include\r\n#include\r\n#include\r\nusing namespace std;\r\nvectorv[1000500];\r\nconst int mod=1000000007;\r\nint cur[1000500];\r\nlong long inv[2000050];\r\nlong long fc[2000050];\r\nlong long vv[1000500];\r\nlong long f(long long a,long long b);\r\nvoid init()\r\n{\r\n\tmemset(cur,0,sizeof(cur));\r\n\tfc[0]=1LL;\r\n\tfor(int i=1;i<2000000;i++)\r\n\tfc[i]=fc[i-1]*i%mod;\r\n\tfor(int i=0;i<2000000;i++)\r\n\tinv[i]=f(fc[i],mod-2);\r\n\tfor(int i=1;i<=1000000;i++)\r\n\tvv[i]=i;\r\n\tcur[1]=1;\r\n\tfor(int i=2;i<=1000000;i++)\r\n\t{\r\n\t\tif(!cur[i])\r\n\t\t{\r\n\t\t\tv[i].push_back(1);\r\n\t\t\tfor(int j=i+i;j<=1000000;j+=i)\r\n\t\t\t{\r\n\t\t\t\tcur[j]=1;\r\n\t\t\t\tint q=0;\r\n\t\t\t\twhile(vv[j]%i==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tq++;\r\n\t\t\t\t\tvv[j]/=i;\r\n\t\t\t\t}\r\n\t\t\t\tv[j].push_back(q);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nlong long f(long long a,long long b)\r\n{\r\n\tlong long c=1;\r\n\twhile(b)\r\n\t{\r\n\t\tif(b&1)\r\n\t\t{\r\n\t\t\tc*=a;\r\n\t\t\tc%=mod;\r\n\t\t}\r\n\t\ta*=a;\r\n\t\ta%=mod;\r\n\t\tb>>=1;\r\n\t}\r\n\treturn c;\r\n}\r\nint main()\r\n{\r\n\t\r\n\tinit();\r\n\tint T;\r\n\tscanf(\"%d\",&T);\r\n\twhile(T--)\r\n\t{\r\n\t\tlong long x,y;\r\n\t\tscanf(\"%lld%lld\",&x,&y);\r\n\t\tlong long ans=1;\r\n\t\tfor(int i=0;i\r\nint main(){\r\n int n,k;\r\n // int sum=0;\r\n int arr[3];\r\n scanf(\"%d\",&n);\r\n for(int i=0;i0){\r\n printf(\"YES\\n\");\r\n }else printf(\"NO\");\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "f9441f8c0ad8cb4a6a41e2a5c122015f", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "6002e3c0a8f116197b1a82bc6e0a3b68", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9503386004514672, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main(){\r\n int n,k;\r\n // int sum=0;\r\n int arr[3];\r\n scanf(\"%d\",&n);\r\n for(int i=0;i0&&arr[arr[arr[p-1]]]>0){\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "00517581df287b109eae7f4b6a03f087", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "6002e3c0a8f116197b1a82bc6e0a3b68", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9527027027027027, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main(){\r\n int n,k;\r\n // int sum=0;\r\n int arr[3];\r\n scanf(\"%d\",&n);\r\n for(int i=0;i0&&arr[arr[arr[p-1]]]>0){\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "eeb02bc85cbd86cdb4ea7abe24c2522a", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "6002e3c0a8f116197b1a82bc6e0a3b68", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9102990033222591, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main()\r\n{\r\n int a[4];\r\n int t,x,c,j,d;\r\n scanf(\"%d\\n\",&t);\r\n for(int i = 0; i < t; i++)\r\n {\r\n scanf(\"%d\\n\",&x);\r\n for(j = 1; j <= 3; j++)\r\n {\r\n scanf(\"%d\",&a[j]);\r\n }\r\n if(a[x] != 0)\r\n {\r\n c = a[x];\r\n if(a[c] != 0)\r\n {\r\n d = a[c];\r\n if(a[d] == 0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "2f4c1c495ccdab24cb08b81539ddfbbe", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "6ce46857bd56a9d2c12696b976aee295", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8577981651376146, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; i++)\r\n {\r\n int x, abc[3];\r\n scanf(\"%d\", &x);\r\n scanf(\"%d %d %d\", &abc[0], &abc[1], &abc[2]);\r\n\r\n int key1 = abc[x] if (abc[key1] != 0)\r\n {\r\n print(\"YES\");\r\n }\r\n else\r\n {\r\n print(\"NO\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "a4964f0617941d2947bd2bea4260c363", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "c536f33020d4bbc2d8ef97bf25c7af23", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8558558558558559, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; i++)\r\n {\r\n int x, abc[3];\r\n scanf(\"%d\", &x);\r\n scanf(\"%d %d %d\", &abc[0], &abc[1], &abc[2]);\r\n\r\n int key1 = abc[x];\r\n if (abc[key1] != 0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "f21dc76afab9c1196995908caa59055f", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "c536f33020d4bbc2d8ef97bf25c7af23", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9107142857142857, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; i++)\r\n {\r\n int x, abc[3];\r\n scanf(\"%d\", &x);\r\n scanf(\"%d %d %d\", &abc[0], &abc[1], &abc[2]);\r\n\r\n int key1 = abc[x - 1];\r\n if (abc[key1 - 1] != 0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "a909f6d9d4df9648107537dd185546ca", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "c536f33020d4bbc2d8ef97bf25c7af23", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9797998867283368, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t,x,a,b,c;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\n\r\nvoid key_func(int x, int a, int b, int c);\r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 1; i <= t; i++)\r\n {\r\n int x, a, b, c;\r\n scanf(\"%d\", &x);\r\n scanf(\"%d %d %d\", &a, &b, &c);\r\n\r\n key_func(x, a, b, c);\r\n\r\n return 0;\r\n }\r\n}\r\n\r\nvoid key_func(int x, int a, int b, int c)\r\n{\r\n if ((x == 1 && a == 2 && b == 3) || (x == 1 && a == 3 && c == 2))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else if ((x == 2 && b == 3 && c == 1) || (x == 2 && b == 1 && a == 3))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else if ((x == 3 && c == 2 && b == 1) || (x == 3 && c == 1 && a == 2))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "972166c32298ed76943f60cf46cc8121", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "55fba3b3552ea1fd665605092ea4bc34", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.24476439790575916, "equal_cnt": 23, "replace_cnt": 21, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,e;\n scanf(\"%d\", &a);\n for (int i = 0; i < a; i++)\n {\n scanf(\"%d\", &b);\n scanf(\"%d %d %d\", &c, &d, &e);\n \n if (b == 1 && c > 0 && (c == 3 && e > 0) || (c == 2) && d > 0)\n printf(\"YES\\n\");\n else if (b == 2 &&d>0&&( d == 3 &&e>0)||(d==1)&&c>0 )\n printf(\"YES\\n\");\n \n else if (b == 3 && e > 0 && (e == 2 && d > 0) || (e == 1) && c > 0)\n \n printf(\"YES\\n\");\n else \n printf(\"NO\\n\");\n \n }\n return 0;\n}\n \t \t \t \t \t \t \t \t\t\t \t", "lang": "GNU C11", "bug_code_uid": "4bcb4d249d1bd2f6e0cb5196584d2444", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "0df208d91fc3567e6034930367bac1b0", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.18009118541033434, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include \nint main(){\n\n\t//identiy the variables \n\tint a=0,b=0,c=0;\n\tint k; //the number you are holding \n\tint a_,b_,c_; //the keys behind \n\n\t//request the input from the user\n\tprintf(\"What number is the key in your hand?\\n\");\n\tscanf(\"%d\",&k);\n\tprintf(\"Please write the key numbers behind doors you open respectively:\");\n\tscanf(\"%d%d%d\",&a_, &b_,&c_);\n\n\t//all possible false returns\n\n\t//you are holding number 1 on your hands \n\n\tif(k==1){\n\t\tif(a_==0){\n\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\treturn 0; \n\t\t}\n\t\telse if(a_==2 && b_==0){\n\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\treturn 0;\n\t\t}\n\t\telse if(a_==3 && c_==0){\n\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\tprintf(\"Now you can open the doors\\n.\");\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\t//you are holding number 2 on your hands \n\n\t\tif(k==2){\n\t\t\tif(b_==0){\n\t\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\t\treturn 0; \n\t\t\t}\n\t\t\telse if(b_==1 && a_==0){\n\t\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse if(b_==3 && c_==0){\n\t\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tprintf(\"Now you can open the doors\\n.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t//you are holding number 3 on your hands \n\n\t\tif(k==3){\n\t\t\tif(c_==0){\n\t\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\t\treturn 0; \n\t\t\t}\n\t\t\telse if(c_==1 && a_==0){\n\t\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse if(c_==2 && b_==0){\n\t\t\t\tprintf(\"Sorry, no way you can open all the doors.\\n\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tprintf(\"Now you can open the doors\\n.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\nreturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "457f00f746b7b893d2fa9516d0283b6a", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "2586f51de4cfd035d5ae602f1c98399b", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6734913793103449, "equal_cnt": 28, "replace_cnt": 20, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 28, "bug_source_code": "#include \n\nint main(){\n\n\t//identiy the variables \n\tint a=0,b=0,c=0;\n\tint k; //the number you are holding \n\tint a_,b_,c_; //the keys behind \n\n\t//request the input from the user\n\tprintf(\"What number is the key in your hand?\\n\");\n\tscanf(\"%d\",&k);\n\tprintf(\"Please write the key numbers after each door:\");\n\tscanf(\"%d %d %d\",&a_, &b_,&c_);\n\n\n\tif(k == 1){\n\t\tif(a_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse if(a_ == 2 && b_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse if(a_ == 3 && c_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse{\n\t\t\tprintf(\"YES\");\n\t\t}\n\n\telse if(k == 2){\n\t\tif(b_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse if(b_ == 1 && a_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse if(b_ == 3 && c_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse{\n\t\t\tprintf(\"YES\");\t\n\n\telse{\n\t\tif(c_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse if(c_ == 1 && a_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse if(c_ == 2 && b_ == 0){\n\t\t\tprintf(\"NO\");\n\t\t}\n\t\telse{\n\t\t\tprintf(\"YES\");\t\n\n\t}\t\t\n\n\treturn 0;\n\n\t}", "lang": "GNU C11", "bug_code_uid": "4aba3789c1eb2dadfba085363f8e02b5", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "2586f51de4cfd035d5ae602f1c98399b", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.49791840133222315, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 11, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "#include\r\nint main()\r\n{\r\n int x,a,b,c,t,i,count=0;\r\n int arr[3];\r\n scanf(\"%d\",&t);\r\n if(1<=t<=18)\r\n {\r\n while(t--)\r\n {\r\n\r\n scanf(\"%d\",&x);\r\n for(i=0; i<3; i++)\r\n {\r\n scanf(\"%d\",&arr[i]);\r\n }\r\n\r\n for(i=0; i<3; i++)\r\n {\r\n if(arr[x-1]!=0)\r\n {\r\n x=arr[x-1];\r\n count++;\r\n }\r\n if(arr[x-1]==0)\r\n break;\r\n\r\n }\r\n\r\n if(count==2)\r\n printf(\"YES\");\r\n else\r\n printf(\"NO\");\r\n }}\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "bc88077b21df0e32afdeadd24a600070", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "197179dc65cd92d3dfef2e8354fabf7b", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6607773851590106, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int x,a[3],i,sum=0;\r\n scanf(\"%d\",&x);\r\n for(i=0;i<3;i++){\r\n scanf(\"%d\",&a[i]);\r\n sum+=a[i];\r\n }\r\n int r=0;\r\n for(i=0;i<3;i++){\r\n if(a[x-1]==0 || a[sum]==0){\r\n r=1;\r\n }\r\n }\r\n if(r){\r\n printf(\"NO\\n\");\r\n }else\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n\r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "26663029b651df49f6eaf9381f3eda57", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "9816f04f21df6d08adeb271c4d18cd72", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7643312101910829, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\r\nint q,l,b[4];\r\nint main() {\r\n scanf(\"%d\",&q);\r\n while(q--) {\r\n scanf(\"%d%d%d%d\",&l,b+1,b+2,b+3);\r\n if (b[b[l]]!=0) {\r\n printf(\"YES\");\r\n }\r\n else {\r\n printf(\"NO\");\r\n }\r\n }\r\n return 0;\r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "28b8d6e587be3899f96445a0418f49ee", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "63d1c2d2b4c6215becc9366325448d62", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9989785495403473, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main(){\r\n int k;\r\n scanf(\"%d\",&k);\r\n while(k--){\r\n int n;\r\n scanf(\"%d\",&n);\r\n int arr[3];\r\n for(int i=0;i<3;i++){\r\n scanf(\"%d\",&arr[i]);\r\n }\r\n int count=0;\r\n int tem=arr[n-1];\r\n while(tem!=0){\r\n tem=arr[temp-1];\r\n count=count+1;\r\n }\r\n if (count==2){\r\n printf(\"YES\\n\");\r\n }\r\n else{\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "1b75f0f0a30303ac7f32b8b79da6cbce", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "79d9e09101bf092c80320a311b0114e5", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9959016393442623, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main(){\r\n int k;\r\n scanf(\"%d\",&k);\r\n while(k--){\r\n int n;\r\n scanf(\"%d\",&n);\r\n int arr[3];\r\n for(int i=0;i<3;i++){\r\n scanf(\"%d\",&arr[i]);\r\n }\r\n int count=0;\r\n int tem=arr[n-1];\r\n while(tem!=0){\r\n tem=arr[n-1];\r\n count=count+1;\r\n }\r\n if (count==2){\r\n printf(\"YES\\n\");\r\n }\r\n else{\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "3d2aad003130f684156b110f2c7a82c1", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "79d9e09101bf092c80320a311b0114e5", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8847826086956522, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "#include \r\n#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n\r\n while(t--)\r\n {\r\n int m, x, a[4];\r\n scanf(\"%d\", &m);\r\n scanf(\"%d %d %d\", &a[1], &a[2], &a[3]);\r\n if(a[m]!=0)\r\n {\r\n x=a[m];\r\n if(a[x]!=0)\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n\r\n return 0;\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "ac803e6f7e913518a9f6a31c833398b0", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "62e1c195651547b66446af5cfb1c45e7", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8806749698674167, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n int x;\r\n scanf(\"%d\", &x);\r\n int a, b, c, i;\r\n int s[3];\r\n scanf(\"%d %d %d\", &a, &b, &c);\r\n for(i = 1; i <= 3; i++)\r\n {\r\n s[1] = a;\r\n s[2] = b;\r\n s[3] = c;\r\n }\r\n for(i = 1; i <= 3; i++)\r\n {\r\n //printf(\"%d\\n\", s[i]);\r\n if(s[x] == 0)\r\n {\r\n printf(\"NO\\n\");\r\n break;\r\n }\r\n else\r\n {\r\n if(s[x] == i)\r\n {\r\n printf(\"%d\\n\", s[x]);\r\n if(s[i] == 0)\r\n {\r\n printf(\"NO\\n\");\r\n break;\r\n }\r\n else\r\n {\r\n printf(\"%d\\n\", s[i]);\r\n if(s[i] == 0)\r\n {\r\n printf(\"NO\\n\");\r\n break;\r\n }\r\n else\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "a89ea7dedfe2bdc45812e7215423908e", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "1f841bef849782e5a4ac445e894d57eb", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9994855967078189, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t,i;\r\n scanf(\"%d\",&t);\r\n for(i=0;i\r\nint main()\r\n{\r\n int n, x,i,flag;\r\n scanf(\"%d\",&n);\r\n for(i=1; i<=n; i++)\r\n {\r\n scanf(\"%d\",&x);\r\n int a[3];\r\n for(i=0; i<3; i++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n for(int j=1; j<=2; j++)\r\n {\r\n if(a[x-1]==0)\r\n {\r\n printf(\"NO\\n\");\r\n flag=1;\r\n break;\r\n }\r\n else\r\n {\r\n x=a[x-1];\r\n flag=0;\r\n }\r\n }\r\n if(flag==0)\r\n {\r\n\r\n printf(\"YES\\n\");}\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "394fcc4bebe1c4f62fe950dd11246d28", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "cac82fd90bf230358b238e70ba11ee23", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9984025559105432, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n, x,i,flag;\r\n scanf(\"%d\",&n);\r\n for(i=1; i<=n; i++)\r\n {\r\n scanf(\"%d\",&x);\r\n int a[3];\r\n for(int j=0; j<3; j++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n for(int j=1; j<=2; j++)\r\n {\r\n if(a[x-1]==0)\r\n {\r\n printf(\"NO\\n\");\r\n flag=1;\r\n break;\r\n }\r\n else\r\n {\r\n x=a[x-1];\r\n flag=0;\r\n }\r\n }\r\n if(flag==0)\r\n {\r\n\r\n printf(\"YES\\n\");}\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "02d0c5607def00f848eed0a1a89da564", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "cac82fd90bf230358b238e70ba11ee23", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9917713295799048, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int x,a,b,c,f;\r\n scanf(\"%d%d%d%d\",&x,&a,&b,&c);\r\n if(x==1){\r\n if(a==2){\r\n if(b==3){\r\n f=1;\r\n }\r\n else f=0;\r\n }\r\n else if(a==3){\r\n if(c==2) f=1;\r\n else f=0;\r\n \r\n }\r\n else f=0;\r\n }\r\n else if(x==2){\r\n if(b==1){\r\n if(a==3){\r\n f=1;\r\n }\r\n else f=0;\r\n }\r\n else if(b==3){\r\n if(c==2) f=1;\r\n else f=0;\r\n \r\n }\r\n else f=0;\r\n }\r\n else if(x==3){\r\n if(c==1){\r\n if(a==2){\r\n f=1;\r\n }\r\n else f=0;\r\n }\r\n else if(c==2){\r\n if(b==1) f=1;\r\n else f=0;\r\n \r\n }\r\n else f=0;\r\n }\r\n \r\n if(f==1)\r\n printf(\"YES\\n\");\r\n else printf(\"NO\\n\");\r\n \r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "812ac84327ef140a858d8a08c3837af3", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "fd7936e2c371b7bcc463a292cd34f0c3", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9714038128249567, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int x,a,b,c,f;\r\n scanf(\"%d%d%d%d\",&x,&a,&b,&c);\r\n if(x==1){\r\n if(a==2){\r\n if(b==3){\r\n f=1;\r\n }\r\n else f=0;\r\n }\r\n else if(a==3){\r\n if(c==2) f=1;\r\n else f=0;\r\n \r\n }\r\n else f=0;\r\n }\r\n else if(x==2){\r\n if(b==1){\r\n if(a==3){\r\n f=1;\r\n }\r\n else f=0;\r\n }\r\n else if(b==3){\r\n if(c==2) f=1;\r\n else f=0;\r\n \r\n }\r\n else f=0\r\n }\r\n else if(x==3){\r\n if(c==1){\r\n if(a==2){\r\n f=1;\r\n }\r\n else f=0;\r\n }\r\n else if(c==2){\r\n if(b==1) f=1;\r\n else f=0;\r\n \r\n }\r\n else f=0;\r\n }\r\n \r\n if(f==1)\r\n printf(\"YES\\n\");\r\n else printf(\"NO\\n\");\r\n \r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "f5413e0058ae8885df273469427af140", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "fd7936e2c371b7bcc463a292cd34f0c3", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4826762246117085, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n int a,b,c,x;\r\n scanf(\"%d\",&x);\r\n scanf(\"%d %d %d\", &a, &b, &c);\r\n if(b==1)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else printf(\"NO\\n\");\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "3dedb4031df36b84399b983032733357", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "bb5a8693b128a54d0c2c1b87c3446700", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1557285873192436, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\n\nint main()\n{\n\tint n, m;\n\tint a, b, c;\n\tscanf(\"%d\", &m);\n\tfor (int i = 0; i < m; i++)\n\t{\n\t\tscanf(\"%d\", &n);\n\t\tscanf(\"%d %d %d\", &a, &b, &c);\n\t\tif (a == 1 || b == 2 || b == 3)\n\t\t\tprintf(\"NO\\n\");\n\t\telse if (n == 1 && a == 0)\n\t\t\tprintf(\"NO\\n\");\n\t\telse if (n == 2 && b == 0)\n\t\t\tprintf(\"NO\\n\");\n\t\telse if (n == 3 && c == 0)\n\t\t\tprintf(\"NO\\n\");\n\t\telse\n\t\t\tprintf(\"YES\\n\");\n\t}\n\treturn 0;\n}\n\t \t\t \t \t\t\t \t \t \t\t \t\t \t\t", "lang": "GNU C11", "bug_code_uid": "804a079463e41bba953995fad9456fc5", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "e7a25cd5424384a1f8904051c601dd33", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.07661290322580645, "equal_cnt": 28, "replace_cnt": 25, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 28, "bug_source_code": "#include \nusing namespace std;\n/*\n\t MADE BY carder\n __________________\n | ________________ |\n || ____ ||\n || /\\ | ||\n || /__\\ | ||\n || / \\ |____ ||\n ||________________||\n |__________________|\n \\###################\\\n \\###################\\\n \\ ____ \\\n \\_______\\___\\_______\\\n\n An AC a day keeps the doctor away.\n*/\nint t,x,carder[5];\nbool f[5];\n/*\n @carder\u5468\u8fb9 \n\u250f\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u250f\u2501\u2513\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u2503\u6253\u2503\u2588\u2503\n\u2523\u252b\u2588\u2588\u2588\u2588\u2503\u66b4\u2503\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u2503\u529b\u2503\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u2503\u6559\u2503\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u2503\u7a0b\u2503\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588|c++\u2503\u2588\u2503\n\u2523\u252b\u2588\u2588\u2588\u2588\u2517\u2501\u251b\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2503\n\u2503\u2503\u2588\u2588\u2588\u5b9a\u4ef7\uff1500\u5143\u2503\n\u2517\u253b\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u251b\n \u9650\u65f68\u6298\uff01\uff01\uff01 \n*/\n\n\n/*\n \u4ec5\u4f9b\u53c2\u8003\uff0c\u6284\u88ad\uff08\u501f\u9274\uff09\u53ef\u803b\uff01\n \u3010For reference only, shame on you for copying!\u3011\n ___________________\n\t\t | |\n\t\t | NO COPYING |\n\t\t | |\n\t\t -------------------\n*/\nint main()\n{\n\tcin>>t; \n\twhile(t--)\n\t{\n\t \tcin>>x;\n\t\tcin>>carder[1];\n\t\tcin>>carder[2];\n\t\tcin>>carder[3];\n\t \tif(carder[x])\n\t\t{\n\t\t\tf[x]=1;\n\t\t}\n\t \telse\n\t\t{\n\t \t\tputs(\"NO\");\n\t \t\tcontinue;\n\t \t}\n\t \tif(carder[carder[x]])\n\t\t{\n\t\t \tf[carder[x]]=1;\n\t\t}\n\t \telse\n\t\t{\n\t \t\tputs(\"NO\");\n\t \t\tcontinue;\n\t \t}\n\t \tif(carder[carder[carder[x]]]==0)\n\t {\n\t \tf[carder[carder[x]]]=1;\n\t }\n\t \tif(f[1]==1&&f[2]==1&&f[3]==1)\n\t\t{\n\t\t \tputs(\"YES\");\n\t\t}\n\t \telse\n\t\t{\n\t\t \tputs(\"NO\");\n\t\t}\n }\n}\n\n \t\t \t \t\t\t\t\t \t \t \t \t \t\t\t", "lang": "GNU C11", "bug_code_uid": "81b97518177b9e8e9bb014a9b3481ead", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "f4d098cd2a826e27c3d23f6701c2c47d", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.14054813773717498, "equal_cnt": 23, "replace_cnt": 17, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "#include\n\nint main()\n{\n\tint t, x, a, b, c;\n\t\n\tscanf(\"%d\", &t);\n\tfor(int i=1; i<=t; i++)\n\t{\n\t\tscanf(\"%d\", &x);\n\t\t\n\t\tscanf(\"%d %d %d\", &a, &b, &c);\n\t\t//a=1 b=2 c=3\n\t\t\n\t\tif(x==1) //1=a\n\t\t{\n\t\t\tif(a==2 || a==3)\n\t\t\t{\n\t\t\t\tif(b==3)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t}\n\t\t\t\telse if(c==2)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(x==2) //2=b\n\t\t{\n\t\t\tif(b==1 || b==3)\n\t\t\t{\n\t\t\t\tif(a==3)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t}\n\t\t\t\telse if(c==1)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(x==3) //3=c\n\t\t{\n\t\t\tif(c==1 || c==2)\n\t\t\t{\n\t\t\t\tif(a==2)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t}\n\t\t\t\telse if(b==1)\n\t\t\t\t{\n\t\t\t\t\tprintf(\"YES\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tprintf(\"NO\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\nreturn 0;\n}\n \t\t \t \t \t\t \t \t\t \t \t\t\t\t \t", "lang": "GNU C11", "bug_code_uid": "809557b68a1d8bb9de0606f9d3bd0b48", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "f4d098cd2a826e27c3d23f6701c2c47d", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9238578680203046, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n int t,x,a,b,c;\n scanf(\"%d\",&t);\n for(int i=0;i\nint main()\n{\n int t,x,a,b,c;\n scanf(\"%d\",&t);\n for(int i=0;i\r\n#include \r\n\r\nint main()\r\n{\r\n int t,n,i,j,T[3],k=3;\r\n scanf(\"%d\",&t);\r\n for(i = 0 ; i < t ; i++){\r\n scanf(\"%d\",&n);\r\n for(j = 0 ; j < 3 ; j++){\r\n scanf(\"%d\",&T[j]);\r\n }\r\n n=n-1;\r\n k=3;\r\n while(k!=0){\r\n if(T[n]==0){\r\n printf(\"NO\\n\");\r\n break;\r\n }else{\r\n n=T[n];\r\n k--;\r\n }\r\n }\r\n if(k==0){\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "072d38cb7e348da1f985f0511dbf0e7c", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "f9f869c89cc72313362193d483df42e9", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9962825278810409, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n#include \r\n\r\nint main()\r\n{\r\n int t,n,i,j,T[3],k;\r\n scanf(\"%d\",&t);\r\n for(i = 0 ; i < t ; i++){\r\n scanf(\"%d\",&n);\r\n for(j = 0 ; j < 3 ; j++){\r\n scanf(\"%d\",&T[j]);\r\n }\r\n n=n-1;\r\n k=3;\r\n while(k!=0){\r\n if(T[n]==0){\r\n printf(\"NO\\n\");\r\n break;\r\n }else{\r\n n=T[n]-1;\r\n k--;\r\n }\r\n }\r\n if(k==0){\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "7ed30083c0e659133cbc3a6c20244f07", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "f9f869c89cc72313362193d483df42e9", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3562043795620438, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \r\nint main()\r\n{\r\n\tint i,j,c,t,x,a[3],v[3]={1,2,3};\r\n\tscanf(\"%d\",&t);\r\n\tfor(i=1;i<=t;i++)\r\n\t{\r\n\t\tscanf(\"%d%d%d%d\",&x,&a[0],&a[1],&a[2]);\r\n\t\tc=0;\r\n\t\tfor(j=0;j<=2;j++){\r\n\t\t\tif(x==v[j] && a[j]!=0)\r\n\t\t{\r\n\t\t\tx=a[j];\r\n\t\t\tc++;\r\n\t\t}if(x==v[j] && a[j]==0)\r\n c=0;\r\n\t\t}if(c==0) printf(\"NO\\n\");\r\n\t\telse printf(\"YES\\n\");\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "603a24e6ae2733467029ef1be44fd949", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "5ba37095df1648a28f6dca08f283b4bc", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9770737807419758, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n#include \n#include \n\ntypedef struct {\n int val;\n int cost;\n} data;\n\nint cmp(const void *a, const void *b) {\n return (*(data *) a).val - (*(data *) b).val;\n}\n\nint main(int argc, const char* argv[]) {\n int t;\n scanf(\"%d\", &t);\n while (t--) {\n int x;\n int a, b, c;\n scanf(\"%d%d%d%d\", &x, &a, &b, &c);\n\n int taken[3] = {0, 0, 0};\n int ok = 1;\n for (int i = 0; i < 3; i++) {\n switch (x) {\n case 1:\n x = a;\n taken[0] = 1;\n break;\n case 2:\n x = b;\n taken[1] = 1;\n break;\n case 3:\n x = c;\n taken[2] = 1;\n break;\n case 0:\n break;\n }\n }\n\n for (int i = 0; i < 2; i++) {\n if (taken[i] == 0) {\n ok = 0;\n break;\n }\n\n }\n if (ok == 1) {\n printf(\"YES\\n\");\n } else {\n printf(\"NO\\n\");\n }\n\n\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "2f03233fa720e89e7246ebdec335146d", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "06e96b3466a9a60f1917a6cf9347b6b2", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.02501488981536629, "equal_cnt": 16, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C11", "bug_code_uid": "d58362fe40278c29abf904b2cc09f5e2", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "12cd62c7c97dc9b49386bc184bf103ac", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1374431531076301, "equal_cnt": 22, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "#include\r\n#include\r\n#include\r\n#include\r\n#include\r\n#define f_sc(a) scanf(\"%f\",&a)\r\n#define i_sc(a) scanf(\"%d\",&a)\r\n#define ll_sc(a) scanf(\"%lld\",&a)\r\n#define c_sc(a) scanf(\" %c\",&a)\r\n#define s_sc(a) scanf(\"%s\",a)\r\n#define f_pr(a) printf(\"%.15f\",a)\r\n#define i_pr(a) printf(\"%d \",a)\r\n#define ll_pr(a) printf(\"%lld \",a)\r\n#define s_pr(a) printf(\"%s \",a)\r\n#define c_pr(a) printf(\"%c\",a)\r\n#define MaxCompare(a, b) (((a) > (b)) ? (a) : (b))\r\n#define MinCompare(a, b) (((a) > (b)) ? (b) : (a))\r\n#define abs(a) (((a) > 0) ? (a) : (-(a)))\r\n#define MAX 281202\r\n#define K 500\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\\n\",&t);\r\n while(t--)\r\n {\r\n //n is the key on your hand\r\n int n;\r\n scanf(\"%d\",&n);\r\n int a[n];\r\n int s=0;\r\n int count=1;\r\n for(int i=0; i<3; i++)\r\n {\r\n i_sc(a[i]);\r\n }\r\n for(int i=0; i<2; i++)\r\n {\r\n for(int j=1; j<3; j++)\r\n {\r\n if(a[i]>a[j])\r\n {\r\n int c=a[i];\r\n a[i]=a[j];\r\n a[j]=c;\r\n }\r\n }\r\n }\r\n for(int i=0; i<3; i++)\r\n {\r\n //i_pr(a[i]);\r\n if(n>=a[i]) n=n+a[i];\r\n else count=0;\r\n }\r\n if(count==0) printf(\"NO\");\r\n else printf(\"YES\");\r\n printf(\"\\n\");\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "490bf172fe7b65adcfa16ade7cf0db02", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "61fb8d6d35219160f8734efc143a325c", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.997946611909651, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n\r\nint main() {\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t>0){\r\n int n;\r\n scanf(\"%d\",&n);\r\n int a,b,c;\r\n scanf(\"%d %d %d\",&a,&b,&c);\r\n int arr[3]={a,b,c};\r\n int e=arr[n-1];\r\n \r\n if(e==0)\r\n printf(\"NO\\n\");\r\n else{\r\n if(arr[e-1]==0){\r\n printf(\"NO\");\r\n }\r\n else{\r\n printf(\"YES\\n\");}\r\n }\r\n t--;\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "cfd7a2250a56f3d0f69de06c4431c529", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "1996260c6bec5042779545aac43b8ac1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9956989247311828, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\r\n#include\r\n\r\n\r\nint open(int x, int * doors) {\r\n if (doors[x-1] == 0) return 0;\r\n if (doors[doors[x-1]-1] == 0) return 0;\r\n return 1;\r\n}\r\n\r\nint main() {\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i=0;i\r\n#include\r\n\r\nint main()\r\n{\r\n int t,a,b,c,flag,x;\r\n scanf(\"%d\",&t);\r\n if(t<=18)\r\n {\r\n for(int i=0;i\r\n\r\n int main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n\r\n for (int i = 0; i < t; i++)\r\n {\r\n int x,a,b,c;\r\n scanf(\"%d\",&x);\r\n scanf(\"%d %d %d\",&a,&b,&c);\r\n int count = 6;\r\n \r\n for (int j = 0; j < 3; j++)\r\n {\r\n if (x==3)\r\n {\r\n count-=x;\r\n x = c;\r\n }\r\n\r\n else if (x==2)\r\n {\r\n count-=x;\r\n x=b;\r\n }\r\n\r\n else if (x==1)\r\n {\r\n count-=x;\r\n x=a;\r\n }\r\n\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n break;\r\n }\r\n \r\n }\r\n\r\n if(count==0){\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n \r\n \r\n \r\n \r\n }\r\n \r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "7a3bda942a78e1258249244e6835a444", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "b420ed428b42b4c95939a57aca3b51db", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.997229916897507, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int i,n,a[4],flag=0;\r\n scanf(\"%d\",&n);\r\n for(i=1;i<=3;i++){\r\n scanf(\"%d\",&a[i]);\r\n }\r\n for(i=1;i<=3;i++){\r\n if(a[n]!=0 && a[a[n]]!=0)\r\n flag++;\r\n\r\n }\r\n if(flag==0)\r\n printf(\"N0\\n\");\r\n else\r\n printf(\"YES\\n\");\r\n}\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "9075ece050a6133b35124e3dcab0058d", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "887f4b6228872407377c1dcd268d50fa", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8396143733567046, "equal_cnt": 30, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 27, "fix_ops_cnt": 29, "bug_source_code": "#include\r\nint main(){\r\nint t,i,j,key,flag=0;\r\nint key_behind_door[4];\r\nscanf(\"%d\",&t);\r\nfor(i=0; i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; i++)\r\n {\r\n int x, arr[3], y = 0;\r\n scanf(\"%d\", &x);\r\n for (int j = 0; j < 3; j++)\r\n {\r\n scanf(\"%d\", &arr[j]);\r\n }\r\n for (int j = 0; j < 2; j++)\r\n {\r\n if (arr[x - 1] == 0)\r\n {\r\n printf(\"NO\");\r\n y = 1;\r\n break;\r\n }\r\n else\r\n {\r\n x = arr[x - 1];\r\n }\r\n }\r\n if (y == 0)\r\n printf(\"YES\");\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "eaa9e79cef8554f7aac2288d9467774f", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "2f87cf4ae580b4fb281c0fcdde758e0d", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9968847352024922, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \r\nint main()\r\n{\r\n\r\n int b;\r\n scanf(\"%d\", &b);\r\n while (b--)\r\n {\r\n int a;\r\n int b, c, d;\r\n scanf(\"%d\", &a);\r\n int dorrkey[4];\r\n for (int i = 0; i < 3; i++)\r\n {\r\n\r\n scanf(\"%d\", &dorrkey[i]);\r\n }\r\n int ans = 0;\r\n for (int i = 0; i < 3; i++)\r\n {\r\n if (dorrkey[a - 1] != 0)\r\n {\r\n ans++;\r\n\r\n a = dorrkey[a - 1];\r\n }\r\n }\r\n if (ans == 2)\r\n {\r\n printf(\"YES\");\r\n }\r\n else\r\n {\r\n printf(\"NO\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "19115ae22d35b7a30d668e53048f2eec", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "72a9767d717ffd0e181008db6f31ee81", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9420160570918823, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \r\n#include \r\n#include \r\n#include \r\n\r\nint check(int n)\r\n{\r\n int k,count=0,i,even=0,odd=0,n1,n2,n3;\r\nk=n;\r\nint arr[3];\r\nfor(int i=0;i<3;i++){\r\n scanf(\"%d\",&arr[i]);}\r\n\r\nn1=arr[k-1];\r\nn2=arr[n1-1];\r\nn3=arr[n2-1];\r\n\r\n if(n1!=n2&&n2!=n3&&n3!=n1)\r\n return 1;\r\n\r\n\r\n else\r\n\r\n return 0;\r\n\r\n\r\n\r\n}\r\n\r\nint main() {\r\nint t,n,c=0;\r\nscanf(\"%d\",&t);\r\nfor(int i=0;i\r\n#include\r\n#include\r\n#include\r\n#include\r\nint cmp(const void* a,const void* b)\r\n{\r\n return (*(int*)a-*(int*)b);\r\n}\r\nvoid input(int ar[],int n)\r\n{\r\n for(int i=0;i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int n,m,i,c=0,c1=0,c2=0;\r\n scanf(\"%d\",&n);\r\n int a[1000];\r\n for(i=0; i<3; i++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n for(i=0; i<3; i++)\r\n {\r\n if(a[n-1] == 0 )\r\n { c++;\r\n }\r\n else\r\n m=a[n-1];\r\n if(a[m-1]== 0)\r\n c++;\r\n else\r\n c=0;\r\n \r\n }\r\n \r\n if(c>0)\r\n printf(\"NO\\n\");\r\n else\r\n printf(\"YES\\n\");\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n \r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "01b05b8f225e41774621740d7cf4f9fe", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "6aa3b6469276d15697af52a3598260b0", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9814471243042672, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int t,x,i,a[4];\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int cnt=0;\r\n scanf(\"%d\",&x);\r\n for(i=1; i<=3; i++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n for(i=1; i<=3; i++)\r\n {\r\n if(a[x]!=0)\r\n {\r\n x=a[x];\r\n }\r\n else if(a[x]==0 && i!=3)\r\n {\r\n cnt=1;\r\n break;\r\n }\r\n }\r\n cnt==0?printf(\"YES\\n\"):printf(\"NO\\n\");\r\n \r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "7ab95ae31dffad643b9139396172ca10", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "c32e5021117b95d0a2469ae421b55b70", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.639135959339263, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int n,x,a,b,c;\r\n scanf(\"%d\",&n);\r\n\r\n while(n--)\r\n {\r\n scanf(\"%d\",&x);\r\n scanf(\"%d%d%d\",&a,&b,&c);\r\n if(x==1)\r\n {\r\n if(a==1 || a==2)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n\r\n }\r\n\r\n else if(x==2)\r\n {\r\n if(b==1 || b==2)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n\r\n }\r\n\r\n else\r\n {\r\n if(c==1 || c==2)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n return 0;\r\n\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "ad8ec798b319cb306f83cb47fab56c42", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "a240c0c79c4278c4a257293e4d23af80", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9984423676012462, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nvoid main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int x,a[3],i,temp,count=0;\r\n scanf(\"%d\",&x);\r\n for(i=0;i<3;i++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n temp=a[x-1];\r\n for(i=0;i<3;i++)\r\n {\r\n if(temp==0)\r\n {\r\n break;\r\n }\r\n else \r\n {\r\n temp=a[temp-1];\r\n count++;\r\n }\r\n\r\n }\r\n if(count==2)\r\n {\r\n printf(\"YES\");\r\n\r\n }\r\n else{\r\n printf(\"NO\\n\");\r\n }\r\n \r\n\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "33e77ff09f92495033ff37108c7fd873", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "51799ba84ed3de923a991c8f03f92215", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9697674418604652, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nint main(){\r\n\tint t;\r\n\tint x;\r\n\tint a[3];\r\n\tint t1,t2,t3;\r\n\tscanf(\"%d\",&t);\r\n\tfor(int i=0;i\r\n\r\n\r\n\r\nint man(){\r\n\tint x ;\r\n\tint ctr = 0 ; \r\n\tint n; \r\n\tscanf(\"%d\" , &n); \r\n\tint arr[4]; \r\n\tarr[0] = -1; \r\n\tfor(int i = 1 ; i< 4 ; i++){\r\n\t\tscanf(\"%d\" , &x); \r\n\t\tarr[i] = x ; \r\n\t}\r\n\r\n\tint num = n ; \r\n\twhile(1){\r\n\t\tif(arr[num] !=0){\r\n\t\t\tctr++ ; \r\n\t\t}\r\n\t\telse{\r\n\t\t\tbreak ; \r\n\t\t}\r\n\t\tnum = arr[num] ; \r\n\t}\r\n\t// printf(\"%d\\n\" , ctr); \r\n\tif(ctr ==2){\r\n\t\tprintf(\"YES\\n\"); \r\n\t}\r\n\telse{\r\n\t\tprintf(\"NO\\n\"); \r\n\t}\r\n\t\r\n}\r\n\r\nint main(){\r\n\tint t ; \r\n\tscanf(\"%d\" , &t); \r\n\tfor(int i = 0 ; i\nint main(void) {\n int test;\n scanf(\"%d\", &test);\n for (int t = 0; t < 4; t++) {\n int key, door1,door2,door3;\n scanf(\"%d\", &key);\n scanf(\"%d %d %d\", &door1, &door2, &door3);\n int unlock = 0;\n int yes = 1;\n while (unlock != 3) {\n if (key == 3) {\n unlock += 1;\n key = door3;\n if (key == 0 && unlock != 3) {\n yes = 0; \n break;\n }\n }\n if (key == 2) {\n unlock += 1;\n key = door2;\n if (key == 0 && unlock != 3) {\n yes = 0; \n break;\n }\n }\n if (key == 1) {\n unlock += 1;\n key = door1;\n if (key == 0 && unlock != 3) {\n yes = 0; \n break;\n }\n }\n }\n if (yes) {\n printf(\"YES\\n\");\n }\n else {\n printf(\"NO\\n\");\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "da92fe0ed21bd7cf2fb3b818a80e003a", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "e66df35ae8fd86d6c6f6085bbc8081d1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9986928104575163, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int t, x, a, b, c, i;\r\n scanf(\"%d\", &t);\r\n for(i=1; i<=t; i++)\r\n {\r\n scanf(\"%d\", &x);\r\n scanf(\"%d %d %d\", &a, &b, &c);\r\n if(x==1)\r\n {\r\n if((a==2 && b==3 && c==0)|| a==3 && b==0 && c==1)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n else if(x==2)\r\n {\r\n if((a==3 && b==1 && c==0)|| a==0 && b==3 && c==1)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n else if(x==3)\r\n {\r\n if((a==0 && b==1 && c==2)|| a==2 && b==0 && c==1)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "8d96358985e1d3d27905f88adb263ae2", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "d3bc50df3f8d98ca273bf46b8d504900", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9004237288135594, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "#include \r\nint main(){\r\n int t,x,a,b,c;\r\n scanf(\"%d\",&t);\r\n for (int i=0;i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\n#include \r\nint main()\r\n{\r\nint i , j , J , a , b , c , m, p;\r\nint T[3];\r\nscanf(\"%d\",&m);\r\nfor(i=1;i<=m;i++){\r\n scanf(\"%d\",&p);\r\n for(J=0;J<3;J++)\r\n scanf(\"%d\",&T[i]);\r\n if(T[p-1]==0)\r\n printf(\"NO\\n\");\r\n else{\r\n a = T[p-1];\r\n if(T[a-1]==0)\r\n printf(\"NO\\n\");\r\n else\r\n printf(\"YES\\n\");\r\n }\r\n}\r\nreturn 0;\r\n\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "981542b3eaed46a27221caf82103b3b0", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "10dcb356330246828ba54e9bbce1bfd1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9955849889624724, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; i++)\r\n {\r\n int x;\r\n int arr[3];\r\n\r\n scanf(\"%d\", &x);\r\n for (int i = 0; i < 3; i++)\r\n {\r\n scanf(\"%d\", &arr[i]);\r\n }\r\n if (arr[x - 1] == 0 || arr[arr[x - 1] - 1] == 0)\r\n {\r\n printf(\"NO\");\r\n }\r\n else\r\n {\r\n printf(\"YES\");\r\n }\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "da7776d0246bbfc041ea66a1457c11ae", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "72a803f98d087ac96a908ea646c655c3", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9932126696832579, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\r\n\r\nvoid can_door_be_opened(int x, int door[3]){\r\n int t=door[x-1];\r\n if(t==0){printf(\"NO\");}\r\n else if(door[t-1]==0){printf(\"NO\");}\r\n else printf(\"YES\");\r\n}\r\n\r\nint main(){\r\n int T;\r\n scanf(\"%d\",&T);\r\n for(int t=0;t\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n int n,a[3];\r\n for(int i=0;i\r\n\r\nint main()\r\n{\r\n \r\n int n, a[3];\r\n int t;\r\n scanf(\"%d\", &t);\r\n for(int i=0; i\r\n\r\nvoid sol(){\r\n \r\n int x, a, b, c;\r\n scanf(\"%d\", &x);\r\n scanf(\"%d %d %d\", &a, &b, &c);\r\n\r\n if(a==1 || b==2 || c==3)\r\n printf(\"NO\\n\");\r\n else if( (x==1&&a==0) || (x==2&&b==0) || (x==3&&c==0) )\r\n printf(\"NO\\n\");\r\n else\r\n printf(\"YES\\n\");\r\n return; \r\n}\r\n\r\n\r\nint main(){\r\n \r\n int test;\r\n cin>>test;\r\n while(test--){\r\n sol();\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "22aa3261bcb2fbf09f8171f3400902fb", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "6bc8994cdea03c4f18113512354b1104", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24671532846715327, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main (){\r\n int t,x,a,b,c,flag;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\n#include \n\nint main(){\n int t;\n scanf(\"%d\",&t);\n while(t--){\n int key;\n int* arr = (int*)malloc(3*sizeof(int));\n scanf(\"%d\", &key);\n scanf(\"%d%d%d\", &arr[0], &arr[1], &arr[2]);\n for(int i=0; i < 3; i++){\n if(arr[key] == 0){\n break;\n } else {\n key = arr[key];\n arr[key] = 0;\n }\n }\n if(arr[0] == 0 && arr[1] == 0 && arr[2] == 0){\n printf(\"YES\\n\");\n } else { printf(\"NO\\n\"); }\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "b167300194bdc5f343d9dadc9d937479", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "c9f64f788a7b7f4f7a4fff5e1b006f65", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6215469613259669, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "#include\r\nint main()\r\n{\r\n int tc,i;\r\n scanf(\"%d\",&tc);\r\n while(tc--)\r\n {\r\n int x,a[3];\r\n scanf(\"%d\",&x);\r\n scanf(\"%d %d %d\",&a[0],&a[1],a[2]);\r\n if(a[x]!=0 && a[a[x]]!=0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "21db3d7c3059b7b37a359c5c551df230", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "d6b294d3e959049120ca90edd98570d6", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9622166246851386, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n#include \r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int key,arr[3];\r\n scanf(\"%d\",&key);\r\n for(int i=0;i<3;i++){\r\n scanf(\"%d\",&arr[i]);}\r\n if(arr[key-1]!=0){\r\n if(arr[arr[key-1]-1]!=0){\r\n printf(\"YES\");\r\n continue;\r\n }\r\n }printf(\"NO\");\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "10de333dd87c1b293abecdba9cb52d40", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "d4eda7d0c137061169648258fd9cb4a2", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9871309613928841, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t,n,c;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n scanf(\"%d\",&n);\r\n int a[4],i;\r\n for(i=1;i<=3;i++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n int c=0;\r\n while(1)\r\n {\r\n\r\n if(a[n]!=0)\r\n {\r\n c++;\r\n n=a[n];\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n printf(\"%d\\n\",c);\r\n if(c==2)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n\r\n\r\n }\r\n return 0;\r\n\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "2213376c6dcc44128854811e6881f53d", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "2068880ea752a60e2c73af8d336a1e8e", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8270561106840891, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int t, x, a, b, c, flag = 0;\r\n scanf(\"%d\", &t);\r\n\r\n for(int i = 0; i < t; i++){\r\n scanf(\"%d %d %d %d\", &x, &a, &b, &c);\r\n for(int j = 0; j < 1; j++){\r\n if(x == 1){\r\n x = a;\r\n }\r\n if(x == 2){\r\n x = b;\r\n }\r\n if(x == 3){\r\n x = c;\r\n }\r\n if(x == 0){\r\n printf(\"NO\\n\");\r\n break;\r\n }\r\n else{\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "a8e75fa478d428ec35821ce6b6b5fb26", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "700feb1f3ffad615540e0065b4ce9fd5", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9783728115345005, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n int m,t;\r\n for(m=0;m\r\n\r\nint main() {\r\n int n;\r\n scanf(\"%d\", &n);\r\n for(int i = 0; i < n; i++) {\r\n int currentKey;\r\n scanf(\"%d\", ¤tKey);\r\n int a1 = currentKey;\r\n int behindKey[3];\r\n for(int i = 0; i < 3; i++) {\r\n scanf(\"%d\", &behindKey[i]);\r\n }\r\n int nextKey = behindKey[currentKey - 1];\r\n if (nextKey == 0) {\r\n printf(\"NO\");\r\n continue;\r\n }\r\n int a2 = nextKey;\r\n nextKey = behindKey[nextKey - 1];\r\n if (nextKey == 0) {\r\n printf(\"NO\");\r\n continue;\r\n }\r\n int a3 = nextKey;\r\n if (a1 != a2 && a1 != a3 && a2 != a3) {\r\n printf(\"YES\");\r\n } else {\r\n printf(\"NO\");\r\n }\r\n\r\n }\r\n\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "b4052e39ff14ce39f46563c38c82a0aa", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "2d64dbc97a7709a68ce7dd75519ca4c1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9992435703479576, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n { int t,i;\n scanf(\"%d\",&t);\n for(i=1;i<=t;i++)\n {\n\n\n\n int x,a,b,c;\n scanf(\"%d\",&x);\n scanf(\"%d%d%d\",&a,&b,&c);\n\n if(x==1)\n {\n if(a==0)\n printf(\"NO\\n\");\n else if(a==2&&b==0)\n printf(\"NO\\n\");\n\n else if(a==3&&c==0)\n printf(\"NO\\n\");\n else\n printf(\"YES\\n\");\n\n\n }\n if(x==2)\n {\n if(b==0)\n printf(\"NO\\n\");\n else if(b==1&&a==0)\n printf(\"NO\\n\");\n\n else if(b==3&&c==0)\n printf(\"NO\\n\");\n else\n printf(\"YES\\n\");\n\n\n }\n if(x==3)\n {\n if(c==0)\n printf(\"NO\");\n else if(c==2&&b==0)\n printf(\"NO\\n\");\n\n else if(c==1&&a==0)\n printf(\"NO\\n\");\n else\n printf(\"YES\\n\");\n\n\n }\n\n\n }\n\n\n\n\n\n return 0;\n }", "lang": "GNU C11", "bug_code_uid": "dd1b91d1f5d7f2ab541b5a7048d4c535", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "5438f8a09e60a33d6432b39cbb46b3f1", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9826212889210717, "equal_cnt": 15, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 13, "fix_ops_cnt": 14, "bug_source_code": "#include\r\nint main()\r\n { int t,i;\r\n scanf(\"%d\",&t);\r\n for(i=1;i<=t;i++)\r\n {\r\n\r\n\r\n\r\n int x,a,b,c;\r\n scanf(\"%d\",&x);\r\n scanf(\"%d%d%d\",&a,&b,&c);\r\n\r\n if(x==1)\r\n {\r\n if(a==0)\r\n printf(\"NO\");\r\n else if(a==2&&b==0)\r\n printf(\"NO\");\r\n\r\n else if(a==3&&c==0)\r\n printf(\"NO\");\r\n else\r\n printf(\"YES\");\r\n\r\n\r\n }\r\n if(x==2)\r\n {\r\n if(b==0)\r\n printf(\"NO\");\r\n else if(b==1&&a==0)\r\n printf(\"NO\");\r\n\r\n else if(b==3&&c==0)\r\n printf(\"NO\");\r\n else\r\n printf(\"YES\");\r\n\r\n\r\n }\r\n if(x==3)\r\n {\r\n if(c==0)\r\n printf(\"NO\");\r\n else if(c==2&&b==0)\r\n printf(\"NO\");\r\n\r\n else if(c==1&&a==0)\r\n printf(\"NO\");\r\n else\r\n printf(\"YES\");\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n return 0;\r\n }\r\n", "lang": "GNU C11", "bug_code_uid": "1a22b68f09bfc4838361b41dd9b4f3e2", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "5e8b1ebc33888fbd1093bff15b0a5fc3", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8443935926773455, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int t, x, a, b, c;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n scanf(\"%d%d%d%d\", &x, &a, &b, &c);\r\n int arr[3];\r\n arr[0]=a;\r\n arr[1]=b;\r\n arr[2]=c;\r\n if (arr[x-1]!=0 && arr[arr[x-1]]!=0)\r\n printf(\"YES\\n\");\r\n// else if (x==2 && b!=0)\r\n// printf(\"YES\\n\");\r\n// else if (x==3 && c!=0)\r\n// printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "22dc276995d9461513ddc0cee783322c", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "3f63fab9a6977cfcead2f1d59c95c8b6", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9972451790633609, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \r\nint main()\r\n{\r\n int n;\r\n scanf(\"%d\", &n);\r\n for (int i = 0; i < n; i++)\r\n {\r\n int key, doors[3], i;\r\n scanf(\"%d\", &key);\r\n scanf(\"%d %d %d\", &doors[0], &doors[1], &doors[2]);\r\n for (i = 0; i < 3; i++)\r\n {\r\n int index = key;\r\n if (doors[index - 1] == 0)\r\n {\r\n if (i == 2)\r\n printf(\"YES\");\r\n else\r\n printf(\"NO\");\r\n break;\r\n }\r\n else if (doors[index - 1] == 1)\r\n key = 1;\r\n else if (doors[index - 1] == 2)\r\n key = 2;\r\n else\r\n key = 3;\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "f390937cee85d952bd5144001484e563", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "08bcc6278599d66ae2e37de53f46c73a", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9947460595446584, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t,x;\r\n int a[3];\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\nint num[19];\r\nint main(){\r\n\tint a,b,count,current;\r\n\tscanf(\"%d\",&a);\r\n\twhile(scanf(\"%d\",&b)!=EOF){\r\n\t\tcount=0;\r\n\t\tfor(int i=1;i\r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n \r\n while(t--)\r\n {\r\n int k1, k2, k3;\r\n scanf(\"%d\", &k1);\r\n \r\n int room[3];\r\n \r\n for(int i=0; i<3; i++)\r\n {\r\n scanf(\"%d\", &room[i]);\r\n }\r\n \r\n int count = 0;\r\n \r\n if(room[k1-1] != 0)\r\n {\r\n count = count + 1;\r\n k2 = room[k1 - 1];\r\n }\r\n \r\n if(room[k2-1] != 0)\r\n {\r\n count = count + 1;\r\n k3 = room[k2 - 1];\r\n }\r\n \r\n if(count = 2)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n \r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "d38d78f9a61f1cc94d51e3d174ea7cc3", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "3041856a49ded7e80d0a5c3cd738795d", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9992957746478873, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/******************************************************************************\r\n\r\n Online C Compiler.\r\n Code, Compile, Run and Debug C program online.\r\nWrite your code in this editor and press \"Run\" button to compile and execute it.\r\n\r\n*******************************************************************************/\r\n\r\n#include \r\n\r\nint main()\r\n{\r\n int t,x,a,b,c;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n \r\n while(t--)\r\n {\r\n int x,i,c,f;\r\n scanf(\"%d\",&x);\r\n \r\n int a[3];\r\n for(i=0;i<3;i++)\r\n {\r\n scanf(\"%d\",&a[i]);\r\n }\r\n \r\n f=0;\r\n if(a[x-1]>0)\r\n {\r\n c=a[x-1];\r\n if(a[c]>0)\r\n {\r\n f=1;\r\n }\r\n }\r\n \r\n if(f==0)\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n else\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "baf14f333d8d7c1e7e471d2d8fb6e8ba", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "8b01160bd31605d058eb4a65a9ede437", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6424242424242425, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "// Online C compiler to run C program online\r\n#include \r\n\r\nint main() {\r\n // Write C code here\r\n //printf(\"Hello world\");\r\n int t;\r\n scanf(\"%d\",&t);\r\n int a[t],b[t][3];\r\n int o[t],x,y,z;\r\n for(int i=0;i\r\n\r\n\r\nint square(int n)\r\n{\r\n int i=1;\r\n int sum=0;\r\n while(i*i\n#include \n#include \n#include \n#define UF64 SCNu64\n#define UF32 SCNu32\n#define UF16 SCNu16\n#define UF8 SCNu8\nuint64_t number(uint64_t);\nint main(){\n uint8_t no_cases;\n scanf(\"%\"UF8,&no_cases);\n uint64_t cases[no_cases];\n for(uint8_t i=0; i input) {sl=i-1; break;}\n }\n for(uint64_t i=2; i input) {cl=i-1; break;}\n }\n for(uint64_t i=1; i<=cl; i++){\n for(uint64_t j=1; j<=sl; j++){\n if(i*i*i == j*j) red++;\n }\n }\n return sl+cl-red;\n}\n", "lang": "GNU C11", "bug_code_uid": "dd051d53a9eb55a186bd7ecbc8437572", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "612e3373cabcc0bc75a0da83abc93290", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3927038626609442, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main(){\n\tint t;\n\tscanf(\"%d\",&t);\n\twhile(t--){\n\t\tlong long n;\n\t\tscanf(\"%lld\",&n);\n\t\tint x=0;\n\t\tint i;\n\t\tfor(i=2;i*i<=n;i++){\n\t\t\tif(i*i<=n){\n\t\t\t\tx++;\n\t\t\t}\n\t\t}\n\t\tint y=0;\n\t\tfor(i=2;i*i*i<=n;i++){\n\t\t\tif(i*i*i<=n){\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\",x+y+1);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e98d773fe3185d9f05b0309c2ae11168", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "8742895f7f6ec80f63db1f31ad4686f1", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7088830255057168, "equal_cnt": 25, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 20, "fix_ops_cnt": 25, "bug_source_code": "\r\n#include\r\nint main()\r\n\r\n{\r\n\r\n int t,n,i,j,k;\r\n scanf(\"%d\",&t);\r\n\r\n if(t>=1 && t<=20){\r\n\r\n for(k=1;k<=t;k++){\r\n\r\n scanf(\"%d\",&n);\r\n\r\n\r\n if(n>=1 && n<=pow(10,9)){\r\n\r\n int d=0;\r\n\r\n for(i=1;i*i<=n;i++){\r\n\r\n for(j=1;j*j*j<=n;j++){\r\n if(i*i==j*j*j){\r\n d++;\r\n }\r\n } \r\n }\r\n \r\n printf(\"%d %d %d\\n\",i,j,d);\r\n\r\n printf(\"%d\\n\",i+j-2-d);\r\n\r\n\r\n }}}\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "929677c1629e084bef65e60395b0e4f4", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "9b5ecf4a274941c59ff02cc0c3baed54", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3808139534883721, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \r\n\r\nint main() {\r\n int t, n, i = 1;\r\n\r\n scanf(\"%d\", &t);\r\n while(t--) {\r\n scanf(\"%d\", &n);\r\n while(i * i <= n && n != 1) {\r\n if(i * i <= n) i++;\r\n if(i * i * i <= n) i++;\r\n }\r\n printf(\"%d\", i);\r\n }\r\n\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "09356c537042762fbd088f9e9c927a85", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "a44c28b2621a564cfbfeca04f7781055", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9976303317535545, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main(){\r\n int i, n;\r\n scanf(\"%d\", &n);\r\n for(i=0;i\r\nint main()\r\n{\r\n\tint t;\r\n\tscanf(\"%d\",&t);\r\n\twhile(t--)\r\n\t{\r\n\t\tlong long int cnt=1,cnt2=0,i=2,j=2,n,a,b;\r\n\t\tscanf(\"%lld\",&n);\r\n\t\ta=i*i;\r\n\t\tb=i*a;\r\n\t\tfor(i=2;(a<=n)||(b<=n);i++)\r\n\t\t{\r\n\t\t\ta=i*i;\r\n\t\t\tb=i*a;\r\n\t\t\tif(a<=n) cnt++;\r\n\t\t\tif(b<=n) cnt++;\r\n\t\t}\r\n\t\ta=j*j;\r\n\t\tb=a*j;\r\n\t\tfor(i=2;a<=n;i++)\r\n\t\t{\r\n\t\t\ta=i*i;\r\n\t\t\tfor(j=2;b<=a;j++)\r\n\t\t\t{\r\n\t\t\t\tb=j*j*j;\r\n\t\t\t\tif(a==b)\r\n\t\t\t\t{\r\n\t\t\t\t\tcnt2++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tprintf(\"%lld\\n\",cnt-cnt2);\r\n\t}\r\n\treturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "85353eb1b9ec2bbde357b4dc09760bbe", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "2f9f45176e672e3e71b51c1acd2d7686", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9672322022621423, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include //getchar putchar (f)scanf (f)printf\r\n#include // strlen\r\n#include // qsort bsearch abs calloc\r\n#include // isalpha isdigit isupper islower isspace\r\n#include // INT_MAX INT_MIN UINT_MAX\r\n#include \r\n\r\ntypedef long long int LL;\r\ntypedef unsigned long long int ULL;\r\nconst int M = 100005;\r\nconst int M15 = 100005;\r\nconst int M25 = 200005;\r\nconst int M35 = 300005;\r\nconst int M45 = 400005;\r\nconst int M55 = 500005;\r\n\r\nconst int N = 102;\r\nconst int A = 26;\r\nconst int mod = 998244353;\r\n\r\nLL gcd(LL a, LL b){return b ? gcd(b,a%b) : a;}\r\nLL maxl(LL a, LL b){if(a>b) return a; else return b;}\r\nLL minl(LL a, LL b){if(ab) return a; else return b;}\r\nint min(const int a, const int b){ if(a*(LL *)b) return 1; else if(*(LL *)a<*(LL *)b) return - 1; else return 0;}\r\nint cmrll(const void *a, const void *b){if(*(LL *)a<*(LL *)b) return 1; else if(*(LL *)a>*(LL *)b) return - 1; else return 0;}\r\nint cmc(const void *a, const void *b){ return *(char *)a - *(char *)b;}\r\nLL rd(){\r\n LL a = 0, d = 10ll;\r\n int flag = 1;\r\n char c = getchar();\r\n while( isspace(c) ) //c == ' ' || c == '\\n' || c == '\\t' )\r\n c = getchar();\r\n if(c == '-'){\r\n flag = -1;\r\n c = getchar();\r\n }\r\n while(isdigit(c)){\r\n a = a * d + c - '0';\r\n c = getchar();\r\n }\r\n return a * flag;\r\n}\r\nvoid wd(LL a){\r\n if(a<0){\r\n putchar('-');\r\n a *= -1;\r\n }\r\n\r\n char b[128], i = 0;\r\n\r\n while(a){\r\n b[i] = a % 10;\r\n a /= 10;\r\n i++;\r\n }\r\n if(i--)\r\n while(i>=0){\r\n putchar('0'+b[i]);\r\n i--;\r\n }\r\n\r\n else\r\n putchar('0');\r\n\r\n putchar(' ');\r\n return;\r\n}\r\n/*\r\nint simple(int *si, int *dig){\r\n int i,j,k = 0;\r\n for(i=2; i < M ; i++ ){\r\n if(dig[i] == 0){\r\n dig[i] = i;\r\n si[k] = i; k++;\r\n }\r\n for(j = 0; j < k && i * si[j] < M && si[j] <= dig[i] ; j++)\r\n dig[ i * si[j] ] = si[j];\r\n }\r\n return k;\r\n} // \u0440\u0435\u0448\u0435\u0442\u043e \u042d\u0440\u0430\u0442\u043e\u0441\u0444\u0435\u043d\u0430 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b\r\nLL getp(int l, int r, int *a){\r\n if(r - l == 1){\r\n return (LL)a[l] * (LL)a[r];\r\n }\r\n else if ( r > l + 1){\r\n int i ,m, mn = INT_MAX;\r\n for(i=l; i<=r; i++){\r\n if(a[i] < mn){\r\n mn = a[i];\r\n m = i;\r\n }\r\n }\r\n LL t = maxl( (LL)a[m] * (LL)a[m-1] , (LL)a[m] * (LL)a[m+1] );\r\n return maxl( t, maxl(getp(l,m-1,a), getp(m+1,r,a)) );\r\n }\r\n else{\r\n return 1ll;\r\n }\r\n}\r\nint sumd(LL n){\r\n int s = 0;\r\n if(n < 0)\r\n n *= -1;\r\n while(n){\r\n s += n % 10;\r\n n /= 10;\r\n }\r\n return s;\r\n}\r\nint min11(LL x){\r\n int i;\r\n return 00000000;\r\n}\r\nint getk(LL x){\r\n int i,c = 0;\r\n int a[10] = {0,0,0,0,0,0,0,0,0,0};\r\n while(x){\r\n a[x % 10]++;\r\n x /=10;\r\n }\r\n for(i=0;i<10;i++){\r\n if(a[i] > 0){\r\n c++;\r\n }\r\n }\r\n return c;\r\n}\r\nint getkeq(LL x){\r\n int i = 0,c = 0;\r\n int a[10] = {0,0,0,0,0,0,0,0,0,0};\r\n while(x){\r\n a[i] = x % 10;\r\n x /=10;\r\n i++;\r\n }\r\n\r\n for(;i>0;i--){\r\n if(a[i] == a[i-1]){\r\n c++;\r\n }\r\n }\r\n return c;\r\n}\r\nint d2(LL a, LL b){\r\n char sa[32], sb[32];\r\n int i,j,la = 0, lb = 0,c = 0;\r\n while(a){\r\n sa[la] = a % 10 + '0';\r\n a /= 10;\r\n la++;\r\n }\r\n sa[la] = '\\0';\r\n\r\n while (b){\r\n sb[lb] = b % 10 + '0';\r\n b /= 10;\r\n lb++;\r\n }\r\n sb[lb] = '\\0';\r\n\r\n strrev(sa);\r\n strrev(sb);\r\n\r\n for(i=0, j = 0 ; i b[j]){\r\n c[k] = b[j]; \r\n j++;\r\n }\r\n else{\r\n c[k] = a[i];\r\n i++;\r\n j++;\r\n }\r\n }\r\n \r\n \r\n // printf(\"c\\n\");\r\n \r\n int t = 1;\r\n scanf(\"%i\", &t);\r\n //printf(\"%i\\n\",t);\r\n while(t--){\r\n \r\n int n,m = 1;\r\n scanf(\"%i\",&n);\r\n \r\n int l = 1;\r\n int r = k;\r\n\r\n while(l<=r){\r\n m = (r + l) / 2;\r\n if (c[m] > n)\r\n r = m - 1;\r\n else if (c[m] < n)\r\n l = m + 1;\r\n else\r\n break;\r\n }\r\n\r\n if(c[m - 1] > n)\r\n m--;\r\n \r\n \r\n printf(\"%i\\n\",m);\r\n }\r\n \r\n /*\r\n int i, n, m;\r\n long long int a[M25], sum = 0ll, mx = -1;\r\n scanf(\"%i\",&n);\r\n for(i=0;i\r\n#include \r\n\r\nint main()\r\n{\r\n\tint t, n, num[20], sum, a;\r\n\tscanf(\"%d\", &t);\r\n\tfor (int i = 0; i < t; i++)\r\n\t{\r\n\t\tnum[i] = -1;\r\n\t\tint j = 0;\r\n\t\tscanf(\"%d\", &n);\r\n\t\tdo\r\n\t\t{\r\n\t\t\tj++;\r\n\t\t\tnum[i]++;\r\n\t\t\tsum = j * j;\r\n\t\t} while (sum <= n);\r\n\t\tj = 0;\r\n\t\tsum = 1;\r\n\t\ta = 0;\r\n\t\tdo\r\n\t\t{\r\n\t\t\tj++;\r\n\t\t\tfor (int k = 1; k * k <= j; k++)\r\n\t\t\t{\r\n\t\t\t\tif (k * k == j)\r\n\t\t\t\t{\r\n\t\t\t\t\ta = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\ta = 1;\r\n\t\t\t}\r\n\t\t\tnum[i] += a;\r\n\t\t\tsum = j * j * j;\r\n\t\t} while (sum <= n);\r\n\t}\r\n\tfor (int i = 0; i < t; i++)\r\n\t{\r\n\t\tprintf(\"%d\\n\", num[i] - 1);\r\n\t}\r\n\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "48dedf5771a7bd4c27ee6af3a397c48e", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "166688f50d627d733dd63c6091c01f48", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9736842105263158, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "int n, x, a[32622], l;\r\nint f(int* q, int* w) { return *q - *w; }\r\nint main() {\r\n\tscanf(\"%d\", &n);\r\n\tfor (int i = 1; i * i <= 1000000000; i++)\r\n\t\ta[l++] = i * i;\r\n\tfor (int i = 1; i * i * i <= 1000000000; i++)\r\n\t\ta[l++] = i * i * i;\r\n\tqsort(a, l, 4, f);\r\n\tfor (int i = 0; i < n; i++) {\r\n\t\tint t = 0;\r\n\t\tscanf(\"%d\", &x);\r\n\t\tfor (int j = 0; j < l; j++)\r\n\t\t\tif (a[j] <= x)\r\n\t\t\t\tt++;\r\n\t\tprintf(\"%d\\n\", t);\r\n\t}\r\n}", "lang": "GNU C11", "bug_code_uid": "d366f0b837d2dd6198c11b366a423a7d", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "e634d8518dbe0fd2d0701a8cbe6a5f2c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9986013986013986, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n#include \r\n#include \r\n\r\nint t[500000];\r\n\r\nint main()\r\n{\r\n int T; scanf(\"%d \", &T);\r\n for(int i = 0; i < T; i++){\r\n long long a; scanf(\"%lld\", &a);\r\n int ans = 0, t1 = 0, t2 = 0;\r\n t[0] = 1;\r\n for(long long j = 1; j*j <= a; j++){\r\n if(j*j*j <= a){\r\n ans++;\r\n t[t1++] = j*j*j;\r\n }\r\n if(j*j >= t[t2]){\r\n if(j*j > t[t2]){\r\n ans++;\r\n }\r\n t2++;\r\n }\r\n else ans++;\r\n }\r\n printf(\"==%d\\n\", ans);\r\n }\r\n// while(T--){\r\n// int n; scanf(\"%d\", &n);\r\n//\r\n// }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "a97b6fbf1ab3b3fc52002f6413aaec81", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "f385948900904bf188b291721d6dc599", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9976525821596244, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main(){\r\n int i, n;\r\n scanf(\"%d\", &n);\r\n for(i=0;i\r\n#include \r\n#include \r\n#include \r\nint main()\r\n{\r\n int n,m;\r\n scanf(\"%d%d\",&n,&m);\r\n if (m==1)\r\n {\r\n printf(\"%d\\n\",n-m);\r\n }\r\n else\r\n printf(\"%d\\n\",n*(m-1));\r\n \r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "79f9f23ff1cef1e15f0a3a6ec00b3939", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "8701da4fb839490ab2437cc6694de539", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2645161290322581, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int n,m;\r\n scanf(\"%d%d\",&n,&m);\r\n int arr1[100][100],i,j;\r\n int x=1;\r\n for(i=0;i\r\nint main()\r\n \r\n{\r\n int r,c,i,j,k,s=0;\r\n scanf(\"%d%d\",&r,&c);\r\n for (i=1; i<=r; i++)\r\n {\r\n if(i==1)\r\n k=1;\r\n for(j=k;j<=i*c; j++)\r\n {\r\n // printf(\"%d \",j);\r\n s++;\r\n }\r\n // printf(\"\\n\");\r\n k=i*c+1;\r\n if(c>1)\r\n s=s-1;\r\n }\r\n if(c==1)\r\n s=s-1;\r\n printf(\"%d\",s);\r\nreturn 0;\r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "63bca49cecfc594000045baaffb9891d", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "8701da4fb839490ab2437cc6694de539", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7401869158878505, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \r\n\r\nint main ()\r\n{\r\n\r\n int a,b;\r\n scanf(\"%d %d\",&a,&b);\r\n if(a==1 && b==1)\r\n printf(\"0\\n\");\r\n else if(a==1 && b==2 || a==2 && b==1)\r\n printf(\"1\\n\");\r\n else\r\n printf(\"%d\\n\",a*(b-1));\r\n\r\n return 0;\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "e3a7b85e8f3c3834b41491b69bcc4409", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "b2cc05502523fcaab46d2aea86216148", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9502762430939227, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int n, m;\r\n scanf(\"%d%d\", &n, &m);\r\n if(m>1)\r\n printf(\"%d\",n*(m-1));\r\n if(m==1)\r\n printf(\"%d\",(n-1)*m);\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "b3b2d26f714134601b7ccbcd70376dbf", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "8761bb8d8140af900800826dc9e78996", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.22910216718266255, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "#include \nint main()\n{\n int a[100][100], R, C,count=0;\n scanf(\"%d %d\", &R, &C);\n for (int i = 0; i < R; i++)\n {\n for (int j = 0; j < C; j++)\n {\n scanf(\"%d\", &a[i][j]);\n }\n }\n for (int i = 0; i < R; i++)\n {\n for (int j = 0; j < C; j++)\n {\n printf(\"%d \", a[i][j]);\n }\n printf(\"\\n\");\n }\n for (int i = 0; i < R; i++)\n {\n for (int j = 0; j < C; j++)\n {\n if (a[i][j]-a[i][j+1]==-1)\n {\n count++;\n }\n if (a[i][j]-a[i+1][j]==-1)\n {\n count++;\n }\n \n \n }\n }\n // count=-R;\n printf(\"%d\\n\",count);\n \n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "ec0703e0ce92bd9905424446aab386ee", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "d1593d315e079645b7303971fcd21c46", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9287020109689214, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include\r\n#include\r\nint main()\r\n{\r\n int a, b, count;\r\n scanf(\"%d %d\", &a, &b);\r\n\r\n if(b == 1)\r\n {\r\n count = (a*b)-b;\r\n }\r\n else{\r\n count = (a*b)-a;\r\n }\r\n\r\n printf(\"%d\\n\", count);\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "0284bcfa75317e4fb9c936095da11c19", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "460e58453574b13856b1234359c6303a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.35942028985507246, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include\r\n#include\r\nint main()\r\n{\r\n int a, b, m, t, i, j, count = 0;\r\n scanf(\"%d %d\", &a, &b);\r\n\r\n int ar[a][b], n = 0;\r\n\r\n for(i=0; i 1){\r\n for(i=0; i\r\n#include\r\nint main()\r\n{\r\n long long int n,m,i,j,k=1,sum=0;\r\n scanf(\"%lld %lld\",&n,&m);\r\n long long int a[m*n+1];\r\n if(n\r\n\r\nint main() {\r\n int m,n;\r\n scanf(\"%d%d\",&n,&m);\r\n if(m>=2)\r\n {\r\n printf(\"%d\",(m-1)*n);\r\n }\r\n else\r\n {\r\n printf(\"%d\",n-1);\r\n }\r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "54320b3dcc401968395786f4ec1d51b0", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "cbf565beaa2a158b12685f490c9ae392", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9967105263157895, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n long long int n,m;\r\n scanf(\"%lld%lld\",&n,&m);\r\n long long int ans;\r\n\r\n if(n==1 && m==1)\r\n ans=0;\r\n else if(n==1)\r\n ans=m-1;\r\n else if(m==1)\r\n ans=n-1;\r\n else\r\n ans=(m-1)*n;\r\n\r\n printf(\"%d\\n\",ans);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "d524f6ceb9886f3166e115bb6f9c909b", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "040c3b88f636754e1fa8b3627385fecd", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8506787330316742, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\nint a,b,c;\r\nscanf(\"%d %d\",&a,&b);\r\nif(b==1)\r\n{\r\nc=a-1;\r\nprintf(\"%d\",c);\r\n}\r\nelse if(a==1)\r\n{\r\nc=b-1;\r\nprintf(\"%d\",c);\r\n}\r\nelse\r\n{\r\nc=a*(b-1);\r\nprintf(\"%d\",c);\r\n}\r\nreturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "9e473002a1f36ed306f02b5dfea804db", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "470f93dac77b534ee2fe613465741756", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9887005649717514, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\r\n#define ll long long\r\nint main()\r\n{\r\n ll r,c;\r\n scanf(\"%lld%lld\",&r,&c);\r\n if(c==1)\r\n printf(\"%d\",r-1);\r\n else\r\n printf(\"%d\",(c-1)*r);\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "804688cc7f559e6d79bfb6eb77440969", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "738b40678cbddcc21b198b0b9d10b454", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.962059620596206, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \r\nint main()\r\n{\r\n int n, m;\r\n scanf(\"%d %d\", &n, &m);\r\n if(n < m)\r\n {\r\n printf(\"%d\\n\", (m-1)*n);\r\n }\r\n else\r\n {\r\n if(n % 2 == 0 && m % 2 == 0)\r\n {\r\n printf(\"%d\\n\", (m-1)*n);\r\n }\r\n else\r\n {\r\n printf(\"%d\\n\", (n-1)*m);\r\n }\r\n }\r\n return 0;\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "2eaa24c42d8d856845356fa87933abb8", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "ecdf48faa3964f12093f09080343d91d", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8146551724137931, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include \r\n#include \r\n\r\nint main(void)\r\n{\r\n int a,b,c,d;\r\n\r\n scanf(\"%d %d\",&a,&b);\r\n\r\n if(b==1){\r\n c =(a-1);\r\n printf(\"%d\",c);}\r\n else { c=a*(b-1);\r\n printf(\"%d\",c);}\r\n\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "8baf8c79e90dde69fe37d0f47c888bab", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "e4db5fa113be386dcdf58abaf37ad8aa", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9938229238160604, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\nvoid swap(int* a, int* b)\r\n{\r\n int temp = *a;*a = *b; *b = temp;\r\n}\r\n \r\nvoid heapify(int arr[], int N, int i){\r\n int largest = i;\r\n \r\n int left = 2 * i + 1;\r\n int right = 2 * i + 2;\r\n if (left < N && arr[left] > arr[largest])\r\n largest = left;\r\n if (right < N && arr[right] > arr[largest])\r\n \r\n largest = right;\r\n if (largest != i) {\r\n \r\n swap(&arr[i], &arr[largest]);\r\n heapify(arr, N, largest);\r\n }\r\n}\r\nvoid heapSort(int arr[], int N)\r\n{\r\n for (int i = N / 2 - 1; i >= 0; i--)\r\n \r\n heapify(arr, N, i);\r\n for (int i = N - 1; i >= 0; i--) {\r\n swap(&arr[0], &arr[i]);\r\n heapify(arr, i, 0);\r\n }\r\n}\r\n\r\nvoid fill(int a[],int n){\r\nfor(int i=0;im){m=a[i];\r\n\t}\r\n}return m;\r\n}\r\nint id(int a[],int n){\r\nfor(int i=0;i\r\nint main()\r\n{\r\n int r,c,n,i;\r\n scanf(\"%d %d\",&r,&c);\r\n n=r*(c-1);\r\n if(c==1){n=r-1;}\r\n printf(\"%d\",n);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "5265b66ec569d69507f376de2865cf39", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "3c8df5acd23ac7327a79b5dc43714584", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9666666666666667, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main()\r\n{\r\n long int N, M;\r\n scanf(\"%ld%ld\", &N, &M);\r\n printf(\"%ld\\n\", (M==1)?(M-1)*N:(N-1)*M);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "303105725138bf0020e04b3f2c075471", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "324a7b27de7216fba706a53e2fbc70ea", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6206896551724138, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n long long int n, m;\r\n scanf(\"%lld %lld\", &n, &m);\r\n if (n > m) {\r\n long long int temp = m;\r\n m = n;\r\n n = temp;\r\n }\r\n printf(\"%lld\", n*(m-1));\r\n \r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "5d62e039c9b22dad0e4c4f3ad276096c", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "898ca76c87b9c0c4233e7093888f4b69", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9788732394366197, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\r\n#include \r\n#include \r\nint main ()\r\n{\r\n\r\n long long int n,m;\r\n int result;\r\n scanf(\"%lld\",&n);\r\n scanf(\"%lld\",&m);\r\n\r\n\r\n if(m==1)\r\n result = n-1;\r\n else\r\n result = n*(m-1);\r\n\r\n printf(\"%d\\n\",result);\r\n\r\n return 0;\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "e04e0fa0db713db7bbbfa9c8f4614f7e", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "b05840530503629fb5651afeaf0a5320", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9183098591549296, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n,m,i;\r\n scanf(\"%d%d\",&n,&m);\r\n if(m==1)\r\n i = ((n-1)*m);\r\n else\r\n i=(m-1)*n;\r\n printf(\"%d\",i);\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "571dd1fc312ac7508e9f7186ba5e3704", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "08b1e371b001868bf7b8df467a358172", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9728813559322034, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int m, n, ans;\r\n\r\n scanf(\"%d %d\", &n ,&m);\r\n\r\n if(n==1 && m==1)\r\n ans=0;\r\n else if(n==1 && m>1)\r\n ans=m-1;\r\n else if(n>1 && m==1)\r\n ans=n-1;\r\n else if(n>1 && m>1)\r\n ans=(m-1)*n;\r\n printf(\"%d\\n\", ans);\r\n}", "lang": "GNU C11", "bug_code_uid": "1a04e698d28dfb1cffd7270a13043c1e", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "f640df3021e0951ace477585326a5c9a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9368770764119602, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include \r\n\r\nint main() {\r\nint m,n;\r\nscanf(\"%d %d \",&n,&m);\r\nif(m==1)\r\nprintf(\"%d\",n-1);\r\nelse\r\nprintf(\"%d\",(m-1)*n);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "454ae6b9d48ca3af40db1141bd694109", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "ff20ed7d5c085ec613cc2ca859513641", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8698060941828255, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n,m;\r\n scanf(\"%d%d\",&n,&m);\r\n long r;\r\n if(m>1)r=n*(m-1);\r\n else r=(n-1)*m;\r\n printf(\"%ld\\n\",r);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "b5624e074fee6840eb7c42554b061258", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "addc6c84638ee218bda6495e6957de4d", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9306930693069307, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n,m;\r\n scanf(\"%d %d\",&n,&m);\r\n if(m==1)\r\n if(n==1)printf(\"0\");\r\n else printf(\"%d\",n-1);\r\n else printf(\"%d\",n*(m-1));\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "767c3f8e1227b5f0d8ccecbb995beb10", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "6ff195c0206803436c9d9085adad4b69", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9366197183098591, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tlong long int m,n,count=0;\r\n\tscanf(\"%lld%lld\",&n,&m);\r\n\t// for(int i=0;i\r\n\r\nint main(){\r\n int n, m;\r\n scanf(\"%d %d\", &n, &m);\r\n int answer;\r\n\r\n if(m==1){\r\n answer = n-1;\r\n printf(\"%d\", answer);\r\n }\r\n else{\r\n answer = n * (m-1);\r\n printf(\"%d\", answer);\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "5b9a59341e097ef816cb4cc9d28164ac", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "a40113236f56214cdfaa36822dac8477", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9735294117647059, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#define __USE_MINGW_ANSI_STDIO 0\r\n#include\r\n#include\r\n#include\r\n#include\r\nint main()\r\n{\r\n int n,m,ans;\r\n scanf(\"%d %d\",&n,&m);\r\n if(n==1)\r\n ans=m-1;\r\n else if(m==1)\r\n ans=n-1;\r\n else\r\n {\r\n ans=(m*n)-n;\r\n }\r\n printf(\"%d\\n\",ans);\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "805ba235486cbbb8908fcd765f23b568", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "d7d54f329b4151e6c9a31f8aaef8552b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9980276134122288, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n long long int ans,n,m;\r\n scanf(\"%lld%klld\",&n,&m);\r\n if(m>1)\r\n ans=(m-1)*n;\r\n else if(m==1 && n==1)\r\n ans=0;\r\n else\r\n ans=n-1;\r\n \r\n printf(\"%lld\\n\",ans);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "ba130df7bce883a236a3fc3aa8b55f70", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "4524057b889e08d846c8bd885dce4701", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8924485125858124, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \r\n\r\nint main() {\r\n long long int n,m;\r\n scanf(\"%d %d\", &n, &m);\r\n if(m==1){\r\n printf(\"%d\\n\",n-1);\r\n }\r\n else{\r\n printf(\"%d\\n\",(m-1)*(n));\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "2d10c4203c976f47b388c72678100f49", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "b210caac9dc959f6747e310fcaa9eaf6", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9482288828337875, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include\r\n\r\nint main(){\r\n int n,m;\r\n scanf(\"%d %d\", &n,&m);\r\n if(m == 1){\r\n printf(\"%d\", n-1);\r\n }else {\r\n printf(\"%d\", ((m-1)*n));\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "d64f7886ac55f04c1e23b8ab157fbf80", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "ce5fad8c0f4e76140d0b59f86cb9e13d", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8613861386138614, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include\r\nint main()\r\n{\r\n int N,M;\r\n scanf(\"%d%d\",&N,&M);\r\n if (M==1)\r\n {\r\n printf(\"%lld\\n\",N-M);\r\n }\r\n else\r\n printf(\"%d\\n\",(N*M)-N);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "0da0faf09b988d94001a238e7043de7a", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "21072a9aa925ad797ff6e54ac33d33bd", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9834254143646409, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \r\nint main(void)\r\n{\r\n long long int n,m;\r\n scanf(\"%d %d\",&n,&m);\r\n\tlong long int out;\r\n\tif(m==1) out=n-1;\r\n\telse out=(m-1)*n;\r\n\tprintf(\"%d\",out);\r\n}\r\n\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "bda3fc4bc38e2fa814d6ad07c7fe061d", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "6fe13cd09e25673dfc42227ae231eb8f", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.328125, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n long n, m;\r\n scanf(\"%d %d\", &n, &m);\r\n if(m%2==0)\r\n {\r\n printf(\"%ld\\n\", (m-1)*(m-1));\r\n }\r\n else\r\n {\r\n printf(\"%ld\\n\", m*m);\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "e7bd7d0962649ef65202a48d847c9618", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "c300aa00594ad995027d748546768b92", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.97, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include\r\n#include\r\nint main(){\r\n\t int n,m;\r\n\t scanf(\"%d%d\",&n,&m);\r\n\t if(n==1||m==1) printf(\"%d\\n\",n*m-1);\r\n\t else{\r\n\t\tprintf(\"%d\\n\",n*(m-1));\r\n\t }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "0e34d93e481101ae279d9da13ee332f1", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "4cb8e2b80c808acbbf25841b14498b97", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9419354838709677, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include\r\nint main()\r\n{\r\n int N, M; scanf(\"%d %d\", &N, &M);\r\n if(M == 1) printf(\"%d\", N - 1);\r\n else printf(\"%d\", N * (M - 1));\r\n}", "lang": "GNU C11", "bug_code_uid": "f8dcd20f947d6508fa10af221c6a7e93", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "0f4bd96c1d7f21d9ba189070336eb9ab", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9141630901287554, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int N, M, num;\r\n scanf(\"%d %d\", &N, &M);\r\n if(M < 2) {\r\n num = (N-1)*M;\r\n }\r\n else {\r\n num = (M-1)*N;\r\n }\r\n printf(\"%d\\n\", num);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "6d2fe9e5982414884c30b252c498bfb7", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "966feb7b9cee9f3667f1806a5ab8f5ad", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6034214618973561, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n long long int n,m;\r\n long long int sum = 0;\r\n INPUT:\r\n scanf(\"%lld%lld\",&n,&m);\r\n if(n>=1&&m>=1&&n<=1000000000&&m<=1000000000){\r\n sum=(m-1)*n;\r\n printf(\"%lld\",sum);\r\n }\r\n else\r\n {\r\n goto INPUT;\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "4df2aaf372314dc44e2c1b4517e71315", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "e5945416aa7a383dc8b2d060a7b7d58e", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9537366548042705, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int a,b;\r\n scanf(\"%d %d\",&a,&b);\r\n if(b==1)\r\n {\r\n printf(\"%d\",a-1);\r\n return 0;\r\n }\r\n if(a==1)\r\n {\r\n printf(\"%d\",b-1);\r\n return 0;\r\n }\r\n printf(\"%d\",(b-1)*a);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "127b05e45f73f51c9951b9718226a168", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "5dabf50a2771a0a69a5c8fd4154e24cb", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5386666666666666, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \r\nint main() {\r\n int n,m;\r\n scanf(\"%d%d\",&n,&m);\r\n if(m==1) {\r\n printf(\"%d\",n-1);\r\n }\r\n else {\r\n printf(\"%d\",(m-1)*n);\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "59d9742f2cd387066ed7108508dd8b89", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "c2de2bc87b5f1b989a7d5ce127037e69", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9428571428571428, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include \r\n\r\nint main(void) {\r\n\t// your code goes here\r\n\tint n,m;\r\n\tscanf(\"%d%d\",&n,&m);\r\n\tif (m==1)\r\n\t{\r\n\t printf(\"%d\",n-1);\r\n\t}\r\n\telse \r\n\t{\r\n\t printf(\"%d\",(m-1)*n);\r\n\t}\r\n\treturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "253e6363a6c51cda71de1f8abec669a6", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "79788de0f5ef2d909be1d7d6cc0e23ad", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9432989690721649, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n,m;\r\n scanf(\"%d%d\",&n,&m);\r\n if(m>1){\r\n printf(\"%d\",(n*(m-1)));\r\n }\r\n if(m==1){\r\n printf(\"%d\",((n-1)*m));\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "bd2bb5f0b588103fa8e1951d56cfbd85", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "e8fd20c843ca4d8b502ebd7d89d6c3f9", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9473684210526315, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint\nmain(void)\n{\n\tint n, m;\n\n\tscanf(\"%d %d\", &n, &m);\n\n\tif (m == 1)\n\t\tprintf(\"%d\\n\", n - 1);\n\telse\n\t\tprintf(\"%d\\n\", n * (m - 1));\n\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "25b61da99cf0d78c3b8531cc29622f82", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "03cb245730464eb61b48dc817730921f", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9485714285714286, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include \r\n\r\nint main(){\r\n int n,m;\r\n scanf(\"%d %d\",&n,&m);\r\n if(m!=1){\r\n printf(\"%d\",n*(m-1));\r\n }else{\r\n printf(\"%d\",n-1);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "73f7f9a0730d9b81b9d907f3aa8c4aa4", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "403269f202483a2341ead761b73d831b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9390519187358917, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \r\n\r\nint main(void)\r\n{\r\n int r, c;\r\n scanf(\"%i %i\", &r, &c);\r\n if (c == 1)\r\n {\r\n printf(\"%i\\n\", r - 1);\r\n }\r\n else\r\n {\r\n printf(\"%i\\n\", r * (c - 1));\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "3c695a026e6ffbc0e739d0e2191b2ae5", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "881ce97b2a1deea40f13284fad8be273", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9581749049429658, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int i,j;\r\n scanf(\"%d%d\",&i,&j);\r\n if(i==1&&j==1)\r\n {\r\n printf(\"0\\n\");\r\n }\r\n else if(j==1)\r\n {\r\n printf(\"%d\\n\",i-1);\r\n }\r\n else\r\n {\r\n printf(\"%d\\n\",i*(j-1));\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "21a8291b939a0dbfe748699c54bed8cb", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "84dc97f84d14b62ddc60a6fa114d8b9a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9488636363636364, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main()\r\n{\r\n int a,b;\r\n scanf(\"%d%d\",&a,&b);\r\n\r\n if(b!=1)\r\n\r\n printf(\"%d\",(a*b)-a);\r\n\r\n else\r\n printf(\"%d\",a-b);\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "2f055d25124691c01a0d2161f3906928", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "17c6eaab29fdc55fd4d9a7c10f6dae85", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5636623748211731, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\r\n#include\r\n#include\r\nint main()\r\n{\r\n long long int a,b;\r\n scanf(\"%lld %lld\",&a,&b);\r\n\r\n if(a<=b){\r\n printf(\"%lld\",((b-1)*a));\r\n }\r\n\r\n else{\r\n printf(\"%lld\",((a-1)*b));\r\n }\r\n return 0;\r\n}\r\n\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\r\n\t\r\n\t\r\n\r\n\r\n\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "b0b8346453c0d6a0f4d4e3d4fb902a6f", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "dfe88018e73d3d5474ea3b61687de9f4", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9346733668341709, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include\r\nint main()\r\n{\r\n int M,N;\r\n scanf(\"%d%d\",&N,&M);\r\n if(M==1){\r\n printf(\"%d\",N-1);\r\n }\r\n else{\r\n printf(\"%d\",(M-1)*N);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "410f05cd0163d9e0ac28facce4b19797", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "c7aba0ed90eebdb046993bb180effe41", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6182669789227166, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int c, r;\r\n scanf(\"%d %d\", &r, &c);\r\n if(c==1)\r\n printf(\"%d\\n\", r-1);\r\n else\r\n printf(\"%d\\n\", (c-1)*r);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "daa132a78252f10cac6c9e309f9606e1", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "1865ba620120b0a05e9c210e8530f99a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8461538461538461, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 8, "bug_source_code": "#include \r\n\r\nint main()\r\n{int m,n;\r\nscanf(\"%d%d\",&n,&m);\r\nif(m!=1){printf(\"%d\",(m-1)*n);}\r\nelse{printf(\"%d\",n-1);}\r\n\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "4c153da118d1aa97a48f2791ccf666a6", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "24876cf015184f7edb5884a6bdc0701a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.94, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main(){\r\n int n,m;\r\n scanf(\"%d %d\",&n,&m);\r\n if(m==1){\r\n printf(\"%d\\n\",n-1);\r\n }\r\n else{\r\n printf(\"%d\\n\",(m-1)*n);\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "1ea4065c63cfd8f17fbc855267f8d5fd", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "dc24530885a2e1e1553916d4f1e8eadf", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7647058823529411, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\nlong long m,n;\r\nscanf(\"%lld%lld\",&m,&n);\r\nprintf(\"%lld\\n\",m*(n-1));\r\nreturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "98d7ec01024f35109d02d28abebcfa4a", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "00d16fd9ca286a1d8265bc30c498de70", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9415584415584416, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main(){\r\nint a,b;\r\nscanf(\"%d%d\",&a,&b);\r\nif(b==1){\r\nprintf(\"%d\\n\",(a-1));\r\n\r\n}\r\nelse{\r\nprintf(\"%d\\n\",(b-1)*a);\r\n\r\n}\r\n\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "fbaa9a10c39e8edb1272d6ad9882536d", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "4f7db34da8f3fce98b2bd4ec2c812ac7", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6150234741784038, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include\r\nint main()\r\n{\r\n long long n,m,s;\r\n scanf(\"%lld%lld\",&n,&m);\r\n if(n>m)\r\n {\r\n n--;\r\n }\r\n else\r\n {\r\n m--;\r\n }\r\n printf(\"%lld\",n*m);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "9cc54438f59ab6ff61a3cca109a2671c", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "e00ea2c60c2d6755d55413dea54be75a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9289940828402367, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define ll long long\n\nint main()\n{\n ll m;\n ll n;\n ll k;\n ll i;\n ll j;\n\n i = -1;\n ll ret = 0;\n scanf(\"%lld %lld\", &n, &m);\n if (n == 1)\n ret = m - 1;\n else if (m == 1)\n ret = n - 1;\n else if (n == 2 && m == 2)\n ret = 4;\n else\n ret = n * (m - 1);\n printf(\"%lld\\n\", ret);\n}", "lang": "GNU C11", "bug_code_uid": "4cb72d49075d00db0401916351b1289e", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "0b219fcb49ed08ee436c5dffe76964fd", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9375, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int r,c;\r\n scanf(\"%d %d\",&r,&c);\r\n if(c>1){\r\n printf(\"%d\", r*(c-1));\r\n }\r\n else printf(\"%d\", r-1);\r\n\r\n\r\n\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "c886917bbf852404d52a91fb52e46f2c", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "f2f108377254902325b6ac4a5ade0d83", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8866075594960336, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "#define __USE_MINGW_ANSI_STDIO 0\r\n#include \r\n\r\n#define maxN 200000\r\n\r\n#define MOD 1000000007\r\n\r\n// MODULAR NCR\r\n// DEPENDENCIES:\r\n\r\n// nCr % mod function\r\n// Using Fermat's Little theorem: a^(p-2) = a^(-1) (mod p)\r\n\r\n// Build factorial array\r\nlong long fac[maxN + 1];\r\nvoid __attribute__((constructor))\r\ninitFacs() {\r\n\tfac[0] = 1;\r\n for (int i = 1; i <= maxN; i++) fac[i] = fac[i - 1] * i % MOD; \r\n}\r\n\r\n// Calculate base ^ pow % mod\r\nlong long modPower(long long base, int pow, int mod)\r\n{\r\n long long res = 1;\r\n base %= mod;\r\n // constantly decompose base ^ pow = (base ^ 2) ^ (pow / 2)\r\n while (pow > 0) {\r\n // make sure if it is odd, then base ^ pow = base ^ (pow - 1) * base\r\n if (pow % 2 == 1) res = res * base % mod;\r\n pow /= 2;\r\n base = (base * base) % mod;\r\n }\r\n return res;\r\n}\r\n\r\n// a ^ (p - 2) = a ^ (-1) (mod p)\r\nlong long modInverse(long long n, int mod) {\r\n return modPower(n, mod - 2, mod);\r\n}\r\n\r\n// nCr = n! / r! / (n - r)!\r\n// nCr = n! * inv(r!) * inv((n - r)!)\r\nlong long nCrModP(unsigned long long n, int r, int mod) {\r\n // Base cases\r\n if (n < r) return 0;\r\n if (r == 0) return 1;\r\n\r\n return fac[n] * modInverse(fac[r], mod) % mod\r\n * modInverse(fac[n - r], mod) % mod;\r\n}\r\n// END MODULAR NCR\r\n\r\nvoid testcase() {\r\n\tint n, k;\r\n\tscanf(\"%d%d\", &n, &k);\r\n\tlong long T;\r\n\tlong long ans;\r\n\tif (n % 2 == 1) {\r\n\t\t// n odd\r\n\t\tT = 1;\r\n\t\tfor (int i = 0; i <= (n - 1) / 2; ++i) {\r\n\t\t\tT += nCrModP(n, i, MOD);\r\n\t\t\tT %= MOD;\r\n\t\t}\r\n\t\tans = 1;\r\n\t\tfor (int i = 0; i < k; ++i) {\r\n\t\t\tans *= T;\r\n\t\t\tans %= MOD;\r\n\t\t}\r\n\t} else {\r\n\t\t// n even\r\n\t\tT = 0;\r\n\t\tfor (int i = 0; i < n / 2; ++i) {\r\n\t\t\tT += nCrModP(n, 2 * i, MOD);\r\n\t\t\tT %= MOD;\r\n\t\t}\r\n\t\tif (T == 1) {\r\n\t\t\tans = k + 1;\r\n\t\t} else {\r\n\t\t\t// GP, T != 1\r\n\t\t\tans = modPower(T, k + 1, MOD);\r\n\t\t\tans -= 1;\r\n\t\t\tans *= modInverse(T - 1, MOD);\r\n\t\t\tans %= MOD;\r\n\t\t}\r\n\t}\r\n\tprintf(\"%lld\\n\", ans);\r\n return;\r\n}\r\n\r\nint main() {\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; ++i) testcase();\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "2244a05e9298012e4bc27cf2ee86b1bf", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "d0fc17283ff7839d542bd4ec59890b32", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6909090909090909, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint winning(int n, int k);\nint expmod(long long int a, int b, int m);\nconst int mod = 1000000007;\n\nint main () {\n int t;\n int n;\n int k;\n scanf(\"%d\", &t);\n for (int i = 0; i < t; i++) {\n scanf(\"%d %d\", &n, &k);\n printf(\"%d\\n\", winning(n, k));\n }\n}\n\nint winning (int n, int k) {\n if (k == 0) {\n return 1;\n }\n if (n % 2 == 0) {\n long long int result = expmod(2, n*(k-1), mod) + (expmod(2, n-1, mod)-1)*winning(n, k-1);\n return result % mod;\n }\n else {\n long long int result = (expmod(2, n-1, mod)+1)*winning(n, k-1);\n return result % mod;\n }\n}\n\nint expmod(long long int a, int b, int m)\n{\n\tint res = 1;\n\ta = a % m; \n\n\tif (a == 0) return 0;\n\n\twhile (b > 0)\n\t{\n\t\tif (b & 1)\n\t\t\tres = (res*a) % m;\n\n\t\tb = b>>1;\n\t\ta = (a*a) % m;\n\t}\n\treturn res;\n}\n", "lang": "GNU C11", "bug_code_uid": "dd59e9e1ce9232be74789c31e9484e58", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "9fc344d3e41959140ef6482f177a66e9", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7737089201877935, "equal_cnt": 19, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "#include \n#include \n\n// Program de Mircea Rebengiuc\n// inceput pe 2021.08.09\n\n#define MOD 1000000007\n#define MAXN 100000\n#define MAXK 100000\n\nint p2[MAXK + 1];\n\nstatic inline int multmod( int a, int b ){\n return (((long long)a) * b) % MOD;\n}\n\nstatic inline int addmod( int a, int b ){\n return (a + b) % MOD;\n}\n\n// chestii invmod\nstatic inline int myExp( int a, int n ){\n int acc = 1;\n\n while( n > 0 ){\n if( n & 1 )\n acc = multmod(acc, a);\n a = multmod(a, a);\n n /= 2;\n }\n\t\n return acc;\n}\n\nstatic inline int inv( int x ){\n return myExp(x, MOD - 2);\n}\n\nint main(){\n int t, n, k, i, big_num, comb, x, answer;\n\n p2[0] = 1;\n for( i = 1 ; i <= MAXK ; i++ )\n p2[i] = (2 * p2[i - 1]) % MOD;// nu tb sa fac long long ca nu 2 * MOD nu da overflow\n\n for( scanf(\"%d\", &t) ; t-- ; ){\n scanf(\"%d%d\", &n, &k);\n\n // calculam big_num\n big_num = 0;\n comb = 1;\n for( i = 0 ; i < n ; i += 2 ){\n big_num = addmod(big_num, comb);\n comb = multmod(comb, multmod(n - i, n - i - 1));\n comb = multmod(comb, multmod(inv(i + 1), inv(i + 2)));\n }\n\n // simulam\n x = 1;\n answer = 0;// scadem din total ca conditia este >=\n for( i = 0 ; i < k ; i++ ){\n answer = addmod(answer, (1 ^ (n & 1)) * multmod(x, p2[k - i - 1])) % MOD;\n x = multmod(x, (n & 1) + big_num);\n }\n answer = addmod(answer, x);\n\n printf(\"%d\\n\", answer);\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "eb5188e1c0e50c67718bfde2c9a7d2ad", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "fabdd2669ee3e1ec90d5a8097af10f6e", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7931796652983897, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n\n// Program de Mircea Rebengiuc\n// inceput pe 2021.08.09\n\n#define MOD 1000000007\n#define MAXN 200000\n#define MAXK 200000\n\nint p2[MAXK + 1];\n\nstatic inline int multmod( int a, int b ){\n return (((long long)a) * b) % MOD;\n}\n\nstatic inline int addmod( int a, int b ){\n return (a + b) % MOD;\n}\n\n// chestii invmod\nstatic inline int myExp( int a, int n ){\n int acc = 1;\n\n while( n > 0 ){\n if( n & 1 )\n acc = multmod(acc, a);\n a = multmod(a, a);\n n /= 2;\n }\n\t\n return acc;\n}\n\nstatic inline int inv( int x ){\n return myExp(x, MOD - 2);\n}\n\nint main(){\n int t, n, k, i, big_num, comb, x, answer;\n\n p2[0] = 1;\n for( i = 1 ; i <= MAXK ; i++ )\n p2[i] = (2 * p2[i - 1]) % MOD;// nu tb sa fac long long ca 2 * MOD nu da overflow\n\n for( scanf(\"%d\", &t) ; t-- ; ){\n scanf(\"%d%d\", &n, &k);\n\n // calculam big_num\n big_num = 0;\n comb = 1;\n for( i = 0 ; i < n ; i += 2 ){\n big_num = addmod(big_num, comb);\n comb = multmod(comb, multmod(n - i, n - i - 1));\n comb = multmod(comb, multmod(inv(i + 1), inv(i + 2)));\n }\n\n // simulam\n x = 1;\n answer = 0;\n for( i = 0 ; i < k ; i++ ){\n answer = addmod(answer, (1 ^ (n & 1)) * multmod(x, p2[k - i - 1]));\n x = multmod(x, (n & 1) + big_num);\n }\n answer = addmod(answer, x);// ca semnul este >=\n\n printf(\"%d\\n\", answer);\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f7793fbfd81062cb5da5e0f15e6018da", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "fabdd2669ee3e1ec90d5a8097af10f6e", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9983471074380166, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define MD\t1000000007\n\nlong long power(long long a, int k) {\n\tlong long p = 1;\n\n\twhile (k) {\n\t\tif (k & 1)\n\t\t\tp = p * a % MD;\n\t\ta = a * a % MD;\n\t\tk >>= 1;\n\t}\n\treturn p;\n}\n\nint main() {\n\tint t;\n\n\tscanf(\"%d\", &t);\n\twhile (t--) {\n\t\tint n, k, i, ans;\n\n\t\tscanf(\"%d%d\", &n, &k);\n\t\tif (k == 0)\n\t\t\tprintf(\"1\\n\");\n\t\telse if (n % 2 == 1)\n\t\t\tprintf(\"%lld\\n\", power(power(2, n - 1) + 1, k));\n\t\telse {\n\t\t\tans = power(power(2, n - 1) - 1, n);\n\t\t\tfor (i = 0; i < k; i++)\n\t\t\t\tans = (ans + power(power(2, n - 1) - 1, i) * power(power(2, n), k - 1 - i)) % MD;\n\t\t\tprintf(\"%d\\n\", ans);\n\t\t}\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "dd3501823788e1b883a69d5978b6795c", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "f5c5969274631e82cc141e2b47ec6e0e", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5743243243243243, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#pragma c11 on\r\n\r\n#include\r\n#include\r\n#include\r\n#include\r\n#include\r\n#include\r\n#define MOD (int)(1e9+7)\r\ntypedef enum colorType{\r\n white, green, red, blue, orange ,yellow\r\n}colorType;\r\n\r\ntypedef struct treeNode{\r\n colorType color;\r\n struct treeNode* previous;\r\n struct treeNode* next;\r\n}treeNode;\r\ntypedef struct tree{\r\n treeNode * root;\r\n int size;\r\n}tree;\r\nvoid makePerfectTree(int *t,int*k,treeNode* node){\r\n if(*t<*k){\r\n node->previous=calloc(1,sizeof(treeNode));\r\n node->next=calloc(1,sizeof(treeNode));\r\n (*t)++;\r\n makePerfectTree(t,k,node->previous);\r\n makePerfectTree(t,k,node->next);\r\n }\r\n}\r\n\r\nlong long quickPow(long long n, long long powers) {\r\n long long res = 1;\r\n while (powers > 0) {\r\n if (powers & 1)\r\n res =res * n%MOD;\r\n n = n*n%MOD;\r\n powers >>= 1;\r\n }\r\n return res;\r\n}\r\nint main(void){\r\n int k;\r\n scanf(\"%d\",&k);\r\n /*tree * tree1=(tree*)calloc(1,sizeof(tree));\r\n tree1->root=calloc(1,sizeof(treeNode));\r\n int t=1;\r\n makePerfectTree(&t,&k,tree1->root);\r\n //forget the idiot tree;\r\n*/\r\n printf(\"%lld\",6* quickPow(4, ((1<\r\n#include \r\n\r\n#define MOD_NUMBER 1000000007\r\n\r\nunsigned long long modpow(int n, unsigned long long index) {\r\n unsigned long long nn = n;\r\n unsigned long long ans = 1;\r\n while (index) {\r\n if (index & 1) {\r\n ans *= nn;\r\n ans %= MOD_NUMBER;\r\n }\r\n nn *= nn;\r\n nn %= MOD_NUMBER;\r\n index >>= 1;\r\n }\r\n\r\n return ans;\r\n}\r\n\r\nint run() {\r\n int n;\r\n scanf(\"%d\", &n);\r\n long long a = (6*modpow(4, (1<\r\n#include \r\n#include \r\n#define DEBUG(x); printf(\"%d------\\n\",x);\r\n#define ll long long\r\n#define M 1000000007\r\nll power(ll a,ll b){\r\n if(b==0)return 1;\r\n ll ans=power(a,b/2)%M;\r\n if(b%2==0)return ans*ans%M;\r\n else return ans*ans*a%M;\r\n}\r\nint main(){\r\n\tint n;\r\n\tscanf(\"%d\",&n);\r\n\tll ans=6,start=1;\r\n// \tn--;\r\n\tif(n>0){\r\n\t // start*=2;\r\n\t ans=ans*power(4,power(2,n)-2)%M;\r\n\t // DEBUG(ans);\r\n\t // n--;\r\n\t}\r\n\tprintf(\"%lld\",ans);\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "bbe26aee3ad84e8e086a0c1aa1e0a034", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "a7da806f08e6a116b947f59730fe7ec4", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.68625, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int t;\r\n int ar[2][2],i,j;\r\n int flag=0;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n \r\n for(i=0;i<2;i++)\r\n {\r\n for(j=0;j<2;j++)\r\n {\r\n scanf(\"%d\",&ar[i][j]);\r\n }\r\n }\r\n for(i=0;i<2;i++)\r\n {\r\n for(j=0;j<2;j++)\r\n {\r\n if(ar[i][j]==1)\r\n {\r\n flag=flag+1;\r\n }\r\n }\r\n \r\n }\r\n if(flag<=2)\r\n {\r\n if(flag==0)\r\n {\r\n printf(\"0\");\r\n }\r\n else\r\n {\r\n printf(\"1\");\r\n }\r\n }\r\n else\r\n {\r\n printf(\"2\");\r\n }\r\n printf(\"\\n\");\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "4f8d1e3a977d705527132bd50efb33ab", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "8f60c75086832c46104693e7f57b6c26", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5704622322435174, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t,T,c[4],ans;\r\n\r\n scanf(\"%d\",&T)\r\n for(int i=1;i<=T;t++){\r\n scanf(\"%d %d %d %d\",c[0],c[1],c[2],c[3]);\r\n for(int j=0;j<4;j++){\r\n if(c[j]==0){\r\n ans++;\r\n }\r\n }\r\n }\r\n\r\nreturn 0;\r\n}\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n ", "lang": "GNU C11", "bug_code_uid": "d5b955ab4033d7fd1d6158b567f1bc31", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f8c0b9df608180f42ef52f16f3a948ff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8973607038123167, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\r\nint main()\r\n{\r\n int T,c[4],ans=0;\r\n\r\n scanf(\"%d\",&T);\r\n for(int i=1;i<=T;i++){\r\n scanf(\"%d %d %d %d\",c[0],c[1],c[2],c[3]);\r\n for(int j=0;j<4;j++){\r\n if(c[j]==0){\r\n ans++;\r\n }\r\n \r\n }\r\n if(ans==4) printf(\"0\\n\");\r\n \r\n else if(ans==3) printf(\"1\\n\");\r\n else if(ans==2) printf(\"1\\n\");\r\n else if(ans==1) printf(\"1\\n\"); \r\n else printf(\"2\\n\");\r\n }\r\n\r\nreturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "618b927f2720e0f0295516317ccd43f4", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f8c0b9df608180f42ef52f16f3a948ff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9888268156424581, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n int T;\r\n int c[4];\r\n\r\n scanf(\"%d\",&T);\r\n for(int i=1;i<=T;i++){printf(\"t\");\r\n \tfor(int t=0;t<4;t++){\r\n scanf(\"%d\",&c[t]);\r\n \t\t} \r\n \t\tint ans = 0;\r\n for(int j=0;j<4;j++){\r\n if(c[j]==0){\r\n ans++;\r\n }\r\n \r\n }\r\n if(ans==4) printf(\"0\\n\");\r\n \r\n else if(ans==3) printf(\"1\\n\");\r\n else if(ans==2) printf(\"1\\n\");\r\n else if(ans==1) printf(\"1\\n\"); \r\n else printf(\"2\\n\");\r\n }\r\n\r\nreturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "2d11cb3c0ec7f1bad030f2173a5dceb6", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f8c0b9df608180f42ef52f16f3a948ff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9934762348555451, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main()\r\n{\r\n int Tcase;\r\n int c[4];\r\n\r\n scanf(\"%d\",&T);\r\n for(int i=1;i<=Tcase;i++){\r\n \tfor(int t=0;t<4;t++){\r\n scanf(\"%d\",&c[t]);\r\n \t\t} \r\n \t\tint ans = 0;\r\n for(int j=0;j<4;j++){\r\n if(c[j]==0){\r\n ans++;\r\n }\r\n \r\n }\r\n if(ans==4) printf(\"0\\n\");\r\n \r\n else if(ans==3) printf(\"1\\n\");\r\n else if(ans==2) printf(\"1\\n\");\r\n else if(ans==1) printf(\"1\\n\"); \r\n else printf(\"2\\n\");\r\n }\r\n\r\nreturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "eef34aa2af8e4f48757acd7ce300fae3", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f8c0b9df608180f42ef52f16f3a948ff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9982547993019197, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main(){\r\n int i,test,sum;\r\n int a[2]={0},b[2]={0};\r\n scanf(\"%d\",&test);\r\n while(test--){\r\n sum=0;\r\n for(i=0;i<2;i++){\r\n scanf(\"%d\",&a[i]);\r\n }\r\n for(i=0;i<2;i++){\r\n scanf(\"%d\",&b[i]);\r\n }\r\n for(i=0;i<2;i++){\r\n sum=a[i]+b[i]+sum;\r\n }\r\n\t\tprintf(\"%d\\t\",sum);\r\n if(sum==0)\r\n printf(\"0\\n\");\r\n else if(sum>0&&sum<4)\r\n printf(\"1\\n\");\r\n else if(sum==4)\r\n printf(\"2\\n\"); \r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "71105ee0438613d252dadc007793b6a9", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "72aea56789386bbc4182b040753d2331", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4367816091954023, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tint a,b,c,d,n,t=1;\r\n\tscanf(\"%d\",&n);\r\n\twhile(t<=n){\r\n\t\tscanf(\"%d %d %d %d\",&a,&b,&c,&d);\r\n\t\tint e=0,f=0;\r\n\t\tif(b!=0){e+=1;}\r\n\t\tif(d!=0){f+=1;}\r\n\t\tprintf(\"%d\\n\",e+f);\r\n\t\tt+=1; \r\n\t}\r\n\treturn 0;\r\n}\n//2022\u5e7410\u670824\u65e5 16\u65f606\u520618.455\u79d2", "lang": "GNU C11", "bug_code_uid": "3f04976a048f606a0bf8785285439b96", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "4a68527add803f8c502400b4730d0a7a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9596928982725528, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tint a,b,c,d,t,i=1;\r\n\tscanf(\"%d\",&t);\r\n\twhile(i<=t){\r\n\t\tscanf(\"%d %d %d %d\",&a,&b,&c,&d);\r\n\t\tif(a+b+c+d==1){\r\n\t\t\tprintf(\"1\\n\");\r\n\t\t} else{\r\n\t\t\tprintf(\"%d\\n\",(a+b+c+d)/2);\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}\n//2022\u5e7410\u670824\u65e5 16\u65f636\u520643.905\u79d2", "lang": "GNU C11", "bug_code_uid": "67bbb51d8ac8b832f8efe9b270ed9111", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "4a68527add803f8c502400b4730d0a7a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4764705882352941, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--){\r\n int a,b,c,d,e;\r\n scanf(\"%d%d\", &a,&b);\r\n scanf(\"%d%d\", &c,&d);\r\n e=a+b+c+d;\r\n if(e==1){\r\n printf(\"1\\n\");\r\n }\r\n else if(e==2){\r\n printf(\"1\\n\");\r\n }\r\n else if(e==3){\r\n printf(\"2\\n\");\r\n }\r\n else{\r\n printf(\"%d\\n\", e/2);\r\n }\r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "351411e73a46e658236ff3f51b5f8237", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "4d41280d89a2cfb6ae156f2ce639fcdd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9951807228915662, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\r\n\r\n#include \r\n\r\n\r\nint main()\r\n\r\n{\r\n\r\nint i , j , J , a , b , c , m, p;\r\nint T[2][2];\r\nscanf(\"%d\",&m);\r\nfor(i=1;i<=m;i++){\r\n p=0;\r\n for(J=0;J<2;J++){\r\n scanf(\"%d %d\",&T[J][0],&T[J][1]);\r\n if(T[J][0]==1)\r\n p++;\r\n if(T[J][1])\r\n p++;\r\n }\r\n if(p==1)\r\n printf(\"1\");\r\n else\r\n printf(\"%d\",p/2);\r\n}\r\nreturn 0;\r\n\r\n}\r\n\r\n ", "lang": "GNU C11", "bug_code_uid": "c481df72c056649f92279ab98799b600", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "12cad5747017f75ad365923f3fb7c35d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8023952095808383, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main()\r\n{\r\n int a,b,c,d,p,q,t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n scanf(\"%d %d\\n\",&a,&b);\r\n scanf(\"%d %d\\n\",&c,&d);\r\n if(a+b+c+d==4){\r\n printf(\"2\\n\");\r\n }\r\n else if(a+b+c+d==0){\r\n printf(\"1\\n\");\r\n }\r\n else{\r\n printf(\"0\\n\");\r\n }\r\n }\r\n return 0; \r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "c26b229e0ed619e4d7255a63496a0dd2", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f57357f917584dac16984ebd3b578e8b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7976011994002998, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main()\r\n{\r\n int a,b,c,d,p,q,t;\r\n scanf(\"%d\",&t)\r\n while(t--){\r\n scanf(\"%d %d\\n\",&a,&b);\r\n scanf(\"%d %d\\n\",&c,&d);\r\n if(a+b+c+d==2){\r\n printf(\"2\\n\");\r\n }\r\n else if(a+b+c+d==0){\r\n printf(\"1\\n\");\r\n }\r\n else{\r\n printf(\"0\\n\");\r\n }\r\n }\r\n return 0; \r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "8bda4532365fbecf13439a552378b432", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f57357f917584dac16984ebd3b578e8b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9736842105263158, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t; scanf(\"%d\",&t);\r\n int a[2][2];\r\n while(t--) {\r\n for(int i=0;i<2;i++) \r\n for(int j=0;j<2;j++) {scanf(\"%d\",&a[i][j]); if(a[i][j]) c++;}\r\n \r\n if(c==0) printf(\"0\\n\");\r\n else if(c==4) printf(\"2\\n\");\r\n else printf(\"1\\n\");\r\n }\r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "ccf22a648bc0c68f8a1a0c335c6a48aa", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "16c1542d17f7a3209aeb376bef925ad9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7002518891687658, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t,i,a[10],j;\r\n\r\n scanf(\"%d\",&t);\r\n for(i=1;i<=t;i++)\r\n {\r\n int count=0;\r\n for(j=0;j<4;j++)\r\n {\r\n scanf(\"%d\",&a[j]);\r\n if(a[j]==1)\r\n count++;\r\n }\r\n printf(\"%d\\n\",count/2);\r\n\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "a3973ac61a58cf7f309630180233f650", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "e84774e99415f0db717a245a2039cbbf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9936170212765958, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \r\n \r\nint main()\r\n{\r\n int t,i,j,grass;\r\n scanf(\"%d\",&t);\r\n int field[2][2];\r\n while (t!=0)\r\n {\r\n grass = 0;\r\n for (i=0;i<2;i++)\r\n {\r\n for (j=0;j<2;j++)\r\n {\r\n scanf(\"%d\",&field[i][j]);\r\n if (field[i][j]==1)\r\n grass++;\r\n }\r\n }\r\n t--;\r\n if (grass==0)\r\n printf(\"%d\",0);\r\n else if (grass ==4)\r\n printf(\"%d\",2);\r\n else \r\n printf(\"%d\",1);\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "16e40806ab35f2c3eb047db0264ad27c", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "5f2742e26af64e36dedae903f4d79a0c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.481421647819063, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n,row,colum,sum=0,i;\r\nscanf(\"%d\",&n);\r\n\r\nwhile(n--)\r\n{\r\n for(row=1;row<=2;row++)\r\n {\r\n for(colum=1;colum<=2;colum++)\r\n {\r\n scanf(\"%d\",&i);\r\n sum=sum+i;\r\n }\r\n }\r\nif(sum==0)\r\n printf(\"0\\n\");\r\nif(sum==1||sum==2)\r\n printf(\"1\\n\");\r\nif(sum==3||sum==4)\r\n printf(\"2\\n\");\r\n}\r\nreturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "575647e13b7e1887c56d929d3a7b7a76", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "9dadf2741656ebf7696ecc89c1001ce1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5689981096408318, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \r\n\r\n\r\nint main(){\r\n\tint tc;\r\n\tscanf(\"%d\", &tc);\r\n\t\r\n\tfor(int i = 0; i < tc; i++){\r\n\t\tint x1, x2, y1, y2;\r\n\t\tscanf(\"%d %d\", &x1, &x2);\r\n\t\tscanf(\"%d %d\", &y1, &y2);\r\n\t\t\r\n\t\t// X1 X2\r\n\t\t// Y1 Y2\r\n\t\t\r\n\t\tint sum = x1 + x2 + y1 + y2;\r\n\t\t\r\n\t\tif(sum == 0){\r\n\t\t\tputs(\"0\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsum -= 2;\r\n\t\t\tif(sum <= 0){\r\n\t\t\t\tputs(\"1\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsum -= 2;\r\n\t\t\t\tputs(\"2\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\treturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "d213ccab927fbcc267bcca4fdf138ca4", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "b2753645d5b9f916fb388f0f5ff9af44", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9433106575963719, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nint main(){\r\nint t;\r\nscanf(\"%d\",&t);\r\nfor(int i=0;i\r\nint main(){\r\nint t;\r\nscanf(\"%d\",&t);\r\nfor(int i=0;i\r\n\r\nint mai(){\r\n\tint x; \r\n\tint ctr= 0 ; \r\n\tfor(int i = 0 ; i<4 ; i++){\r\n\t\tscanf(\"%d\" , &x); \r\n\t\tif(x==1){\r\n\t\t\tctr++; \r\n\t\t}\r\n\t}\r\n\tif(ctr ==0){\r\n\t\tprintf(\"0\");\r\n\t\treturn \r\n\t}\r\n\tif(ctr == 1 ||ctr==2 || ctr ==3){\r\n\t\tprintf(\"1\"); \r\n\t\treturn ; \r\n\t}\r\n\tif (ctr ==4){\r\n\t\tprintf(\"2\"); \r\n\t\treturn ; \r\n\r\n\t}\r\n\treturn 0 ; \r\n}\r\n\r\nint main(){\r\n\tint t ; \r\n\tscanf(\"%d\" , &t);\r\n\tfor(int i = 0 ; i\r\n\r\nvoid mai(){\r\n\tint x; \r\n\tint ctr= 0 ; \r\n\tfor(int i = 0 ; i<4 ; i++){\r\n\t\tscanf(\"%d\" , &x); \r\n\t\tif(x==1){\r\n\t\t\tctr++; \r\n\t\t}\r\n\t}\r\n\tif(ctr ==0){\r\n\t\tprintf(\"0\");\r\n\t\treturn ; \r\n\t}\r\n\tif(ctr == 1 ||ctr==2 || ctr ==3){\r\n\t\tprintf(\"1\"); \r\n\t\treturn ; \r\n\t}\r\n\tif (ctr ==4){\r\n\t\tprintf(\"2\"); \r\n\t\treturn ; \r\n\r\n\t}\r\n\treturn ; \r\n}\r\n\r\nint main(){\r\n\tint t ; \r\n\tscanf(\"%d\" , &t);\r\n\tfor(int i = 0 ; i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int s=0,s1=0,c=0,x1,x2,y1,y2;\r\n scanf(\"%d%d\",&x1,&y1);\r\n if(y1==1)c++;\r\n scanf(\"%d%d\",&x2,&y2);\r\n if(y2==1)c++;\r\n printf(\"%d\\n\",c);\r\n\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "861c1bcce5d2f523c18396125c78451f", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "6ad8f8b5e813d6b1a3c6dec571941eba", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7178082191780822, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include \r\n#include \r\n\r\nint main()\r\n\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n int a[3][3], i, j;\r\n for(i=0; i<2; i++)\r\n {\r\n for(j=0; j<2; j++)\r\n {\r\n scanf(\"%d\", &a[i][j]);\r\n }\r\n }\r\n int move=0;\r\n if((a[0][0]+a[0][1]+a[1][0]==1) || (a[0][0]+a[0][1]+a[1][0]==2) || (a[0][0]+a[0][1]+a[1][0]==3))\r\n move++;\r\n if(a[1][1]==1)\r\n move++;\r\n printf(\"%d\\n\", move);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "96fa7eeecd5d77bd1592ed2eafe84b77", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "4acea74ab4b52e4bb8d62726f6d2257b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7814726840855107, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "int main(){\r\n int t,x,y;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\n\r\nvoid main(){\r\n unsigned short t;\r\n scanf(\"%hu\",&t);\r\n while(t--){\r\n unsigned register short count=0;\r\n for(unsigned register short i=0; i<4; i++){\r\n unsigned short n;\r\n scanf(\"%hu\",&n);\r\n count+=n;\r\n }\r\n printf(\"%hu\\n\",(!count)?0:(count>2)?2:1);\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "069a118e5af7f5863e494f25db799527", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "c7b36f522fb3ffa5fb80ffbebde03a4f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6483516483516484, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \r\nint main(){\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--){\r\n int x[4];\r\n for(int i = 0; i < 4; i++){\r\n scanf(\"%d\", &x[i]);\r\n }\r\n int sum = x[0] + x[2];\r\n printf(\"%d\\n\", sum);\r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "68000291acd8a4a06ec8900c70364d02", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "83c45c78cece54c92eb733bc037d7435", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9909638554216867, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "\n #include \nint main()\n{\n int t;\n scanf(\"%d\",&t);\n for(int i=0;i\r\n\r\nint main(){\r\n\tint t;\r\n\tint x[20][4];\r\n\tscanf(\"%d\",&t);\r\n\tfor (int i=0;i\r\n\r\nint main(){\r\n\tint t;\r\n\tint x[20][4];\r\n\tscanf(\"%d\",&t);\r\n\tfor (int i=0;i\r\n#include \r\nint main()\r\n{\r\nint t;\r\nscanf(\"%d\", &t);\r\nfor(int i=0;i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int ara[2][2];\r\n for(int i=0; i<2; i++)\r\n {\r\n for(int j=0; j<2; j++)\r\n {\r\n scanf(\"%d\",&ara[i][j]);\r\n }\r\n }\r\n int a=0,b=0;\r\n if(ara[0][1]==1)\r\n {\r\n a=1;\r\n }\r\n if(ara[1][0]==1 || ara[1][1]==1)\r\n {\r\n b=1;\r\n }\r\n printf(\"%d\\n\",a+b);\r\n\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "7dbdfa2fc1989b77015c3ba409695d2d", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "a0d75fdcbbd6dc5f9e566b26a34c1432", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9764350453172206, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n\ntypedef struct{\n int a;\n int b;\n int c;\n int d;\n int e;\n}list;\n\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n\n list* s=NULL;\n s=(list*)malloc(sizeof(list)*n);\n\n int i=0;\n for(;;){\n if(i>=n){\n break;\n }\n scanf(\"%d\",&s[i].a);\n scanf(\"%d\",&s[i].b);\n scanf(\"%d\",&s[i].c);\n scanf(\"%d\",&s[i].d);\n ++i;\n }\n\n int num;\n i=0;\n for(;;){\n if(i>=n){\n break;\n }\n num=0;\n if(s[i].a==1){\n ++num;\n }\n if(s[i].b==1){\n ++num;\n }\n if(s[i].c==1){\n ++num;\n }\n if(s[i].d==1){\n ++num;\n }\n s[i].e=num/2;\n ++i;\n }\n\n i=0;\n for(;;){\n if(i>=n){\n break;\n }\n printf(\"%d\",s[i].e);\n if(i!=n-1){\n printf(\"\\n\");\n }\n ++i;\n }\n\n free(s);\n}\n", "lang": "GNU C11", "bug_code_uid": "b9a1c4cf0d5bb89ca75207cbc905dac1", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "21901c437d217dfc28a14885f0eb8247", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9952380952380953, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "// Online C compiler to run C program online\r\n#include \r\n\r\nint main() {\r\n // Write C code here\r\n int t;\r\n scanf(\"%d\",&t);\r\n while (t--){\r\n int arr[4];\r\n int count=0;\r\n int oneCount=0;\r\n scanf(\"%d %d\",&arr[0],&arr[1]);\r\n scanf(\"%d %d\",&arr[2],&arr[3]);\r\n for(int i=0;i<4;i++){\r\n if (arr[i]==1){\r\n oneCount+=1;\r\n }\r\n }\r\n if (oneCount==4){\r\n printf(\"%d\",2);\r\n }\r\n else if (oneCount==0) printf(\"%d\",0);\r\n else{\r\n printf(\"%d\",1);\r\n }\r\n \r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "6f853e400e3839afd14c414b00d16d0c", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "8f72aa79f3c35667cd84a8141518d395", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9968404423380727, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "// Online C compiler to run C program online\r\n#include \r\n\r\nint main() {\r\n // Write C code here\r\n int t;\r\n scanf(\"%d\",&t);\r\n while (t--){\r\n int arr[4];\r\n int count=0;\r\n int oneCount=0;\r\n scanf(\"%d %d\",&arr[0],&arr[1]);\r\n scanf(\"%d %d\",&arr[2],&arr[3]);\r\n for(int i=0;i<4;i++){\r\n if (arr[i]==1){\r\n oneCount+=1;\r\n }\r\n }\r\n if (oneCount==4){\r\n printf(\"%d\",2\\n);\r\n }\r\n else if (oneCount==0) printf(\"%d\\n\",0);\r\n else{\r\n printf(\"%d\\n\",1);\r\n }\r\n \r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "b38ad7708091a3e2033e8083d0198ef1", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "8f72aa79f3c35667cd84a8141518d395", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.983142279163857, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t;\r\n int grass[2][2];\r\n int zeroes=0;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\n\r\nint main()\r\n{\r\n int t;\r\n int grass[2][2];\r\n int zeroes=0;\r\n scanf(\"%d\",&t);\r\n for(int i=0;i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int n;\r\n cnt=0;\r\n for(i=0;i<4;i++){\r\n scanf(\"%d\",&n);\r\n if(n==1)\r\n cnt++;\r\n }\r\n if(cnt==0)\r\n printf(\"%d\",0);\r\n else if(cnt!=4)\r\n printf(\"%d\",1);\r\n else\r\n printf(\"%d\",2);\r\n }\r\n return 0;\r\n }\r\n", "lang": "GNU C11", "bug_code_uid": "77c5fbf4bcc03249bcb401c367cd9240", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "bd3e347162e11f3e80683896e9f5220a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9925558312655087, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int n,cnt,i;\r\n cnt=0;\r\n for(i=0;i<4;i++){\r\n scanf(\"%d\",&n);\r\n if(n==1)\r\n cnt++;\r\n }\r\n if(cnt==0)\r\n printf(\"%d\",0);\r\n else if(cnt!=4)\r\n printf(\"%d\",1);\r\n else\r\n printf(\"%d\",2);\r\n }\r\n return 0;\r\n }", "lang": "GNU C11", "bug_code_uid": "68379c85cbec406e73e1f5c7b74276c0", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "bd3e347162e11f3e80683896e9f5220a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9590163934426229, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int i,j,sum=0,min;\r\n int a[2][2];\r\n for(i=0;i<2;i++){\r\n for(j=0;j<2;j++){\r\n scanf(\"%d\",&a[i][j]);\r\n sum += a[i][j];\r\n }\r\n }\r\n if(sum==0){\r\n min = 0;\r\n }\r\n else if(sum==4){\r\n min = 2;\r\n }\r\n else{\r\n min = 1;\r\n }\r\n printf(\"%d\",min);\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "e54624e07a20c7c439f31f970b0f2fff", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "06c6ee90c5fbb19da929bacd00645061", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9908883826879271, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "// a\r\n\r\n#include\r\nint main()\r\n{\r\n\tint t;\r\n\tscanf(\"%d\",&t);\r\n\twhile(t--)\r\n{\r\n\tint field[2][2] = {{ 0 , 0 } , { 0 , 0 }};\r\n\tint line = 0;\r\n\tfor(int i = 0 ; i < 2 ; ++i)\r\n\t{\r\n\t\tscanf(\"%d %d\",&field[i][0],&field[i][1]);\r\n\t\tline += field[i][0]+field[i][1];\r\n\t\tprintf(\"%d %d\", field[i][0],field[i][1]);\r\n\t}\r\n\tif(line == 0 )\r\n\t\tprintf(\"%d\", 0 );\r\n\telse if(line == 4 )\r\n\t\tprintf(\"%d\", 2 );\r\n\telse\r\n\t\tprintf(\"%d\", 1);\r\n}\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "7bbfe94ce8d19e892f75bce4ba3939ae", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "ad0cb11ab1e3dc27a0f5be61e3b57d6d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7315068493150685, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t,a,b,c,d,f=0;\r\n scanf(\"%d\",&t);\r\n for(int i=0; i\r\nint main(){\r\n\tint w;\r\n\tscanf(\"%d\",&w);\r\n\twhile(w--){\r\n\t\tint q[2][2];\r\n\t\tint i,j,k=0,temp=0;\r\n\t\tfor(i=0;i<2;i++){\r\n\t\t\tfor(j=0;j<2;j++){\r\n\t\t\t\tscanf(\"%d\",&q[i][j]);\r\n\t\t\t\tk+=q[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(k==0)\r\n\t\ttemp=0;\r\n\t\telse if(k==1||k==2)\r\n\t\ttemp=1;\r\n\t\telse temp=2;\r\n\t\tprintf(\"%d\\n\",temp);\r\n\t}\r\n\t\r\n\t\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "9596660d526fd85956eea609f794b023", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "f1e93433388fa9b0e690e542e04e80eb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9906542056074766, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t, a[2][2], x=0;\r\n\r\n scanf(\"%d\", &t);\r\n\r\n while(t--){\r\n\r\n for(int i=0; i<2; i++){\r\n\r\n for(int j=0; j<2; j++){\r\n\r\n scanf(\"%d\", &a[i][j]);\r\n\r\n x+=a[i][j];\r\n\r\n }\r\n\r\n }\r\n\r\n if(x==0){\r\n\r\n printf(\"0\\n\");\r\n }\r\n else if(x>0 && x<2){\r\n\r\n printf(\"1\\n\");\r\n }\r\n else if(x>=2 && x%2==0){\r\n\r\n printf(\"%d\\n\", x/2);\r\n }\r\n\r\n x=0;\r\n\r\n }\r\n\r\n return 0 ;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "83f8369083aa3a31c5b7660e455850c3", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "246964aa48e765bf484bbed534881170", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7804878048780488, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\r\n\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n for(int z=0;z\r\n\r\nint main()\r\n{\r\n\r\n int t;\r\n\r\n int c = 0;\r\n scanf(\"%d\", &t);\r\n while (t)\r\n {\r\n c = 0;\r\n int tt;\r\n for (int i = 0; i < 4; i++)\r\n scanf(\"%d\", &tt);\r\n if (tt)\r\n {\r\n c += 1;\r\n };\r\n if (c == 4)\r\n {\r\n printf(\"%d\", 2);\r\n }\r\n else if (c == 0)\r\n {\r\n printf(\"%d\", 0);\r\n }\r\n else\r\n {\r\n printf(\"%d\", 1);\r\n }\r\n t--;\r\n }\r\n\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "8431f771d18bc133993991f69cb45e40", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "73ba4a1e1436da4b0836bf754e542c7f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9975728155339806, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t, a[4], i, j, sum=0;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n for(i=0; i<4; i++)\r\n {\r\n scanf(\"%d\", &a[i]);\r\n sum+=a[i];\r\n }\r\n if(sum<1)\r\n printf(\"0\\n\");\r\n else if(sum>0 && sum<3)\r\n printf(\"1\\n\");\r\n else\r\n printf(\"2\\n\");\r\n sum=0;\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "9071e4db22cdb3a43daf99458828e0a5", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "ad1cc03213c9278ea5a9fd4c00001570", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9765432098765432, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n#include \r\n\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n int count = 0;\r\n while (t > 0)\r\n {\r\n int A[3];\r\n int B[3];\r\n for (int i = 0; i < 2; i++)\r\n {\r\n int x;\r\n scanf(\"%d\", &x);\r\n A[i] = x;\r\n if (A[i] == 1)\r\n {\r\n count = count + 1;\r\n }\r\n }\r\n for (int j = 0; j < 2; j++)\r\n {\r\n int x;\r\n scanf(\"%d\", &x);\r\n B[j] = x;\r\n if (B[j] == 1)\r\n {\r\n count = count + 1;\r\n }\r\n }\r\n if (count == 0)\r\n {\r\n printf(\"0\\n\");\r\n }\r\n else if (count == 1)\r\n {\r\n printf(\"1\\n\");\r\n }\r\n else if (count == 2)\r\n {\r\n printf(\"1\\n\");\r\n }\r\n else if (count == 3)\r\n {\r\n printf(\"1\\n\");\r\n }\r\n else\r\n {\r\n printf(\"2\\n\");\r\n }\r\n t = t - 1;\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "8629dd8d73dd632c89290f9adbd1fdfc", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "2ab4583e8a85fc78519a455ad3ad722b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9296826384567517, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "/* */\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\ntypedef int TYPE;\r\ntypedef unsigned char UCHAR;\r\n\r\n/* Translator is a function that enters numbers from the stack into the array */\r\nvoid GetNumbersInArrayFromStr( TYPE *res, char *S, int N )\r\n{\r\n char *Buf;\r\n int i = 0, l = 0, j, ofs = 0;\r\n\r\n for (i = 0; i < N; i++)\r\n {\r\n Buf = malloc(sizeof(char) * 100);\r\n\r\n l = 0;\r\n j = ofs;\r\n while (S[j] != ' ' && S[j] != 0)\r\n {\r\n Buf[j - ofs] = S[j];\r\n l++;\r\n j++;\r\n }\r\n Buf[l] = 0;\r\n res[i] = atoi(Buf);\r\n ofs += (l + 1);\r\n\r\n free(Buf);\r\n }\r\n} /* End of 'GetNumbersInArrayFromStr' function */\r\n\r\n/* Get string function */\r\nvoid GetStr( char *str, int len )\r\n{\r\n int i = 0;\r\n char ch;\r\n\r\n while ((ch = getchar()) != '\\n' )\r\n if (str != NULL && i < len - 1)\r\n str[i++] = ch;\r\n if (str != NULL && i < len - 1)\r\n str[i] = 0;\r\n} /* End of 'GetStr' function */\r\n\r\nint main( void )\r\n{\r\n int T, i, A[2][2], res = 0, x, y, ed = 0;\r\n\r\n scanf(\"%i\", &T);\r\n for (i = 0; i < T; i++)\r\n {\r\n scanf(\"%i %i\", &A[0][0], &A[0][1]);\r\n scanf(\"%i %i\", &A[1][0], &A[1][1]);\r\n\r\n ed = 0;\r\n for (y = 0; y < 2; y++)\r\n for (x = 0; x < 2; x++)\r\n if (A[y][x])\r\n ed++;\r\n \r\n if (ed == 1)\r\n res = 1;\r\n else if (ed == 3)\r\n res = 1;\r\n else if (ed == 2)\r\n {\r\n if (A[0][0] == A[1][1])\r\n res = 1;\r\n else\r\n res = 1;\r\n }\r\n else if (ed == 4)\r\n res = 2;\r\n\r\n printf(\"%i\\n\", res);\r\n\r\n }\r\n\r\n /** /\r\n getchar();\r\n getchar();\r\n /**/\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "e78decba295b8392b1a0617046d6ad08", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "fe075d2da0669032a29d3bf49a4ac29e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9929078014184397, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint t,a,b,c,d;\r\nint main(){\r\n\tscanf(\"%d\",&t);\r\n\twhile(t--){\r\n\t\tscanf(\"%d%d%d%d\",&a,&b,&c,&d);\r\n\t\tif((a&d)||(b&c))printf(\"2\\n\");\r\n\t\telse if(a|b|c|d)printf(\"1\\n\");\r\n\t\telse printf(\"0\\n\");\r\n\t}\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "d2b4292ea7f2b832c06d4cd072c74643", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "3d68fad2c6c688f3bb2541fec6ec57f1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9938650306748467, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int m[1000],n[1000], i, s=0;\r\n for(i=0;i<2;i++)\r\n {\r\n scanf(\"%d %d\",&n[i],&m[i]);\r\n s=s+n[i];\r\n s=s+m[i];\r\n }\r\n if(s==0)\r\n printf(\"0\\n\");\r\n else if(s==4)\r\n printf(\"2\\n\");\r\n else if\r\n printf(\"1\\n\");\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "336a6463ac76c2edd051e748dbc898d4", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "9c7789e82a8099fb21c20bc8d5997f57", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9993169398907104, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\nvoid swap(int* a, int* b)\r\n{\r\n int temp = *a;*a = *b; *b = temp;\r\n}\r\n \r\nvoid heapify(int arr[], int N, int i){\r\n int largest = i;\r\n \r\n int left = 2 * i + 1;\r\n int right = 2 * i + 2;\r\n if (left < N && arr[left] > arr[largest])\r\n largest = left;\r\n if (right < N && arr[right] > arr[largest])\r\n \r\n largest = right;\r\n if (largest != i) {\r\n \r\n swap(&arr[i], &arr[largest]);\r\n heapify(arr, N, largest);\r\n }\r\n}\r\nvoid heapSort(int arr[], int N)\r\n{\r\n for (int i = N / 2 - 1; i >= 0; i--)\r\n \r\n heapify(arr, N, i);\r\n for (int i = N - 1; i >= 0; i--) {\r\n swap(&arr[0], &arr[i]);\r\n heapify(arr, i, 0);\r\n }\r\n}\r\n\r\nvoid fill(int a[],int n){\r\nfor(int i=0;im){m=a[i];\r\n\t}\r\n}return m;\r\n}\r\nint main(){\r\nint t,n,a,b,c,d;\r\nscanf(\"%d\",&t);\r\nwhile(t--){\r\nscanf(\"%d%d%d%d\",&a,&b,&c,&d);int count=(a==1)+(b==1)+(c==1)+(d==1);\r\nif(count>1&&count<4){puts(\"1\");\r\n}\r\nelse if(count==4){puts(\"2\");\r\n}\r\nelse{puts(\"0\");\r\n}\r\n}\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "b699d3d90297029a1472e5957f2b40f0", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "1ab83e4ee0c2c6dc4edb77d25ede0530", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9227467811158798, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\r\n\r\nint main(){\r\n int t,a[4],i,x;\r\n \r\n scanf(\"%d\",&t);\r\n \r\n while(t--){\r\n x=0;\r\n for(i=0;i<4;i++){\r\n scanf(\"%d\",&a[i]);\r\n if(a[i]==1){\r\n x++;\r\n }\r\n }\r\n if(x==0){\r\n printf(\"0\\n\");\r\n }\r\n if(x==1){\r\n printf(\"1\\n\");\r\n }\r\n if(x==2){\r\n printf(\"1\\n\");\r\n }\r\n if(x>=3){\r\n printf(\"2\\n\");\r\n }\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "b1d45ee34a90ac87da587344c72ce619", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "6445985f8b86db7b83f1e94bc279cd3b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9340463458110517, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \r\n#include\r\nint main(void) {\r\n\t// your code goes here\r\n \r\n int t;\r\n scanf(\"%d\",&t);\r\n for(int k=0;k\r\n\r\nint main(void){\r\n int t; scanf(\"%d\",&t);\r\n for(int i = 0; i < t; i++){\r\n //Get the input\r\n int field[4]; int count = 0;\r\n for(int j = 0 ; j < 4; j++){\r\n scanf(\"%d\",field[j]);\r\n //count the no. of 1's\r\n if(field[j] == 1){\r\n count++;\r\n }\r\n }\r\n if(count == 0){\r\n printf(\"0\\n\");\r\n }\r\n else if(count < 4){\r\n printf(\"1\\n\");\r\n }\r\n else{\r\n printf(\"2\\n\");\r\n }\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "793d3abd9480d35c2d7ad00ecd1669d2", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "98eb65d300c279d5957f510700ef00dc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.29411764705882354, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t,i,j,k;\r\n scanf(\"%d\",&t);\r\n for(k=0;k\r\nint solution(){\r\n int mat[2][2];\r\n for (int i = 0; i < 2; i++)\r\n {\r\n for (int j = 0; j < 2; j++)\r\n {\r\n scanf(\"%d\",&mat[i][j]);\r\n }\r\n }\r\n int count = 0;\r\n for (int i = 0; i < 2; i++)\r\n {\r\n for (int j = 0; j < 2; j++)\r\n {\r\n if (mat[i][j]==1)\r\n {\r\n count++;\r\n }\r\n }\r\n }\r\n if (count==0)\r\n {\r\n printf(\"0\\n\");\r\n }\r\n else if (count==2 || count==3)\r\n {\r\n printf(\"1\\n\");\r\n }\r\n else\r\n printf(\"2\\n\");\r\n return 0;\r\n}\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n while (t--)\r\n {\r\n solution();\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "4449557590e3319ad3a166972499da4b", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "1ee2f0f8faad3796db15f870184b47e4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7966321243523317, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\r\n\r\n\r\nint main()\r\n{\r\n int t,a[2][2],a_req[t],k,j,l;\r\n\r\n scanf(\"%d\",&t);\r\n\r\n\r\n for(l=0; l\r\nint main()\r\n{\r\n int n,o,z;\r\n scanf(\"%d\",&n);\r\n int a[2][2];\r\n for(int i=0;i\r\nint main( )\r\n{\r\n int t, i, j, k, ara[2][2];\r\n scanf(\"%d\", &t);\r\n for(i = 1; i <= t; i++)\r\n {\r\n int count = 0;\r\n for(j = 0; j < 2; j++)\r\n {\r\n for(k = 0; k < 2; k++)\r\n {\r\n scanf(\"%d\", &ara[i][j]);\r\n }\r\n }\r\n for(j = 0; j < 2; j++)\r\n {\r\n for(k = 0; k < 2; k++)\r\n {\r\n if(ara[i][j] == 1)\r\n count++;\r\n }\r\n }\r\n if(count == 0)\r\n printf(\"0\\n\");\r\n else if(count == 4)\r\n printf(\"2\\n\");\r\n else\r\n printf(\"1\\n\");\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "2551786ac7137a960292e3da0166c150", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "c9aa6ee73cbc3aeb106fb6789cc144c2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8383084577114428, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n int t, i = 0, x, y, r;\r\n\r\n scanf(\"%d\", &t);\r\n\r\n while(t--) {\r\n scanf(\"%d%d\", &x, &y);\r\n if(x == 0) i++;\r\n if(y == 0) i++;\r\n scanf(\"%d%d\", &X, &y);\r\n if(x == 0) i++;\r\n if(y == 0) i++;\r\n\r\n if(i == 0) r = 0;\r\n else if(i < 4) r = 1;\r\n else r = 2;\r\n\r\n printf(\"%d\\n\", r);\r\n }\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "601497fc52c80ef6c9085b7b553d0d07", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "717ee6a0398f1a25cd529dabc9f1a9e9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9782608695652174, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\r\n#define MAX 16\r\nint main()\r\n{\r\n\tint t, a[MAX][MAX], i,j, sum=0;\r\n\tscanf(\"%d\", &t);\r\n\twhile(t--)\r\n\t{\r\n\t\tfor(i=0; i<2; i++)\r\n\t\t{\r\n\t\t\tfor(j=0; j<2; j++)\r\n\t\t\t{\r\n\t\t\t\tscanf(\"%d\", &a[i][j]);\r\n\t\t\t\tif(a[i][j] == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(sum == 0)\r\n\t\t\tprintf(\"0\\n\");\r\n\t\telse if(sum>0 && sum <3)\r\n\t\t\tprintf(\"1\\n\");\r\n\t\telse if(sum>2)\r\n\t\t\tprintf(\"2\\n\");\r\n\t}\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "c7e7f4b57ab024f4d3476412c59bd311", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "2dcf90774c9e0eed38df1a690a538f0b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9137336093857833, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "#include \r\nint main()\r\n{\r\n int x,a[2][2],b[1000];\r\n scanf(\"%d\",&x);\r\n printf(\"\\n\");\r\n for(int z=1;z<=x;z++)\r\n {for (int i=0;i<2;i++)\r\n {for (int j=0;j<2;j++)\r\n {\r\n a[i][j]=0;\r\n }}\r\n \r\n for (int i=0;i<2;i++)\r\n {for (int j=0;j<2;j++)\r\n {\r\n scanf(\"%d\",&a[i][j]);\r\n }}\r\n if (a[1][1]+a[1][2]+a[2][2]+a[2][1]==4)\r\n b[z]=2;\r\n else if (a[1][1]+a[1][2]+a[2][2]+a[2][1]==0)\r\n b[z]=0;\r\n else b[z]=1;\r\n //for (int l=0;l<2;l++)\r\n //{printf(\"\\n\");\r\n for (int m=0;m<2;m++)\r\n {\r\n //printf(\"%d \",a[l][m]);\r\n }}\r\n }\r\n \r\n for (int k=0;k<=x;k++)\r\n printf(\"%d\\n\",b[k]);\r\n \r\n \r\n \r\n \r\n \r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "418a2354c191d0010bc4188a56d06b21", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "12ac072d85b568b8c1af80f33e344306", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4534005037783375, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int a,b,c,d;\r\n scanf(\"%d %d\",&a,&b);\r\n scanf(\"%d %d\",&c,&d);\r\n int e=((a+b)+(c+d))/2;\r\n printf(\"%d\\n\",e);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "74dc76b8861df4f83475181a67a7989e", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "378bd99f64ca0d71a336af4a366c7b58", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.48954489544895446, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \r\n\r\nint main() {\r\n int a,b,c,d,t,count;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n count = 0;\r\n scanf(\"%d %d %d %d\",&a,&b,&c,&d);\r\n if(a==1||d==1)\r\n count++;\r\n if(b==1||c==1)\r\n count++;\r\n\r\n\r\n printf(\"%d\\n\",count);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "c1987e34ead31dfdc9e5050b05134836", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "2aa19e301b0c51f2abb96b4fbfce4084", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.27689030883919064, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 19, "bug_source_code": "#include \r\nint main()\r\n{\r\n\tint t, i;\r\n\tscanf(\"%d\", &t);\r\n\twhile (t--)\r\n\t{\r\n\t\tint n, count = 0;\r\n\t\tfor (i = 0; i < 4; i++)\r\n\t\t{\r\n\t\t\tscanf(\"%d\", &n);\r\n\t\t\tif (n == 1)\r\n\t\t\t\tcount++;\r\n\t\t\r\n\t}\r\n\r\n\tif (count == 0)\r\n\t\tprintf(\"0\");\r\n\telse if (count != 4)\r\n\t\tprintf(\"1\");\r\n\telse\r\n\t\tprintf(\"2\");\r\n}\r\n}", "lang": "GNU C11", "bug_code_uid": "4e4453e979710c4fcab71293c6c16845", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "0697db6331fbb97c30c68d4187f986b4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7037861915367484, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main() {\n int t;\n scanf(\"%d\", &t);\n for(int i = 0;i < t;i++) {\n int a[2][2];\n int count = 0;\n for(int j = 0;j<2;j++) {\n for(int k = 0;k < 2;k++) {\n scanf(\"%d\", &a[j][k]);\n if (a[j][k]) {\n count++;\n }\n }\n }\n printf(\"%d\\n\", count/2);\n\n\n \n }\n}", "lang": "GNU C11", "bug_code_uid": "7fec061acdc045678a92f6a87a6f1565", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "c6d0f2eaf34d430a2f0fef27e104e0df", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8233532934131736, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n int n,c=0;\r\n for(int i=0;i<4;i++)\r\n {\r\n scanf(\"%d\",&n);\r\n if(n==1)\r\n c++;\r\n }\r\n printf(\"%d\\n\",c/2);\r\n }\r\n }\r\n ", "lang": "GNU C11", "bug_code_uid": "2870cfda5613ed47bb969da52e40ad32", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "e3d6d872360c36aafea26cb427fe813f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.989247311827957, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nint main (){\r\n int n;\r\n scanf(\"%d\",&n);\r\n for(int i=0;i\n#include \n\nint main(void)\n{\n int t,c=0;\n scanf(\"%d\",&t);\n while(t--)\n {\n c=0;\n for(int i=0;i<4;++i)\n {\n int a;\n scanf(\"%d\",&a);\n if(a==1)\n c++;\n }\n if(c==0)\n printf(\"%d\",c);\n else if((c%2)!=0)\n printf(\"1\");\n else\n printf(\"%d\",c/2);\n }\n}", "lang": "GNU C11", "bug_code_uid": "37ae0ae6bd1021188d00e399db29ea40", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "2e43b9c9a5287b229ce40b3ed3f66efb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6046511627906976, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "int main()\r\n{\r\n int i,t;\r\n scanf(\"%d\",&t);\r\n for(i=0;i\r\nint main()\r\n{\r\n int a[3][3],i,j,k,t,n,m;\r\n scanf(\"%d\",&t);\r\n for(k=0;k\r\n\r\nint main ()\r\n{\r\n int i,n,a,b,c,d,ans;\r\n scanf(\"%d\", &n);\r\n\r\n for (i=0;i\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n int m = 2, n = 2, sum;\r\n int a[m][n], r, c;\r\n for(r = 0; r < m; r++)\r\n {\r\n for(c = 0; c < n; c++)\r\n {\r\n scanf(\"%d\", &a[r][c]);\r\n }\r\n }\r\n sum = a[0][0] + a[0][1];\r\n printf(\"%d\\n\", sum);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "8c2a6165506d95fab17521a721f1c47a", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "214a3d07ab42484eec95107c79a959b2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9968152866242038, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\nint a[10],cnt,i,j,n;\r\nscanf(\"%d\",&n);\r\nfor(i=1;i<=t;i++)\r\n{\r\n\r\nfor(j=1,cnt=0;j<=4;j++)\r\n{\r\nscanf(\"%d\",&a[j]);\r\nif(a[j]==1)\r\n{\r\ncnt++;\r\n}\r\n}\r\nif(cnt==0)\r\n{\r\nprintf(\"0\\n\");\r\n}\r\nif(cnt==1 || cnt==2 || cnt==3)\r\n{\r\nprintf(\"1\\n\");\r\n}\r\nif(cnt==4)\r\n{\r\nprintf(\"2\\n\");\r\n}\r\n}\r\nreturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "807ef36f261a9d32c681bdfb7dec02e5", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "7feb460235a775e84d90ff617d9dffcf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8385093167701864, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include \r\nint main(int argc, char *argv[])\r\n{\r\n\tint a,b[2][2],i,j,k,c;\r\n\tscanf(\"%d\",&a); \r\n\tfor(i=0;i\r\nint main(){\r\n\tint n,a[2][2],cnt=0,f;\r\n\tscanf(\"%d\",&n);\r\n\tfor(int i=1;i<=n;i++){\r\n\t\tfor(int j=0;j<2;i++){\r\n\t\t\tfor(int k=0;k<2;k++){\r\n\t\t\t\tscanf(\"%d\",&a[j][k]);\r\n\t\t\t\tif(a[j][k]==1){\r\n\t\t\t\t\tcnt++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(cnt==0){\r\n\t\t\tf=0;\r\n\t\t}\r\n\t\telse if(cnt==1||cnt==2||cnt==3){\r\n\t\t\tf=1;\r\n\t\t}\r\n\t\telse if(cnt==4){\r\n\t\t\tf=2;\r\n\t\t}\r\n\t\tprintf(\"%d\\n\",f);\r\n\t}\r\n\treturn 0;\r\n} ", "lang": "GNU C11", "bug_code_uid": "95e3d369f74f0117ec2504f008535844", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "d1cbfd17ea4de8e18ed847f99d1504c3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9976415094339622, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n\tint t, a[3][3] = { 0 };\r\n\tscanf(\"%d\", &t);\r\n\twhile (t--)\r\n\t{\r\n\t\tint i, j;\r\n\t\tfor (i = 0; i <= 1; i++)\r\n\t\t\tfor (j = 0; j <= 1; j++)\r\n\t\t\t\tscanf(\"%d\", &a[i][j]);\r\n\t\tif (a[0][0] == 0 && a[0][1] == 0 && a[1][1] == 0 && a[1][1] == 0)\r\n\t\t\tprintf(\"0\\n\");\r\n\t\telse if (a[0][0] == 1 && a[1][1] == 1 && a[0][1] == 1 && a[1][0] == 1)\r\n\t\t\tprintf(\"2\\n\");\r\n\t\telse\r\n\t\t\tprintf(\"1\\n\");\r\n\t}\r\n\treturn 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "9897f85f8e6938d98918319819bd381b", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "a111d93f33bc0f814b994a7a632562cb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9727403156384505, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n int b = 0;\n scanf(\"%d\",&b);\n while(b > 0){\n b--;\n int x = 0,y = 0,z = 0,p = 0;\n int a[2][2];\n for(int i = 0;i< 2; i++)\n {\n for(int j = 0; j< 2;j++)\n {\n scanf(\"%d\", &a[i][j]);\n }\n }\n x = a[0][0] + a[0][1] + a[1][0];\n y = a[0][0] + a[1][1] + a[1][0];\n z = a[0][1] + a[0][0] + a[1][1];\n p = a[1][0] + a[1][1] + a[0][1];\n if(x == 0 && y==0 && z ==0 && p ==0)\n {\n printf(\"0\\n\");\n }\n int q = 0;\n while( x != 0 || y != 0 || z != 0 || p != 0)\n {\n if(x >= y && x >= z && x>=p && x != 0)\n {\n a[0][0] = 0;\n a[0][1] = 0;\n a[1][0] = 0;\n q++;\n }\n else if(y >= x && y >= z && y>=p && y != 0)\n {\n a[0][0] = 0;\n a[1][1] = 0;\n a[1][0] = 0;\n q++;\n }\n else if(z >= x && z >= y && z>=p && z != 0)\n {\n a[0][1] = 0;\n a[0][0] = 0;\n a[1][1] = 0;\n q++;\n }\n else if(p >= x && p >= y && p>=z && p != 0)\n {\n a[1][0] = 0;\n a[1][1] = 0;\n a[0][1] = 0;\n q++;\n }\n x = a[0][0] + a[0][1] + a[1][0];\n y = a[0][0] + a[1][1] + a[1][0];\n z = a[0][1] + a[0][0] + a[1][1];\n p = a[1][0] + a[1][1] + a[0][1];\n } \n printf(\"%d\\n\",q);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "4ded4a19f7c702e2042db4e4f3d40724", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "cf362452c0a97e2fb766dfa224599c96", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9894291754756871, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n\r\nint main(){\r\n int T;\r\n scanf(\"%d\",&T);\r\n while (T--)\r\n {\r\n int n,ans = 0;\r\n for (size_t i = 0; i < 4; i++)\r\n {\r\n scanf(\"%d\",&n);\r\n ans+=n;\r\n }\r\n if (ans==0)\r\n {\r\n printf(\"0\\n\");\r\n }\r\n else if (ans ==1 || ans == 2)\r\n {\r\n printf(\"1\\n\");\r\n }\r\n else\r\n {\r\n printf(\"2\\n\");\r\n }\r\n\r\n }\r\n \r\n}", "lang": "GNU C11", "bug_code_uid": "b720ab7006c2326970a7cbbfbbc606f8", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "e5343e37f4972a4948a79d82d05c2e7e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9782330345710627, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main()\n{\n\tint t,a[4],sum = 0;\n\tscanf(\"%i\", &t);\n\tfor (int j = 0; j < t; j++)\n\t{\n\t\tfor (int i = 0; i < 4; i++)\n\t\t{\n\t\t\tscanf(\"%i\", &a[i]);\n\t\t\tsum += a[i];\n\t\t}\n\t\tint moves;\n\t\tif (sum == 0)\n\t\t{\n\t\t\tmoves = 0;\n\t\t\tprintf(\"%i\\n\", moves);\n\t\t}\n\t\telse if(sum == 4)\n\t\t{\n\t\t\tmoves = 2;\n\t\t\tprintf(\"%i\\n\", moves);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmoves = 1;\n\t\t\tprintf(\"%i\\n\", moves);\n\t\t}\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "61b722ebb77f92e67ad99966775a13fa", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "fb45c7c32dc8becd4ee615d1ee261794", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6539196940726577, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "int main()\r\n{\r\n int t,a,b,c,d;\r\n scanf(\"%d\",&t);\r\n while (t--) {\r\n scanf(\"%d%d%d%d\",&a,&b,&c,&d);\r\n if (a&&c || b&&d) printf(\"2\\n\");\r\n else printf(\"%d\\n\", (a||b||c||d) ? 1 : 0);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "40d877ef3ec52f405ddad1e52ad161ab", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "7dce9bfa6ef393d814d868926b858401", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9918300653594772, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include \r\nvoid solve() {\r\n int a,b,c,d,count=0;\r\n scanf(\"%d %d\",&a,&b);\r\n scanf(\"%d %d\",&c,&d);\r\n if (a==1)\r\n count++;\r\n if (b==1)\r\n count++;\r\n if (c==1)\r\n count++;\r\n if (d==1)\r\n count++;\r\n if (count==0) {\r\n printf(\"0\");\r\n }\r\n else if (count==1) {\r\n printf(\"1\");\r\n }\r\n else if (count==2) {\r\n printf(\"1\");\r\n }\r\n else if (count==3) {\r\n printf(\"1\");\r\n }\r\n else {\r\n printf(\"2\");\r\n }\r\n}\r\nint main() {\r\n int t;\r\n scanf(\"%d\",&t);\r\n while (t--)\r\n solve();\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "59c570e9912bc4b98600511fac603a3e", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "56742c9b9ef716596f044565c45fcd7f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9171518137035378, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n#include \r\nint main(){\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--){\r\n int n, m, k;\r\n scanf(\"%d%d%d\", &n, &m, &k);\r\n if(m<2){\r\n if(k==0)printf(\"YES\\n\");\r\n else printf(\"NO\\n\");\r\n }\r\n else if(n<2){\r\n if(k==m/2)printf(\"YES\\n\");\r\n else printf(\"NO\\n\");\r\n }\r\n else if(n%2==1){\r\n if((k-(m/2))>=0 && (k-(m/2))%2==0){\r\n printf(\"YES\\n\");\r\n }\r\n else{\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n else{\r\n if(m%2==1){\r\n if(k*2>(m-1)*n){\r\n printf(\"NO\\n\");\r\n }\r\n else{\r\n if(k%2==0){\r\n printf(\"YES\\n\");\r\n }\r\n else{\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n }\r\n \r\n }\r\n }\r\n //system(\"pause\");\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "21074e74978e1efc6dd1355a051376fb", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "c124586c26543279d000c61dd075b8ec", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4580152671755725, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tint i,j,k,m,n,x,y,z,t;\r\n\tscanf(\"%d\",&t);\r\n\twhile(t--)\r\n\t{\r\n\t\tscanf(\"%d%d%d\",&n,&m,&k);\r\n\t\tif(n%2==1&&m%2==1)printf(\"NO\");\r\n\t\tif(n%2==0&&m%2==0)printf(\"YES\");\r\n\t\tif(n%2==1&&m%2==0)\r\n\t\t{\r\n\t\tx=m/2;\r\n\t\ty=k/x;\r\n\t\tif(k%x==0&&y%2==1)printf(\"YES\");\r\n\t\telse printf(\"NO\");\t\r\n\t\t}\r\n\t\tif(n%2==0&&m%2==1)\r\n\t\t{\r\n\t\tz=m*n/2-k;\r\n\t\tx=n/2;\r\n\t\ty=z/x;\r\n\t\tif(z%x==0&&y%2==1)\r\n\t\tprintf(\"YES\");\r\n\t\telse printf(\"NO\");\r\n\t\t}\r\n\t\tif(t)printf(\"\\n\");\r\n\t}\r\n\treturn 0;\r\n } ", "lang": "GNU C11", "bug_code_uid": "26a7b7d071bbdc05c20048b5d2af3928", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "a993c93ec9a8d1cb81a3f34e8ac0d78e", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9974683544303797, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {int n,m,k;\r\n scanf(\"%d %d %d\",&n,&m,&k);\r\n if(n%2 == 0 && m %2 == 0 && k&1)\r\n printf(\"NO\\n\");\r\n else if(n&1 && ((2*k < m) || (2*k-m)%4))\r\n printf(\"NO\\n\");\r\n else if(m&1 && (((n*m)-2*k < n) || (((n*m)-2*k)-n)%4))\r\n printf(\"N)\\n\");\r\n else\r\n printf(\"YES\\n\");\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "717e24afaf899bb2fe103c2c6b001f74", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "0e114bee64ceee12825940ee84516dbd", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.862547288776797, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\r\nint main()\r\n{int t;\r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {int n,m,k;\r\n scanf(\"%d %d %d\",&n,&m,&k);\r\n if(n%2 == 0 && m %2 == 0 && k&1)\r\n cout << \"NO\\n\";\r\n else if(n&1 && ((2*k < m) || (2*k-m)%4))\r\n cout << \"NO\\n\";\r\n else if(m&1 && (((n*m)-2*k < n) || (((n*m)-2*k)-n)%4))\r\n cout << \"NO\\n\";\r\n else\r\n cout << \"YES\\n\";\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "58eeabfab9db18ecc73004eebaa1d75e", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "0e114bee64ceee12825940ee84516dbd", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7566628041714948, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n\r\nint n, m, k, i, j, sum, t, tc, det;\r\nint main(void)\r\n{\r\n scanf(\"%d\", &t);\r\n for(tc=1;tc<=t;tc++)\r\n {\r\n det=2;\r\n scanf(\"%d %d %d\", &n, &m, &k);\r\n if(n==1 || m==1)\r\n {\r\n if(m==1)\r\n {\r\n printf(\"%s\\n\", k==0 ? \"YES\" : \"NO\");\r\n continue;\r\n }\r\n if(n==1)\r\n {\r\n printf(\"%s\\n\", k==(m*n)/2 ? \"YES\" : \"NO\");\r\n continue;\r\n }\r\n }\r\n if(n%2==1 && (m%4==1 || m%4==2)) det=1;\r\n if(k%2==det%2) printf(\"YES\\n\");\r\n else printf(\"NO\\n\");\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "3e641ea17d332ba4886e67e6db5f5b6e", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "6abba7d2906f7a84967c2919374ea137", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.19776119402985073, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "#include \r\n\r\nvoid testcase();\r\n\r\nint main() {\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 0; i < t; i++) {\r\n testcase();\r\n }\r\n return 0;\r\n}\r\n\r\nvoid testcase() {\r\n int n, m, k;\r\n scanf(\"%d %d %d\", &n, &m, &k);\r\n if (m == 1 && k >= 1) {\r\n printf(\"NO\\n\");\r\n return;\r\n }\r\n if ((n - k) % 2 != 0) {\r\n printf(\"NO\\n\");\r\n return;\r\n }\r\n printf(\"YES\\n\");\r\n return;\r\n}", "lang": "GNU C11", "bug_code_uid": "09585309b9bb22a97226ca8a485d6b88", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "262d59df12846ddfe8a1de22ece4356c", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8525214081826832, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\r\n#include\r\n#include\r\n#include\r\nlong long int min(long long int a, long long int b)\r\n{\r\n return a < b ? a : b;\r\n}\r\nint cmpfunc (const void * a, const void * b) {\r\n return ( *(int*)a - * (int*)b );\r\n}\r\ntypedef long long ll;\r\nvoid test();\r\nint main()\r\n{\r\n/*#ifndef ONLINE_JUDGE\r\n freopen(\"input.txt\", \"r\", stdin);\r\n freopen(\"output.txt\", \"w\", stdout);\r\n#endif*/\r\n int t;\r\n scanf(\"%d\", &t);\r\n while (t--)\r\n {\r\n test();\r\n }\r\n return 0;\r\n}\r\nvoid test()\r\n{\r\n int n, m, k;\r\n scanf(\"%d %d %d\", &n, &m, &k);\r\n if (n % 2 == 0 && m % 2 == 0)\r\n {\r\n if (k % 2 == 0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n else if (n % 2 == 0 && m % 2 != 0)\r\n {\r\n if (k > (n * (m / 2)))\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n else if (k % 2 == 0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n else if (n % 2 != 0 && m % 2 == 0)\r\n {\r\n if (k == n * (m / 2))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else if (k % 2 != 0)\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "4b38280d7049d5e0f955f878c231c1c4", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "8b4ef334aa72240d2df077d84ff337e6", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9983361064891847, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tint n,m,t,k;\r\n\tscanf(\"%d\",&t);\r\n\twhile(t--){\r\n\t\tscanf(\"%d %d %d\",&n,&m,&k);\r\n\t\tint sum=n*m/2;\r\n\t\tif(n%2==1){\r\n\t\t\tsum-=m/2;\r\n\t\t\tk-=m/2;\r\n\t\t}\r\n\t\tif(m%2==1){\r\n\t\t\tsum-=n/2;\r\n\t\t}\r\n\t\tif(k<0||k%2==1||k>sum){\r\n\t\t\tprintf(\"NO\\n\");\r\n\t\t}else printf(\"YES\\n\");*\r\n\t}\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "6d47d477cf6654a70019062e19ee4b8a", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "9a08517680e629f0ac3a6ec82eeb76ef", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9166666666666666, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\r\n#include\r\n#include\r\n#include\r\n/*#define debug(x);\r\nprintf(x);*/\r\n\r\nvoid init()\r\n{\r\n\t#ifndef ONLINE_JUDGE\r\n\tfreopen(\"input.txt\" , \"r\" ,stdin);\t\r\n\tfreopen(\"output.txt\" , \"w\" ,stdout);\r\n\t#endif\r\n}\r\n//** pritishcf307 **//\r\n//**-------------------------------------------------------------**//\r\n\r\nint main()\r\n{ \r\n\tinit();\r\n\tlong long int t;\r\n\tscanf(\"%lld\",&t);\r\n\twhile(t--)\r\n\t{\r\n\t\tlong long int n,m,k;\r\n\t\tscanf(\"%lld %lld %lld\",&n,&m,&k);\r\n\t\tif(n%2==1 & m%2==0)\r\n\t\t{\r\n\t\t\tif(k%2==0)\r\n\t\t\t{\r\n\t\t\t\tprintf(\"YES\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tprintf(\"NO\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(n%2==0 && n%2==1)\r\n\t\t{\r\n\t\t\tif(k\r\n#include \r\n\r\nint row,column,k;\r\nvoid solve()\r\n{\r\n if(column&1){\r\n if((k<=(column/2*row)) && (k%2==0))\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n else{\r\n if(row%2 == k%2)\r\n printf(\"YES\\n\");\r\n else\r\n printf(\"NO\\n\");\r\n }\r\n}\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n scanf(\"%d%d%d\",&row,&column,&k);\r\n solve();\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "b9d02cd4577a59e148915ae1b01bdf34", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "41d2ecca9ccd836fc92e807c2984aa6c", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9980676328502416, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n for (int i = 1; i <= t; i++)\r\n {\r\n int n, m, h, v;\r\n scanf(\"%d %d %d\", &n, &m, &h);\r\n v = (n * m) / 2 - h;\r\n if ((n % 2) && (m % 2 == 0))\r\n {\r\n int s = n / 2;\r\n if ((s != 0))\r\n {\r\n int f = v / s;\r\n if ((v % s == 0) && (f % 2 == 0))\r\n {\r\n printf(\"YES\\n\");\r\n continue;\r\n }\r\n\r\n if ((v % 2 == 0) && (v <= s * m))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n else\r\n {\r\n if ((v == 0))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n }\r\n else if ((n % 2 == 0) && (m % 2))\r\n {\r\n int s = m / 2;\r\n if ((s != 0))\r\n {\r\n int f = h / s;\r\n if ((h % s == 0) && (f % 2 == 0))\r\n {\r\n printf(\"YES\\n\");\r\n continue;\r\n }\r\n if ((h % 2 == 0) && (h <= s * n))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n else\r\n {\r\n if ((h == 0))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n }\r\n else\r\n {\r\n if ((h%2== 0))\r\n {\r\n printf(\"YES\\n\");\r\n }\r\n else\r\n {\r\n printf(\"NO\\n\");\r\n }\r\n }\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "0198614f764db42298d8144b4afc571f", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "30128e4f3542d7d0fa380198b6acd9d6", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.35537190082644626, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include \n\n#define N\t100\n#define M\t100\n\nint main() {\n\tint t;\n\n\tscanf(\"%d\", &t);\n\twhile (t--) {\n\t\tstatic char cc[N][M + 1], cc_[M][N + 1];\n\t\tint n, m, k, i, j, tmp, flip;\n\n\t\tscanf(\"%d%d%d\", &n, &m, &k);\n\t\tflip = 0;\n\t\tif (n % 2 != 0)\n\t\t\ttmp = n, n = m, m = tmp, k = n * m / 2 - k, flip = 1;\n\t\tif (k % 2 != 0 || m % 2 != 0 && k > n * (m - 1) / 2) {\n\t\t\tprintf(\"NO\\n\");\n\t\t\tcontinue;\n\t\t}\n\t\tfor (i = 0; i < n; i++)\n\t\t\tfor (j = 0; j < m; j++)\n\t\t\t\tcc[i][j] = (i / 2 + j) % 2 == 0 ? 'a' : 'b';\n\t\tfor (i = 0; i < n; i += 2)\n\t\t\tfor (j = 0; j + 1 < m; j += 2)\n\t\t\t\tif (k > 0) {\n\t\t\t\t\tk -= 2;\n\t\t\t\t\tif ((j / 2) % 2 == 0) {\n\t\t\t\t\t\tcc[i][j] = 'c', cc[i][j + 1] = 'c';\n\t\t\t\t\t\tcc[i + 1][j] = 'd', cc[i + 1][j + 1] = 'd';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcc[i][j] = 'd', cc[i][j + 1] = 'd';\n\t\t\t\t\t\tcc[i + 1][j] = 'c', cc[i + 1][j + 1] = 'c';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\tif (flip) {\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\tfor (j = 0; j < m; j++)\n\t\t\t\t\tcc_[j][i] = cc[i][j];\n\t\t\tfor (i = 0; i < m; i++)\n\t\t\t\tfor (j = 0; j < n; j++)\n\t\t\t\t\tcc[i][j] = cc_[i][j];\n\t\t\ttmp = n, n = m, m = tmp;\n\t\t}\n\t\tfor (i = 0; i < n; i++)\n\t\t\tcc[i][m] = 0;\n\t\tprintf(\"YES\\n\");\n\t\tfor (i = 0; i < n; i++)\n\t\t\tprintf(\"%s\\n\", cc[i]);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "bce9135b7fa8d8500468ed1c6c7b4861", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "0d9cdea9ccf928b674ad4141f29a1642", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.20717131474103587, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \r\nint main(){\r\n int a,b;\r\n scanf(\"%d\",&a);\r\n b = a + 1;\r\n printf(\"%d\\n\",&b);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "0446eafeccb9beb2dbe195a28b07e5b0", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "23fead531f2f0ed927c62e77bdc7891c", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9936406995230525, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nint main(){\r\n int n;\r\n scanf(\"%d\",&n);\r\n if(n < 1200){\r\n printf(\"%d\\n\",1200);\r\n }\r\n else if(n < 1400){\r\n printf(\"%d\\n\",1400);\r\n }\r\n else if(n < 1600){\r\n printf(\"%d\\n\",1600);\r\n }\r\n else if(n < 1900){\r\n printf(\"%d\\n\",1900);\r\n }\r\n else if(n < 2100){\r\n printf(\"%d\\n\",2100);\r\n }\r\n else if(n < 2300){\r\n printf(\"%d\\n\",2300); \r\n }\r\n else if(n < 2400){\r\n printf(\"%d\\n\",2400); \r\n }\r\n else if(n < 2600){\r\n printf(\"%d\\n\",2600); \r\n }\r\n else if(n < 3000){\r\n printf(\"%d\\n\",3000);\r\n }\r\n return 0:\r\n}", "lang": "GNU C11", "bug_code_uid": "2bd8e42d19be03c7c72251ae182ab888", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "23fead531f2f0ed927c62e77bdc7891c", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2510822510822511, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nint main(){\r\n int r;\r\n scanf(\"%d\",&r);\r\n printf(\"%d\\n\",r);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "e747a661c6ddf5432b8ebea101c3c4a2", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "9156c56051c7612bfb9eea624357c18d", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41409691629955947, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main() {\n\tprintf(\"1\");\n}\n", "lang": "GNU C11", "bug_code_uid": "40ba3df8bdbcfbe12caf4bfe1c8a6c71", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "a792565189cdab8d6f31bfbf0d9a2013", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9965556831228473, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nint main(){\r\n short n;\r\n scanf(\"%hi\", &n);\r\n if(n < 1200) printf(\"1200\");\r\n else if(n < 1400) printf(\"1400\");\r\n else if(n < 1600) printf(\"1600\");\r\n else if(n < 1900) printf(\"1900\");\r\n else if(n < 2100) printf(\"2100\");\r\n else if(n < 2300) printf(\"2300\");\r\n else if(n < 2400) printf(\"2400\");\r\n else if(n < 2600) printf(\"2600\");\r\n else if(n < 3000) printf(\"3000\");\r\n\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "09942776a9af63c93b290bf764a51e5e", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "95c78624b9adc362175d49c382347b28", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4585537918871252, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int n,ans=0,j;\r\n scanf(\"%d\",&n);\r\n for(n;j>9;)\r\n {\r\n j=n%9;\r\n \r\n }\r\n printf(\"%d\",j);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "ca3e7cec40e96d31d9994953e6186556", "src_uid": "477a67877367dc68b3bf5143120ff45d", "apr_id": "2e4dda60fc30a4f35c9b8630f3619a73", "difficulty": 1600, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.961038961038961, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \r\n#include \r\n \r\nint main()\r\n{\r\n int n;\r\n cin>>n;\r\n if (n % 9 == 0)\r\n printf(\"9\\n\");\r\n else\r\n printf(\"%d\\n\",(n % 9));\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "4f2e8e0b76dfc9e64bdbd2f24dc73924", "src_uid": "477a67877367dc68b3bf5143120ff45d", "apr_id": "90a4560e75319d9a6a919a2323e2843d", "difficulty": 1600, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9734513274336283, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main(){\r\n int a;\r\n scanf(\"%d\",&a);\r\n printf(\"%d\\n\",(a%9));\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "1d41ddba9d52e20c2c72dd39a4e061a0", "src_uid": "477a67877367dc68b3bf5143120ff45d", "apr_id": "be0adff140bea048d8f54b202f3d0bda", "difficulty": 1600, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9841269841269841, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n\r\nint main(){\r\n int n;\r\n scanf(\"%d\", &n);\r\n printf(\"%d\", n ? (n - 1) % 9 : 0);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "bc34bae6350ac2a28044450a7c625853", "src_uid": "477a67877367dc68b3bf5143120ff45d", "apr_id": "0c8893e74c56aefaa1e341ef923d3154", "difficulty": 1600, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9221556886227545, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tint a;\r\n\tscanf(\"%d\",&a);\r\n\tprintf(\"%d\",&a);\r\n}", "lang": "GNU C11", "bug_code_uid": "37c38caa863c8759353d79455ec5c479", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "e7f68bc96c7f6037109d6d1c76c447bd", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9204545454545454, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main(){\r\nint a;\r\ncin>>a;\r\nprintf(\"%d\",2-(a*a));\r\nreturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "303387ddb84a4430fa06a6af2d71185b", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "0a926c04ec73250bdbbd427a58abb45f", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9986577181208054, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nchar mp[9][9];\nint dir;\nint n,m,x,y;\nint get_dis(int dir){\n if(dir==0&&y==m)return 100;\n if(dir==1&&x==n)return 100;\n if(dir==0){\n for(int i=y+1;i<=m;i++)\n if(mp[x][i]=='*')return i-y;\n }else\n for(int i=x+1;i<=n;i++)\n if(mp[i][y]=='*')return i-x;\t\n return 100;\n}\n\nint main(void){\n scanf(\"%d%d\",&n,&m);\n for(int i=1;i<=n;i++)scanf(\"%s\",mp[i]+1);\n dir=0;\n int ans=0;\n x=1;y=1;\n for(int i=0;iget_dis(!dir)){\n if(dir==0)\n\tx++;\n else\n\ty++;\n dir=!dir;\n }else{\n x++;\n }\n }\n printf(\"%d\\n\",ans);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "040bebb597426bff1d596522ef3cea6e", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "71ef76d0f7dc56d64da23f7904201fce", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.17341699942954936, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n\nint\tgetmin(int a, int b)\n{\n\tif (a < b)\n\t\treturn (a);\n\treturn (b);\n}\nint\tgetmax(int a, int b)\n{\n\tif (a > b)\n\t\treturn (a);\n\treturn (b);\n}\n\nint\t*get_tab(int *c, int size)\n{\n\tint\t*t;\n\tint\ti;\n\tint\tj;\n\n\ti = 0;\n\tj = 0;\n\tt = (int *)malloc (sizeof(int) * size);\n\twhile (i < size)\n\t{\n\t\tif ((c[j] + c[j + 1]) % 2 == 0)\n\t\t\tt[i] = getmax(c[j], c[j + 1]);\n\t\telse\n\t\t\tt[i] = getmin(c[j], c[j + 1]);\n\n\t\tj += 2;\n\t\ti++;\n\t}\n\treturn (t);\n}\n\nint\tpow_t(int a, int b)\n{\n\tint\ti;\n\n\ti = 1;\n\twhile (i < b)\n\t{\t\n\t\ta = a * 2;\n\t\ti++;\n\t}\n\treturn (a);\n}\n\nint main()\n{\n\tint\tt;\n\tint\tcas;\n\tint\ti;\n\tint\tj;\n\tint\tsize;\n\tint\tk;\n\tint\t*tab;\n\tint\t*tmp;\n\tint\tarr;\n\n\n\tscanf(\"%d\",&t);\n\tint\tn[t];\n\ti = 0;\n\twhile (i < t)\n\t{\n\t\tscanf(\"%d\",&n[i]);\n\t\ti++;\n\t}\n\tcas = 0;\n\twhile (cas < t)\n\t{\n\t\tif (n[cas] == 1)\n\t\t\tprintf(\"1\\n\");\n\t\telse\n\t\t{\n\t\t\tarr = pow_t(2, n[cas]);\n\t\t\ttab = (int *)malloc(sizeof(int) * arr / 2);\n\t\t\ti = 1;\n\t\t\tj = 0;\n\t\t\twhile (i < arr)\n\t\t\t{\n\t\t\t\tif ((i + i + 1) % 2 == 0)\n\t\t\t\t\ttab[j] = getmax(i, i + 1);\n\t\t\t\telse\n\t\t\t\t\ttab[j] = getmin(i, i + 1);\n\t\t\t\ti = i + 2;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tsize = arr / 2;\n\t\t\tk = 1;\n\t\t\twhile ((k < n[cas]))\n\t\t\t{\n\t\t\t\tsize /= 2;\n\t\t\t\ttmp = tab;\n\t\t\t\ttab = get_tab(tab, size);\n\t\t\t\tfree(tmp);\n\t\t\t\tk++;\n\t\t\t}\n\t\t\tfree(tab);\n\t\t\tif ((tab[0] + tab[1]) % 2 == 0)\n\t\t\t\tprintf(\"%d\\n\",getmax(tab[0], tab[1]));\n\t\t\telse\n\t\t\t\tprintf(\"%d\\n\",getmin(tab[0], tab[1]));\n\t\t}\n\t\tcas ++;\n\t}\n\treturn (0);\n}", "lang": "GNU C11", "bug_code_uid": "3d00f3608382e4d0e58041646707f336", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "92bd5d77417a0ea2bde9440b5845a8ab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6818181818181818, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \r\n#include \r\nint winner(int stages);\r\n\r\nint main()\r\n{\r\n int num;\r\n int *stages;\r\n scanf(\"%d\", &num);\r\n stages = (int *)malloc(num * sizeof(int));\r\n for (int i = 0; i < num; i++) {\r\n scanf(\"%d\", stages + i);\r\n }\r\n for (int i = 0; i < num; i++) {\r\n printf(\"%d\\n\", winner(stages[i]));\r\n }\r\n return 0;\r\n}\r\n\r\nint winner(int stages)\r\n{\r\n int player_num = 1 << stages;\r\n int *players = (int *)malloc(player_num * sizeof(int));\r\n for (int i = 0; i < player_num; i++) {\r\n players[i] = i + 1;\r\n }\r\n for (int i = player_num / 2; i != 0; i = i / 2) {\r\n for (int j = 0; j < i; j++) {\r\n players[j] = ((players[2 * j + 1] + players[2 * j]) % 2)? players[2 * j] : players[2 * j + 1];\r\n }\r\n }\r\n free(players);\r\n return players[0];\r\n}", "lang": "GNU C11", "bug_code_uid": "57ecf76f106c5e1ea46fe2586840515e", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "98e3a33f353567ff0b23196dcca39a22", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9968847352024922, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n#include\r\nint powerOf2(int n){\r\n int i,j=1;\r\n for(i=0;i\r\n \r\n \r\n int main()\r\n {\r\n int tt;\r\n scanf(\"%d\",&tt);\r\n while(tt--)\r\n {\r\n int n;\r\n scanf(\"%d\",&n);\r\n printf(\"%d\\n\",(1>>n)-1);\r\n }\r\n }", "lang": "GNU C11", "bug_code_uid": "82f616289d097f7c04a9b40183100274", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "94acc348e4da23ae4a1c09cf2f8cdb8d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9906542056074766, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nlong long int gop(int n){\r\n long long ans = 1;\r\n for(int i = 0;i < n;i++){\r\n ans = ans*2;\r\n }\r\n\r\n return ans;\r\n}\r\n\r\nint main(){\r\n\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int n;\r\n scanf(\"%d\",&n);\r\n\r\n\r\n printf(\"%lld\",gop(n));\r\n }\r\n\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "cd40919d80aec5f7e9f89e04f063e052", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "fc7e3e474e5e3a10ea49af5686575fad", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5512048192771084, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\"stdio.h\"\r\n\r\nint main()\r\n{\r\n int n;\r\n scanf(\"%d\",&n);\r\n int result = 2;\r\n for(int i = 1; i < n; ++i)\r\n {\r\n result *= 2;\r\n }\r\n printf(\"%d\",result-1);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "c5f53530754175f49e860724c51a5d1e", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "d6858664da7b609faaa3ddfecb4b3d42", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9716803020767778, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#define _CRT_SECURE_NO_WARNINGS\r\n#include \r\nlong long int arrey[31];\r\nlong long int num[31] = { 0,2,\r\n4,\r\n8,\r\n16,\r\n32,\r\n64,\r\n128,\r\n256,\r\n512,\r\n1024,\r\n2048,\r\n4096,\r\n8192,\r\n16384,\r\n32768,\r\n65536,\r\n131072,\r\n262144,\r\n524288,\r\n1048576,\r\n2097152,\r\n4194304,\r\n8388608,\r\n16777216,\r\n33554432,\r\n67108864,\r\n134217728,\r\n268435456,\r\n536870912,\r\n1073741824};\r\n\r\nint main()\r\n{\r\n\tlong long int n;\r\n\t\r\n\tscanf(\"%lld\", &n);\r\n\tfor (int i = 1;i <= n;i++)\r\n\t{\r\n\t\tscanf(\"%d\", &arrey[i]);\r\n\t}\r\n\tfor (int k = 1;k <= n;k++)\r\n\t{\r\n\t\tint temp = arrey[k];\r\n\t\tif (temp== 1)\r\n\t\t{\r\n\t\t\tprintf(\"1\\n\");\r\n\t\t\t\r\n\t\t}\r\n\t\telse if (temp == 2)\r\n\t\t{\r\n\t\t\tprintf(\"1\\n\");\r\n\t\t\t\r\n\t\t}\r\n\t\telse if (temp == 3)\r\n\t\t{\r\n\t\t\tprintf(\"7\\n\");\r\n\t\t\t\r\n\t\t}\r\n\t\telse if (temp >= 3)\r\n\t\t{\r\n\t\t\tprintf(\"%lld\\n\", num[n] - 1);\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n}", "lang": "GNU C11", "bug_code_uid": "37c8fdbcaac105a12eea43ea3ecf6b7b", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "9df715b93a5db03dc70f93b3af96fdc7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9953917050691244, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\nint main()\r\n{\r\n\tint n;\r\n\tscanf(\"%d\",&n);\r\n\tint i;\r\n\tfor(i=0;i\n#include \n#include \nint main()\n{\n int n;\n scanf(\"%d\",&n);\n long int k =1;\n for(int i =0; i\r\n\r\nint main()\r\n{\r\n int i,t,n;\r\n scanf(\"%d\",&t);\r\n for (i=0;i\r\n\r\nint main()\r\n{\r\n int i,t,n;\r\n long long ans;\r\n scanf(\"%d\",&t);\r\n for (i=0;i\r\n\r\nint main()\r\n{\r\n int test,n;\r\n scanf(\"%d\",&test);\r\n\r\n for(int i=0 ;i 1)\r\n printf(\"%d\\n\",result-1);\r\n else\r\n printf(\"%d\\n\",n);\r\n }\r\n\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "252df091bf158c5516512860daca9439", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "ec8bfb76bc53d0d39332654223d6bf47", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6954732510288066, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nvoid win(int n)\r\n{\r\n\tif(n==1)\r\n\tprintf(\"1\\n\");\r\n\tif(n==2)\r\n\tprintf(\"3\\n\");\r\n\tif(n>2)\r\n\t{\r\n\t\tprintf(\"%d\\n\",3+(n-2)*4);\r\n\t}\r\n}\r\nint main ()\r\n{\r\n\tint t;\r\n\tscanf(\"%d\",&t);\r\n\twhile(t--)\r\n\t{\r\n\t\tint n;\r\n\t\tscanf(\"%d\",&n);\r\n\t\twin(n);\r\n\t}\r\n } \r\n", "lang": "GNU C11", "bug_code_uid": "f91f7e67c329b5a9681950cb1fd0354b", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "00d35af1af7be1226474f8fc7b842c1b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9964788732394366, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n\r\nint main()\r\n{\r\n int t,n,ans;\r\n scanf(\"%d\",&t);\r\n\r\n while(t--)\r\n {\r\n ans=1;\r\n scanf(\"%d\",&n);\r\n\r\n for(int i=0;i\r\n\r\nint tests;\r\nscanf(\"%d\", &tests);\r\nfor(int i=0; i\r\nint answer(int x,int y,int u)\r\n{\r\n\tif (x == y)\r\n\t{\r\n\t\treturn x;\r\n\t}\r\n\telse {\r\n\t\tif (u == 1)\r\n\t\t{\r\n\t\t\treturn answer((x+y)/2+1, y, 0);\r\n\t\t}\r\n\t\tif (u == 0)\r\n\t\t{\r\n\t\t\treturn answer(x, (x+y) / 2, 1);\r\n\t\t}\r\n\t}\r\n}\r\nint main(void)\r\n{\r\n\tint t;\r\n\tscanf(\"%d\", &t);\r\n\tfor (int i = 0; i < t; i++)\r\n\t{\r\n\t\tint p;\r\n\t\tscanf(\"%d\", &p);\r\n\t\tint m = 1;\r\n\t\tfor (int o = 1; o <= p; o++)\r\n\t\t{\r\n\t\t\tm = 2 * m;\r\n\t\t}\r\n\t\tint v;\r\n\t\tif (p % 2 == 0)\r\n\t\t{\r\n\t\t\tv=answer(1, m, 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tv=answer(1, m, 0);\r\n\t\t}\r\n\t\tprintf(\"%d\\n\", v);\r\n\t}\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "cf4ef95138dcf21ff3fe5c7c93ddd808", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "ad457a69267f82d57f93f29c74c66df1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9940119760479041, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nint main() {\r\n int t, n;\r\n scanf(\"%d\", &t);\r\n while (t--) {\r\n scanf(\"%d\", &n);\r\n printf(\"%lld\\n\", 1ll << n - 1);\r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "d389fe69dbc9cf1dfbeff4f908a7f5a5", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "e4f06a1fe07636b8ce623407624a47ab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9948186528497409, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n\tint n;\r\n\tscanf(\"%d\",&n);\r\n\twhile(n--)\r\n\t{\r\n\t\tint num;\r\n\t\tscnaf(\"%d\",&num);\r\n\t\tnum = 1 << num;\r\n\t\tnum--;\r\n\t\tprintf(\"%d\\n\",num);\r\n\t\t\r\n\t}\r\n\r\n\t\r\n\t\r\n \r\n \r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "ab76c8f4f41bda6d7d2eeb828126923e", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "b5809b446c1096d117c9bcf3e9683da6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9876977152899824, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \r\nvoid solve();\r\nint main() { \r\n \r\n int i, t;\r\n scanf(\"%d\",&t);\r\n for(i=0;i\n#include \n\n#define N\t200000\n#define L_\t19\t/* L_ = ceil(log2(N * 2 + 1)) */\n#define N_\t(1 << L_)\n#define MD\t998244353\n\nint min(int a, int b) { return a < b ? a : b; }\n\nlong long power(long long a, int k) {\n\tlong long p = 1;\n\n\twhile (k) {\n\t\tif (k & 1)\n\t\t\tp = p * a % MD;\n\t\ta = a * a % MD;\n\t\tk >>= 1;\n\t}\n\treturn p;\n}\n\nint vv[N + 1], ff[N + 1], gg[N + 1], mobius[N + 1];\nint *wwu[L_ + 1], *wwv[L_ + 1], vv_[L_ + 1];\n\nvoid init() {\n\tint i, j, l, u, v;\n\n\tff[0] = gg[0] = 1;\n\tfor (i = 1; i <= N; i++) {\n\t\tvv[i] = i == 1 ? 1 : (long long) vv[i - MD % i] * (MD / i + 1) % MD;\n\t\tff[i] = (long long) ff[i - 1] * i % MD;\n\t\tgg[i] = (long long) gg[i - 1] * vv[i] % MD;\n\t}\n\tfor (i = 2; i <= N; i++) {\n\t\tif (mobius[i])\n\t\t\tcontinue;\n\t\tfor (j = i; j <= N; j += i)\n\t\t\tmobius[j]++;\n\t}\n\tfor (i = 2; i <= N / i; i++)\n\t\tfor (j = i * i; j <= N; j += i * i)\n\t\t\tmobius[j] = -1;\n\tfor (i = 1; i <= N; i++)\n\t\tmobius[i] = mobius[i] == -1 ? 0 : (mobius[i] % 2 == 0 ? 1 : -1);\n\tu = power(3, MD - 1 >> L_), v = power(u, MD - 2);\n\tfor (l = L_; l > 0; l--) {\n\t\tint n = 1 << l, m = n >> 1;\n\n\t\twwu[l] = (int *) malloc(m * sizeof *wwu[l]);\n\t\twwv[l] = (int *) malloc(m * sizeof *wwv[l]);\n\t\twwu[l][0] = wwv[l][0] = 1;\n\t\tfor (i = 1; i < m; i++) {\n\t\t\twwu[l][i] = (long long) wwu[l][i - 1] * u % MD;\n\t\t\twwv[l][i] = (long long) wwv[l][i - 1] * v % MD;\n\t\t}\n\t\tvv_[l] = power(1 << l, MD - 2);\n\t\tu = (long long) u * u % MD, v = (long long) v * v % MD;\n\t}\n\tvv_[0] = 1;\n}\n\nint choose(int n, int k) {\n\treturn (long long) ff[n] * gg[k] % MD * gg[n - k] % MD;\n}\n\nvoid ntt_(int *aa, int l, int inverse) {\n\tif (l) {\n\t\tint n = 1 << l, m = n >> 1, *ww = inverse ? wwv[l] : wwu[l], i, j;\n\n\t\tntt_(aa, l - 1, inverse), ntt_(aa + m, l - 1, inverse);\n\t\tfor (i = 0; (j = i + m) < n; i++) {\n\t\t\tint a = aa[i], b = (long long) aa[j] * ww[i] % MD;\n\n\t\t\tif ((aa[i] = a + b) >= MD)\n\t\t\t\taa[i] -= MD;\n\t\t\tif ((aa[j] = a - b) < 0)\n\t\t\t\taa[j] += MD;\n\t\t}\n\t}\n}\n\nvoid ntt(int *aa, int l, int inverse) {\n\tint n = 1 << l, i, j;\n\n\tfor (i = 1, j = 0; i < n; i++) {\n\t\tint b = n >> 1, tmp;\n\n\t\twhile ((j ^= b) < b)\n\t\t\tb >>= 1;\n\t\tif (i < j)\n\t\t\ttmp = aa[i], aa[i] = aa[j], aa[j] = tmp;\n\t}\n\tntt_(aa, l, inverse);\n}\n\nint solve(int n, int k) {\n\tstatic int aa[N_], bb[N_];\n\tint n_, l_, i, ans;\n\n\tk = min(k, n);\n\tl_ = 0;\n\twhile (1 << l_ < k + k + 1)\n\t\tl_++;\n\tn_ = 1 << l_;\n\tfor (i = 0; i < n_; i++)\n\t\taa[i] = i <= k ? (long long) power(i, n) * gg[i] % MD : 0;\n\tfor (i = 0; i < n_; i++)\n\t\tbb[i] = i <= k ? (long long) (i % 2 == 0 ? 1 : MD - 1) * gg[i] % MD : 0;\n\tntt(aa, l_, 0), ntt(bb, l_, 0);\n\tfor (i = 0; i < n_; i++)\n\t\taa[i] = (long long) aa[i] * bb[i] % MD;\n\tntt(aa, l_, 1);\n\tans = MD - 1;\n\tfor (i = 0; i <= k; i++)\n\t\tans = (ans + (long long) aa[i] * vv_[l_]) % MD;\n\treturn ans;\n}\n\nint main() {\n\tint n, k, d, ans;\n\n\tinit();\n\tscanf(\"%d%d\", &n, &k);\n\tif (k == 1) {\n\t\tprintf(\"1\\n\");\n\t\treturn 0;\n\t}\n\tans = 0;\n\tfor (d = 1; d < n; d++)\n\t\tif (mobius[d])\n\t\t\tans = (ans + solve((n + d - 1) / d, k) * mobius[d]) % MD;\n\tif (ans < 0)\n\t\tans += MD;\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f4b2474420c285773da1c6e83089259d", "src_uid": "eb9d24070cc5b347d020189d803628ae", "apr_id": "53feaecd6a10fc763ccffea5c73418b9", "difficulty": 2900, "tags": ["fft", "math", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9956767542401064, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\n#define N\t200000\n#define L_\t19\t/* L_ = ceil(log2(N * 2 + 1)) */\n#define N_\t(1 << L_)\n#define MD\t998244353\n\nint min(int a, int b) { return a < b ? a : b; }\n\nlong long power(long long a, int k) {\n\tlong long p = 1;\n\n\twhile (k) {\n\t\tif (k & 1)\n\t\t\tp = p * a % MD;\n\t\ta = a * a % MD;\n\t\tk >>= 1;\n\t}\n\treturn p;\n}\n\nint vv[N + 1], ff[N + 1], gg[N + 1], mobius[N + 1];\nint *wwu[L_ + 1], *wwv[L_ + 1], vv_[L_ + 1];\n\nvoid init() {\n\tint i, j, l, u, v;\n\n\tff[0] = gg[0] = 1;\n\tfor (i = 1; i <= N; i++) {\n\t\tvv[i] = i == 1 ? 1 : (long long) vv[i - MD % i] * (MD / i + 1) % MD;\n\t\tff[i] = (long long) ff[i - 1] * i % MD;\n\t\tgg[i] = (long long) gg[i - 1] * vv[i] % MD;\n\t}\n\tfor (i = 2; i <= N; i++) {\n\t\tif (mobius[i])\n\t\t\tcontinue;\n\t\tfor (j = i; j <= N; j += i)\n\t\t\tmobius[j]++;\n\t}\n\tfor (i = 2; i <= N / i; i++)\n\t\tfor (j = i * i; j <= N; j += i * i)\n\t\t\tmobius[j] = -1;\n\tfor (i = 1; i <= N; i++)\n\t\tmobius[i] = mobius[i] == -1 ? 0 : (mobius[i] % 2 == 0 ? 1 : -1);\n\tu = power(3, MD - 1 >> L_), v = power(u, MD - 2);\n\tfor (l = L_; l > 0; l--) {\n\t\tint n = 1 << l, m = n >> 1;\n\n\t\twwu[l] = (int *) malloc(m * sizeof *wwu[l]);\n\t\twwv[l] = (int *) malloc(m * sizeof *wwv[l]);\n\t\twwu[l][0] = wwv[l][0] = 1;\n\t\tfor (i = 1; i < m; i++) {\n\t\t\twwu[l][i] = (long long) wwu[l][i - 1] * u % MD;\n\t\t\twwv[l][i] = (long long) wwv[l][i - 1] * v % MD;\n\t\t}\n\t\tvv_[l] = power(1 << l, MD - 2);\n\t\tu = (long long) u * u % MD, v = (long long) v * v % MD;\n\t}\n\tvv_[0] = 1;\n}\n\nint choose(int n, int k) {\n\treturn (long long) ff[n] * gg[k] % MD * gg[n - k] % MD;\n}\n\nvoid ntt_(int *aa, int l, int inverse) {\n\tif (l) {\n\t\tint n = 1 << l, m = n >> 1, *ww = inverse ? wwv[l] : wwu[l], i, j;\n\n\t\tntt_(aa, l - 1, inverse), ntt_(aa + m, l - 1, inverse);\n\t\tfor (i = 0; (j = i + m) < n; i++) {\n\t\t\tint a = aa[i], b = (long long) aa[j] * ww[i] % MD;\n\n\t\t\tif ((aa[i] = a + b) >= MD)\n\t\t\t\taa[i] -= MD;\n\t\t\tif ((aa[j] = a - b) < 0)\n\t\t\t\taa[j] += MD;\n\t\t}\n\t}\n}\n\nvoid ntt(int *aa, int l, int inverse) {\n\tint n = 1 << l, i, j;\n\n\tfor (i = 1, j = 0; i < n; i++) {\n\t\tint b = n >> 1, tmp;\n\n\t\twhile ((j ^= b) < b)\n\t\t\tb >>= 1;\n\t\tif (i < j)\n\t\t\ttmp = aa[i], aa[i] = aa[j], aa[j] = tmp;\n\t}\n\tntt_(aa, l, inverse);\n}\n\nint solve(int n, int k) {\n\tstatic int aa[N_], bb[N_];\n\tint n_, l_, i, ans;\n\n\tl_ = 0;\n\twhile (1 << l_ < k + k + 1)\n\t\tl_++;\n\tn_ = 1 << l_;\n\tfor (i = 0; i < n_; i++)\n\t\taa[i] = i <= k ? (long long) power(i, n) * gg[i] % MD : 0;\n\tfor (i = 0; i < n_; i++)\n\t\tbb[i] = i <= k ? (long long) (i % 2 == 0 ? 1 : MD - 1) * gg[i] % MD : 0;\n\tntt(aa, l_, 0), ntt(bb, l_, 0);\n\tfor (i = 0; i < n_; i++)\n\t\taa[i] = (long long) aa[i] * bb[i] % MD;\n\tntt(aa, l_, 1);\n\tans = MD - 1;\n\tfor (i = 0; i <= k; i++)\n\t\tans = (ans + (long long) aa[i] * vv_[l_]) % MD;\n\treturn ans;\n}\n\nint main() {\n\tint n, k, d, ans;\n\n\tinit();\n\tscanf(\"%d%d\", &n, &k);\n\tif (k == 1) {\n\t\tprintf(\"1\\n\");\n\t\treturn 0;\n\t}\n\tans = 0;\n\tfor (d = 1; d < n; d++)\n\t\tif (mobius[d])\n\t\t\tans = (ans + solve((n + d - 1) / d, k) * mobius[d]) % MD;\n\tif (ans < 0)\n\t\tans += MD;\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9a62b55f0f3714bb1434bedb4262c886", "src_uid": "eb9d24070cc5b347d020189d803628ae", "apr_id": "53feaecd6a10fc763ccffea5c73418b9", "difficulty": 2900, "tags": ["fft", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9376558603491272, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include \r\n\r\ntypedef long long ll;\r\n\r\nint mod = 998244353;\r\n\r\nll qPow(ll a, ll b) {\r\n\tll ret = 1;\r\n\twhile(b) {\r\n\t\tif(b&1)\r\n\t\t\tret = ret * a % mod;\r\n\t\ta = a * a % mod;\r\n\t\tb >>= 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n\r\nint main() {\r\n int n, x;\r\n scanf(\"%d %d\", &n, &x);\r\n\tll C[n+1][n+1];\r\n\tfor(int i=0;i<=n;i++){\r\n\t\tfor(int j=0;j<=i;j++) {\r\n\t\t\tif(!j)\r\n\t\t\t\tC[i][j] = 1;\r\n\t\t\telse\r\n\t\t\t\tC[i][j] = (C[i-1][j] + C[i-1][j-1]) % mod;\r\n\t\t}\r\n\t}\r\n\tll f[n+1][x+1];\r\n\tfor(int i=2;i<=n;i++){\r\n\t\tfor(int j=1;j<=x;j++) {\r\n\t\t\tif(j\r\n#include \r\n \r\ntypedef long long ll;\r\n \r\nint mod = 998244353;\r\n \r\nll qPow(ll a, ll b) {\r\n\tll ret = 1;\r\n\twhile(b) {\r\n\t\tif(b&1)\r\n\t\t\tret = ret * a % mod;\r\n\t\ta = a * a % mod;\r\n\t\tb >>= 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n \r\n \r\nint main() {\r\n int n, x;\r\n scanf(\"%d %d\", &n, &x);\r\n\tll C[n+1][n+1];\r\n\tmemset(C,0,sizeof(C));\r\n\tfor(int i=0;i<=n;i++){\r\n\t\tfor(int j=0;j<=i;j++) {\r\n\t\t\tif(!j)\r\n\t\t\t\tC[i][j] = 1;\r\n\t\t\telse\r\n\t\t\t\tC[i][j] = C[i-1][j] + C[i-1][j-1];\r\n\t\t\t\tif(C[i][j] >= mod)\r\n\t\t\t\t C[i][j] -= mod\r\n\t\t\t\t \r\n\t\t}\r\n\t}\r\n\tll f[n+1][x+1];\r\n\tmemset(f,0,sizeof(f));\r\n\tfor(int i=2;i<=n;i++){\r\n\t\tfor(int j=1;j<=x;j++) {\r\n\t\t\tif(j\r\n#include \r\n \r\ntypedef unsigned long long ll;\r\ntypedef unsigned int int;\r\n \r\nint mod = 998244353;\r\n \r\nll qPow(ll a, ll b) {\r\n\tll ret = 1;\r\n\twhile(b) {\r\n\t\tif(b&1)\r\n\t\t\tret = ret * a % mod;\r\n\t\ta = a * a % mod;\r\n\t\tb >>= 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n \r\n \r\nint main() {\r\n int n, x;\r\n scanf(\"%u %u\", &n, &x);\r\n\tint C[n+1][n+1];\r\n\tmemset(C,0,sizeof(C));\r\n\tfor(int i=0;i<=n;i++){\r\n\t\tfor(int j=0;j<=i;j++) {\r\n\t\t\tif(!j)\r\n\t\t\t\tC[i][j] = 1;\r\n\t\t\telse\r\n\t\t\t\tC[i][j] = C[i-1][j] + C[i-1][j-1];\r\n\t\t\t\tif(C[i][j] >= mod)\r\n\t\t\t\t C[i][j] -= mod;\r\n\t\t\t\t \r\n\t\t}\r\n\t}\r\n\tll f[n+1][x+1];\r\n\tmemset(f,0,sizeof(f));\r\n\tfor(int i=2;i<=n;i++){\r\n\t\tfor(int j=1;j<=x;j++) {\r\n\t\t\tif(j\r\n#include \r\n\r\ntypedef unsigned long long ll;\r\ntypedef unsigned int uint;\r\n\r\nint mod = 998244353;\r\n\r\nuint pp[501][501];\r\n\r\nll qPow(uint a, uint b)\r\n{\r\n if (pp[a][b] > 0)\r\n {\r\n return pp[a][b];\r\n }\r\n ll ret = 1, aa = a;\r\n while (b)\r\n {\r\n if (b & 1)\r\n ret = ret * aa % mod;\r\n aa = aa * aa % mod;\r\n b >>= 1;\r\n }\r\n pp[a][b] = ret;\r\n return ret;\r\n}\r\n\r\nuint C[501][501];\r\nuint inited = 0;\r\nvoid init()\r\n{\r\n if (inited)\r\n return;\r\n inited = 1;\r\n memset(pp, 0, sizeof(pp));\r\n memset(C, 0, sizeof(C));\r\n for (uint i = 0; i <= 500; i++)\r\n {\r\n for (uint j = 0; j <= i; j++)\r\n {\r\n if (!j)\r\n C[i][j] = 1;\r\n else\r\n C[i][j] = C[i - 1][j] + C[i - 1][j - 1];\r\n if (C[i][j] >= mod)\r\n C[i][j] -= mod;\r\n }\r\n }\r\n}\r\nll f[501][501];\r\nint main()\r\n{\r\n uint n, x;\r\n scanf(\"%u %u\", &n, &x);\r\n init();\r\n memset(f, 0, sizeof(f));\r\n for (uint i = 2; i <= n; i++)\r\n {\r\n for (uint j = 1; j <= x; j++)\r\n {\r\n if (j < i)\r\n {\r\n f[i][j] = qPow(j, i);\r\n }\r\n else\r\n {\r\n f[i][j] = qPow(i - 1, i);\r\n for (uint k = 2; k <= i; k++)\r\n {\r\n f[i][j] = (f[i][j] + C[i][k] * qPow(i - 1, i - k) % mod * f[k][j - i + 1] % mod) % mod;\r\n }\r\n }\r\n }\r\n }\r\n\r\n printf(\"%llu\", f[n][x]);\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "3b139dea3e4e1cfe28d27f859bee9ff0", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "200036a3eb91a2d1ab2edd563f3ea153", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4565826330532213, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include\r\n#include\r\nint func(int m, int n, int a[]) {\r\n\tint sum = 0;\r\n\tfor (int i = 1; i <= m; i++) {\r\n\t\tint count = 0;\r\n\t\tfor (int k = 1; k <= n; k++) {\r\n\t\t\tfor (int j = 1; j < i; j++) {\r\n\t\t\t\tif (i * k % j == 0 && i * k <= n * j) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsum += n-count;\r\n\t\ta[i] = sum;\r\n\t}\r\n\treturn sum;\r\n}\r\n\r\nint main() {\r\n\tint m, n;\r\n\tscanf(\"%d%d\",&n,&m);\r\n\tint a[20];\r\n\tint num[20]={0};\r\n\r\n\tint k,maxi=19;\r\n\tnum[1] = n;\r\n\tfor (int i = 2; i < 20;i++) {\r\n\t\tk = int(pow(double(n), 1.0 / double(i)));\r\n\t\tif (pow(n, i) <= k)\r\n\t\t\tk++;\r\n\t\tif (k == 1) {\r\n\t\t\tmaxi = i - 1;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tnum[i] = k-1;\r\n\t\t//printf(\"%d \", k);\r\n\t}\r\n\tfor (int i = maxi; i >= 2;i--) {\r\n\t\tfor (int j = 1; j < i; j++) {\r\n\t\t\tnum[j] -= num[i] * (i / j);\r\n\t\t}\r\n\t}\r\n\tint sum = 0;\r\n\tfunc(maxi, m,a);\r\n\tfor (int i = 0; i <= maxi; i++) {\r\n\t\tsum += a[i] * num[i];\r\n\t}\r\n\tsum -= (m - 1);\r\n\tprintf(\"%d\", sum);\r\n\t//for (int i = 1; i <= maxi; i++)\r\n\t\t//printf(\"%d \",num[i]);\r\n\treturn 0;\r\n\r\n\r\n}", "lang": "GNU C11", "bug_code_uid": "acfc933cb3b974f2d5092799c0b0eb13", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "223830ce203ae8ae539d93a2ef6e0b67", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9831678895123004, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\r\n#include\r\nint func(int m, int n, int a[]) {\r\n\tint sum = 0;\r\n\tfor (int i = 1; i <= m; i++) {\r\n\t\tint count = 0;\r\n\t\tfor (int k = 1; k <= n; k++) {\r\n\t\t\tfor (int j = 1; j < i; j++) {\r\n\t\t\t\tif ((i * k) % j == 0 && i * k <= n * j) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsum += n-count;\r\n\t\ta[i] = sum;\r\n\t}\r\n\treturn sum;\r\n}\r\n\r\nint main() {\r\n\tint m, n;\r\n\tscanf(\"%d%d\",&n,&m);\r\n\tif (n == 1) {\r\n\t\tprintf(\"1\");\r\n\t\treturn 0;\r\n\t}\r\n\tif (m == 1) {\r\n\t\tprintf(\"%d\", n);\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tint a[20]={0};\r\n\tint num[20]={0};\r\n\r\n\tint k,maxi=19;\r\n\tnum[1] = n - 1;\r\n\t\r\n\tfor (int i = 2; i*i <= n; i++) {\r\n\t\tint p = 1;\r\n\t\tfor (int k = 1; k < 21; k++) {\r\n\t\t\tp *= i;\r\n\t\t\tif (p > n) {\r\n\t\t\t\tnum[k-1]++;\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfor (int i = maxi; i >= 2; i--) {\r\n\t\tif (num[maxi] == 0) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tfor (int j = 2; j < i; j++) {\r\n\t\t\t{\r\n\t\t\tnum[i/j] -= num[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tnum[1] = n - 1;\r\n\tfor (int i = maxi; i >= 2; i--) {\r\n\t\tnum[1] -= num[i] * i;\r\n\t}\r\n\tlong long int sum = 0;\r\n\tfunc(maxi, m,a);\r\n\tfor (int i = 1; i <= maxi; i++) {\r\n\t\r\n\t\tsum += (long long int)a[i] * num[i];\r\n\t}\r\n\tsum += 1;\r\n\tprintf(\"%lld\", sum);\r\n\t\r\n\treturn 0;\r\n\r\n\r\n}", "lang": "GNU C11", "bug_code_uid": "ed281213360d91c123a2c830aa7aea21", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "223830ce203ae8ae539d93a2ef6e0b67", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.4880258899676375, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n\n#define N\t1000000\n\nint min(int a, int b) { return a < b ? a : b; }\n\nint kk[N + 1];\n\nvoid init() {\n\tint a, b, k;\n\n\tmemset(kk, 0x3f, (N + 1) * sizeof *kk);\n\tfor (a = 2; a <= N; a++) {\n\t\tb = a, k = 1;\n\t\twhile (1) {\n\t\t\tif (b > N / a)\n\t\t\t\tbreak;\n\t\t\tb *= a, k++;\n\t\t\tkk[b] = min(kk[b], k);\n\t\t}\n\t}\n}\n\nint main() {\n\tint n, m, i;\n\tlong long ans;\n\n\tinit();\n\tscanf(\"%d%d\", &n, &m);\n\tans = 1;\n\tfor (i = 2; i <= n; i++)\n\t\tans += m - m / kk[i];\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "3778dc7bb1b572f75db9d80bbdaee054", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "73def07df1c4ada6310f515cc8688756", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9488752556237219, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n \r\n while(t--){\r\n int n,k;\r\n int max=1e9+7;\r\n scanf(\"%d%d\",&n,&k);\r\n long long int ans=1;\r\n for(int i=1;i<=n;i++){\r\n ans=(ans*i)%max;\r\n }\r\n printf(\"%lld\",ans)\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "3b2831aef44381312581880beeebd1f4", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "fb7532d8c012a5669bd47057e2818074", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9775051124744376, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n\r\n while(t--){\r\n int n,k;\r\n int max=1e9+7;\r\n scanf(\"%d%d\",&n,&k);\r\n long long int ans=1;\r\n for(int i=1;i<=n;i++){\r\n ans=(ans*i)%max;\r\n }\r\n printf(\"%lld\",ans);\r\n }\r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "2dde0284519432cc97f462106d64a5a7", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "fb7532d8c012a5669bd47057e2818074", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9724770642201835, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \r\n\r\nint main()\r\n{\r\n unsigned int t,k;\r\n unsigned long long int n,i;\r\n scanf(\"%u\",&t);\r\n while(t--)\r\n {\r\n scanf(\"%llu%u\",&n,&k);\r\n i=1;\r\n while(k--)\r\n {\r\n i=i*n%1000000007;\r\n }\r\nprintf(\"%llu\",i);\r\n }\r\n \r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "51d6ec73e0c2a38610c7638345f7a738", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "411e06e77c4c7dc4191c9d4c93f17aea", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9890909090909091, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nint main(){\r\n int t;\r\n scanf(\"%d\",&t);\r\n while(t--){\r\n int n,k;\r\n scanf(\"%d %d\",&n,&k);\r\n long long int ans = 0;\r\n for(int i=1; i<=k; i++){\r\n ans=ans*n;\r\n ans=ans%1000000007;\r\n }\r\n printf(\"%lld\\n\",ans);\r\n }\r\n return 0;\r\n}\r\n\r\n", "lang": "GNU C11", "bug_code_uid": "3421e1f8e8a5d592066ed0eb5f4eb0bc", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "3d8199077e4066f2368eb6abd33394f9", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8842975206611571, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\r\nint main()\r\n{\r\n int t;\r\n scanf(\"%d\", &t);\r\n while(t--)\r\n {\r\n int n, k, c=1;\r\n scanf(\"%d %d\", &n, &k);\r\n while(k--)\r\n c=c*n;\r\n printf(\"%d\", c%1000000007);\r\n }\r\n}", "lang": "GNU C11", "bug_code_uid": "8a8527bf5b073d9a241956fb3d839dd6", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "98f0bf32dbda450582257f9851be328a", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9718875502008032, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nint main() {\r\n\tint t; scanf(\"%d\", &t);\r\n\tint mod = 1e9 + 7;\r\n\twhile (t--) {\r\n\t\tint n, k; scanf(\"%d%d\", &n, &k);\r\n\t\tint ans = 1;\r\n\t\tfor (int i = 0; i < k; i++) {\r\n\t\t\tans *= n;\r\n\t\t\tans %= mod;\r\n\t\t}\r\n\t\tprintf(\"%d\\n\", ans);\r\n\t}\r\n}", "lang": "GNU C11", "bug_code_uid": "648c11260b68416973da34e8c54754b2", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "006fa67f87612e3c5498fa0591eb6b9b", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9715189873417721, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\r\nusing namespace std;\r\nint main()\r\n{\r\n int n,k,i,T;\r\n long long ans=1LL;\r\n long long mod=(1E9)+7;\r\n scanf(\"%d\",&T);\r\n while(T--)\r\n {\r\n ans=1LL;\r\n scanf(\"%d%d\",&n,&k);\r\n for(i=0;i\r\n\r\n#define M 1000000007\r\n\r\nint min(int a, int b) { return a < b ? a : b; }\r\n\r\nint main()\r\n{\r\n int x,y,z,i,j,k,a,b,c,n,m,t;\r\n long long res;\r\n \r\n scanf(\"%d\",&t);\r\n while(t--)\r\n {\r\n res = 1; \r\n scanf(\"%d %d\",&n,&k);\r\n k = min(n, k);\r\n for(x = 0; x < k; x++)\r\n res = (res * n) % M;\r\n \r\n printf(\"%lld\\n\",res); \r\n }\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "63a7fdf466dd4f6d68f562ee03d8314c", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "89fbd504e1ed9c6fb5f88e00698e7e65", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9987357774968394, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\n#define N\t200\n\nint min(int a, int b) { return a < b ? a : b; }\nint max(int a, int b) { return a > b ? a : b; }\n\nint vv[N + 1], ff[N + 1], gg[N + 1];\n\nvoid init(int md) {\n\tint i;\n\n\tff[0] = gg[0] = 1;\n\tfor (i = 1; i <= N; i++) {\n\t\tvv[i] = i == 1 ? 1 : (long long) vv[i - md % i] * (md / i + 1) % md;\n\t\tff[i] = (long long) ff[i - 1] * i % md;\n\t\tgg[i] = (long long) gg[i - 1] * vv[i] % md;\n\t}\n}\n\nint main() {\n\tstatic int dp[N + 1][N + 1];\n\tint n, md, a, b, k, l, s, ans;\n\n\tscanf(\"%d%d\", &n, &md), init(md);\n\tans = 0;\n\tfor (a = 1; a\t<= n + 1; a++) {\n\t\tfor (k = 0; k <= n; k++)\n\t\t\tmemset(dp[k], 0, (a + 1) * sizeof *dp[k]);\n\t\tdp[0][0] = 1;\n\t\tfor (b = a; b <= n + 1; b++) {\n\t\t\tfor (k = n; k >= 0; k--)\n\t\t\t\tfor (s = 0; s + (n - k) * (b - a) <= a && s + k * a <= a * (b - 1); s++) {\n\t\t\t\t\tint x = dp[k][s], k_, s_, lower, upper;\n\n\t\t\t\t\tif (x == 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t/* l >= 1\n\t\t\t\t\t * k + l <= n\n\t\t\t\t\t * s + l * (b - a) + (n - (k + l)) * (b + 1 - a) <= a\n\t\t\t\t\t * s + l * (b - a) + (k + l) * a <= a * b\n\t\t\t\t\t *\n\t\t\t\t\t * l >= 1\n\t\t\t\t\t * l <= n - k\n\t\t\t\t\t * l >= s + (n - k) * (b + 1 - a) - a\n\t\t\t\t\t * l <= (a * b - s - k * a) / b\n\t\t\t\t\t */\n\t\t\t\t\tlower = max(1, s + (n - k) * (b + 1 - a) - a);\n\t\t\t\t\tupper = min(n - k, (a * b - s - k * a) / b);\n\t\t\t\t\tfor (l = lower; l <= upper; l++) {\n\t\t\t\t\t\tk_ = k + l, s_ = s + l * (b - a);\n\t\t\t\t\t\tdp[k_][s_] = (dp[k_][s_] + (long long) dp[k][s] * gg[l]) % md;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (b == a)\n\t\t\t\tdp[0][0] = 0;\n\t\t}\n\t\tfor (s = 0; s <= a; s++)\n\t\t\tans = (ans + (long long) dp[n][s] * ff[n]) % md;\n\t}\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c0843eaf36706493f2236fcd061bf32a", "src_uid": "cf57508de47d80bc983861f70bb5f3d6", "apr_id": "7e2176a9dd0cbb5202d8c567a099b7a9", "difficulty": 3200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"}