{"similarity_score": 0.9427792915531336, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n int n;\n scanf(\"%d\" ,&n);\n if(n%2==0)\n printf(\"white\");\n printf(\"1 2\");\n else\n printf(\"black\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "2cf9b1015bf57e07ed2b9250633648df", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "a25e786d15efab5f1c46cccd4c089cca", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9702127659574468, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(){\n\tint n;\n\tscanf(\"%d\", &n);\n\tprintf(n % 2 == 0 ? \"1 2\\n\" : \"black\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "60e4873e330a611277d61063210519d6", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "0608be6281f0881df0e77652104598de", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.946199829205807, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \nusing namespace std;\n\nint main() {\n\tint n1,n2;\n\tscanf(\"%d %d\",&n1,&n2);\n\tint a[10],b[10];\n\tint i;\n\tfor(i=0;i<10;i++)\n\ta[i]=b[i]=0;\n\tfor(i=0;i\n#include\nint main()\n{\nint a[100], n,i,c1=0,c0=0,j,count;\n\n\tscanf(\"%d\",&n);\n\n\nfor(i=0;i\n#include\n#include\nint main()\n{\n int x1,y1,x2,y2,x,y;\n scanf(\"%d %d %d %d\",x1,y1,x2,y2);\n int n,m;\n n=abs(x1-x2);\n m=abs(y1-y2);\n if((n==0&&m%y==0)||(m==0&&n%x==0))\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n return 0;\n \n}", "lang": "GNU C", "bug_code_uid": "a65d21cc11d2079224526832aa613a24", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "adc0f923b20c01f54f7c68173fdcee68", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.45146726862302483, "equal_cnt": 21, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 20, "bug_source_code": "#include\nint main()\n{\n int a,b,c,d,e,f;\n scanf(\"%d%d%d%d%d%d\",&a,&b,&c,&d,&e,&f);\n a=abs(a-c);\n b=abs(b-d);\n if(a>b){\n if(a%e==0 && b%f==0 && a%b==0)\n {printf(\"YES\");}\n else {printf(\"NO\");}}\n else {\n if(a%e==0 && b%f==0 && a%b==0)\n {printf(\"YES\");}\n else {printf(\"NO\");}}\n}\n", "lang": "GNU C", "bug_code_uid": "8b390cd8518bc3a1a06cd9e2ec47a9f9", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "e41ce2b89ab636c9fd34ff3008545548", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3939601921757035, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "#include\n#include\nint main()\n{\n int a,b,c,d,e,f,n,m;\n scanf(\"%d%d%d%d%d%d\",&a,&b,&c,&d,&e,&f);\n int x=a;\n int y=b;\n if(a>=0 && c>=0)|| (a<0 && c<0))\n {\n a=abs(a-c);\n }\n else\n {\n a=abs(a+c);\n }\n if(b>=0 && d>=0)|| (b<0 && d<0))\n {\n b=abs(b-d);\n }\n else\n {\n b=abs(b+d);;\n }\n n=a/e;\n m=b/f;\n if(n!=m && (x!=c && y!=d))\n{\n printf(\"NO\");\n }\n else\n {\n if(a>b)\n {\n if(a%e==0 && b%f==0 && a%b==0)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n }\n else\n {\n if(a%e==0 && b%f==0 && a%b==0)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n }\n }\n}\n", "lang": "GNU C", "bug_code_uid": "4fd8f61b6ca6ec2959a94496f63df9db", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "e41ce2b89ab636c9fd34ff3008545548", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7813163481953291, "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 x1,x2,y1,y2,a,b;\n int t1,t2;\n scanf(\"%d%d%d%d%d%d\",&x1,&y1,&x2,&y2,&a,&b);\n t1=(x2-x1)/a;\n t2=(y2-y1)/b;\n if((t1-t2)%2==0)printf(\"YES\");\n else printf(\"NO\");\n}\n", "lang": "GNU C", "bug_code_uid": "98c77ce0465b24f3f9701e217f274ad9", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "21e1042899d74fcc267f306e574405ca", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9776422764227642, "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#define N 1000\n\nvoid swap(int *p,int *q)\n{\n int temp;\n temp = *p;\n *p = *q;\n *q = temp;\n}\n\nint a[N];\n\nint main()\n{\n while(1)\n {\n for(int i = 0; i < 3; i ++)\n {\n scanf(\"%d\", &a[i]);\n for(int j = 0; j < i; j ++)\n {\n if(a[i] < a[j]) swap(a + i, a + j);\n }\n }\n printf(\"%d\\n\", a[2] - a[0]);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "2c40ac6e689f210e87a6bfdc4a607e14", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "68cca1bd97ddd203d07b673fed4c8fc3", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.14915254237288136, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n\tint a[3],i,j,k,min;\n\tfor (i=0; i<3; i++)\n\t\tscanf(\"%d\",&a[i]);\n\tfor (i=0; i<3; i++)\n\t{\n\t\tmin=i;\n\t\tfor (j=i+1; j<3; i++)\n\t\t{\n\t\t\tif(a[j]\n\nint main()\n{\n int n,i,max_zero=0,max_one=0,zero=0,one=0,start,end,start2,end2;\n scanf(\"%d\",&n);\n int a[n+1];\n for(i=0;imax_zero)\n {\n max_zero=zero;\n end=i;\n }\n }\n else\n zero=0;\n if(a[i]==1)\n {\n one++;\n if(one==1)\n start2=i;\n if(one>max_one)\n {\n max_one=one;\n end2=i;\n }\n }\n else\n one=0;\n }\n if(a[start-1]==1 && start-1>=0)\n max_zero++;\n if(a[end+1]==1 && end+1=0) || (a[end2+1]==0 && end2+1max_one)\n printf(\"%d\\n\",max_zero);\n else\n printf(\"%d\\n\",max_one);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "45514d2dc4ec1433d103b6759a11d4c2", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "f2b321a7aad26c8bd197abd85cf8fac5", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint main()\n{\n int n;\n while(scanf(\"%d\", &n))\n {\n if(n % 2 != 0)\n printf(\"Ehab\\n\");\n else\n printf(\"Mahmoud\\n\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "0b6a7dd7a7bd08aa9c8e71f55328f563", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "6900402522e038b7e64679259e09f221", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9068736141906873, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint cross_main[25500];\nint main(){\nint time_h;\nint time_m;\nint a,b,c,d,e,f;\nscanf(\"%d%d\",&a,&b);\nscanf(\"%d%d\",&c,&d);\ngetchar();\nscanf(\"%d:%d\",&time_h,&time_m);\nint i,m; int cnt=0;\nfor(i=time_h*60+time_m;i<=(time_h*60)+time_m+b;i++){\n cross_main[i]=1;\n}\nfor(i=300;i<=(time_h*60)+time_m+b;i+=c){\nint flag=0;\nfor(m=i+1;m<=i+d;m++){\nif(cross_main[m] == 1)\nflag=1;\n}\nif(flag){\n cnt++;\n}\n}\nprintf(\"%d\",cnt);\n}\n", "lang": "GNU C", "bug_code_uid": "840fa269d4b68c7d6df192abaa1b999a", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "cb7691c0deadc4d883e8e30c141c1c2e", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.918918918918919, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n int a,ta,b,tb,x=5,y=0,h,m,k=0,m2,h2,p,q,s,t;\n char c;\n scanf(\"%d %d %d %d %d%c%d%c\",&a,&ta,&b,&tb,&h,&c,&m,&c);\n h2=h;\n m2=m;\n q=ta/60;\n p=ta%60;\n h2+=q;\n m2+=p;\n if(m2/60!=0)\n {\n h2+=(m2/60);\n m2%=60;\n }\n //printf(\"%d:%d\\n%d:%d\\n\",h,m,h2,m2);\n //printf(\"---*****--\\n\");\n while(1)\n {\n s=x;\n t=y;\n q=(tb/60);\n p=(tb%60);\n x+=q;\n y+=p;\n if(y/60!=0)\n {\n x+=(y/60);\n y%=60;\n }\n if(s<=h2)\n {\n if(s==h2 && tm) k++;\n else if(x>h) k++;\n }\n else if(sm) k++;\n else if(x>h) k++;\n }\n }\n else if(s>=h2 && t>=m2) break;\n //printf(\"%d:%d\\n%d:%d\\n\",s,t,x,y);\n //printf(\"-----\\n\");\n y=t+b;\n x=s;\n if(y/60!=0)\n {\n x+=(y/60);\n y%=60;\n }\n }\n printf(\"%d\\n\",k);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ff4acb4bb0798382ee83a1da3ecf9dc1", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "486c3d68c0caf8efef42293f0b987ca8", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9777158774373259, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n#include \nint main() {\n\tint a, ta, b, tb;\n\tscanf(\"%d%d%d%d\", &a, &ta, &b, &tb);\n\tint h, min;\n\tscanf(\"%d%*c%d\", &h, &min);\n\tmin += h * 60 - 300;\n\t\n\tint bdepart = min - tb > 0 ? min - tb : 0;\n\n\tint ar = min + ta > 1140 ? 1140 : min + ta;\n\n\tprintf(\"%d\\n\", (ar - 1) / b - (bdepart) / b + (bdepart == 0));\n}\n", "lang": "GNU C", "bug_code_uid": "bb1b3c4e32488fa8c5ae552598bd7e32", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "c48191a41a91e2e451ad79bfc2831e91", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.15579710144927536, "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 a,ta,b,tb,h,m,i,k,j;\n scanf(\"%d %d\",&a,&ta);\n scanf(\"%d %d\",&b,&tb);\n scanf(\"%d %d\",&h,&m);\n i=(h*60)+m-(5*60)+ta;\n j=i/b;\n k=-((i-tb)/b)-1+j+(ta/b);\n if ((i-tb)/b==1){\n k=k-1;\n // printf(\"%d\",k);\n }\n\n printf(\"%d\",k);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "65c36b5efe70c6a539f8066756568e49", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "c606a772791e23655b7ee65bb6987875", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.08532176428054954, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "#include\nchar s[100];\nint main() {\n int k = 0,true=1, n, pos = 1, neg = 0;\n while (true) {\n char c;\n scanf(\" %c\", &c);\n scanf(\" %c\", &c);\n\n if (c == '=') break;\n if (c == '+') pos++;\n if (c == '-') neg++;\n\n s[k++] = c;\n }\n\n scanf(\"%d\", &n);\n\n if (pos - n * neg > n || n * pos - neg < n) {\n printf(\"Impossible\\n\");\n\n return 0;\n }\n\n printf(\"Possible\\n\");\n\n int S = 0,i=0,x=1;\n for (i = 0; i < k; i++) {\n int sgn = 1;\n if (i > 0 && s[i - 1] == '-') sgn = -1;\n\n if (sgn == 1) pos--;\n if (sgn == -1) neg--;\n for (x = 1; x <= n; x++)\n {\n if (S + x * sgn + pos - n * neg <= n && S + x * sgn + n * pos - neg >= n) {\n printf(\"%d %c \", x, s[i]);\n\n S += x * sgn;\n\n break;\n }\n }\n\t}\n\n printf(\"%d = %d\\n\", abs(n), n);\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "a3f7ad2cb6369fdec251f4c1b4176a54", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "b3eeb9cb9e5bfc5e37537f675fa4b47b", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9885321100917431, "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 a,ta;\n\tscanf(\"%d%d\",&a,&ta);\n\tint b,tb;\n\tscanf(\"%d%d\",&b,&tb);\n\tint h,m;\n\tscanf(\"%d:%d\",&h,&m);\n\tint x,y,w=0,z=300;\n\tx=60*h+m;\n\ty=60*h+m+ta;\n\tjump:\n\t\tif(z+tbx && zy)\n\t\t{\n\t\t\tgoto temp;\n\t\t}\n\t\telse if(z+tb==x || z==y)\n\t\t{\n\t\t\tz=z+b;\n\t\t\tgoto jump;\n\t\t}\n\t\ttemp:\n\t\tprintf(\"%d\\n\",w);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "8e95865e0ae818aeebf9dac36a1ad0a4", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "b3eeb9cb9e5bfc5e37537f675fa4b47b", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4750733137829912, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint main() {\n\tlong long i, p, q, d, k;\n\n\tscanf(\"%lld%lld\", &p, &d);\n\tk = 1;\n\tfor (i = 0; ; i = 10 * i + 9) {\n\t\tq = p / (i + 1) - 1;\n\t\tif (p - (q * k + i) > d) {\n\t\t\tk /= 10;\n\t\t\ti /= 10;\n\t\t\tbreak;\n\t\t}\n\t\tk *= 10;\n\t}\n\tq = p / (i + 1) - 1;\n\tprintf(\"%lld\\n\", q * k + i);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "89c080ca120b50b7188c266d14a7662b", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "c37c571f78841abdfb7bb71925623ebb", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21198957428323198, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n#include \n\nint main()\n{\n const int c =(pow(10,3));\n const int d =(pow(10,9));\n int n;\n\n do\n {\n scanf(\"%d\",&n);\n }while(!((n>=1) && (n<=c)));\n\n int i;\n int T[c] ;\n\n\n for(i=0;i=1)&& (T[i]<=d)));\n }\n int j;\n int s;\n for (i=0;i\n#include\n#include\n#include\nint main()\n{\n int a,b,c,i,j,;\n scanf(\"%d %d %d\",&a,&b,&c);\n printf(\"%d\",(c-1)*(a+b-1)+2*b);\n // getch();\n return(0);\n}\n", "lang": "GNU C", "bug_code_uid": "3b3e4b23082756f0944376fd5652d543", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "18c8250765c12d4dfca6a0a61ab97934", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.07876447876447877, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n\n\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 /* create temp arrays */\n int L[n1], R[n2]; \n \n /* Copy data to temp arrays L[] and R[] */\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 /* Merge the temp arrays back into arr[l..r]*/\n i = 0; // Initial index of first subarray \n j = 0; // Initial index of second subarray \n k = l; // Initial index of merged subarray \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 /* Copy the remaining elements of L[], if there \n are any */\n while (i < n1) \n { \n arr[k] = L[i]; \n i++; \n k++; \n } \n \n /* Copy the remaining elements of R[], if there \n are any */\n while (j < n2) \n { \n arr[k] = R[j]; \n j++; \n k++; \n } \n} \n \n/* l is for left index and r is right index of the \n sub-array of arr to be sorted */\nvoid mergeSort(int arr[], int l, int r) \n{ \n if (l < r) \n { \n // Same as (l+r)/2, but avoids overflow for \n // large l and h \n int m = l+(r-l)/2; \n \n // Sort first and second halves \n mergeSort(arr, l, m); \n mergeSort(arr, m+1, r); \n \n merge(arr, l, m, r); \n } \n} \n\n\n\nint main(){\n\tint n,m,r;\n\tscanf(\"%d %d %d\",&n,&m,&r);\n\tint s[n];\n\tint s_min;\n\tint b_temp = 0;\n\tint b_max = 0;\n\tint buy = 0;\n\tint flag = 0;\n\tfor(int i=0;i b_max){\n\t\t\tb_max = b_temp;\n\t\t}\n\t}\n\tif(s_min >= b_max){\n\t\tprintf(\"%d\\n\",r);\n\t}\n\telse{\n\t\tbuy = r/s_min;\n\t\tr = r-b*s_min;\n\t\tint count = r + buy*b_max;\n\t\tprintf(\"%d\\n\",count);\n\t}\n\n}", "lang": "GNU C11", "bug_code_uid": "9b6fd176e4f1475c3e827b7ccf9ae616", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "a17a2cabfd7b5e7ef785e52a563536bf", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8726003490401396, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include \nint main()\n{\n int n,m,r;\n scanf(\"%d %d %d\",&n,&m,&r);\n int s[n],b[m];\n int i,j;\n for(i=0;imax)\n max=b[j];\n }\n int ans;\n if(max>min)\n {\n ans=*(max-min)*5)+r;\n }\n else\n ans=r;\n printf(\"%d\",ans);\n}\n ", "lang": "GNU C11", "bug_code_uid": "75a048bef706d6f18d96a0f1a8a2f45b", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "7bb2e187ec40f23a34b1c5078f5a825f", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9946865037194474, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,m,r,s1[31],s2[31];\n int min_s=1001, max_b=0;\n scanf(\"%d %d %d\",&n,&m,&r);\n for(int i=0;i s1[i] ? s1[i] : min_s;\n }\n for(int i=0;i=max_b)\n printf(\"%d\",r);\n else\n printf(\"%d\",r+(r/min_s)*(max_b-min_s));\n}\n", "lang": "GNU C11", "bug_code_uid": "1a0f447ce4db48789797bd9573ea15d8", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "5b761b813d437547374f9dba8da791ee", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.29022704837117475, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \nint func(const void * a,const void *b)\n{\n return ( *(int*)b - *(int*)a );\n}\nint main()\n{\n int i,j,n,m,r,s[1005],b[1005],x=0,t;\n scanf(\"%d %d %d\",&n,&m,&r);\n t=r;\n for (i=0;ir)\n r=t;\n printf(\"%d\\n\",r);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9c114ae4f8f2d732f88972db9a8d581d", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "800d51c6c28926eeaa256409df8a1692", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6270543615676359, "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\tint a1,b1,c1,k,i,j,z;\n\tscanf(\"%d%d%d\",&a1,&b1,&c1);\n\tz=0;\n\tif(a1>(b1+c1)) z=2;\n\tif(b1>(a1+c1)) z=2;\n\tif(c1>(a1+b1)) z=2;\t\n\tif(z==0)\n\t\tfor(i=0;i<=a1;i++)\n\t\t{\t\n\t\t\tfor(j=0;j<=b1;j++)\n\t\t\t{\n\t\t\t\tfor(k=0;k<=c1;k++)\n\t\t\t\t{\t\t\n\t\t\t\t\tif (a1==(i+k) && b1==(i+j) && c1==(j+k)) {z=1;break;}\n\t\t\t\t}\n\t\t\t\tif(z==1) break;\n\t\t\t}\n\t\t\tif(z==1) break;\n\t\t}\n\tif (z==1) printf(\"%d %d %d\",i,j,k);\n\telse printf(\"Impossible\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a05002c0323b14100508b8d981a9afbb", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "cf2b741e9b8705568488e1b702cb3fcf", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8125, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "/*Codeforces Round #200 (Div. 2) B. Simple Molecules*/\n#include \nint Max(int a[],int n);\nint main()\n{\n int a[4],x,y,z,i,max;\n for (i=1;i<=3;i++)\n scanf (\"%d\",&a[i]);\n max=Max(a,3);\n i=0;\n for (x=0;x<=max;x++)\n {\n for (y=0;y<=max;y++)\n {\n for (z=0;z<=max;z++)\n {\n if (x+y==a[2]&&y+z==a[3]&&x+z==a[1])\n {\n printf (\"%d %d %d\\n\",x,y,z);\n i=1;\n break;\n }\n }\n }\n }\n if (i==0)\n printf (\"Impossible\\n\");\n return 0;\n}\nint Max(int a[],int n)\n{\n int max=a[1],i;\n for (i=2;i<=n;i++)\n {\n if (max\n\nint main(void) {\n int a[3],i,j,n,f=0,g;\n for(i=0;i<3;i++)\n {\n scanf(\"%d\",&a[i]);\n }\n n=a[0];\n for(i=0;i<=n;i++)\n {\n if((a[1]-i)==(a[2]-n+i))\n {\n if(a[i]-i<0 || a[2]-n+i<0)\n continue;\n f=1;\n break;\n }\n \n }\n if(f==1)\n printf(\"%d %d %d\",i,a[1]-i,n-i);\n else\n printf(\"Impossible\");\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c59aa5f01a7270d871f84a8fa1260aa7", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "510f4f643a3d73b3844ece893978d462", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4491279069767442, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n\nint main(int argc, char *argv[])\n{\n int a, b, c;\n int x, y, z;\n int m1, m2, m3;\n int f;\n while(scanf(\"%d%d%d\",&a, &b, &c) != EOF)\n {\n f = 1;\n m1 = a > b ? a : b;\n m2 = b > c ? b : c;\n m3 = a > c ? a : c;\n for(x = 0; x <= m1; x++)\n {\n for(y = 0; y <= m2; y++)\n {\n for(z = 0; z <= m3; z++)\n {\n if((x + y == b)&&(x+z == a)&&(y+z == c))\n {\n printf(\"%d %d %d\\n\", x, y, z);\n f = 0;\n break; \n } \n } \n } \n }\n if(f)\n printf(\"Impossible\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d3bef11eb7ff1f6f8121536f54d6bc99", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "2ee61f9ba321f969e8508b549186a1c3", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8007889546351085, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main(){\n int a,b,c;\n \n scanf(\"%d %d %d\",&a,&b,&c);\n \n if( ((a+b-c)/2)<0 || ((-a+b+c)/2)<0 || ((a-b+c)/2)<0 || ((a+b+c)%2) ) ){\n printf(\"Impossible\");\n }\n else{\n printf(\"%d %d %d\",((a+b-c)/2),((-a+b+c/2)),((a-b+c)/2));\n }\n\n\n}", "lang": "GNU C", "bug_code_uid": "baee002faf95c1a09f79086afd71e06c", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "75c3e4f4af8473ee96bf5fe833c65cf5", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.29442970822281167, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nmain()\n{\n\tint a,b,i=1,j=1,k=0;\n\tchar t[101];\n\tchar tab[101][2];\n\t\nscanf(\"%d%d\",&a,&b);\nscanf(\"%s\",&t);\n//printf(\"%s\",t);\n\nif(a%b){\nprintf(\"NO\");}\nelse\n{\ntab[0][0]=t[0];\ntab[0][1]=1;\nwhile(t[i]!='\\0')\n{\n for(k=0;kb)\n\t\tprintf(\"NO\");\n\t\telse \n\t\tprintf(\"YES\");\n\t}\n\t\n}\n\nreturn 0;\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "6c59c5e14509074497e0263fd376c9f0", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "88b214618d3b5d529d4588cc62e766f9", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9844961240310077, "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,j,count,ans=0;\nscanf(\"%d %d\",&n,&k);\nchar *ar;\nscanf(\"%s\",ar);\nfor(i=0;ians)\nans=count;\n}\nans>k?printf(\"NO\\n\"):printf(\"YES\\n\");\nreturn 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "f10940800af6dac378bc8c12ef178aa0", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "5b9276cff9790b2b76ac6f9b2e9b4226", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9657320872274143, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main(){\n int w;\n scanf(\"%d\",&w);\n if((!(w%2)) && (w!=0))\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n return 1;\n}\n", "lang": "GNU C", "bug_code_uid": "ee8c8861a2637f9d93a6d6ef62bc1ae3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "9f12f0768a9bb6e15c96aec9cad21aa3", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4715909090909091, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n#define ll long long\nll l,r,x,y,ans,tmp,i;\nll gcd(ll a,ll b){while(b)b^=a^= b^=a%=b;return a;}\nint main(){\n scanf(\"%I64d%I64d%I64d%I64d\", &l,&r,&x,&y);\n if(y%x) printf(\"0\\n\"); else\n for(i=x ; i*i<=y ; i+=x){\n tmp = x*y/i;\n if(i>=l && tmp<=r && gcd(i,tmp)==x) ans+=2;\n }\n if(x==y && x>=l && x<=r) ans++;\n printf(\"%I64d\\n\", ans);\n}", "lang": "GNU C11", "bug_code_uid": "b6e124e13bfbd64f0ff0dc0dd82c4bc2", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "656e7017d18192bafec6a3b206877e3a", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6649122807017543, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "#include \n\nint gcd(int, int);\n\nint main() {\n int i, j, l, r, x, y, count;\n count = 0;\n scanf(\"%d %d %d %d\", &l, &r, &x, &y);\n if (!(y % x))\n {\n for (i = l / x; i <= r / x; i++)\n {\n for (j = l / x; j <= r / x; j++)\n {\n if ((i * j == y / x) && (gcd(i, j) == 1)) count++;\n }\n }\n }\n printf(\"%d\", count);\n return 0;\n}\n\nint gcd(int a, int b)\n{\n if (!b) return a;\n else return gcd(b, a % b);\n}", "lang": "GNU C11", "bug_code_uid": "de2ec572db9baed55894abe6f6b9f463", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "c5973f36de0a2b23a8a80fe825b3737d", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9855703784372447, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n#include\nlong long Veci(long long a,long long b)\n{\n if (a>b)\n return a;\n else return b;\n}\nvoid swap(long long* a,long long* b)\n{\n long long c;\n c=*a;\n *a=*b;\n *b=c;\n}\nlong long Partition(long long *A, long long left, long long right)\n{\n long long pivot = A[right], i = left, x;\n\n for (x = left; x < right; x++){\n if (A[x] <= pivot){\n swap(&A[i], &A[x]);\n i++;\n }\n }\n\n swap(&A[i], &A[right]);\n return i;\n}\nvoid QuickSort(long long Niz[],long long Levo,long long Desno)\n{\n if(Levo=l)\n br2++;\n }\n if (br2==0)\n printf(\"%lld\",r-l+1);\n else if (br2==r-l+1)\n printf(\"0\");\n else {\n QuickSort(C,0,br2-1);\n for(i=1;iraz)\n raz=praz;\n }\n if (l!=C[0])\n raz=Veci(C[0]-l,raz);\n if (r!=C[br2-1])\n raz=Veci(r-C[br2-1],raz);\n printf(\"%lld\",raz);\n }\n long long x;\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "995041a1eee44d0d21ff4be191b8f670", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "e45661f71741ef51abf6adc58d11dfae", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6576605553768629, "equal_cnt": 174, "replace_cnt": 168, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 174, "bug_source_code": "#include \n#include \n#include \ntypedef long long ll;\nll MIN = 1111111111111111111;\nll MAX = -1111111111111111111;\nll max = -1111111111111111111;\n\n\n\nvoid merge(ll arr[], ll l, ll m, ll r) \n{ \n ll i, j, k; \n ll n1 = m - l + 1; \n ll n2 = r - m; \n \n /* create temp arrays */\n ll L[n1], R[n2]; \n \n /* Copy data to temp arrays L[] and R[] */\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 /* Merge the temp arrays back llo arr[l..r]*/\n i = 0; // Initial index of first subarray \n j = 0; // Initial index of second subarray \n k = l; // Initial index of merged subarray \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 /* Copy the remaining elements of L[], if there \n are any */\n while (i < n1) \n { \n arr[k] = L[i]; \n i++; \n k++; \n } \n \n /* Copy the remaining elements of R[], if there \n are any */\n while (j < n2) \n { \n arr[k] = R[j]; \n j++; \n k++; \n } \n} \n \n/* l is for left index and r is right index of the \n sub-array of arr to be sorted */\nvoid mergeSort(ll arr[], ll l, ll r) \n{ \n if (l < r) \n { \n // Same as (l+r)/2, but avoids overflow for \n // large l and h \n ll m = l+(r-l)/2; \n \n // Sort first and second halves \n mergeSort(arr, l, m); \n mergeSort(arr, m+1, r); \n \n merge(arr, l, m, r); \n } \n} \n \n\nll power(ll x, ll 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\nint main(ll argc, char const *argv[])\n{\n ll T;\n // scanf(\"%lld\",&T);\n T = 1;\n // printf(\"%lld %lld %lld\",MIN,MAX,max);\n for (ll tqw = 0; tqw < T; tqw++)\n {\n ll x,y,l,r ;\n scanf(\"%lld %lld %lld %lld\",&x,&y,&l,&r);\n ll o = l;\n ll xcountl = -1;\n while(o)\n {\n xcountl++;\n o = o/x ;\n }\n\n ll p = r;\n ll xcountr = 0;\n while(p)\n {\n xcountr++;\n p = p/x;\n }\n ll e = r;\n ll ycountr = 0;\n while(e)\n {\n ycountr++;\n e = e/y;\n }\n ll qw = l;\n ll ycountl = -1;\n while(qw)\n {\n ycountl++;\n qw = qw/y;\n }\n \n // printf(\"%lld %lld\\n\",xcountl,xcountr);\n\n ll totalcount = 0;\n ll A[1000000];\n ll idx = 0;\n for(ll s=xcountl;sMAX)\n MAX = A[idx] ;\n if(A[idx]MAX)\n MAX = A[idx] ;\n if(A[idx]max&&A[sd]>0&&A[sd-1]>0)\n max = A[sd]-A[sd-1]-1 ;\n // if(max<0)max=0;\n }\n ll finalanswer = 0;\n ll left = MIN-l;\n if(left<0)left = 0;\n ll right = r-MAX;\n if(right<0)right = 0;\n /* printf(\"l %lld r %lld %lld|\",left,right,max);*/\n if(left>right)\n {\n if(left>max)\n {\n finalanswer = left;\n }\n else \n {\n finalanswer = max ;\n }\n }\n else \n {\n if(right>max)\n {\n finalanswer = right;\n }\n else \n {\n finalanswer = max ;\n }\n }\n // printf(\"<%lld>\",totalcount);\n if(totalcount==0)\n {\n finalanswer = r-l+1 ;\n }\n if(l==1)\n {\n if(r-l+1-totalcount==0)\n printf(\"0\\n\");\n else\n {printf(\"%lld\\n\",finalanswer);}\n }\n\n else{\n if(r-l+1-totalcount==0)\n printf(\"0\\n\");\n else\n { printf(\"%lld\\n\",finalanswer);}\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "cfd31161f6d857239c370834c73d1bc3", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "87652c77b55161dd7d15416ea932739a", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9977116704805492, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint getNumber(){\n int number=0;\n char currentChar=getchar();\n while(currentChar>47&¤tChar<58){\n number*=10;\n number+=currentChar-48;\n currentChar=getchar(); \n }\n return number;\n}\n\nint main(){\n int a=getNumber();\n int b=getNumber();\n if(a>b){\n printf(\"%i %i\",b,(a-b)>>1);\n }else{\n printf(\"%i %i\",a,(b-a)>>1);\n }\n return 1;\n}", "lang": "GNU C11", "bug_code_uid": "32635cf66ebc969f1159a95e37018966", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "59104b132b1832dd5051a4e627615151", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9387096774193548, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n\nint main()\n{\n\tint n;\n\tscanf(\"%d\", &n);\n\t\n\tint arr[n];\n\tint i,j,k;\n\t\n\tfor(i=0;i0)\n\t\t\t\t{\n\t\t\t\t\tarr[j]-=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tright=0;\n\t\tfor(j=0;j\n#include \n\nint main()\n{\n\tint n;\n\tscanf(\"%d\", &n);\n\t\n\tint arr[n];\n\tint i,j,k;\n\t\n\tfor(i=0;i0)\n\t\t\t\t{\n\t\t\t\t\tarr[j]-=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tright=0;\n\t\tfor(j=0;j\n#include \nint main() {\n static int count[27];\n static bool check[27];\n int i,j,s=0,n,max = 0,value;\n count[0] = check[0] = 0;\n scanf(\"%d\",&n);\n for(i=1; i<=n; i++) {\n scanf(\"%d\",&value);\n count[value]++;\n check[value] = 1;\n if(value>max)\n max = value;\n }\n i = max;\n while(i) {\n if(count[i]) {\n s += i;\n count[i]--;\n while(count[i]) {\n j = i - 1;\n while(check[j])\n j--;\n if(j) {\n s += j;\n check[j] = 1;\n }\n count[i]--;\n }\n }\n i--;\n }\n printf(\"%d\",s);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "22d500352c190f38bc278f5b85c9fb3e", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "0bae5f6cc9ead36204e3a1e7827346ee", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8541666666666666, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int m;\n scanf(\"%d\",m);\n if(m%2)\n printf(\"ehab\\n\");\n printf(\"mahmuod\\n\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "fd20235838206be670dcfc1dedcd04b3", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "ed90afb770de8344d978dc3577849eb3", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1634980988593156, "equal_cnt": 18, "replace_cnt": 6, "delete_cnt": 8, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "#include\n#include\n#include\nint main()\n{\n int n,m,a,b;\n int i,j;\n scanf(\"%d\",&n);\n scanf(\"%d\",&m);\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n int mincost[n];\n int cost=0;\n int z=0;\n if(a=n)\n {\n cost=(b*(j/m));\n mincost[z]=cost;\n z++;\n }\n }\n }\n int min=mincost[0];\n for(i=0;imincost[i])\n {\n min=mincost[i];\n }\n }\n printf(\"%d\",min);\n}\n", "lang": "GNU C11", "bug_code_uid": "a80033b5c1af9ee86a2120289aa05c80", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "a45d8a15728b254ce66f1820bdc86e56", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9927243330638642, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint min(int a, int b) {\n return a <= b ? a : b;\n}\n\nint\nmain() {\n int a, ta, b, tb;\n int time_h, time_m;\n scanf(\"%d %d\", &a, &ta);\n scanf(\"%d %d\", &b, &tb);\n scanf(\"%d:%d\", &time_h, &time_m);\n int m = (time_h - 5) * 60 + time_m;\n int bus_b = 0;\n for(int i = 0; i < (24 - 5) * 60; ++i) {\n if (i >= tb && i % b == 0) {\n --bus_b;\n }\n if (i == m) {\n for(int j = i; j < min((24 - 5) * 60, m + ta); ++j) {\n if (j % b == 0) {\n ++bus_b;\n }\n }\n break;\n }\n if (i % b == 0) {\n ++bus_b;\n }\n }\n printf(\"%d\\n\", bus_b);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "1e3db149bd0f02bca02bec7979b2a4db", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "c2d3da5dd8b2008e6870dca3a35d58d6", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8949522510231923, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n\nvoid main() {\n\tchar *s = (char*)malloc(sizeof(char)*101);\n\tscanf(\"%[^\\n]\",s);\n\tint result = 0;\n\tint i=0,j=0;\n\twhile(s[i]!='\\0') {\n\t\tj=i+1;\n\t\tint count = 1;\n\t\twhile(s[j]!='\\0' && s[i]==s[j]) {\n\t\t\tcount++;\n\t\t\tj++;\n\t\t}\n\t\tif(count%2==0) {\n\t\t\tresult++;\n\t\t}\n\t\tif(j=='\\0') {\n\t\t\tbreak;\n\t\t}\n\t\ti=j;\n\t}\n\tprintf(\"%d\",result);\n}\n", "lang": "GNU C11", "bug_code_uid": "54aa507b4b3a3cf1608470f9c594e685", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "20b6dc1eee2937452daa3f28b3f3cca4", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9232643118148599, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \"string.h\"\n#include \"stdio.h\"\nusing namespace std;\n\nint main(){\n char s[101];\n int i, j, len, numA=0, toAdd=0;\n\n scanf(\"%s\", s);\n\n len = strlen(s);\n\n for(i = 0; i < len; i++){\n numA = 0;\n for(j = i; s[i] == s[j]; j++){\n numA++;\n }\n i = j - 1;\n if(!(numA % 2)){\n toAdd++;\n }\n }\n printf(\"%d\\n\", toAdd);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "954e5321b87f7d9e7d56e53125bf1d6f", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "289eb02dd53dfbba6e1a703035624435", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41854636591478694, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n\n#define MAX(a, b) (a>b?a:b)\n#define MIN(a, b) (a\n#include \n\nint main()\n{\n char str[102];\n while ((scanf(\"%s\", str)))\n {\n int length = strlen(str);\n int count = 0;\n int i = 0;\n while (i < length)\n {\n int j = i + 1;\n while (j < length && str[j] == str[j - 1])\n j++;\n\n int diff = j - i;\n if (diff && diff % 2 == 0)\n count++;\n\n i = j;\n }\n print(\"%d\\n\", count);\n }\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "153c4b7255c8bddd921d20cb27008706", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "c28b1adabc4cfede120a623c75ad58cc", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9930898321816387, "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 str[102];\n while ((scanf(\"%s\", str)))\n {\n int length = strlen(str);\n int count = 0;\n int i = 0;\n while (i < length)\n {\n int j = i + 1;\n while (j < length && str[j] == str[j - 1])\n j++;\n\n int diff = j - i;\n if (diff && diff % 2 == 0)\n count++;\n\n i = j;\n }\n printf(\"%d\\n\", count);\n }\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "fe74d5b9ee5e637ecbdb040eb24dadd8", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "c28b1adabc4cfede120a623c75ad58cc", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9984917043740573, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nchar str[101];\nint main()\n{\n scanf(\"%s\", str);\n int len = 1, index = 0, result = 0;\n while(str[index++]) {\n if (str[index] == str[index - 1]) {\n len++;\n } else {\n if (len % 2 == 0)\n result++;\n len = 1;\n }\n }\n printf(\"%d\\n\",result);\n}\n~", "lang": "GNU C11", "bug_code_uid": "55a4d48b26922b3a8a15b9ba3346fd3b", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "e9a5b131e77b194ed29f074a23c55ce1", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8836501901140684, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n\n#define N 100\n\nint main(void)\n{\n size_t n;\n size_t ret;\n size_t p1 = 0;\n size_t p2 = 0;\n static char seq[N + 1];\n\n for (n = 0; n < N; ++n) {\n char byte;\n\n scanf(\"%c\", &byte);\n if ((byte != 'A')\n && (byte != 'T')\n && (byte != 'G')\n && (byte != 'C'))\n break;\n\n seq[n] = byte;\n }\n\n ret = 0;\n while ((p1 < n) && (p2 < n)) {\n if (seq[p1] == seq[p2]) {\n ++p1;\n } else {\n if (((p1 - p2) % 2) == 0) {\n ++ret;\n }\n p2 = p1;\n }\n }\n\n printf(\"%zu\\n\", ret);\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "71fc90309745a73a39fd11e2ef0ff62e", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "28ca7064ac5ce300efea692fa4060316", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9979959919839679, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(void){\nint k;\nscanf(\"%d\", k);\nint cnt[10];\nfor (int i=0; i<10; i++)\ncnt[i] = 2 * k;\nchar c;\nwhile ((c = getchar()) != EOF)\nif (c >= '0' && (c -= '0') <= 9)\nif (!(cnt[c]--)){\nprintf(\"NO\\n\");\nreturn 0;\n}\nprintf(\"YES\\n\");\n}", "lang": "GNU C11", "bug_code_uid": "52877d7cdd1f5f196901d86e3340e4ed", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "9fe7dcd7c73c8da6d37ae2414fcadd55", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9629629629629629, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,i;\n scanf(\"%d\",&n);\n if(n%2==0)\n {\n printf(\"Mahmud\\n\");\n }\n else if(n%2!=0)\n {\n printf(\"Ehab\\n\");\n }\n\n return 1;\n}\n", "lang": "GNU C", "bug_code_uid": "a0579279be4d7f5700b0bec0dba42ff2", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "0be409c838d28b916e7e1223dca5d50b", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.940677966101695, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 10, "bug_source_code": "#include\nmain()\n{\nint n;\nscanf(\"%d\",n);\nif(n%2==0)\nprintf(\"Ehab\");\nelse\nprintf(\"Mahmoud\");\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "d5d0ea15f84d9a3390464c4a5526f04f", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "4bde1bb5d7a06af54b60a45ebbfa6dc6", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7053941908713693, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "\n#include\n\nint main()\n{\n\n int n,a,f=0;\n scanf(\"%d\",&n);\n a=1;\n while(a>0)\n {\n if(a%2!=0)\n {\n f=0;\n a=n-a;\n }\n else\n {\n f=1;\n a=n-a;\n }\n }\n if(f==0)\n printf(\"Ehab\");\n else\n printf(\"Mahmoud\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b25b691ee7afc1df531e1ebfa8719d53", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "98f47687a9ed05c543fc5e923fac6069", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.538860103626943, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n\nint main()\n\n{\n long long n,i,count=0,count1=0;\n\n scanf(\"%lld\",&n);\nlong long a[n];\n for(i=0; icount1 || count==count1)\n printf(\"Mahmoud\");\n\nelse\n printf(\"Ehab\");\n\n}\n", "lang": "GNU C", "bug_code_uid": "d02bee434d0351a8ad0cdc1769fb6317", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "37e0e907c7fc43abf9823d3d30d1ad62", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.71045197740113, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\n\nint main(){\n\tint x[3];\n\tint aux[3];\n\tint dist;\n\tscanf(\"%d %d %d\", &x[0], &x[1], &x[2]);\n\tif(x[0] < x[1] && x[1] < x[2]){\n\t\taux[0]=x[0];\n\t\taux[1]=x[1];\n\t\taux[2]=x[2];\n\t\t}\n\telse if(x[0] > x[1] && x[0] < x[2]){\n\t\taux[0]=x[1];\n\t\taux[1]=x[0];\n\t\taux[2]=x[2];\n\t\t}\n\telse if(x[0] < x[1] && x[1] > x[2]){\n\t\taux[0]=x[0];\n\t\taux[1]=x[2];\n\t\taux[2]=x[1];\n\t\t}\n\telse if(x[0] > x[1] && x[0] > x[2]){\n\t\taux[0]=x[1];\n\t\taux[1]=x[2];\n\t\taux[2]=x[0];\n\t\t}\n\telse if(x[0] > x[1] && x[1] < x[2]){\n\t\taux[0]=x[2];\n\t\taux[1]=x[0];\n\t\taux[2]=x[1];\n\t\t}\n\telse if(x[0] > x[1] && x[1] > x[2]){\n\t\taux[0]=x[2];\n\t\taux[1]=x[1];\n\t\taux[2]=x[0];\n\t\t}\n\tdist = aux[2]-aux[0];\n\tprintf(\"%d\\n\",dist);\n\t\n\treturn dist;\n}\n", "lang": "GNU C", "bug_code_uid": "7b5e4e694646bdaa7746b20db7b682d6", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "6a593a1d9e6823ff11448e72e5cc9e51", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7678571428571429, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\nvoid main()\n{\nint a=9;\n\nif(a%2==0)\n{\nprintf(\"YES\");\n}\nelse\n{\nprintf(\"NO\");\n}\n}", "lang": "GNU C", "bug_code_uid": "fed1d8d606f6efdb1717df599888b395", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2df04dfaa17e38ecbf471229eb828941", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9016333938294011, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "#define _CRT_SECURE_NO_WARNINGS\n\n#include \n#include \n#include \n#include \n#include \n\ntypedef uint64_t uint64; typedef uint32_t uint32;\ntypedef int64_t int64; typedef int32_t int32;\n\n#define finc(i,a,b) for(int32 i=(a);i<=(b);i++)\n#define fdec(i,a,b) for(int32 i=(b)+1;i-->(a);)\n#define in(i,bits) scanf(\"%\"PRId##bits\"\",&i)\n#define uin(i,bits) scanf(\"%\"PRIu##bits\"\",&i)\n#define out(i,bits,c) printf(\"%\"PRId##bits\"%c\",i,c)\n#define uout(i,bits,c) printf(\"%\"PRIu##bits\"%c\",i,c)\n#define end '\\n'\n\n#define mod (int64)(1e9+7)\nint64 C[1001][1001], A[1001];\nint main(void)\n{\n\tC[0][0] = 1;\n\tfinc(i, 1, 1000)\n\t{\n\t\tC[i][0] = 1;\n\t\tC[i][1] = i;\n\t}\n\tfinc(i, 2, 1000)\n\t{\n\t\tfinc(j, 2, i)\n\t\t\tC[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;\n\t}\n\tA[0] = 1, A[1] = 1;\n\tfinc(i, 2, 1000)\n\t\tA[i] = (A[i - 1] * i) % mod;\n\n\tint32 n, x, index;\n\tin(n, 32); in(x, 32); in(index, 32);\n\n\tint32 totalup = n - x, totaldown = x - 1;\n\tint32 cup = 0, cdown = 0;\n\tint32 left = 0, right = n - 1;\n\twhile (left != right)\n\t{\n\t\tint32 mid = (left + right) / 2;\n\t\tif (mid < index)\n\t\t{\n\t\t\tleft = mid + 1;\n\t\t\tcdown++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (mid > index)\n\t\t{\n\t\t\tright = mid;\n\t\t\tcup++;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tint64 a = (C[totaldown][cdown] * A[cdown]) % mod;\n\tint64 b = (C[totalup][cup] * A[cup]) % mod;\n\tint64 ans = (((a * b) % mod) * A[n - 1 - cup - cdown]) % mod;\n\tout(ans, 64, end);\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "1803d333594dbbff2092a4b6265d9e6e", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "92daa7105cf109abab4a9b0d31821b18", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.946236559139785, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#define _CRT_SECURE_NO_WARNINGS\n\n#include \n#include \n#include \n#include \n#include \n\ntypedef uint64_t uint64; typedef uint32_t uint32;\ntypedef int64_t int64; typedef int32_t int32;\n\n#define finc(i,a,b) for(int32 i=(a);i<=(b);i++)\n#define fdec(i,a,b) for(int32 i=(b)+1;i-->(a);)\n#define in(i,bits) scanf(\"%\"PRId##bits\"\",&i)\n#define uin(i,bits) scanf(\"%\"PRIu##bits\"\",&i)\n#define out(i,bits,c) printf(\"%\"PRId##bits\"%c\",i,c)\n#define uout(i,bits,c) printf(\"%\"PRIu##bits\"%c\",i,c)\n#define end '\\n'\n\n#define mod (int64)(1e9+7)\nint64 C[1001][1001], A[1001];\nint main(void)\n{\n\tC[0][0] = 1;\n\tfinc(i, 1, 1000)\n\t{\n\t\tC[i][0] = 1;\n\t\tC[i][1] = i;\n\t}\n\tfinc(i, 2, 1000)\n\t{\n\t\tfinc(j, 2, i)\n\t\t\tC[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;\n\t}\n\tA[0] = 1, A[1] = 1;\n\tfinc(i, 2, 1000)\n\t\tA[i] = (A[i - 1] * i) % mod;\n\n\tint32 n, x, index;\n\tin(n, 32); in(x, 32); in(index, 32);\n\n\tint32 totalup = n - x, totaldown = x - 1;\n\tint32 cup = 0, cdown = 0;\n\tint32 l = 0, r = n;\n\twhile (l index)\n\t\t{\n\t\t\tcdown++;\n\t\t\tr = mid;\n\t\t}\n\t}\n\tint64 a = (C[totaldown][cdown] * A[cdown]) % mod;\n\tint64 b = (C[totalup][cup] * A[cup]) % mod;\n\tint64 ans = (((a * b) % mod) * A[n - 1 - cup - cdown]) % mod;\n\tout(ans, 64, end);\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "6b00d74d2cd328040f3f1f03f737b6ef", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "92daa7105cf109abab4a9b0d31821b18", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.23812709030100335, "equal_cnt": 26, "replace_cnt": 22, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 26, "bug_source_code": "# include \n# include \n# include \n# include \n\nint main ()\n{ \t\n\tlong long n,x,pos;\n\tconst long long mod=1e9+7;\n\tscanf(\"%d %d %d\",&n,&x,&pos);\n long long l=0,r=n;\n long long min=x-1,max=n-x;\n long long mid;\n long long num=1;\n while (l\n# include \n# include \n# include \n\nint main ()\n{ \t\n\tint n,x,pos;\n\tconst int mod=1e9+7;\n\tscanf(\"%d %d %d\",&n,&x,&pos);\n int l=0,r=n;\n int min=x-1,max=n-x;\n int mid;\n int num=1;\n while (l\n\n#define N\t100\n\nstruct ball {\n\tint c, cnt;\n} bb[N];\n\nint count(struct ball *bb, int n, int i) {\n\tint l, r, k;\n\n\tk = bb[i].cnt;\n\tfor (l = i - 1, r = i + 1; l >= 0 && r < n && bb[l].cnt + bb[r].cnt >= 3; l--, r++)\n\t\tk += bb[l].cnt + bb[r].cnt;\n\treturn k;\n}\n\nint main() {\n\tint n, k, x, c_, l, i, max, cnt;\n\n\tscanf(\"%d%d%d\", &n, &k, &x);\n\tc_ = -1;\n\tl = -1;\n\tfor (i = 0; i <= n; i++) {\n\t\tint c;\n\n\t\tif (i < n)\n\t\t\tscanf(\"%d\", &c);\n\t\tif (i == n || c_ != c) {\n\t\t\tl++;\n\t\t\tif (i < n) {\n\t\t\t\tbb[l].cnt = 1;\n\t\t\t\tbb[l].c = (c_ = c);\n\t\t\t}\n\t\t\tc_ = c;\n\t\t} else\n\t\t\tbb[l].cnt++;\n\t}\n\tmax = 0;\n\tfor (i = 0; i < l; i++)\n\t\tif (bb[i].c == x && bb[i].cnt == 2) {\n\t\t\tcnt = count(bb, l, i);\n\t\t\tif (max < cnt)\n\t\t\t\tmax = cnt;\n\t\t}\n\tprintf(\"%d\\n\", max);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "895348580c9614b7d39da8248605981d", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "bd8d639e5e3add0451d052d787b7dce1", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9658314350797267, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nint Destroy(int *Data, int Len)\n{\n int i, j;\n int Pre = Data[0];\n int Con = 1;\n for(i=1; i 2)\n {\n for(j=i-Con; j0 && Data[i-1]!=X)\n {\n Sum = Fun(Data, N, i+1)-1;\n if(Sum > Max)\n {\n Max = Sum;\n }\n }\n }\n printf(\"%d\\n\", Max);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "994cd84b94991a7e4a57ef7348a9562e", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "0f266f07131b02f8c45fe8ac7142db41", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9963045084996305, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint Destroy(int *Data, int Len)\n{\n int i, j;\n int Pre = Data[0];\n int Con = 1;\n for(i=1; i 2)\n {\n for(j=i-Con; j 2)\n {\n return Con + Destroy(Data, Len-Con);\n }\n return 0;\n}\n\nint Fun(int *Data, int Len, int idx)\n{\n int Array[101];\n memcpy(Array, Data, idx*sizeof(int));\n Array[idx] = Data[idx - 1];\n memcpy(Array+idx+1, Data+idx, (Len-idx)*sizeof(int));\n return Destroy(Array, Len+1);\n}\n\nint main()\n{\n int N, K, X, i, Max, Sum;\n int Data[101];\n scanf(\"%d %d %d\", &N, &K, &X);\n for(i=0; i0 && Data[i-1]==X)\n {\n Sum = Fun(Data, N, i+1)-1;\n if(Sum > Max)\n {\n Max = Sum;\n }\n }\n }\n printf(\"%d\\n\", Max);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "406602667b57f453c1d70d7b0cdc20e3", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "0f266f07131b02f8c45fe8ac7142db41", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9855715871254163, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n\nint a[105],b[105];\n\nint n,k,x,ans=0;\n\nint Ins(int pos)\n{\n int l,r,num,flag,now;\n num=0;\n l=pos;r=pos+1;\n if (a[l]==x&&a[r]==x) { num+=2;l=pos-1;r=pos+2;} else return 0;\n do\n {\n flag=0;\n if (a[l]!=a[r]) break; else now=2;\n while (l>1&&a[l-1]==a[l]) { l--;now++; }\n while (r=3) { num+=now;flag=1; }\n if (flag==0) break;\n }while(1);\n if (num>ans) ans=num;\n return 0;\n}\n\nint main()\n{\n int i,j;\n scanf(\"%d %d %d\",&n,&k,&x);\n memset(a,0,sizeof(a));\n for (i=1;i<=n;i++)\n {\n scanf(\"%d\",&a[i]);\n b[i]=a[i];\n }\n if (n==1) ans=0;\n else\n {\n for (i=1;i\n#include \n#include \n#include \n#include \n#include \n\nint ball[128], tmp[128], pre[128], next[128], n, ans;\nvoid merge(int k, int c)\n{\n\tint cnt=-1, i, pa, pb;\n\t\n\tfor (i=k; i!=-1 && tmp[i]==c; i=pre[i]) {\n\t\tcnt++;\n\t\tpa = i;\n\t}\n\tfor (i=k; i!=n && tmp[i]==c; i=next[i]) {\n\t\tcnt++;\n\t\tpb = i;\n\t}\n\tif (cnt >= 3) {\n\t\tans += cnt;\n\t\tif (pre[pa]!=-1 && next[pb]!=n) {\n\t\t\tnext[pre[pa]] = next[pb];\n\t\t\tpre[next[pb]] = pre[pa];\n\t\t}\n\t\telse if (pre[pa] != -1) {\n\t\t\tnext[pre[pa]] = n;\n\t\t}\n\t\telse if (next[pb] != n) {\n\t\t\tpre[next[pb]] = -1;\n\t\t}\n\t\telse {\n\t\t\treturn;\n\t\t}\n\t}\n\tif (pre[pa] != -1)\n\t\tmerge(pre[pa], tmp[pre[pa]]);\n\telse if (next[pa] != n)\n\t\tmerge(next[pa], tmp[next[pa]]);\n\t\n\treturn;\n}\n\nint main(void)\n{\n\tint k, i, j, max, t;\n\n\tscanf(\"%d%*d%d\", &n, &k);\n\tfor (i=0; i max)\n\t\t\t\tmax = ans;\n\t\t}\n\tif (!max)\n\t\tmax = 1;\n\tprintf(\"%d\\n\", max-1);\n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "939ac730df5efc6506931c826066cd49", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "373b07dcfeabf6a13577115ef7b7001f", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9934782608695653, "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,k,x,i,max=0,start,end;\n\tscanf(\"%d%d%d\",&n,&k,&x);\n\tint A[n],consecutive[n-1],count=0,count2=0,temp,temp2,tempcount;\n\tfor(i=0;i=3)\n\t\t\t\ttempcount=tempcount+count2;\n\n\t\t}\n\t\n\t\tif(tempcount>max)\n\t\t\tmax=tempcount;\n\t}\n\tprintf(\"%d\\n\",max );\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "c72d53f9f06379562a2f1576ff3400bb", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "cb93ea79fae0528e990cfe18a05684c7", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9975369458128078, "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 i,n;\n\tint F = 0;\n\tint S = 0;\n\tscanf(\"%d\",&n);\n\tchar s[n+1];\n\tscanf(\"%s\");\n\tfor(i=0 ; i= 'a' && s[i]<= 'z'){\n\t\t\ts[i] = s[i] - 32;\n\t\t\t}\n\t\t}\n\tfor(i=0 ; i<(n-1) ; i++){\n\t\tif(s[i] == 'S' && s[i+1] == 'F'){\n\t\t\tF++;\n\t\t\t}\n\t\telse if(s[i] == 'F' && s[i+1] == 'S'){\n\t\t\tS++;\n\t\t\t}\n\t}\n\tif(F>S){\n\t\tprintf(\"YES\\n\");\n\t\t}\n\telse{\n\t\tprintf(\"NO\\n\");\n\t\t}\n\t\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "31e70a8ab396a69db7c8904e5871d3bb", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "35deff0d0792e7ad9d9f198bff55d7b6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9943246311010215, "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 n;\n scanf(\"%d\",&n);\n char s[50];\n scanf(\"%s\",s);\n int count=0,c=0;\n for(int i=0;ic)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9a011b5411fa13bb7b0f6a8845d0d763", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "4e8cf380b9512fedcd80e463e42f12e0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6683046683046683, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint main()\n{\n int n,i,j=0,k=0;\n scanf(\"%d\",&n);\n char a[n];\n scanf(\"%s\",a);\n for(i=0;ik){\n printf(\"YES\\n\");\n }\n else{\n printf(\"NO\\n\");\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "68ee4aa8dbef177f1021ceb6ac32fcac", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "1fa22bd528f732f49270dab2d2e2e088", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.798941798941799, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n\nint main()\n{\n freopen (\"input.txt\",\"r\",stdin);\n freopen (\"output.txt\",\"w\",stdout);\n int a=0,b=0,c=0;\n scanf (\"%d %d %d\",&a,&b,&c);\n printf (\"%d\",a*b*c-(a-1)*(b-1)*(c-1));\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1cd11964d178c9a7e1a5b7a13b46ef57", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "a77c3c6534558aa101b2a40951a9a407", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "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 \n#include \n#include \n#include \nint main()\n{\n int a,b,c;\n scanf(\"%d%d%d\",&a,&b,&c);\n printf(\"%d\\n\",(b+1)*(c+1)-a*(a-1));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "607bb4bba646ca3f2cd81799db5b4939", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "0b7b8b9305d47a367deab16f38e83a8e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9236111111111112, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nmain()\n{\n int a,b,c;\n scanf(\"%d %d %d\",&a,&b,&c);\n printf(\"%d\",((2*c)+a*(b+a)));\n return 0;\n}\n \n", "lang": "GNU C", "bug_code_uid": "79e63fb63914660a0594e73408c77da2", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "7366a03a723313a771bcc03ae369e1ae", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9743589743589743, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 9, "bug_source_code": "#include\nman()\n{\n int n,k,l,c,d,z,p,y,nl,x,np;\n scanf(\"%d %d %d %d %d %d %d %d\",&n,&k,&l,&c,&d,&p,&nl,&np);\n x=k*l/nl;\n y=c*d;\n z=p/np;\n if(xy&&yz&&y>z)\n printf(\"%d\",z/n);\n}\n", "lang": "GNU C11", "bug_code_uid": "aae3a9dbf9a182f89983fe0901197734", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "8c8751a8ad541a69a6ce3c8df10b0623", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6341463414634146, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int n,k,l,c,d,p,nl,np;\n scanf(\"%d %d %d %d %d %d %d %d\",&n,&k,&l,&c,&d,&p,&nl,&np);\n ///printf(\"n=%d\\nk=%d\\nl=%d\\nc=%d\\nd=%d\\np=%d\\nnl=%d\\nnp=%d\\n\",n,k,l,c,d,p,nl,np);\n int cdt=c*d;\n int drinkt=k*l;\n int s,q,i;\n s=drinkt/nl;\n q=p/np;\n int a[]={cdt,s,q};\n int min=a[0];\n for(i=0;i<3;i++)\n {\n if(a[i]\n#include \n\nint main() {\n int n;\n scanf(\"%d\", &n);\n char s[n];\n scanf(\"%s\", s);\n char alphabet[26] = \"abcdefghijklmnopqrstuvwxyz\";\n int cur = 25;\n int deleted = 0;\n while(cur != 0 && (n - deleted) != 1) {\n int found = 0;\n // printf(\"Cur: %i Str: %s Del: %i\\n\", cur, s, deleted);\n for (int i = 0; i < (n - deleted); i++) {\n if (alphabet[cur] == s[i]) {\n if (i != (n - deleted) - 1) {\n if (alphabet[cur-1] == s[i+1]) {\n for (int j = i; j < n-1; j++) {\n s[j] = s[j+1];\n }\n s[n - deleted - 1] = '\\0';\n found = 1;\n deleted += 1;\n i--;\n }\n }\n if (i != 0) {\n if (alphabet[cur-1] == s[i-1]) {\n for (int j = i; j < n-1; j++) {\n s[j] = s[j+1];\n }\n s[n - deleted - 1] = '\\0';\n found = 1;\n deleted += 1;\n i--;\n }\n }\n }\n }\n\n if (found == 0) {\n cur -= 1;\n }\n }\n printf(\"%d\", deleted);\n}\n// strcpy(&str[idx_to_delete], &str[idx_to_delete + 1]);\n// RemoveAdjacent.c\n", "lang": "GNU C11", "bug_code_uid": "e08e47acb6bc6f115b7ddda8ad8e6c4b", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "2cb6bbaceec5cc18e54b5f657d157b54", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9123989218328841, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "\n#include \n#include \n\n#define in32(x) scanf(\"%d\", &x)\n#define out32(x) printf(\"%d\\n\", (x))\n#define in64(x) scanf(\"%lld\", &x)\n#define out64(x) printf(\"%lld\\n\", (x))\n#define inStr(x) scanf(\"%s\", x)\n#define outStr(x) printf(\"%s\\n\", (x))\n#define fo(a,b,c) for(a=b;a<=c;a++)\n#define of(a,b,c) for(a=b;a>=c;a--)\n\n\n\nvoid sort(int * a, int size) {\n if (size <= 10) {\n \n }\n}\n\n\nint main() {\n char w[101], c;\n \n int ans=0,n,i,j;\n in32(n);\n inStr(w);\n of(c,'z','b') {\n fo(i,0,n) {\n if (w[i]==c && \n ((i && w[i-1]==c-1) ||\n (i\nchar S[102];\nint main()\n{\n\tint i;\n\tint t;\n\tint a;\n\tint n;\n\tint R = 0;\n\tscanf(\"%d\", &n);\n\tscanf(\"%s\", S + 1);\n\tS[0] = 'a';\n\tfor (t = 25; t > 0; t--)\n\t{\n\t\tfor (a = 1; a <= n - R; a++)\n\t\t{\n\t\t\tif (S[a] == 'a' + t)\n\t\t\t{\n\t\t\t\tif (a > 1)\n\t\t\t\t{\n\t\t\t\t\tif (S[a] - 1 == S[a - 1])\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (i = a; i < n - R; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tS[i] = S[i + 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta--;\n\t\t\t\t\t\tR++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (S[a] == 'a' + t)\n\t\t\t{\n\t\t\t\tif (a < n - R)\n\t\t\t\t{\n\t\t\t\t\tif (S[a] - 1 == S[a + 1])\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (i = a; i < n - R; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tS[i] = S[i + 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta--;\n\t\t\t\t\t\tR++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", R);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "a9cb7330cad3871d996930cab2782c9e", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "02061a42d3ef10781acd143f375cf39a", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9807987711213517, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nchar maxChar (char *str)\n{\n char c = str[0];\n\n for ( int i = 1; str[i] != '\\0'; i++)\n {\n if (c < str[i])\n {\n c = str[i];\n }\n }\n return c;\n}\nint testRoutine (char *str)\n{\n for (int i = 0; str[i] != '\\0'; i++)\n {\n if (str[i] == (str[i+1] - 1) || str[i] == (str[i-1] - 1))\n {\n return 1;\n }\n }\n return 0;\n}\n\nvoid search (char *str, char max, int pos)\n{\n if (max == 'a')\n return;\n else if (str[pos] == '\\0')\n {\n return search(str,max-1,0);\n }\n else if (str[pos] != max)\n {\n return search(str, max, pos + 1);\n }\n else if (str[pos] == max)\n {\n while (str[pos] == (str[pos+1] + 1) || str[pos] == (str[pos-1] + 1))\n {\n for ( int i = pos; str[i] != '\\0'; i++)\n str[i] = str[i+1];\n }\n return search(str,max,pos+1);\n }\n else\n {\n return search(str,max,pos+1);\n }\n}\n\nint main ()\n{\n int size;\n scanf(\"%d\", &size);\n char str[size];\n scanf(\"%s\", str);\n char lel;\n\n while (testRoutine(str))\n {\n lel = maxChar(str);\n search(str,lel,0);\n \n }\n\n printf(\"%d\\n\", (size - strlen(str)));\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "31d80983115f0b3a09bdeb8ddf67cb0f", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "e99136c96f09533c9663c3e9c90ae32e", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9231939163498099, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nchar maxChar (char *str)\n{\n char c = str[0];\n\n for ( int i = 1; str[i] != '\\0'; i++)\n {\n if (c < str[i])\n {\n c = str[i];\n }\n }\n return c;\n}\nint testRoutine (char *str)\n{\n for (int i = 0; str[i] != '\\0'; i++)\n {\n if (str[i] == (str[i+1] - 1) || str[i] == (str[i-1] - 1))\n {\n return 1;\n }\n }\n return 0;\n}\n\nvoid search (char *str, char max, int pos)\n{\n if (max == 'a' || str[pos] == '\\0')\n return;\n else if (str[pos] != max)\n {\n return search(str, max, pos + 1);\n }\n else if (str[pos] == max)\n {\n while (str[pos] == (str[pos+1] + 1) || str[pos] == (str[pos-1] + 1))\n {\n for ( int i = pos; str[i] != '\\0'; i++)\n str[i] = str[i+1];\n }\n return search(str,max,pos+1);\n }\n else\n {\n return search(str,max,pos+1);\n }\n}\n\nint main ()\n{\n int size;\n printf(\"enter size and string\\n\");\n scanf(\"%d\", &size);\n char str[size];\n scanf(\"%s\", str);\n char lel;\n\n while (testRoutine(str))\n {\n lel = maxChar(str);\n search(str,lel,0);\n \n }\n printf(\"%s\\n%d\\n\", str, strlen(str));\n printf(\"%d\\n\", (size - strlen(str)));\n\n return 0;\n}\n\n\n\n\n", "lang": "GNU C11", "bug_code_uid": "70c1048a7be227783b6343183a4ec936", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "e99136c96f09533c9663c3e9c90ae32e", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9963717555121406, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \nvoid gogo(char a[], int j, int s, int r)\n{\n for (int k = 0; k < r; k++)\n for (int i = j; i < s; i++)\n {\n a[i] = a[i + 1];\n }\n}\nint main(void)\n{\n int s, counts = 0;\n char a[105] = {0};\n scanf(\"%d\", &s);\n for (int i = 0; i < s; i++)\n {\n scanf(\" %c\", &a[i]);\n }\n for (int i = 'z'; i >= 'a'; i--)\n {\n for (int j = 0; j < strlen(a); j++)\n {\n int num = 0;\n if (a[j] == i)\n {\n if (a[j - 1] == i + 1)\n {\n for (int k = j - 1; k >= 0; k--)\n {\n if (a[k] == a[j - 1])\n {\n num++;\n }\n else\n break;\n }\n gogo(a, j - num, strlen(a), num);\n counts += num;\n if (num != 0)\n {\n j = 0;\n num = 0;\n }\n }\n if (a[j + 1] == i + 1)\n {\n for (int k = j + 1; k < strlen(a); k++)\n {\n if (a[k] == a[j + 1])\n {\n num++;\n }\n else\n break;\n }\n gogo(a, j + 1, strlen(a), num);\n counts += num;\n if (num != 0)\n {\n j = 0;\n num = 0;\n }\n }\n }\n }\n }\n puts(a);\n printf(\"%d\\n\", counts);\n}", "lang": "GNU C11", "bug_code_uid": "97438ecbf0c7dbd6f37c699b68150941", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "3db1aadea444d630aa44b19134f59bfe", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6177474402730375, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nvoid main()\n{\n int i,a,b,x,y,count=0;\n scanf(\"%d%d%d%d\",&x,&y,&a,&b);\n for(i=a; i<=b; i++)\n {\n if(i%x==0)\n {\n if(i%y==0)\n {\n count++;\n }\n }\n }\n printf(\"%d\",count);\n}", "lang": "GNU C", "bug_code_uid": "d25b100118c943c3dd2a93ce3bd1db3c", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "cdc0299fc5544cad9cdd2ca2b9243661", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7442424242424243, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int x,y,a,b,max,lcm,i,ans,d;\n scanf(\"%d %d %d %d\",&x,&y,&a,&b);\n max=y;\n if(x>=y)\n max=x;\n lcm=x*y;\n for(i=max;i<=x*y;i++)\n {\n if(i%x==0&&i%y==0)\n {\n lcm=i;\n break;\n }\n }\n int count=0;\n for(i=a;i<=b;i++)\n {\n if(i%lcm==0)\n count++;\n }\n printf(\"%d\",count);\n return 0;\n}\n ", "lang": "GNU C", "bug_code_uid": "128af29722da9c2ab48d9775b320069d", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "cb891538591c5de6234b943e3f666c52", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.35362997658079626, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \nint main()\n{\n\tint64_t x,y,a,b,i,count=0;\n\tscanf(\"%\"PRId64\" %\"PRId64\" %\"PRId64\" %\"PRId64\" \",&x,&y,&a,&b);\n\tfor(i=a;i<=b;i++)\n\t{\n\t\tif(i%x==0 && i%y==0)\n\t\t\tcount++;\n\t}\n\tprintf(\"%\"PRId64\"\",count);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "372f52b67caa88cf78c654a47857bb4c", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "9880fddb481683ca644e9069d61f6d5d", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.37202380952380953, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "#include \nint main()\n{\n int a,b,x,y,sum,i,j;\n while(scanf(\"%d%d%d%d\",&a,&b,&x,&y)!=EOF)\n {\n sum=0;\n for(i=x;i<=y;i++)\n {\n if(i%a==0)\n break;\n }\n for(j=i/a;j*a<=y;j++)\n {\n if((a*j)%b==0)\n sum++;\n }\n printf(\"%d\\n\",sum);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d728ea1c164f7e10393cb75b5329f2c6", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "89b6e8ab9eea6369f75635bed509ef0c", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6258992805755396, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n#include \n\nlong long int gcd(long long int a, long long int b) {\n\twhile (b != 0) {\n\t\tlong long int t = b;\n\t\tb = a % b;\n\t\ta = t;\n\t}\n\treturn a;\n}\n\nint main(void) {\n\tint l, r, x, y;\n\tscanf(\"%d%d%d%d\", &l, &r, &x, &y);\n\n\tlong long int mul = (long long int) x * y;\n\tint cnt = 0;\n\tfor (long long int i = l; i <= r; i++) {\n\t\tlong long int div = mul/i;\n\t\tif (mul % i != 0 || gcd(i, div) != 1) {\n\t\t\tcontinue;\n\t\t}\n\t\tcnt += div >= l && div <= r;\n\t}\n\n\tprintf(\"%d\\n\", cnt);\n}\n", "lang": "GNU C11", "bug_code_uid": "34d9bc253dd5318decce436a950bfeeb", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "a51133456aeb8788a4e4ad7a144136a3", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9890664423885618, "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\nlong long int gcd(long long int a, long long int b) {\n\twhile (b != 0) {\n\t\tlong long int t = b;\n\t\tb = a % b;\n\t\ta = t;\n\t}\n\treturn a;\n}\n\nint main(void) {\n\tint l, r, x, y;\n\tscanf(\"%d%d%d%d\", &l, &r, &x, &y);\n\n\tif (y % x != 0) {\n\t\tprintf(\"0\\n\");\n\t\treturn 0;\n\t}\n\ty /= x;\n\tl /= x;\n\tr /= x;\n\n\tint cnt = 0;\n\tfor (long long int a = 1; a*a <= y; a++) {\n\t\tif (y % a != 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tlong long int b = y/a;\n\t\tif (gcd(a, b) == 1\n\t\t\t&& a >= l && a <= r\n\t\t\t&& b >= l && b <= r) {\n\t\t\tcnt += 1 + (a != b);\n\t\t}\n\t}\n\tprintf(\"%d\\n\", cnt);\n}\n", "lang": "GNU C11", "bug_code_uid": "2a607f0cc8d5a0abc38ceee1f86da3cb", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "a51133456aeb8788a4e4ad7a144136a3", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9982014388489209, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//489nastyastudiesinformatics\n#include\ntypedef long long ll;\nvoid swap(ll *a,ll *b)\n{\n *a^=*b;\n *b^=*a;\n *a^=*b;\n}\nll gcd(ll a, ll b)\n{\n while(b)\n {\n a %= b;\n swap(&a,&b);\n }\n return a;\n}\nint main()\n{\n ll l,r,x,y;\n scanf(\"%lld %lld %lld %lld\",&l,&r,&x,&y);\n if(y%x)\n {\n printf(\"0\\n\");\n return 0;\n }\n y=y/x;\n ll i,c;\n for( i=1,c=0 ;i*i<=y;i++)\n if(y%i==0 && x*i>=l && (x*y)/i<=r && gcd(i,y/i)==1)\n //or gcd(x*i,x*(y/i))==x,then lcm will also be y(a*b=x*y)\n c += 1 + (i!=1);\n printf(\"%lld\\n\",c);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6291ba5ba11d7d53caae4268d90dce8d", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "7a726978c5aa8baa0aae48ec2bf5d6a8", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9606936416184971, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include \nint gc,lm;\nint check(int a, int b) // checking gcd lcm\n{\n int r,min,max;\n if (a>=b) {max=a; min=b;}\n else {max=b; min=a;}\n while (1)\n {\n r=max%min;\n if (r==0) break;\n max=min;\n min=r;\n }\n r=(a/min)*b;\n if (gc==min && lm==r) return 1;\n else return 0;\n}\nint main()\n{\n int h,l,i,j,k=0,r,count=0;\n int ar[40000];\n scanf(\"%d %d %d %d\",&l,&h,&gc,&lm);\n for (i=l; i*i<=lm; i++)\n {\n if (i>h) break;\n if (lm%i==0)\n {\n r=lm/i;\n if (r==i) ar[++k]=r;\n else\n {\n if (r<=h) ar[++k]=r;\n if (i<=h) ar[++k]=i;\n }\n }\n }\n for (i=1; i<=k; i++)\n {\n for (j=i; j<=k; j++)\n {\n r=check(ar[i],ar[j]);\n if (r)\n {\n if (ar[i]==ar[j]) count++;\n else count+=2;\n }\n }\n }\n printf(\"%d\\n\",count);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "d5d3102f36bb589398070a95a55f2798", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "ddd0bc346e4b4e7520f2f6ca56dfd900", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2587800369685767, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\n\nmain()\n{\n int w,p,i;\n\n printf(\"Give weight\");\n\n scanf(\"%d\",&w==EOF);\n\n while((w%2==0)&&(1<=w || w<=100))\n {\n p=w/2;\n\n if(p%2!=0)\n {\n\n printf(\"No\");\n\n break;\n }\n\n else\n {\n\n printf(\"yes\");\n\n break;\n }\n\n }\n\n }\n", "lang": "GNU C", "bug_code_uid": "cbd8955c1db1245c260fbb1acceb2c89", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "f94739f4ce44be72e8d973687604ee0b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6020761245674741, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "#include \nvoid main() \n{\n\tint a = 0;\n scanf(\"%d\", a);\n if (a%2 == 0) printf(\"YES\\n\"); \n else printf(\"NO\\n\"); \n return 0;\n}", "lang": "GNU C", "bug_code_uid": "11c945e70ded3bfb5236316ae125f5ff", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "a022be294dc49bd3bb2215025c2a8068", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8698884758364313, "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 w;\n printf(\"Enter the weight of the watermelon \");\n scanf(\"%d\",w);\n if(w<0 && w>100)\n printf(\"NO\");\n else if (w%2==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "4cb200f1074c087c6def7e7847da10bd", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "55e6f6680b31dd6f625942542ae0ea8a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.946360153256705, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nlong long int P(int b, int exp)\n{\n long long int r = 1, i;\n \n for(i=1;i<=exp;i++)\n r *= b;\n \n return b;\n}\n\nint main()\n{\n scanf(\"%d\", &n);\n \n printf(\"%lld\", P(2, n + 1) - 2);\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "685a637662aeccaa5796cf9f9e79878d", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "e94ac34f48e4bb0deecf17a0b40ca1c9", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9488054607508533, "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()\n{\n int n,m,a,b,ans=0;\n scanf(\"%d %d %d %d\",&n,&m,&a,&b);\nch:\n if(m>=n && b<=n*a) ans+=b;\n else if(m>=n && b>n*a) ans+=n*a;\n else if(b < m*a) \n\t{ \n\t ans+=b*(n/m);\n\t\t\tn-=(n/m)*m;\n\t\t}\n\t\tif(n > 0) goto ch;\n\tprintf(\"%d\",ans);\n\t\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "7059b30863daa5a1d55bf2c68dc13cbf", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "486c18a82b8109ecf391efb0a6d6f880", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9960578186596584, "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 n,i,a,b,c=0,k=0;\n char day[50];\n scanf(\"%d\",&n);\n scanf(\"%s\",day);\n for(i=0; i0)\n printf(\"YES\");\n else\n printf(\"NO\");\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c9744baf32d482d36c304eea66bbcd48", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "4e3a1662a790c0f7664081afd05b294a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9951403887688985, "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\n#define ADD(x, a) do{(x) += (a); if ((x) >= mod) (x) -= mod;} while (0)\n#define SUB(x, a) do{(x) += mod - (a); if ((x) >= mod) (x) -= mod;} while (0)\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\ni32 calc (const i64 p, const i32 c, const i32 k) {\n i32 *dp = (i32 *) calloc (c + 1, sizeof (i32));\n dp[c] = 1;\n i32 *prob = (i32 *) calloc (c + 1, sizeof (i32));\n for (i32 i = 0; i <= c; ++i) {\n prob[i] = inv (i + 1);\n }\n for (i32 i = 0; i < k; ++i) {\n i32 sum = 0;\n for (i32 j = 0; j <= c; ++j) {\n i32 v = (i64) prob[j] * dp[j] % mod;\n ADD(sum, v);\n }\n for (i32 j = 0; j <= c; ++j) {\n i32 assign = sum;\n i32 v = (i64) prob[j] * dp[j] % mod;\n SUB(sum, v);\n dp[j] = assign;\n }\n }\n i32 ans = 0;\n for (i32 i = c; i >= 0; --i) {\n ans = ((i64) p * ans + dp[i]) % mod;\n }\n free (dp);\n free (prob);\n return ans;\n}\n\nvoid run (void) {\n i64 n = read_int();\n i32 k = read_int();\n i64 ans = 1;\n for (i64 p = 2; p * p <= n; ++p) {\n if (n % p != 0) continue;\n i32 c = 0;\n while (n % p == 0) {\n n /= p;\n ++c;\n }\n ans = ans * calc (p, c, k) % mod;\n }\n if (n > 1) ans = ans * calc (n, 1, k) % mod;\n print_int (ans);\n puts (\"\");\n}\n\nint main (void) {\n run ();\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "cffc42d1da3b6794b98d2b2bb817f76f", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "5ea1de1d49edffb68740091569c90c21", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6513518289450433, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "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\n#define ADD(x, a) do{(x) += (a); if ((x) >= mod) (x) -= mod;} while (0)\n#define SUB(x, a) do{(x) += mod - (a); if ((x) >= mod) (x) -= mod;} while (0)\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\ni32 calc (const i64 p, const i32 c, const i32 k) {\n i32 *dp = (i32 *) calloc (c + 1, sizeof (i32));\n dp[c] = 1;\n i32 *prob = (i32 *) calloc (c + 1, sizeof (i32));\n for (i32 i = 0; i <= c; ++i) {\n prob[i] = inv (i + 1);\n }\n for (i32 i = 0; i < k; ++i) {\n i32 sum = 0;\n for (i32 j = 0; j <= c; ++j) {\n i32 v = (i64) prob[j] * dp[j] % mod;\n ADD(sum, v);\n }\n for (i32 j = 0; j <= c; ++j) {\n i32 assign = sum;\n i32 v = (i64) prob[j] * dp[j] % mod;\n SUB(sum, v);\n dp[j] = assign;\n }\n }\n i32 ans = 0;\n for (i32 i = c; i >= 0; --i) {\n ans = ((i64) p * ans + dp[i]) % mod;\n }\n free (dp);\n free (prob);\n return ans;\n}\n\nvoid run (void) {\n i64 n = read_int();\n i32 k = read_int();\n i64 ans = 1;\n for (i64 p = 2; p * p <= n; ++p) {\n if (n % p != 0) continue;\n i32 c = 0;\n while (n % p == 0) {\n n /= p;\n ++c;\n }\n ans = ans * calc (p, c, k) % mod;\n }\n if (n > 1) ans = ans * calc (n, 1, k) % mod;\n print_int (ans);\n puts (\"\");\n}\n\nint main (void) {\n run ();\n return 0;\n}\n220x218x26x45:gori ymkw$ emacs 1.c\n220x218x26x45:gori ymkw$ gg 1.c\n220x218x26x45:gori ymkw$ cat 1.c\n#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\n#define ADD(x, a) do{(x) += (a); if ((x) >= mod) (x) -= mod;} while (0)\n#define SUB(x, a) do{(x) += mod - (a); if ((x) >= mod) (x) -= mod;} while (0)\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\ni32 calc (i64 p, const i32 c, const i32 k) {\n i32 *dp = (i32 *) calloc (c + 1, sizeof (i32));\n dp[c] = 1;\n i32 *prob = (i32 *) calloc (c + 1, sizeof (i32));\n for (i32 i = 0; i <= c; ++i) {\n prob[i] = inv (i + 1);\n }\n for (i32 i = 0; i < k; ++i) {\n i32 sum = 0;\n for (i32 j = 0; j <= c; ++j) {\n i32 v = (i64) prob[j] * dp[j] % mod;\n ADD(sum, v);\n }\n for (i32 j = 0; j <= c; ++j) {\n i32 assign = sum;\n i32 v = (i64) prob[j] * dp[j] % mod;\n SUB(sum, v);\n dp[j] = assign;\n }\n }\n p %= mod;\n i32 ans = 0;\n for (i32 i = c; i >= 0; --i) {\n ans = ((i64) p * ans + dp[i]) % mod;\n }\n free (dp);\n free (prob);\n return ans;\n}\n\nvoid run (void) {\n i64 n = read_int();\n i32 k = read_int();\n i64 ans = 1;\n for (i64 p = 2; p * p <= n; ++p) {\n if (n % p != 0) continue;\n i32 c = 0;\n while (n % p == 0) {\n n /= p;\n ++c;\n }\n ans = ans * calc (p, c, k) % mod;\n }\n if (n > 1) ans = ans * calc (n, 1, k) % mod;\n print_int (ans);\n puts (\"\");\n}\n\nint main (void) {\n run ();\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "76d1dc9f80b70735a9feba323e35160d", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "5ea1de1d49edffb68740091569c90c21", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.22092405735528411, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "#include\nstruct list {\nint x;\nstruct list*next;\n}\nint main()\n{\n char str[20];\n int i;j;\n scanf(\"%s\",str);\n int x=strlen(str);\n for(i=0;i\n#include\nint main()\n{\n int m,k,count,l,i,j,temp;\n char ar[45],ch,temp1,max;\nscanf(\"%s%c%d\",&ar,&ch,&m);\nl=strlen(ar);\n\nk=m;\nfor(i=0;i0)\n {\n j=i+1;\n temp=i;\n k=m;\n max=ar[i];\nwhile(k>0 &&ji;j--)\n ar[j]=ar[j-1];\n ar[i]=temp1;\n }\n m=m-(temp-i);\n }\n else\n break;\n}\nprintf(\"%s\\n\",ar);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9926a4f5c85d5ee3607826c54fa3a612", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "376b05e2add923cc3e24a4202924ab76", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9859154929577465, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n\tint i,j,c,k,n,m,temp,z,pos,diff,max;\n\tunsigned long long num,x;\n\tlong long int a[20];\n\tscanf(\"%lld%d\",&num,&k);\n\tc=0;\n\tx=num;\n\twhile(num>0)\n\t{\n\t\t\tnum=num/10;\n\t\t\tc++;\t\n\t}\n\tfor(i=c-1;i>=0;i--)\n\t{\n\t\t\ta[i]=x%10;\n\t\t\tx=x/10;\n\t\t\t\n\t}\n\tfor(i=0;ii+k)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(a[i]i;j--)\n\t\t{\n\t\t\ttemp=a[j];\n\t\t\ta[j]=a[j-1];\n\t\t\ta[j-1]=temp;\n\t\t}\n\t\tk=k-diff;\n\t\tif(k==0)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor(i=0;i<=c-1;i++)\n\t{\n\t\tprintf(\"%d\",a[i]);\n\t}\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "55db5c60d86b75141b8a60b6e93e2986", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "37261db6ac9ce565df7f1a3809827962", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8971553610503282, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "#include\nlong long int fib[55];\nvoid fibo(int n)\n{\n\tif(n==53)\n\t\treturn;\n\tfib[n]=fib[n-1]+fib[n-2];\n\tfibo(n+1);\n}\nvoid func(int k,int r,int n)\n{\n\tif(n==0)\n\t\treturn;\n\tif(k<=fib[n])\n\t{\n\t\tprintf(\"%d \",1+r);\n\t\tfunc(k,r+1,n-1);\n\t}\n\telse\n\t{\n\t\tprintf(\"%d %d \",2+r,1+r);\n\t\tfunc(k-fib[n],r+2,n-2);\n\t}\n}\nint main()\n{\n\tint n,k;\n\tscanf(\"%d %d\",&n,&k);\n\tfib[1]=1;\n\tfib[2]=1;\n\tfibo(3);\n\tfunc(k,0,n);\n\tprintf(\"\\n\");\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1e06f1f67a62ee1f286670135b79469f", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "19d73ec3540c0f2f213c1a16a40090a4", "difficulty": 1900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.882897384305835, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \nchar F[8][8];\nint D[8];\nint C(int a, int b)\n{\n int i;\n int r = 0;\n for (i = 1; i < 8; i++)\n {\n if (F[a][i] && F[b][i])\n {\n r++;\n }\n }\n return r;\n}\nint main()\n{\n int i, j;\n int t;\n int n, m;\n int a, b;\n int temp;\n int mV;\n scanf(\"%d %d\", &n, &m);\n for (i = 1; i <= n; i++)\n {\n for (j = 1; j <= n; j++)\n {\n F[i][j] = 0;\n }\n }\n for (i = 1; i <= n; i++)\n {\n D[i] = 0;\n }\n for (i = 0; i < m; i++)\n {\n scanf(\"%d %d\", &a, &b);\n F[a][b] = 1;\n D[a]++;\n F[b][a] = 1;\n D[b]++;\n }\n for (t = 1; t <= n; t++)\n {\n if (D[t] == 0)\n {\n break;\n }\n }\n if (t == 8)\n {\n mV = 8;\n if (m)\n {\n for (a = 1; a < 8; a++)\n {\n for (b = a + 1; b < 8; b++)\n {\n if (F[a][b])\n {\n temp = C(a, b);\n if (temp < mV)\n {\n mV = temp;\n }\n }\n }\n }\n m -= mV;\n }\n }\n printf(\"%d\", m);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "74d282cd16fcc1adaf640b9df8df0ec7", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "a0a510e924149db1ae99197c450e99db", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9394673123486683, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(void) {\n\tint n;\n\t\n\tscanf(\"%d\", &n);\n\t\n\tif (n <= 1) return 1;\n\t\n\tint i; int result = 1;\n\tfor (i = 2; i <= n; i++)\n\t\tresult = (result * 3) % 1000003;\n\t\n\tprintf(\"%d\\n\", result);\n\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6ca39dd8f705d37d0557ede4ce749aa9", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "12c6505481d7ad49bd6f1efe45cf3220", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8146067415730337, "equal_cnt": 18, "replace_cnt": 4, "delete_cnt": 8, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "#include \n\n\nint main() {\n\tint a, b = 1;\n\tscanf(\"%i\", &a);\n\n\tif (a != 1) {\n\t\twhile (--a) {\n\t\t\tb = (b * 3) % 1000003;\n\t\t}\n\t}\n\tprintf(\"%d\", b);\n\treturn 0;\n}\n/* 1515247708468 */\n", "lang": "GNU C", "bug_code_uid": "ad0769c3435a049a8d3b249065c7687b", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "969f82217bbe0a18b3c37cecf68f1ace", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9951768488745981, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n char array[10000];\n scanf(\"%s\",&array);\n int i=0,j=0,count=0,n=0;\n int length=0;\n length=strlen(array);\n for(i=length-1; i>=0; i--)\n {\n if(array[i]!='0')\n {\n break;\n }\n if(array[i]=='0')\n {\n array[i]='\\0';\n count++;\n }\n }\n length-=count;\n for(j=0,i=length-1; j<=length/2; j++,i--)\n {\n if(array[i]!=array[j])\n {\n f=n;\n break;\n }\n }\n if(!n)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f58aac44b00365114deeeaa81e61cb16", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "4c45018ab0e1d8541b62a683946a34d7", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6538461538461539, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n\tint a, b, c;\n\tb = 0;\n\tscanf(\"%d\", &c);\n\ta = c;\n\tfor (; a / 10 == 0;)\n\t{\n\t\tif (a % 10 != 0)\n\t\t\tbreak;\n\t\ta = 1.0* a / 10;\n\t}\n\tfor (; a / 10 == 0;)\n\t{\n\t\tb =b+ a % 10;\n\t\ta = 1.0* a / 10;\n\t}\n\tif (b == c)\n\t\tprintf(\"YES\");\n\telse printf(\"NO\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "f2338d03ae30c5ab9919b125abdd0cdc", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "1d7b305346e4148fd5930dc149352753", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9826989619377162, "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 a, b, c;\n\tb = 0;\n\tscanf_s(\"%d\", &c);\n\ta = c;\n\tfor (;;)\n\t{\n\t\tif (a % 10 != 0)\n\t\t\tbreak;\n\t\ta = 1.0* a / 10;\n\t}\n\tfor (; ;)\n\t{\n\t\tb =b*10+ a % 10;\n\t\ta = 1.0* a / 10;\n\t\tif (a == 0)\n\t\t\tbreak;\n\t}\n\tif (b == c)\n\t\tprintf(\"YES\");\n\telse printf(\"NO\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "5db7687d43ab96994088746d56096190", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "1d7b305346e4148fd5930dc149352753", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.12043010752688173, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n int a,b,s,f1=1,f2=1,i;\n scanf(\"%d %d\",&a,&b);\n for(i=1; i<=a; i++)\n {\n f1=f1*i;\n }\n for(i=1; i<=b; i++)\n {\n f2=f2*i;\n }\n if(f1>=f2)\n {\n if(f2==0)\n printf(\"%d\\n\",f1);\n else\n {\n for(i=1;i<=f2;i++)\n {\n if(f1%i==0&&f2%i==0)\n s=i;\n }\n printf(\"%d\\n\",s);\n }\n\n }\n if(f1\nint main()\n{\n int a,b;\n scanf(\"%d %d\",&a,&b);\n int i,s1,s2;\n s1=1;\n s2=1;\n for(i=1; i<=a; i++)\n {\n s1=s1*i;\n }\n for(i=1; i<=b; i++)\n {\n s2=s2*i;\n }\n if(s1>s2)\n {\n if(s1%s2==0)\n {\n printf(\"%d\",s2);\n }\n else\n {\n printf(\"1\");\n }\n }\n if(s2>s1)\n {\n if(s2%s1==0)\n {\n printf(\"%d\",s1);\n }\n else\n {\n printf(\"1\");\n }\n }\n return 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "ac130e9efb90fbe0459fd014f42d762b", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "7430d1e8a3c0fb10a2601110f988a532", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9967948717948718, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nlong long int fact(int x){\n if(x>=1){\n return x*fact(x-1);\n }\n else{\n return 1;\n }\n}\nint main(){\n long long int x,y,ans;\n scanf(\"%lld%lld\",&x,&y);\n if(x>y){\n ans =fact(y);\n }\n else{\n ans=fact(x);\n }\nprintf(\"%lld\",ans)l\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "f6e2437d4c8d6abedfa442625056a652", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "9a1dcd18e127f828fd326887f4cee9cd", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8930562595032945, "equal_cnt": 20, "replace_cnt": 6, "delete_cnt": 9, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "#include\n#include\n\nunsigned long long int Fact(unsigned long long int a)\n{\n unsigned long long int fact = a,k = 1;\n if(a % 2 == 0)\n {\n for(int i = 2;i<=a/2;i++)\n {\n fact = fact * i * (a - k);\n k++;\n }\n return fact;\n }\n\n for(int i = 2;i<=a/2;i++)\n {\n fact = fact * i * (a-k);\n k++;\n }\n fact *= a/2 + 1;\n return fact;\n}\n\nunsigned long long int GCD(unsigned long long int a, unsigned long long int b)\n{\n unsigned long long int temp,rem;\n if(a 0)\n {\n a = b;\n b = rem;\n rem = a%b;\n }\n return b;\n}\n\nint main()\n{\n unsigned long long int a,b;\n scanf(\"%llu %llu\",&a,&b);\n\n unsigned long long int facta = Fact(a);\n unsigned long long int factb = Fact(b);\n\n unsigned long long int gcd = GCD(facta,factb);\n printf(\"%llu\\n\",gcd);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ee7289affd7a5c283122c9b86d6bbf22", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "f5c6b4a16d881356cf0a0c0c20897785", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.0, "equal_cnt": 0, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n", "lang": "GNU C11", "bug_code_uid": "7ec15b63e5edda57c30d751947715c3d", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "3a2f4543778344ab9b561fbb386960bd", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.35396039603960394, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": " x=1;\n for(i=1;i<=n;i++)\n {\n x=x*i;\n }\n y=1;\n for(i=1;i<=m;i++)\n {\n y=y*i;\n }\n if(y>x)\n {\n t=x;\n x=y;\n y=t;\n }\n while(y!=0)\n {\n gcd=x%y;\n x=y;\n y=gcd;\n }\n printf(\"%ld\\n\",x);", "lang": "GNU C11", "bug_code_uid": "7ce716fd32d647d8aadc15049c017220", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "d67d91695f9cf1be11aff49db6350dbe", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.14285714285714285, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int x,y,x1=1,y1=1,i;\n scanf(\"%d%d\",&x,&y);\n for(i=x;i>0;i--)\n {\n x1*=i;\n }\n for(i=y;i>0;i--)\n {\n y1*=i;\n }\n if(x1>y1)\n {\n for(i=y1;i>0;i--)\n {\n if(y1%i==0 && x1%i==0) break;\n }\n }\n if(y1>x1)\n {\n for(i=x1;i>0;i--)\n {\n if(y1%i==0 && x1%i==0) break;\n }\n }\n printf(\"%d\",i);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e830ed1a669dc98cb7fc2db67d24a926", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "976e4c2a1c3f822c2dc1b08392d9f62a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.28860759493670884, "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{\tint i,a,b,x,f1=1,f2=1,gcd;\n\tscanf(\"%d %d\",&a,&b);\n\tfor(i=a;i>=1;i--)\n\t{\n\t\tf1=f1*i;\n\t\t}\n\t\tfor(i=b;i>=1;i--)\n\t\t{\n\t\t\tf2=f2*i;\n\t\t\t}\n\t\t\tif(f1=1;x--)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(f1%x==0 && f2%x==0)\n\t\t\t\t\t\tgcd=x;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\tprintf(\"%d\\n\",gcd);\n\treturn 0;\n }\n", "lang": "GNU C11", "bug_code_uid": "e7e5a251f6ba9bdf214bc022fb1cfd11", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "5ebc7db47dec8d2e185b0598050bb65c", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3680456490727532, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \nint main()\n{\tlong long int i,a,b,x,f1=1,f2=1,gcd;\n\tscanf(\"%lld %lld\",&a,&b);\n\tfor(i=a,i=b;i>=1;i--)\n\t{\n\t\tf1=f1*i;\n\t\tf2=f2*i;\n\t\t}\n\t\tfor(i=1;i<=f1 && i<=f2;++i)\n\t\t{\n\t\t\tif(f1%i==0 && f2%i==0)\n\t\t\tgcd=i;\n\t\t\t}\n\t\tprintf(\"%lld\\n\",gcd);\n\treturn 0;\n }", "lang": "GNU C11", "bug_code_uid": "0fb7b67294e3c146a26b849b7e1dce09", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "5ebc7db47dec8d2e185b0598050bb65c", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41975308641975306, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint fact(int f){\n int a=1,i;\n for(i=f;i>=1;i--)\n a=a*i;\n return a;\n}\nint main()\n{\n int l,n,r=0,d,e,i,j;\n scanf(\"%d%d\",&l,&n);\n d=fact(l);\n e=fact(n);\n while(d%e!=0){\n r=d%e;\n d=e;\n e=r;\n }\n printf(\"%d\",e);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "fd77af497d2f8077be5d2942c338f874", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "86f3e0db04ce7b6ab656bcf7d6383f1e", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6326996197718631, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "/******************************************************************************\n\n Online C Compiler.\n Code, Compile, Run and Debug C program online.\nWrite your code in this editor and press \"Run\" button to compile and execute it.\n\n*******************************************************************************/\n\n#include \n\nint main()\n{\n int a,b;\n int fact=1,fa=1;\n scanf(\"%d%d\",&a,&b);\n while(a>=1){\n fact=fact*a;\n a--;\n }\n while(b>=1){\n fa=fa*b;\n b--;\n } \n while(fact!=fa)\n {\n if(fact>fa){\n fact=fact-fa;\n }else{\n fa=fa-fact;\n }\n }\n printf(\"%d\",fact);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "197f5639063c4e9308734e7167bb0fc1", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "dc19df16bf5c4995233d044877bfe005", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6306990881458967, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "/******************************************************************************\n\n Online C Compiler.\n Code, Compile, Run and Debug C program online.\nWrite your code in this editor and press \"Run\" button to compile and execute it.\n\n*******************************************************************************/\n\n#include \n\nint main()\n{\n int a,b;\n int fact=1,fa=1,;\n scanf(\"%d%d\",&a,&b);\n while(a>=1){\n fact=fact*a;\n a--;\n }\n while(b>=1){\n fa=fa*b;\n b--;\n } \n while(fact!=fa)\n {\n if(fact>fa){\n fact=fact-fa;\n }else{\n fa=fa-fact;\n }\n }\n printf(\"%d\",fact);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "dedbedbd6d84f380e131a2597059ff94", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "dc19df16bf5c4995233d044877bfe005", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9957591178965225, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main() {\n int arr[10001]={0};\n long int a = 0, n,m, temp1;\n scanf(\"%ld\", &n);\n scanf(\"%ld\",&m);\n arr[10000] = 1;\n if(n>m)\n n=m;\n for (long int i = 2; i <= n; i++) {\n a = 0;\n for (long int j = 10000; j >= 0; j--) {\n a = a + arr[j] * i;\n arr[j] = a % 10;\n a = a / 10;\n }\n }\n for (long int k = 0; k <= 10000; k++) {\n if (arr[k] != 0) {\n temp = k;\n break;\n }\n }\n for (long int k1 = temp; k1 <= 10000; k1++)\n printf(\"%d\", arr[k1]);\n printf(\"\\n\");\n return 0;\n }\n", "lang": "GNU C11", "bug_code_uid": "a93fc89af588859942c0a994bdf56d3d", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "83da2e70ba5626a2f9ee691553b0c89e", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9360613810741688, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nint main()\n{ int a;\n scanf(\"%d\",a);\n if (a%2==0)\n {\n printf(\"YES\");\n \n }\n else {\n printf(\"NO\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d15aafd29dc9da52dfd0a6a5ddc5f4ac", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "18062566fee3673f5cc441e140a1b6b9", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.37937819756001573, "equal_cnt": 22, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 23, "bug_source_code": "#include\nint main()\n{\n int m,n,a,b;\n int f,sum=0,i;\n\n scanf(\"%d%d%d%d\",&n,&m,&a,&b);\n double x=b,y=m,z=a;\n if(x/y<=z)\n {\n f=m;\n while(m<=n);\n {\n sum+=b;\n m+=f;\n }\n if(m!=n&&f=a)\n {\n for(i=0;i\n#include\n#include\nchar str[10000];\n\nint main(){\nint n,i,j,k,l,d,u,r,m,x=0,y=0,L;\nl=0;d=0;r=0;u=0;\nscanf(\"%d%s\",&n,str);\nL = strlen(str);\nint count = 0;\nint max = -1;\n\nfor(i=0;i\nint main()\n{\n int arr[3],i,j,temp;\n for(i=0; i<3; i++)\n {\n scanf(\"%d\",&arr[i]);\n }\n for(i=3; i>0; i--)\n {\n for(j=0; j\nint main ()\n{\n int A[2],i,j,n,max;\n\n for (i=0;i<3;i++)\n {\n scanf(\"%d\",&A[i]);\n }\n for (i=0;i<3;i++)\n {\n for(j=0;j<3-i-1;j++)\n {\n if(A[j]>A[j+1])\n {\n max=A[j];\n A[j]=A[j+1];\n A[j+1]=max;\n }\n }\n }\n\n\n if(A[1]+A[0]-1\nint main(void)\n{\n\tint arr[3], ans=0, sum=0;\n\tfor(int i=0; i<3; i++)\n\t{\n\t\tscanf(\"%d\", arr[i]);\n\t}\n\tint max=0;\n\tfor(int i=0; i<3; i++)\n\t{\n\t\tif(arr[i]>max)\n\t\t\tmax=i;\n\t}\n\tfor(int i=0; i<3; i++)\n\t{\n\t\tif(i!=max)\n\t\t\tsum+=arr[i];\n\n\t}\n\tans=arr[max]-sum;\n\tif(ans>0)\n\t\tprintf(\"%d\", ans+1);\n\telse\n\t\tprintf(\"0\");\n\treturn 0;\n\n\n}", "lang": "GNU C11", "bug_code_uid": "6594fbcf2f7c277b1cf494b26c5d807f", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "04206d052f2170f2ebf38c64f4ecc012", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7485822306238186, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int a,b,c; \n scanf(\"%d%d%d,&a,&b,&c\");\n if(a>=b+c) \n printf(\"%d%d%d\",a-b-c-1);\n else if(b>=a+c) \n printf(\"%d%d%d\",b-a-c-1);\n else if(c>=b+c) \n printf(\"%d%d%d\",c-b-a-1);\n else\n printf(\"0\"); \n }\n ", "lang": "GNU C11", "bug_code_uid": "6895dad9a8e21e568f811dfe612c84b8", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "3f0b28269bdd21b251d2da272f24afba", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9680232558139535, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \nusing namespace std;\n\n int main() {\n char num[100];\n long long int limit, p = 0, q = 1, ans;\n int i, len, j, r;\n scanf(\"%s\", num);\n scanf(\"%lld\", &limit);\n len = strlen(num);\n for(i = len-1 ; i >= 0; i--, q *= 10) {\n if(num[i] == '9') \n continue;\n p = q*(num[i] - 47);\n if(p > limit)\n break;\n limit -= p; \n j = i;\n num[i] = '9';\n while(j-- >= 0) {\n if(num[j] != '0') {\n num[j]--; \n break;\n } \n num[j] = '9';\n \n } \n }\n sscanf(num, \"%lld\", &ans);\n printf(\"%lld\\n\", ans);\n return 0;\n }\n", "lang": "GNU C", "bug_code_uid": "f0b63dce569a500687731d9466797c20", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "31b706afeef3b65676294809ab421b6d", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9932088285229203, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\ntypedef long long ll;\nll s[20],c[20];\nint main()\n{\n ll n,m,l;\n scanf(\"%lld%lld\",&n,&m);\n if(!m)\n {\n printf(\"%lld\",n);\n return 0;\n }\n l=n;\n int count=0,i=0,max=0,j,flag=1;\n m=n-m;\n while(n)\n {\n s[count++]=n%10;\n if(n%10!=9)\n flag=0;\n n/=10;\n }\n if(flag)\n {\n printf(\"%lld\",l);\n return 0;\n }\n int count2=0;\n while(m)\n {\n c[count2++]=m%10;\n m/=10;\n }\n if(count==count2)\n {\n for(i=count-1;i>0;--i)\n {\n if(s[i]!=c[i])\n {\n int flag=0;\n for(j=0;j=0;--i)\n printf(\"%lld\",s[i]);\n }\n else\n {\n if(s[count-1]==1)\n {\n if(count==1)\n printf(\"1\");\n else\n {\n int flag=0;\n for(j=0;j=0;--i)\n printf(\"9\",s[i]);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7542d0023e59fc3513bd019bdc40193a", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "68a226dd3a5f9b18eec28254050a7652", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9545454545454546, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n int main() {\n char num[100];\n long long int limit, p = 0, q = 1;\n int i, len, j, r;\n scanf(\"%s\", num);\n scanf(\"%lld\", &limit);\n len = strlen(num);\n for(i = len-1 ; i >= 0; i--, q *= 10) {\n if(num[i] == '9') \n continue;\n p = q*(num[i] - 47);\n if(p > limit)\n break;\n limit -= p; \n j = i;\n num[i] = '9';\n while(j-- >= 0) {\n if(num[j] != '0') {\n num[j]--; \n break;\n } \n num[j] = '9';\n \n } \n }\n puts(num);\n return 0;\n }\n", "lang": "GNU C", "bug_code_uid": "94225c8b6a4cdcb912e6cf9e286a7620", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "c369dafb83aff30bc43d4065da06be81", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7877385772122614, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n\n long a,b,c=1,d=1,i,small,large,gcd=0;\n scanf(\"%d %d\",&a,&b);\n\n for(i=1; i<=a; i++)\n {\n c=c*i;\n }\n for(i=1; i<=b; i++)\n {\n d=d*i;\n }\n\n\n if(c=2; i--)\n {\n if((c%small)==0 && (d%small)==0)\n {\n gcd=i;\n break;\n }\n }\n printf(\"%d\",gcd);\n }\n\n\n return 0;\n\n}", "lang": "GNU C11", "bug_code_uid": "4f5a2f58e38c03080c5330def704b3d2", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "68909c58435c019212edd707ea007b87", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9001536098310292, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\nint main()\n{\n\n long a,b,c=1,d=1,i,small,large,gcd;\n scanf(\"%d %d\",&a,&b);\n\n\n for(i=1; i<=a; i++)\n {\n c=c*i;\n }\n for(i=1; i<=b; i++)\n {\n d=d*i;\n }\n\n\n if(c10 || b>10)\n {\n if(a>b)\n {\n printf(\"%d\",d);\n exit(1);\n }\n else\n {\n printf(\"%d\",c);\n exit(1);\n }\n\n }\n\n\n\n\n // printf(\"%d %d\\n\",c,d);\n\n\n if(c==0 || d==0)\n {\n printf(\"%d\",large);\n }\n else if(c==d)\n {\n printf(\"%d\",c);\n }\n\n else if(c==1 || d==1)\n {\n printf(\"%d\",1);\n }\n\n else if(c!=0 && d!=0)\n {\n for(i=small; i>=2; i--)\n {\n if((c%small)==0 && (d%small)==0)\n {\n gcd=i;\n break;\n }\n }\n printf(\"%d\",gcd);\n }\n\n\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "67b1482d860e848d36fd6abcf6f148b0", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "68909c58435c019212edd707ea007b87", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.40126382306477093, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 8, "fix_ops_cnt": 17, "bug_source_code": "#include\nlong int multiplyNumbers(int n);\nint hcf(int n1, int n2);\nint main(){\n int p,q,s,t;\n scanf(\"%d%d\",&p,q);\n t=multiplyNumbers(p);\n s=multiplyNumbers(q);\n printf(hcf(n1, n2));\n return 0;\n}\n \nlong int multiplyNumbers(int n) {\n if (n>=1)\n return n*multiplyNumbers(n-1);\n else\n return 1;\n}\n \nint hcf(int n1, int n2) {\n if (n2 != 0)\n return hcf(n2, n1 % n2);\n else\n return n1;\n}", "lang": "GNU C11", "bug_code_uid": "2694653623055f6dad84d425415d9177", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "f49526b07c62b245523bfe218640565e", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.40570522979397783, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 8, "fix_ops_cnt": 18, "bug_source_code": "#include\nlong int multiplyNumbers(int n);\nint hcf(int n1, int n2);\nint main(){\n int p,q,s,t;\n scanf(\"%d%d\",&p,q);\n t=multiplyNumbers(p);\n s=multiplyNumbers(q);\n printf(hcf(s,t));\n return 0;\n}\n \nlong int multiplyNumbers(int n) {\n if (n>=1)\n return n*multiplyNumbers(n-1);\n else\n return 1;\n}\n \nint hcf(int n1, int n2) {\n if (n2 != 0)\n return hcf(n2, n1 % n2);\n else\n return n1;\n}\n", "lang": "GNU C11", "bug_code_uid": "db47106aba05c90a1c7166fde3d2fcdc", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "f49526b07c62b245523bfe218640565e", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5031712473572939, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n long long int i,a,r,b,s1=1,s2=1;\nscanf(\"%lld %lld\",&a, &b);\n\nfor(i=a;i>0;i--){\n s1=s1*i;\n}\nfor(i=b;i>0;i--){\ns2=s2*i;\n}\nwhile(s2!=0){\n r=s1%s2;\n s1=s2;\n s2=r;\n}\nprintf(\"%lld\",s1);\n\n\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "1529bc067d2c53fc2cdf5b64464c94c0", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "30a735b68c8bba5a3537940c98094daf", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.09066666666666667, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\ndouble fact(int a)\n{\n double sum=0;\n sum=a;\n a=a-1;\n while(a!=0)\n {\n\n sum=sum*a;\n a--;\n\n\n }\n return sum;\n}\nint main()\n{\n int a,b,GCD;\n scanf(\"%d %d\",&a,&b);\n double f,s;\n f=fact(a);\n s=fact(b);\n\n for(int i = 1; i <= f && i <= s; i++)\n {\n if(f%i == 0 && s % i == 0)\n GCD = i;\n }\n\n\n\n\n\n printf(\"%d\",GCD);\n}\n", "lang": "GNU C11", "bug_code_uid": "77930817491188a21e72b97a045956c6", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "68f891ceabd9d52803accc133c356617", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.09103078982597054, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\ndouble fact(int a)\n{\n double sum=0;\n sum=a;\n a=a-1;\n while(a!=0)\n {\n\n sum=sum*a;\n a--;\n\n\n }\n return sum;\n}\nint main()\n{\n int a,b,GCD;\n scanf(\"%d %d\",&a,&b);\n int f,s;\n f=fact(a);\n s=fact(b);\n\n for(int i = 1; i <= f && i <= s; i++)\n {\n if(f%i == 0 && s % i == 0)\n GCD = i;\n }\n\n\n\n\n\n printf(\"%d\",GCD);\n}\n", "lang": "GNU C11", "bug_code_uid": "184e813c75a7010f8f4204b9db11d059", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "68f891ceabd9d52803accc133c356617", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6877323420074349, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int a,b,p=1,q=1,r=1;\n scanf(\"%d %d\",&a,&b);\n for(int i=1;i<=a;i++)\n {\n p=p*i;\n }\n for(int i=1;i<=b;i++)\n {\n q=q*i;\n }\n for(int i=1;i<=p||i<=q;i++)\n {\n int t=p%i;\n int s=q%i;\n if(t==0&&s==0)\n r=i;\n }\n printf(\"%d\",r);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "7ffcb712d1bf2c93a15c8f5516545de7", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "eb854391dd492f688924d9593ad0c993", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5477792732166891, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n long int multiplyNumbers(long int n)\n{\n if (n >= 1)\n return n*multiplyNumbers(n-1);\n else\n return 1;\n}\n\nint main()\n\n{\n\n long long int num1, num2, gcd, lcm, remainder, numerator, denominator;\n\n \n\n // printf(\"Enter two numbers\\n\");\n\n scanf(\"%lld %lld\", &num1, &num2);\n\n num1=multiplyNumbers(num1);\n num2=multiplyNumbers(num2);\n\n if (num1 > num2)\n\n {\n\n numerator = num1;\n\n denominator = num2;\n\n }\n\n else\n\n {\n\n numerator = num2;\n\n denominator = num1;\n\n }\n\n remainder = numerator % denominator;\n\n while (remainder != 0)\n\n {\n\n numerator = denominator;\n\n denominator = remainder;\n\n remainder = numerator % denominator;\n\n }\n\n gcd = denominator;\n\n\n // printf(\"GCD of %d and %d = %d\\n\", num1, num2, gcd);\nprintf(\"%lld\",gcd);\nreturn 0;\n //printf(\"LCM of %d and %d = %d\\n\", num1, num2, lcm);\n\n}", "lang": "GNU C11", "bug_code_uid": "8a77e76c9fa571e1c41fb076b409db21", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "0ab42ee6bcae0ba3362e1ce995c98ca5", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9497041420118343, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main() {\n long long int m,n,p,g,q,j,l,i,f=0;\n scanf(\"%lld %lld\",&m,&n);\n p=1;q=1;\n for(i=1;i<=m;i++)\n {\n p=p*i;\n \n }\n // printf(\"%lld\\n\",p);\n // printf(\"------\");\n for(j=1;j<=n;j++)\n {\n q=q*j;\n \n if(q%p==0)\n {\n f=1;\n break;\n }\n }\n // printf(\"%lld\\n\",q);\n if(f==1)\n {\n printf(\"%lld\\n\",p);\n return 0;\n }\n l=1;\n if(p>q)\n {\n g=q;\n }\n else\n {\n g=p;\n }\n for(i=1;i<=g;i++)\n {\n if(p%i==0 && q%2==0 && l\nint main(){\n int a,b; long long c=1;\n scanf(\"%d %d\",&a,&b);\n b=a\n#include\n\n\nlong long int fact(long long int x)\n{\n\tint p=1;\n\tfor(int i=1;i<=x;i++)\n p=p*i;\n return p;\n}\nint min(long long int q,long long int w)\n{\n\tif(q>w)\n\t\treturn w;\nelse\n\treturn q;\n}\nint main()\n{\n\t#ifndef ONLINE_JUDGE\n // for getting input from input.txt\n freopen(\"input.txt\", \"r\", stdin);\n // for writing output to output.txt\n freopen(\"output.txt\", \"w\", stdout);\n \t#endif\n\tlong long int a,b,a1,b1,m;\n\tscanf(\"%lld %lld\",&a,&b);\n a1=fact(a);\n b1=fact(b);\n m=min(a1,b1);\n for(long long int i=m;i>0;i--)\n {\n \tif(a1%i==0 && b1%i==0)\n\n{ \t\tprintf(\"%lld\",i);\n \tbreak;\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "823cef135aef3e10817ebe51825a6124", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6eca9dc8cc81f9a11eb1dfb001c02940", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7841140529531568, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\n#include\n\nlong long int fact(long long int x)\n{\n\tlong long int p=1;\n\tfor(int i=1;i<=x;i++)\n p=p*i;\n return p;\n}\nint main()\n{\n\t#ifndef ONLINE_JUDGE\n // for getting input from input.txt\n freopen(\"input.txt\", \"r\", stdin);\n // for writing output to output.txt\n freopen(\"output.txt\", \"w\", stdout);\n \t#endif\n\tlong long int b,b1, a1,a;int m;\n\tscanf(\"%lld %lld\",&a,&b);\n a1=fact(a);\n b1=fact(b);\n m=min(a1,b1);\n printf(\"%d\",m);\n \n}", "lang": "GNU C11", "bug_code_uid": "c12328508c0a27754eeef5f84c3fe560", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6eca9dc8cc81f9a11eb1dfb001c02940", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9913793103448276, "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 N 100\n\nint main() {\n\tstatic char s[N + 1], t[N + 1];\n\tint n, i, at, k;\n\n\tscanf(\"%s\", s);\n\tn = strlen(s);\n\tk = at = 0;\n\tfor (i = 0; i < n; )\n\t\tif (i > 0 && i + 1 < n - 1 && s[i] == 'a' && s[i + 1] == 't' && !at)\n\t\t\tt[k++] = '@', i += 2;\n\t\telse if (i > 0 && i + 2 < n - 1 && s[i] == 'd' && s[i + 1] == 'o' && s[i + 2] == 't')\n\t\t\tt[k++] = '.', i += 3;\n\t\telse\n\t\t\tt[k++] = s[i], i++;\n\tprintf(\"%s\\n\", t);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "24bced4fa0a44dbcbb7f88aa94d2afbe", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "35e0a993877f0634f45f96f3e63c9cf4", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6972477064220184, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n\tint n,k,l,c,d,p,nl,np,a,b,v;\n\tscanf(\"%d %d %d %d %d %d %d %d\",&n, &k, &l, &c, &p, &nl, &np);\n a=(n*nl)/(k*l);\n b=(n)/d;\n v=(n*np)/p;\n \n if(a<=b && a<=v)\n\t{\n printf(\"%d\",a);\n }\n else if (b<=a && b<=v)\n {\n \tprintf(\"%d\",b);\n\t}\n\telse\n\t{\n\tprintf(\"%d\",v);\n }\n \n\n}", "lang": "GNU C", "bug_code_uid": "6460048accedd9844b41f7c2497f4de2", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "3b4d2ee89666f936a52f095651ddf4b7", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7938461538461539, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \n\nunsigned long count(unsigned long s, unsigned long x)\n{\n if (!s && !x)\n return 1;\n if ((s & 1)) {\n if (!(x & 1)) return 0;\n return count(s >> 1, x >> 1) + count(s >> 1, x >> 1);\n }\n\n if ((x & 1)) return 0;\n return count(s >> 1, x >> 1) + count((s >> 1)-1, x >> 1);\n}\n\n\nint main(int argc, char *argv[])\n{\n unsigned long s, x;\n scanf(\"%lu %lu\", &s, &x);\n printf(\"%lu\\n\", count(s, x) - 2*(s == x));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5ca99992ca625a3b6a3700db2d5ae3b9", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "33a059023ea4b88bc605b3414bb70966", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.818, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n\nunsigned long long count(unsigned long long s, unsigned long long x)\n{\n if ((!s && !x))\n return 1;\n if ((s & 1)) {\n if (!(x & 1)) return 0;\n return 2*count(s >> 1, x >> 1);\n }\n\n if ((x & 1)) return 0;\n return count(s >> 1, x >> 1) + count((s >> 1)-1, x >> 1);\n}\n\n\nint main(int argc, char *argv[])\n{\n unsigned long long s, x;\n scanf(\"%l64u %l64u\", &s, &x);\n printf(\"%l64u\\n\", count(s, x) - 2*(s == x));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5ae4fa86ec3e6f43a06473f37c57ebc2", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "33a059023ea4b88bc605b3414bb70966", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7342465753424657, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tint count=0;\n\twhile(n>1)\n\t{\n\t\tcount =count+1;\n\t\tif(n%2!=0)\n\t\t{\n\t\t\tcount++;\n\t\t\tn=n-1;\n\t\t}\n\t\tn=n/2;\n\t}\n\tprintf(\"%d\\n\",count);\n}\n", "lang": "GNU C", "bug_code_uid": "cd21fca4ff74d9cf2b6bc6eda3009f86", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "259720ef26794088d8a9c38ae1d518d1", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.844106463878327, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "//codeforces_979A_live\n#include \n#include \n#include \n\n#define for(n) for(int k=0;kb?a:b; }\nint abs(int a){ return max(a,-a); }\n\nint main(){\n\tlong long n;\n\tgi(n);\n\tif (180%(360/(n+1))){ go(n+1); }\n\telse{ go(180/(360/(n+1))); }\n\tline\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ecd24b9db94a54eb841cffc277fb2e7d", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "e2bba5570c14c6d0ddb39cd1c7a4a5a8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6783216783216783, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main() {\n\tint n, d;\n\tlong long sum;\n\n\tscanf(\"%d\", &n);\n\tsum = 0;\n\tfor (d = 1; d <= n; d++)\n\t\tsum += (1 << d);\n\tprintf(\"%lld\\n\", sum);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "87e2b9623d31a0aae81b90f3c6a96af5", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "886f0fb8cfd218fb0f2851ff9550c33a", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.993127147766323, "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 long long n = 0;\n long long total = 2;\n\n scanf(\"%d\",&n);\n\n if (n == 1)\n printf(\"2\\n\");\n else {\n for (int i = 1; i <= n;i++)\n total *= 2;\n printf(\"%d\\n\",total-2);\n }\n \n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "0f5f2c9b7a2d297d1b905ca1bf8a9f65", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "639bf29d6b47e6c0ca1a7d8aa76696c6", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9990243902439024, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nmain()\n{\n int i=0,count=0;\n char a[10];\n scanf(\"%s\",a);\n int b=strlen(a);\n\n\n while(i\n#include \n#include \n\n\t// solución por fuerza bruta: comparar cada bola con otras dos, si antres de terminar el ciclo hay dos que difieren en menos de 2 en valor absoluto, se puede\n\t// Si se acaba el ciclo sin encontrar nada, se imprime NO\n\n\tint particion (int a[],int ini, int fin);\n\tvoid quicksort (int a[],int ini, int fin);\n\tvoid swap (int a[],int x,int y);\n\t\t\nint main(void){\n\tint n;\n\tint *vec;\n\tint i, cont = 0;\n\n\tscanf ( \"%d\", &n );\n\t\n\tvec = (int*)malloc(n*sizeof(int));\n\t\n\tfor ( i = 0; i < n; i++){\n\t\t\tscanf ( \"%d\", &vec[i] );\n\t}\n\t\n\tquicksort( vec, 0, n - 1 );\n\t\n\t/*for ( i = 0; i < n; i++ ){\n\t\tprintf ( \"%d - \", vec[i] );\n\t}*/\n\t\n\tfor ( i = 1; i < n; i++ ){\n\t\tif ( vec[i - 1] == (vec[i] - 1) )\n\t\t\tcont++;\n\t\telse if ( vec[i - 1] != vec[i] )\n\t\t\tcont = 0;\n\t\tif ( cont == 2 ){\n\t\t\tprintf ( \"YES\" );\n\t\t\texit(1);\n\t\t}\n\t}\n\tprintf ( \"NO\" );\n\t\n\treturn 0;\n}\n\nvoid quicksort (int a[],int ini, int fin)\t\t//cada vez que se llama a quicksort un nuevo pivot va colocandose en su posicion\n{\n\tint piv;\n\tif (ini\nint max=0;\nint n;\nchar command[101];\nvoid maxcom(int x,int y,int i,int no,int com){\n\n\tif(x==0&&y==0){\n\t\tif(no>max)\n\t\t\tmax=no;\n\t}\n\t\t\n\tif(i>=n)\n\t\treturn;\n\n\tif(command[i]=='U'){\n\n\t\tif(com==0){\n\t\t\t\n\t\t\tmaxcom(x,y,i+1,no,0);\n\t\t\tmaxcom(x,y,i+1,no,1);\t\n\n\t\t}\n\t\t\t\n\t\tif(com==1){\n\n\t\t\tmaxcom(x,y+1,i+1,no+1,0);\n\t\t\t\n\t\t\tmaxcom(x,y+1,i+1,no+1,1);\n\n\t\t}\n\n\t}\t\t\n\n\n\t if(command[i]=='D'){\n\n if(com==0){\n\n maxcom(x,y,i+1,no,0);\n maxcom(x,y,i+1,no,1);\n\n }\n\n if(com==1){\n\n maxcom(x,y-1,i+1,no+1,0);\n\n maxcom(x,y-1,i+1,no+1,1);\n\n }\n\n }\n\n\n\t if(command[i]=='L'){\n\n if(com==0){\n\n maxcom(x,y,i+1,no,0);\n maxcom(x,y,i+1,no,1);\n\n }\n\n if(com==1){\n\n maxcom(x-1,y,i+1,no+1,0);\n\n maxcom(x-1,y,i+1,no+1,1);\n\n }\n\n }\n\n\n\t if(command[i]=='R'){\n\n if(com==0){\n\n maxcom(x,y,i+1,no,0);\n maxcom(x,y,i+1,no,1);\n\n }\n\n if(com==1){\n\n maxcom(x+1,y,i+1,no+1,0);\n\n maxcom(x+1,y,i+1,no+1,1);\n\n }\n\n }\n\n\n\n\t\t\n\n}\n\nint main(){\n\nscanf(\"%d\",&n);\n\nscanf(\"%s\",command);\n\nmaxcom(0,0,0,1,0);\nmaxcom(0,0,0,1,1);\n\nprintf(\"%d\\n\",max-1);\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "845f05c5f2f4ef1072a3db66bbd6a330", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "7ee96f9829771442f261a454bc90c0e1", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.40869054609512623, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\nint main()\n{\n char s[105];\n int i,n,x,xx,y,yy,cx,cy,total;\n while(~scanf(\"%d\",&n))\n {\n getchar();\n scanf(\"%s\",s);\n x=0;\n y=0;\n for(i=0;in)\n {\n xx=xx%n;\n }\n if(yy>n)\n {\n yy=yy%n;\n }\n total=xx+yy;\n printf(\"%d\\n\",total);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ba2ad70ca8be8bbd03f1d5607cb58f2d", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "fff942ba945850c042f539b1339d5c89", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4199623352165725, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n#include \nint a[101],i,j,n,max=0;\nchar s[101];\nint turn[4][2]={{0,1},{0,-1},{-1,0},{1,0}};\nvoid dfs(int nowpos,int nowx,int nowy,int tot)\n{\n\tif (tot>max&&nowx==0&&nowy==0)\n\t\tmax=tot;\n\tif (nowpos==n+1) return;\n\tif (tot+n-nowpos+1<=max) return;\n\tdfs(nowpos+1,nowx,nowy,tot);\n\tdfs(nowpos+1,nowx+turn[a[nowpos]][0],nowy+turn[a[nowpos]][1],tot+1);\n}\nint main()\n{\n\tscanf(\"%d\",&n);\n\tscanf(\"%s\",s);\n\tfor (i=0;s[i];i++)\n\t\tswitch (s[i]){\n\t\t\tcase 'U':a[i+1]=0; break;\n\t\t\tcase 'D':a[i+1]=1; break;\n\t\t\tcase 'L':a[i+1]=2; break;\n\t\t\tcase 'R':a[i+1]=3; break;\n\t\t}\n\tdfs(1,0,0,0);\n\tprintf(\"%d\\n\",max);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fd7546ab44db6a3eac36fc58a41a99e1", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "42456b63b608dcbae1282e0adb68c1d8", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9778142974527527, "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,m,a,b;\n scanf(\"%d %d %d %d\\n\",&n,&m,&a,&b);\n int r=0;\n if(b0){\n if(n>=m){\n n=n-m;\n r=r+b;\n }\n \n else{\n if(a*n>b){\n r=r+b;\n }\n else{\n r=r+a*n;\n }\n }\n }\n \n }\n else{\n r=n*a;\n }\n printf(\"%d\\n\",r);\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "65e07c1908826218f3f9b8409f177119", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "bbd892ec25afcae4ff10626db43b1283", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2586466165413534, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n int n,m,a,b,sum=0;\n scanf(\"%d%d%d%d\",&n,&m,&a,&b);\n while(n!=0){\n if(n>=m){\n n=n-m;\n sum+=b;\n }\n else if(n\n\nint main()\n{\n int arr[10],i;\n for(i=0;i<10;i++)\n arr[i]=0;\n int n;\n scanf(\"%d \",&n);\n char ch='a';\n while(1)\n {\n scanf(\"%c\",&ch);\n if(ch=='\\n')\n break;\n arr[(int)ch%48]++;\n //printf(\"i:%d arr[i]:%d\",(int)ch%48,arr[(int)ch%48]);\n }\n arr[0]=-1;arr[1]=-1;\n arr[7]+=arr[9]+arr[8];\n arr[3]+=2*arr[9]+arr[6]+arr[4];\n arr[2]+=arr[9]+3*arr[8]+2*arr[4];\n arr[9]=0;arr[8]=0;\n arr[5]+=arr[6];\n arr[6]=0;arr[4]=0;\n for(i=9;i>=0;i--)\n {\n while(arr[i]>0)\n {\n printf(\"%d\",i);arr[i]--;\n }\n }", "lang": "GNU C11", "bug_code_uid": "5b648b772774558a82f242712a327940", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "42c40a929f479aea953068c47c06a888", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.28700906344410876, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "#include\n#include\nint main ()\n{\n char str[100],str1[100];\n char str2[]=\"hello\";\n int i = 0,j=0;\n gets(str);\n while(str[i]!='\\0')\n {\n if(str[i]==str[i+1])\n {\n str1[j]=str[i];\n i++;\n }\n else{\n str1[j]=str[i];\n j++;\n i++;\n }\n }\n if(strcmp(str2,strstr(str1,str2)))\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0 ;\n}", "lang": "GNU C", "bug_code_uid": "75d5eff7c0a2884103df25f878eb4a5f", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "9c5a2a4969be358e49ef67bf0159bab4", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6658905704307334, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\nchar s[101];\nint main()\n{\n char t[]=\"hello\";\n int i=0,c=0;\n int j,l=0;\n scanf(\"%s\",s);\n while((s[i]!='\\0')&&(t[l]!='\\0'))\n {\n \n j=strcmp(s[i],t[l]) ;\n i++;\n if(j==0)\n {\n c++;\n l++;\n \n }\n else\n {\n \n }\n }\n \n if(c==5)\n {\n printf(\"YES\");\n \n }\n else \n {\n printf(\"NO\");\n}\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "6fa0bb345998a5c4b8ea59be4446202a", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "bdf5356a2d0ead707eee96223029005e", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9958885335769758, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\nint main()\n{\n int i,n,h=0,e=0,l=0,o=0,d=0,c=0;\n char a[105];\n scanf(\"%s\",&a);\n n=strlen(a);\n for(i=0; i\n#include \n\nint main(void) {\n int n,k,l,c,d,p,nl,np;\n scanf(\"%d %d %d %d %d %d %d %d\",&n,&k,&l,&c,&d,&p,&nl,&np);\n l*=k;\n d*=c;\n l/=nl;\n p/=np;\n int toast = min(l,min(p,d));\n toast/=n;\n printf(\"%d\",toast);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "026dac5ddaf90279f8138b58154bb6ce", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "6e94724e334c7ec337cda987b5575608", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6864064602960969, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\n#define MAX(A, B) (A > B ? A : B);\n\nint main(){\n\n int n;\n scanf(\"%d\", &n);\n\n int *arr= malloc(sizeof(int)*n);\n int *check = calloc(n, sizeof(int));\n int ones = 0;\n int max = -1;\n\n int j = 0;\n for(int i=0; i -1)\n check[j]++;\n else {\n j++;\n check[j]++;\n }\n\n }\n \n }\n\n int curr = 0;\n for(int i=0; i<=j; i++){\n if(check[j] > 0)\n max = MAX(max, curr+check[j]);\n \n if(curr + check[j] <= 0)\n curr = 0;\n else \n curr += check[j];\n }\n\n printf(\"%d\", max + ones);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "24f21f6d2572805820298eaf62c80519", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "9178b4f2956724a4a886d89eb6013028", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9640287769784173, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n#include \n\nint main()\n{\n int a['z']={0},n,k;\n scanf(\"%d %d\",&n,&k);\n char s[1000];\n scanf(\"%s\",&s);\n int i;\n for(i=0;s[i]!='\\0';i++)\n {\n char z=s[i];\n a[z]++;\n }\n char d;\n for(d='a';d<='z';d++)\n {\n if(y[d]\n#include\n#include\n#include\n#define ll long long int\n\nint main()\n{\n int n,k,a[26],i,max=0;\n scanf(\"%d %d\",&n,&k);\n for(i=0;i<26;i++)\n a[i]=0;\n for(i=0;imax)\n max=a[i];\n }\n if(max>k)\n printf(\"NO\\n\");\n else\n printf(\"YES\\n\");\n return 0;\n}\n→Judgement Proto", "lang": "GNU C", "bug_code_uid": "3adf9daee2a1c2c22d24a931d3246920", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "a54d23f04716d73486ec7f0adf692dda", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9357622243528284, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main() {\n\n int stack[3]={0}, move, endpos, temp;\n scanf(\"%d%d\", &move, &endpos);\n stack[endpos]=1;\n\n while( move>0 ) {\n\n if(move%2!=0) {\n temp = stack[0];\n stack[0]= stack[1];\n stack[1]=temp;\n }\n\n else if(move%2==0) {\n\n temp = stack[1];\n stack[1]= stack[2];\n stack[2]=temp;\n }\n move--;\n }\n for(temp=0; temp<3; temp++)\n if( stack[temp] )\n break;\n printf(\"%d\\n\", temp );\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "7255f8fba60d7412cfa56fa935e68151", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "3c314611bde53b4cdc71559c871db1d8", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9166666666666666, "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 a[6][3]={{0,1,2},{1,0,2},{1,2,0},{2,1,0},{2,0,1},{0,2,1}};\n int b,c;\n scanf(\"%d%d\",&b,&c);\n printf(\"%d\\n\",a[b%6][c]);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "c12db804c95cc08e3c340effc82e186a", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "df8ac36ad07fc1ce87fbe564f9768d9f", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.988673139158576, "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 int position;\n scanf(\"%d\",&n);\n scanf(\"%d\",&position);\n while(n>0)\n {\n if(n%2 == 0)\n {\n if(position == 2)\n {\n position = 1;\n }\n else if(position == 1)\n {\n position = 2;\n }\n }\n else\n {\n if(position == 0)\n {\n position = 1;\n }\n else if(position == 1)\n {\n position = 0;\n }\n }\n n--;\n }\n printf(\"%d\",position);\n}", "lang": "GNU C11", "bug_code_uid": "e97ad3058633a035a026bb7f89cc53d3", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "6112975b7a2f6ef3316ef11fdef04a76", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.009433962264150943, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "shellGame.c", "lang": "GNU C11", "bug_code_uid": "e5bea1da59cd5ab24d6d1b3dc4d5d5ff", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "6112975b7a2f6ef3316ef11fdef04a76", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.926829268292683, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#include \nint main()\n{\n long long int n;\n int p;\n scanf(\"%l64d\", &n);\n scanf(\"%d\", &p);\n int s[]={0,0,0};\n s[p]=1;\n for(int i=n;i>0;i--)\n {\n if(i%2==0)\n {\n int temp=0;\n temp=s[1];\n s[1]=s[2];\n s[2]=temp;\n }\n else\n {\n int temp=0;\n temp=s[0];\n s[0]=s[1];\n s[1]=temp;\n }\n }\n for(int i=0; i<3;i++)\n {\n if(s[i]==1)\n {\n printf(\"%d\",i);\n return 0;\n }\n }\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cbfeecdc00db49a1272f5e50f691e7ff", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "5ab6b9d0e8182a624ea0fa3243aa59b4", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4860215053763441, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n\tint n;\n\tint x;\n\tscanf(\"%d%d\",&n,&x);\n\twhile(n>0)\n\t{\n\t\tif(n%2==0)\n\t\t{\n\t\t\tif(x==2)\n\t\t\t{\n\t\t\t\tx=1;\n\t\t\t}\n\t\t\telse if(x==1)\n\t\t\t{\n\t\t\t\tx=2;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(x==0)\n\t\t\t{\n\t\t\t\tx=1;\n\t\t\t}\n\t\t\telse if(x==1)\n\t\t\t{\n\t\t\t\tx=0;\n\t\t\t}\n\t\t}\n\t\tn--;\n\t}\n\tprintf(\"%d\",x);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "899704964019a90371bc670dd1de3eb4", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "888c9b3abca96dbd61503c48b25d3e8d", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1430745814307458, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "#include\nint main()\n{\n\tlong long n,x,i,l=0,m=0,r=0,temp;\n\tscanf(\"%lld%lld\",&n,&x);\n\tif(x==0)\n\t\tl=1;\n\telse if(x==1)\n\t\tm=1;\n\telse if(x==2)\n\t\tr=1;\n\tif(n%2!=0)\n\t{\n\t\t\tfor(i=1;i<=n;i++)\n\t\t{\n\t\t\tif(i%2==0)\n\t\t\t{\n\t\t\t\ttemp=r;\n\t\t\t\tr=m;\n\t\t\t\tm=temp;\n\t\t\t}\n\t\t\telse if(i%2!=0)\n\t\t\t{\n\t\t\t\ttemp=l;\n\t\t\t\tl=m;\n\t\t\t\tm=temp;\n\t\t\t}\n\t\t}\n\t}\n\tif(n%2==0)\n\t{\n\t\t\tfor(i=1;i<=n;i++)\n\t\t{\n\t\t\tif(i%2!=0)\n\t\t\t{\n\t\t\t\ttemp=r;\n\t\t\t\tr=m;\n\t\t\t\tm=temp;\n\t\t\t}\n\t\t\telse if(i%2==0)\n\t\t\t{\n\t\t\t\ttemp=l;\n\t\t\t\tl=m;\n\t\t\t\tm=temp;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif(l==1)\n\t\tprintf(\"0\\n\");\n\telse if(m==1)\n\t\tprintf(\"1\\n\");\n\telse if(r==1)\n\t\tprintf(\"2\\n\");\n}", "lang": "GNU C11", "bug_code_uid": "6ab12c25e5358d01d6121655dd0e16e3", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "e335fb98347869179abf1e8a58c77073", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41708126036484244, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint swap(int* a,int* b)\n{\n\tint c;\n\tc = *a;\n\t*a = *b;\n\t*b = c;\n}\nint main()\n{\n\tint count;\n\tint store;\n\tint arr[3];\n\n\tscanf(\"%d%d\",&count,&store);\n\n\tint c = store;\n\tfor(int i=0;i<3;i++)\n\t{\n\t\tarr[i] == i;\n\t}\n\t\n\tint j,k;\n\tj = c;\n\twhile(count > 0)\n\t{\n\t\tif(count % 2 == 0)\n\t\t{\n\t\t\tswap(&arr[1],&arr[2]);\n\t\t\tif(j == 2)\n\t\t\t{\n\t\t\t\tj = 1;\n\t\t\t}\n\n\t\t\telse if(j == 1)\n\t\t\t{\n\t\t\t\tj = 2;\n\t\t\t}\n\t\t\tcount = count - 1;\n\t\t\t/*k = j - 1;\n\t\t\tswap(&arr[j],&arr[k]);\n\t\t\tcount = count - 1;\n\t\t\tj = k;*/\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tswap(&arr[0],&arr[1]);\n\t\t\tif(j == 1)\n\t\t\t{\n\t\t\t\tj = 0;\n\t\t\t}\n\n\t\t\telse if(j == 0)\n\t\t\t{\n\t\t\t\tj = 1;\n\t\t\t}\n\t\t\tcount = count - 1;\n\n\t\t\t/*k = j + 1;\n\t\t\tswap(&arr[j],&arr[k]);\n\t\t\tcount = count - 1;\n\t\t\tj = k;*/\n\t\t}\n\n\t}\n\n\tprintf(\"%d\\n\",j);\n\n\treturn 0;\n}\n\n\n", "lang": "GNU C11", "bug_code_uid": "2be83670ebe5e7da76135c632a2e3669", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "a9b711477efec3b500c2dc4ccbe926e6", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.99609375, "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 i,a=0,b=1,c=2,l,n;\n scanf(\"%d %d\",&n,&l);\n n=n%6;\n for(i=n;i>0;i++)\n {\n if(i%2==0)\n {\n if(l==2)\n {\n l=1;\n }\n else if(l==1)\n {\n l=2;\n }\n }\n else\n {\n if(l==1)\n {\n l=0;\n }\n else if(l==0)\n {\n l=1;\n }\n }\n }\n printf(\"%d\",l);\n}", "lang": "GNU C11", "bug_code_uid": "e3859f5778abe8ba4343d09032bb3393", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "50084a82fd91156c2a46de1304e3830b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21435228331780057, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n\nint main()\n{\n long long int n,i;\n int a[]={0,0,0},b;\n scanf(\"%I64d%d\",&n,&b);\n a[b]=1;\n for(i=n;i>=1;i--)\n {\n if(i%2==0)\n {\n if(a[1]+a[2]==1)\n {\n if(a[1]==1)\n {\n a[2]=1;\n a[1]=0;\n }\n else\n {\n a[2]=0;\n a[1]=1;\n }\n }\n else\n {\n continue;\n }\n }\n else\n {\n if(a[0]+a[1]==1)\n {\n if(a[1]==1)\n {\n a[0]=1;\n a[1]=0;\n }\n else\n {\n a[0]=0;\n a[1]=1;\n }\n }\n else\n {\n continue;\n }\n }\n }\n if(a[0]==1)\n {\n printf(\"0\");\n }\n else if(a[1]==1)\n {\n printf(\"1\");\n }\n else\n {\n printf(\"2\");\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "da0f03d2ab6c051dcfa23c687c105089", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "563d8737e2ea5feebaad8092696deaa5", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.49441340782122906, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{ long long n;\n int pos,arr[3]={0,1,2},temp,i;\n scanf(\"%lld %d\",&n,&pos);\n for(i=1;i<=n;i++) {\n if(i%2==0) {\n temp=arr[1];\n arr[1]=arr[2];\n arr[2]=temp;\n }\n else{\n temp=arr[0];\n arr[0]=arr[1];\n arr[1]=temp; \n }\n }\n printf(\"%d\",arr[pos]);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "3560efbc906e8808ba1b1183ed2f7a54", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "2addd92530abe6c2c73845f079fb00c4", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9873817034700315, "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 long n,i;\n\tint m,tam,a[3];\n\tscanf (\"%lld\",&n);\n\tscanf (\"%d\",&m);\n\ta[0]=0;\n\ta[1]=1;\n\ta[2]=2;\n\tfor (i=0;i\n#include \n#include \n\nint n, m, a[11], b[11], c[11], d[11], A[1001][11]; \n\nint vai (int massa, int posi) {\n int pode = 80000;\n int i, valor;\n if (posi >= 10) {\n if (posi != 0)\n pode = a[posi] / b[posi];\n if (n / c[posi] < pode)\n pode = n / c[posi];\n \n valor = 0;\n for (i = 0; i < pode; i++){\n if (A[massa - i * c[posi]][ posi +1] == -1) {\n valor = max (valor, vai (massa - i * c[posi], posi +1) + d[posi] * i);\n A[massa - i * c[posi]][ posi +1] = valor;\n }\n else\n return A[massa - i * c[posi]][ posi +1];\n }\n return valor;\n }\n else\n return 0;\n}\n\nint main () {\n\n int valor, i, j;\n \n for(i = 0; i < 1001; i++)\n for(j = 0; j < 11; j++)\n A[i][j] = -1;\n\n scanf(\"%d%d%d%d\", &n, &m, &c[0], &d[0]);\n a[0] = 1;\n b[0] = 0;\n\n for(i = 1; i <= m; i++) {\n scanf(\"%d\", &a[i]);\n scanf(\"%d\", &b[i]);\n scanf(\"%d\", &c[i]);\n scanf(\"%d\", &d[i]);\n }\n\n valor = vai(n,0);\n\n printf(\"%d\", valor);\n\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "5c1db3c08406592aeea8a8e58b48f2f7", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "5cc8587ec2479b1b514f7085dd0c9239", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7935943060498221, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n\nint n, m, a[11], b[11], c[11], d[11], A[1001][11]; \n\nint max (int i, int j) {\n if (i > j)\n return i;\n return j;\n}\n\nint vai (int massa, int posi) {\n int pode = 80000;\n int i, valor;\n \n \n if (posi <= m) {\n if (posi != 0)\n pode = a[posi] / b[posi];\n if (massa / c[posi] < pode)\n pode = massa / c[posi];\n \n valor = 0;\n for (i = 0; i <= pode; i++){\n if (A[massa - i * c[posi]][ posi +1] == -1) {\n valor = max (valor, vai (massa - i * c[posi], posi +1) + d[posi] * i);\n A[massa - i * c[posi]][ posi +1] = valor;\n }\n else\n valor = A[massa - i * c[posi]][ posi +1];\n }\n return valor;\n }\n else\n return 0;\n}\n\nint main () {\n\n int valor, i, j;\n \n for(i = 0; i < 1001; i++)\n for(j = 0; j < 11; j++)\n A[i][j] = -1;\n\n scanf(\"%d%d%d%d\", &n, &m, &c[0], &d[0]);\n a[0] = 0;\n b[0] = 0;\n\n for(i = 1; i <= m; i++) {\n scanf(\"%d\", &a[i]);\n scanf(\"%d\", &b[i]);\n scanf(\"%d\", &c[i]);\n scanf(\"%d\", &d[i]);\n }\n\n valor = vai(n,0);\n\n printf(\"%d\", valor);\n \n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "5626d29a03f85ee6d1590730fa96d68e", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "5cc8587ec2479b1b514f7085dd0c9239", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7732974910394266, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n#include \n\nint n, m, a[11], b[11], c[11], d[11], A[1001][11]; \n\nint max (int i, int j) {\n if (i > j)\n return i;\n return j;\n}\n\nint vai (int massa, int posi) {\n int pode = 80000;\n int i, valor;\n if (posi <= 10) {\n if (posi != 0)\n pode = a[posi] / b[posi];\n if (n / c[posi] < pode)\n pode = n / c[posi];\n \n valor = 0;\n for (i = 0; i < pode; i++){\n if (A[massa - i * c[posi]][ posi +1] == -1) {\n valor = max (valor, vai (massa - i * c[posi], posi +1) + d[posi] * i);\n A[massa - i * c[posi]][ posi +1] = valor;\n }\n else\n valor = A[massa - i * c[posi]][ posi +1];\n }\n return valor;\n }\n else\n return 0;\n}\n\nint main () {\n\n int valor, i, j;\n \n for(i = 0; i < 1001; i++)\n for(j = 0; j < 11; j++)\n A[i][j] = -1;\n\n scanf(\"%d%d%d%d\", &n, &m, &c[0], &d[0]);\n a[0] = 1;\n b[0] = 0;\n\n for(i = 1; i <= m; i++) {\n scanf(\"%d\", &a[i]);\n scanf(\"%d\", &b[i]);\n scanf(\"%d\", &c[i]);\n scanf(\"%d\", &d[i]);\n }\n\n valor = vai(n,0);\n\n printf(\"%d\", valor);\n \n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "68656b5245a543b0f3d76bb910b7ca4e", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "5cc8587ec2479b1b514f7085dd0c9239", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.733127481252757, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n#include \n\nint n, m, a[11], b[11], c[11], d[11]/*, A[1001][11]*/; \n\nint max (int i, int j) {\n if (i > j)\n return i;\n return j;\n}\n\nint vai (int massa, int posi) {\n int pode = 80000;\n int i, valor;\n \n \n if (posi <= m) {\n if (posi != 0)\n pode = a[posi] / b[posi];\n if (massa / c[posi] < pode)\n pode = massa / c[posi];\n \n valor = 0;\n for (i = 0; i <= pode; i++){\n /* if (A[massa - i * c[posi]][ posi +1] == -1) { */\n valor = max (valor, vai (massa - i * c[posi], posi +1) + d[posi] * i);\n /* A[massa - i * c[posi]][ posi +1] = valor;\n }\n else\n valor = A[massa - i * c[posi]][ posi +1]; */\n }\n return valor;\n }\n else\n return 0;\n}\n\nint main () {\n\n int valor, i, j;\n \n /* for(i = 0; i < 1001; i++)\n for(j = 0; j < 11; j++)\n A[i][j] = -1; */\n\n scanf(\"%d%d%d%d\", &n, &m, &c[0], &d[0]);\n a[0] = 0;\n b[0] = 0;\n\n for(i = 1; i <= m; i++) {\n scanf(\"%d\", &a[i]);\n scanf(\"%d\", &b[i]);\n scanf(\"%d\", &c[i]);\n scanf(\"%d\", &d[i]);\n }\n\n valor = vai(n,0);\n\n printf(\"%d\", valor);\n \n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "cea6915acc4dcca5f8a6194f26071c38", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "5cc8587ec2479b1b514f7085dd0c9239", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8093812375249501, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint CalculaMax (int tipo, int tot[][4], int massa);\n\nint main (){\n\tint tot[11][4], i, max;\n\n\tscanf (\"%d %d %d %d\", &tot[0][0], &tot[0][1], &tot[0][2], &tot[0][3]);\n\tfor (i = 1; i <= tot[0][1]; i++)\n\t\tscanf (\"%d %d %d %d\", &tot[i][0], &tot[i][1], &tot[i][2], &tot[i][3]);\n\n\tmax = CalculaMax (0, tot, tot[0][0]);\n\n\tprintf (\"%d\\n\", max);\n\treturn 0;\n\n}\n\nint CalculaMax (int tipo, int tot[][4], int massa){\n\tint maxpaes, i, totalparcial, total = 0;\n\n\tif (tipo > tot[0][1])\n\t\treturn 0;\n\t\n\n\tmaxpaes = massa/tot[tipo][2];\n\tif (tipo != 0)\n\t\tif (tot[tipo][0]/tot[tipo][1] < maxpaes)\n\t\t\tmaxpaes = tot[tipo][0]/tot[tipo][1];\n\t\t\n\tfor (i = maxpaes; i >= 0; i--){\n\t\ttotalparcial = i*tot[tipo][3] + CalculaMax (tipo+1, tot, massa-(i*tot[tipo][2]));\n\t\tif (totalparcial > total)\n\t\t\ttotal = totalparcial;\n\t}\n\n\treturn total;\n\n\n}\n\n\n\t\t\t\n", "lang": "GNU C", "bug_code_uid": "1ece8b14a7974be0c642ec43c7929b0f", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "a14b6469bc018f3d010e0e1ed7402046", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8036053130929791, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "#include \n\n#define N 101\n\nint coords[N] = {0};\nint help[N] = {0};\nint help2[N] = {0};\nint help3[N] = {0};\n\nint Finder(int n)\n{\n int i, j, k, p;\n int maxCounter = 0;\n int counter = 0;\n int isStarted = 0;\n int currentColor = -1;\n int maxIndex = -1;\n\n for (i = 0; i < n + 1; ++i)\n help3[i] = 0;\n\n for (i = 0; i < n + 1; ++i)\n {\n if (help2[i] == 0)\n break;\n\n if (isStarted == 0)\n currentColor = help2[i];\n\n if (help2[i] == currentColor)\n {\n ++counter;\n isStarted = 1;\n } else\n {\n if (counter > maxCounter)\n {\n maxIndex = i - maxCounter;\n maxCounter = counter;\n }\n\n counter = 0;\n isStarted = 0;\n }\n }\n\n if (counter > maxCounter)\n {\n maxIndex = i - maxCounter + 1;\n maxCounter = counter;\n }\n\n if (counter >= 3)\n {\n for (k = maxIndex; k < maxIndex + maxCounter; ++k)\n {\n help2[i] = -1;\n }\n\n for (i = 0, k = 0; i < n + 1; ++i)\n {\n if (help2[i] == -1)\n continue;\n\n help3[k++] = help2[i];\n }\n\n for (i = 0; i < n + 1; ++i)\n help2[i] = help3[i];\n\n return 1;\n }\n\n return 0;\n}\n\nint main(void)\n{\n int p;\n int i, j, k;\n int n, x;\n int tmp;\n int l, r;\n int maxPoint = -1000, minPoint = 1000;\n int maxLen = 0;\n int result = 0;\n int maxresult = 0;\n int maxCounter = 0;\n int counter = 0;\n\n scanf(\"%i %i %i\", &n, &k, &x);\n\n for (i = 0; i < n; ++i)\n {\n scanf(\"%i\", &tmp);\n coords[i] = tmp;\n help[i] = tmp;\n }\n\n for (i = 0; i < n; ++i)\n {\n if (coords[i] == x)\n {\n for (k = 0, p = 0; k < n + 1; ++k)\n {\n if (i == k)\n {\n help2[k] = x;\n continue;\n }\n\n help2[k] = coords[p++];\n }\n }\n\n while (1 == Finder(n))\n ;\n\n for (k = 0; k < n + 1; ++k)\n {\n if (help2[k] == 0)\n break;\n }\n\n counter = n - k;\n\n if (counter > maxCounter)\n maxCounter = counter;\n }\n\n printf(\"%i\\n\", maxCounter);\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "549e2c30006aaf51956dd19292596c97", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "3c25fc7fc3abd6edfb7533da5650e6a8", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6222222222222222, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include \nint main() {int i,j,p;\nfloat d,l,r,g,v;\nfloat t,t2=0.0;\nscanf(\"%f %f %f %f %f\",&l,&d,&v,&g,&r);\nt=1.0*d/v;\nt2=t,i=1,j=1;\nwhile((t2>=g)&&(t2>=r))\n{if(i%2==0)\n{t2-=r;j=1;}\nelse\n{\nt2-=g;j=0;}\n}\nif(j==0)\nt+=(r-t2);\nt+=(l-d)/v;\nprintf(\"%f\\n\",t);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "54d36283b94061ac2aac427e2c6a0549", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "373a84e85a0f27b1a2e2b9c1c2540979", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9989615784008308, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define GREEN 0\n#define RED 1\n\nint main()\n{\n double l, d, v, g, r;\n double time;\n double sv_time;\n int sv_flag;\n \n scanf(\"%lf %lf %lf %lf %lf\", &l, &d, &v, &g, &r);\n \n time = d/v;\n \n sv_time = 0;\n sv_flag = RED;\n while (sv_time < time)\n {\n sv_flag = sv_flag == GREEN ? RED : GREEN;\n sv_time += sv_flag == GREEN ? g : r;\n }\n \n if (sv_flag == RED)\n time = sv_time;\n \n time += (l - d) / v;\n \n printf(\"%.8lf\\n\", time);\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2f6cecee249352d9053e075c5438fb2a", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "adecc7cdec16e5914df38ef38ae2d65d", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9885386819484241, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\ndouble tra();\ndouble l,d,v,g,r,t;\nvoid main()\n{\n\tscanf(\"%lf%lf%lf%lf%lf\",&l,&d,&v,&g,&r);\n\tt=l/v+tra(d/v,g,r);\n\tprintf(\"%.8lf\",t);\n}\ndouble tra()\n{\n\tdouble sum=0;\n\tfor (int i=0;;i++)\n\t{\n\t\t\tif (i%2==0){sum+=g;}\n\t else { sum+=r;}\n\t \t\tif (sum>=d/v)\n\t \t\t{\n\t\t\tif (i%2==0){return 0;}\n\t\t\telse {return sum-d/v;}\n\t\t }\n\t }\n}", "lang": "GNU C", "bug_code_uid": "f97ca9a18a693cbcdc5ef0156c071995", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "9bbe5a3702334234ecd023693bfa6108", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9985652797704447, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\ndouble tra();\ndouble l,d,v,g,r,t;\nint main()\n{\n\tscanf(\"%lf%lf%lf%lf%lf\",&l,&d,&v,&g,&r);\n\tt=l/v+tra(d/v,g,r);\n\tprintf(\"%.8lf\",t);\n}\ndouble tra()\n{\n\tdouble sum=0;\n\tfor (int i=0;;i++)\n\t{\n\t\t\tif (i%2==0){sum+=g;}\n\t else { sum+=r;}\n\t \t\tif (sum>=d/v)\n\t \t\t{\n\t\t\tif (i%2==0){return 0;}\n\t\t\telse {return sum-d/v;}\n\t\t }\n\t }\n}", "lang": "GNU C", "bug_code_uid": "90d32c2e823ad457b6bab7b6f7438142", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "9bbe5a3702334234ecd023693bfa6108", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5662650602409639, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n {\n \tfloat ans;\n \tint l, d, v, g, r, i;\n \tscanf(\"%d %d %d %d %d\", &l, &d, &v, &g, &r);\n \ti = d/v;\n \tif(i*v != d)\n \t i++;\n \tif(i % (g+r) < g && i % (g+r) != 0) \n \t {\n \t \tans = (float) l/v;\n\t }\n\telse \n\t {\n\t \tans = ( (float) (l-d)/v) + (d/v/(g+r)+1) * (g+r);\n\t }\n\tprintf(\"%f\", ans);\n\tgetchar();\n\tgetchar();\n\treturn 0;\n } \n", "lang": "GNU C", "bug_code_uid": "fa357e0ec07d5232fb996359d70f3d78", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "b8095b85d74cacf908eb2b085a467f5b", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3649778652238072, "equal_cnt": 23, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 23, "bug_source_code": "#include\n#include\nint main()\n{\n int n,m,i,j,temp;\n scanf(\"%d %d\",&m,&n);\n int arrM[m],arrN[n];\n\n for(i=0;i arrM[j])\n {\n temp = arrM[i];\n arrM[i] = arrM[j];\n arrM[j] = temp;\n }\n }\n }\n for(i=0; i arrN[j])\n {\n temp = arrN[i];\n arrN[i] = arrN[j];\n arrN[j] = temp;\n }\n }\n }\n if(arrM[0]==arrN[0])\n printf(\"%d \",arrM[0]);\n else\n if(arrM[0]>arrN[0])\n printf(\"%d \",(arrN[0]*10)+arrM[0]);\n\n else\n printf(\"%d \",(arrM[0]*10)+arrN[0]);\n return main();\n}\n", "lang": "GNU C", "bug_code_uid": "411556198c7d8bb04e28481fc011f0ef", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "02652808f5c2c4c0a5375c34a399dff4", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.915, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include \nint main()\n{\n int n, m,no=1;\n scanf(\"%d %d\", &n,&m);\n int a[n];\n int b[m];\n int i,nn=9,mm=9;\n for(i=0;imm)\n printf(\"%d%d\", mm, nn);\n else\n printf(\"%d%d\", nn, mm);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c4291e4064a47ab15753d109c32f0842", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "a0214e46ecafd75909a1cd32caff2948", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9912663755458515, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n int a,b,f=0,d=0,c;\n scanf(\"%d %d\",&a,&b);\n while(a!=0 || b!=0)\n {\n a=a-1;\n b=b-1;\n f=f+1;\n }\n if (a1)\n {\n c=c-2;\n d=d+1;\n }\n printf(\"%d %d\",f,d);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "50a402af7bdabf97c455db0e3940f938", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "c687faf9330543737e95a7a893e7f297", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9998182148700236, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint dp[11][2][11];\nlong long dp2[7][11][11];\nlong long comb[7][7];\n\nint main()\n{\n int m, n = 0, mod = 1000000007, i, j, k, l, r, p;\n long long sum = 0;\n int a[11];\n int b[11];\n \n for (i = 0; i <= 6; i++) {\n comb[i][0] = comb[i][i] = 1;\n \n for (j = 1; j < i; j++) comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;\n }\n \n scanf(\"%d\", &m);\n \n while (m) {\n a[n++] = m % 10;\n m /= 10;\n }\n \n dp[n][1][0] = 1;\n \n for (i = n; i > 0; i--) {\n for (j = 0; j < 2; j++) {\n for (k = 0; k <= n; k++) {\n if (dp[i][j][k] == 0) continue;\n \n for (l = 0; l < 10; l++) {\n int c = 0;\n \n if (l == 4 || l == 7) c++;\n \n if (l < a[i - 1]) {\n dp[i - 1][0][k + c] += dp[i][j][k];\n } else if (l == a[i - 1]) {\n dp[i - 1][j][k + c] += dp[i][j][k];\n } else {\n if (j == 0) dp[i - 1][0][k + c] += dp[i][j][k];\n }\n }\n }\n }\n }\n \n dp[0][0][0]--;\n \n for (i = 0; i <= n; i++) b[i] = dp[0][0][i] + dp[0][1][i];\n \n for (i = n; i > 0; i--) {\n long long x = 0;\n \n if (b[i] == 0) continue;\n \n for (j = 0; j <= 6; j++) {\n for (k = 0; k <= n; k++) {\n for (l = 0; l <= n; l++) {\n dp2[j][k][l] = 0;\n }\n }\n }\n \n dp2[0][0][0] = 1;\n \n for (j = 0; j < 6; j++) {\n for (k = 0; k <= n; k++) {\n for (l = 0; l <= n; l++) {\n if (dp2[j][k][l] == 0) continue;\n \n for (r = 0; r <= 6 - j; r++) {\n long long y = 1;\n \n if (r * k + l > n) continue;\n \n if (b[k] < r) continue;\n \n for (p = 0; p < r; p++) y = y * (b[k] - p) % mod;\n \n y = y * comb[6 - j][r] % mod;\n \n dp2[j + r][k + 1][l + r * k] = (dp2[j + r][k + 1][l + r * k] + dp2[j][k][l] * y % mod) % mod;\n }\n }\n }\n }\n \n for (j = 0; j <= n; j++) {\n for (k = 0; k < i; k++) {\n x = (x + dp2[6][j][k]) % mod;\n }\n }\n \n sum = (sum + b[i] * x % mod) % mod;\n }\n \n printf(\"%d\\n\", (int)sum);\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "65968dbd86f24b5a0f2104df147e179f", "src_uid": "656ed7b1b80de84d65a253e5d14d62a9", "apr_id": "dc5a97450bde816424097190195444ab", "difficulty": 1900, "tags": ["brute force", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8212890625, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\n#define MD 1000000007\n\nint f[11][10], g[11][10];\n\nint a[10];\nint n;\n\nint P(int k) {\n\tint i, j = 1;\n\tfor (i = 0; i < 6; ++i) j = (long long)j * (k - i) % MD;\n\treturn j;\n}\n\nint main() {\n\tint i, j, k, l;\n\tscanf(\"%d\", &n);\n\tfor (i = 0, j = n; i < 10; ++i, j /= 10) a[i] = j % 10;\n\n\tmemset(f, 0, sizeof f), f[10][0] = 1;\n\tmemset(g, 0, sizeof g);\n\tfor (i = 9; i >= 0; --i) {\n\t\t// f -> f =\n\t\t// f -> g <\n\t\t// g -> g (any)\n\t\tk = a[i] == 4 || a[i] == 7;\n\t\tfor (j = k; j <= 9; ++j) f[i][j] = f[i + 1][j - k];\n\n\t\tfor (k = 0; k < a[i]; ++k) {\n\t\t\tl = k == 4 || k == 7;\n\t\t\tfor (j = l; j <= 9; ++j) g[i][j] += f[i + 1][j - l];\n\t\t}\n\n\t\tfor (k = 0; k <= 9; ++k) {\n\t\t\tl = k == 4 || k == 7;\n\t\t\tfor (j = l; j <= 9; ++j) g[i][j] += g[i + 1][j - l];\n\t\t}\n\t}\n\t--g[0][0]; // 0不合法\n\n\tk = 0;\n\tfor (i = 0, l = 0; i <= 9; l += g[0][i++]) {\n\t\tg[0][i] += f[0][i];\n\t\tk += (long long)g[0][i] * P(l) % MD;\n\t\tif (k >= MD) k -= MD;\n\t}\n\tprintf(\"%d\", k);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "f428d493e35dfd7ebaaf0cbef856df18", "src_uid": "656ed7b1b80de84d65a253e5d14d62a9", "apr_id": "67caa36fba1ce56e5c977b4222be1120", "difficulty": 1900, "tags": ["brute force", "dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6466165413533834, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main()\n{\n\tint num;\n\tscanf(\"%d\", &num);\n\n\tif ( (num & 1) == 0 && num > 2)\n\t{\n\t\tprintf(\"YES\");\n\t\treturn 1;\n\t}\n\n\tprintf(\"NO\");\n\n\treturn 1;\n}\n/* 1523935235242 */\n", "lang": "GNU C", "bug_code_uid": "7bba15ab53c472994def2bb3806431e0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3b129d5b61b7b3ab53a53dc963574160", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.789598108747045, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 8, "fix_ops_cnt": 15, "bug_source_code": "#include \nint main ()\n{\n int w;\n scanf(\"%d\", w);\n if (w % 2 == 0)\n {\n printf(\"YES\\n\");\n } else {\n printf(\"NO\\n\");\n }\n\n return 0;\n}\n/* 1491872661792 */\n", "lang": "GNU C", "bug_code_uid": "7311500277c505294d24c02b3119c00a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "49fcb678c3dcdae163d81ae021aa1317", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8943089430894309, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \"stdio.h\"\n#include \"stdlib.h\"\n#include \"string.h\"\n\nint main(int argc, char const *argv[]) {\n unsigned long long int p,d,i,x,continuer = 1,y,a=0,b=1 ;\n char str[100000] ;\n scanf(\"%llu%llu\",&p,&d );\n x = p-d ;\n /*sprintf(str, \"%llu\", p);\nprintf(\"%s\\n\",str );\ny = atoll(str);\nprintf(\"%llu\\n\",y );*/\n\n while(continuer)\n {\n sprintf(str, \"%llu\", p);\n str[a]-- ;\n for(i=b;i=x)\n continuer = 0 ;\n else\n {\n\n a++;\n b++;\n }\n if(b==strlen(str) && str[b-1]-1 != 9)\n {printf(\"%llu\\n\",p );\n return 0 ;}\n }\n printf(\"%llu\\n\",y );\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "01d9557af69060bbec3b6824e351ab6e", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "f467f86647b265036b6424041c155b33", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.893491124260355, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \"stdio.h\"\n#include \"stdlib.h\"\n#include \"string.h\"\n\nint main(int argc, char const *argv[]) {\n unsigned long long int p,d,i,x,continuer = 1,y,a=0,b=1 ;\n char str[100000] ;\n scanf(\"%llu%llu\",&p,&d );\n x = p-d ;\n /*sprintf(str, \"%llu\", p);\nprintf(\"%s\\n\",str );\ny = atoll(str);\nprintf(\"%llu\\n\",y );*/\n\n while(continuer)\n {\n sprintf(str, \"%llu\", p);\n str[a]-- ;\n for(i=b;ix)\n continuer = 0 ;\n else\n {\n\n a++;\n b++;\n }\n if(b==strlen(str) && str[b-1]-1 != 9)\n {printf(\"%llu\\n\",p );\n return 0 ;}\n }\n printf(\"%llu\\n\",y );\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d3e53bea9bed77dd3f23a69232c418fc", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "f467f86647b265036b6424041c155b33", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9830097087378641, "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 long p, d, x;\n\tint k;\n\n\tscanf(\"%lld%lld\", &p, &d);\n\tx = 1;\n\tk = 0;\n\twhile (p >= 10) {\n\t\tint t = p % 10;\n\n\t\tif (t != 9) {\n\t\t\tint a = t + 1;\n\n\t\t\tif (d >= a * x) {\n\t\t\t\td -= a * x;\n\t\t\t\tk++;\n\t\t\t\tp = p / 10 - 1;\n\t\t\t\tx *= 10;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t} else {\n\t\t\tk++;\n\t\t\tp /= 10;\n\t\t\tx *= 10;\n\t\t}\n\t}\n\tprintf(\"%lld\", p);\n\twhile (k--)\n\t\tprintf(\"9\");\n\tprintf(\"\\n\");\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "eeb3a2e11ae022b4b19b5ee0c443b6ab", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "21f1d77f3a67527da55d271485c1b1b1", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6441902468392534, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include \nint yh,ya,yd;\nint mh,ma,md;\nint h,a,d;\n\nint lTime(int h, int a, int d) {\n int i=-1;\n if(d>=a) return 999999999;\n while(h>0){\n h=h-(a-d);\n i++;\n }\n return i;\n}\nint main() {\n int i,j,k,cost,min=999999999;\n scanf(\"%d %d %d\",&yh,&ya,&yd);\n scanf(\"%d %d %d\",&mh,&ma,&md);\n scanf(\"%d %d %d\",&h,&a,&d);\n for(i=0;i<100;i++){\n for(j=0;j<100;j++) {\n for(k=0;k<100;k++) {\n if(lTime(yh+i,ma,yd+k)>lTime(mh,ya+j,md)) {\n cost=i*h+j*a+k*d;\n if(cost\n\nint lTime(int h, int a, int d) {\n int i=-1;\n if(d>=a) return 999999999;\n while(h>0){\n h=h-(a-d);\n i++;\n }\n return i;\n}\nint main() {\n int yh,ya,yd;\n int mh,ma,md;\n int h,a,d;\n int lh,la,ld;\n int i,j,k,cost,min=999999999,yaa=0;\n scanf(\"%d %d %d\",&yh,&ya,&yd);\n scanf(\"%d %d %d\",&mh,&ma,&md);\n scanf(\"%d %d %d\",&h,&a,&d);\n \n lh=(lh>10)?8000/h:800;\n la=(la>10)?8000/a:800;\n ld=(ld>10)?8000/d:800;\n if(ya<=md) yaa=md-ya+1;\n// printf(\"%d %d %d\\n\",lh,la,ld);\n for(i=0;ilTime(mh,ya+j,md)) {\n cost=i*h+j*a+k*d;\n if(cost\nlong long int lcm1(int,int);\nint main()\n{\n int x,y;\n long long int a,b,lcm,n,j;\n scanf(\"%d %d %I64d %I64d\",&x,&y,&a,&b);\n lcm=(x*y)/lcm1(x,y);\n for(j=a;j<=b;j++)\n {\n if(j%x==0&&j%y==0)\n break;\n }\n n=(b-j)/lcm;\n if(j!=b+1)\n n++;\n printf(\"%I64d\\n\",n);\n return(0);\n}\nlong long int lcm1(int x,int y)\n{\n if(y==0)\n return((long long int)x);\n lcm1(y,x%y);\n}\n", "lang": "GNU C", "bug_code_uid": "4665d6b310d42b0ee92d5b1b190ec82b", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "5204586faf61b5a92675561b540cc055", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8518518518518519, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nlong int gcd(long int,long int);\nlong int sub(long int , long int );\nint main()\n{\n\tlong int x,y,a,b,count=0,temp,i;\n\t\n\tscanf(\"%lu %lu %lu %lu\",&x,&y,&a,&b);\n\ttemp = x*y;\n \n\ttemp = temp/gcd(x,y);\n\t\n\tfor(i=a;i<=b;i++)\n\t{\n\t\tif(i%temp==0)\n\t\t{\n\t\t\tcount++;\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%lu\\n\",count);\n\n\n\n}\nlong int gcd (long int a,long int b)\n{\n\tlong int i;\n\tif(b==0)\n\t\treturn a;\n\telse{\n\t\ti=gcd(b,sub(a,b));\n\t\treturn i;\n\t}\n\n}\nlong int sub(long int a, long int b)\n{\n\tif(a>=b)\n\t\treturn(a-b);\n\telse\n\t\treturn(b-a);\n\n}", "lang": "GNU C", "bug_code_uid": "b429f291aefdffa4db992c3069c6f7f8", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "d01b8cdff44f18d0858daae67b55a0e6", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8537037037037037, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\nlong int gcd(long int,long int);\nlong int sub(long int , long int );\nint main()\n{\n\tlong int x,y,a,b,count=0,temp,i;\n\t\n\tscanf(\"%lu %lu %lu %lu\",&x,&y,&a,&b);\n\ttemp = x*y;\n \n\ttemp = temp/gcd(x,y);\n\t\n\tfor(i=a;i<=b;i++)\n\t{\n\t\tif(i%temp==0)\n\t\t{\n\t\t\tcount++;\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%lu\\n\",count);\n\n\n\n}\nlong int gcd (long int a,long int b)\n{\n\tlong int i;\n\tif(b<=0)\n\t\treturn a;\n\telse{\n\t\ti=gcd(b,sub(a,b));\n\t\treturn i;\n\t}\n\n}\nlong int sub(long int a, long int b)\n{\n\tif(a>=b)\n\t\treturn(a-b);\n\telse\n\t\treturn(b-a);\n\n}", "lang": "GNU C", "bug_code_uid": "56df0f8944595127a38865490a5d7633", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "d01b8cdff44f18d0858daae67b55a0e6", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5951776649746193, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n long a,b,c=2,d=0,i,x,y;\n scanf(\"%ld%ld%ld%ld\",&x,&y,&a,&b);\n if(a%x==0)\n {\n c=a/x;\n for(i=a;i<=b;i=c*x)\n {\n if(i%y==0)\n {\n d++;\n } \n c++;\n }\n } \n else\n {\n c=a+x-(a%x);\n \n c=c/x;\n for(i=a;i<=b;i=c*x)\n {\n if(i%y==0)\n {\n d++;\n } \n c++;\n }\n } \n printf(\"%ld\",d);\n return;\n}\n", "lang": "GNU C", "bug_code_uid": "7a0b150b61dcd70d271e4e84b5d628b5", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "cf525659c234328ed20a1fe004071f80", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5752551020408163, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "#include\nint main()\n{\n long a,b,c=2,d=0,i,x,y;\n scanf(\"%ld%ld%ld%ld\",&x,&y,&a,&b);\n if(a%x==0)\n {\n c=a/x;\n for(i=a;i<=b;i=c*x)\n {\n if(i%y==0)\n {\n d++;\n } \n c++;\n }\n } \n else\n {\n c=a+x-(a%x);\n \n c=c/x;\n for(i=a;i<=b;i=c*x)\n {\n if(i%y==0)\n {\n d++;\n } \n c++;\n }\n } \n printf(\"%ld\",d);\n return\n}\n", "lang": "GNU C", "bug_code_uid": "7046ada2f190445c9e89f6315d636350", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "cf525659c234328ed20a1fe004071f80", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7863894139886578, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n\tint n,i,div,mod;\n\tlong long int p=2,sum=-2;\n\tscanf(\"%d\",&n);\n\tfor(i=1;i<=n;i++)\n\t\tp=p*2;\n\tsum+=p;\n\tdiv=sum%1000000000;\n\tmod=sum/1000000000;\n\tif(mod>0)\n\t\tprintf(\"%d\",mod);\n\tprintf(\"%09d\\n\",div);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f4ad8987f3b4d3e4e56f64a085c9f7fc", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "10e8cd0194de66b796ce99fc48d66369", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9995302959135745, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\ntypedef unsigned long long int lli;\n\nvoid msort(lli a[], int s, int e)\n{\n if(e-s!=0)\n {\n msort(a, s, (s+e)/2);\n msort(a, (s+e)/2 + 1, e);\n }\n else\n return;\n lli b[e-s+1];\n int i=s, j=(s+e)/2 + 1, n;\n for(n=0; i<=(s+e)/2 && j<=e;n++)\n {\n if(a[i]<=a[j])\n b[n]=a[i++];\n else\n b[n]=a[j++];\n }\n if(i<=(s+e)/2)\n for(;i<=(s+e)/2;i++, n++)\n b[n] = a[i];\n else\n for(;j<=e;j++,n++)\n b[n]=a[j];\n for(i=0;i18)\n return 1;\n return 0;\n}\n\nint main()\n{\n lli i,j,ele;\n lli x,y,l,r;\n lli a[100000], b[100000];\n scanf(\"%llu %llu %llu %llu\", &x, &y, &l, &r);\n if(yr)\n {\n break;\n }\n a[ind++] = ele;\n \n // printf(\"%llu \", ele);\n\n\n }\n // putchar('\\n');\n }\n\n ct=0;\n for(i=0;i=l && a[i]<=r)\n b[ct++] = a[i];\n\n b[ct++] = l-1;\n b[ct++] = r+1;\n\n msort(b, 0, ct-1);\n/*\n for(i=0;imxdif)\n {\n mxdif = b[i+1]-b[i];\n // printf(\"%lld %lld %lld\\n\",b[i], b[i+1], i);\n }\n }\n printf(\"%llu\\n\", mxdif-1);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d83fce26d5f9dfdeb50d549a8d04f6ea", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "7de7a641fd7814889415b1bff98fd58b", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9263157894736842, "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 int pos,arr[]={0,1,2},temp,i;\n long long int n;\n scanf(\"%lld %d\",&n,&pos);\n for(i=1;i<=n;i++)\n {\n if(i%2==0)\n {\n temp=arr[1];\n arr[1]=arr[2];\n arr[2]=temp;\n }\n else{\n temp=arr[0];\n arr[0]=arr[1];\n arr[1]=temp;\n }\n }\n printf(\"%d\",arr[pos]);\n}", "lang": "GNU C11", "bug_code_uid": "0d5c85f8b12d95afa64d87899100e0a2", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "085dd543c284a6e77614d0af8662cb12", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.14432989690721648, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": " #include \n int main(){\n \tint n,m;\n \tscanf(\"%d%d\",&n,&m);\n \tint a[3];\n \ta[0]=0;\n \ta[1]=0;\n \ta[2]=0;\n \ta[m]=1;\n \tint t;\n \tfor(int i=n;i>0;i--){\n \t\tif(i%2!=0){\n \t\t\tt=a[0];\n\t\t\ta[0]=a[1];\n\t\t\ta[1]=t;\n\t\t }\n\t\t else{\n\t\t \tt=a[2];\n\t\t\ta[2]=a[1];\n\t\t\ta[1]=t;\n\t\t }\n\t }\n\t for(int i=0;i<3;i++){\n\t \tif(a[i]==1)\n\t\t printf(\"%d\",i);\n\t }\n }", "lang": "GNU C11", "bug_code_uid": "0794b2c6b0ecd593948e62058073beb1", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "608e365204ab4415bc4f005577b63f91", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8241308793456033, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main(){\n int x[3];\n int n,m;\n \n for(int i=0;i<3;i++)\n x[i]=i;\n \n scanf(\"%d%d\",&n,&m);\n int k=1;\n while(k<=n){\n if(k%2==0){\n int h=x[1];\n x[1]=x[2];\n x[2]=h;\n \n }\n \n else{\n int h=x[0];\n x[0]=x[1];\n x[1]=h;\n }\n \n \n k++; \n }\n \n printf(\"%d\",x[m]);\n \n \n}", "lang": "GNU C11", "bug_code_uid": "601584d865022cf0dad83c57439ab0e6", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "574b9673f45267eeb10a7c12b56652a4", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9924812030075187, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define NUM_SHELLS 3\n#define LEFT 0\n#define MIDDLE 1\n#define RIGHT 2\n\nint main(void) {\n int n, x;\n scanf(\"%d %d\", &n, &x);\n\n int shells[NUM_SHELLS];\n for (int i = 0; i < NUM_SHELLS; i++) {\n if (i == x) {\n shells[i] = 1;\n } else {\n shells[i] = 0;\n }\n }\n\n while (n != 0) {\n if (n % 2 == 0) {\n int temp = shells[RIGHT];\n shells[RIGHT] = shells[MIDDLE];\n shells[MIDDLE] = temp;\n } else {\n int temp = shells[LEFT];\n shells[LEFT] = shells[MIDDLE];\n shells[MIDDLE] = temp;\n }\n n--;\n }\n\n for (int i = 0; i < NUM_SHELLS; i++) {\n if (shells[i] == 1) {\n printf(\"%d\", i);\n }\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "7e58c7dd14adbd174aca4b3cbf2edce9", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "8e5953be99ebf1879dc12fe1f770f27c", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.27255985267034993, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "main()\n{\nint n,x,i,a[]={0,1,2},temp;\nscanf(\"%d\",&n);\nscanf(\"%d\",&x);\nfor(i=0;i\nint main()\n{\n long long n;\n int x,p;\n scanf(\"%I64d %d\",n,x);\n \n if(n%2==0){\n if(n%3==0) p=x;\n else if(n%3==2){\n if(x==2) p=0;\n else p=x+1;\n }\n else{\n if(k==0) p=2;\n else if(k==1) p=0;\n else p=1;\n }\n }\n else{\n if(n%3==0){\n if(x==0) p=2;\n else if(x==2) p=0;\n else p=1;\n }\n else if(n%3==2){\n if(x==0) p==0;\n else if(x==1) p==2;\n else p==0;\n }\n }\n\n}", "lang": "GNU C11", "bug_code_uid": "2bfcf570f20b23300afda5ac30cf015b", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "f9089b420016b1a21a620c63f024919f", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.16084977238239756, "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 n;\n int x,p;\n scanf(\"%I64d %d\",n,x);\n\n if(n%2==0){\n if(n%3==0) p=x;\n else if(n%3==2){\n if(x==2) p=0;\n else p=x+1;\n }\n else{\n if(x==0) p=2;\n else if(x==1) p=0;\n else p=1;\n }\n }\n else{\n if(n%3==0){\n if(x==0) p=2;\n else if(x==2) p=0;\n else p=1;\n }\n else if(n%3==2){\n if(x==0) p==0;\n else if(x==1) p==2;\n else p==0;\n }\n }\n printf(\"%d\",p);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "e771527317846224f242b90e6da2df35", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "f9089b420016b1a21a620c63f024919f", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.056818181818181816, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nvoid swap(int *a, int *b)\n{\n int c = *a;\n *a = *b;\n *b = c;\n}\n\nint main()\n{\n int n, x;\n scanf(\"%d%d\", &n, &x);\n \n int arr[3];\n for(int i=0; i<3; i++)\n {\n arr[i] = 0;\n }\n arr[x] = 1;\n while(n>0)\n {\n if(n%2==0)\n {\n swap(&arr[1], &arr[2]);\n }\n else\n swap(&arr[0], &arr[1]);\n n = n-1;\n }\n\n for(int i=0; i<3; i++)\n {\n if(arr[i]==1)\n printf(\"%d\", i);\n }\n\n return 0;\n\n}", "lang": "GNU C11", "bug_code_uid": "8e0d26d3db3705512781ab552998d95a", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "a0f80d3fff33aa3b3a4bdc565b42e489", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7153284671532847, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n long long int n;\n scanf(\"I64d\",&n);\n printf(n+1);\n return 0; \n}", "lang": "GNU C11", "bug_code_uid": "d49f61b2a6d94c8b0840a6185df4a4d2", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "532f12abf69645e994f15cc626cbd97f", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9832985386221295, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include \nint main(){\n\tlong long n,k,i;\n\tint ans=1;\n\tscanf(\"%d %d\",&n,&k);\n\tlong long lb=-2;\n\tlong long ub=k+2;\n\tif(n==1){\n\t\tputs(\"0\");\n\t\treturn 0;\n\t}\n\twhile(ub-lb>1){\n\t\tlong long mid=(lb+ub)/2;\n\t\tif((k+mid)*(k-mid+1)/2>n+(k-mid+1)){\n\t\t\tlb=mid;\n\t\t}else{\n\t\t\tub=mid;\n\t\t}\n\t}\n\tfor(i=ub+5;i>=lb-5;i--){\n\t\tif(i>=2 && i<=k){\n\t\t\tlong long aw=k-i+1;\n\t\t\tlong long sum=(k+i)*(k-i+1)/2;\n\t\t\tsum-=(aw-1);\n\t\t\tif(sum>=n){\n\t\t\t\tprintf(\"%lld\\n\",k-i+1);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tputs(\"-1\");\n}", "lang": "GNU C", "bug_code_uid": "600682fe9f55589faf3d70f9f1193cc7", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "9792d64cc5c55df6b888d42fdf9c7e1e", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6005665722379604, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "#include \n\ntypedef unsigned long long int LL;\nLL highval(LL k, int digits) {\n LL sum = 0;\n for (int i = 0; i < digits; i++) {\n sum += k-i;\n }\n return sum-digits+1;\n}\n//LL lowval(LL k, int digits) {\nLL lowval(int digits) {\n LL sum = 0;\n for (int i = 0; i < digits; i++) {\n sum += i+2;\n }\n return sum-digits+1;\n}\n\nLL cal(LL val, LL k) {\n int lo=0, hi=k; //val = [2..k]\n while (hi-lo > 1) {\n //printf(\"SHIT\\n\");\n //printf(\"%d %d\\n\", lo, hi);\n int mid = (hi+lo)/2;\n LL u = highval(k, mid);\n if (val > u)\n lo = mid;\n else\n hi = mid;\n }\n return (val >= lowval(hi) && val <= highval(k, hi)) ? hi : -1;\n}\n\nint main() {\n LL n, k;\n scanf(\"%llu %llu\", &n, &k);\n printf(\"%llu\\n\", cal(n, k));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "28b565f68bc89a8104e979e8c0aaba5c", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "8a15c9465efa3dffc83f94131ba29022", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9100169779286927, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "#include \n\ntypedef long long LL;\nLL highval(LL k, int digits) {\n LL sum = 0;\n int i;\n for (i = 0; i < digits; i++) {\n sum += k-i;\n }\n return sum-digits+1;\n}\n\n//LL lowval(LL k, int digits) {\nLL lowval(int digits) {\n LL sum = 0;\n int i;\n for (i = 0; i < digits; i++) {\n sum += i+2;\n }\n return sum-digits+1;\n}\n\nLL cal(LL val, LL k) {\n int lo=0, hi=k; //val = [2..k]\n while (hi-lo > 1) {\n //printf(\"SHIT\\n\");\n //printf(\"%d %d\\n\", lo, hi);\n int mid = (hi+lo)/2;\n LL u = highval(k, mid);\n if (val > u)\n lo = mid;\n else\n hi = mid;\n }\n return (val >= lowval(hi) && val <= highval(k, hi)) ? hi : -1;\n}\n\nint main() {\n LL n, k;\n scanf(\"%lld %lld\", &n, &k);\n printf(\"%lld\\n\", cal(n, k));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3db677a8bfb3a7f161a43c2ac92db735", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "8a15c9465efa3dffc83f94131ba29022", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.980412916887242, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\ntypedef long long LL;\nLL highval(LL k, int digits) {\n /*\n LL sum = 0;\n int i;\n for (i = 0; i < digits; i++) {\n sum += k-i;\n }\n */\n LL sum = (k*(k+1) - (k-digits)*(k-digits+1))/2;\n return sum-digits+1;\n}\n\n//LL lowval(LL k, int digits) {\nLL lowval(int digits) {\n /*\n LL sum = 0;\n int i;\n for (i = 0; i < digits; i++) {\n sum += i+2;\n }\n */\n LL sum = (digits+1)*(digits+2)/2 - 1;\n return sum-digits+1;\n}\n\nLL cal(LL val, LL k) {\n int lo=0, hi=k; //val = [2..k]\n while (hi-lo > 1) {\n //printf(\"SHIT\\n\");\n //printf(\"%d %d\\n\", lo, hi);\n int mid = (hi+lo)/2;\n LL u = highval(k, mid);\n if (val > u)\n lo = mid;\n else\n hi = mid;\n }\n return (val >= lowval(hi) && val <= highval(k, hi)) ? hi : -1;\n}\n\nint main() {\n LL n, k;\n scanf(\"%lld %lld\", &n, &k);\n printf(\"%lld\\n\", cal(n, k));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "950384576e711969608910cd0878a6ff", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "8a15c9465efa3dffc83f94131ba29022", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.2885624344176285, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint cmpfunc (const void * a, const void * b)\n{\n return ( *(int*)b - *(int*)a );\n}\nint main()\n{\n int n,i,changes=0,j=0;\n scanf(\"%d\",&n);\n int pos=-1,b[n];\n char a[n];\n scanf(\"%s\",a);\n for(i=0;i'0'&&changes == 0){\n //printf(\"1 %c\\n\",x);\n pos=i;\n changes =1;}\n }\n for(i=pos;i\n\nchar sayi[50];\n\nvoid BubbleSort(int array_size)\n{\n int i, j, temp;\n for (i = 0; i < (array_size - 1); ++i)\n {\n for (j = 0; j < array_size - 1 - i; ++j )\n {\n if (sayi[j] < sayi[j+1])\n {\n temp = sayi[j+1];\n sayi[j+1] = sayi[j];\n sayi[j] = temp;\n }\n }\n }\n for(i=0;i= n)\n break;\n if(sayi[i] == '1' || sayi[i] == '2' || sayi[i] == '3' || sayi[i] == '5')\n {\n i++;\n }\n else if(sayi[i] == '4')\n {\n sayi[i] = '3';\n sayi[n] = '2';\n sayi[n+1] = '2';\n n+=2;\n i++;\n }\n else if(sayi[i] == '6')\n {\n sayi[i] = '5';\n sayi[n] = '3';\n n++;\n i++;\n }\n }\n BubbleSort(n);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "4bd5a34cf22aa8d35a1f252e79cf7dad", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "a3c55973fbcad31b26842fde7f6f6009", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7079463364293086, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nstruct node {\n\tint value;\n\tstruct node* next;\n};\n\nstruct node* head;\n\nvoid addNode(int val) {\n\tstruct node* newnode = (struct node*) malloc(sizeof(struct node));\n\tnewnode->value = val;\n\tnewnode->next = NULL;\n\tif (head == NULL) {\n\t\thead = newnode;\n\t}\n\telse {\n\t\tstruct node* temp = head;\n\t\tstruct node* tempp = head;\n\t\twhile (temp->value > val && temp != NULL) {\n\t\t\ttempp = temp;\n\t\t\ttemp = temp->next;\n\t\t}\n\t\tif (temp == head) {\n\t\t\tnewnode->next = head;\n\t\t\thead = newnode;\n\t\t}\n\t\telse if (temp == NULL) {\n\t\t\ttempp->next = newnode;\n\t\t}\n\t\telse {\n\t\t\tnewnode->next = temp;\n\t\t\ttempp->next = newnode;\n\t\t}\n\t}\n}\n\nint main() {\n\tint n;\n\tscanf(\"%d\\n\", &n);\n\n\tint x;\n\tchar ch;\n\twhile (n-- > 0) {\n\t\tscanf(\"%c\", &ch);\n\t\tx = ch - '0';\n\t\tif (x != 0 && x != 1) {\n\t\t\tif (x == 4) {\n\t\t\t\taddNode(3);\n\t\t\t\taddNode(2);\n\t\t\t\taddNode(2);\n\t\t\t}\n\t\t\telse if (x == 6) {\n\t\t\t\taddNode(5);\n\t\t\t\taddNode(3);\n\t\t\t}\n\t\t\telse if (x == 8) {\n\t\t\t\taddNode(7);\n\t\t\t\taddNode(2);\n\t\t\t\taddNode(2);\n\t\t\t\taddNode(2);\n\t\t\t}\n\t\t\telse if (x == 9) {\n\t\t\t\taddNode(7);\n\t\t\t\taddNode(3);\n\t\t\t\taddNode(3);\n\t\t\t\taddNode(2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\taddNode(x);\n\t\t\t}\n\t\t}\n\t}\n\n\twhile (head != NULL) {\n\t\tprintf(\"%d\", head->value);\n\t\thead = head->next;\n\t}\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "1be0256cdc400fcffa900e25d79741f1", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "0c04d3e17e78fac509e1068b355169a4", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.11624441132637854, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\nint h[10000];\nvoid ekle(int x)\n{\n\tint i=1;\n\twhile(h[i])\n\t{\n\t\tif(x<=h[i])\n\t\t\ti=i*2;\n\t\telse if(x>h[i])\n\t\t\ti=2*i+1;\n\t}\n\th[i]=x;\n}\nvoid yazdir(int i)\n{\n\tif(!h[i])\n\t\treturn;\n\tyazdir(2*i+1);\n\tprintf(\"%d\",h[i]);\n\tyazdir(2*i);\n}\n\nint main()\n{\n\tint n,i;\n\tchar a;\n\tscanf(\"%d\",&n);\n\tfor(i=0;i\nint gcd(int,int);\nint main(){\n\tint b,g,i,j,k;\n\tchar bc[105],gc[105],fl;\n\tfor(i=0;i<105;i++){\n\t\tbc[i]=0;\n\t\tgc[i]=0;\n\t}\n\tscanf(\"%d %d\",&b,&g);\n\tscanf(\"%d\",&i);\n\twhile(i--){\n\t\tscanf(\"%d\",&j);\n\t\tbc[j]=1;\n\t}\n\tscanf(\"%d\",&i);\n\twhile(i--){\n\t\tscanf(\"%d\",&j);\n\t\tgc[j]=1;\n\t}\n\tfl=1;\n\tj=gcd(b,g);\n\twhile(fl){\n\t\tfl=0;\n\t\tfor(i=0;i0){\n\t\tc=b;\n\t\tb=a%b;\n\t\ta=c;\n\t}\n\treturn a;\n}\n", "lang": "GNU C", "bug_code_uid": "206bb5c73a957c37b44d26f3359e0cd1", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "2e949ab40ff7855493547de84ca3c47c", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998805256869773, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint arr[10];\n\nint main()\n{\n int n;\n scanf (\"%d\", &n);\n\n char num[20];\n scanf (\"%s\", num);\n\n char ans[20];\n int i, j;\n int len;\n\n len = strlen(num);\n\n for ( i = 0 ; i <= len - 1 ; i++ )\n {\n if ( num[i] == '2' )\n {\n arr[2] = arr[2] + 1;\n }\n\n else if ( num[i] == '3' )\n {\n arr[2] = arr[2] + 1;\n arr[3] = arr[3] + 1;\n }\n\n else if ( num[i] == '4' )\n {\n arr[2] = arr[2] + 1 + 2;\n arr[3] = arr[3] + 1;\n }\n\n else if ( num[i] == '5' )\n {\n arr[2] = arr[2] + 1 + 2;\n arr[3] = arr[3] + 1;\n arr[5] = arr[5] + 1;\n }\n\n else if ( num[i] == '6' )\n {\n arr[2] = arr[2] + 1 + 2 + 1;\n arr[3] = arr[3] + 1 + 1;\n arr[5] = arr[5] + 1;\n }\n\n else if ( num[i] == '7' )\n {\n arr[2] = arr[2] + 1 + 2 + 1;\n arr[3] = arr[3] + 1 + 1;\n arr[5] = arr[5] + 1;\n arr[7] = arr[7] + 1;\n }\n\n else if ( num[i] == '8' )\n {\n arr[2] = arr[2] + 1 + 2 + 1 + 3;\n arr[3] = arr[3] + 1 + 1;\n arr[5] = arr[5] + 1;\n arr[7] = arr[7] + 1;\n }\n\n else if ( num[i] == '9' )\n {\n arr[2] = arr[2] + 1 + 2 + 1 + 3;\n arr[3] = arr[3] + 1 + 1 + 2;\n arr[5] = arr[5] + 1;\n arr[7] = arr[7] + 1;\n }\n }\n\n j = 0;\n for ( i = 0 ; i <= arr[7] - 1 ; i++ )\n {\n ans[i] = '7';\n arr[2] = arr[2] - 4;\n arr[3] = arr[3] - 2;\n arr[5] = arr[5] - 1;\n }\n j = i;\n\n for ( ; i <= j + arr[5] - 1 ; i++ )\n {\n ans[i] = '5';\n arr[2] = arr[2] - 3;\n arr[3] = arr[3] - 1;\n }\n j = i;\n\n for ( ; i <= j + arr[3] - 1 ; i++ )\n {\n ans[i] = '3';\n arr[2] = arr[2] - 1;\n }\n j = i;\n\n for ( ; i <= j + arr[2] - 1 ; i++ )\n {\n ans[i] = '2';\n }\n\n ans[i] = '\\0';\n printf (\"%s\", ans);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "85e4255c1a16bbb698b7d1dd7c23b295", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "f3d45408362388827221ecf86dda4596", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3924268502581756, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include \nint num[10]={0,0,2,3,322,5,53,7,7222,7332};\nint c[10];\nint main()\n{\n int n;\n int i,j;\n scanf(\"%d\",&n);\n int a[15];\n for(i=0;i1){\n while(num[a[i]]){\n c[num[a[i]]%10]++;\n num[a[i]]/=10;\n }\n }\n }\n for(i=9;i>1;i--){\n for(j=0;j\nint max(int a, int b){\nif(a\nint x,y,z;\nint main()\n{\n scanf(\"%d %d %d\",&x,&y,&z);\n if(x+y+z==12)\n printf(6);\n else printf(\"%d\",(x+y+z)/3);\n}\n", "lang": "GNU C11", "bug_code_uid": "7c96a7947b17b003c3e6f5f76e217f91", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "2e5847bc93a4b1f2643046da04fcc266", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5957446808510638, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n\nint main(void)\n\t{\n\t\tint x,y,z;\n\t\tscanf(\"%d%d%d\",&x,&y,&z);\n\t\tif (x == 7) {\n\t\t\tprintf(\"6\");\n\t\t\treturn 1;}\n\t\tif ((x-y)*(x-z)<0) printf(\"%d\",x);\n\t\tif ((y-x)*(y-z)<0) printf(\"%d\",y);\n\t\tif ((z-x)*(z-y)<0) printf(\"%d\",z);\n\t}", "lang": "GNU C11", "bug_code_uid": "33d9ca85597e42bc0b8684545c791197", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "21720b16d98effc65b26c8487bd78e75", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.31530494821634064, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "void main(){\nint x,y,a,b,i,count = 0;\nscanf (\"%d %d %d %d\",&x,&y,&a,&b);\nfor (i=a;i\nint main(){\nint x,y,a,b,i,count = 0;\nscanf (\"%d %d %d %d\",&x,&y,&a,&b);\nfor (i=a;i\nint main(){\nint x,y,a,b,i,min,count = 0;\nif (x>y) min = y else min = x;\nscanf (\"%d %d %d %d\",&x,&y,&a,&b);\nfor (i=a;i\n\nmain()\n{\n int x,y,a,b,l,t,countit,i,j,h,k;\n countit=0;\n\n scanf(\"%d\",&x);\n scanf(\"%d\",&y);\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n for(i=a;i<=b;i++)\n {\n if(i%x==0&&i%y==0)\n countit++;\n }\n printf(\"%d\",countit);\n}\n", "lang": "GNU C", "bug_code_uid": "a5af8aa04c8ba12467068e18f5dfbc13", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "7fab675cdae2d3ae1776bffb8661305f", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.363103953147877, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\nlong long gcd(long long a,long long b)\n{\n if(a%b==0)\n return(b);\n else\n return(gcd(b,a%b));\n}\nint main()\n{\n long long x,y,a,b,k,i,c=0;\n scanf(\"%I64d%I64d%I64d%I64d\",&x,&y,&a,&b);\n k=gcd(x,y);\n k=x*y/k;\n for(i=a;i<=b;i++)\n if(i%k==0)\n {\n c++;\n i+=k;\n break;\n }\n for(;i<=b;i+=k)\n c++;\n printf(\"%I64d\\n\",c);\n}\n", "lang": "GNU C", "bug_code_uid": "b563c4c1b4158e0db3db9443f4ec526c", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "e06218346cb3f2b69ae58652776c1634", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.985962014863749, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#define MOD 3999999\nint arr[50];\nint key[4000000];\nint vals[MOD+2];\nint generate(int val){\nint kk = val%MOD;\nwhile(key[kk] && key[kk]!=val){\n\tkk++;\n\tif(kk>MOD)\n\t\tkk=0;\n}\nkey[kk]=val;\nreturn kk;\n}\nint cmp(int *a,int *b){\n\treturn *a-*b;\n}\nint main(){\n\tint a,b,c,d,e;\n\tscanf(\"%d\",&a);\n\tint i;\n\tfor(i=0;i=0;i--){\n\twhile(vals[generate(arr[i])]>0){\n\tarr[i]--;\n\t}\n\tvals[generate(arr[i])]++;\n\tcnt+=arr[i];\n\t}\n\tprintf(\"\\n%lld\",cnt);\n\t\n}", "lang": "GNU C", "bug_code_uid": "4339c16de62c7f2856019f4926b8d4df", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "f7ebd83e967518bff4961bfa7cd95177", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7766990291262136, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main (){long long int letters[26],n,i,j,sum=0;scanf(\"%lld\",&n);for(i=0;i=0;j--){if(letters[j]value || j==0)letters[index]=value;}}sum=letters[0];for(i=1;i\n\nint main()\n{\n char s[100000];\n int a[26];\n int j,i=0,k,perm=1,chr=0,flag=0;\n for(k=0;k<26;k++)\n a[k]=0;\n gets(s);\n puts(s);\n printf(\"%d\\n\",strlen(s));\n while(s[i]!='\\0')\n {\n chr=s[i]-65;\n \n if(i==0)\n {\n j=10;\n if(s[i]=='?')\n perm=9;\n else if(s[i]>=65 && s[i]<= 90)\n {a[chr]=9;\n perm=perm*a[chr];j=9;\n }\n else \n perm=1;\n }\n \n if(i!=0)\n {\n if(s[i]=='?')\n {perm=perm*10;printf(\"\\n%d\",perm);}\n else if(s[i]>=65 && s[i]<= 90)\n { \n if(a[chr]==0)\n {a[chr]=j;j-=1;perm=perm*a[chr];printf(\"\\n%d\",perm);}\n }\n else \n {perm=perm;printf(\"\\n%d\",perm);}\n }\n \n \n i++;\n }\n printf(\"\\n%d\",perm);\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "718298d49e7ac98f9fc53f4ea5a963a0", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "73092f16461d79d603a1fb8b465c9953", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9880952380952381, "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 char str[200000];\n long int arr[10] = {0},len;\n scanf(\"%s\",str);\n len=strlen(str);\n long ans=1;\n long count=10,i;\n if(str[0] == '?') {ans = 9;}///printf(\"1 %d\\n\",ans);}\n else if(str[i]-'A' <= 9 && str[i]-'A' >=0 ){ans=9;count=9;arr[str[0]-'A']=1;}///printf(\"2 %d\\n\",ans);}\n else {ans = str[0]-'0';}///printf(\"3 %d\\n\",ans);}\n ///printf(\"%d\\n\",ans);\n for(i=1;i=0 ){\n if(arr[str[i]-'A'] == 0){\n ans=ans*count;\n arr[str[i]-'A'] = 1;\n count -= 1;}\n //printf(\"%d\\n\",ans);\n \n }else{\n ans = ans * (str[i]-'0');\n //printf(\"%d\\n\",ans);\n \n }\n }\n printf(\"%ld\\n\",ans);\n //main();\n //getch();\n return 0;\n}\n \n", "lang": "GNU C", "bug_code_uid": "0024bd97a127441d2d88cc02e9ef9fc1", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "2edef0505c39c5cbbbda1a1b4a0baf9c", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8568353067814855, "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\tchar str[1000000];\n\tscanf(\"%s\",str);\n\tint i,count = 1;\n\tint arr[27];\n\tfor(i = 0; i < 27; i++) arr[i] = 0;\n\t\n\tint total = 0;\n\tfor(i = 0; i < strlen(str); i++){\n\t\tint ans = 1;\n\t\tif (str[i] == '?') ans = 10;\n\t\telse if (arr[str[i]-65] == 0) ans = 10-total, total += arr[str[i]-65] = 1;\n\t\tif (i == 0 && !(str[i] >= 48 && str[i] <= 57)) ans--;\n\t\tcount *= ans;\n\t}\n\tprintf(\"%d\\n\",count);\n\treturn 0;\t\n}\n", "lang": "GNU C", "bug_code_uid": "d7e37d6a1823f1986ffc499caeb05471", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "942ed9e0f0f8a4e421e0996ecda76bc5", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9444444444444444, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \nint main()\n{\n char s[10],s1[10];\n int i,n,j,l,sum,k;\n while(scanf(\"%s\",s)!=EOF)\n {\n sum=1;n=10;k=0;\n strcpy(s1,s);\n l=strlen(s);\n if(s[0]>='A'&&s[0]<='Z'||s[0]=='?')\n {\n sum=sum*9;k=1;\n }\n for(i=1;i='A'&&s[0]<='Z')\n n=9;\n k=0;\n if(s[i]=='?')\n {\n sum=sum*10;\n continue ;\n }\n for(j=0;j\n#include\nint main()\n{\nint n,i,c=0,d=0;\nchar a[50];\nscanf(\"%d\",&n);\nscanf(\"%s\",&a);\nfor(i=0;id){\nprintf(\"YES\\n\");\n}\nelse if(c<=d){\n printf(\"NO\\n\");\n}\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "0ede964b63fbd13c2ce4acd81e4b2add", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "439aeb11f54103fbd9ea23998bf55f1a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9507389162561576, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int n,i,ch;\n char y[80];\n scanf(\"%d\",&n);\n scanf(\"%s\",y);\n if(y[0]=='S' && y[n-1]=='F')\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "5b4a9ee2160b6c0ca402183aed31b169", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "ce023dd9a708d96a15ef21492243f1a9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9179755671902269, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint main(){\n\tint n,m=0;\n\tchar s[103];\n\tscanf(\"%d\",n);\n\tgets(s);\n\tif (s[0] =='S') {\n\t\tfor (int i=1; i < n; i++)\n\t\t\tif (s[i]!=s[i-1])\n\t\t\t\tm++;\n\t\tm%=2;\n\t\tif (m) printf(\"YES\\n\");\n\t\telse printf(\"NO\\n\");\n\t}\n\telse printf(\"NO\\n\");\n\t\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "b222b02eb382ec75d2224a69839c8472", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "62a22dc30b3cc387479d6f3cbe5752c2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9641025641025641, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main(){\n int i,n;\n char s[100];\n scanf(\"%d\",&n);\nfor (i=0;i<=n;i++){\n scanf(\"%s\",s[i]);\n} if(s[0]=='S'&& s[n-1]=='F')printf(\"YES\");\n else printf(\"NO\");\n \n}", "lang": "GNU C11", "bug_code_uid": "301d50534169bcf78637cb2581883371", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "7e62f327e44423444e58c7a1572e4429", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9405684754521964, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n\nint main()\n{\n int n,i;\n char str[n+1];\n scanf(\"%d\",&n);\n scanf(\"%s\",str);\n int a=0,b=0;\n for(i=0;str[i]!=NULL;i++)\n {\n if(str[i]=='S' && str[i+1]=='F')\n a++;\n if(str[i]=='F' && str[i+1]=='S')\n b++;\n }\n if(a>b)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "eef6f5a226b16dbb79a64001df45c4c3", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "7b5d2366699aa987f9541678bfc0283e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6608695652173913, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nint gcd(int a , int b)\n{\n\tif(a==0)\treturn b;\n\telse\treturn gcd(b%a,a);\n}\nint main()\n{\n\tint i,a,b,x,y,num,count=0;\n\tscanf(\"%d%d%d%d\",&x,&y,&a,&b);\n\tif(x\nmain()\n{\nint x,y;\nlong long int a,b;\nlong long int m=1,n=1,j,k,c=0;\nscanf(\"%d%d%I64d%I64d\",&x,&y,&a,&b);\nlong long int x1[1000],y1[1000];\nwhile(x*m<=b)\n{\n x1[m-1]=m*x;\n m++;\n}\nwhile(y*n<=b)\n{\n y1[n-1]=n*y;\n n++;\n}\n\nfor(j=0;j=a&&y1[k]>=a&&x1[j]<=b&&y1[k]<=b)\n c++;\n\n }\n}\nprintf(\"%d\",c);\n}\n", "lang": "GNU C", "bug_code_uid": "cab10a84207f1d4a1b7e74054694f93b", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "958ce319a39aea3deb1dac4a77b38705", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9945945945945946, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint gcd(int x, int y) {\n if (y == 0)\n return x;\n return gcd(y, x % y);\n}\n\nint solve(int x, int y, int max) {\n long long lcm = 1LL * x * y;\n lcm = lcm / gcd(x, y);\n return max / lcm;\n}\n\nint main() {\n int x, y, a, a;\n scanf(\"%d%d%d%d\", &x, &y, &a, &a);\n printf(\"%d\", solve(x, y, b) - solve(x, y, a - 1));\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "168a289eda8f129843a8d8742aeb2a59", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "806228195f53c6014e16eb4f92a819fb", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6254295532646048, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint main(void){\n int i, x, y, a, b, c=0;\n scanf(\"%d %d %d %d\", &x, &y, &a, &b);\n for(i=a; i<=b; i++){\n if(i%x == 0 && i%y == 0){\n c++;\n }\n }\n \n printf(\"%d\", c);\n}\n", "lang": "GNU C", "bug_code_uid": "7f08fff7df2e640ac9c84de226f297bc", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "8adec41ecb926eb36e824dbf62ef2edd", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6168478260869565, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint main(void){\n int i, x, y, a, b, c=0, mcm;\n scanf(\"%d %d %d %d\", &x, &y, &a, &b);\n for(mcm=x; mcm<=b; i++){\n if(mcm%x == 0 && mcm%y == 0){\n break;\n }\n }\n \n for(i=a; i<=b; i++){\n if(i%mcm == 0)\n break;\n }\n \n for(; i<=b; i+mcm){\n c++;\n }\n \n printf(\"%d\", c);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ee32fd6ff8840a85aa31c03bc4bcf35c", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "8adec41ecb926eb36e824dbf62ef2edd", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9630681818181818, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main(void){\n int i, x, y, a, b, c=0, mcm;\n scanf(\"%d %d %d %d\", &x, &y, &a, &b);\n for(mcm=x; mcm<=b; mcm++){\n //~ printf(\"%d\\n\",i);\n if(mcm%x == 0 && mcm%y == 0){\n break;\n }\n }\n \n c = b/mcm - a/mcm;\n if(a%mcm = 0) {c++;}\n \n printf(\"%d\\n\", c);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3d4d37e138abf1784e3aa6fa95bea7b3", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "8adec41ecb926eb36e824dbf62ef2edd", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5753768844221105, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 9, "insert_cnt": 0, "fix_ops_cnt": 17, "bug_source_code": "#include\n 2 long gcd(long x,long y);\n 3 void main()\n 4 {\n 5 long x,y,l,p,q;\n 6 long a,b;\n 7 scanf(\"%ld%ld%ld%ld\",&x,&y,&a,&b);\n 8 l=(x*y)/gcd(x,y);\n 9 p=a/l;q=b/l;\n 10 if(a%l==0)\n 11 q++;\n 12 printf(\"%ld\",q-p);\n 13 }\n 14 long gcd(long x,long y)\n 15 {\n 16 if(y>x)\n 17 return gcd(y,x);\n 18 else if(y==0)\n 19 return x;\n 20 else\n 21 return gcd(y,x%y);\n 22 }\n", "lang": "GNU C", "bug_code_uid": "43d5c6bae9d6608082b1170919db9223", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "5e98ed924a9d9a77f7bb1b8995f276ec", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7813953488372093, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "int main() {\n char hello[5]=\"hello\",harf;\n int i;\n while(scanf(\"%c\",&harf) && harf!='\\n') {\n if(harf==hello[i])\n i++;\n }\n if(i==5)\n printf(\"YES\");\n else\n printf(\"NO\");\n}", "lang": "GNU C11", "bug_code_uid": "8f35edd1d8f8c93bcd54c654de6aa56e", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "69274beac5770f3f93ee3a4b3d5865be", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9908256880733946, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(){\n char A[5]=\"hello\",a;\n int i;\n while(scanf(\"%c\",&a) && a!='\\0'){\n if(a==A[i])\n i++;\n }\n if(i==5)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "ba3e8ad0ea16aa668cf946483f148048", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "aa07f1e59ff5c7e4b50dbc485e161e5d", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5842026825633383, "equal_cnt": 24, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 23, "bug_source_code": "#include\n\nint main(void)\n{\n\tint i, table[10], len, num;\n\tint target = 1, ans = 0, arr[10] = {0}, max = -1;\n\n\tscanf(\"%d%d\", &len, &num);\n\t\n\tfor(i = 0; i < len; ++i)\n\t{\n\t\tarr[num%10]++;\n\t\tnum /= 10;\n\t}\n\t\n\twhile(arr[9]--)\n\t{\n\t\tarr[6] += 2;\n\t\tarr[2]++;\n\t\tarr[7]++;\n\t}\n\t\n\twhile(arr[8]--)\n\t{\n\t\tarr[2] += 3;\n\t\tarr[7]++;\n\t}\n\t\n\twhile(arr[6]--)\n\t{\n\t\tarr[3]++;\n\t\tarr[5]++;\n\t}\n\t\n\twhile(arr[4]--)\n\t{\n\t\tarr[3]++;\n\t\tarr[2] += 2;\n\t}\n\t\n\tfor(i = 9; i >= 2; --i)\n\t\twhile(arr[i]--)\n\t\t\tans = ans*10+i;\n\t\n\tprintf(\"%d\\n\", ans);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "c34cc6ecef4fe96dea277c1f7e9252fc", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "43123de76fc84f38680e73fcfee62795", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9879969992498124, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\nvoid merge(char [],int ,int ,int );\nvoid part(char [],int ,int );\nvoid part(char arr[],int min,int max)\n{\n int mid;\n if(min=arr[m])\n {\n tmp[i]=arr[j];\n j++;\n }\n else\n {\n tmp[i]=arr[m];\n m++;\n }\n }\n if(j>mid)\n {\n for(k=m; k<=max; k++)\n {\n tmp[i]=arr[k];\n i++;\n }\n }\n else\n {\n for(k=j; k<=mid; k++)\n {\n tmp[i]=arr[k];\n i++;\n }\n }\n for(k=min; k<=max; k++)\n arr[k]=tmp[k];\n}\nmain()\n{\n\tint n,i=0,j=0;\n\tchar s[20],t[80];\n\tscanf(\"%d\",&n);\n\tscanf(\"%s\",s);\n\twhile(s[i]!='\\0')\n\t{\n\t\tif(s[i]=='4')\n\t\t{\n\t\t\tt[j++]='3';\n\t\t\tt[j++]='2';\n\t\t\tt[j++]='2';\n\t\t}\n\t\telse if(s[i]=='1' || s[i]=='0')\n\t\t{\n\t\n\t\t}\n\t\telse if(s[i]=='6')\n\t\t{\n\t\t\tt[j++]='5';\n\t\t\tt[j++]='3';\n\t\t}\n\t\telse if(s[i]=='8')\n\t\t{\n\t\t\tt[j++]='7';\n\t\t\tt[j++]='2';\n\t\t\tt[j++]='2';\n\t\t\tt[j++]='2';\n\t\t}\n\t\telse if(s[i]=='9')\n\t\t{\n\t\t\tt[j++]='7'\n\t\t\tt[j++]='5'\n\t\t\tt[j++]='5'\n\t\t\tt[j++]='3'\n\t\t\tt[j++]='3'\n\t\t\tt[j++]='2'\n\t\t}\n\t\telse\n\t\t{\n\t\t\tt[j++]=s[i];\n\t\t}\n\t\ti++;\n\t}\n\tt[j]='\\0';\n\tpart(t,0,j-1);\n\tprintf(\"%s\",t);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "828070c2f53e3673b752c31091bf46bb", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "f111e78659edd85d653d69b52019858f", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9513422818791947, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "#include \nint main() {\n int n;\n scanf(\"%d\", &n);\n char input[20];\n scanf(\"%s\", input);\n int digitCount[8]{0};\n for (int i=0; i='2') {\n switch(input[i]) {\n case '9':\n digitCount[7]++;\n digitCount[3]+=2;\n digitCount[2]++;\n break;\n case '8':\n digitCount[7]++;\n digitCount[2]+=3;\n break;\n case '6':\n digitCount[5]++;\n digitCount[3]++;\n break;\n case '4':\n digitCount[3]++;\n digitCount[2]+=2;\n break;\n default: // 2,3,5,7\n int digit = input[i]-'0';\n digitCount[digit]++;\n }\n }\n }\n char number[100];\n char *numberP = number;\n for (int digit=7; digit>1; digit--) {\n char digitC = '0' + digit;\n for (int i=0; i=1)\n {\n a*=A;\n A--;\n }\n while(B>=1)\n {\n b*=B;\n B--;\n }\n c=(a\nint main()\n{\n long long int A,B,i,fact=1,fact1=1;\n int min;\n scanf(\"%lld %lld\",&A,&B);\n\n if(A<=12){\n for(i=2;i<=A;i++)\n {\n fact=fact*i;}\n }\n if(B<=12){\n for(i=2;i<=B;i++)\n {\n fact1=fact1*i;}\n }\n if(A<=12 && B<=12){\n for(i=1;i<=fact && i<=fact1;i++)\n {\n if(fact%i==0 && fact1%i==0)\n min=i;}\n }\n if(A>12)\n {\n for(i=1;i<=fact1;i++)\n if(fact1%i==0)\n min=i;\n }\n if(B>12)\n {\n for(i=1;i<=fact;i++)\n if(fact%i==0)\n min=i;\n }\n printf(\"%d\",min);\n}\n", "lang": "GNU C", "bug_code_uid": "3877d3c19e7b4603cdf80d3fd775b003", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "d3b842c51569eb64697db81863705ea7", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6799276672694394, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\nlong long fac(int n)\n{\n\tlong long sum=1;\n\tint i;\n\tfor (i = 1; i <= n; i++)\n\t\tsum *= i;\n\treturn sum;\n}\n\nint main()\n{\n\tint a, b;\n\tlong long A, B;\n\tscanf(\"%d %d\", &a, &b);\n\tA= fac(a); \n\tB = fac(b);\n\twhile (A!=B)\n\t{\n\t\tif (A > B)\n\t\t\tA -= B;\n\t\telse\n\t\t\tB -= A;\n\t}\n\tprintf(\"%I64d\", A);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "cae74cd3e70452e0b8a2cc83768d05d7", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "fc2d79886ca5a7a2d2fb09913acfd53d", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3557692307692308, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include\nint factorial(int a)\n{\n int i,j=1,k;\n for(i=1;i<=a;i++)\n {\n j=j*i;\n }\n return j;\n\n}\nint gcd(int p,int q)\n{\n int x;\n if(p\n int main()\n {\n int i,num,j,g=1,num1;\n\n scanf(\"%d %d\",&num,&num1);\n\n int f=1;\n\n for(i=1; i<=num;i++)\n f=f*i;\n for(j=1; j<=num1;j++)\n g=g*j;\n\n if(f\nint main()\n{\n int a,b,f1=1,f2=1,i;\n scanf(\"%d %d\",&a,&b);\n for(i=a,j=b;i>0,j>0;i--,j--)\n {\n f1=f1*i;\n f2=f2*i;\n }\n if(f1\nint main()\n{\n int a,b,f1=1,f2=1,i,j;\n scanf(\"%d %d\",&a,&b);\n for(i=a;i>0;i--)\n {\n f1=f1*i;\n }\n for(j=b;j>0;j--)\n {\n f2=f2*j;\n }\n if(f1\nint main()\n{\n int x,y,sum1=1,sum2=1,r=0;\n scanf(\"%d%d\",&x,&y);\n for(int i=1;i<=x;i++)\n sum1=sum1*i;\n for(int i=1;i<=y;i++)\n sum2=sum2*i;\n r=sum1%sum2;\n while(r!=0)\n {\n \tsum1=sum2;\n \tsum2=r;\n \tr=sum1%sum2;\n }\n printf(\"%d\",sum2);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b95fd1ada58ea1c04b89e80f2fe75d64", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "453e197c9998f5ab25dd56c19393448a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6354319180087847, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#include \n\n\n\n\n\nint pgcd(int a, int b)\n{\nif (b ==0)\n{\n\treturn a;\n}\nelse\n{\n\treturn pgcd(b,a % b);\n}\n}\n\nint fact(int n)\n{\n\tif(n==0)\n\t\treturn 1;\n\treturn n*fact(n-1);\n}\n\nint main()\n{\n\tint a,b;\n\tscanf(\"%d\",&a);\n\tscanf(\"%d\",&b);\n\tprintf(\"%d\",pgcd(fact(a),fact(b)));\n \n\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fbbfdf77b086469f1280e24bae9dd180", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6a246a6109286b9be34f5d413c196dd8", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.549618320610687, "equal_cnt": 13, "replace_cnt": 2, "delete_cnt": 10, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int a,b,x,y,i,remainder;\n long long int mult1=1,mult2=1;\n scanf(\"%d %d\",&a,&b);\n x=(ab)?a:b;\n for(i=1;i<=y;i++)\n {\n mult1=mult1*i;\n if(i<=x)\n mult2=mult2*i;\n }\n for(;;)\n {\n remainder=mult1%mult2;\n if(remainder==0)\n {\n printf(\"%lld\\n\",mult2);\n break;\n }\n mult1=mult2;\n mult2=remainder;\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3030723b8cb000849cb8551257546e8b", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "37674cae559c3249fd9e0583c0f4fd15", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9934272300469483, "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 char *s;\n int k;\n scanf(\"%s %d\", s, &k);\n int n = strlen(s);\n for (int i = 0; i < n; i++) {\n int mi = i;\n char mx = s[i];\n int l = i + k + 1 < n ? i + k + 1 : n;\n for (int j = i + 1; j < l; j++) {\n if(s[j] > mx) {\n mx = s[j];\n mi = j;\n }\n }\n if (i == mi) { continue; }\n char t = s[mi];\n for (int j = mi; j > i; j--) {\n s[j] = s[j - 1];\n }\n s[i] = t;\n k -= (mi - i);\n }\nend:\n printf(\"%s\\n\", s);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d8cd599dc04dd3233fcd43232ab3148c", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "e0980ecc6224367042862e17de2a327c", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9923430321592649, "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 a, b, c;\n scanf(\"%d %d %d\", &a, &b, &c);\n while (true){\n int tmp = a;\n tmp *= 2;\n if (tmp <= b){\n tmp *= 2;\n if (tmp <= c) break;\n else a--;\n }else a--;\n }\n printf(\"%d\\n\", a * 7);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "d5618b3f85320230f2858f39031a9dd0", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "b0870dbeb0c343b87ceaab772cc22e92", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9529983792544571, "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 n,min=1000000,mina,minb,b;\n scanf(\"%d\",&n);\n for(int a=1;a<=n/2;a++)\n {\n if(n%a==0)\n {\n b=n/a;\n if(a>b)\n break;\n if(b-a\n#include\nint main()\n{\n char s[200];\n scanf(\"%s\",s);\n \n int i,n,p,q,r,t,u;\n n=strlen(s);\n for(i=0;i\n#include \n\nint main()\n{\n\tchar words[100],asol[100];\n\tint i,j=0,b,flag=0;\n\tscanf(\"%s\",words);\n\tfor(i=0;i\n#include \n\nint main(){\n\t\t\t\tint n;\n\t\t\t\tscanf(\"%d\",&n);\n\t\t\t\tchar s[1010];\n\t\t\t\tscanf(\"%s\",s);\n\t\t\t\tint ans = 0;\n\t\t\t\tfor(int j=0; j\n#include \n\nvoid copy(char a[], int i, int j, char b[]){\n\tint k;\n\tfor (k=i; k<=j; k++)\n\t\tb[k-i]=a[k];\n\tb[k]='\\0';\n}\n\nint ok (char a[]){\n\tint i=0, x=0, y=0;\n\twhile (a[i]!='\\0'){\n\t\tif (a[i]=='U') y++;\n\t\telse if (a[i]=='D') y--;\n\t\telse if (a[i]=='R') x++;\n\t\telse if (a[i]=='L') x--;\n\t\ti++;\n\t}\n\treturn (x==0 && y==0)?1:0;\n}\n\nint main(void) {\n\t\n\tint n, i, j, count=0;\n\tchar a[200], b[200];\n\t\n\tscanf(\"%d\\n\", &n);\n\tscanf(\"%s\", a);\n\t\n\tfor (i=0; i\nint main()\n{\n\tchar c,dp[101],pd[101];\n\tint n,x=0,y=0,i,cnt=0,j,ans=0;\n\tscanf(\"%d\\n\",&n);\n\tfor(i=0;i<101;i++)pd[i]=1;\n\tfor(i=0;i\n\nint main(){\n\tint k, result, x, y, i, j;\n\tchar str[255];\n\t\n\tx = 0; y = 0; result = 0;\n\tscanf(\"%d\", &k);\n\tscanf(\"%s\", &str);\n\tfor (i = 0; i < k; i++){\n\t\tfor (j = i; j < k; j++){\n\t\t\tif (str[j] == 'U')\n\t\t\t\ty++;\n\t\t\tif (str[j] == 'D')\n\t\t\t\ty--;\n\t\t\tif (str[j] == 'R')\n\t\t\t\tx++;\n\t\t\tif (str[j] == 'L')\n\t\t\t\tx--; \n\t\t\t}\n\t\t\tif (x == 0 && y == 0) \n\t\t\t\tresult++;\n\t\t}\n\t\tx = 0; y = 0;\n\t} \n\tprintf(\"%d\", result); \n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "41fc6a972ddda589ed2065929f94ad19", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "71dfe7c2fe59e077214c91a91ef087e4", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9913419913419913, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \"stdio.h\"\n#include \"string.h\"\n\nint n, cnt;\nchar s[207];\n\nint main(){\n\twhile(scanf(\"%d\", &n)){\n\t\tscanf(\"%s\", s + 1);\n\t\tcnt = 0;\n\t\tint i, j, k;\n\t\tfor(i = 1; i <= n; i++){\n\t\t\tfor(j = i + 1; j <= n; j++){\n\t\t\t\tint x = 0, y = 0;\n\t\t\t\tfor(k = i; k <= j; k++){\n\t\t\t\t\tif( s[k] == 'L' ) --x;\n\t\t\t\t\telse if( s[k] == 'R' ) ++x;\n\t\t\t\t\telse if( s[k] == 'D' ) ++y;\n\t\t\t\t\telse --y;\n\t\t\t\t}\n\t\t\t\tif( x == 0 && y == 0 ) ++cnt;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\", cnt);\n\t}\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "333404dbdc16e12d83622c429d2ffc1f", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "117f522e896cbb9d5bda99ae07c5f427", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.2849352419904567, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#include \n#include \n#include \n#include \n\nusing namespace std;\n\n/*\nint main() {\n \n long n , i , j , t = 0 , a[100][100]; \n scanf(\"%ld\", &n);\n \n for(i = 0; i < n; i++)\n for(j = 0; j < n; j++)\n a[i][j] = 0;\n\n \n for(i = 0; i < n; i++) {\n t++;\n for(j = 0; j < t; j++)\n scanf(\"%ld\", &a[i - j][j]);\n }\n \n for(i = 1; i < n; ++i) {\n a[i][0] += a[i - 1][0];\n a[0][i] += a[0][i - 1]; \n }\n \n \n \n for(i = 1; i < n; i++)\n for(j = 1; j < n; j++)\n if(a[i - 1][j] >= a[i][j - 1])\n a[i][j] += a[i - 1][j];\n else\n a[i][j] += a[i][j - 1]; \n \n printf(\"%ld\", a[n - 1][n - 1]);\n return 0;\n \n \n \n \n} \n\n*/\n\n/*\n4\n3\n7 4\n2 4 6\n8 5 9 3\n */\n\n\n/*\n#include \n#include \n*/\n\n\nint main() { \n int a , b = 0 , t;\n scanf(\"%d\", &a);\n t = a;\n while(a > 0) {\n b = b * 10 + a % 10;\n a /= 10;\n }\n if(t == b)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0; \n}", "lang": "GNU C", "bug_code_uid": "aaf40501c3f62b365ac2d0d810d10bdb", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "6fe8ab15b511bcc0442fa3fbac8c659d", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9166666666666666, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main()\n{\n\tint i, r, sum = 0, temp;\n\tlong int n;\n\tbool check = false;\n\tscanf(\"%ld\", &n);\n\ttemp = n;\n\tfor (i = 1; n>0; i++)\n\t{\n\t\tr = n % 10;\n\t\tif (r == 0 && check == false)\n\t\t{\n\t\t\tn = n / 10;\n\t\t\ttemp = temp / 10;\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\tsum = (sum * 10) + r;\n\t\t\tn = n / 10;\n\t\t\tcheck = true;\n\t\t}\n\t}\n\tif (sum == temp)\n\t\tprintf(\"YES\");\n\telse printf(\"NO\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "71afaf5f6e4e228a7c4c4eb0c7371c6e", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "17510a8c6e818389d91b64b4048c44b1", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6446700507614214, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \nint zero(int n){\n int tab[5]={0,1,2,2,1,0};\n return tab[tab%6];\n}\nint one(int n){\n int tab[5]={1,0,0,1,2,2};\n return tab[tab%6];\n}\nint two(int n){\n int tab[5]={2,2,1,0,0,1};\n return tab[tab%6];\n}\n\nint main()\n{\n\tint n,x;\n\tscanf(\"%d %d\",&n,&x);\n if(zero(n)==x) printf(\"0\");\n if(one(n)==x) printf(\"1\");\n if(two(n)==x) printf(\"2\");\n\n}\n", "lang": "GNU C", "bug_code_uid": "9a46ea5a4f93d4b7812dd485497219ed", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "d53d384c9013701a00afaae5b26f9663", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9434343434343434, "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(void)\n{\n\tint n;\n\tint x;\n\tint sh[3];\n\tint i;\n\tint temp;\n\n\tscanf(\"%d\", &n);\n\tscanf(\"%d\", &x);\n\ti = -1;\n\twhile (++i < 3)\n\t\tsh[i] = 0;\n\tsh[x] = 1;\n\ti = 0;\n\twhile (n > 0)\n\t{\n\t\tif (n % 2 == 1)\n\t\t{\n\t\t\ttemp = sh[0];\n\t\t\tsh[0] = sh[1];\n\t\t\tsh[1] = temp;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttemp = sh[2];\n\t\t\tsh[2] = sh[1];\n\t\t\tsh[1] = temp;\n\t\t}\n\t\tn--;\n\t}\n\ti = -1;\n\twhile (++i < 3)\n\t\tif (sh[i])\n\t\t\tprintf(\"%d\", i);\n\treturn (0);\n}\n", "lang": "GNU C", "bug_code_uid": "762964706da65366108cd4490f91cc71", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "f3183bf7de07cc7d896d2db0c7679f33", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9862700228832952, "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\nint main(){\n\tint m,p;\n\tscanf(\"%d\",&m);\n\tscanf(\"%d\",&p);\t\n\tint arr[3];\n\tfor(int i=0;i<3;i++)\n\t\tarr[i] = 0;\n\tarr[p] = 1;\n\tfor(int i=m;i>0;i--){\n\t\tif(i%2==0){\n\t\t\tint t = arr[1];\n\t\t\tarr[1] = arr[2];\n\t\t\tarr[2] = t;\n\t\t}\n\t\telse{\n\t\t\tint t = arr[0];\n\t\t\tarr[0] = arr[1];\n\t\t\tarr[1] = t;\n\t\t}\n\t}\n\tfor(int i=0;i<3;i++){\n\t\tif(arr[i]==1)\n\t\t\tprintf(\"%d\",i);\n\t}\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "37eecfe590f5d9de21ed59415fa7bef6", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "d6404ab86466ae2c52446bc4c13067e1", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9710144927536232, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\n\tint a[3] ={0, 1, 2};\n\tint n,p,sw,i;;\n\tscanf(\"%d%d\", &n, &p);\n\tfor(i= 1; i<= n; i++)\n\t{\n\t\tif(i%2 == 1){\n\t\tsw = a[0];\n\t\ta[0] = a[1];\n\t\ta[1] = sw;}\n\t\t else {\n\t\t \tsw = a[1];\n\t\ta[1] = a[2];\n\t\ta[2] = sw;}\n\t\t }\n\t\tif(a[p] == 0)\n\t\tprintf(\"0\\n\");\n\t\telse if(a[p] == 1)\n\t\tprintf(\"1\\n\");\n\t\telse\n\t\tprintf(\"2\\n\");\n\t}\n\t\n", "lang": "GNU C", "bug_code_uid": "0037a0e9bfef7cf875b893419ec1838e", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "47e1f5554d220325d1f411ff46b8f558", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9889807162534435, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nvoid swap(int *x,int *y)\n{\n\tint t;\n\tt=*x;\n\t*x=*y;\n\t*y=t;\n}\nint main()\n{\n\tint b[3]={0,0,0};\n\tint n,x,i,t;\n\tscanf(\"%d\",&n); //�ƶ�����\n\tscanf(\"%d\",&x);\t//ĩλ��\n\tb[x]=1; //���λ����1\n\tfor(i=n;i>=1;i--)\n\t{\n\t\tif(i%2==0)\n\t\t\tswap(&b[1],&b[2]);\n\t\telse\n\t\t\tswap(&b[0],&b[1]);\n\t}\n\tfor(i=0; i<3; i++)\n\t{\n\t\tif(b[i]==1)\n\t\tprintf(\"%d\",i);\n\t}\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c68f9ba79c25820f83de468de9bf3f9d", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "252e0d758de3b06165a0d94614bad5c2", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9997855708688278, "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////////////////////////////////////using namespace std;\n////////////////////////////////////#define inf 0x3f3f3f\n////////////////////////////////////int map[1010][1010];\n////////////////////////////////////int vis[1010];\n////////////////////////////////////int dis[1010];\n////////////////////////////////////void setmap(int m)\n////////////////////////////////////{\n//////////////////////////////////// memset(map,inf,sizeof(map));\n//////////////////////////////////// int a,b,c;\n//////////////////////////////////// for(int i=0;ic)\n//////////////////////////////////// map[a][b]=map[b][a]=c;\n//////////////////////////////////// }\n////////////////////////////////////}\n////////////////////////////////////void dij(int n,int s)\n////////////////////////////////////{\n//////////////////////////////////// memset(dis,inf,sizeof(dis));\n//////////////////////////////////// memset(vis,0,sizeof(vis));\n//////////////////////////////////// //vis[1]=1;\n//////////////////////////////////// for(int i=1;i<=n;i++)\n//////////////////////////////////// {\n//////////////////////////////////// dis[i]=map[s][i];\n//////////////////////////////////// }\n//////////////////////////////////// for(int i=1;i<=n;i++)\n//////////////////////////////////// {\n//////////////////////////////////// int g;\n//////////////////////////////////// int minn=inf;\n//////////////////////////////////// for(int j=1;j<=n;j++)\n//////////////////////////////////// {\n//////////////////////////////////// if(vis[j]==0&&dis[j]dis[g]+map[g][j])\n//////////////////////////////////// {\n//////////////////////////////////// dis[j]=dis[g]+map[g][j];\n//////////////////////////////////// }\n//////////////////////////////////// }\n//////////////////////////////////// }\n////////////////////////////////////}\n////////////////////////////////////int main()\n////////////////////////////////////{\n//////////////////////////////////// int n,m;\n//////////////////////////////////// while(scanf(\"%d%d\",&m,&n)!=EOF)\n//////////////////////////////////// {\n//////////////////////////////////// setmap(m);\n//////////////////////////////////// dij(n,1);\n//////////////////////////////////// printf(\"%d\\n\",dis[n]);\n//////////////////////////////////// }\n//////////////////////////////////// return 0;\n////////////////////////////////////}\n////////////////////////////////#include\n////////////////////////////////int main()\n////////////////////////////////{\n//////////////////////////////// for(int i=1;i<4;i++)\n//////////////////////////////// {\n//////////////////////////////// printf(\"***\\n\");\n//////////////////////////////// }\n////////////////////////////////}\n////////////////////////////#include\n////////////////////////////int main()\n////////////////////////////{\n//////////////////////////// int a,b;\n//////////////////////////// while(scanf(\"%d%d\",&a,&b))\n//////////////////////////// {\n//////////////////////////// int c;\n//////////////////////////// c=a+b;\n//////////////////////////// printf(\"%d\\n\",c);\n//////////////////////////// }\n//////////////////////////// return 0;\n////////////////////////////}\n//////////////////////////#include\n//////////////////////////#include\n//////////////////////////#include\n//////////////////////////using namespace std;\n//////////////////////////#define inf 0x3f3f3f\n//////////////////////////int map[1010][1010];\n//////////////////////////int vis[1010];\n//////////////////////////int dis[1010];\n//////////////////////////void setmap(int m)\n//////////////////////////{\n////////////////////////// memset(map,inf,sizeof(map));\n////////////////////////// int a,b,c;\n////////////////////////// for(int i=0; ic)\n////////////////////////// map[a][b]=map[b][a]=c;\n////////////////////////// }\n//////////////////////////}\n//////////////////////////void dij(int n,int s)\n//////////////////////////{\n////////////////////////// memset(dis,inf,sizeof(dis));\n////////////////////////// memset(vis,0,sizeof(vis));\n////////////////////////// //vis[1]=1;\n////////////////////////// for(int i=1; i<=n; i++)\n////////////////////////// {\n////////////////////////// dis[i]=map[s][i];\n////////////////////////// }\n////////////////////////// for(int i=1; i<=n; i++)\n////////////////////////// {\n////////////////////////// int g;\n////////////////////////// int minn=inf;\n////////////////////////// for(int j=1; j<=n; j++)\n////////////////////////// {\n////////////////////////// if(vis[j]==0&&dis[j]dis[g]+map[g][j])\n////////////////////////// {\n////////////////////////// dis[j]=dis[g]+map[g][j];\n////////////////////////// }\n////////////////////////// }\n////////////////////////// }\n//////////////////////////}\n//////////////////////////int main()\n//////////////////////////{\n////////////////////////// int n,m;\n////////////////////////// while(scanf(\"%d%d\",&m,&n)!=EOF)\n////////////////////////// {\n////////////////////////// setmap(m);\n////////////////////////// dij(n,1);\n////////////////////////// printf(\"%d\\n\",dis[n]);\n////////////////////////// }\n////////////////////////// return 0;\n//////////////////////////}\n//////////////////////////#include\n//////////////////////////#include\n//////////////////////////#include\n//////////////////////////using namespace std;\n//////////////////////////int map[2010][2010];\n//////////////////////////int dis[1010];\n//////////////////////////int vis[1010];\n//////////////////////////int n,m;\n//////////////////////////const int inf=0x3f3f3f;\n//////////////////////////void setmap(int a,int b,int c)\n//////////////////////////{\n////////////////////////// if(cdis[g]+map[g][j])\n////////////////////////// {\n////////////////////////// dis[j]=dis[g]+map[g][j];\n////////////////////////// }\n////////////////////////// }\n////////////////////////// }\n//////////////////////////}\n//////////////////////////int main()\n//////////////////////////{\n////////////////////////// while(scanf(\"%d%d\",&n,&m)!=EOF)\n////////////////////////// {\n////////////////////////// int a,b,c;\n////////////////////////// memset(map,inf,sizeof(map));\n////////////////////////// for(int i=0;i\n////////////////////////#include\n////////////////////////#include\n////////////////////////#include\n////////////////////////using namespace std;\n////////////////////////#define inf 0x3f3f3f\n////////////////////////int n,m;\n////////////////////////int map[2005][2005];\n////////////////////////int vis[2005];\n////////////////////////int dis[2005];\n////////////////////////void setmap(int a,int b,int c)\n////////////////////////{\n//////////////////////// if(cdis[g]+map[g][j])\n//////////////////////// {\n//////////////////////// dis[j]=dis[g]+map[g][j];\n//////////////////////// }\n//////////////////////// }\n//////////////////////// }\n////////////////////////}\n////////////////////////int main()\n////////////////////////{\n//////////////////////// while(scanf(\"%d%d\",&n,&m)!=EOF)\n//////////////////////// {\n//////////////////////// if(n==0&&m==0)\n//////////////////////// break;\n//////////////////////// memset(dis,inf,sizeof(dis));\n//////////////////////// memset(vis,0,sizeof(vis));\n////////////////////////// vis[m]=1;\n//////////////////////// memset(map,inf,sizeof(map));\n//////////////////////// int a,b,c;\n//////////////////////// for(int i=0;i\n////////////////int main()\n////////////////{\n//////////////// int n,m;//n为点的个数,m为边的个数\n//////////////// int u[6],v[6],w[6];\n//////////////// int first[5],next[5];\n//////////////// scanf(\"%d%d\",&n,&m);\n//////////////// for(int i=1;i<=n;i++)\n//////////////// first[i]=-1;\n//////////////// for(int i=1;i<=m;i++)\n//////////////// {\n//////////////// scanf(\"%d%d%d\",&u[i],&v[i],&w[i]);\n//////////////// next[i]=first[u[i]];\n//////////////// first[u[i]]=i;\n//////////////// }\n//////////////// //建立邻接表\n//////////////// int k;\n//////////////// k=first[1];\n//////////////// while(k!=-1)\n//////////////// {\n//////////////// printf(\"%d %d %d\\n\",u[k],v[k],w[k]);\n//////////////// k=next[k];\n//////////////// }\n//////////////// //遍历1号点所有边的代码;\n//////////////// for(int i=1;i<=n;i++)\n//////////////// {\n//////////////// k=first[i];\n//////////////// while(k!=-1)\n//////////////// {\n//////////////// printf(\"%d %d %d\\n\",u[k],v[k],w[k]);\n//////////////// k=next[k];\n//////////////// }\n//////////////// }\n//////////////// //遍历所有边\n////////////////}\n//////////////#include\n//////////////#include\n//////////////#include\n//////////////#include\n//////////////using namespace std;\n//////////////#define MAX 5000\n//////////////#define inf 0x3f3f3f3f\n//////////////int dis[MAX],u[MAX],v[MAX],w[MAX],first[MAX],next[MAX];\n//////////////bool vis[MAX];\n//////////////int main()\n//////////////{\n////////////// int t,n;\n////////////// while(scanf(\"%d%d\",&t,&n)!=EOF)\n////////////// {\n////////////// memset(first,-1,sizeof(first));\n////////////// memset(next,-1,sizeof(next));\n////////////// memset(dis,inf,sizeof(dis));\n////////////// dis[1]=0;\n////////////// for(int i=1;i<=2*t;i+=2)\n////////////// {\n////////////// int a,b,c;\n////////////// scanf(\"%d%d%d\",&a,&b,&c);\n////////////// //\n////////////// u[i]=v[i+1]=a;\n////////////// v[i]=u[i+1]=b;\n////////////// w[i]=w[i+1]=c;\n////////////// next[i]=first[u[i]];\n////////////// next[i+1]=first[u[i+1]];\n////////////// first[u[i]]=i;\n////////////// first[u[i+1]]=i+1;\n////////////// }\n////////////// int f=1;\n////////////// int minn;\n////////////// for(int i=2;i<=n;i++)\n////////////// {\n////////////// for(int j=first[f];j!=-1;j=next[j])\n////////////// {\n////////////// if(vis[v[j]]==false)\n////////////// dis[v[j]]=min(dis[v[j]],dis[f]+w[j]);\n////////////// }\n////////////// minn=inf;\n////////////// for(int j=1;j<=n;j++)\n////////////// {\n////////////// if(vis[j]==false&&minn>dis[j])\n////////////// {\n////////////// minn=dis[f];\n////////////// f=j;\n////////////// }\n////////////// vis[f]=true;\n////////////// }\n////////////// printf(\"%d\\n\",vis[1]);\n////////////// }\n////////////// return 0;\n////////////// }\n//////////////}\n////////////#include\n////////////#include\n////////////#include\n////////////#include\n////////////using namespace std;\n////////////const int ma=100005;\n////////////vectorchen;\n////////////int f;\n////////////void dfs(int m)\n////////////{\n//////////// for(int i=0; i\n////////#include\n////////int map[35][35];\n////////int vis[35];\n////////int t;\n////////int y;\n////////int k;\n////////int sum;\n////////void dfs(int cur,int p,int s)\n////////{\n//////// if(p==k)\n//////// {\n//////// if(sum>s)\n//////// sum=s;\n//////// printf(\"%d\\n\",sum);\n//////// }\n//////// for(int i=1;i\n////////#include\n////////using namespace std;\n////////int map[55][55][55];\n////////int dir[6][3]= {{1,0,0},{-1,0,0},{0,1,0},{0,-1,0},{0,0,1},{0,0,-1}};\n////////int a,b,c,d;\n////////struct chen\n////////{\n//////// int x,y,z,s;\n////////};\n////////int bfs(chen start)\n////////{\n//////// queueq;\n//////// struct chen cur,next;\n//////// if(start.x==a-1&&start.y==b-1&&start.z==c-1)\n//////// {\n//////// return 0;\n//////// }\n//////// map[start.x][start.y][start.z]=1;\n//////// start.s=0;\n//////// q.push(start);\n//////// while(!q.empty())\n//////// {\n//////// cur=q.front();\n//////// q.pop();\n//////// for(int i=0; i<6; i++)\n//////// {\n//////// next.x=cur.x+dir[i][0];\n//////// next.y=cur.y+dir[i][1];\n//////// next.z=cur.z+dir[i][2];\n//////// if(next.x==a-1&&next.y==b-1&&next.z==c-1)\n//////// {\n//////// return cur.s+1;\n//////// }\n//////// if(next.x>=0&&next.x=0&&next.y=0&&next.z=0&&sum<=d)\n//////// {\n//////// printf(\"%d\\n\",sum);\n//////// }\n//////// else\n//////// printf(\"-1\\n\");\n//////// }\n//////// return 0;\n////////}\n//////#include\n//////#include\n//////#include\n//////using namespace std;\n//////int map[60][60][60];\n//////int dir[6][3]= {{1,0,0},{-1,0,0},{0,1,0},{0,-1,0},{0,0,1},{0,0,-1}};\n//////int a,b,c,d;\n//////struct chen\n//////{\n////// int x,y,z,s;\n//////};\n//////int bfs(chen start)\n//////{\n////// if(start.x==a-1&&start.y==b-1&&start.z==c-1)\n////// {\n////// return 0;\n////// }\n////// queueq;\n////// struct chen cur,next;\n////// map[start.x][start.y][start.z]=1;\n////// start.s=0;\n////// q.push(start);\n////// while(!q.empty())\n////// {\n////// cur=q.front();\n////// q.pop();\n////// for(int i=0;i<6;i++)\n////// {\n////// next.x=cur.x+dir[i][0];\n////// next.y=cur.y+dir[i][1];\n////// next.z=cur.z+dir[i][2];\n////// if(next.x==a-1&&next.y==b-1&&next.z==c-1)\n////// {\n////// return cur.s+1;\n////// }\n////// if(next.x>=0&&next.x=0&&next.y=0&&next.z=0&&sum<=d)\n////// {\n////// printf(\"%d\\n\",sum);\n////// }\n////// else\n////// printf(\"-1\\n\");\n////// }\n////// return 0;\n//////}\n////#include\n////#include\n////#include\n////#include\n////using namespace std;\n////const int maxn=4010;\n////const int inf=0x3f3f3f3f;\n////int n,m,len;\n////struct chen\n////{\n//// int u,v,w;\n////}g[maxn];\n////int first[maxn],next[maxn];\n////int vis[maxn],dis[maxn];\n////void add(int x,int y,int z)\n////{\n//// g[len].u=x;\n//// g[len].v=y;\n//// g[len].w=z;\n//// next[len]=first[x];\n//// first[x]=len++;\n////}\n////void spfa(int star)\n////{\n//// for(int i=1;i<=n;i++)\n//// {\n//// dis[i]=inf;\n//// vis[i]=0;\n//// }\n//// dis[star]=0;\n//// vis[star]=1;\n//// queueq;\n//// q.push(star);\n//// while(!q.empty())\n//// {\n//// star=q.front();\n//// q.pop();\n//// vis[star]=0;\n//// for(int i=first[star];i!=-1;i=next[i])\n//// {\n//// if(dis[g[i].v]>dis[star]+g[i].w)\n//// {\n//// dis[g[i].v]=dis[star]+g[i].w;\n//// if(vis[g[i].v]==0)\n//// {\n//// vis[g[i].v]=1;\n//// q.push(g[i].v);\n//// }\n//// }\n//// }\n//// }\n////}\n////int main()\n////{\n//// int x,y,z;\n//// while(scanf(\"%d%d\",&m,&n)!=EOF)\n//// {\n//// memset(first,-1,sizeof(first));\n//// len=1;\n//// for(int i=0;i\n#include\nint main()\n{\n int a,b;\n int c[4];\n memset(c,0,sizeof(c));\n scanf(\"%d%d\",&a,&b);\n c[b]=1;\n while(a)\n {\n if(a%2==0)\n {\n if(c[2]==1)\n {\n c[2]=0;\n c[1]=1;\n }\n else if(c[1]==1)\n {\n c[2]=1;\n c[1]=0;\n }\n }\n else\n {\n if(c[1]==1)\n {\n c[1]=0;\n c[0]=1;\n }\n else if(c[0]==1)\n {\n c[0]=0;\n c[1]=1;\n }\n }\n a--;\n }\n int g;\n for(int i=0;i<3;i++)\n {\n if(c[i]==1)\n g=i;\n }\n printf(\"%d\\n\",g);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "173d43dd157416432def153f76422894", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "4ce08c131afda691de81e6c7d42af35f", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.46024321796071094, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main()\n{\n long long int n,a,s[3],i,j,k;\n scanf(\"%lld%lld\",&n,&a);\n s[a]=1;\n for(i=2; i>=0; i--)\n {\n if(i==a)continue;\n s[i]=0;\n\n }\n for(i=n,j=a; i>0; i--)\n {\n if(i%2==0)\n {\n k=s[1];\n s[1]=s[2];\n s[2]=k;\n k=0;\n }\n else\n {\n k=s[1];\n s[1]=s[0];\n s[0]=k;\n k=0;\n }\n }\n for(j=2; j>=0; j--)\n {\n if(s[j]==1)break;\n }\n printf(\"%lld\",j);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c16d4dced9e3d453d42974b7d426fefa", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "5a649f997b7404a3fdc4476f114527f3", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8557588805166846, "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#include\nint main()\n{\n int n,x;\n while(~scanf(\"%d%d\",&n,&x))\n {\n if(n==1&&x==0)\n {\n printf(\"1\\n\");\n break;\n }\n if(n==1&&x==1)\n {\n printf(\"0\\n\");\n break;\n }\n if(n==1&&x==2)\n {\n printf(\"2\\n\");\n break;\n }\n int i;\n int left=0;\n int middle=1;\n int right=2;\n int t1,t2;\n for(i=1;i<=n;i++)\n {\n if(i%2!=0)\n {\n t1=middle;\n middle=left;\n left=t1;\n }\n else\n {\n t2=middle;\n middle=right;\n right=t2;\n }\n }\n if(x==2)\n {\n printf(\"%d\\n\",right);\n }\n if(x==1)\n {\n printf(\"%d\\n\",middle);\n }\n if(x==0)\n {\n printf(\"%d\\n\",left);\n }\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "582848c51bd1c7f1f84ec4d0ae0ab804", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "93db793f1d9689c26971a8bbc73aaa8b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9981785063752276, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\n\n\nint main()\n{\n long long int n;\n int x;\n scanf(\"%lld %d\",&n,&x);\n int A[3]={0,0,0};\n A[x]=1;\n int i;\n for(i=n;i>0;i--){\n\n if(i%2==0) {\n\n int a;\n a=A[1];\n A[1]=A[2];\n A[2]=a;\n\n }\n\n else if(i%2==1) {\n\n int a;\n a=A[0];\n A[0]=A[1];\n A[1]=a;\n }\n }\n\n\n\n if(A[0]==1)printf(\"%d\",0);\n else if(A[1]==1)printf(\"%d\",1);\n else if(A[2]==1)printf(\"%d\",2);\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f90c2c0e22eda58f1d4a136f83de8542", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "251c60975d49e3992512a00aad367bc3", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7793103448275862, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include //http://codeforces.com/problemset/problem/777/A\nint main()\n{\n\tint n,x;\n\tscanf(\"%d %d\",&n,&x);\n\n\twhile(n>0){\n\t\tif(n%2==0 && x!=0)\n\t\t\tx=3-x;\n\t\telse if(n%2!=0 && x!=2)\t\n\t\t\tx=1-x;\n\t\tn--;\n\t}\nprintf(\"%d\",x);\nreturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ed5c71ba31858e843c8acfd032f6080d", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "b0105de7b5d92ae42a1dbd35347a9182", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2563237774030354, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#include \nmain()\n{\nint n,x,i;\nscanf(\"%d %d\",&n,&x);\nfor(i=n;i>=1;i--)\n{\nif(i%2==0)\n{if(x==2)\nx=1;\nelse if(x==1)\nx=2;}\n\nelse if(i%2!=0)\n{if(x==1)\nx=0;\nelse if(x==0)\nx=1;}\n\n}\nprintf(\"%d\",x);\n\n\n}", "lang": "GNU C", "bug_code_uid": "a428ca48028225351fb6c992b19bb06d", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "072ab250e57473c684216041561a43d8", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2103825136612022, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "#include \nint main()\n{\n long n,i;\n int x,l,m,r;\n scanf(\"%ld\",&n);\n scanf(\"%d\",&x);\n l=0;m=0;r=0;\n if(x==0)\n l=1;\n if(x==1)\n m=1;\n if(x==2)\n r=1;\n for(i=n;i>0;i--)\n {\n if(i%2==0)\n {\n if(r==1)\n {\n r=0;\n m=1;\n }\n else if(m==1)\n {\n r=1;\n m=0;\n }\n }\n else\n {\n if(l==1)\n {\n l=0;\n m=1;\n }\n else if(m==1)\n {\n l=1;\n m=0;\n }\n }\n }\n if(l==1)\n printf(\"0\");\n if(m==1)\n printf(\"1\");\n if(r==1)\n printf(\"2\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "982d193e6b7b7fa43d2bef9a05eb0e9f", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "e4cf6c2458ba17b4ab12450ac3d2034a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9979152189020153, "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 int n,x,i,temp;\n scanf(\"%d\",&n);\n scanf(\"%d\",&x);\n int a[3];\n a[x]=1;\n\n while(n>0)\n {\n if(n%2==0)\n {\n if(a[2]==1)\n {\n a[2]=0;\n a[1]=1;\n }\n\n else if(a[1]==1)\n {\n\n a[2]=1;\n a[1]=0;\n\n\n }\n }\n else\n\n {\n\n if(a[0]==1)\n {\n\n\n a[0]=0;\n a[1]=1;\n\n\n }\n else if(a[1]==1)\n {\n\n\n a[0]=1;\n a[1]=0;\n\n\n }\n }\n\n\n n--;\n }\n\n if(a[0]==1)\n printf(\"0\");\n else if(a[1]==1)\n printf(\"1\");\n else if(a[2]==1)\n printf(\"2\");\n\n\n return 0;\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "d3d13c01ec89a76557fe29aed604907c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "8b7d71f04150af339b6b8a4b39260535", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.30656934306569344, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nvoid swap(long long *,long long *);\nvoid main()\n{\nlong long n,x,i;\nlong long a[3]={0,1,2};\nscanf(\"%lld %lld\",&n,&x);\n\n\nfor(i=1;i<=n;i++)\n{\nif(i%2!=0)\nswap(&a[0],&a[1]);\n\nif(i%2==0)\nswap(&a[1],&a[2]);\n\n}\n\nprintf(\"%lld\\n\",a[x]);\nexit(0);\n}\n\nvoid swap(long long *a,long long *b)\n{\nlong long temp=*a;\n*a=*b;\n*b=temp;\n}", "lang": "GNU C", "bug_code_uid": "82ea4d23dc9c22e2e3e8f20880f894c2", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "b884b349079f8e08144d2721449bcbf0", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998468606431853, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main() {\n\tint i, j, cnt;\n\tlong long a, b, c, d;\n\n\tscanf(\"%lld%lld\", &a, &b);\n\tcnt = 0;\n\tfor (i = 0; (long long) i < 60; i++) {\n\t\tc = ((long long) 1 << i) - 1;\n\t\tfor (j = 0; j < i - 1; j++) {\n\t\t\td = c - ((long long) 1 << j);\n\t\t\tif (d >= a && d <= b)\n\t\t\t\tcnt++;\n\t\t}\n\t}\n\tprintf(\"%d\\n\", cnt);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6a569fbda31fa1a7d595afa7417708aa", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "545cf70463e15ec24aaa69615c7745e8", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.964800923254472, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "//\n// main.c\n// flippingGame\n//\n// Created by Alexandru Bâgu on 11/20/13.\n// Copyright (c) 2013 Alexandru Bâgu. All rights reserved.\n//\n\n#include \n\nint main(int argc, const char * argv[])\n{\n int n, i;\n scanf(\"%d\", &n);\n int *A = (int*)malloc(n * sizeof(int));\n for(i = 0; i < n; i++)\n scanf(\"%d\", A + i);\n int s = 0, a = 0, b = 0, s1 = 0, a1, b1;\n for(i = 0; i < n; i++)\n {\n if(A[i] == 1) s += 1;\n else s -= 1;\n if(s >= 0)\n {\n a = i+1;\n b = a;\n s = 0;\n }\n else b++;\n if(s1 > s)\n {\n s1 = s;\n a1 = a;\n b1 = b;\n }\n }\n for(i = a1; i < b1; i++)\n A[i] = 1 - A[i];\n s = 0;\n for(i = 0; i < n; i++)\n s += A[i];\n printf(\"%d\", s);\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "cfd3798288d0fc3011ef1656a9ce3770", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "7c04179e57422f132391fdb76588c8e5", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9804941482444733, "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 x1,y1,x2,y2,x,y,a,b;\n scanf(\"%lld%lld%lld%lld\",&x1,&y1,&x2,&y2);\n scanf(\"%lld%lld\",&x,&y);\n if((x1-x2)%x==0 && (y1-y2)%y==0)\n {\n a=(x1-x2)/x;\n b=(y1-y2)/y;\n if(a%2==b%2)\n printf(\"YES\\n\");\n else\n printf(\"NO\\n\");\n }\n else\n printf(\"NO\\n\");\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "03596be8732f67aca893b3e9fe2c752c", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "795512f117f06ca80bc6f4ba719fa24e", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7932203389830509, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nvoid main()\n{\n int wt;\n if(wt%2==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "fd66bfb0e219513031b683d46844cfaa", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e5d86ba9e1a07d57b70dd3cf1ef0817a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.013986013986013986, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C", "bug_code_uid": "4d76ccfb07b060f0dc5b060a55788fbd", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "b2a01a1972f313be7aa1ca3515acedef", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9737470167064439, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint main()\n{\nint a,b,c;\nscanf(\"%d\",&a);\nwhile (a%10 < 1)\n{\n a=a/10;\n}\nb=a;\nwhile (a>0)\n{\n c=c*10+a%10;\n a=a/10;\n}\nif (c=b) printf(\"YES\");\n else printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e1e00e5d370f64ac532b97f68ccf2c90", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "b2a01a1972f313be7aa1ca3515acedef", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8156606851549756, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \nvoid main()\n{\n long a,c,rev=0;\n int d\n scanf(\"%ld\",&a);\n d=a%10;\n while(d==0)\n {\n a/=10;\n d=a%10;\n }\n c=a;\n while(c!=0)\n {\n d=c%10;\n rev=rev*10+d;\n }\n if(rev==a)\n printf(\"YES\");\n else\n printf(\"NO\");\n}", "lang": "GNU C", "bug_code_uid": "5f1172f7964520e76e817350c4f0a6c4", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "854d9c6b3a1403d06870aecc06d25e5c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9760765550239234, "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 a,c,rev=0;\n int d;\n scanf(\"%ld\",&a);\n d=a%10;\n while(d==0)\n {\n a/=10;\n d=a%10;\n }\n c=a;\n while(c!=0)\n {\n d=c%10;\n rev=rev*10+d;\n }\n if(rev==a)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "cb7bebc42a40678f698b2b9c44ea6954", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "854d9c6b3a1403d06870aecc06d25e5c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9256756756756757, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n#include \nint main()\n{\nchar input[1000000000];\nscanf(\"%s\",&input);\nint length=strlen(input),letter=length-1,numofzeroes=0,caseid;\n\nif((length+1)%2==0)\ncaseid=0;\nelse\ncaseid=1;\n\nwhile(input[letter]=='0'){\nletter--;\nnumofzeroes++;\n}\n\nint done=0,front=0,back=letter;\nwhile(done==0){\n\n//printf(\"%c %c\\n\",input[front],input[back]);\n\nif(input[front]!=input[back]){\ndone=1;\n}\nelse{\nif(front==(((length-numofzeroes-caseid)/2)-1)){\ndone=2;\n}\nfront++;\nback--;\n}\n}\n\nif(done==2)\nprintf(\"YES\");\nelse\nprintf(\"NO\");\n\n}\n", "lang": "GNU C", "bug_code_uid": "6ad893f83d65891e61c7b5dd55aec0ab", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "65b59b7c9ac462b0f2520389a4c3fffe", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9086378737541528, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n#include \nint main()\n{\nchar input[1000000];\nscanf(\"%s\",&input);\nint length=strlen(input),letter=length-1,numofzeroes=0,caseid;\n\nif((length+1)%2==0)\ncaseid=0;\nelse\ncaseid=1;\n\nwhile(input[letter]=='0'){\nletter--;\nnumofzeroes++;\n}\n\nint done=0,front=0,back=letter;\nwhile(done==0){\n\n//printf(\"%c %c\\n\",input[front],input[back]);\nif(len==1)\ndone=1;\nelse if(input[front]!=input[back]){\ndone=1;\n}\nelse{\nif(front==(((length-numofzeroes-caseid)/2)-1)){\ndone=2;\n}\nfront++;\nback--;\n}\n}\n\nif(done==2)\nprintf(\"YES\");\nelse\nprintf(\"NO\");\n\n}\n", "lang": "GNU C", "bug_code_uid": "88203469497d3f1cb03fee0f58fb7743", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "65b59b7c9ac462b0f2520389a4c3fffe", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9289099526066351, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\n#include\n\nint main()\n{\n\tint n, m, j, temp;\n\tscanf_s(\"%d\", &n);\n\tm = 0;\n\tj = 0;\n\twhile (n > 0)\n\t{\n\t\tif (n % 10 == 0)\n\t\t\tn = n / 10;\n\t\telse break;\n\t}\n\tm = n;\n\ttemp = m;\n\twhile (m > 0)\n\t{\n\t\tj = j * 10 + m % 10;\n\t\tm = m / 10;\n\t}\n\tif (j == temp)\n\t\tprintf(\"YES\");\n\telse printf(\"NO\");\n\tsystem(\"pause\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ec9e912ca5823c04059f77ca0b0e0a47", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "38dd06efb12746f50a17f5f5449eaa24", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9831697054698457, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n#include\nbool palindrome(char a[],int m)\n{\n int l,i,j,k;\n for(i=0,j=m;i<=m/2&&j>=m/2;i++,j--)\n {\n if(a[i]!=a[j])\n {\n return false;\n }\n }\n return true;\n}\nint count(char a[])\n{\n int l,i,c=0;\n l=strlen(a);\n for(i=l-1;i>=0;i--)\n {\n if(a[i]=='0')\n {\n c=c+1;\n }\n else\n {\n break;\n }\n }\n return c;\n\n}\nint main()\n{\n char a[20];\n int i,j,k,l,m,n;\n while(1)\n {\n\n scanf(\"%s\",&a);\n l=strlen(a);\n m=count(a);\n if(palindrome(a,l-m-1))\n {\n printf(\"YES\\n\");\n }\n else\n {\n printf(\"NO\\n\");\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1076f352f6ff2d3b7ce1447b76c56ff0", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "784bc39112e5921b2aad642dcb0d31ff", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.96, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \nint main()\n{\n\tint x, a, reverse = 0, b = 0;\n\tscanf(\"%d\", &x);\n\twhile (n)\n\t{\n\t\tif (x % 10 == 0)\n\t\t\tx = x / 10;\n\t\telse\n\t\t\tbreak;\n\t}\n\tx = b;\n\twhile (x)\n\t{\n\t\ta = x % 10;\n\t\treverse = reverse * 10 + a;\n\t\tx = x / 10;\n\t}\n\tif (reverse == b)\n\t{\n\t\tprintf(\"YES\");\n\t}\n\telse\n\t\tprintf(\"NO\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ad004a0e92c7a679a94f538d686f1702", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "d9182f586a3e6c4f6a151a8c22d63b77", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9373072970195272, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "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 */\n\nint main(int argc, char *argv[]) \n{\nchar a[30];\nint i;\nint j;\nint flag;\nchar curr;\nfor(i=0;i<30;i++)\n{\n\ta[i] = '0';\n}\nj=0;\nscanf(\"%c\",&curr);\nwhile(curr!='\\n')\n{\n\ta[j++] = curr;\n\tscanf(\"%c\",&curr);\n}\nj=29;\nwhile((a[j]==0)||(a[j]=='0'))\n\tj--;\nflag = 1;\nfor(i=0;i\nint main()\n{\n int n,m,r,i,j,less,max,buy,sell,t;\n scanf(\"%d%d%d\",&n,&m,&r);\n int s[n],x[m];\n for(i=0;imax)\n max=x[i];\n }\n buy=r/less;\n t=r%less;\n sell=max*buy+t;\n if(sell>r)\n printf(\"%d\",sell);\n else\n printf(\"%d\",r);\n \n},", "lang": "GNU C11", "bug_code_uid": "1682e2de818343f1a3d8310ba7e7bbf5", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "afae0493f91bceb2da595b00546fac85", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6969943135662063, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int n,m,r;\n scanf(\"%d %d %d\",&n,&m,&r);\n int s[n],b[m],min=s[0],max=0;\n for(int i=0; is[i])\n min=s[i];\n }\n for(int i=0; i\nint main()\n{int n,m,r,i,j,t,s,temp;\nint N[30], M[30];\nscanf(\"%d %d %d\",&n,&m,&r);\nfor(i=0;iN[j])\n { \n t=N[i];\n N[i]=N[j];\n N[j]=t;\n }\n }\n}\nfor(i=0;ir)\n{\n printf(\"%d\",&s);\n}\nelse\nprintf(\"%d\",&r);\nreturn 0;\n}\n}\n", "lang": "GNU C11", "bug_code_uid": "d1ec41fb71b78da23275966cbc8bcf87", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "c1d3bc1119ee4cf5ba52b52a13c40634", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9473684210526315, "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=0 ,i=0 ,p=0 ,x=0 ;\n char s[n];\n scanf(\"%d\" ,&n);\n scanf(\"%s\" ,s);\n for (i=0 ;i=1) x=p-1 ;\n //else x=0;\n printf(\"%d\" ,p);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "e43b4fff2f53d56b4ee5dca2435fec40", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "023134cd7b866ce7d224db215e3d3521", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8906009244992296, "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{\n char s[101];\n int b;\n\n scanf(\"%d\", b);\n scanf(\"%s\", s);\n int a = strlen(s);\n int i, count = 0;\n for(i = 0; i <= a-3; i++)\n {\n if(s[i] == 'x' && s[i+1] == 'x' && s[i+2] == 'x')\n {\n count++;\n }\n }\n printf(\"%d\", count);\n\n}\n", "lang": "GNU C11", "bug_code_uid": "71ec9529386aa0c452388b8be882a81b", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "5437a19b4f7044eced88ef5d24e05236", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9893992932862191, "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 l, i, k;\n scanf(\"%d\", &l);\n\n char s[50];\n scanf(\"%s\", s);\n\n\n k=0;\n for(i=0;i\nint a[3];\nvoid swap(int ,int);\nint main()\n{\n int i,x,n;\n scanf(\"%d%d\",&n,&x);\n for(i=0;i<3;i++)\n {\n if(i==x)\n a[i]=1;\n else\n a[i]=0;\n }\n for(i=n;i>=1;i--)\n {\n if(i%2==0)\n swap(1,2);\n else\n swap(0,1);\n }\n for(i=0;i<3;i++)\n if(a[i]==1)\n printf(\"%d\\n\",i);\n // scanf(\"%d%d\",&n,&x);\n \nreturn 0;\n}\n\n\n\nvoid swap(int i,int j)\n{\n int t;\n t=a[i];\n a[i]=a[j];\n a[j]=t;\n return ;\n}\n \n \n", "lang": "GNU C", "bug_code_uid": "910ce59e3983002199f4ea07a18c5ab7", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "487ad53cdd203ab965b826eb788a9349", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.993920972644377, "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 n,i,a[3]={0},fin,tem;\n scanf(\"%d%d\",&n,&fin);\n a[fin]=1;\n if(n%2==0)\n {\n if((n/2)%3==1)\n {\n a[fin]=0;\n fin++;\n if(fin==3)\n fin=0;\n a[fin]=1;\n }\n if((n/2)%3==2)\n {\n a[fin]=0;\n fin++;\n if(fin==3)\n fin=0;\n fin++;\n if(fin==3)\n fin=0;\n a[fin]=1;\n }\n }\n else\n {\n tem=a[0];\n a[0]=a[1];\n a[1]=tem;\n for(i=0;i<3;i++)\n if(a[i]==1)\n fin=i;\n if(((n-1)/2)%3==1)\n {\n a[fin]=0;\n fin++;\n if(fin==3)\n fin=0;\n a[fin]=1;\n }\n if(((n-1)/2)%3==2)\n {\n a[fin]=0;\n fin++;\n if(fin==3)\n fin=0;\n fin++;\n if(fin==3)\n fin=0;\n a[fin]=1;\n }\n for(i=0;i<3;i++)\n {\n if(a[i]==1)\n printf(\"%d\",i);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "dc2d7436137f76e8c686e649b55ff733", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "be04bff8889d272e1c9f356943502012", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.21188630490956073, "equal_cnt": 24, "replace_cnt": 9, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 23, "bug_source_code": "#include\n#include\n#include\nusing namespace std;\n\nint n,a[100000+5];\n\nint findtop(int t,int max){\n bool flag;\n flag=false;\n for (int i=t; i>=1; i--)\n if (a[i]==max) return i;\n return 0;\n}\n\nint main(){\n\n memset(a,0,sizeof(a));\n cin>>n;\n for (int i=1;i<=n;i++)\n cin>>a[i];\n int max; max=n; int t=1;\n while (max>0){\n while (findtop(t,max)!=0){\n cout<n) break;\n cout<\nint main()\n{\n int i, d, x;\n long int n;\nint arr[3]={0, 0, 0};\nscanf(\"%ld\", &n);\nscanf(\"%d\", &x);\narr[x]=1;\nwhile (n!=0)\n{\nif (n%2==0)\n{\nd=arr[1];\narr[1]=arr[2];\narr[2]=d;\n}\nelse\n{\nd=arr[0];\narr[0]=arr[1];\narr[1]=d;\n}\nn--;\n}\n\n\nfor (i=0;i<3;i++)\n{\n if (arr[i]==1)\n {\n\n\n printf(\"%d\", i);\n break;\n }\n}\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c33f69e04fb4f3962c37345bf2ba5c0f", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "3afe67ec3c79a27a3f086a47f1350368", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6287911149081589, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n\n\nint main(){\n int n,x;\n scanf(\"%d\",&n);\n scanf(\"%d\",&x);\n \n int temp=x;\n for(int i=n;i>0;i--)\n {\n if(i%2==0){\n if(temp==2)\n {\n temp=1;\n }\n else if(temp==1)\n {\n temp=2;\n }\n else temp=temp;\n }\n else if(i%2!=0){\n if(temp==1)\n {\n temp=0;\n }\n else if(temp==0)\n {\n temp=1;\n }\n else temp=temp;\n \n }\n \n // printf(\"%d\\n\",temp);\n \n }\n printf(\"%d\",temp);\n}\n", "lang": "GNU C", "bug_code_uid": "5ecddd18a312e57192233adad30317a2", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "1fa1ce6d631c1afeeaef21b68a4daad1", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9719853836784409, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nmain()\n{\n long int i,j,k,n,x;\n scanf(\"%ld\",&n);\n scanf(\"%ld\",&x);\n for(i=n;i>=1;i--)\n {\n if((i%2==0) &&(x==2)){x=1;}\n else if((i%2==0)&&(x==1)){x=2;}\n else if((i%2==0)&&(x==0)){x=0;}\n if((i%2!=0) &&(x==0)){x=1;}\n else if((i%2!=0)&&(x==1)){x=0;}\n else if((i%2!=0)&&(x==2)){x=2;}\n }\n printf(\"%d\\n\",x);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "00630ae001805486e174aaf781690add", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "53294ad6198c05027ef0574b39560aed", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9862258953168044, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n\nint swap1(int k){\n\tif (k == 0){\n\t\treturn 1;\n\t}\n\tif (k == 1){\n\t\treturn 0;\n\t}\n\treturn k;\n}\n\nint swap2(int k){\n\tif (k == 1){\n\t\treturn 2;\n\t}\n\tif (k == 2){\n\t\treturn 1;\n\t}\n\treturn k;\n}\n\nint main(void)\n{\n\tint n, k;\n\tscanf(\"%d %d\", &n, &k);\n\t\n\twhile (n){\n\t\tif (n & 1){\n\t\t\tk = swap1(k);\n\t\t} else {\n\t\t\tk = swap2(k);\n\t\t}\n\tn--;\n\t}\n\tprintf(\"%d\", k);\n}\n", "lang": "GNU C", "bug_code_uid": "9b9352725dcc9606c697edfd7a12d97b", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "09f36e1513fc4113c1ee95d3d2fe6da4", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9764868603042877, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "//\n// main.c\n// CF777\n//\n// Created by Ding Chao on 2/24/17.\n// Copyright © 2017 Ding Chao. All rights reserved.\n//\n\n#include \n\nvoid swap(int *a, int *b) {\n int t = *a;\n *a = *b;\n *b = t;\n}\n\nint main(int argc, const char * argv[]) {\n // insert code here...\n int move, finalPosition, pos[3] = {0, 0, 0};\n scanf(\"%d%d\", &move, &finalPosition);\n pos[finalPosition] = 1;\n for (int i = move; i > 0; i--) {\n if (i % 2 ==0) {\n swap(&pos[1], &pos[2]);\n }\n else {\n swap(&pos[0], &pos[1]);\n }\n }\n \n for (int i = 0; i < 3; i++) {\n if (pos[i] == 1)\n printf(\"%d\\n\", i);\n }\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f7b595be9fe32091876e1d904dba6265", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "85a9d65f848dc1ed44d47722975b6c57", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9914129586260734, "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 \ntypedef long long ll;\nint main()\n{\n ll n;\n scanf(\"%lld\",&n);\n ll x=0,i=0;\n scanf(\"%lld\",&x);\n ll s = x;\n if(n%2==1)\n {\n for(i=1;i<=n;i++)\n {\n if(i%2==1)\n {\n if(s==0||s==1)\n s = 1-s;\n }\n else\n {\n if(s==2)\n s=1;\n else if(s==1)\n s=2;\n } \n }\n }\n else\n {\n for(i=2;i<=n+1;i++)\n {\n if(i%2==1)\n {\n if(s==0||s==1)\n s = 1-s;\n }\n else\n {\n if(s==2)\n s=1;\n else if(s==1)\n s=2;\n } \n }\n } \n printf(\"%lld\\n\",s);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "e001b8495e7e43defb389a7f42031732", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "65da5b96f0096a72412a77e954869539", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4404973357015986, "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,x;\n int i;\n while(scanf(\"%d%d\",&n,&x)!=EOF)\n {\n for(i=n;i>=1;i--)\n {\n if(i%2==0)\n {\n if(x==1) x++;\n else if(x==2) x--;\n }\n else\n {\n if(x==0) x++;\n else if(x==1) x--;\n }\n }\n printf(\"%d\\n\",x);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "864ca3ce6b29c49052ce4fc8cceb6bc5", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "c1ccc6380088f8eb922efd8e3b05890d", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7741228070175439, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include \nint main()\n{\n\tint ara[3]={0,0,0};\n\tint i,n,x,temp,j;\n\tscanf(\"%d\",&n);\n\tscanf(\"%d\",&x);\n\tfor (i=0;i<3;i++)\n\t{\n\t\tara[i]=1;\n\t\tfor(j=1;i<=n;j++)\n\t\t{\n\t\t\tif (j%2!=0)\n\t\t\t{\n\t\t\t\ttemp=ara[0];\n\t\t\t\tara[0]=ara[1];\n\t\t\t\tara[1]=temp;\n\t\t\t}\n\t\t\tif (j%2==0)\n\t\t\t{\n\t\t\t\ttemp=ara[1];\n\t\t ara[1]=ara[2];\n\t\t\t\tara[2]=temp;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (ara[x]==1)\n\t\t{\n\t\t\tprintf(\"%d\\n\",i);\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\tara[i]=0;\n\t}\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "2a9035aaca83ea19e240835cc208b5a2", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "e8a28a8b1d69f3bc92b7e44d68546687", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9784615384615385, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n#include\n\n\nint main()\n{\n int n,x;\n scanf(\"%d\",&n);\n scanf(\"%d\",&x);\n\n int array[]={0,0,0};\n\n array[x]=1;\n\n int j=n;\n while(j>0)\n {\n if(j%2==0)//even\n {\n int temp=array[2];\n array[2]=array[1];\n array[1]=temp;\n }\n else//odd\n {\n int temp=array[0];\n array[0]=array[1];\n array[1]=temp;\n }\n j--;\n }\n\n int t=0;\n while(t<3)\n {\n if(array[t]==1)\n {\n printf(\"%d\\n\",t);\n }\n t++;\n }\n}\n", "lang": "GNU C", "bug_code_uid": "ab9dda5f1d6fed6bdbcd3887615e8f35", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "1106db1e7b189a58b4cfef9bcdf903e0", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.998220640569395, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//#include\n#include\nint main()\n{\n long long n,m,i;\n scanf(\"%lld %lld\",&n,&m);\n int ind[3]={0,1,2};\n int swap,c=100,cat,t;\n ind[m]=c;\n if(n>6){t=n;}\n else{t=n;}\n for(i=t;i>=1;i--){\n if(i%2==0){\n swap=ind[1];\n ind[1]=ind[2];\n ind[2]=swap;\n }\n else{\n swap=ind[0];\n ind[0]=ind[1];\n ind[1]=swap;\n }\n }\n for(i=0;i<3;i++){\n if(ind[i]==c){\n cat=i;\n }\n }\n printf(\"%d\",cat);\n\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e49abac1d565186bf2dcb7da517b50ab", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "2e84eddd87fca30e46f096c34de9c9b6", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9950372208436724, "equal_cnt": 2, "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 int n,x;\n scanf(\"%d %d\",&n,&x);\n int ball = x;\n int i;\n for(i=n; i>=1; i--)\n {\n if(i%2 == 0 && ball!=0)\n {\n if(ball == 1)\n ball = 2;\n else\n ball = 1;\n }\n else if(i%2 == 1 && ball!=2)\n {\n if(ball == 0)\n ball = 1;\n else\n ball = 0;\n }\n }\n printf(\"%d\\n\",ball );\n\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "4775227492db1f7355315973088c4a96", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "349e08618e3c5607b0f00f696dc443e1", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.10678733031674208, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int n,x;\n while(~scanf(\"%d\",&n))\n {\n int i;\n scanf(\"%d\",&x);\n for(i=n; i>=1; i--)\n {\n if(i%2!=0)\n {\n if(x==0)\n {\n x=1;\n continue;\n }\n if(x==1)\n {\n x=0;\n continue;\n }\n }\n\n if(i%2==0)\n {\n if(x==1)\n {\n x=2;\n continue;\n }\n if(x==2)\n {\n x=1;\n continue;\n }\n\n }\n }\n printf(\"%d\\n\",x);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6667fe04a5fec01e3655cc9f616adbb6", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "0886079b70c0bcac802345bf611ec990", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6305329719963866, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main ()\n{\n long n,m;\n scanf(\"%ld %ld\",&n,&m);\n while(n>0)\n {\n if(n%2==0)\n {\n if(m==1) m=2;\n else if (m==2) m=1; n--;\n }\n else if(n%2==1)\n {\n if(m==1) m=0;\n else if (m==0) m=1; n--;\n }\n }\n printf(\"%ld\",m);\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "53483ef5746699aac35685a564afa33b", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "9ffe18eea60a0fd0ce699ea5077566dd", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.38204833141542005, "equal_cnt": 25, "replace_cnt": 16, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 25, "bug_source_code": "#include\nint main()\n{\n long long int n;\n int i,f,temp1,temp2,l,m,r;\n scanf(\"%lld%d\",&n,&f);\n if(f==0)\n {\n l=1;\n m=0;\n r=0;\n }\n else if(f==1)\n {\n l=0;\n m=1;\n r=0;\n }\n else\n {\n l=0;\n m=0;\n r=1;\n }\n if(n%2==0)\n for(i=1;i<=n;i++)\n {\n if(i%2!=0)\n {\n temp1=r;\n r=m;\n m=temp1;\n }\n else\n {\n temp2=l;\n l=m;\n m=temp2;\n }\n\n }\n else\n for(i=1;i<=n;i++)\n {\n if(i%2!=0)\n {\n temp2=l;\n l=m;\n m=temp2;\n }\n else\n {\n temp1=r;\n r=m;\n m=temp1;\n }\n }\n if(l==1)\n printf(\"0\");\n\n else if(m==1)\n printf(\"1\");\n else if(r==1)\n printf(\"2\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7c73021c5c30ac30b3cc0e8ab9e7a04a", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "c34d395ec2325a0a9abf6a806330570b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4514073287307488, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "#include\nint main()\n{\n long long int n;\n int x,f,temp1,temp2,a,b,c;\n scanf(\"%lld%d\",&n,&f);\nif(f==0)\n {\n a=1;\n b=0;\n c=0;\n }\nelse if(f==1)\n {\n a=0;\n b=1;\n c=0;\n }\nelse\n {\n a=0;\n b=0;\n c=1;\n }\n if(n%2==0)\n x=n%6;\n else\n x=6-(n%6);\n switch()\n {\n case(1)\n temp1=b;\n b=c;\n c=temp1;\n break;\n \n case(2)\n temp1=b;\n b=c;\n c=temp1;\n a=temp2;\n a=c;\n c=temp2;\n break;\n case(3)\n temp1=a;\n a=c;\n c=temp1;\n break;\n case(4)\n temp1=b;\n b=a;\n a=temp1;\n temp2=c;\n c=a;\n a=temp2;\n break;\n case(5)\n temp1=a;\n a=b;\n b=temp1;\n break;\n case(6)\n ;\n break;\n default\n ;\n \n }\n if(a==1)\n printf(\"0\");\n else if(b==1)\n printf(\"1\");\n else if(c==1)\n printf(\"2\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e0f184065b7dee639fcebcf46798b420", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "c34d395ec2325a0a9abf6a806330570b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9907854322071084, "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 N_LIMIT 1000003 // 1e6+3\ntypedef long long ll;\n\n\nll a_pows[N_LIMIT];\n\nll inv(ll x, ll p)\n{\n ll result = 1, y;\n //printf(\"inverse of %lld is \", x);\n while (x != 1)\n {\n y = (x+p)/x;\n result *= y;\n x = (x*y)%p;\n }\n //printf(\"%lld\\n\", result);\n return result;\n}\n\nint main(int argc, char *argv)\n{\n ll a, b, p, x, d = 1;\n \n ll n, m, y, z;\n ll pdi;\n ll count;\n int i;\n scanf(\"%lld %lld %lld %lld\", &a, &b, &p, &x);\n a_pows[0] = 1;\n a_pows[1] = a;\n while (a != 1)\n {\n d++;\n a = (a*a_pows[1]) % p;\n a_pows[d] = a;\n }\n //printf(\"d: %lld\\n\", d);\n count = 0;\n pdi = inv(p-d, p);\n for (m=0; m= z*d+m)\n {\n count += 1;\n }\n }\n printf(\"%lld\\n\", count);\n \n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "525abb2923f77c30bac1bfa8839667f2", "src_uid": "4b9f470e5889da29affae6376f6c9f6a", "apr_id": "7547325ddf38c6f18ec28e8ac0d4feae", "difficulty": 2100, "tags": ["math", "chinese remainder theorem", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9939148073022313, "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\tint x, n, x1;\n\tn = 0;\n\tscanf(\"%d\", &x);\n\tx1 = x;\n\twhile (x1 % 10 == 0)\n\t\tx1 = t / 10;\n\twhile (x != 0)\n\t{\n\t\tn = n * 10 + x % 10;\n\t\tx = x / 10;\n\t}\n\tif (x1 == n)\n\t\tprintf(\"YES\");\n\telse\n\t\tprintf(\"NO\");\n\treturn(0);\n}", "lang": "GNU C", "bug_code_uid": "543db34c7f22f430d0c7f097908e381a", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "6d123badbd9dcb77315929a79b6556d0", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9968520461699895, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \nchar s[100000000];\n\nint palin(char s[]){\n int i ,j ;\n i=0;\n j=(strlen(s)-1);\n int res = 1;\n while (i0) {\n\n if (s[i]!=s[j]) {\n res=0;\n break;\n }\n else{\n i++;\n j--;\n }\n }\n\n return res ;\n}\nint palin0(char s[],int z){\n int i ,j ;\n i=0;\n j=(strlen(s)-1-z);\n int res = 1;\n while (i0) {\n if (s[i]!=s[j]) {\n res=0;\n break;\n }\n else{\n i++;\n j--;\n }\n }\n\n return res ;\n}\n\n\nint main() {\n\n\n\n int i ;\n int res ;\n\n scanf(fich,\"%s\",s);\n\n\n\n int zero = 0 ;\n for ( i = strlen(s)-1 ; i > 0 ; i--) {\n if (s[i]=='0') {\n zero++;\n }\n else\n break;\n }\n if (zero!=0) {\n\n if (palin0(s,zero)==1) {\n printf(\"YES\");\n }\n else\n printf(\"NO\");\n\n }\n else{\n if (palin(s)==1) {\n printf(\"YES\");\n }\n else\n printf(\"NO\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "763c740f7b54bc6080933259f31e8e8d", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "92b958ca08c3a75a5972e4ed763e567d", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9551886792452831, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nusing namespace std;\nint main()\n{\n int i,j,n,m,k;\n scanf(\"%d\",&k);\n while(k%10==0)\n k=k/10;\n m=k;\n n=0;\n i=0;\n while(m)\n {\n i++;\n n=n*10+m%10;\n m=m/10;\n }\n m=k;\n j=0;\n while(m)\n {\n if(n%10==m%10)\n j++;\n m=m/10;\n n=n/10;\n }\n if(i==j)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b96cbf4ab505188fa3b256d9abf88474", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "040ec40b32a41bc034819547a53f5dfa", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.009669621273166801, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"homework\", \"homework\\homework.vcxproj\", \"{2793BD17-4988-483F-8D84-4904507F33A9}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{2793BD17-4988-483F-8D84-4904507F33A9}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{2793BD17-4988-483F-8D84-4904507F33A9}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{2793BD17-4988-483F-8D84-4904507F33A9}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{2793BD17-4988-483F-8D84-4904507F33A9}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "GNU C", "bug_code_uid": "481e269c9d715e2c31ed4b307c9a4dc4", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "3443f247b718fe2d7c00fbcbe93c5a47", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9948006932409013, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nchar ch[15];\n\nint main(void)\n{\n\tint n,i,j,x;\n\tscanf(\"%s\",ch);\n\tn=strlen(ch);\n\tx=n-1;\n\tfor(i=n-1;i>0;i--) {\n\t\tif(ch[i]!='0') {\n\t\t\tx=i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor(i=0,j=x;i<=x;i++,j--) {\n\t\tif(ch[i]!=ch[j]) {\n\t\t\tprintf(\"NO\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\tprintf(\"YES\");\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "9cc499504cff701914f16e79fe73f46b", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "b9516215c4148f9c8903b2c7e4f93d25", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9153046062407132, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint rt(int n)\n{\n //printf(\"%d\\n\",n);\n int i;\n for(i=0;i*i<=n;i++);\n if((i-1)*(i-1)==n)\n \n \n \n \n return i-1;\n else\n return i;\n \n \n}\n\nint main()\n{\n int r,x,y,nx,ny,flag=0;\n scanf(\"%d%d%d%d%d\",&r,&x,&y,&nx,&ny);\n int temp=(nx-x)*(nx-x)+(ny-y)*(ny-y);\n int root=rt(temp);\n int moves=root/(2*r);\n //printf(\"%d %d\\n\",root,flag);\n if(moves*2*r==root)\n \n printf(\"%d\\n\",moves);\n else\n printf(\"%d\\n\",moves+1);\n return 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "7e2ffc13bb7c05850457cdb9acdc8933", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "60508d41919223cd9983392dd9071c23", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9906166219839142, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\n double r,x1,y1,x2,y2,ans,tot,d,l,h,m;\n int ansf;\n scanf(\"%lf %lf %lf %lf %lf\",&r,&x1,&y1,&x2,&y2);\n tot=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);\n l=0;\n h=tot;\n m=(h+l)/2;\n while(1)\n {\n m=(h+l)/2;\n if(m*m>tot)\n {\n if(m*m-tot<0.00000001)\n break;\n else\n h=m;\n }\n else if(m*m\n#include\nint main()\n{\n double r,x1,y1,x2,y2,ans,tot,d,l,h,m;\n int ansf;\n scanf(\"%lf %lf %lf %lf %lf\",&r,&x1,&y1,&x2,&y2);\n tot=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);\n l=0;\n h=tot;\n m=(h+l)/2;\n while(1)\n {\n m=(h+l)/2;\n if(m*m>tot)\n {\n if(m*m-tot<0.00000000001)\n break;\n else\n h=m;\n }\n else if(m*m\n#define lli long long int\n\nlli n,c1,c2,pr=0;\n\nlli calc(lli gr)\n{\n if(gr==0 || gr>pr)\n return 1000000000000000;\n lli num=n/gr;\n lli r=n%gr;\n lli ret=gr*c1;\n ret+=r*(n/gr)*(n/gr)*c2;\n ret+=(gr-r)*(n/gr-1)*(n/gr-1)*c2;\n return ret;\n}\n\nint main() {\n scanf(\"%lld%\",&n);\n scanf(\"%lld%\",&c1);\n scanf(\"%lld%\",&c2);\n char s[n+1];\n gets(s);\n int ch=0;\n int i;\n for(i=0;inm && n2>nm)\n {ans=nm;\n break;}\n else if(n2\n#include \n#include \n#include \n#include \n\nint Input;\nint Ans[70000];\nint A, B, i, x, y, Test, FAns;\n\nint QS(int *A, int *B){\n if (*A>*B) return 1;\n if (*A<*B) return -1;\n return 0;\n}\n\nint main(){\n while(~scanf(\"%d\", &Input)){\n FAns = 0;\n \n for (A=0; A<10; A++) for (B=0; B<10; B++) for (i=0; i<1024; i++){\n Test = 0;\n x = i;\n while(x){\n Test *= 10;\n if (x&1) Test += A;\n else Test += B;\n x /= 2;\n }\n if (Test>0) if (Test<=Input){\n Ans[FAns] = Test;\n FAns++;\n }\n }\n \n qsort(Ans, FAns, sizeof(Ans[0]), QS);\n \n if (Input==1000000000){\n Ans[FAns] = Input;\n FAns++;\n }\n \n if (FAns<=1){\n printf(\"%d\\n\", FAns);\n continue;\n }\n \n for (i=FAns-1; i; i--) if (Ans[i]==Ans[i-1]) FAns--;\n \n printf(\"%d\\n\", FAns);\n }\n \n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9ec7b03a1fd3dcca0b7900103425e887", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "e5c86dd5bd0a4a9c08cd8dfaaa50cd85", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.11350293542074363, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main(void)\n{\n int n,i,j,k,t,count1,count2,flag,num[100],a;\n while(scanf(\"%d\",&n)!=EOF)\n {\n count2=0;\n for(k=102;k<=n;k++)\n {\n memset(num,0,sizeof(num));\n count1=0;\n flag=1;\n t=k;\n while(t!=0)\n {\n a=t%10;\n num[a]++;\n t=t/10;\n }\n for(j=0;j<=9;j++)\n {\n if(num[j]!=0)\n count1++;\n if(count1==3)\n flag=0;\n }\n if(flag==0)\n {\n count2++;\n }\n }\n printf(\"%d\\n\",n-count2);\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "2192d1c83cdaece8aa6d79d460d05401", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "3fe61cec49f490731512fe882c808fde", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.974559686888454, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main(void)\n{\n int a;\n while(scanf(\"%d\",&a)!=EOF)\n {\n if(a<=101)\n printf(\"%d\\n\",a);\n else if(a==123)\n printf(\"113\\n\");\n else if(a==1000)\n printf(\"352\\n\");\n else if(a==1000000000)\n printf(\"40744\\n\");\n else if(a==999999999)\n printf(\"40743\\n\");\n else if(a==999999998)\n printf(\"40742\\n\");\n else if(a==999999997)\n printf(\"40741\\n\");\n else if(a==909090901)\n printf(\"38532\\n\");\n else if(a==142498040)\n printf(\"21671\\n\");\n else if(a==603356456)\n printf(\"31623\\n\");\n else if(a==64214872)\n printf(\"15759\\n\");\n else if(a==820040584)\n printf(\"36407\\n\");\n else if(a==442198)\n printf(\"3071\\n\");\n else if(a==642678)\n printf(\"3615\\n\");\n else if(a==468390)\n printf(\"3223\\n\");\n else if(a==326806)\n printf(\"2759\\n\");\n else if(a==940)\n printf(\"331\\n\");\n else if(a==356)\n printf(\"175\\n\");\n else if(a==132)\n printf(\"114\\n\");\n else if(a==102)\n printf(\"101\\n\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "59cc89b60650f3c58a9ce72e87ec37bc", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "3fe61cec49f490731512fe882c808fde", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.32974504249291786, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include \nint main(int argc, char const *argv[])\n{int c=0,z,n,p=1,l,ans=0,a,i,r,flag,j,y,q,q1,ar[100],h;\n\tscanf(\"%d\",&n);\n\tz=n;\n\tif(n<=100)\n\t{\n\t\tprintf(\"%d\\n\", n);\n\t\treturn 0;\n\t}\n\twhile(z!=0)\n\t{\n\t\tz=z/10;\n\t\tc++;\n\t\t//printf(\"1\\n\");\n\t}\n\t//printf(\"%dd\\n\",c );\n\tl=c;\n\tc=c-1;\n\tfor (int i = 0; i < c; ++i)\n\t{\n\t\tans=ans+9*(9*(p-1)+1);\n\t\tp=p*2;\n\t\tar[i]=p;\n\t\t//printf(\"2\\n\");\n\t}\n\t//printf(\"ans is %d\\n\",ans );\n\ty=n;\n\t\tfor (int i = 0; i < c; ++i)\n\t\t{\n\t\t\ty=y/10;\n\t\t}\n\t\ta=y%10;\n\n\t\tfor(i=1;i0)\n\t\t\t\t{\n\t\t\t\t\tif(i%10!=q && i%10!=q1)\n\t\t\t\t\t{\n\t\t\t\t\t\tflag=0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif(i%10!=q)\n\t\t\t\t{\n\t\t\t\t\tr++;\n\t\t\t\t\tq1=i%10;\n\t\t\t\t}\n\t\t\t\ti=i/10;\n\t\t\t}\n\t\t\tif(flag==1)\n\t\t\t{\n\t\t\t\tans++;\n\t\t\t}\n\t\t}\n\tprintf(\"%d\\n\",ans );\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "a830b917d937364342bdef2d6fde092b", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "e2315dd1206c0e19728ff67a85374fba", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9629629629629629, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "/* practice with Dukkha */\n#include \n\n#define MD\t1000003\n\nint main() {\n\tint n, p;\n\n\tscanf(\"%d\", &n);\n\tp = 1;\n\twhile (--n)\n\t\tp = p * 3 % MD;\n\tprintf(\"%d\\n\", p);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "4d18044c6d9cdaec73b70ded423d1154", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "b0c4548a3c5377887efe3dbfa1b4c591", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9967256057629339, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nlong long f[60];\nint i,j;\nint n,k;\nint p[60];\n\nvoid dfs(int,int,long long);\n\nint main()\n{\n scanf(\"%d%lld\",&n,&k);\n f[0]=f[1]=1;\n for(i=2;i<=n;i++)\n {\n f[i]=f[i-1]+f[i-2];\n }\n dfs(1,n,k);\n for(i=1;i=tmp)\n {\n w=i+k-1;\n ww=i+k-1;\n while(i<=ww)\n {\n p[i]=w;\n i++;\n w--;\n }\n dfs(i,j-k,tmp);\n return;\n }\n else tmp-=f[j-k];\n }\n}\n", "lang": "GNU C", "bug_code_uid": "2b6562c2ed8bb54024d48332b9b8c5e1", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "a55e6e990d9bd37b111491829c26077b", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.33597285067873306, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n\nint main()\n{\n\tlong long int x;\n\tscanf(\"%lld\",&x);\n\tlong long int a=0;\n\tlong long int n=0;\n\tif(x<0)\n\t{\n\t\ta=(360+x)%360;\n\t\tif(a>=0&&a<=44)\n\t\t\tprintf(\"0\");\n\t\telse if(a==45)\n\t\t\tprintf(\"0\");\n\t\telse if(a>=46&&a<=134)\n\t\t\tprintf(\"1\");\n\t\telse if(a==135)\n\t\t\tprintf(\"1\");\n\t\telse if(a>=136&&a<=224)\n\t\t\tprintf(\"2\");\n\t\telse if(a==225)\n\t\t\tprintf(\"2\");\n\t\telse if(a>=226&&a<=314)\n\t\t\tprintf(\"3\");\n\t\telse if(a==315)\n\t\t\tprintf(\"0\");\n\t\telse if(a>=316&&a<=360)\n\t\t\tprintf(\"0\");\n\t}\n\telse if(x>=0)\n\t{\n\t\tn=x%360;\n\t\tif(n>=0&&n<=44)\n\t\t\tprintf(\"0\");\n\t\telse if(n==45)\n\t\t\tprintf(\"0\");\n\t\telse if(n>=46&&n<=134)\n\t\t\tprintf(\"1\");\n\t\telse if(n==135)\n\t\t\tprintf(\"1\");\n\t\telse if(n>=136&&n<=224)\n\t\t\tprintf(\"2\");\n\t\telse if(n==225)\n\t\t\tprintf(\"2\");\n\t\telse if(n>=226&&n<=314)\n\t\t\tprintf(\"3\");\n\t\telse if(n==315)\n\t\t\tprintf(\"0\");\n\t\telse if(n>=316&&n<=360)\n\t\t\tprintf(\"0\");\n\n\t}\n\treturn 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "1c8f4fedd387b73ea11ed24eac5ceba0", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "783e2e4fd25822d1ae1f1aee14037393", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9487179487179487, "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 prime 1000000007\nint main()\n{\n\tlong long num,flag=0;\n\tscanf(\"%lli\",&num);\n\tif(num<0)\n\t{\n\t\tflag=1;\n\t\tnum=-1*num;\n\t}\n\tnum=num%360;\n\tif(flag==0)\n\t{\n\t\tif(num<=45)\n\t\t{\n\t\t\tprintf(\"0\\n\");\n\t\t}\n\t\telse if(num<=135)\n\t\t{\n\t\t\tprintf(\"1\\n\");\n\t\t}\n\t\telse if(num<=225)\n\t\t{\n\t\t\tprintf(\"2\\n\");\n\t\t}\n\t\telse if(num<315)\n\t\t{\n\t\t\tprintf(\"3\\n\");\n\t\t}\n\t\telse printf(\"0\\n\");\n\t}\n\telse if(flag==1)\n\t{\n\t\tif(num==135)\n\t\t\tprintf(\"2\\n\");\n\t\telse if(num<=45)\n\t\t{\n\t\t\tprintf(\"0\\n\");\n\t\t}\n\t\telse if(num<=135)\n\t\t{\n\t\t\tprintf(\"3\\n\");\n\t\t}\n\t\telse if(num<=225)\n\t\t{\n\t\t\tprintf(\"2\\n\");\n\t\t}\n\t\telse if(num<315)\n\t\t{\n\t\t\tprintf(\"1\\n\");\n\t\t}\n\t\telse printf(\"0\\n\");\n\t}\n\treturn 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "238c2364f8cb64d8679b39688db93602", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "fe466af37611c9e1837ee36a82f1d86b", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8323108384458078, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int n,i,j,t;\n scanf(\"%d\",&n);\n int a[n];\n for(i=1;i<=n;i++)\n {\n for(j=1;j,<=n-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 int count=1;\n for(i=1;i<=n;i++)\n {\n if(a[i]+1==a[i+1])\n count++;\n else\n count=1;\n if(count==3)\n {\n printf(\"YES\");\n break;\n }\n }\n if(count<3)\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "77b293a8c11b8f39609e8f33f9c79bfc", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "5b3447ba20d4935a050fac9c495c7f24", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3553299492385787, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n int a,b,A=1,B=1,i,j,GCD;\n scanf(\"%d %d\",&a,&b);\n for(;a>0;)\n {\n A=A*a;\n a--;\n }\n for(;b>0;)\n {\n B=B*b;\n b--;\n }\n if(A>B)\n {\n for(i=B;i>1;i--)\n {\n if(A%i==0)\n {\n printf(\"%d\",i);\n break;\n }\n else\n {\n continue;\n }\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d51655a0a1e05d99bdb02dee1e061961", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "79991e3d0bc448f8fb17dd54e70925c0", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.29282296650717704, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n long long a,b,A=1,B=1,i,j,GCD;\n scanf(\"%lld %lld\",&a,&b);\n for(;a>0;)\n {\n A=A*a;\n a--;\n }\n for(;b>0;)\n {\n B=B*b;\n b--;\n }\n if(A>B)\n {\n for(i=B;i>1;i--)\n {\n if(A%i==0)\n {\n printf(\"%lld\",i);\n break;\n }\n else\n {\n continue;\n }\n }\n }\n else\n {\n for(i=A;i>1;i--)\n {\n if(B%i==0)\n {\n printf(\"%lld\",i);\n break;\n }\n else\n {\n continue;\n }\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "f24cea2c21d26bcac3809acba64ff170", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "79991e3d0bc448f8fb17dd54e70925c0", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.48148148148148145, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n\nint fact(int x);\nvoid cmp(int l, int m);\n\nint main()\n{\n int a, b;\n scanf(\"%d %d\", &a, &b);\n if(a < b)\n {\n cmp(fact(a), fact(b));\n return 0;\n }\n else if(a > b)\n {\n\n cmp(fact(b), fact(a));\n }\n else if(a == b)\n {\n printf(\"%d\", fact_a);\n return 0;\n }\n}\n\nint fact(int x)\n{\n return (x == 0)? 1 : x * fact(x - 1);\n}\n\nvoid cmp(int l, int m)\n{\n for(int i = l; i > 0; i--)\n {\n if(m % i == 0)\n {\n if(l % i == 0)\n {\n printf(\"%d\", i);\n return;\n }\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "8ea95455b509957db881fa6f1557b5b8", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6a04bab8cb451aa5f3fde5d312e31d9a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.40903225806451615, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include \n#include \n\nint fact(int x);\nvoid cmp(int l, int m);\n\nint main()\n{\n int a, b, fact_a = 1, fact_b = 1;\n scanf(\"%d %d\", &a, &b);\n int j = (a > b)? a : b;\n for(int i = 1; i <= j; i++)\n {\n fact_a = (i > a)? fact_a : fact_a * i;\n fact_b = (i > b)? fact_b : fact_b * i;\n }\n if(a < b)\n {\n cmp(fact_a, fact_b);\n return 0;\n }\n else if(a > b)\n {\n\n cmp(fact_b, fact_a);\n }\n else if(a == b)\n {\n printf(\"%d\", fact_a);\n return 0;\n }\n}\n\n// int fact(int x)\n// {\n// //return (x == 0)? 1 : x * fact(x - 1);\n// }\n\nvoid cmp(int l, int m)\n{\n for(int i = l; i > 0; i--)\n {\n if(m % i == 0)\n {\n if(l % i == 0)\n {\n printf(\"%d\", i);\n return;\n }\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "765221ce130acdfd853bd3ef98842f36", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6a04bab8cb451aa5f3fde5d312e31d9a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3867403314917127, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include \n int main()\n {\n int A,B,c,d;\n scanf(\"%d %d\", &A,&B);\n for(i,z=1;i<= A,z<=B;i++,z++)\n {\n c=i*(i+1);\n d=z*(z+1);\n \n }\n while(d!=0)\n {\n c=c%d;\n d=c;\n \n }\n printf(\"%d\",d);\n }", "lang": "GNU C11", "bug_code_uid": "7cb84f5dcd5527a1d57260937e34e604", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6445346616caed36bbe0350bb0c1dd91", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7323943661971831, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nmain()\n{\n unsigned long a, b, n, fact;\n \n scanf(\"%lu %lu\", &a, &b);\n \n (a < b) ? n = a: n = b;\n \n for(fact = 1; n >= 2; fact *= n, n--);\n \n printf(\"%lu\\n\", fact);\n}", "lang": "GNU C11", "bug_code_uid": "cac43fc4a2c23fa6aa2d35c2987b60c7", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "02840086ccfc8ff95040c7e559c178e5", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6517857142857143, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include \n\nint fact(int n)\n{\n\tif(n<=1) return 1;\n\telse return n*fact(n-1);\n}\n\nint main()\n{\n\tint a,b,x,y,i;\n\tscanf(\"%d %d\",&a,&b);\n\tx=fact(a);\n\ty=fact(b);\n\t\n\twhile(y%x != 0)\n\t{\n\t\ty=y%x;\n\t\tx=y;\n\t}\n\tprintf(\"%d\\n\",x);\n\t\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "7d606ca7963affb1b522dc9033356713", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "3799404417c963eb77bc2ac44d22e291", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9587155963302753, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint gt(int n){\n\tint gt=1;\n\tfor(int i=2;i<=n;i++){\n\t\tgt=gt*i;\n\t}\n\treturn gt;\n}\nint main(){\n\tint a,b;\n\tscanf(\"%d%d\", &a,&b);\n\tif(gt(a)%gt(b)==0) printf(\"%d\", gt(b));\n\telse printf(\"%d\", gt(a));\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "ee8fdc2481f1e93454a034bdf4990e5a", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "4722b96266c66c8efbb0c970fc492216", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.014749262536873156, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import math as m\na = int(input())\nb = int(input())\ndef gcd(a, b):\n if a == 0:\n return b\n if b == 0:\n return a\n if a > b:\n return gcd(a-b , b)\n return gcd(a, b-a)\na = m.factorial(a)\nb = m.factorial(b)\nprint(gcd(a, b))", "lang": "GNU C11", "bug_code_uid": "912be5143a62ca38264b3a7d916636d8", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6834c4887ded6d80cd455ee349874f8a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3083511777301927, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint gt(int n){\n\tif(n==0) return 1;\n\treturn n*gt(n-1);\n}\nint gcd(int a,int b){\n\tif(b==0) return a;\n\treturn gcd(b,a%b);\n}\nint main(){\n\tint a,b;\n\tscanf(\"%d%d\",&a,&b);\n\tprintf(\"%d\",gcd(gt(a),gt(b))); \n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "8effffdad105951f3ece1df762b64f02", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "7167b010bf10326cba68a2220174a435", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6666666666666666, "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{\n long long i,t,c,b,a,min,j,x,y,q,p,temp;\n scanf(\"%lld %lld\",&a,&b);\n x=1;\n for(i=1;i<=a;i++)\n\n {\n x*=i;\n }\n y=1;\n for(i=1;i<=b;i++)\n\n {\n y*=i;\n }\nif(x\n\nlong factorial(int);\nint min(int,int);\nint max(int,int);\n\t\nint main(void){\n\tint n,m,a,b,cnt;\n\tscanf(\"%d%d\", &n, &m);\n\ta = min(n,m);\n\tb = max(n,m);\n\ta = factorial(a);\n\tb = factorial(b);\n\tfor(cnt=a;cnt>=1;cnt--){\n\t\tif(a%cnt==0 && b%cnt==0)\n\t\t\tbreak;\n\t}\n\tprintf(\"%d\", cnt);\n}\n\nlong factorial(int n){\n\tint c;\n\tfloat\n\tresult = 1;\n\tfor (c=1; c <= n; c++){\n\t\tresult = result * c;\n\t}\n\treturn result;\n}\n\nint min(int a, int b){\n\tif(a<=b)\n\t\treturn a;\n\telse\n\t\treturn b;\n}\n\nint max(int a, int b){\n\tif(a<=b)\n\t\treturn b;\n\telse\n\t\treturn a;\n}\n", "lang": "GNU C11", "bug_code_uid": "497f41af82f711cf968cf41be5c17527", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "f2d6c8d918e8d9d0653af7423fb7d9f3", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5311355311355311, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\nint main(){\n\tlong long int a,b,i=1,A=1,B=1;\n\tscanf(\"%lld %lld\",&a,&b);\n\twhile(1){\n\t\tif(a>=i) A = A*i;\n\t\tif(b>=i) B = B*i;\n\t\ti++;\n\t\tif(i>a && i>b) break;\n\t}\n\twhile(A!=B){\n\t\tint max,min;\n\t\tmin = A>B?B:A;\n\t\tmax = (A>B?A:B)-min;\n\t\tA = max;\n\t\tB = min;\n\t}printf(\"%lld\\n\",A);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "84a3bc073290c08c40b39dcc1905d1ad", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "0be7b02bbe0ce80d3e530f4287d41a86", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.35122838944494994, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main()\n{\n int A,B,i,j;\n long long int count=1,result=1,rem;\n scanf(\"%d %d\",&A,&B);\n for(i=1; i<=A; i=i+1)\n {\n count=count*i;\n }\n for(i=1; i<=B; i=i+1)\n {\n result=result*i;\n }\n if(count>=result)\n {\n for(j=1;j!=0;j=j+1)\n {\n rem=count%result;\n count=result;\n result=rem;\n if(result==0)\n {\n printf(\"%I64d\\n\",count);\n exit(0);\n }\n }\n }\n else if(count\n#define Mod 1000000007\n#define ll long long\nint factorial(int n);\nint gcd(int a,int b);\nint main()\n{\n ll A,B;\n scanf(\"%lld%lld\",&A,&B);\n int c,d;\n c = factorial(A);\n d = factorial(B);\n int r;\n r = gcd(c,d);\n printf(\"%d\\n\",r);\n return 0;\n}\nint factorial(int n)\n{\n int i,fact = 1;\n for(i=1; i<=n; i++)\n fact = ((fact%Mod)*(i%Mod))%Mod;\n return fact;\n}\nint gcd(int a,int b)\n{\n if(b==0) return a;\n else gcd(b,(a%b));\n}\n", "lang": "GNU C11", "bug_code_uid": "e2e9cb919393923d90f68e2bfb8b763f", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "414acd970f61f5118169b9866a8955ae", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9866342648845686, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint obtenerDistancia(int max,int min,int a,int b,int c) {\n\tif (maxa) min=a;\n\tif (maxb) min=b;\n\tif (maxc) min=c;\t\n\n\treturn (max-min);\n}\t\n\t\nint main(){ \nint a,b,c,max,min,distancia;\t\n\tscanf(\"%d%d%d\",a,b,c);\n\tmax=1;\n\tmin=100;\n\n\tdistancia=obtenerDistancia(max,min,a,b,c);\n\n\tprintf(\"%d\\n\", distancia);\n\nreturn 0;\t\n}", "lang": "GNU C", "bug_code_uid": "65dc16212ceabb6141803425b03cb4e2", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "1ca7d47e74992cecf34f3f5af5de2ba3", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9988901220865705, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint a[10],i,j,k;\nchar c;\n\nint main\n{\n j=0;\n scanf(\"%d\",&k);\n for(i=0;i<5;i++)\n {\n for(j=0;j<5;j++)\n {\n scanf(\"%c\",&c);\n if(c=='1') a[1]++;\n if(c=='2') a[2]++;\n if(c=='3') a[3]++;\n if(c=='4') a[4]++;\n if(c=='5') a[5]++;\n if(c=='6') a[6]++;\n if(c=='7') a[7]++;\n if(c=='8') a[8]++;\n if(c=='9') a[9]++;\n }\n }\n j=0;\n for(i=1;i<10;i++)\n if(2*k\n#include\n#include\n#include\n#include\n#include\nusing namespace std;\n\nint main()\n{\n int k,i,a[10]={0};\n char s[5];\n scanf(\"%d\",&k);\n k=k*2;\n for(i=0;i<4;i++)\n {\n scanf(\"%s\",s);\n if(s[0]!='.') \n\t\t{\n\t\t\ta[s[0]-'0']++;\n\t\t}\n if(s[1]!='.')\n\t\t{\n\t\t\ta[s[1]-'0']++;\n\t\t}\n if(s[2]!='.') \n\t\t{\n\t\t\ta[s[2]-'0']++;\n\t\t}\n if(s[3]!='.')\n\t\t{\n\t\t\ta[s[3]-'0']++;\n\t\t}\n }\n for(i=0;i<10;i++)\n { \n\t\tif(a[i]>k)\n {\n printf(\"NO\\n\");\n return 0;\n }\n }\n printf(\"YES\\n\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "a331605ff334f7a884a3fd0f6ef87643", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "2b849d636c2fb95c8634968030ccf82e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9671801741460148, "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;\n int i, j;\n int flag;\n int fig[10];\n char map[6][6];\n while(scanf(\"%d\", &n) != EOF)\n {\n for(i = 0; i < 10; i++)\n fig[i] = 0;\n for(i = 0; i < 4; i++)\n {\n for(j = 0; j < 4; j++)\n {\n scanf(\"%c\", &map[i][j]);\n if(map[i][j] > '0' && map[i][j] <= '9')\n fig[map[i][j] - '0']++;\n }\n getchar();\n }\n flag = 0;\n for(i = 1; i < 10; i++)\n {\n if(fig[i] > n * 2)\n flag = 1;\n }\n if(flag == 1)\n printf(\"NO\\n\");\n else\n printf(\"YES\\n\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "b78982e9000d21e730cb34f0d974d536", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "2ca81cfd38ecdc9530c220177216f695", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5544554455445545, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{ \n long long int a,b,d=1,e=1,i;\n scanf(\"%I64%I64d\",&a,&b);\n while(a>0)\n {\n d=d*a;\n a--;\n }\n a=d;\n\n while(b>0)\n {\n e=e*b;\n b--;\n }\n b=e;\n for(i=(a0;i--)\n if(a%i==0&&b%i==0)\n break;\n printf(\"%I64d\",i);\n\n return 0;\n\n}", "lang": "GNU C11", "bug_code_uid": "a72f828b4ddd045bdc4ed9be98d1d9d5", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "2d5e0d190cf292e35e7cb503795ac17f", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3804755944931164, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include \nint main(void)\n{\n long long long int a, b, f1 = 1, f2 = 1, i, gcd;\n scanf(\"%llld %llld\", &a, &b);\n for(i = 1; i <= a; i++)\n {\n f1 = f1 * i;\n }\n for(i = 1; i <= b; i++)\n {\n f2 = f2 * i;\n }\n printf(\"%llld %llld\\n\", f1, f2);\n for(i = 1; i <= f1 && i <= f2; i++)\n {\n if(f1 % i == 0 && f2 % i == 0)\n gcd = i;\n }\n printf(\"%llld\\n\", gcd);\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "ef6f170b9abfc725c4260fd438497835", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "36d5e9c46f412214945d19cf2244ff69", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6946902654867256, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\n\nint main()\n{\n\tint x,y,i,j;\n\tlong long int a,b,c,m;\n\tscanf(\"%d %d\",&x,&y);\n\ta=1;\n\tb=1;\n\tfor(i=1;i<=x;i++){\n\t\ta=i*a;\n\t}\n\tfor(j=1;j<=y;j++){\n\t\tb=j*b;\n\t}\n\twhile(1){\n\t\tc=a%b;\n\t\tif(c==0){\n\t\t\tm=b;\n\t\t\tbreak;\n\t\t}\n\t\tb=c;\n\t}\n\tprintf(\"%lld\",m);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "c6a4055daf68417795a6bd8528472729", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "4d1d08c47cdb2110bd4db32ad96ba51c", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.33840304182509506, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nlong long fac(int n)\n{\n\tif(n==1||n==0)\n\treturn 1;\n\telse\n\treturn fac(n-1)*n;\n}\nlong long gcd(long long x,long long y)\n{\n\tif(y==0)\n\treturn x;\n\telse\n\treturn gcd(y,x%y);\n}\nint main()\n{\n\tint a,b,ans;\n\tlong long x,y;\n\tscanf(\"%d%d\",&a,&b);\n\tx=fac(a);\n\ty=fac(b);\n\tans=gcd(x,y);\n\tprintf(\"%d\\n\",ans);\n\treturn 0;\n } ", "lang": "GNU C11", "bug_code_uid": "178f9594d4a69c0b58822991985e0677", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "b2f7d29ab98c55f6f0b8be923dc1d208", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9980732177263969, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint fac(int n){\n if(n==1) return 1;\n else return n*fac(n-1);\n}\nint min(int a, int b){\n if(a>b) a=b;\n return a;\n}\nint main(){\n int a,b;\n scanf(\"%d%d\",&a,&b);\n a=min(a,b);\n a=fac(a);\n prinf(\"%d\\n\",a);\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "3c14ac7022279c1cbb1d538b95f6b015", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "a311ad22909f07312294921c3fa59054", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3697813121272366, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n\tint x,y;\n\tscanf(\"%d %d\",&x,&y);\n\tint i=1,a=1,b=1;\n\tfor(i=1;i<=x;i++)\n\ta=a*i;\n\tfor(i=1;i<=y;i++)\n\tb=b*i;\n\tint g,s,s1;\n\tif(a\n\nint main()\n{\n int t, n;\n scanf(\"%d\", &t);\n while(t--){\n scanf(\"%d\", &n);\n int a[n];\n\n }\n}\n\nint sum(int a[], n)\n{\n\n}\n", "lang": "GNU C11", "bug_code_uid": "4482c499b860a5560bc43e1dd210ebbe", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "f8389dd08c691550083a5f17bd7f8884", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.42, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n long long int a=1,b=1,c,d,i,div,rem,p,x;\n scanf(\"%lld%lld\",&c,&d);\n for(i=1;i<=c;i++)\n {\n a*=i;\n }\n for(i=1;i<=d;i++)\n {\n b*=i;\n }\n if(a\nint main()\n{\n\n\tlong long int n1,n2,k1=1,k2=1,i,j,x,z;\n\tscanf(\"%lld%lld\",&n1,&n2);\n\tfor(i=n1;i>0;i--)\n {\n k1=k1*i;\n }\n k2=1;\n for(j=n2;j>0;j--)\n {\n k2=k2*j;\n }\n if(k1>k2)\n {\n if(k1%k2==0)\n {\n printf(\"%lld\",k2);\n }\n\n else if(k1%k2!=0)\n { x=2;\n while(k1%k2!=0)\n { k2=k2/x;\n x=x+1;\n\n\n }\n printf(\"%d\",k2);\n\n }\n }\n if(k1\n/*int function(long long int n,long long int m)\n{\nint main()\n{\nlong long int x,y,w=1,i,j=1,a,s;\nscanf(\"%lld%lld\",&x,&y);\nif(x\n\nint main()\n{\n long a,b;\n scanf(\"%d%d\",&a,&b);\n printf(\"%d\",pgcd(factoriel(a),factoriel(b)));\n\n return 0;\n}\n\nint factoriel(long a)\n{\n int k=1;\n for (int i =1 ; i <= a ; i++)\n {\n k*=i;\n }\n return k;\n}\n\nint pgcd(long a,long b)\n{\n int r;\n r = a%b ; \n if (r!=0)\n {\n return pgcd(b,r);\n }\n else\n {\n return b;\n }\n\n}", "lang": "GNU C11", "bug_code_uid": "748449370a305188e8d59f7faede0a66", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "667dc32a7ccdec51179f16fa0731d1e4", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9936305732484076, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint main(){\n int a,b;\n scanf(\"%d %d\",&a,&b);\n long int f1=1,f2=1;\n if(a<=b)\n {\n for(int i=1;i<=a;i++)\n {\n f1*=i;\n }\n printf(\"%ld\",f1);\n else { \n for(int i=1;i<=b;i++)\n {\n f2*=i;\n }\n printf(\"%ld\",f2);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "83dcff9839908d4f439f28ea782c5784", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "52c46527b1173646828292902c9e9e92", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.31955922865013775, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "#include \nint main()\n{\n long int a,b,c=1,d=1,e,i,f;\n scanf(\"%ld%ld\",&a,&b);\n if(a>0)\n {\n for(i=a;i>0;i--)\n {\n c=c*i;\n }\n }\n if(b>0)\n {\n for(i=b;i>0;i--)\n {\n d=d*i;\n }\n }\n if(c>d)\n {\n e=d;\n }\n else\n {\n e=c;\n }\n for(i=1;i<=e;i++)\n {\n if(c%i==0&&d%i==0)\n {\n f=i;\n }\n }\n printf(\"%ld\",f);\n\n}", "lang": "GNU C11", "bug_code_uid": "e4d35df34fc2c3018c4dbcf226a26aa6", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "e4abbe23a8fd939815143c7b7a51139e", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.1968503937007874, "equal_cnt": 21, "replace_cnt": 11, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 22, "bug_source_code": "/******************************************************************************\n\n Online C Compiler.\n Code, Compile, Run and Debug C program online.\nWrite your code in this editor and press \"Run\" button to compile and execute it.\n\n*******************************************************************************/\n\n#include \n\nint main()\n{\n int a,b,c,i,am,bm,j;\n scanf(\"%d%d\",&a,&b);\n \n i=a;\n j=b;\n \n am=1;\n bm=1;\n while(i>0 || j>0)\n {\n if(i>0)\n {\n am*=i; \n }\n if(j>0)\n {\n bm*=j;\n }\n j--;\n i--;\n }\n \n c=(am>bm)?bm:am;\n if(am%c==0 && bm%c==0)\n {\n printf(\"%d\",c);\n \n }else{\n for(i=1;i<=c;i++)\n {\n if(am%i==0 && bm%i==0)\n {\n printf(\"%d\",i);\n break;\n }\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "5cf811e3190792e01571753d49bd5bcb", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "bc6a6fce137f65f57d4b7f4c116783c8", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22913719943422914, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,k,p=1,l=1,g;\n scanf(\"%d %d\",&n,&k);\n for(int i=1;i<=n;i++){\n p*=i;\n }\n for(int i=1;i<=k;i++){\n l*=i;\n }\n if(p>l){\n if(p%l!=0){\n g=1;\n }\n else{\n g=l;\n }\n }\n \n else{\n if(l%p!=0){\n g=1;\n }\n else{\n g=p;\n }\n }\n printf(\"%d\",g);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "d56c92937eb52b9354dcb8cb2bbf9d68", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "d6e4ddf17fe8d1b1c40a1e7725570969", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3925233644859813, "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,ans;\n scanf(\"%d\",&n);\n ans=1;\n ans=ans+(n-1)+n-2;\n printf(\"%d\",ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f1d05e69d2bfee57b31605933e306197", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "557f279f0f855400906770a2e496225b", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3222416812609457, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n//week3\nint di(int n)\n{\n if(n==1) return 1;\n if(n==2) return 2;\n if(n==3) return 4;\n if(n==4) return 6;\n else return 2*di(n-1)-2*di(n-3)+di(n-4);\n}\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int m=di(n);\n printf(\"%d\\n\",m);\n}", "lang": "GNU C", "bug_code_uid": "414bfd8b2ed8bbc8569fcd96d0232cf2", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "24ebb4aceb65e097f2af514dc3a68d13", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9814814814814815, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main() {\n\tint n;\n\tint sum;\n\tint i;\n\tscanf(\"%d\",&n);\n\tfor(i=1;i<=n;i++){\n\t\tsum+=i>(n-i+1)?(n-i+1):i;\n\t}\n\tprintf(\"%d\",sum);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d74e9518e1ffbf77b68c4212b0aaa369", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "d558130c840bdc156c1b93c113b0234b", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9496774193548387, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main() {\n int n,i,j,beg,end,z,o,max=0,c=0;\n scanf(\"%d\",&n);\n int A[n];\n for(i=0;imax)\n {\n max=z-o;\n beg=i;\n end=j;\n }\n }\n }\n }\n for(i=0;i\n#include\nmain()\n{\n long long int i,j,k,n,p,lo,hi,mid,a,max,flag=0;\n scanf(\"%lld %lld\",&n,&k);\n //n=499999998500000001;\n //k=1000000000;\n\n if(n<=k)\n {\n printf(\"1\\n\");\n return 0;\n }\n max=(k*(k-1)/2)+1;\n if(n>max)\n {\n printf(\"-1\\n\");\n return 0;\n }\n if(n==max)\n {\n printf(\"%lld\\n\",k-1);\n return 0;\n }\n lo=1;\n hi=k-1;\n while(lon)\n hi=mid;\n if(a\nint main()\n{\n\tlong long int n,k,sum,low,high,mid;\n\tscanf(\"%lld%lld\",&n,&k);\n\tif(n==1){\n\t\tprintf(\"0\");\n\t\treturn 0;\n\t}\n\tif(n==223265034477&&k==726990){\n\t\tprintf(\"440662\");\n\t\treturn 0;\n\t}\n\tsum = (2+k)*(k-1)/2;\n\tsum -= (k-2);\n\tlow=2;\n\thigh = k;\n\tif(sumn){\n\t\t\t\tlow = mid+1;\n\t\t\t}\n\t\t\telse if((mid+k)*(k-mid+1)/2-k+mid\n\nunsigned long long sum(unsigned long long a1, unsigned long long n)\n{\n\tif(n % 2 == 0)\n\t{\n\t\treturn (2 * a1 - n + 1) * (n / 2);\n\t}\n\telse\n\t{\n\t\treturn (2 * a1 - (n - 1) + 1) * ((n - 1) / 2) + (a1 - n + 1);\n\t}\n}\n\nint main()\n{\n\tunsigned long long n, k;\n\tscanf(\"%llu %llu\", &n, &k);\n\tunsigned long long l = 0, r = k;\n\twhile(l + 1 < r)\n\t{\n\t\tif(1 + sum(k - 1, (l + r) / 2) >= n)\n\t\t{\n\t\t\tr = (l + r) / 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tl = (l + r) / 2;\n\t\t}\n\t}\n\tprintf(\"%lld\", (r == k) ? -1 : r);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0682717ce53d7018117c8e359d730d41", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "ea72eaf167df9a1e16b8be206beaa300", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3448275862068966, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{ int j=1,n,m,h=1;\nint i,k;\n\nscanf(\"%d %d\",&n,&m);\n for(i=1;ij)?j:h;\n while(n>0)\n {\n if(h%k==0&&j%k==0)\n {\n printf(\"%d\",k);\n break;\n }\n else\n k--;\n }\n return 0;\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "06cfe5f31cd15c866ffe9f01754749bb", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "680f5afbe6f2e281b593b8bf74c9bcec", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3338632750397456, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{ long long int j=1,n,m,h=1;\nlong long int i,k;\n\nscanf(\"%d %d\",&n,&m);\n for(i=1;ij)?j:h;\n while(n>0)\n {\n if(h%k==0&&j%k==0)\n {\n printf(\"%d\",k);\n break;\n }\n else\n k--;\n }\n return 0;\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "60ec66c7ae220826d1bbc743f7faa68a", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "680f5afbe6f2e281b593b8bf74c9bcec", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.14046121593291405, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\nint fact(int x){\nint f=1;\nwhile (x>0){\n\tf=f*x;\n\tx--;\n\t}\n\nreturn f;\n}\n\nint gcd(int x,int y){\n\nint v=1;\nint n=2;\nint min=x;\n\nif (min>y) min=y;\n\nwhile (n<=min){\n\tif(x%n==0 && y%n==0){\n\t\tx=x/n;\n\t\ty=y/n;\n\t\tv=v*n;\t\n\t}\n\tn++;\n\t}\nreturn v;\n\n}\n\nint main(){\n//variables calcular maximo comun divisor de a! y b!\nint A,B;\nint min;\n\n//condicion inicial\nscanf(\"%d %d\",&A,&B);\nint fA= fact(A);\nint fB= fact(B);\n//printf(\"los facoriales son : %d %d\\n\",fA,fB);\nint valor = gcd(fA,fB);\nprintf(\"%d \\n\",valor);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4c1a4ccca566fbbbf52902ca60777c2c", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "2285ff834530fd222b84eb8198c1b26d", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.45981308411214955, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n#include \nint fact(int x){\nint f=1;\n\nwhile (x>0){\n f=f*x;\n x--;\n }\n\nreturn f;\n}\n\nint gcd(int x,int y){ if(x%n==0 && y%n==0){\n x=x/n;\n y=y/n;\n v=v*n; \n }\n n++;\n }\nreturn v;\n\n}\n\nint main(){\n//variables calcular maximo comun divisor de a! y b!\nint A,B;\nint min;\n\n//condicion inicial\nscanf(\"%d %d\",&A,&B);\nint fA= fact(A);\nint fB= fact(B);\n//printf(\"los facoriales son : %d %d\\n\",fA,fB);\nint valor = gcd(fA,fB);\nprintf(\"%d \\n\",valor);\n\n//bucle\n//while (1){\n\nint v=1;\nint n=2;\nint min=x;\nif (min>y) min=y;\nwhile (n<=min){\n", "lang": "GNU C", "bug_code_uid": "2d55273f8d98191f3b7f58de04bd4b7e", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "2285ff834530fd222b84eb8198c1b26d", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.638095238095238, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint gcd(int a, int b){\n while(a!=b){\n if(a>b)\n a-=b;\n else\n b-=a;\n }\n\n if(a==b) return a;\n}\n\nint fact(int n){\n int i,res=1;\n\n for(i=2;i<=n;i++)\n res=res*i;\n\n return res;\n}\n\nint main(){\n int a,b;\n\n scanf(\"%d\", &a); scanf(\"%d\", &b);\n\n printf(\"%d\\n\", gcd(fact(a), fact(b)));\n}\n", "lang": "GNU C", "bug_code_uid": "c3266dfdc04dd67b23fe258587f8c60d", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6759d91c25479fa24e4f19131b4c0b63", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.416988416988417, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\nint fact(int n)\n{\n\tif (n >= 1)\n\t\treturn n*fact(n-1);\n\telse\n\t\treturn 1;\n}\nint hcf(int n1, int n2)\n{\n\tif (n2 != 0)\n\t\treturn hcf(n2, n1%n2);\n\telse \n\t\treturn n1;\n}\nint main()\n{\n\tint a,b,n1,n2;\n\tscanf(\"%d %d\",&a,&b);\t\n\tn1=fact(a);\n\tn2=fact(b);\n\tprintf(\"%d\\n\",hcf(n1,n2));\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "95928df066fde8678e540c8fd4dc04b5", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "a013ac1dc709bc004bb4303eed4c581d", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4383838383838384, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main(){\n long long int a,b,i,sum1=1,sum=1,x;\n scanf(\"%lld %lld\",&a,&b);\n for(i=1;i<=a;i++){\n sum=sum*i;\n }\n for(i=1;i<=b;i++){\n sum1=sum1*i;\n }\n if(sum>sum1){\n for(i=sum1;i>=1;i--){\n if(sum%sum1==0&&sum1%sum1==0){\n x=i;\n break;\n }\n \n }\n \n }\n else{\n for(i=sum;i>=1;i--){\n if(sum%sum==0&&sum1%sum==0){\n x=i;\n break;\n }\n \n }\n \n \n \n }\n printf(\"%lld\\n\",x);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "c62fdb3040edcf57e58ceaa9b41dd063", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "060e725eb21c27c699bfd4aa301c4925", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9851301115241635, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \nint fact(int);\nint gcd(int , int);\nint main()\n{\n int a , int b ;\n scanf(\"%d%d\",&a,&b);\n int min = (a>=b)?b:a;\n int z = fact(min) ;\n printf(\"%d\",z);\n}\nint fact(int n)\n{\n if(n<=1)\n return 1 ;\n else\n return fact n*(fact(n-1));\n}\n", "lang": "GNU C", "bug_code_uid": "f93a4cd51b7cf3ee19dbb5d1b446494c", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "0116c202effd7d233eb68d987c66cd3b", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.764612954186414, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \nint fact(int);\nint gcd(int , int);\nint main()\n{\n int a ; int b ;\n scanf(\"%d%d\",&a,&b);\n int x = fact(a);\n int y = fact(b);\n int z = gcd(x,y) ;\n printf(\"%d\",z);\n}\nint fact(int n)\n{\n if(n<=1)\n return 1 ;\n else\n return n*(fact(n-1));\n}\nint gcd(int a, int b)\n{\n if(b==0)\n return a ;\n else\n return gcd(b,a%b);\n}", "lang": "GNU C", "bug_code_uid": "516d0589805145a727394092b39642f3", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "0116c202effd7d233eb68d987c66cd3b", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7477477477477478, "equal_cnt": 19, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "#include \n\nint main()\n{\n int A,B;\n long long Answer;\n scanf(\"%d %d\",&A,&B);\n if(A>B)\n Answer = factorial(B);\n else\n Answer = factorial(A);\n printf(\"%lld\",Answer);\n}\n\nlong long factorial(int n)\n{\n int i;\n long long result = 1;\n for(i=1;i<=n;i++)\n result *= i;\n return result;\n}", "lang": "GNU C", "bug_code_uid": "2417dd791a23ab27773f180dfb64b685", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "acecb462a9d3b3651d9144cd829da733", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9915966386554622, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{ int a[15],i;\n for(i=0;i<14;i++)\n a[i]=1;\n long int A,B,ans;\n for(i=1;i<13;i++)\n a[i+1]=(i+1)*a[i];\n scanf(\"%ld %ld\",&A,&B);\n if(A\nlong long int fct(int j);\n int gcd(int a, int b);\nint main()\n\n{\n\tint l,a,b,c,d ;\nlong long int n,k ;\n\tscanf(\"%d %d\" ,&n ,&k);\n n=fct(n);\n k=fct(k);\n l=gcd(n,k) ;\n\tprintf(\"%d\",l);\n\treturn 0;\n}\nlong long int fct(int j){\n int l;\n long long int r ;\n r=1 ;\n for(l=2;l<=j;l++){\n r=l*r ;\n \n }\n return r ;\n }\n int gcd(int a,int b){\n \t\n \tfor(;ab;){\n \t\tif(a>b){\n \t\t\ta=a-b ;\n \t\t}\n \t\telse{\n \t\t\tb=b-a ;\n \t\t}\n \t\t\n \t}\n \treturn a ;\n }\n \t", "lang": "GNU C", "bug_code_uid": "d442917b10fc57e8dd766b39e14b80a3", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "f41ce45065a3405a720bf8bc7d066fe4", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4180327868852459, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint main()\n\n{\n long long a,b,c,d,i,factA=1,factB=1,rem=0,n1=0,n2=0;\n\n scanf(\"%lld%lld\",&c,&d);\n if(c>d)\n {\n a=c;\n b=d;\n }\n else\n {\n a=d;\n b=c;\n }\n\n\n\n for(i=1;i<=a;i++)\n {\n factA=factA*i;\n }\n\n\n for(i=1;i<=b;i++)\n {\n factB=factB*i;\n }\n n1=factA;\n n2=factB;\n while(n2!=0)\n {\n rem=n1%n2;\n n1=n2;\n n2=rem;\n\n\n printf(\"%lld\",n1);\n }\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "f29ca4f01c9372f7ee9e5811fb511c5b", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "9b001580c3fe9bc1149edc2900e48f4c", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6255813953488372, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \nlong long fact(long long a);\nlong long gcd1(long long a, long long b);\n\nint main()\n{\n long long a, b, f1, f2;\n scanf(\"%lld %lld\", &a, &b);\n f1 = fact(a);\n f2 = fact(b);\n printf(\"%lld\", gcd1(f1, f2));\n return 0;\n}\n\nlong long fact(long long a)\n{\n long long f1=1;\n while(a){\n f1 = f1*a--;\n }\n return f1;\n}\n\nlong long gcd1(long long a, long long b)\n{\n long long g=1, min;\n if(a\nint l,r,x,y;\nint gcd(int p,int q){\n\tint r;\n\twhile(q!=0){\n\t\tr=p%q;\n\t\tp=q;\n\t\tq=r;\n\t}\n\treturn p;\n}\nvoid run(){\n\tint i,j,k,c;\n\twhile(scanf(\"%d%d%d%d\",&l,&r,&x,&y)!=EOF){\n\t\tif(y%x!=0){\n\t\t\tprintf(\"0\\n\");\n\t\t\tcontinue;\n\t\t}\n\t\tj=y/x;\n\t\tc=0;\n\t\tfor(i=1;i<100007&&i<=j;i++){\n\t\t\tif(j%i==0){\n\t\t\t\tk=j/i;\n\t\t\t\tif(k=l&&i*x<=r&&k*x>=l&&k*x<=r){\n\t\t\t\t\tif(gcd(i,k)==x){\n\t\t\t\t\t\tc+=i==k?1:2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\",c);\n\t}\n}\nmain(){\n#ifndef\tONLINE_JUDGE\n\tfreopen(\"4892b_min.in\",\"rb\",stdin);\n\tfreopen(\"4892b_.out\",\"wb\",stdout);\n#endif\n\trun();\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b8bdcb2aa3fdf0cfb01de00675970286", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "ba47687425950ff1db7adbcc0ec299f6", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9946587537091988, "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#include \n#include \n#include \n\n#define PI 3.141592653589793\n#define max(a,b) ((a < b) ? (b) : (a))\n#define min(a,b) ((a > b) ? (b) : (a))\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#define RAD(x) (((x)*PI)/180)\n#define y1 y_1\n#define endl printf(\"\\n\")\n#define MAX 105\n\nint i, u, k;\nchar s[MAX];\n\nint main () {\n\tscanf(\"%s\",s);\n\tu = strlen(s);\n\tFOR(i, 0, u - 1){\n\t\tif(s[i] == 'd' && s[i + 1] == 'o' && s[i + 2] == 't' && i + 2 != u - 1 &&i != 0){\n\t\t\ts[i] = '.';\n\t\t\ts[i + 1] = '\\0';\n\t\t\ts[i + 2] = '\\0';\n\t\t}\n\t\telse if(s[i] == 'a' && s[i + 1] == 't' && i + 1 != u - 1 && !k){\n\t\t\ts[i] = '@';\n\t\t\ts[i + 1] = '\\0';\n\t\t\tk = 1;\n\t\t}\n\t}\n\tFOR(i, 0, u - 1)\n\t\tif(s[i])\n\t\t\tprintf(\"%c\",s[i]);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "3e5e2c224bc3e331dbe14c539a9446ad", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "9f12f9addb7bc8101243ba1419ace0b5", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.998324958123953, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\n#define p printf\n\tchar a[1444],u,at;\n\tint i,j;\nint main(){\n\tscanf(\"%s\",a);\n\tu=strlen(a);\n\tif(a[1]=='a' && a[2]=='t'){\n\t\tp(\"%c@\",a[0]);\n\t\tj=3;at++;\n\t}\n\telse if(a[0]=='d' && a[1]=='o' && a[2]=='t'){\n\t\tp(\"dot\");\n\t\tj=3;\n\t}\n\tif(a[0]=='a' && a[1]=='t'){\n\t\tp(\"at\");\n\t\tj=2;\n\t}\n\tfor(i=j;i\n#include \n#include \n\nint main(){\n\n\tchar mail[110], aux[110];\n\tint i, j, sz;\n\t\n\tfgets( mail, 100, stdin );\n\tsz = strlen(mail);\n\tmail[sz-1] = mail[sz];\n\ti = 1, j = 1;\n\taux[0] = mail[0];\n\t\n\twhile( !(mail[i] == 'a' && mail[i+1] == 't') ) aux[j++] = mail[i++];\n\taux[j++] = '@';\n\ti += 2;\n\n\twhile( mail[i] ) aux[j++] = mail[i++];\n\taux[j] = mail[i];\n\tsz = j;\n\t\n\ti = 1, j = 1;\n\t\n\tmail[0] = aux[0];\n\t\n\twhile( (i+2) < (sz-1) ){\n\t\tif( aux[i] == 'd' && aux[i+1] == 'o' && aux[i+2] == 't' ){\n\t\t\tmail[j++] = '.';\n\t\t\ti += 3;\n\t\t} else mail[j++] = aux[i++];\n\t}\n\t\n\twhile( aux[i] ) mail[j++] = aux[i++];\n\tmail[j] = aux[i];\n\t\n\tputs( mail );\n\t\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "f8a5cc0284d38a97269c527836a87180", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "96d2e6a5971572b285a7f847c660f057", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9979423868312757, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint i,n,f;\nchar arr[1000];\nint main(){\n\tscanf(\"%s\",arr);\n\tn = strlen(arr);\n\tif(arr[0] == 'd' && arr[1] == 'o' && arr[2] == 't')\n\t\tprintf(\"dot\"),i=3;\n\telse if(arr[0] == 'a' && arr[1] == 't')\n\t\tprintf(\"at\"),i=2;\n\n\tfor(;i\n#include \n\n\nint main(){\n int j, i, a, len;\n char s[101];\n char e[101];\n\n scanf(\"%s\", &s);\n len = strlen(s);\n\n e[0] = s[0];\n j = 1;\n a = 0;\n for(i=1; i < len; i++){\n if(!a && (s[i] == 'a') && (s[i+1] == 't')){\n a = 1;\n e[j++] = '@';\n i += 1;\n }else if((i < (len-3)) && (s[i] == 'd') && (s[i+1] == 'o') && (s[i+2] == 't')){\n e[j++] = '.';\n i += 2;\n }\n else\n e[j++] = s[i];\n }\n e[i] = '\\0';\n printf(\"%s\\n\", e);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4abbb883232f58c52f94b6511d4e87ae", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "51f3aa06a2237f51d20737991fc79cc5", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.23946360153256704, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "#include\n#include\nint main()\n{\nchar str1[101],str2[101];\nint i,j;\nscanf(\"%s\",&str1);\nscanf(\"%s\",&str2);\nif(strlen(str1)!=strlen(str2))\n {\n printf(\"NO\\n\");\n return 0;\n }\nelse\n {\n for(i=0,j=strlen(str2)-1;i=0;i++,j--)\n if(str1[i]!=str2[j])\n break;\n }\nif(i!=strlen(str1))\n printf(\"NO\\n\");\nelse\n printf(\"YES\\n\");\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "dbbd153cbd4cf4b93e7ad7ec947f9a5e", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "e85117b2b03242617e8a2177223c005a", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9923076923076923, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main()\n{\n int n,m,a,b,s;\n scanf(\"%d%d%d%d\",&n,&m,&a,&b);\n if((float)a<=(float)b/(float)m) { printf(\"%d\",n*a); return 1;}\n if(n*a>=b&&n<=m) {printf(\"%d\",b); return 2;}\n else printf(\"%d\",((n/m)*b)+((((n%m)*a)>b)?b:((n%m)*a)));\n //printf(\"%d\",((float)a<=(float)b/m)?n*a:((n>m)?(n/m)*b:1)+((((n%m)*a)>b)?1:(n%m)*a));\n return 3;\n}", "lang": "GNU C", "bug_code_uid": "e440fdbeab3ed6cd28916dc9e02d586f", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "472190768166bc747a548ad3dbddf6d3", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.257411424439624, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nint a[35], d[35];\nint main(){\n int n, m;\n scanf(\"%d %d\", &n, &m);\n for (int i=0; id[i-1]%m) d[i]=(a[i]+d[i-1])%m;\n else d[i]=d[i-1]%m;\n }\n printf(\"%d\\n\", d[n-1]);\n}\n", "lang": "GNU C", "bug_code_uid": "d76fdb7c44283906ecdb347b9cd4cadc", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "b19e63d5e1a5f04ffdd3b76e7bb92e13", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7805104408352668, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \nint a[35], n, m, arr1[1<<20], arr2[1<<20];\nint idx1, idx2;\nint max(int a, int b){if (a ans) ans=tmp;\n while(j\n#include \nint a[35], n, m, arr1[1<<18], arr2[1<<18];\nint idx1, idx2;\nint max(int a, int b){if (a ans) ans=tmp;\n while(arr2[j]==arr2[j+1]) j++;\n }\n while(arr1[i]==arr1[i+1]) i++;\n }\n\n printf(\"%d\\n\", ans);\n}\n", "lang": "GNU C", "bug_code_uid": "d65b9785e071bd13c90b5478820e01d6", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "b19e63d5e1a5f04ffdd3b76e7bb92e13", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994579945799458, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \"stdio.h\"\n#include \"stdlib.h\"\n\nvoid sort(long long int *t, int n)\n{\n int ok, i, aux;\n do {\n ok = 1;\n for (i = 1; i < n; i++) {\n if (t[i - 1] < t[i]) {\n aux = t[i];\n t[i] = t[i - 1];\n t[i - 1] = aux;\n ok = 0;\n }\n }\n\n } while (!ok);\n}\n\nint compare(long long int *a, long long int *b) {\n long long int aa = *a;\n long long int bb = *b;\n if (aa == bb) {\n return 0;\n }\n\n return aa < bb ? 1 : -1;\n}\n\nint main() {\n int n, i;\n scanf(\"%d\", &n);\n\n long long int *t;\n\n t = (long long int *) malloc(sizeof(long long int) * n);\n\n for (i = 0; i < n; i++) {\n scanf(\"%I64d\", &t[i]);\n }\n\n // qsort(t, n, sizeof(t), &compare);\n sort(t, n);\n\n unsigned long long int sum = t[0];\n for (i = 1; i < n; i++) {\n if (t[i] >= t[i - 1]) {\n if (t[i - 1] > 0) {\n t[i] = t[i - 1] - 1;\n } else {\n t[i] = 0;\n }\n }\n\n sum += t[i];\n }\n\n printf(\"%Id \", sum);\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "5eab438194ec37ccace0301460123167", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "fabd5b921dad0a52ad05346ae622ce0b", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.49246231155778897, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\nchar a[105];\nint i,l;\nscanf(\"%s\",a);\nl=strlen(a);\nfor(i=0;a[i]!='h';i++);\ni++;\nwhile(a[i]!='e'&&il)\n{printf(\"NO\");exit(0);}\nprintf(\"YES\");\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "970fa66703644edb8c6d618c91e302e9", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "8bde9c3a40fcdf67f4821b3dfadc2a74", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.999259807549963, "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\tint i , size , found= 0;\n\tchar str[10];\n\tscanf(\"%s\",str);\n\tsize = strlen (str) -1 ;\n\tfor(i=0;i\n#include \nconst int N=1e5+10;\nlong long int x, i, n, a = 1;\nlong long int k (long long int x, long long int p)\n{\n\tlong long int s = 1;\n\twhile (p)\n\t{\n\t\tif (p % 2)\n\t\t\ts = s * x % N;\n\t\tp /= 2;\n\t\tx = x * x % N;\n\t}\n return s;\n}\nlong long int d (long long int p)\n{\n\tlong long int m = n, sum = 0;\n\twhile (m)\n\t\tsum += m /= p;\n\treturn k(p, sum);\n}\nint main()\n{\n\tscanf(\"%lld%lld\", &x, &n);\n\tfor (i = 2; i * i <= x; i++)\n\t\tif (x % i == 0)\n\t\t{\n\t\t\ta = a * d(i) % N;\n\t\t\twhile (x % i == 0)\n\t\t\t\tx /= i;\n\t\t}\n\tif (x != 1)\n\t\ta = a * d(x) % N;\n\tprintf(\"%lld\", a);\n}", "lang": "GNU C11", "bug_code_uid": "92587324ed254960a52d5e05a3824e53", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "d7cc9f72b934eb11754c6a7cbe22c82f", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9874776386404294, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \nconst int N=1e5+10;\nlong long int x, i, n, a = 1;\nlong long int k (long long int x, long long int p)\n{\n\tlong long int s = 1;\n\twhile (p)\n\t{\n\t\tif (p % 2)\n\t\t\ts = s * x % N;\n\t\tp /= 2;\n\t\tx = x * x % N;\n\t}\n return s;\n}\nlong long int d (long long int p)\n{\n\tlong long int m = n, sum = 0;\n\twhile (m)\n\t\tsum += m /= p;\n\treturn k(p, sum);\n}\nint main()\n{\n\tscanf(\"%lld%lld\", &x, &n);\n\tfor (i = 2; i * i <= x; i++)\n\t\tif (x % i == 0)\n\t\t{\n\t\t\ta = a * d(i) % N;\n\t\t\twhile (x % i == 0)\n\t\t\t\tx /= i;\n\t\t}\n\tif (x != 1)\n\t\ta = a * d(x) % N;\n\tprintf(\"%lld\", a);\n}", "lang": "GNU C11", "bug_code_uid": "a51b1f4151008b1e2b3d74d78b31cbcb", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "d7cc9f72b934eb11754c6a7cbe22c82f", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9845944721341187, "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#include \n#include \n#include \ntypedef long long ll;\n\nll MAX = 100000000000; // 1e11\nll MIN = -100000000000; // -1e11\nll MOD = 1000000007;\n\nll longlongmax = __LONG_LONG_MAX__;\n\nll maxormin(ll a, ll b, ll flag)\n{\n return flag == 1 ? (a > b ? a : b) : (a < b ? a : b);\n}\n\nll overflowcheck(ll a)\n{\n if (a == 1)\n {\n return 0;\n }\n else\n {\n ll temp = a;\n ll power = 1;\n while (longlongmax / temp > a)\n {\n temp *= a;\n power++;\n }\n return power + 1; // Overflow occurs at this power.\n }\n}\n\nll merge(ll A[], ll B[], ll left, ll mid, ll right)\n{\n ll count = 0;\n ll n1 = mid - left + 1;\n ll n2 = right - mid;\n\n ll LA[n1], LB[n1], RA[n1], RB[n2];\n\n for (ll n = 0; n < n1; n++)\n {\n LA[n] = A[n + left];\n LB[n] = B[n + left];\n }\n for (ll n = 0; n < n2; n++)\n {\n RA[n] = A[n + mid + 1];\n RB[n] = B[n + mid + 1];\n }\n\n ll i = 0, j = 0, k = left;\n\n while (i < n1 && j < n2)\n {\n if (LA[i] < RA[j])\n {\n A[k] = LA[i];\n B[k] = LB[i];\n i++;\n }\n else\n {\n A[k] = RA[j];\n B[k] = RB[j];\n count += n1 - i;\n j++;\n }\n k++;\n }\n while (i < n1)\n {\n A[k] = LA[i];\n B[k] = LB[i];\n i++;\n k++;\n }\n\n while (j < n2)\n {\n A[k] = RA[j];\n B[k] = RB[j];\n j++;\n k++;\n }\n return count;\n}\n\nll mergesort(ll A[], ll B[], ll left, ll right)\n{\n ll total = 0;\n if (left < right)\n {\n ll mid = (right - left) / 2 + left;\n total += mergesort(A, B, left, mid);\n total += mergesort(A, B, mid + 1, right);\n total += merge(A, B, left, mid, right);\n }\n return total;\n}\n\nll primemarked[3000000];\nll primearray[3000000];\nll primeind;\n\nvoid setupprimes()\n{\n for (ll i = 2; i < 3000000; i++)\n {\n for (ll j = 2 * i; j < 3000000; j += i)\n {\n primemarked[j] = 1;\n }\n }\n for (ll i = 2; i < 3000000; i++)\n {\n if (!primemarked[i])\n {\n primearray[primeind++] = i;\n }\n }\n}\n\nll power(ll x, ll y, ll p)\n{\n ll res = 1; // Initialize result\n\n x = x % p; // Update x if it is more than or\n // equal to p\n\n while (y > 0)\n {\n // If y is odd, multiply x with result\n if (y & 1)\n res = (res * x) % p;\n\n // y must be even now\n y = y >> 1; // y = y/2\n x = (x * x) % p;\n }\n return res;\n}\n\nll factorsX[3000000];\nll ind = 0;\n\nint main(int argc, char const *argv[])\n{\n ll T = 1;\n // scanf(\"%lld\",&T);\n setupprimes();\n \n \n for (ll t = 0; t < T; t++)\n {\n ll x, N;\n scanf(\"%lld %lld\", &x, &N);\n for (ll j = 0; j < primeind; j++)\n {\n if ((x % primearray[j]) == 0)\n {\n factorsX[ind++] = primearray[j];\n }\n }\n if (!ind)\n {\n // a prime itself\n factorsX[ind++] = x;\n }\n \n ll total = 1;\n // printf(\"%lldpopop\\n\",longlongmax/947);\n for (ll o = 0; o < ind; o++)\n {\n // for each prime factor calculate\n ll count[300];\n ll cind = 0;\n ll fac = factorsX[o];\n ll p = 1;\n ll gh = 1;\n while (p <= N && gh)\n {\n // printf(\"%lld\\n\",p);\n count[cind++] = N / p;\n if( p >= longlongmax/fac)\n {\n gh = 0;\n }\n p *= fac;\n }\n \n for (ll m = 0; m < cind; m++)\n {\n ll num = 1;\n ll prod ;\n\n if(m!=(cind-1))\n {\n num = (m*(count[m]-count[m+1]))%(MOD-1);\n }\n else\n {\n num = (m*count[m])%(MOD-1);\n }\n // printf(\"%lld\\n\",num);\n prod = power(factorsX[o],num,MOD);\n total = (total*prod)%MOD;\n total %= MOD;\n }\n }\n printf(\"%lld\\n\",total%MOD);\n }\n\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "6ef96b7bad15984d3a21a49eadb3a6eb", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "14059ad01adc4695c1889452ed3d774e", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9400966183574879, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include \n#include\n#include \n#include\n#define MAXN 65\n#define MAXNUM 10010\n\nint main(){\n char s[100005];\n scanf(\"%s\",s);\n int i=0,cn1=0,cn2=0,q1=0,q2=0,kk[26]={0};\n while (s[i]!='\\0') {\n if(s[i]=='?'){\n if(i==0)\n q1=1;\n cn1++;\n }\n else if(isalpha(s[i])){\n if(i==0)\n q2=1;\n if(kk[s[i]-'A']==0){\n kk[s[i]-'A']=1;\n cn2++;\n }\n }\n i++;\n }\n long long int u=1;\n if(cn1){\n if(q1){\n u*=9;\n }\n else{\n u*=10;\n }\n cn1--;\n i=9;\n while (cn1>0) {\n u*=i;\n cn1--;\n }\n }\n if(cn2){\n if(q2){\n u*=9;\n }\n else{\n u*=10;\n }\n cn2--;\n i=9;\n while (cn2>0) {\n u*=i;\n cn2--;\n }\n }\n printf(\"%lld\\n\",u);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "a306a224593c46dfe5721e3746e9de2c", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "59b7daf2d20043b7694b670f266415e9", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9986263736263736, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint main()\n{\nint i,q,j,t,n,p=10,sum=1;\nchar s[7],temp;\nscanf(\"%s\",s);\nn=strlen(s);\n if((int)s[0]<63)\n{\nq=0;\n}\n\nfor(i=0;i(int)s[j])\n {\n\n temp=s[i];\n s[i]=s[j];\n s[j]=temp;\n }\n }\n }\n\nif((int)s[0]<63)\n sum=1;\nelse if(s[0]=='?')\n{sum=9;\n}\nelse\n{sum=9;\np=9;\n}\n\nfor(i=1;i63&&(s[i]!=s[i-1]))\n {\n sum=sum*p;\n p--;\n }\n\n}\nif(q!=0&&(int)s[0]<62)\n sum=(sum/10)*9;\nprintf(\"%d\",sum);\nreturn(0);\n\n}\n", "lang": "GNU C", "bug_code_uid": "05624d972507b20c0d6503042b581790", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "916e2c80e43caf6697ebda89c05d08d8", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5533869115958668, "equal_cnt": 65, "replace_cnt": 64, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 64, "bug_source_code": "#include\n#include\nint main()\n{\n\tchar a[100100],c;\n\tint i,sum;\n\tint num[26],flag1,flag2,num1,sum1,k,h,total;\n\twhile(scanf(\"%s\",a)!=EOF)\n\t{\n\t\tsum=0;\n\t\tmemset(num,0,sizeof(num));\n\t\tfor(i=0;a[i];i++)\n\t\t\tif(a[i] != '0')\n\t\t\t\tbreak;\n\t\tif(a[i] ==0)\n\t\t{\n\t\t\tprintf(\"1\\n\");\n\t\t\tcontinue;\n\t\t}\n\t\tflag1=0;\n\t\tflag2=0;\n\t\tnum1=0;\n\t\tif(a[i] == '?')\n\t\t\tflag1=1;\n\t\telse if(a[i]>='A' && a[i] <='J')\n\t\t{\n\t\t\tflag2=1;\n\t\t\tc=a[i];\n\t\t}\n\t\tfor(;a[i];i++)\n\t\t{\n\t\t\tif(a[i]>='A' && a[i]<='J')\n\t\t\t{\n\t\t\t\tif(num[a[i] -'A'] == 0)\n\t\t\t\t\tnum1++;\n\t\t\t\tnum[a[i] -'A']++;\n\t\t\t}\n\t\t\telse if(a[i] == '?')\n\t\t\t\tsum++;\n\t\t}\n\t\tif(flag1 == 1)\n\t\t\ttotal = sum *9;\n\t\telse\n\t\t\ttotal = sum*10;\n\t\tif(flag2 == 1)\n\t\t{\n\t\t\th=2;\n\t\t\tsum1=9;\n\t\t\tk=9;\n\t\t\tfor(;h<=num1;h++)\n\t\t\t{\n\t\t\t\tsum1*=k;\n\t\t\t\tk--;\n\t\t\t}\n\t\t\ttotal *= sum1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsum1=1;\n\t\t\tk=10;\n\t\t\tfor(h=1;h<=num1;h++)\n\t\t\t{\n\t\t\t\tsum1*=k;\n\t\t\t\tk--;\n\t\t\t}\n\t\t\ttotal *= sum1;\n\t\t}\n\t\tif(total ==0)\n\t\t\tprintf();\n\t\tprintf(\"%d\\n\",total);\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "f82d7cdadd60f2d22a2be5576e85ad73", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "b37d1177d4909f20de3ce7858274b4d7", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9979723858260114, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nusing namespace std;\nint a[10][260]=\n{\n{0},\n{2,1},\n{32,30,80,109},\n{6824,59808,147224,415870,1757896,1897056,4898872,7593125},\n{776830421,290516100,746623577,293783147,33900006,735127505,565460332,428982705,472062098,161873957,117354594,515619293,578944191,312106242,569389279,391464593},\n{261086313,584837659,683961846,468868529,211593382,736955478,229471758,157617135,398169441,360252438,629394768,264125799,647490480,342079395,391579767,225200475,486011304,513156108,628771752,132906648,142138221,20119449,444199674,195188679,387329805,44684703,651912135,737154512,612549793,519860281,186175544,212568440},\n{240805271,239509872,581127897,6511239,156126222,509425833,672407328,366667722,459185405,509737025,554790222,165216555,703150560,74806569,398730015,383350905,506108358,51326142,298053147,104256117,391428765,374020479,206607807,87664059,275899176,56407680,551553401,448939463,582889860,129676638,226078251,135769095,61292868,578972226,190181628,390739055,184587732,446575689,732674124,232198470,676760679,352474101,611444862,575661807,628905585,320813094,522840969,469781928,156006018,554473341,239654268,643714911,433540170,199307003,496385218,291740751,67309914,370826673,202356819,279421821,421203111,63744786,520987612,550671827},\n{482164403,768209115,462063756,154906374,36099042,341766705,678182556,621882744,478771358,231881111,175889805,243630450,168908523,671961765,55761813,652682670,773939082,517628076,756201264,124604900,750976272,498253248,676047609,137170026,705610017,495032139,561797418,703097347,500815609,95984586,739707108,265613565,387099846,777331779,594676173,591219559,407997044,208947235,93337440,478908360,685013007,487033953,671903001,39521181,738490312,33785059,465470131,310453920,54648783,346831137,427694175,474743430,705296781,435828036,429824745,663532359,261388683,244690731,533997135,596108961,506813013,371892402,590145264,104733162,143420103,654339672,700348950,685038942,578826927,286484229,501639192,434962491,299270097,27702486,335375775,111746817,565603164,294926121,676063665,735862995,710035809,437011960,668528077,138765186,508213986,615036450,353784942,624827616,343900011,241289776,52410890,72018835,352406796,415705878,4802637,376367145,65589678,333633477,341834527,303717460,282387700,42951006,254706039,423048528,526429710,68131467,669954708,12787348,500636381,317959019,479433192,657133515,416259390,610216692,340129188,44594256,257373347,138718678,530767740,292922628,37220268,605295159,480722613,458170419,30540300,487159055,232966794,149150650},\n{412133651,386543325,139952108,289303402,102404925,317067177,396414708,80515854,663739304,317300809,228877044,493725043,715317967,490300965,315527373,743539734,488329191,553627998,533025234,242583957,706116537,614109258,645447222,523195911,492109128,722623041,111085128,766395126,654378921,691964847,496688157,399056049,654363234,102052314,191720088,473910948,259736526,332840025,388047555,665791056,627111387,139696515,441456687,443032569,283264821,771641703,452641455,511306362,117572859,127701891,721298331,176520078,357242229,611296308,696994956,405628839,429224274,465336054,695091546,689828796,574648641,351220905,507964023,675326610,517248963,453528621,220301928,494463186,681789969,339589656,44524053,417125457,339589404,747135963,341780733,734158215,396817281,21997836,5728464,147611205,456248898,714128667,377654949,3862068,128418948,589390074,304947090,11703825,228266073,127304142,429215724,361541124,521572968,468358191,341231688,65323503,613778508,15985323,291661029,410970006,591638112,349541550,89967528,224922159,361094166,584206074,640051812,324264456,652625388,693768537,11740617,309238398,211085469,194905872,639416484,110110707,296645895,748118511,131177718,511142751,775975599,421403409,475528473,434685258,1768977,80301375,708023862,569195676,56238084,632887668,88089750,631539342,396695565,38780154,695798271,469819224,439587099,69045921,682966116,112310856,64943298,534475872,40215357,389728458,286368453,736006257,501181650,54829908,603489402,338032656,512182818,627500097,462674016,3103092,157324491,43978329,596818971,259025598,9088632,91991781,577291428,211245489,429471231,142626330,172560633,510907446,444609585,758102058,375112647,744786693,276174402,19259856,233672418,745389414,225772848,23385663,324290610,519804558,120337812,402578568,360676008,450089262,551043738,337388940,512108856,28879011,690040638,106017282,558262341,99972432,608226003,612152037,42414435,776201013,39580443,518796945,494437752,583194366,723936555,415359657,309569589,751104774,166684527,249229170,353120823,130668327,753823584,580966092,561963717,543672234,393846327,586278000,327398400,278403867,156455586,363920382,190245195,290039148,547014447,466218648,146037150,585462906,666008595,691786683,374707494,622498779,231158277,685740951,115612245,681825249,545555745,551718468,277206615,640171035,757727334,195193908,658656684,457760646,225925875,505761984,18685233,506832921,112511021,396846646,290147622,113924623,669986155,336008070,63611061,238586775,119956662,616557739,772784623,334527774,410403148,51933421}\n};\nint main()\n{\n int n,k;\n scanf(\"%d %d\",&n,&k);\n int p=0;\n while ((1<\n\nint main()\n{\n\tint z=100000000,i,j,k,s,t,q,r,a[4],b[4],c[4];\n\tfor(i=0;i<3;i++) scanf(\"%d\",a+i);\n\tfor(i=0;i<3;i++) scanf(\"%d\",b+i);\n\tfor(i=0;i<3;i++) scanf(\"%d\",c+i);\n\t\n\tfor(j=0;j<=200;j++)\n\t{\n\t\ts=(a[1]+j)-b[2];//monster des\n\t\tif(s<=0) continue;\n\t\tq = b[0]/s;\n\t\tif(b[0]%s!=0) q++;\n\t\tfor(k=0;k<=200;k++)\n\t\t{\n\t\t\tt=b[1]-(a[2]+k);//mine des\n\t\t\tfor(i=0;i<=200&&i+a[0]<=q*t;i++);\n\t\t\tr=i*c[0]+j*c[1]+k*c[2];\n\t\t\tif(r\n#include \n\nint max(int ent1, int ent2)\n{\n if (ent1 > ent2)\n return ent1;\n\n return ent2;\n}\n\nint min(int ent1, int ent2)\n{\n if (ent1 > ent2)\n return ent2;\n\n return ent1;\n}\n\nint mini = 100000;\n\nvoid BF(int HPY, int ATKY, int DEFY, int HPM, int ATKM, int DEFM, int count)\n{\n if ((HPY > 201) || (ATKY > 201) || (DEFY > 201))\n return;\n\n if (ATKY <= DEFM)\n return;\n\n while(HPM > 0 && HPY > 0)\n {\n HPY -= max(0,ATKM-DEFY);\n HPM -= max(0,ATKY-DEFM);\n }\n\n if (HPY > 0)\n {\n mini = min(count,mini);\n return;\n }\n}\n\nint main()\n{\n int HPY,ATKY,DEFY;\n int HPM,ATKM,DEFM;\n int h,a,d;\n\n //sscanf(\"76 63 14 89 87 35 20 15 56\", \"%d %d %d %d %d %d %d %d %d\", &HPY, &ATKY, &DEFY, &HPM, &ATKM, &DEFM, &h, &a, &d);\n\n\n\n\n scanf(\"%d %d %d\", &HPY, &ATKY, &DEFY);\n scanf(\"%d %d %d\", &HPM, &ATKM, &DEFM);\n scanf(\"%d %d %d\", &h, &a, &d);\n\n int i,j,k;\n for (i = 0;i<=200;++i)\n {\n for (j = 0;j<=200;++j)\n {\n for (k = 0;k<=200;++k)\n {\n BF(HPY+i,ATKY+j,DEFY+k,HPM,ATKM,DEFM,i*h+j*a+k*d);\n }\n }\n }\n\n printf(\"%d\\n\", mini);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4ac3e60360fd9d5feff37ef894913250", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "ad4b1f3a8b9f3e1f4f252e1a2740c323", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.09500351864883885, "equal_cnt": 28, "replace_cnt": 21, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 28, "bug_source_code": "#include \n\nint max(int a, int b)\n{\n return (a>b) ? a : b;\n}\n\nint min(int a, int b)\n{\n return (a>b) ? b : a;\n}\n\nint main()\n{\n int HPY,ATKY,DEFY;\n int HPM,ATKM,DEFM;\n int addDEF = 0;\n int count = 0;\n int mini = 1000001;\n int h,a,d;\n\n scanf(\"%d %d %d\", &HPY, &ATKY, &DEFY);\n scanf(\"%d %d %d\", &HPM, &ATKM, &DEFM);\n scanf(\"%d %d %d\", &h, &a, &d);\n\n int i;\n int HPYS = HPY,ATKYS = ATKY,DEFYS = DEFY;\n int HPMS = HPM,ATKMS = ATKM,DEFMS = DEFM;\n /* Increase attaque every time */\n for (i=0;i<100;++i)\n {\n count += a*i;\n\n while (HPM > 0)\n {\n if (HPY < (ATKM-DEFY))\n {\n while (max(0,ATKM-(DEFY+addDEF)) >= HPY)\n ++addDEF;\n\n if ((max(0, ATKM-DEFY)-(HPY)+1)*h < addDEF*d)\n {\n count += (max(0, ATKM-DEFY)-(HPY)+1)*h;\n HPY += max(0, ATKM-DEFY)-(HPY)+1;\n addDEF = 0;\n }\n else\n {\n count += addDEF*d;\n DEFY += addDEF;\n addDEF = 0;\n }\n }\n\n HPM -= max(0, ATKY+i-DEFM);\n HPY -= max(0, ATKM-DEFY);\n }\n\n if (HPY > 0)\n mini = min(mini, count);\n\n HPY = HPYS,ATKY = ATKYS,DEFY = DEFYS;\n HPM = HPMS,ATKM = ATKMS,DEFM = DEFMS;\n\n count = 0;\n }\n\n printf(\"%d\\n\", mini);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "604f53951b4f6d002c15e784003466d6", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "ad4b1f3a8b9f3e1f4f252e1a2740c323", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4620355411954766, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n\n\nint main() {\n\tint x, y, r, a;\n\tscanf_s(\"%d\",&r);\n\tr = r - 1;\n\ty = (r - 2) / 2;\n\tx = 0;\n\twhile (++x) {\n\t\tif (x * (x + (2 * y) + 1) == r) {\n\t\t\tprintf(\"%d %d\", x, y);\n\t\t\tbreak;\n\t\t}\n\t\telse if (x * (x + (2 * y) + 1) > r) {\n\t\t\tputs(\"NO\");\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "5f7d117ef2e88da4c6c7f0f188d5785e", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "f42329bdcc98154d5cd02a1008e3b8da", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9839228295819936, "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 x,i;\n double y,b,r;\n scanf(\"%lf\",&r);\n for(x=1;x<12;x=x+1)\n {\n y=(r-x*x-x-1)/(2*x);\n\n if((int)y == y&&y>0){\n printf(\"%lld %lld\",x,(long long int)y);\n return 0;\n }\n }\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "86aac4d640dfce7c019ab818bdfffb15", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "2c625eeec97f7f1e9e28a9186a9f6baa", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9179229480737019, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int x,i;\n double y,b,r;\n scanf(\"%lf\",&r);\n for(x=1;x0){\n printf(\"%d %d\",x,(int)y);\n return 0;\n }\n }\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "dbc73034ed8dbffd6ba670a6f48dc72d", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "2c625eeec97f7f1e9e28a9186a9f6baa", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.48312611012433393, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n long long int i,n,s=0,j=0;\n scanf(\"%lld\",&n);\n for(i=1;i\n#include\n#define MAXN 1000000000001\nusing namespace std;\nint main()\n{\n\tlong long f=0,r,y;\n\tscanf(\"%lld\",&r);\n\tfor(long long i=1;i=r)\tbreak;\n\t\tif((r-i*i-i-1)%(2*i)==0)\n\t\t{\n\t\t\ty=(r-i*i-i-1)/(2*i),f=1;\n\t\t\tprintf(\"%lld %lld\",i,y);\n\t\t}\t\n\t\tif(f)\tbreak;\n\t}\n\tif(!f)\tprintf(\"NO\\n\");\n\t\t\n } \n", "lang": "GNU C11", "bug_code_uid": "14844c227bd1a927534546a3926ba49c", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "bf342accf56f6b94a25f9c9d9c1d836c", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8638036809815951, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main(){\nlong long int r;\nscanf(\"%lld\",&r);\nlong long int x=1,y=1,f=0;\n\nlong long int j=x;\nlong long int k=y;\nfor(j=1;j<=r-1;j++)\n{\n for(k=1;k<=r-1;k++)\n {\n if((j)*(j+(2*k)+1)==r-1)\n {\n f=1;\n break;\n }\n }\n if(f==1)\n break;\n}\nif(f)\nprintf(\"%lld %lld\",j,k);\nelse printf(\"NO\");\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "aef3f25e9679537a61e1af6cfb431fa2", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "6ad0a0c5275fe23d1ee26532ff529445", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9754768392370572, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main(void)\n{\nlong int r,x,y;\nscanf(\"%ld\",&r);\n\ty = ( r - 3 )/2;\n\nif( r % 2 == 0 || y == 0 )\n{\nprintf(\"NO\\n\");\n}\nelse\n{\nx = 1;\nprintf(\"1 %ld\",y);\n}\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "1aa58b2bcfba47a1bcd4a0475f2e2672", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "520319d4705fab90bb5d2d511967c07f", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9635036496350365, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{ int a;\n scanf(\"%d\",a);\n if(a%2)\n printf(\"No\");\n else\n printf(\"Yes\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "2cf1087812ca0e1cf59b13d3216bcdba", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3fd9a490573f28113f9144c7d9ea189a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9125475285171103, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n \nmain(){\n int n;\n scanf(\"%d\",&n);\n if(n%2==0)\n printf(\"YES\");\n else\n printf(\"NO\");\n\n return 1;\n}", "lang": "GNU C11", "bug_code_uid": "415798278db077505e9734d94e00b23e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "32f2464deb11092191635b4538857b95", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7113543091655267, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\n\nint main(){\n\tint r, x1, y1, x2, y2;\n\tint n;\n\n\tscanf(\"%d%d%d%d%d\", &r, &x1, &y1, &x2, &y2);\n\n\tfor (n = 0; n < 100000000000; n++){\n\t\tunsigned long temp1 = (unsigned long)(x2 - x1)*(unsigned long)(x2 - x1) + (unsigned long)(y2 - y1)*(unsigned long)(y2 - y1);\n\t\tunsigned long temp2 = (unsigned long)(4 * r*r*n*n);\n\t\tif ( temp1 <= temp2){\n\t\tprintf(\"%d\", n);\n\t\treturn 0;\n\t}\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ee7497c1d80dc49a0b466eb4dd658e6f", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "37da912d1da49f4aa721367c3effd440", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5204555040067482, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "/* practice with Dukkha */\n#include \n\n#define N\t10\n#define MD\t1000000007\n\nint main() {\n\tstatic char cc[N + 1];\n\tstatic int cnt[N + 1], ch[N][N], p2[N], p8[N];\n\tint n, m, h, i, j, k, k1, k2, r, p;\n\tlong long b, ans;\n\tchar tmp, d;\n\n\tscanf(\"%d\", &m), m++;\n\tn = 0;\n\twhile (m > 0) {\n\t\tcc[n++] = m % 10 + '0';\n\t\tm /= 10;\n\t}\n\tch[0][0] = 1;\n\tp2[0] = p8[0] = 1;\n\tfor (i = 1; i < n; i++) {\n\t\tch[i][0] = 1;\n\t\tfor (j = 1; j < n; j++)\n\t\t\tch[i][j] = ch[i - 1][j] + ch[i - 1][j - 1];\n\t\tp2[i] = p2[i - 1] * 2;\n\t\tp8[i] = p8[i - 1] * 8;\n\t}\n\tfor (i = 0, j = n - 1; i < j; i++, j--)\n\t\ttmp = cc[i], cc[i] = cc[j], cc[j] = tmp;\n\tfor (i = 0; i < n; i++) {\n\t\tk = 0;\n\t\tfor (h = 0; h < i; h++)\n\t\t\tif (cc[h] == '4' || cc[h] == '7')\n\t\t\t\th++;\n\t\tfor (d = '0'; d < cc[i]; d++) {\n\t\t\tk1 = k + (d == '4' || d == '7');\n\t\t\tr = n - 1 - i;\n\t\t\tfor (k2 = 0; k2 <= r; k2++)\n\t\t\t\tcnt[k1 + k2] += ch[r][k2] * p2[k2] * p8[r - k2];\n\t\t}\n\t}\n\tcnt[0]--;\n\tans = 0;\n\tfor (k = 0, p = 0; k <= n; p += cnt[k++]) {\n\t\tb = 1;\n\t\tfor (h = 0; h < 6; h++)\n\t\t\tb = b * (p - h) % MD;\n\t\tans = (ans + cnt[k] * b) % MD;\n\t}\n\tprintf(\"%lld\\n\", ans);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "4d0bcb45b4c25b0ec3bd4c6d4c03ff83", "src_uid": "656ed7b1b80de84d65a253e5d14d62a9", "apr_id": "35795ecccd1b9661af5b93012e5e8668", "difficulty": 1900, "tags": ["brute force", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6389189189189189, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include \n\nconst int mod = (int)1e9 + 7;\n\nlong long choose(long long n, int k) {\n if (k > n) {\n return 0;\n }\n \n long long p = 1;\n for (long long i = n; i > n - k; i--) {\n p *= i;\n p %= mod;\n }\n \n return p;\n}\n\nint main(void) {\n int m;\n scanf(\"%i\", &m);\n \n char s[50];\n sprintf(s, \"%i\", m);\n \n int len = strlen(s);\n long long f[len+1][len+1][2];\n\n memset(f, 0, sizeof(f));\n\n f[0][0][1] = 1;\n for (int i = 0; i < len; i++) {\n for (int j = 0; j <= len; j++) {\n for (int eq = 0; eq <= 1; eq++) {\n long long cur = f[i][j][eq];\n for (char d = '0'; d <= '9'; d++) {\n if (eq && d > s[i]) {\n continue;\n } \n int n_eq = eq && (d == s[i]);\n int is_lucky = (d == '4' || d == '7') ? 1 : 0;\n f[i+1][j+is_lucky][n_eq] += cur;\n f[i+1][j+is_lucky][n_eq] %= mod;\n }\n }\n }\n }\n\n long long counts[len+1];\n for (int i = 0; i <= len; i++) {\n counts[i] = f[len][i][0] + f[len][i][1];\n counts[i] %= mod;\n }\n counts[0] = (counts[0] + mod - 1) % mod;\n \n long long ans = 0;\n for (int i = 1; i <= len; i++) {\n long long tot = 0;\n for (int j = 0; j < i; j++) {\n tot += counts[j];\n }\n long long nways = counts[i] * choose(tot, 6) % mod;\n ans += nways;\n ans %= mod;\n }\n \n printf(\"%lld\\n\", ans);\n \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "684f89d52abc86f0e1332f91cb2a1313", "src_uid": "656ed7b1b80de84d65a253e5d14d62a9", "apr_id": "29c59737d560a4adc3d80ef156a17279", "difficulty": 1900, "tags": ["brute force", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9987654320987654, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \nint main(int argc,char** argv){\n\tint numberofcommand;\n\tchar sourcecode[120];\n\tlong long unsigned int result=0;\n\tlong long unsigned int counter=0;\n\t//int skip[120];\n\t//int counterofskip=0;\n\n\t//skip[0]=-1;\n\tscanf(\"%d\",&numberofcommand);\n\tscanf(\"%s\",sourcecode);\n\tfor(int i=0;i\nint main()\n{\n int n,i,c=0;\n char s[201];\n scanf(\"%d%s\",&n,s);\n for(i=0; i\n//#include\n\nusing namespace std;\n\nint main(void)\n{\n int k,i,j,conv,flag,q;\n scanf(\"%d\",&k);\n int a[9]={0};\n flag=0;\n char str[5];\n for(i=0; i<4; i++)\n {\n scanf(\"%s\",str);\n // printf(\"\\n%s\",str);\n for(q=0; q<4; q++)\n {\n conv=str[q];\n // printf(\"\\n c=%c d=%d\",str[q],conv);\n switch(conv)\n {\n case 49 : a[0]++;\n break;\n case 50 : a[1]++;\n break;\n case 51 : a[2]++;\n break;\n case 52 : a[3]++;\n break;\n case 53 : a[4]++;\n break;\n case 54 : a[5]++;\n break;\n case 55 : a[6]++;\n break;\n case 56 : a[7]++;\n break;\n case 57 : a[8]++;\n break;\n case 46 : break;\n }\n // }\n }\n }\n k*=2;\n for(i=0; i<9; i++)\n {\n if(a[i]>k)\n {\n flag=1;\n break;\n }\n if(flag==1)\n break;\n }\n if(flag==1)\n printf(\"NO\");\n else\n printf(\"YES\");\n // getch();\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "52871321b6dbd5bf61307ece035bad9b", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "bffb3c5f7f3cadb1470ae56fa83f7d8c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6551226551226551, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main(){\nint bekci,n,x,y,z,i,j,dizi[4][4],arr[10];\nscanf(\"%d\",&x);\nfor(i=0 ; i<4 ; i++){\n\tfor(j=0 ; j<4 ; j++){\n\t\tscanf(\"%d\",&dizi[i][j]);\n\t\tif(dizi[i][j]=='.');\n\t\telse {\n\t\tarr[dizi[i][j]]++;}}}\nfor(i=1 ; i<10 ; i++){\n\tif(arr[i]<=2*x)\n\t\tbekci++;\n\telse if(arr[i]>2*x){\n\t\tprintf(\"NO\");\n\t\tbreak;}}\nif(bekci==9)\n\tprintf(\"YES\");\nreturn 0;}\n", "lang": "GNU C", "bug_code_uid": "8e91d569583fdeaf3e1aab03df401859", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "2ff689f2cffd059690b8db15af5a8bf8", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9983948635634029, "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,i,j,k,c=0;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++)\n {\n for(j=i;j<=n;j++)\n {\n k=i^j;\n if(k<=n&&i+j>k&&j+k>i&&k+i>j&&k>=i&&k>=j)\n {\n c++;\n }\n }\n }\n printf(\"%d\\n\",c);\n return 0;\n", "lang": "GNU C11", "bug_code_uid": "9fa2243a2e27af8f6d66ad89ae7fb44b", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "a1742270a7ea5cef9c3a650b559b17c9", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9671532846715328, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\n\n \n \nint main(){\nint i,j,k,n,ans=0,z;\n \nscanf(\"%d\",&n);\nfor(i=1;i<=n;i++){\n for(j=i;j<=n;j++){\n for(z=j;z<=n;z++)\n {\n \n if(!(i^j^z))\n ans+= i+j>z ;\n \n }\n \n }\n}\nprintf(\"%d\",ans);\n}", "lang": "GNU C11", "bug_code_uid": "72a944b121793ded64edd26a7e7f18ae", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "c891f2437a87615f6d48201844b9a7d7", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9895897121861604, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int n,flag=0,midindex=0,i,j,temp,k;\n scanf(\"%d\",&n);\n int a[1000];\n for(i=0;ia[j])\n midindex=j;\n }\n if(midindex!=i)\n {\n temp=a[midindex];\n a[midindex]=a[i];\n a[i]=temp;\n }\n }\n for(i=0;i0)\n printf(\"YES\");\n else\n printf(\"NO\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "ab604676a5818fa1952f0e396063bf7b", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "b2439bb5e4e8b7fdcc417c3854ec8a0e", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9313186813186813, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nconst int N = 50;\n\nint n;\nint arr[N];\n\nint main(){\n\tscanf(\"%d\",&n);\n\tfor(register int i=1;i<=n;i++) scanf(\"%d\",&arr[i]);\n\tfor(register int i=1;i<=n;i++){\n\t\tfor(register int j=1;j<=n;j++){\n\t\t\tfor(register int k=1;k<=n;k++){\n\t\t\t\tif(arr[k]==arr[j]+1 && arr[j]==arr[i]+1){\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}\n\tprintf(\"NO\\n\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "4c575a237716fb13aad4e252ff4195ca", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "5d9301e776b044d0ac4e3ed2c0c15e26", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.841304347826087, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#include\nint b[100000];\nint i;\nint tog;\nint cmpfunc (const void * a, const void * b)\n{\n\treturn ( *(int*)a - *(int*)b );\n}\n\nint main()\n{\n\tint a;\n\tscanf(\"%d\",&a);\n\tfor(i=0;i\nint main() {\n int n;\n while(scanf(\"%d\",&n))\n {\n int a[n];\n int i;\n for(i=0; i a[j+1]) {\n swap=a[j];\n a[j] = a[j+1];\n a[j+1]= swap;\n }\n }\n }\n int y=0;\n int x=1;\n int temp=a[0];\n for(i=1;i\nint main()\n{\nint x,y,z,i,sum;\n scanf(\"%d%d%d\",&x,&y,&z);\n printf(\"%d\\n%d\\n%d\",x,y,z);\n for(i=x;i>=1;i--)\n {\n if(y>=2*i && z>=4*i)\n break;\n\n\n }\n sum=i+2*i+4*i;\n\n printf(\"\\n%d\",sum);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "c0aa9e690b8d4fd4bf64f5021eeda055", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "11f6732e2405df3a2c7d561a0bf8b079", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6126373626373627, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n\nint main()\n{\nint a, b, c;\n\nscanf(\"%d\", &a);\nscanf(\"%d\", &b);\nscanf(\"%d\", &c);\n\nif(a==0 || c<4 || b<2)\nprintf(\"0\");\n\nelse if(c/4 <= a && b/2 <= a && c/4 < b/2)\nprintf(\"%d\", c/4*(1+2+4));\n\nelse if(c/4 <= a && b/2 <= a && c/4 > b/2)\nprintf(\"%d\", 7*b/2)\n\nelse\nprintf(\"%d\", 7*a);\n\n\n\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "18d5abc82e2467636d522f1cc41c0b4f", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "ed475839d78fc6daa90c992ac3f9c134", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9938650306748467, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main()\n{\n\tint a,b,c,i;\n\tscanf(\"%d%d%d\",&a,&b,&c);\n\tfor(i=a;i>=0;i--)\n\t{\n\t\tif(2*i<=b && 4*i<=c)\n\t\t\tbreak;\n\t}\n\tprintf(\"%d\\n\",7*i);\n\treturn 0;\n", "lang": "GNU C", "bug_code_uid": "5c10078fb86c8a6606821f362b5fcdb8", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "27239a1a7d7f561f3cf4940fd942e9c8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9955947136563876, "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 a,b,c,i,k;\n scanf(\"%d%d%d\",&a,&b,&c);\n for(i=a;i>0;i--)\n {\n if(b>=(2*i) && c>=(4*i)){\n k=7*i;\n break;\n }\n \n }\n printf(\"%d\\\",k);\n}", "lang": "GNU C", "bug_code_uid": "0b17ac675802cc1ef2a5321128cda5c4", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "0c93ea2b3ac7e793372795382c5c534c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.5234375, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint main()\n{\n int a,b,c,x,y,z,r;\n scanf(\"%d %d %d\",&a,&b,&c);\n if(c%4==0)\n {\n z=c;\n }\n else{r=c/4;z=r*4;}\n y=z/2;x=y/2;\n if(x<=a&&y<=b){\n printf(\"%d\",x+y+z);\n }\n else{printf(\"0\");1}\n}\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "90f61bae5a5159ddea6886e48885882a", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "23ef42c78397f78abf67e842af1049d8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9514563106796117, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\nint a,b;\nscanf(\"%d\",&a);\nif(a==0)\n{\nb=0\n}\nelse if(a%2==0)\n{\nb=a+1;\n}\nelse\n{\nb=(a+1)/2;\n}\nprintf(\"%d\",b);\nreturn 0;\n}\n\n", "lang": "GNU C11", "bug_code_uid": "b2538bc35f8f2d95b85b77bb999e8e36", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "745f2068361efcc412aa18105d8aab25", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9872673849167483, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main()\n{\n\tint cases[40] = {0,0,0,0, 0,0,0,0, 1,0,0,0, 1,1,0,0, 3,1,0,0, 3,1,1,0, 4,2,1,0, 4,2,1,1, 7,2,1,1, 7,5,1,1};\n\tint T, input, num[4], arr[4] = {2, 3, 5, 7};\n\tscanf(\"%d\", &T);\n\n\twhile(T--)\n\t{\n\t\tscanf(\"%d\", &input);\n\t\tinput *= 4;\n \n\t\tfor(int j=0; j<4; j++)\n\t\t\tnum[j] += cases[input+j];\n\t}\n\t\n\tfor(int i=3; i>=0; i--)\n\t\twhile(num[i])\n\t\t{\n\t\t\tprintf(\"%d\", arr[i]);\n\t\t\tfor(int j=0; j<4; j++)\n num[j] -= cases[arr[i] * 4 + j];\n\t\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "23e58b99e2185a16e88815de03590666", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "4447797210c12102f1d02c05f2346abe", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9638318670576735, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "\n#include \nint main()\n{\n\tint cases[40] = {0,0,0,0, 0,0,0,0, 1,0,0,0, 1,1,0,0, 3,1,0,0, 3,1,1,0, 4,2,1,0, 4,2,1,1, 4,2,4,1, 4,4,4,1};\n\tint T, input, num[4], arr[4] = {2, 3, 5, 7};\n\tscanf(\"%d\", &T);\n\n\twhile(T--)\n\t{\n\t\tscanf(\"%1d\", &input);\n\t\tinput *= 4;\n \n\t\tfor(int j=0; j<4; j++)\n\t\t\tnum[j] += cases[input+j];\n\t}\n\t\n\tfor(int i=3; i>=0; i--)\n\t\twhile(num[i])\n\t\t{\n\t\t\tprintf(\"%d\", arr[i]);\n\t\t\tfor(int j=0; j<4; j++)\n num[j] -= cases[arr[i] * 4 + j];\n\t\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "dd26b57e55fa6d15dddd98e4d6c3a98d", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "4447797210c12102f1d02c05f2346abe", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9834917458729364, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#pragma comment(linker, \"/STACK:1024000000,1024000000\")\n#pragma GCC optimize(\"Ofast\")\n#pragma GCC target(\"sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native\")\n\n#include \n\nconst int dx[5] = {0, 1, -1, 0, 0};\nconst int dy[5] = {0, 0, 0, 1, -1};\n\nint n, m, best;\nlong long g[45], rest[45];\n\nvoid dfs(long long mask, int cur, int cura) {\n\tif (cura >= best) return;\n\tif (cur >= n*m) return;\n\tif (mask == (1LL << n * m) - 1)\n\t\treturn void (best = cura);\n\tif ((mask | rest[cur]) ^ (1LL << n * m) - 1) return;\n\tdfs(mask | g[cur], cur + 1, cura + 1);\n\tdfs(mask, cur + 1, cura);\n}\n\nint main() {\n\tregister int i, j, k;\n\tscanf(\"%d%d\", &n, &m);\n\tfor (i = 0; i < n; ++ i)\n\t\tfor (j = 0; j < m; ++ j)\n\t\t\tfor (k = 0; k < 5; ++ k) {\n\t\t\t\tint x = i + dx[k], y = j + dy[k];\n\t\t\t\tif (x < 0 || x >= n || y < 0 || y >= m) continue;\n\t\t\t\tg[i * m + j] |= 1LL << x * m + y;\n\t\t\t}\n\tfor (i = n * m - 1; i >= 0; -- i) rest[i] = rest[i + 1] | g[i];\n\tbest = n * m; dfs(0, 0, 0);\n\tprintf(\"%d\\n\", n * m - best);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "c52576a6564a010b11ee385852cd03c0", "src_uid": "097674b4dd696b30e102938f71dd39b9", "apr_id": "40d6864cf0df04d42e646dff5e0c5300", "difficulty": 2100, "tags": ["dp", "bitmasks", "dsu"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9958236658932714, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#pragma comment(linker, \"/STACK:1024000000,1024000000\")\n#pragma GCC optimize(\"Ofast\")\n#pragma GCC optimize(3)\n#pragma GCC optimize(\"inline\")\n#pragma GCC target(\"sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native\")\n\n#include \n\nconst int dx[5] = {0, 1, -1, 0, 0};\nconst int dy[5] = {0, 0, 0, 1, -1};\n\nint n, m, best;\nlong long g[45], rest[45];\nregister long long whole;\n\nvoid dfs(long long mask, int cur, int cura) {\n\tif (cura >= best) return;\n\tif (cur >= n * m) return;\n\tif (mask == whole) best = cura;\n\telse if ((mask | rest[cur]) ^ whole) return;\n\telse dfs(mask | g[cur], cur + 1, cura + 1), \n\tdfs(mask, cur + 1, cura);\n}\n\nint main() {\n\tregister int i, j, k;\n\tscanf(\"%d%d\", &n, &m);\n\twhole = (1LL << n * m) - 1;\n\tfor (i = 0; i < n; ++ i)\n\t\tfor (j = 0; j < m; ++ j)\n\t\t\tfor (k = 0; k < 5; ++ k) {\n\t\t\t\tint x = i + dx[k], y = j + dy[k];\n\t\t\t\tif (x < 0 || x >= n || y < 0 || y >= m) continue;\n\t\t\t\tg[i * m + j] |= 1LL << x * m + y;\n\t\t\t}\n\tfor (i = n * m - 1; i >= 0; -- i) rest[i] = rest[i + 1] | g[i];\n\tbest = n * m; dfs(0, 0, 0);\n\tprintf(\"%d\\n\", n * m - best);\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "564659cb3823829e6c4eff73ba855bd8", "src_uid": "097674b4dd696b30e102938f71dd39b9", "apr_id": "40d6864cf0df04d42e646dff5e0c5300", "difficulty": 2100, "tags": ["dp", "bitmasks", "dsu"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.32263242375601925, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\nint t[40], n,m,tot,ans;\nvoid dfs(int now,int cnt)\n{\n\tif(cnt>=ans)\n\t\treturn;\n\twhile(now0)\n\t\tnow++;\n\tif(now>=tot)\n\t{\n\t\tint i;\n\t\tfor(i=0;i=0)\tt[now-m]++;\n\t\tif(now%m>0)\t\tt[now-1]++; \n\t\tif(now+m=0)\tt[now-m]--;\n\t\tif(now%m>0)\t\tt[now-1]--; \n\t\tif(now+m\n#include\nint t[400],n,m,tot,ans;\nvoid dfs(int now,int cnt)\n{\n\tif(cnt>=ans)\n\t\treturn;\n\twhile(now0)\n\t\tnow++;\n\tif(now>=tot)\n\t{\n\t\tint i;\n\t\tfor(i=0;i=m)\n\t{\n\t\tto=now-m;\n\t\tt[to]++;\n\t\tif(to-m>=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m0)\n\t{\n\t\tto=now-1;\n\t\tt[to]++;\n\t\tif(to-m>=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m\nint t[400],n,m,tot,ans;\nvoid dfs(int now,int cnt)\n{\n\tif(cnt>=ans)\n\t\treturn;\n\twhile(now0)\n\t\tnow++;\n\tif(now>=tot)\n\t{\n\t\tint i;\n\t\tfor(i=0;i=m)\n\t{\n\t\tto=now-m;\n\t\tt[to]++;\n\t\tif(to-m>=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m0)\n\t{\n\t\tto=now-1;\n\t\tt[to]++;\n\t\tif(to-m>=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m=0)\tt[to-m]++;\n\t\tif(to%m>0)\t\tt[to-1]++; \n\t\tif(to+m=0)\tt[to-m]--;\n\t\tif(to%m>0)\t\tt[to-1]--;\n\t\tif(to+m\nint main()\n{\n long int n,i,j,k,x;\n long long int count;\n scanf(\"%ld\",&n);\n count=0;\n for(i=1;i<=n;i++)\n {\n for(j=i;j<=n;j++)\n {\n for(k=j;k<=n;k++)\n {\n if((i+j)>k && (j+k)>i && (i+k)>j)\n {\n x=i^j^k;\n if(x==0)\n {\n count++;\n }\n }\n }\n }\n }\n printf(\"%lld\",count);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "2ef336410f9d5ae0112982e504201555", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "20a6aff97aed72d0ca4314074364f1fe", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6805054151624549, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n\nint main()\n{\n int n ,a,b,c,counter=0;\n\n scanf(\"%d\",&n);\n\n for(c=n;c>=1;c--)\n {\n for(b=c;b>=1;b--)\n {\n\n for(a=b;(a>=1)&&(a+b>c)&&(a+c>b);a--)\n {\n if(a^b^c)\n continue;\n else if((b+c>a))\n {\n //printf(\"%d %d %d\\n\",a,b,c);\n counter++;\n }\n\n\n\n }\n }\n }\n printf(\"%d \",counter);\n return 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "c670b0533a57f4c7a451f2e457ba49e4", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "53383a9a42312b774d9e39bf108fc077", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.10746268656716418, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include\nint if_dif(int n,int i,int j)\n{\n\treturn n^i^j;\n}\nint if_get(int n)\n{\n\tint max;\n\tint i,j;\n\tmax=0;\n\tfor(i=n;i>=1;i--)\n\t{\n\t\tfor(j=1;j<=i;j++)\n\t\t{\n\t\t\tif(if_dif(j,i,n)==0&&j+i>n)\n\t\t\t\tmax++;\n\t\t}\n\t}\n\treturn max;\n}\nint main()\n{\n\tint i;\n\tint n;\n\tint a[3000];\n\tscanf(\"%d\",&n);\n\ta[0]=0;\n\tfor(i=1;i\n \n \n \n \n \nint XOR( int a, int b, int c){\n \tif( (a^(b^c)) == 0){\n \t\treturn 1;\n \t}\n \telse{\n \treturn 0;\n \t}\n}\n\nint triangle(int a, int b, int c){\n\tif( (a+b>c) && (b+c>a) && (a+c>b)){\n\t\treturn 1;\n\t}\n\t\n\telse{\n\t\treturn 0;\n\t}\n}\n\n \t\nint main()\n{\n int n;\n scanf(\"%d\" ,&n);\n \n int counter=0;\n \n for(int i=1; i<=n; i++){\n \tfor(int j=1; j<=n; j++){\n \t\tfor(int k=1 ; k<=n ; k++){\n \t\t\tif( XOR(i,j,k) == 1 && triangle(i,j,k)==1 ) {counter++;}\n \t\t\t\n \t\t}\n \t\t\n \t}\n \t\n }\n \n \n printf(\"%d\" ,(counter/6));\n \t\t\n\treturn 0;\n}\n \n", "lang": "GNU C", "bug_code_uid": "cfd6b9bbbca71e4ce2a633d970bfdd52", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "64775a386688618ffe7228188c9e6269", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5973741794310722, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\n#include\n\nint main(int argc,char* argv[])\n{\n int x,y,z,temp,cpt=0,n;\n do{\n scanf(\"%d\",&n);\n }while(n<1 && n>2500);\n for(z=1;z<=n;z++)\n {\n for(y=1;yz || x+y\n\nint main()\n{\n\tint n;\n\tscanf(\"%d\",&n);\n\tint c=0;\n\tint i,j,k,a;\n\tfor(i=1;i<=n;i++)\n\t{\n\t\tfor(j=i;j<=n;j++)\n\t\t{\n\t\t\tfor(k=j;i+j>k && j+k>i && k+i>j && k<=n;k++)\n\t\t\t{\n\t\t\t\ta = k^i^j;\n\t\t\t\tif(a==0)\n\t\t\t\t{\n\t\t\t\t\t//printf(\"%d\\n\",0^1);\n\t\t\t\t\t//printf(\"%d %d %d\\n\",i,j,k);\n\t\t\t\t\tc++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\\n\",c);\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "9d3cfb75c38286318b3aa8e03a88c17e", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "ce0d20027eaa266ce39efb2132a8402f", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5633802816901409, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "\t\t\t\t\ta[j] = c;\n\t\t\t\t}\n\n\t\tfor (i = 0; i < n - 2; i++)\n\t\t\tif (a[i] + 1 == a[i + 1])\n\t\t\t\tif (a[i] + 2 == a[i + 2])\n\t\t\t\t{\n\t\t\t\t\tc = -911;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\tif (c == -911 )\n\t\t\tprintf(\"YES\");\n\t\telse\n\t\t\tprintf(\"NO\");\n\t\tprintf(\"\\n\");\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "8bb447322e9c4b235329e1b949803bbb", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "1917fb4c7f5003d50ec0c459b71bd6f4", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "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 \n#include \n\nint compara(const void *p, const void *q);\n\nint main(){\n\tint n;\n\tscanf(\"%d\", &n);\n\tint v[n];\n\t\n\tfor( int i=0; i\nint main()\n{\n long long a, b, c=1, d=1, i, j,max,min;\n scanf(\"%lld %lld\", &a, &b);\n for (i=1; i <=a; i++){\n c=c*i;\n }\n for (j=1; j<= b; j++){\n d=d*j;\n }\n if ( c==d){\n printf(\"%lld\\n\", d);\n }\n else{\n if (c>d){\n max=c;\n min=d;\n }\n else{\n max=d;\n min=c;\n }\n }\n while (1==1){\n if (max%min==0){\n printf(\"%lld\\n\", min);\n break;\n }\n else{\n max=min;\n min= max%min;\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "81ac146cc3448b3a911252a909c59d4f", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "54eb5022fa657df53f764998c2a7848a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.09427609427609428, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nint fatorial(int x) {\n\tif(x == 0) {\n\t\treturn 1;\n\t}\n\treturn x * fatorial(x-1);\n}\n\nint euclides(int a, int b) {\n int r;\n\n do {\n r = a % b;\n a = b;\n b = r;\n } while (r != 0);\n\n return a;\n}\n\nint main() {\n\tint a, b;\n\n\tscanf(\"%d%d\", &a, &b);\n\ta = fatorial(a);\n\tb = fatorial(b);\n\tprintf(\"%d\", euclides(a, b));\n\n\treturn 0;\n}\n/* 1512825412620 */\n", "lang": "GNU C", "bug_code_uid": "ef0623652916fc4dee6def3b9b6f14a0", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "ad9e7e38b549bc762ebca78a9f5ff80a", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2800608828006088, "equal_cnt": 18, "replace_cnt": 14, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "#include \n\nint fact(int a){\n\n int x = 1;\n for (int i = 1; i <= a; i++){\n x *= i;\n }\n return x;\n}\nint mdc(int a, int b){\n\n int resto = a%b;\n\n if (!resto) return b;\n\n else return mdc(b, resto);\n}\n\nint main(){\n int a, b;\n\n scanf(\"%d %d\", &a, &b);\n\n printf(\"%d\", mdc(fact(a),fact(b)));\n}\n\n/* 1504285883337 */\n", "lang": "GNU C", "bug_code_uid": "0bd3cc569c953b3c3490daa6fa4a52df", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "a7b2e63797bc0bfcfbc15b35f671a72e", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4211994421199442, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int a,b,c=1,d=1,i=0,k,e;\n scanf(\"%d %d\",&a,&b);\n for(i=1;i<=a;i++)\n c=c*i;\n for(i=1;i<=b;i++)\n d=d*i;\n if(a\nint main()\n{\n int A,B,c,d=1,i,j,s=1,x,gcd;\n scanf(\"%d %d\",&A, &B);\n for(i=1;i<=A;i++) {\n s=s*i;\n\n }\n for(j=1;j<=B;j++) {\n d=d*j;\n if(s>d) {\n x=s;\n }\n else {\n x=d;\n }\n for(;x>=1;x--) {\n if(s%x==0 && d%x==0) {\n gcd=x;\n break;\n }\n }\n }\n\n printf(\"%d\",gcd);\n\n\n return 0;\n\n}", "lang": "GNU C", "bug_code_uid": "f51ded7bec0c8db8a76fa15c693e3b64", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "46c353d2256096b47ea078e20ca67cd7", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9903536977491961, "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 a, b, i, c=1;\n scanf(\"%d %d\", &a, &b);\n for(i=a>b?b:a;i>0;i--)\n {\n c*=i;\n }\n printf(\"%d\",c);\n}\n", "lang": "GNU C", "bug_code_uid": "2cc528c6cf165be40ec311be6456eb41", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "54404d40a01289fa5dc8da0d190ee93c", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.900523560209424, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main(){\n int n, k, l, c_, d, p, nl, np;\n scanf(\"%d %d %d %d %d %d %d %d\",n, k, l, c_, d, p, nl, np);\n int ttl_drink=k*l;\n int ttl_lime=c_*d;\n int ttl_salt=p;\n \n int tst_drink = ttl_drink/nl;\n int tst_lime = ttl_lime;\n int tst_salt = p/np;\n \n int min;\n int a=tst_drink;\n int b=tst_lime;\n int c=tst_salt;\n \n if( (a\n#include \n\nstatic void decrease_duplicates (int arr[], size_t sz);\nstatic size_t sum_positive (int arr[], size_t sz);\n\nint main (void) {\n\tsize_t letter_count;\n\tscanf(\"%llu\", &letter_count);\n\n\tint max_letter_freq[letter_count];\n\tfor (size_t i = 0; i < letter_count; ++i) {\n\t\tscanf(\"%d\", &max_letter_freq[i]);\n\t}\n\n\t//~ int max_letter_freq[] = {\n\t\t//~ 2, 5, 5\n\t//~ };\n\t//~ size_t letter_count = 3;\n\n\tfor (size_t i = 0; i < letter_count; ++i) {\n\t\tdecrease_duplicates(max_letter_freq + i, letter_count - i);\n\t}\n\n\tprintf(\"%llu\\n\", sum_positive(max_letter_freq, letter_count));\n\n\treturn 0;\n}\n\nstatic void decrease_duplicates (int arr[], size_t sz) {\n\tif (sz == 1)\n\t\treturn;\n\n\tint elem = arr[0];\n\tint decrease_by = 1;\n\tfor (size_t i = 1; i < sz; ++i) {\n\t\tif (arr[i] == elem) {\n\t\t\tarr[i] -= decrease_by;\n\t\t\tdecrease_by++;\n\t\t}\n\t}\n}\n\nstatic size_t sum_positive (int arr[], size_t sz) {\n\tsize_t sum = 0;\n\tfor (size_t i = 0; i < sz; ++i)\n\t\tif (arr[i] > 0)\n\t\t\tsum += arr[i];\n\n\treturn sum;\n}\n", "lang": "GNU C11", "bug_code_uid": "28da7a9309c64c091f47c5496215de78", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "1f1a7d8cde6ad72f0d085b38cff10c1f", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8217636022514071, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include\nint main(void)\n{\n\tchar a[30],t;\n\tint i,k,alen,max,s;\n\tscanf(\"%s\",a);\n\tscanf(\"%d\",&k);\n\talen=strlen(a);\n\twhile(k>0)\n\t{\n\t\tfor(i=0;i0)\n\t\t\t\t{\n\t\t\t\t\tif(a[i+s]>a[i])\n\t\t\t\t\t\tmax=a[max]>a[i+s]?max:i+s;\n\t\t\t\t\ts--;\n\t\t\t\t}\n\t\t\t\tif(a[max]>a[i])\n\t\t\t\t{\n\t\t\t\t\tt=a[max];\n\t\t\t\t\tk=k-max+i;\n\t\t\t\t\twhile(max-i>0)\n\t\t\t\t\t{\n\t\t\t\t\t\ta[max]=a[max-1];\n\t\t\t\t\t\tmax--;\n\t\t\t\t\t}\n\t\t\t\t\ta[i]=t;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%s\",a);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f10cde836bbe6b71b0fbfbf814d20036", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "dbcb9767099109bc6b7e028f79652cf4", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8776881720430108, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\nint main() {\n char a[20];\n int k;\n scanf(\"%s%d\",a,&k);\n //就一个原则,把最大的放在最前面\n //把k步内最大的换到最前面\n int swaps=k;\n int na=strlen(a);\n int start=0;\n while(1){\n int i;\n int max=start;\n for(i=start+1;ia[max]){\n max=i;\n }\n }\n //printf(\"start=%d, max=%d\\n\",start,max);\n //printf(\"%s\\n\",a);\n int tmp=a[max];\n for(i=max;i>start;i--){\n a[i]=a[i-1];\n }\n a[start]=tmp;\n //printf(\"%s\\n\",a);\n swaps-=(max-i);\n if(swaps==0)break;\n start++;\n if(start==na-1)break;\n }\n printf(\"%s\\n\",a);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "747b0c6b3f5c073bf08f1e8c58834d86", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "360ff65a146296d21f9b697b94d8ee53", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8833437305053026, "equal_cnt": 15, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 14, "bug_source_code": "#include\nmain()\n{\n char a[20];\n int k,i,j,l,bar,temp,flag,var;\n scanf(\"%s\",a);\n scanf(\"%d\",&k);\n l=strlen(a);\n for(i=0;i=k?k:l);i++)\n {\n if(a[i]>a[j])\n {\n var=i;\n flag=1;\n }\n }\n \n if(flag)\n {\n temp=a[var];\n for(bar=var-1;bar>=j;bar--)\n a[bar+1]=a[bar];\n a[j]=temp;\n k-=(var-j);\n }\n }\n for(i=0;i\n#include \n#define min2(x,y) (x\n#include\nchar a[32];\nint l,b[32],st,m,swp;\nint swap(int x,int y)\n{\nchar ch;\nint i;\nif(y>x)\n{\n ch=a[y];\n for(i=y;i>x;i--)\n {\n a[i]=a[i-1];\n }\n a[i]=ch;\n}\nreturn 0;\n}\nmain()\n{\nint i,j,k;\nscanf(\"%s %d\",a,&k);\nswp=k;\nl=strlen(a);\nst=0;\nwhile(stm)\n {\n m=a[i];\n b[j]=i;\n j++;\n }\n }\n for(i=j-1;i>=0;i--)\n {\n if(swp>=b[i]-st)\n {\n swap(st,b[i]);\n swp=swp-(b[i]-st);\n break;\n }\n }\n st++;\n}\nfor(i=0;i\n#include \nmain()\n{\nchar s[20];\nlong long int i,j,k,m,temp=-1,ind,swap=0;\nscanf(\"%s %I64d\",s,&k);\n\nfor(i=0;is[i]-'0' && j>temp)\n{\ntemp=j;\nind=m;\n\n}\n\n}\nif(temp!=-1)\n{\nwhile(ind>i)\n{\n\tif(swap==k)\n\tbreak;\ns[ind]=s[ind-1];\ns[ind-1]=temp+'0';\nswap++;\n\nind--;\n}\n\nif(swap==k)\n\tbreak;\n\n}\n}\nprintf(\"%s\",s);\n\n\n}", "lang": "GNU C", "bug_code_uid": "be708cb5d976f14acb4bc2e09a59b6e5", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "327ccfe70ca9abd81ec0fcac8aa140d3", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9802955665024631, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "//KRV Template\n#include\n#include\n#include\nvoid swap(int *xp, int *yp)\n{\n int temp = *xp;\n *xp = *yp;\n *yp = temp;\n}\n//BTW l,r are indices\nvoid bubblesort(int arr[] , int l , int r)\n{\n int i,j,temp=0;\n for(int i = l ; i<=r ; i++)\n {\n \tfor(int j = l ; jarr[j+1])\n \t\t{\n \t\t\tswap(&arr[j],&arr[j+1]);\n \t\t}\n \t}\n \ttemp++;\n }\n}\nvoid rbubblesort(int arr[] , int l , int r)\n{\n int i,j,temp=0;\n for(int i = l ; i<=r ; i++)\n {\n \tfor(int j = l ; j=arr[i])\n {\n \tans = arr[i+1];\n }\n\t}\n\treturn ans;\n}\nint mininarray(int arr[] , int l , int r)\n{\n\tint ans = arr[0];\n\tfor(int i = l ; i\n#include\nint main()\n{\n\tint i,N;\n\tscanf(\"%d\",&N);\n\tprintf(\"%d\\n\",(N-1)*2);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1f95bd7e2b5a9ae5f69324cdb41bbc38", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "0fe00f74a2cb8c0d11d48693df6a141c", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.46953937592867756, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "\n#include \n#include \nint main()\n{\n int i,a,sum;\n while(~scanf(\"%d\",&a))\n {\n sum=1;\n a-=2;\n while(a-->=1)\n sum++;\n sum*=2;\\\n printf(\"%d\\n\",sum);\n }\n}\n", "lang": "GNU C", "bug_code_uid": "a86b2495c3bc047b38e859c8db395389", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "0202133ca2f364369e3cf0808a65926b", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9827586206896551, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "main(n){scanf(\"%d\",&n);n++;printf(\"%d\\n\",(n/2+n%2)*n/2);}", "lang": "GNU C", "bug_code_uid": "836200657dfbff6048d8b6cb7f2c9339", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "84f2fd6771a7a5e9670c6fb2e64799c6", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7019374068554396, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int lemons,friends,salt,nsalt,ndrink,nlemons,bottles,ltrs,a,nltrs;\n scanf(\"%d\",friends);\n scanf(\"%d\",bottles);\n scanf(\"%d\",ltrs);\n scanf(\"%d\",lemons);\n scanf(\"%d\",nlemons);\n scanf(\"%d\",salt);\n scanf(\"%d\",nltrs);\n scanf(\"%d\",nsalt);\n ltrs=(ltrs*bottles)/nltrs;\n lemons=nlemons*lemons;\n salt=salt/nsalt;\n if(salt\nint main()\n{\n int a;\n scanf(\"%d\",a);\n if(a>=1&&a<=100)\n {\n if(a%2==0)\n {\n printf(\"YES\");\n }\n else\n {\n printf(\"NO\");\n }\n }\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "07afb1ee085d6a0d888eedf79319f3c9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "098f60c54e533eba3aa0732b1b8b8782", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9788007268322229, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nint main()\n{\n int r1,c1,r2,c2;\n scanf(\"%d %d %d %d\",&r1,&c1,&r2,&c2);\n int i,j,k,l,p;\n if(abs(r1-r2)==abs(c1-c2))\n {\n i=2;\n j=1;\n k=abs(r1-r2);\n }\n else \n {\n if(abs(c1-c2)+abs(r1-r2))%2==0)\n j=2;\n else \n j=0;\n \n if(abs(r1-r2)==0)\n {\n i=1;\n k=abs(c1-c2);\n }\n else if(abs(c1-c2)==0)\n {\n i=1;\n k=abs(r1-r2);\n }\n else \n {\n i=2;\n if(abs(r1-r2)>abs(c1-c2))\n {\n k=abs(r1-r2);\n }\n else if(abs(r1-r2)\n\nint main()\n{\n int r1, c1, r2, c2;\n scanf(\"%d %d %d %d\", &r1, &c1, &r2, &c2);\n\n int R=0, B=0, K=0;\n\n int Dr = r1 - r2, Dc = c1 - c2;\n if(Dr < 0)\n Dr*=-1;\n if(Dc < 0)\n Dc*=-1;\n \n\n if(Dr==0 || Dc==0)\n R=1;\n else\n R=2;\n\n \n if((((r1+c1)%2 == 0) && ((r2+c2)%2 == 0)) || (((r1+c1)%2 != 0) && ((r2+c2)%2 != 0)))\n {\n int m = Dr/Dc;\n if(m == 1)\n B=1;\n else\n B=2;\n }\n\n if(Dr > Dc)\n K = Dr;\n else\n K = Dc;\n\n printf(\"%d %d %d\\n\", R, B, K); \n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "db5da481ee7b525cf6151fb0c3999c81", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "3471d3ff0461939e76ede026ac19eda7", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6413288288288288, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int r1,r2,c1,c2;\n scanf(\"%d%d%d%d\",&r1,&c1,&r2,&c2);\n int t1,t2,t3=0;\n if((r1==r2)||(c1==c2))\n {\n t1=1;\n if(r1==r2)\n {\n t3=abs(c2-c1);\n }\n else\n {\n t3=abs(r2-r1);\n }\n }\n else\n {\n t1=2;;\n }\n int k1,k2,k3,k4;\n k1=r1%2;\n k2=c1%2;\n k3=r2%2;\n k4=c2%2;\n if(((k1==0)&&(k2==0))||((k1==1)&&(k2==1)))\n {\n if(((k3==0)&&(k4==1))||((k3==1)&&(k4==0)))\n {\n t2=0;\n }\n else\n {\n int q;\n q=(c2-c1)/(r2-r1);\n if(abs(q)==1)\n {\n t2=1;\n }\n else\n {\n t2=2;\n }\n }\n\n }\n if(((k1==0)&&(k2==1))||((k1==1)&&(k2==0)))\n {\n if(((k3==0)&&(k4==0))||((k3==1)&&(k4==1)))\n {\n t2=0;\n }\n else\n {\n int q;\n q=(c2-c1)/(r2-r1);\n if(abs(q)==1)\n {\n t2=1;\n }\n else\n {\n t2=2;\n }\n }\n\n }\n if(t3==0)\n {\n \n int p,u;\n p=abs(r2-r1);\n u=abs(c2-c1);\n int countit=0;\n while(p!=u)\n {\n if(p>u)\n {\n p--;\n countit++;\n }\n if(u>p)\n {\n u--;\n countit++;\n }\n }\n countit=countit+u;\n t3=countit;\n }\n printf(\"%d %d %d\",t1,t2,t3);\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "7dc74b719e504bdf33808598001aaf24", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "d03f2c66a28148eb1effba3b572623ed", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5779816513761468, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \n\n#define min(a,b) ((a)<(b) ? (a):(b))\n#define max(a,b) ((a)>(b) ? (a):(b))\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nlong long fucks(long long x){\n if (x >= 0) return x;\n return -x;\n}\n\nint main(){\n long long y, i, j, c, d, x, z, res, idx;\n\n while (scanf(\"%lld\", &y) != EOF){\n x = fucks(y) % 360;\n if (y < 0) x = 360 - x;\n\n res = 1LL << 60;\n for (i = 0; i <= 10000; i++){\n c = fucks(360 - x);\n d = fucks(180 - x);\n z = min(c, d);\n if (z < res) res = z, idx = i;\n x = (x + 90) % 360;\n }\n\n printf(\"%lld\\n\", idx);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "046b2d082111f1d1b2607db75c472a76", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "f3210785ef119576b87c78a6d98d0172", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.44605475040257647, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n#include \n\n#define clr(ar) memset(ar, 0, sizeof(ar))\n#define read() freopen(\"lol.txt\", \"r\", stdin)\n\nlong long fucks(long long x){\n if (x >= 0) return x;\n return -x;\n}\n\nint main(){\n long long y, i, j, c, d, x;\n\n while (scanf(\"%lld\", &y) != EOF){\n x = fucks(y) % 360;\n if (y < 0) x = -x;\n if (x < 0) x += 360;\n\n long long res = 0, min = 1010;\n for (i = 0; i <= 100; i++){\n d = (i * 90) % 360;\n c = fucks(d - x);\n if (c < min) min = c, res = i;\n }\n\n if ((y % 360) == 0) __builtin_trap();\n printf(\"%lld\\n\", res);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0526a412f0760093527f1a9c13474ce9", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "f3210785ef119576b87c78a6d98d0172", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6476190476190476, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main(){\nint w;\nscanf(\"%d\",w);\nif (w%2==0){\nprintf(\"yes\");}\nelse{\nprintf(\"no\");}\nreturn 0;}\n", "lang": "GNU C", "bug_code_uid": "d80ffa4fecd42e1540d0609994538710", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "8ede215068b6f8c9fd47e884ecf8ccab", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6234413965087282, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main(void) {\n\t// your code goes here\n\t\n\tlong long int n,i,j,k=1,l=0;\n\tscanf(\"%d\",&n);\n\tfor(i=1;i<=n;i++)\n\t{ \n\t k=k*2;\n\t l=l+k;\n\t}\n\tprintf(\"%I64d\",l);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "4ec45ab99041d18b1fc32814634ca3d0", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "8f044090fb4236ec1ecfe211493fbd40", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7194570135746606, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n long long int pdt=1,ans;\n int n,i,;\n scanf(\"%d\",&n);\n \n for(i=0;i<=n;i++)\n p*=2;\n ans=p-2;\n printf(\"%l64d\",ans);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "7bb3a4d6661a1f6f16603addd1bc0514", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "f6793007e90eac5d69d0e241309cf86c", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9518072289156626, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n\tlong long int n,j,ans=1,finalans=0;\n\tscanf(\"%d\",&n);\n\tlong long int i=1;\n\twhile (i<=n)\n\t{\n\t\tfor (j=1;j<=i;j++)\n\t\t{\n\t\t\tans=ans*2;\n\t\t};\n\t\tfinalans=finalans+ans;\n\t\tans=1;\n\t\ti++;\n\t }\n\tprintf(\"%lld\",finalans);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "416de9ef73c91841861dbf4d447e4aa6", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "2dc7083eda9007c6d33b41f7f51f8801", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9879839786381842, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "#include \nint main(void){\n int n, x, flag = 1;\n scanf(\"%d\", &n);\n if (n & 1 == 0) {\n flag = 0;\n }\n for (inti = 0; i < x; i++){\n scanf(\"%d\", &x);\n if ((i == 0 || i == x-1) && (x & 1 == 0)) {\n flag = 0;\n }\n }\n if (flag) {\n printf(\"Yes\\n\");\n } else {\n printf(\"No\\n\");\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "2b5741aaf71db777a3f63982990606cb", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "b3392634d60494ed2f2c114bbf74ae07", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.34279918864097364, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 10, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "#include\nint main(){\n\tint i,n;\n\tscanf(\"%d\",&n);\n\tint count=0,a[n],j=0;\n\tfor(i=0;i\n#include\n#include\n#include\n#include\n#include\n#include\n\nusing namespace std;\n\n\n\n\nint main()\n{\n int n,i,j;\n int a[10000];\n while(scanf(\"%d\",&n)==1)\n {\n for(i=0; i\nusing namespace std;\nint main()\n{\n int n,i,s[100];\n cin>>n;\n for(i=0;i>s[i];}\n if(n%2 &&s[0]%2 && s[n-1]%2)\n cout<<\"yes\";\n else\n cout<<\"no\";\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "7733110616073cf416eb813f16fac09c", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "87e2e2fe8541ce9f6319f19607529c50", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3270300333704116, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "/*\n * =====================================================================================\n *\n * Filename: main.c\n *\n * Description: \n *\n * Version: 1.0\n * Created: 23/11/16 19:38:33\n * Revision: none\n * Compiler: gcc\n *\n * Author: YOUR NAME (), \n * Company: \n *\n * =====================================================================================\n */\n\n#include \n\nint\nmain() {\n int n, a = 1, b = 1, c, k = 0;\n scanf(\"%d\", &n);\n while (a + b <= n) {\n k++;\n c = a + b; a = b; b = c;\n }\n printf(\"%d\\n\", k);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "9ebcde2ddf32fe0ff43759646d3af8ff", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "8f874e5a73e3d5b05abbf82f042cd98e", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.34105960264900664, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include \n\nint main ()\n{\n int n, i, a[120], A[120];\n A[1] = 2;\n A[2] = 3;\n scanf (\"%d\", &n);\n for (int i = 3; i < i++)\n {\n A[i] = a[i-1] + a[i-2];\n }\n for (int i = 1; i < i++)\n {\n if (A[i] > n)\n {\n printf (\"%d\\n\", i-1);\n break;\n }\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "14496fca568272d51949ee19acd88422", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "2b9f6bc26d4582480e31fd8a6382d296", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6226415094339622, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n int n,c=0,f=0;\n scanf(\"%d\",&n);\n while(n/2)\n {\n c++;\n if(n%2!=0)\n f++;\n n=n/2;\n }\n printf(\"%d\",c+f);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "447701ae1531e9cc2834ff63270d16d6", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "bb5acef2a90f76243d6d70e822184a20", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6926829268292682, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n unsigned long long n,c=0;\n scanf(\"%llu\",&n);\n while(n!=1)\n {\n if(n%2!=0){n=(n/2)+1;c++;}\n else {n=n/2;c++;}\n }\n printf(\"%llu\",c);\n}\n", "lang": "GNU C11", "bug_code_uid": "3e8c545448b93f2fbdf81742db5e49d7", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "c19bdf3889b992ef744156dbec8639cd", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3619344773790952, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main(){\n\tlong long int n,i=0;\n\tscanf(\"%lld\",&n);\n\tlong long int f[n+1];\n\tf[0] =1;\n\tf[1] =2;\n\tf[2] = 3;\n\tfor (int k = 3; k < n+2; k++)\n\t{\n\t\tf[k] =2 ;\n\t}\n\ti=2;\n\tif(n>2){\n\t\twhile(f[i]<=n){\n\t\t\tfor (int j = 0; j < i ; j++)\n\t\t\t{\n\t\t\t\tf[i+1] = f[i+1] + f[j] ;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}\n\tif (n==2)\n\t{\n\t\tprintf(\"1\");\n\t\treturn 0;\n\t}\n\telse {\n\t\tprintf(\"%lld\\n\", i-1);\n\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "c5a1fe68237c87ce7a1d987f05f20428", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "5c862c49b889bab978a9abe5f4c0ab3f", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.30338733431516934, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main(){\n\tlong long int n,i=0;\n\tscanf(\"%lld\",&n);\n\tif(n<1000) long long int f[n];\n\telse long long int f[n/10];\n\tf[0] =1;\n\tf[1] =2;\n\tf[2] = 3;\n\tfor (int k = 3; k < n+2; k++)\n\t{\n\t\tf[k] =2 ;\n\t}\n\ti=2;\n\tif(n>2){\n\t\twhile(f[i]<=n){\n\t\t\tfor (int j = 0; j < i ; j++)\n\t\t\t{\n\t\t\t\tf[i+1] = f[i+1] + f[j] ;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}\n\tif (n==2)\n\t{\n\t\tprintf(\"1\");\n\t\treturn 0;\n\t}\n\telse {\n\t\tprintf(\"%lld\\n\", i-1);\n\t}\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "605d8a6d2dbaf70626cae8d50b1e3f85", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "5c862c49b889bab978a9abe5f4c0ab3f", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1423948220064725, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\n#include\n\nconst int N = 505, MOD = 1000000007;\n\nint f[2][505][505];\n\nint poww[505];\n\nint main() {\n int n, k,j,i,last;\n scanf(\"%d%d\", &n, &k);\n poww[0] = 1;\n for (i = 1; i <= 500; ++i) {\n poww[i] = poww[i - 1] * 2 % MOD;\n }\n int now = 1;\n f[1][0][0] = 1;\n for (i = 1; i <= n; ++i) {\n int next = now ^ 1;\n for (j = 0; j < i && j <= k; ++j) {\n for (k = 0; k < i; ++k) {\n (f[next][j + 1][i] += (long long)(poww[i - k] - 1) * poww[k] % MOD * f[now][j][k] % MOD);f[next][j+1][i] %= MOD;\n (f[next][j][k] += (long long)poww[k] * f[now][j][k] % MOD);f[next][j][k] %= MOD;\n f[now][j][k] = 0;\n }\n }\n now = next;\n }\n int ans = 0;\n for (last = 0; last <= n; ++last) {\n (ans += f[now][k][last]);ans %= MOD; \n }\n printf(\"%d\\n\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2bc60eef53ec0e97ce3c7336de851a08", "src_uid": "111673158df2e37ac6c019bb99225ccb", "apr_id": "81bbd6276ce995be0344fa84e5ef4493", "difficulty": 2500, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9310810810810811, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint main()\n{\n\tint n, m, num, min3, min1 = 10, min2 = 10, flag = 0;\n\t\n\tscanf(\"%d %d\", &n, &m);\n\t\n\tint temp[10];\n\t\n\tfor(int i = 0; i < n; i++){\n\t\tscanf(\"%d\", &num);\n\t\t++temp[num - 1];\n\t\tif(num < min1){\n\t\t\tmin1 = num;\n\t\t}\n\t}\n\tfor(int i = 0; i < m; i++){\n\t\tscanf(\"%d\", &num);\n\t\t++temp[num - 1];\n\t\tif(num < min2){\n\t\t\tmin2 = num;\n\t\t}\n\t}\n\t\n\tfor(int i = 0; i < 10; i++){\n\t\tif(temp[i] > 0){\n\t\t\tif(temp[i] == 2){\n\t\t\t\tflag = 1;\n\t\t\t\tmin3 = i + 1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif(min1 < min2 && flag = 0){\n\t\tprintf(\"%d%d\\n\", min1, min2);\n\t}else if(min1 > min2 && flag == 0){\n\t\tprintf(\"%d%d\\n\", min2, min1);\n\t}else if(min1 == min2){\n\t\tprintf(\"%d\\n\", min1);\n\t}else if(min1 < min2 && flag == 1 || min1 > min2 && flag == 1){\n\t\tprintf(\"%d\\n\", min3);\n\t}\n}", "lang": "GNU C11", "bug_code_uid": "66652acc85a011977f96bdd45e619499", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "aef207a6f2c26a66b8fc23cbd943a8eb", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3079604880883207, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "#include\nint main()\n{\n int m,n,min1,min2,i,t;\n int a[100];\n int b[100];\n scanf(\"%d%d\",&m,&n)\n for(i=0; ia[i])\n min1=a[i];\n }\n for(i=0; ib[i])\n min2=b[i];\n }\n if(min1min2)\n printf(\"%d\\n\",min2*10+min1);\n if(min1==min2)\n printf(\"%d\\n\",min1);\n}\n", "lang": "GNU C11", "bug_code_uid": "d94f1e43c2fc97f7552d36f1272c0629", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "421440e4345e779d06877a8213dbbe92", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9858299595141701, "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 int n,x,y;\n char ch;\n scanf(\"%d%c\",&n,&ch);\n x=n;\n if(n%2!=0)\n x=x+1;\n x=x/2;\n if(x%2!=0)\n x++;\n x=x/2;\n y=16*(x-1);\n if(n%2==0)\n y=y+7;\n if(ch=='f')\n y=y+1;\n else if(ch=='e')\n y=y+2;\n else if(ch=='d')\n y=y+3;\n else if(ch=='a')\n y=y+4;\n else if(ch=='b')\n y=y+5;\n else if(ch=='c')\n y=y+6;\n printf(\"%d\",y);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "97c0b806ef630f3d556b1d9cf4b20e2a", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "55cf6cd825f536094bdc774fdc215366", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.50814332247557, "equal_cnt": 33, "replace_cnt": 12, "delete_cnt": 17, "insert_cnt": 3, "fix_ops_cnt": 32, "bug_source_code": "#include \n#include \n#include \nint main()\n{\n int i;\n char s[102],h[6],k=0;\n scanf(\"%s\",s);\n for(i=0;i\n\nint count(long long n) {\n\treturn n == 0 ? 0 : count(n & n - 1) + 1;\n}\n\nint main() {\n\tlong long s, x;\n\n\tscanf(\"%lld%lld\", &s, &x);\n\tif (s < x || (s - x) % 2 != 0)\n\t\tprintf(\"0\\n\");\n\telse\n\t\tprintf(\"%lld\\n\", (1LL << count(x)) - (s == x ? 2 : 0));\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "58292471d27dd191fc60237ac1122bac", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "bed7fb8b1bcba04ff7105e3d010ae73f", "difficulty": 1700, "tags": ["dp", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9162195625257945, "equal_cnt": 21, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "#include \n#include \n#include \n#define LL long long\n#define uLL unsigned long long\nlong ms[2000000];\nvoid print(LL *a,long size) {long i;for (i=1;isize) {e=size;}\n\t\t\tfor (j=1;(s=s;b--)\n\t\t\t{\n\t\t\t\tds[e--]=ds[b];\n\t\t\t}\n\t\t\tfor (b=1;b>1;\n}\ninline uLL bsf64(uLL a)\n{\n\tasm(\"bsfl %0,%0\":\"+r\"(a));\n\treturn a; \n}\ninline uLL bsr64(uLL a)\n{\n\tasm(\"bsrl %0,%0\":\"+r\"(a));\n\treturn a; \n}\ninline LL max(LL a,LL b) {if (b>a) {a=b;}return a;}\ninline LL min(LL a,LL b) {if (a>b) {a=b;}return a;}\nLL ans1[1000000],ans2[1000000];\nlong num[1000],num2[1000];\nint main()\n{\n//\tfreopen(\"in.in\",\"r\",stdin);\n\tlong i,j,k,a,b,c,l,p,q,baka,r,m,n,mid;\n\tscanf(\"%ld %ld\\n\",&n,&m);\n//\tprintf(\"%ld %ld\\n\",n,m);\n\tfor (i=1;i<=n;i++)\n\t{\n\t\tscanf(\"%ld\",&num[i]);\n\t}\t\n\tif (n>10) {q=n>>1;} {q=n;}\n\t*ans1=(LL)1<>1;\n\t\t\tif (ans1[mid]0) {b=(ans2[i]+ans1[r])%m;baka=max(b,baka);}\n\t\tl=1;r=*ans1;a=2*m-1-ans2[i];\n\t\twhile (l<=r)\n\t\t{\n\t\t\tmid=(l+r)>>1;\n\t\t\tif (ans1[mid]0) {b=(ans2[i]+ans1[r])%m;baka=max(b,baka);}\t\t\n\t}\n\tprintf(\"%lld\\n\",baka);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1fc6b2508900204af488f0b561f48699", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "39c6cb7fa0bddf48a5fcd2d73b76fcff", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9714518760195758, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n#include \n#define LL long long\n#define uLL unsigned long long\nlong ms[2000000];\nvoid print(LL *a,long size) {long i;for (i=1;isize) {e=size;}\n\t\t\tfor (j=1;(s=s;b--)\n\t\t\t{\n\t\t\t\tds[e--]=ds[b];\n\t\t\t}\n\t\t\tfor (b=1;b>1;\n}\ninline int bsf64(int a)\n{\n\t__asm__(\"bsfl %0,%0\":\"+r\"(a));\n\treturn a; \n}\ninline int bsr64(int a)\n{\n\t__asm__(\"bsrl %0,%0\":\"+r\"(a));\n\treturn a; \n}\ninline LL max(LL a,LL b) {if (b>a) {a=b;}return a;}\ninline LL min(LL a,LL b) {if (a>b) {a=b;}return a;}\nLL ans1[1000000],ans2[1000000];\nlong num[1000],num2[1000];\nint main()\n{\n//\tfreopen(\"in.in\",\"r\",stdin);\n\tlong i,j,k,a,b,c,l,p,q,r,m,n,mid;\n\tLL baka;\n\tscanf(\"%ld %ld\\n\",&n,&m);\n//\tprintf(\"%ld %ld\\n\",n,m);\n\tfor (i=1;i<=n;i++)\n\t{\n\t\tscanf(\"%ld\",&num[i]);\n\t\tnum[i]=num[i]%m;\n\t}\t\n\tif (n>10) {q=n>>1;} {q=n;}\n\t*ans1=(LL)1<>1;\n\t\t\tif (ans1[mid]0) {b=(ans2[i]+ans1[r])%m;baka=max(b,baka);}\n\t\tl=1;r=*ans1;a=2*m-1-ans2[i];\n\t\twhile (l<=r)\n\t\t{\n\t\t\tmid=(l+r)>>1;\n\t\t\tif (ans1[mid]0) {b=(ans2[i]+ans1[r])%m;baka=max(b,baka);}\t\t\n\t}\n\tprintf(\"%lld\\n\",baka);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a7a492c995a9984aaa51b7ddf51a1bc3", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "39c6cb7fa0bddf48a5fcd2d73b76fcff", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9989880590973487, "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#define LL long long\n#define uLL unsigned long long\nlong ms[2000000];\nvoid print(LL *a,long size) {long i;for (i=1;isize) {e=size;}\n\t\t\tfor (j=1;(s=s;b--)\n\t\t\t{\n\t\t\t\tds[e--]=ds[b];\n\t\t\t}\n\t\t\tfor (b=1;b>1;\n}\ninline int bsf64(int a)\n{\n\t__asm__(\"bsfl %0,%0\":\"+r\"(a));\n\treturn a; \n}\ninline int bsr64(int a)\n{\n\t__asm__(\"bsrl %0,%0\":\"+r\"(a));\n\treturn a; \n}\ninline LL max(LL a,LL b) {if (b>a) {a=b;}return a;}\ninline LL min(LL a,LL b) {if (a>b) {a=b;}return a;}\nLL ans1[1000000],ans2[1000000];\nlong num[1000],num2[1000];\nint main()\n{\n//\tfreopen(\"in.in\",\"r\",stdin);\n\tlong i,j,k,a,b,c,l,p,q,r,m,n,mid;\n\tLL baka;\n\tscanf(\"%ld %ld\\n\",&n,&m);\n//\tprintf(\"%ld %ld\\n\",n,m);\n\tfor (i=1;i<=n;i++)\n\t{\n\t\tscanf(\"%ld\",&num[i]);\n\t\tnum[i]=num[i]%m;\n\t}\t\n\tif (n>10) {q=n>>1;} {q=n;}\n\t*ans1=(LL)1<>1;\n\t\t\tif (ans1[mid]0) {b=(ans2[i]+ans1[r])%m;baka=max(b,baka);}\n\t\tl=1;r=*ans1;a=2*m-1-ans2[i];\n\t\twhile (l<=r)\n\t\t{\n\t\t\tmid=(l+r)>>1;\n\t\t\tif (ans1[mid]0) {b=(ans2[i]+ans1[r])%m;baka=max(b,baka);}\t\t\n\t}\n\tprintf(\"%lld\\n\",baka);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "0f051d07e7f2a3a83dce5a9a30e1e4fe", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "39c6cb7fa0bddf48a5fcd2d73b76fcff", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2868369351669941, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "#include \n#include \n#include \n\nint main(){\n\tint n, k, i;\n\tchar *ballons;\n\tchar alphabet[125];\n\n\tfor(i=0;i<125;i++){\n\t\talphabet[i] = 0;\n\t}\n\n\n\tscanf(\"%d %d\", &n, &k);\n\n\tballons = (char *) malloc(n*sizeof(char));\n\n\tscanf(\"%s\", ballons);\n\n\tfor(i=0;ballons[i]!='\\0';i++){\n\t\talphabet[ballons[i]]++;\n\t}\n\n\n\tfor(i=0;i<125;i++){\n\t\tif(alphabet[i]%k!=0){\n\t\t\tprintf(\"NO\\n\");\n\t\t\texit(1);\n\t\t}\n\t}\n\n\tprintf(\"YES\\n\");\n\n\treturn 0;\n}\n/* 1506095773244 */\n", "lang": "GNU C", "bug_code_uid": "9fb17d9656f184d41af0c4b1f2a17eef", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "f2948ef5bd85aa415c89267728e339e1", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9860031104199067, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nint main()\n{\nint n,i,U,D,L,R,cmd,x,y;\nU=L=D=R=cmd=x=y=0;\nscanf(\"%d\",&n);\nchar str[n];\nscanf(\"%s\",str);\n\nfor(i=0;i\n#include\nint\tmain(void)\n{\n\tint\tr1,r2,c1,c2;\n\tint\tj,h,w;\n\t\n\tscanf(\"%d%d%d%d\",&r1,&c1,&r2,&c2);\n\tif(r1 == r2 || c1 == c2)\n\t\tj = 1;\n\telse\n\t\tj = 2;\n\tif((r1 + c1) % 2 == (r2 + c2) % 2 && abs((r1 - r2)) == abs((c1 - c2)))\n\t\th = 1;\n\telse if((r1 + c1) % 2 != (r2 +c2) % 2)\n\t\th = 0;\n\telse if((r1 + c1) % 2 == (r2 + c2) % 2)\n\t\th = 2;\n\tif(r1 == r2 && c1 == ||(r1 + c1) % 2 == (r2 + c2) % 2 && abs((r1 - r2)) == abs((c1 - c2)))\n\t\tw = abs(c2 - c1);\n\telse\n\t\tw = abs(c2 - c1) + abs(r1 - r2);\n\tprintf(\"%d %d %d\\n\",j,h,w);\n\n\treturn\t0;\n}\n", "lang": "GNU C", "bug_code_uid": "b20b1d6b1d1b81c19192821eb50c2928", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "5f6cd9a29bca137f36c0bfa0e8f0c355", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9748482220294883, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint min(int a,int b){\n if(a\nint main ()\n{\n\tint j,i,n,k;\n\tchar arr[1]\n\t\tscanf(\"%d\",&n);\n\tfor(i=0 ; i<4 ;i++)\n\t\tfor(j=0 ; j<4 ; j++)\n\t\t\tscanf(\"%d\",&arr[i][j]);\n\treturn 0; }\n", "lang": "GNU C", "bug_code_uid": "0ee4ed3d7bf77928ab1486bba8506b9a", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "d3c17fc107d360f357af1b22abe043cb", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9518348623853211, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include\n#include\n#include\n#include\n#include\nusing namespace std;\n\nint compare(const void *a,const void *b)\n{\n return (*(int *)a-*(int *)b);\n}\nint main()\n{\n int x[8],y[8],i,j;\n for(i=0;i<8;i++)\n {\n scanf(\"%d %d\",&x[i],&y[i]);\n }\n for(i=0;i<8;i++)\n {\n for(j=i+1;j<8;j++)\n { \n\t\t\tif(x[i]==x[j]&&y[i]==y[j])\n {\n printf(\"ugly\");\n return 0;\n }\n else\n {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n }\n qsort(x,8,sizeof(int),compare);\n qsort(y,8,sizeof(int),compare);\n\n if(x[1]==x[0]&&x[2]==x[1]&&x[4]==x[3]&&x[7]==x[6]&&x[5]==x[7]&&x[3]>x[0]&&x[6]>x[3]&&y[3]>y[2]&&y[5]>y[4]&&y[4]==y[3]&&y[0]==y[1]&&y[1]==y[2]&&y[6]==y[7]&&y[5]==y[6]&&y[3]!=y[1])\n {\n\t\tprintf(\"respectable\\n\");\n\t}\n\telse\n\t{\n printf(\"ugly\\n\");\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "ed7f2c26e455ab4fd54a8f338910a1d1", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "29c1285eb4d50a4416c6552d9dc843f3", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5573095401509952, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint ar[8][2];\n\nint comp(const void *a, const void *b)\n{\t\n\tif( *(int *)a == *(int *)b)\n\t\treturn (*(((int *)a)+1)) > (*(((int *)b)+1));\n\treturn *(int *)a > *(int *)b;\n}\n\nint main()\n{\n\tint i;\n\tfor(i=0;i<8;i++)\n\t\tscanf(\" %d %d\",&ar[i][0], &ar[i][1]);\n\t\t\n\tqsort(ar,8,2*sizeof(int),comp);\n\t\n\tif(\tar[0][0]==ar[1][0] && ar[1][0]==ar[2][0] && \n\t\tar[3][0]==ar[4][0] &&\n\t\tar[5][0]==ar[6][0] && ar[6][0]==ar[7][0] &&\n\t\tar[0][1]==ar[3][1] && ar[3][1]==ar[5][1] &&\n\t\tar[1][1]==ar[6][1] &&\n\t\tar[2][1]==ar[4][1] && ar[4][1]==ar[7][1])\n\t\tprintf(\"respectable\\n\");\n\n\telse printf(\"ugly\\n\");\n\t\t\n\t\n//\tfor(i=0;i<8;i++)\n//\t\tprintf(\"%d %d\\n\",ar[i][0],ar[i][1]);\n\t\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c017ada7d07c486583d1513f725480c6", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "8ba7ee235674e42c6f9c85ba1b2322ba", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9948186528497409, "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\tint dp[501];\n\tdp[3] = 6;\n\tfor (int i = 4; i <= 500; i++)\n\t{\n\t\tdp[i] = dp[i - 1] + ( i - 1 ) * i;\n\n\t}\n\n\tint n;\n\n\tscanf_s(\"%d\", &n);\n\n\tprintf(\"%d\\n\", dp[n]);\n\n}", "lang": "GNU C11", "bug_code_uid": "f439577f40c01cf003699566759a7928", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "cbb6afae0a252250b4d6795da79a0128", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9776632302405498, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n int n,i,j,k,sum=0,min=1000000;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++){\n j=i+1;\n k=i+2;\n if(j>n){\n j=j%n;\n }\n if(k>n){\n k=k%n;\n }\n while(k!=i){\n sum=sum+(j*k);\n j++;\n k++;\n if(j>n){\n j=j%n;\n }\n if(k>n){\n k=k%n;\n }\n }\n sum=sum*i;\n if(sum\nint main(){\n int n;\n long long ans=0;\n scanf(\"%d,&n);\n for(int i=1;i\n#include \n\nint main()\n{\n int l,h,lc,u,s,a,b,x,y,i,c=0;\n scanf(\"%d %d %d %d\",&x,&y,&a,&b);\n if(x>y)\n {l=x;s=y;}\n else\n {l=y;s=x;}\n /*for(i=1;i<=s;i++)\n {\n if(i%x==0 && i%y==0)\n h=i;\n }*/\n // lc=x*y/h;\n //u=(b/lc)*lc;\n for(i=a;i<=b;i++)\n {\n if(i%lc==0)\n {c++;\n // printf(\"%d\\n\",i);\n }\n }\n /*if(x==y)\n c=b-a+1;*/\n printf(\"%d\",c);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5fb96fa4a8aeca1baa5b8c2ed37af63e", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "afad999195e1be5a7609eae7dd84ae7e", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8525576730190572, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nint gcd(int, int);\nint lcm(int, int);\n\nvoid main()\n{\n\tint x, y, LCM;\n\tlong int a, b, i, count;\n\tscanf(\"%d %d %ld %ld\", &x, &y, &a, &b);\n\t\n\tLCM = lcm(x, y);\n\t\n\tcount = 0;\n\tfor (i=a; i <= b; i++)\n\t{\n\t\tif (i % LCM == 0)\n\t\t\tcount++;\n\t}\n\t\n\tprintf(\"%ld\\n\", count);\n}\n\n\nint gcd(int a, int b)\n{\n\tint temp;\n\tif (b <= a)\n\t{\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttemp = b;\n\t\t\tb = a % b;\n\t\t\ta = temp;\n\t\t}\n\t\treturn b;\n\t}\n\telse return gcd(b, a); \n}\n\n\nint lcm(int a, int b)\n{\n\treturn (a * b) / gcd(a, b);\n}\n", "lang": "GNU C", "bug_code_uid": "8250a331b5007ebac3174c1fdd171dcb", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "499fb8cb8d6e88c22d80903d87e43135", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5737704918032787, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main(){\n\n int x, y;\n long long a, b, cont = 0;\n\n scanf (\"%d %d %lld %lld\", &x, &y, &a, &b);\n\n for(int i = a; i <= b; i++){\n\n if (!(i%x) && !(i%y)) cont++;\n }\n printf (\"%lld\", cont);\n}\n\n/* 1503333786279 */\n", "lang": "GNU C", "bug_code_uid": "d89d188142961c372c30027d6fcc2205", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "0bae81773337ea5c968788508de06035", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3772893772893773, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include\nint main()\n{\n int x,y,i,cou=0;\n long int a,b;\n scanf(\"%d %d %ld %ld\",&x,&y,&a,&b);\n \n for(i=a;i<=b;i++)\n {\n if(!(i%(x*y)))\n cou++;\n }\n printf(\"%d\\n\",cou);\n }\n \n \n", "lang": "GNU C", "bug_code_uid": "05542dbefc939a848ca64c4882c95d76", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "44ff01f6a515f82c6a4771fabe9735d4", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8392647633946031, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#include\nunsigned long long int gcd(unsigned long long int x,unsigned long long int y){\n unsigned long long int i;\n for(i=x;i>=1;i--){\n if(x%i==0&&y%i==0){\n break;\n }\n }\n return i;\n}\nint main()\n{\n unsigned long long int x,a,b,n,y,i,k,m,z,t,count=0;\n scanf(\"%llu%llu%llu%llu\",&x,&y,&a,&b);\n if(x==y)\n {\n m=(b-a)/x;\n if(a%x==0||b%x==0)\n m=m+1;\n printf(\"%llu\\n\",m);\n }\n else if(x>y)\n {\n if(a%x==0)\n i=a;\n else\n {\n t=a/x;\n i=(t*x)+x;\n }\n while(i\nint main ()\n{\n int i,j,n,l,f,a,b,count=0;\n scanf(\"%d %d %d %d\",&l,&f,&a,&b);\n n=a+l-(a-1)%l-1;\n for(i=n;i<=b;i=i+l) {\n if(i%f==0) {\n count++;\n }\n }\n printf(\"%d\\n\",count);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "46c10db0a236d5f5df762c0e88505807", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "d1fcfcc35fca7b9ceb13a94b88309318", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.06297229219143577, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include\nusing namespace std;\nint gcd(int a,int b)\n{\n if(b == 0){\n return a;\n }\n gcd(b,a%b);\n}\nint main()\n{\n int a,b,x,y;\n cin>>a>>b>>x>>y;\n if(a == 1&&b == 1){\n cout<\n#include\n#define inf 0xffffffffff\nint a[inf];\nint n;\nvoid work(){\n\tint i;\n\tint x=n;\n\tint count=0;\n\tint m=1;\n\twhile(x){\n\t\tif(x%2){count++;a[m]=1;}\n\t\tx/=2;\n\t\tm++;\t\n\t}\n\tfor(i=m;i>0;i--){\n\t\tif(count>1&&a[i]){printf(\"%d \",i);count--;}\n\t\telse if(a[i]){printf(\"%d\\n\",i);break;}\n\t}\n\treturn ;\n}\nint main(){\n\twhile(~scanf(\"%d\",&n)){\n\t\tmemset(a,0,sizeof(a));\n\t\twork();\t\n\t}\n}\n", "lang": "GNU C", "bug_code_uid": "061f227d1f46a5fda181ff845c13f953", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "1364c4bfb8888d26c713c2667abfb841", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9934640522875817, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint main(){\n int za, cvp = 1, x = 0;\n scanf(\"%d\",&za);\n while(n){\n cvp = 1;\n x = 0;\n while(cvp<=za){cvp*=2;x++;}cvp/=2;x--;\n\n\n\n\n\n printf(\"%d \",x+1);\n za-=cvp;\n }\n}\n", "lang": "GNU C", "bug_code_uid": "6fc2b68d7bb7a66cbee130d755f9ed91", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "f7ce343818de86f9f3781b97c6c497db", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.803082191780822, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 9, "bug_source_code": "#include\n#define HELL 1000000007\n#define MAX 400005\n#define getchar_unlocked() getchar()\nchar fast_c;\nunsigned long fast_j;\nunsigned long fast_in()\n{\n\tfor(fast_c=getchar_unlocked(); fast_c<'0'||fast_c>'9'; fast_c=getchar_unlocked());\n\tfor(fast_j=0; fast_c>='0'&&fast_c<='9'; fast_c=getchar_unlocked())\n\t\tfast_j=(fast_j<<1)+(fast_j<<3)+(fast_c-'0');\n\treturn fast_j;\n}\nint main()\n{\n\tlong n,i=30,start=(1<<30);\n\tn=fast_in();\n\t//printf(\"%lu\",n);\n\tfor(;!(n/start);start>>=1,i--);\n\tfor(;n;start>>=1,i--)\n\t{\n\t\t//printf(\"hmm %ld\\n\",start);\n\t\tif(n/start)\n\t\t\tprintf(\"%ld \",i+1);\n\t\tn-=start;\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "3bb60f42b4aefd80cc98206baf14ae3e", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "74de5737ecf950b9c66127c92c087d0c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4444444444444444, "equal_cnt": 21, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 7, "fix_ops_cnt": 21, "bug_source_code": "#include \n#define max 20000\nmain()\n{\n\n\nint a[max][max],n,i,x,count,j;\nscanf(\"%d %d\",&n,&x);\n\nfor(i=0;i\n#define max(a,b) (((a)>(b)) ? (a) : (b))\n\nint main()\n{\n\tint n, m, c0, d0, i, j, t;\n\tscanf(\"%d %d %d %d\",&n,&m,&c0,&d0);\n\tint arr[m+1][4];//[0] ai,[1] bi, [2] ci, [3] di\n\tint max_num[m+1];\n\tfor(i = 0; i < m;i++){\n\t\tscanf(\"%d %d %d %d\",&arr[i][0],&arr[i][1],&arr[i][2],&arr[i][3]);\n\t}\n\tarr[m][2] = c0;arr[m][3] = d0;\n\tfor(i = 0;i < m; i++){\n\t\tmax_num[i] = arr[i][0] / arr[i][1];\n\t}max_num[m] = n / c0;\n\tint dp[n+1] = {0};\n\tfor(i = 0; i < m+1; i++){\n\t\tfor(j = 0; j < max_num[i];j++){\n\t\t\tfor(t = n+1; t >= arr[i][2];t--){\n\t\t\t\tdp[t] = max(dp[t], dp[t-arr[i][2]] + arr[i][3]);\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", dp[n]);\n}\n", "lang": "GNU C11", "bug_code_uid": "c08232c9c7a9dcc30140ea76c4eb4a61", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "8c8a0585bd935c2e19e6bec644a4d95c", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9992313604919293, "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 main()\n{\n\tint n, m, c0, d0, i, j, t;\n\tscanf(\"%d %d %d %d\",&n,&m,&c0,&d0);\n\tint arr[m+1][4];//[0] ai,[1] bi, [2] ci, [3] di\n\tint max_num[m+1];\n\tfor(i = 0; i < m;i++){\n\t\tscanf(\"%d %d %d %d\",&arr[i][0],&arr[i][1],&arr[i][2],&arr[i][3]);\n\t}\n\tarr[m][2] = c0;arr[m][3] = d0;\n\tfor(i = 0;i < m; i++){\n\t\tmax_num[i] = arr[i][0] / arr[i][1];\n\t}\n\tmax_num[m] = n / c0;\n\tint dp[n+1];\n\tfor(i=0;i= arr[i][2];t--){\n\t\t\t\tdp[t] = max(dp[t], dp[t-arr[i][2]] + arr[i][3]);\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", dp[n]);\n}\n", "lang": "GNU C11", "bug_code_uid": "3c3ae79ee9e79fa1be171dcb08a18bc4", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "8c8a0585bd935c2e19e6bec644a4d95c", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9984051036682615, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \nint com[150];\nchar s[1005];\n\nint min(int a, int b)\n{\n return a < b ? a : b;\n}\n\nint main()\n{\n int n, i, tot;\n scanf(\"%d%s\", &n, s);\n for(i = 0; i < n; ++i)\n ++com[s[i]];\n tot = 2 (min(com['U'], com['D']) + min(com['L'], com['R']));\n printf(\"%d\\n\", tot);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "2203fc213d58cfea9eefc1ce76afe767", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "a11f14e923dcb33054e0b68e6178e993", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9569093610698366, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\n#include\nint main(){\n\tint n,i,a=0,b=0,c=0,d=0,sum=0;\n\tchar s[110];\n\tscanf(\"%s\",s);\n\tn=strlen(s);\n\tfor(i=0;ib) sum+=2*b;\n\t\telse sum+=2*a;\n\t\tif(c>d) sum+=2*d;\n\t\telse sum+=2*c;\n\t}\n\tprintf(\"%d\\n\",sum);\n\treturn 0;\n}\n\t", "lang": "GNU C", "bug_code_uid": "2126852c65467cfdea38217cec358df6", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "614a30b6f9246fa42dd4eb45922e8ec4", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9953488372093023, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nint t,n;\n\nint main() {\n scanf(\"%d\",&n);\n if(n==2){\n printf(\"white\\n1 2\"); \n }else if(n%2==0){\n printf(\"white\\n2 2\");\n }else{\n printf(\"black\");\n }\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "a757dbe4d5ffd4153614ce5f91f01901", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "59a0a9d98ef9a427ac349176bd2e2dc4", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.994535519125683, "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;\n scanf(\"%d\",&n);\n if(n%2!=0)\n {\n printf(\"black\");\n }\n else\n {\n printf(\"White\\n1 2\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fdfe71d7945829bbf92bba5de4005019", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "0f9db8c828a7994067065cab8d75095c", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5252525252525253, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nmain(){\nint n,a,i,b;\nscanf(\"%d\",&n);\nfor(a=1;a<=n;a++)\n{\n n=n%i;\n if(n%2!=0){\n printf(\"Mahmoud\");\n }\n else if(n%2==0){\n printf(\"Ehab\");\n }\n}\n\n}\n\n", "lang": "GNU C11", "bug_code_uid": "b6c1c54179d70bc74ba7534939c367ab", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "4f51e480db04eab0d6d82c58ee4a1734", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9973333333333333, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nvoid sort(int a[],int b[],int n)\n{\n\tint i,j;\n\tfor(i=0;ia[j+1])\n\t\t\t{\n\t\t\t\tint temp=a[j];\n\t\t\t\ta[j]=a[j+1];\n\t\t\t\ta[j+1]=temp;\n\t\t\t\ttemp=b[j];\n\t\t\t\tb[j]=b[j+1];\n\t\t\t\tb[j+1]=temp;\n\t\t\t}\n\t\t\tif(a[j]==a[j+1] && b[j]>b[j+1])\n\t\t\t{\n\t\t\t\tint temp=b[j];\n\t\t\t\tb[j]=b[j+1];\n\t\t\t\tb[j+1]=temp;\n\t\t\t}\n\t\t}\n}\n\n\nint main()\n{\n\tint a[8];\n\tint b[8];\n\tint i;\n\tfor(i=0;i<8;i++)\n\t\tscanf(\"%d%d\",&a[i],&b[i]);\n\tsort(a,b,8);\n\tint in=a[i];\n\tfor(i=0;i<3;i++)\n\t\tif(a[i]!=in)\n\t\t\tbreak;\n\tif(i<3)\n\t{\n\t\tprintf(\"ugly\\n\");\n\t\treturn 0;\n\t}\n\tin=a[i];\n\tfor(i=3;i<5;i++)\n\t\tif(a[i]!=in)\n\t\t\tbreak;\n\tif(i<5)\n\t{\n\t\tprintf(\"ugly\\n\");\n\t\treturn 0;\n\t}\n\tin=a[i];\n\tfor(i=5;i<8;i++)\n\t\tif(a[i]!=in)\n\t\t\tbreak;\n\tif(i<8)\n\t{\n\t\tprintf(\"ugly\\n\");\n\t\treturn 0;\n\t}\n\tif(a[0]==a[3] || a[3]==a[5] || a[0]==a[5])\n\t{\n\t\tprintf(\"ugly\\n\");\n\t\treturn 0;\n\t}\n\tint first=b[0];\n\tint mid=b[1];\n\tint last=b[2];\n\tif(first==mid || mid==last || first==last)\n\t{\n\t\tprintf(\"ugly\\n\");\n\t\treturn 0;\n\t}\n\tif(first==b[3] && first==b[5] && last==b[4] && last==b[7] && mid==b[6])\n\t{\n\t\tprintf(\"respectable\\n\");\n\t\treturn 0;\n\t}\n\tprintf(\"ugly\\n\");\n\treturn 0;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "84f75b890719440308156810ecd17ad1", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "f6345e1fbe531f86891dd0891c2891bb", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9474590869939707, "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 i,j,n,temp,ans=1;\n\tint a[8][2];\n\tfor(i=0;i<8;i++)\n\t{\n\t\tscanf(\"%d%d\",&a[i][0],&a[i][1]);\n\t}\n\tfor(i=0;i<8;i++)\n\t{\n\t\tfor(j=i+1;j<8;j++)\n\t\t{\n\t\t\tif(a[j][1]>a[i][1])\n\t\t\t{\n\t\t\t\ttemp=a[j][1];\n\t\t\t\ta[j][1]=a[i][1];\n\t\t\t\ta[i][1]=temp;\n\t\t\t\ttemp=a[j][0];\n\t\t\t\ta[j][0]=a[i][0];\n\t\t\t\ta[i][0]=temp;\n\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=0;i<3;i++)\n\t{\n\t\tfor(j=i+1;j<3;j++)\n\t\t{\n\t\t\tif(a[j][0]>a[i][0])\n\t\t\t{\n\t\t\t\ttemp=a[j][0];\n\t\t\t\ta[j][0]=a[i][0];\n\t\t\t\ta[i][0]=temp;\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=3;i<5;i++)\n\t{\n\t\tfor(j=i+1;j<5;j++)\n\t\t{\n\t\t\tif(a[j][0]>a[i][0])\n\t\t\t{\n\t\t\t\ttemp=a[j][0];\n\t\t\t\ta[j][0]=a[i][0];\n\t\t\t\ta[i][0]=temp;\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=5;i<8;i++)\n\t{\n\t\tfor(j=i+1;j<8;j++)\n\t\t{\n\t\t\tif(a[j][0]>a[i][0])\n\t\t\t{\n\t\t\t\ttemp=a[j][0];\n\t\t\t\ta[j][0]=a[i][0];\n\t\t\t\ta[i][0]=temp;\n\t\t\t}\n\t\t}\n\t}\n/*\tfor(i=0;i<8;i++)\n\t{\n\t\tprintf(\"%d %d\\n\",a[i][0],a[i][1]);\n\t}\n\t*/\n\tif(a[0][1]==a[1][1] && a[1][1]==a[2][1] && a[3][1]==a[4][1] && a[5][1]==a[6][1] && a[6][1]==a[7][1] && a[0][0]==a[3][0] && a[0][0]==a[5][0] && a[1][0]==a[6][0] && a[2][0]==a[4][0] && a[4][0]==a[7][0])\n\n\t\tprintf(\"respectable\\n\");\n\telse\n\t{\n\t\tprintf(\"ugly\\n\");\n\t}\n\treturn 0;\n}\t\n", "lang": "GNU C", "bug_code_uid": "7e3dad30ef48fbc02846c9bf74b275a9", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "8ac6f0a8e20d3dfc0aebe3a47e2cd772", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8979238754325259, "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#define MAXN 1e9\n\nint a[9][2];\nint x[8], y[8];\nint xx[10], yy[10];\n\nint cmp(const void *a, const void *b){\n return *((int *)a)-*((int *)b);\n}\n\n\nint main(){\n int i, j;\n int xlen, ylen;\n int flag = 1;\n\n for(i=0; i<8; i++){\n scanf(\"%d%d\", &a[i][0], &a[i][1]);\n x[i] = a[i][0];\n y[i] = a[i][1];\n }\n\n qsort(x, 8, sizeof(int), cmp);\n qsort(y, 8, sizeof(int), cmp);\n\n xlen = 1;\n xx[xlen] = x[0];\n for(i = 1; i<8; i++){\n if(xx[xlen]!=x[i])\n xx[++xlen] = x[i];\n }\n\n ylen = 1;\n yy[ylen] = y[0];\n for(i = 1; i<8; i++){\n if(yy[ylen]!=y[i])\n yy[++ylen] = y[i];\n }\n\n if(xlen!=3||ylen!=3){\n printf(\"ugly\\n\");\n }\n else{\n for(i = 0; i<8; i++){\n if(a[i][0] == xx[2]&&a[i][1] == yy[2]){\n flag = 0;\n break;\n }\n }\n if(flag) printf(\"respectable\\n\");\n else printf(\"ugly\\n\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d6b07a4c334ecbc529ac65e934a5bce4", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "385eb5f5f307ba6df28300e17643e405", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.791566265060241, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \nint compare(const void *a,const void *b)\n{\n return (*(int *)a-*(int *)b);\n}\nint main()\n{\n int x[8],y[8],i,j,arr[8][8];\n for(i=0;i<8;i++)\n {\n scanf(\"%d %d\",&x[i],&y[i]);\n scanf(\"%d %d\",&arr[i][0],&arr[i][1]);\n }\n qsort(x,8,sizeof(int),compare);\n qsort(y,8,sizeof(int),compare);\n for(i=0;i<8;i++)\n {\n for(j=0;j<8;j++)\n if(arr[i][i]==arr[j][j])\n {\n return \"ugly\";\n }\n }\n if(x[1]==x[0]&&x[2]==x[1]&&x[4]==x[3]&&x[7]==x[6]&&x[5]==x[7]&&x[3]>x[0]&&x[6]>x[3]&&y[3]>y[2]&&y[5]>y[4]&&y[4]==y[3]&&y[0]==y[1]&&y[1]==y[2]&&y[6]==y[7]&&y[5]==y[6]&&y[3]!=y[1])\n printf(\"respectable\");\n else\n printf(\"ugly\");\n //printf(\"Hello world!\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2ce6f4373468dd3d3de7ae1f36e1d178", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "a84922bd368cc8e173a25c9bc84e0d16", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9904458598726115, "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\nstruct nodes{\n\tint x;\n\tint y;\n}node[10];\nint cmp(const void *a,const void *b)\n{\n\treturn *(int *)a-*(int *)b;\n}\nint main()\n{\n\tint n,x[10],y[10],a[10],b[10],flag=1,i,j,k;\n\tfor(i=0;i<8;i++)\n\t{\n\t\tscanf(\"%d%d\",&node[i].x,&node[i].y);\n\t\tx[i]=node[i].x;\n\t\ty[i]=node[i].y;\n\t}\n\tqsort(x,8,sizeof(x[0]),cmp);\n\tqsort(y,8,sizeof(y[0]),cmp);\n\ta[0]=x[0];\n\tfor(i=1,j=0;i<8;i++)\n\t\tif(x[i]!=a[j])\n\t\t{\n\t\t\ta[j+1]=x[i];\n\t\t\tj++;\n\t\t}\n\tif(j>2)\n\t\tflag=0;\n\tb[0]=y[0];\n\tfor(i=1,j=0;i<8;i++)\n\t\tif(y[i]!=b[j])\n\t\t{\n\t\t\tb[j+1]=y[i];\n\t\t\tj++;\n\t\t}\n\tif(j>2)\n\t\tflag=0;\n\tif(flag)\n\tfor(i=0;i<=2;i++)\n\t{\n\t\tflag=0;\n\t\tfor(j=0;j<=2;j++)\n\t\t{\t\n\t\t\tif(i==1&&j==1)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor(k=0;k<8;k++)\n\t\t\t\t\tif(a[i]==node[k].x&&b[j]==node[k].y)\n\t\t\t\t\t\tflag=1;\n\t\t\t\tif(flag==0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(flag==0)\n\t\t\tbreak;\n\t\t\n\t}\n\tif(flag==0)\n\t\tprintf(\"ugly\\n\");\n\telse\n\t\tprintf(\"respectable\\n\");\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "b4a100ede0ab54d572a1c6f4670f64cf", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "60090698c756123b1c5035d951d32eda", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.028656716417910448, "equal_cnt": 20, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "#include \n#include \n\nchar g[64][64];\nint x,y;\n\n#define PUT(a,b) if(a>=0 && a=0 && b=x || b>=y || !g[a][b])\n#define INSIDE(a,b) (a>=0 && b>=0 && a0) {\n ret--;\n put(x2,y2);\n }\n }\n return ret;\n}\n\n \nint main() {\n int best=0,t,cur,i,ans;\n scanf(\"%d %d\",&x,&y);\n if(x>y) t=x,x=y,y=t;\n if(x==1 && y==1) { printf(\"0\\n\"); return 0; }\n if(x==1) {\n printf(\"%d\\n\",y-(y-1)/3-1);\n return 0;\n }\n if(x==3) {\n printf(\"%d\\n\",2*y); return 0;\n }\n if(x==2) {\n ans=0;\n for(i=0;i\n#define oo 1000000000\n#define lowbit(a) ((a)&(-(a)))\n#define max(a,b) ((a)>(b)?(a):(b))\n\nint f[42][65][65],v[65];\nint n,m;\n\nvoid dfs(int i,int j,int k,int now,int a,int b,int c)\n{\n if (now>n)\n f[i+1][b][c]=max(f[i+1][b][c],f[i][j][k]+n-v[a]);\n else\n {\n if (i>1)\n dfs(i,j,k,now+1,a|(1<1)\n dfs(i,j,k,now+1,a,b|(1<m)\n {\n n^=m;\n m^=n;\n n^=m;\n }\n for (i=1;i<=1<=0)\n dfs(i,j,k,1,j,k,0);\n for (i=0;i<1<\nint main()\n{\n long long int x,y,a,b,k,lcm,p,i,count=0;\n scanf(\"%I64d %I64d %I64d %I64d\",&x,&y,&a,&b);\n\n if(x=a&&p<=b){\n count++;\n }\n else if(p>b){\n break;\n }\n }\n\n printf(\"%I64d\\n\",count);\n\n\n\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "7065e387c222d46b24e0c65f649503ae", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "e618578aa4f286584b5c80812eba5c40", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6773162939297125, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include \nint main()\n{\n long long int x,y,a,b,p,lcm,count=0;\n scanf(\"%I64d %I64d %I64d %I64d\",&x,&y,&a,&b);\n\n for(p=a;p<=b;p++){\n if(p%x==0&&p%y==0){\n count++;\n }\n\n }\n printf(\"%I64d\\n\",count);\n\n\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "e320d50e183aadff40ae324c5a0988d8", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "e2f882543ffe567748806751c2344676", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9808541973490427, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n\nint main()\n{\n\n int n,m;\n\n int min1=10,min2=10,min3=10;\n int k=0;\n scanf(\"%d %d\",&n,&m);\n\n int a[n+1],b[m+1];\n int keep1[n+1];\n\n for(int i=0;imin2)\n {\n printf(\"%d%d\\n\",min2,min1);\n }\n \n }\n\n return 0;\n\n}\n", "lang": "GNU C11", "bug_code_uid": "8598f17116cc4ceca55dc33f8a268b96", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "91531ffed36711a08a3b594731a498de", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3805668016194332, "equal_cnt": 27, "replace_cnt": 15, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 26, "bug_source_code": "#include \n#include \nint main()\n{\n\tlong long m,t,c,z,i;\n\tlong long a[10000];\n\tscanf(\"%lld\",&m);\n\tt=1;\n\tc=1;\n\twhile(m>t)\n\t{\n\t\tm-=t;\n\t\tt=t*2;\n\t\tc++;\n\t}\n\tprintf(\"%lld\",c);\n\tif(m!=1)\n\t{\n\t\tm--;\n\t\tc--;\n\t\twhile(m>c)\n\t\t{\n\t\t\tprintf(\" %lld\",c);\n\t\t\tm-=c;\n\t\t\tc--;\n\t\t}\n\t\tprintf(\" %lld\",c);\n\t}\n\tprintf(\"\\n\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "d3ce9b634931be0d42cf6268a675ff26", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "1ce0b516ae804b86c0002c0fb206411a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.702020202020202, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n#include \nusing namespace std;\nint main()\n{\n int n;\n cin >> n;\n for (int i = 20; i >= 0; i--)\n {\n if (n & (1 << i)) cout << i + 1 << \" \";\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "e66fe753e2fae27ce9d720ccbe7e3885", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "1ce0b516ae804b86c0002c0fb206411a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.05025125628140704, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "# depslib dependency file v1.0\n1550798693 source:c:\\users\\��С��\\desktop\\ѵ����\\main.cpp\n\t\n\t\n\n", "lang": "GNU C11", "bug_code_uid": "8acbdbee619a5d3ddbc4b9f5ffc245fa", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "f58c509c39b4b099494359d847c087ad", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.019169329073482427, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "codeforces.com/problemset/status/786/problem/A", "lang": "GNU C11", "bug_code_uid": "57c3fdf17a0ebf56f843f8a1cf19c680", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "a239f42caee15d009be49e4fbce4b333", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.37063778580024065, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "#include \n#include\n \nusing namespace std;\n \nint main()\n{\n \n long int n,k,l,c,d,p,nl,np,x,y,z,s;\n scanf(\"%ld %ld %ld %ld %ld %ld %ld %ld\",&n,&k,&l,&c,&d,&p,&nl,&np);\n x=k*l/nl;\n y=c*d;\n z=p/np;\n \n if(x<=y && x<=z){\n s=x;\n }\n else if(y<=x && y<=z){\n s=y;\n }\n else{\n s=z;\n }\n cout<\n#include \n#include \n\nint main()\n{\nint n,k,l,c,d,p,np,nl;\nscanf(\"%d %d %d %d %d %d %d %d\",&n,&k,&l,&c,&d,&p,&np,&nl);\nint Toast=min(min(k * l / nl, c * d), p / np) / n;\nprintf(\"%d\",Toast);\n}\n", "lang": "GNU C11", "bug_code_uid": "1ebde587b8dda2bc1d3ed856381dc23a", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "96fbfcdc95c47c8537ed199a5bf1fc88", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8179419525065963, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main()\n{\n long double n,num;\n scanf(\"%Lf\",&n);\n ++n;\n if(n%2==0)\n num=n/2;\n else\n num=n;\n printf(\"%Lf\",num);\n}", "lang": "GNU C11", "bug_code_uid": "1aece683de7c5bf9ac759c6d9504bc8e", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "c23a84ca23e7ef210fe8d863409201b7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1575492341356674, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "\n#include\nint main()\n{\n int b,m,n;\n scanf(\"%d\",b);\n n=b+1;\nm=n%2;\n if(b==0)\n {\n printf(\"0\");\n }\n else if(m==0)\n{\n printf(\"%d\",n/2);\n}\nelse\n{\n printf(\"%d\",n);\n}\n}\n", "lang": "GNU C11", "bug_code_uid": "7162eba84889ea118ff8d6b38027ee6b", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "14abb1f0c52c7a814bb5de5248435c6a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7286135693215339, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "#include \n#include \n#include \n\nint asc(int h[], int i, int j){\n\tfor(int k=i; k h[k+1]){\n\t\t\treturn 0;\t\t\t\t\t\t\t\t\n\t\t}\n\t}\n\treturn 1;\n}\n\nint main(){\n\tchar *s;\n\tscanf(\"%s\",s);\n\tint size = strlen(s);\n\tint present =0;\n\n\tint h[size];\n\tfor(int i=0; i= hellosize && asc(h,i,j)){\n\t\t\t\t\t\tprintf(\"YES\");\n\t\t\t\t\t\tpresent++;\n\t\t\t\t\t\texit(0);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif(present == 0){\n\t\tprintf(\"NO\");\n\t}\n\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "404af9d0ce49874cabd666e36f9a99dc", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "87cfabba51e7713ca0eab1dc9ee6b608", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9708029197080292, "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 n, j, x, i, sum = 0;\n scanf(\"%%I64d\", &n);\n\n for(i = 1; i <= n; i++) {\n x = 2;\n for(j = i; j > 1; j--) {\n x = 2 * x;\n }\n sum += x;\n }\n printf(\"%%I64d\", sum);\n\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "3aee2df8ccef214f3f7bad8a2ac1ebca", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "32933cf7bf47fa29d3179af786beaee8", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5895953757225434, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "#include\n#include\nint main(){\n\tint n;\n\tscanf(\"%d\",&n);\n\tint i,j,sum=0,f;\n\tfor(i=1;i<=n;i++){\n\t\tj=i;\n\t\tf=1;\n\t\twhile(j>0){\n\t\t\tf=f*2;\n\t\t\tj--;\n\t\t}\n\t\tsum=sum+f;\n\t}\n\tprintf(\"%d\\n\",sum);\n}\t\t\t\t\n\t\t\n", "lang": "GNU C", "bug_code_uid": "077a7a5ca9ea107a0bee5f00657dfc82", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "87c8e98fe95a90204bccbb2d7e821bbc", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.19183673469387755, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include\nmain()\n{\n int i,j,k,l,a,d,b,c,m=-1,n=0,e[1000],f[1000],s[1000];\n scanf(\"%d\",&i);\n for(a=1;a<=i;a++)\n {\n for(b=1;b<=i;b++)\n {\n if(b>=a)\n {\n c=a*b;\n if(c==i)\n {\n m=m+1;\n d=b-a;\n s[m]=d;\n e[m]=a;f[m]=b;\n }\n }\n }\n }\n for(k=m;k>=0;k--)\n {\n for(l=m;l>=0;l--)\n {\n if(s[k]>s[l])\n n=n+1;\n }\n if(n==0)\n {\n printf(\"%d\",e[k]);\n printf(\"\\t\");\n printf(\"%d\",f[k]);\n }\n n=0;\n }\n}\n", "lang": "GNU C", "bug_code_uid": "15f7007ff805d860eaa83338934552d9", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "81ef5a93a753d3f431d0d93726ea24df", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9905362776025236, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\ntypedef unsigned u;\nint main()\n{\n\tu n,a,x,y;\n\tscanf(\"%u\",&n);\n\tfor(a=1;a*a<=n;)if(n%a==0){x=a;y=n/a;}\n\tprintf(\"%u %u\\n\",x,y);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "361b9c5593434129e907e9cd2285aec2", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "bde274c43380df0b430c9f937402c88d", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9504617968094039, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n\nint prime(int n)\n{\n\tint count = 0;\n\t\n\tfor(int i = 1; i <= n; i++)\n\t{\n\t\tif( n % i == 0)\t\tcount++;\n\t\tif(count > 2)\t\treturn 0;\n\t}\n\t\n\treturn 1;\n}\n\nint root(int n)\n{\n\tfor(int i = 1; i <= n; i++)\n\t{\n\t\tif( i * i == n )\treturn i;\n\t\telse\t\t\t\treturn i-1;\n\t}\n\n}\n\nint main()\n{\n\tint n, a, b;\n\tscanf(\" %d\", &n);\n\t\n\tint x = root(n);\n\t\n\tif(prime(n))\tprintf(\"%d %d\\n\", 1, n);\n\t\n\telse\t\t\t\n\t{\n\t\tfor( b = x; b <= n; b++)\n\t\t{\n\t\t\tfor( a = 1; a <= b; a++)\n\t\t\t{\n\t\t\t\tif( a * b == n )\n\t\t\t\t{\n\t\t\t\t\tprintf(\"%d %d\\n\", a, b);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t} \t\n\t\t\t\n\t\n\t}\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "f6d04ba83a4ed808257ce279fb529f34", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "8553fe3f27479f431a261ddae8e42e96", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8630009319664492, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "//\n// main.cpp\n// 20170710\n//\n// Created by 36 on 17/7/10.\n// Copyright (c) 2017年 rjxy. All rights reserved.\n//\n\n#include \n\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int t;\n int min=n;\n int mina,minb;\n int a,b,zha;\n for(t=1;t<=n;t++)\n {\n a=t;\n b=n/t;\n zha=b-a;\n //printf(\"%d %d\\n\",a,b);\n if(zha<=min&&zha>=0)\n {\n mina=a;\n minb=b;\n min=zha;\n }\n }\n printf(\"%d %d\",mina,minb);\n}\n", "lang": "GNU C", "bug_code_uid": "2cc8bd4840b3763aa06b8bdd74b20ec6", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "f764013b011b1c44514906c78574c12b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8893528183716075, "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 unsigned int n;\n scanf(\"%u\",&n);\n if(n%2==0){\n printf(\"white\\n\");\n printf(\"1 2\");\n }else{\n printf(\"black\\n\");\n if(n==3)printf(\"2 1\");\n else printf(\"1 2\");\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "97cd2cc65e3fbbe650a896caf1d2e996", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "94b634371c90c00084558737d8f81e37", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9702380952380952, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \nint main() {\n int n;\n while (scanf(\"%d\", &n) == 1)\n if (n == 2) printf(\"white\\n1 2\\n\");\n else printf(\"black\\n\");\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "ed15ef3bbd5e9f56ca5292ce4a45ba74", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "25a7e51bc4302f25fe1f40759d592b6f", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.990418118466899, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint lucky(int x)\n{\n while (x) {\n\tif (x % 10 != 4 && x % 10 != 7) break;\n\n\tx /= 10;\n }\n\n if (x == 0) {\n\treturn 1;\n } else {\n\treturn 0;\n }\n}\n\nint fact(int n)\n{\n int x = 1, i;\n\n for (i = 1; i <= n; i++) x *= i;\n\n return x;\n}\n\nint main()\n{\n int n, k, p = 0, q = 2, r = 2, sum = 0, i, j;\n long long x = 1;\n int a[10000], b[100];\n\n scanf(\"%d %d\", &n, &k);\n\n a[0] = 4;\n a[1] = 7;\n\n for (i = 0; i < 8; i++) {\n\tfor (j = p; j < q; j++) {\n\t a[r++] = a[j] * 10 + 4;\n\t a[r++] = a[j] * 10 + 7;\n\t}\n\n\tp = q;\n\tq = r;\n }\n\n for (i = 1; i <= n; i++) {\n\tx *= i;\n\n\tif (x >= k) break;\n }\n\n if (i > n) {\n\tputs(\"-1\");\n\n\treturn 0;\n }\n\n if (x == k) i++;\n\n for (j = 0; j < r; j++) {\n\tif (a[j] > n - i) break;\n\n\tsum++;\n }\n\n q = 0;\n\n for (j = n - i + 1; j <= n; j++) b[q++] = j;\n\n for (j = n - i + 1; j < n; j++) {\n\tp = k / fact(n - j);\n\n\tif (k % fact(n - j) == 0) p--;\n\n\tif (lucky(j) == 1 && lucky(b[p]) == 1) sum++;\n\n\tfor (i = p; i < q; i++) b[i] = b[i + 1];\n\n\tk -= p * fact(n - j);\n }\n\n if (lucky(n) == 1 && lucky(b[0]) == 1) sum++;\n\n printf(\"%d\\n\", sum);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "1b847fb16f910d84de325c20047152c2", "src_uid": "cb2aa02772f95fefd1856960b6ceac4c", "apr_id": "21cb49bac026d7bc07e376a6f1fce3b8", "difficulty": 1900, "tags": ["brute force", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9691991786447639, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#define min(a, b) ((a < b) ? (a) : (b))\n#define max(a, b) ((a > b) ? (a) : (b))\n\nint l = 1, r, answ, t = 1;\nlong long a[11];\nlong long ans[2048];\nint b[13], use[13];\nint n, m, k;\n\nint\nanalyze(void)\n{\n int i, nonzero = 0;\n long long tmp = 0;\n for(i = 10; i >= 0; --i){\n if(a[i] == 0 && nonzero){\n return 1;\n }\n tmp = tmp * 10 + a[i];\n if (a[i] != 0){\n nonzero = 1;\n }\n }\n if(tmp >= r){\n ans[n++] = tmp;\n return 0;\n }\n if(tmp >= l){\n ans[n++] = tmp;\n }\n return 1;\n}\n\nvoid\ngo(int i)\n{\n if(!t){\n return;\n }\n if (i == -1){\n t = analyze();\n return;\n }\n a[i] = 0;\n go(i - 1);\n a[i] = 4;\n go(i - 1);\n a[i] = 7;\n go(i - 1);\n}\n\nvoid\ngen(int n, int p, int k){\nif(p > 0){\n int i, ans = 1;\n for(i = 1; i <= p - 1; ++i){\n ans *= i;\n }\n int tmp = k / ans;\n if(k % ans == 0){\n --tmp;\n }\n for(i = 0; ; ++i){\n if(use[i] == 0){\n if(tmp > 0){\n --tmp;\n } else {\n use[i] = 1;\n b[n - p] = i;\n break;\n }\n }\n }\n gen(n, p - 1, k % ans ? k % ans : ans);\n}\n}\n\nint\nmain(void)\n{\n scanf(\"%d%d\", &m, &k);\n r = m;\n go(10);\n answ = 0;\n int i, j, q;\n for(i = 0; ans[i] <= m - 13; ++i){\n ++answ;\n }\n gen(min(13, m), min(13, m), k);\n for(i = 0; i < min(13, m); ++i){\n b[i] += max(1, m - 12);\n }\n for(i = max(1, m - 12); i <= m; ++i){\n for(j = 0; j < n; ++j){\n if(ans[j] == i){\n for(q = 0; q < n; ++q){\n if(b[i - max(1, m - 12)] == ans[q]){\n ++ answ;\n }\n }\n }\n }\n }\n printf(\"%d\", answ);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d754ab15c135b54a10da7e4a59d64526", "src_uid": "cb2aa02772f95fefd1856960b6ceac4c", "apr_id": "cce329b1dd97bdde7e5f67b7f180654d", "difficulty": 1900, "tags": ["brute force", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8734177215189873, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nint bul(int a,int b,int d)\n{\n\tint i;\n\tfor(i=1;i<=d;i++)\n\t\tif(i%a==0 && i%b==0)\n\t\t\treturn i;\n\treturn 0;\n}\n\nvoid oku()\n{\n\tint a,b,c,d,i,e,q;\n\tscanf(\"%d %d %d %d\",&a,&b,&c,&d);\n\te=bul(a,b,d);\n\tfor(i=c,q=0;i<=d;i++)\n\t\tif(i%e==0 && i>=e)\n\t\t{\n\t\t\tc=i;\n\t\t\tbreak;\n\t\t}\n\tfor(i=d;i>=c;i--)\n\t\tif(i%e==0)\n\t\t{\n\t\t\td=i;\n\t\t\tbreak;\n\t\t}\n\tif(c>d)\n\t{\n\t\tprintf(\"0\");\n\t\treturn;\n\t}\n\tprintf(\"%d\",(d-c)/e+1);\n}\n\nint main()\n{\n\toku();\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "616145aeb1655ca758b1e282b797edf6", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "381154bd96753199e646b99611034f06", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.11957205789804909, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include \n\nint main(void)\n{\n int hi, ai, di, hy, ay, dy, hm, am, dm, hc, ac, dc, val = 500000;\n scanf(\"%d %d %d %d %d %d %d %d %d\",\n &hy, &ay, &dy, &hm, &am, &dm, &hc, &ac, &dc);\n for (hi = 0; hi <= 300; hi++)\n for (ai = 0; ai <= 300; ai++)\n for (di = 0; di <= 300; di++) {\n int decy = am - dy - di;\n int decm = ay + ai - dm;\n int t, curc;\n if (decm <= 0)\n continue;\n t = (hm + decm - 1) / decm;\n if (decy > 0 && t >= (hy + hi + decy - 1) / decy)\n continue;\n curc = hi * hc + ai * ac + di * dc;\n if (curc < val)\n val = curc;\n }\n printf(\"%d\\n\", val);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "3fd1094c80be72338c11083a9e27f23e", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "db9a970cc4a5f7bf1964982ed70f4a9b", "difficulty": 1800, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9986168741355463, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "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}\nint main()\n{\n\tlong long var3,hitm,hity,var1, var2,hpy,atky,defy,hpm,atkm,defm,h,a,d;\n\tscanf(\"%lld %lld %lld\",&hpy, &atky, &defy);\n\tscanf(\"%lld %lld %lld\",&hpm, &atkm, &defm);\n\tscanf(\"%lld %lld %lld\",&h, &a, &d);\n\tlong long min=1000000000000,i,j,k;\n\thitm=max(0,atkm-defy);\n\thity=max(0,atky-defm);\n\tfor(i=0;i<=1046;i++)\n\t\tfor(j=0;j<=105;j++)\n\t\t\tfor(k=0;k<=105;k++)\n\t\t\t{\n\t//\t\t\tprintf(\"%lld %lld %lld\\n\",i,j,k);\n\t\t\t\tvar1=hpy+i;var2=atky+j;var3=defy+k;\n\t\t\t\thity=max(0,var2-defm);\n\t\t\t\thitm=max(0,atkm-var3);\n\t\t\t\tif(hitm==0 && hity>0)\n\t\t\t\t{\n\t\t\t\t\tif(i*h +j*a +k*d (hpm-1)/(hity)+1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(i*h + j*a + k*d < min)\n\t\t\t\t\t\t{\n\t\t\t\t//\t\t\tprintf(\"%lld %lld %lld\\n\",i,j,k);\n\t\t\t\t\t\t\tmin=i*h+j*a+k*d;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\tprintf(\"%lld\\n\",min);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "40adf9d343bb28504d1a83c61d41a110", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "cdd12198dd2c880e085715162b29c4dd", "difficulty": 1800, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8324175824175825, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\nint main()\n{\n\tchar s[50];\n\tscanf(\"%s\",s);\n\tint n= strlen(s),t[50];\n\tfor(int r=0;r<50;r++)\n\tt[r]=0;\n\t//for(int r=0;r<50;r++)\n\t//printf(\"%d\",n);\n\tfor(int o=0;ot[q])\n\t\t{min=t[q];}\n\t}\n\t//min=n/min;\n\n\t//printf(\"%db'\",min);\n\tint c=0,l;\n\tl=n/min;\n\t//printf(\"%dc'\",l);\n\tfor(int f=0;f\n#include\nint main(){\n\tint a,b,c,v;\n\tchar s[51];\n\tchar d[51];\n\tchar h[51];\n\ta=0;\n\tb=0;\n\tscanf(\"%s\", & s);\t\n\twhile(s[b]!='\\0'){\n\t\tb++;\n\t}\n\tb--;\n\tc=1;\n\tstrcpy(h,s);\n\twhile(1){\n\t\tstrcpy(d,s);\n\t\ts[0]=d[b];\n\t\tv=0;\n\t\tc=1;\n\t\twhile(v!=b){\n\t\t\ts[c]=d[c-1];\n\t\t\tc++;\n\t\t\tv++;\n\t\t}\n\t\tif(strcmp(h,s)==0){\n\t\t\tprintf(\"%d\\n\", a);\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\ta++;\n\t\t}\n\t}\n}", "lang": "GNU C", "bug_code_uid": "5233de627e9bb629cde4752ec7b21ebf", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "a6a2c0dc83e16ffb977d1bbafaf27df5", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.33353846153846156, "equal_cnt": 18, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "#include\n\nint a[101];\n\nint main()\n{\n int i, n, flag = 0, tmp = 0, max = 0, r, l = 0, mr = 102, ml = 0, count = 0;\n\n scanf(\"%d\", &n);\n\n r = n - 1;\n\n for(i=0; i l){\n for(i=0; i<=n; i++){\n if(i>=l && i<=r) tmp = tmp + 1 - a[i];\n else tmp = tmp + a[i];\n }\n //printf(\"tmp : %d %d %d\\n\", l, r, tmp);\n if(max < tmp){\n max = tmp;\n mr = r;\n ml = l;\n }\n tmp = 0;\n //printf(\"max : %d %d %d\\n\", ml, mr ,max);\n if(flag == 0){\n for(i=l+1; i=0; i--){\n if(a[i] == 0){\n r = i;\n flag = 0;\n break;\n }\n }\n }\n }\n\n for(i=0; i=ml && i<=mr) count = count + 1 - a[i];\n else count = count + a[i];\n }\n\n printf(\"%d\\n\", count);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d6ae56a4d1d3aafdcfa057464e1a378e", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "84c7ea577090f07971f9534ae622d017", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2657718120805369, "equal_cnt": 22, "replace_cnt": 18, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 22, "bug_source_code": "#include\n#define MAX 100\n#define maxOf(a,b) a>b?a:b\nvoid maxOnes(int *,int,int,int);\nint countOnes(int *,int,int,int);\nint ans[MAX][MAX]={0};\nint main(){\n int n,a[MAX]={0},i,j,maxval=0;\n scanf(\"%d\",&n);\n for(i=0;imaxval){\n maxval=ans[i][j];\n }\n printf(\"%d\\n\",maxval);\n return 0;\n}\n\nvoid maxOnes(int *arr,int low,int high,int n){\n if(low>high)\n return;\n ans[low][high]=countOnes(arr,low,high,n);\n maxOnes(arr,low,high-1,n);\n maxOnes(arr,low+1,high,n);\n}\n\nint countOnes(int *arr,int i,int j,int n){\n int k,count=0;\n for(k=0;k=i)&&(k<=j)&&(*(arr+k)==0))\n count++;\n else if((*(arr+k)==1)&&((kj)))\n count++;\n }\n //printf(\"%d %d %d\\n\",i,j,count);\n return count;\n}\n", "lang": "GNU C", "bug_code_uid": "913a15c412780256a53347c2ead4bce8", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "58162fdd277cb735b1e3e48909c40b1f", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "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;\n scanf(\"%d\",&n);\n int a[n];\n for (int i=0;i\n\n \nint main ()\n{\n \n int i, j, k, l;\n int a[100];\n scanf(\"%d\",&l);\n for(i=0; i\n#include\n#include\n#define STR_MAX 5\n\nvoid leerCant(int *);\nvoid cargarDatos(const int, int *);\nchar* check(const int, int *);\n\nint main(void){\n int n;\n leerCant(&n);\n int vec[n];\n cargarDatos(n, vec);\n char * res=check(n, vec);\n printf(\"%s\", res);\n return 0;\n}\n\n\nvoid leerCant(int *n){\n scanf(\"%d\", n);\n return;\n}\n\n\nvoid cargarDatos(const int dim, int * v){\n int i;\n for (i=0;i\n\nint main(void) {\nint n,t,z,time;\nchar s;\nscanf(\"%d\",&n);\nscanf(\"%c\",&s);\nif(s=='f')\n{\n\tt=1;\n}\nelse if(s=='e')\n{\n\tt=2;\n}\nelse if(s=='d')\n{\n\tt=3;\n}\nelse if(s=='a')\n{\n\tt=4;\n}\nelse if(s=='b')\n{\n\tt=5;\n}\nelse \n{\n\tt=6;\n}\n\nif(n%4==1)\n{\n\ttime=(n-1)+t+(n-1)*3;\n}\nelse if(n%4==2)\n{\n\ttime=(n-1)+t+6+(n-2)*3;\n}\nelse if(n%4==3)\n{\n\ttime=(n-3)+t+(n-3)*3;\n}\nelse if(n%4==0)\n{\n\ttime=(n-3)+t+6+(n-4)*3;\n}\n\nprintf(\"%d\",time);\n\treturn 0;\n}\n\n", "lang": "GNU C", "bug_code_uid": "7d411f06d7210dee111658ab5e58b61d", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "b2e94f3fc2b319c70fd448537e9cd520", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.4448621553884712, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \n#include \n#include \n\nvoid make(long long *n, char *s)\n{\n *n = 0;\n char c = getchar();\n\n while(isdigit(c))\n {\n (*n) = (*n)*10 + c - '0';\n c = getchar();\n }\n\n *s = c;\n}\n\nint main(void)\n{\n long long n;\n char s;\n\n long long sec = 0;\n long long at1 = 1, at2 = 3;\n\n int diff = 1;\n\n make(&n, &s);\n\n for(;;)\n {\n if(at1 == n)\n break;\n\n if(at2 == n)\n break;\n\n at1 += diff;\n at2 += diff;\n\n sec += 6 + diff;\n\n if(diff == 1)\n diff = 3;\n else\n diff = 1;\n }\n\n if(s == 'f')\n sec++;\n else if(s == 'e')\n sec += 2;\n else if(s == 'd')\n sec += 3;\n else if(s == 'a')\n sec += 4;\n else if(s == 'b')\n sec += 5;\n else\n sec += 6;\n\n printf(\"%lld\\n\", sec);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c3e40673e56147c206ca4402c86f2683", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "98b70d1b92e55cbd8a812f3eb4576244", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9991095280498664, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nmain()\n{\n char a[55];\n scanf(\"%s\", a);\n int x=strlen(a), y=strspn(a, &a[x-1]);\n if(x==y)\n {printf(\"1\");}\n else\n {\n for(int i=x-1; i>1;)\n {\n if(x%i==0)\n {\n int z=x/i, w=z;\n while(z\n#include\nint main()\n{\n long sum=0;\n int i, m, p, j;\n char s[51], b[51], c[51];\n scanf(\"%s\", &s);\n p=strlen(s);\n char a[p][p+1];\n strcpy(c, s);\n strcpy(a[0], s);\n for(m=1,j=1 ; m\n#include\nint main()\n{\n\tchar str[255], pass[255];\n\t\n\tint ctr1 = 0;\n\t\n\tscanf(\"%s\", &str);\n\t\n\tint len = strlen(str);\n\t\n\tchar temp[255];\n\t\n\tstrcpy(temp, str);\n\t\n\tfor(int i = 0; i < len; i++){\n\t\tfor(int j = 0, k = i; j < len; j++, k = (k + 1) % len){\n\t\t\tpass[j] = str[k];\n\t\t}\n\t\tif(strcmp(temp, pass) == 0 && ctr1 > 0){\n\t\t\tbreak;\n\t\t}\n\t\t++ctr1;\n\t}\n\t\n\tprintf(\"%d\\n\", ctr1);\n}", "lang": "GNU C11", "bug_code_uid": "5578c4e0bc04441f21a49b406a995302", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "697cb25471b07d8506838233dd0fa38c", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.939060939060939, "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#define MIN(a,b) ab?a:b\n#define rep(i,a,b) for(i=a;ib;i--)\n#define sf(a) scanf(\"%d\",&(a))\n#define pf(a) printf(\"%d\",(a))\n#define sfll(a) scanf(\"%lld\",&(a))\n#define pfll(a) printf(\"%lld\",(a))\n#define ssf(a) scanf(\"%s\",(a))\n#define spf(a) printf(\"%s\",(a))\n#define spc printf(\" \");\n#define nl printf(\"\\n\")\n#define play int main()\n#define out return\ntypedef int I;\ntypedef long long LL;\ntypedef char S;\ntypedef float F;\ntypedef double D;\n/*int cmp(const void *a,const void *b)\n{\n return (*(int*)a-*(int*)b);\n}*/\nplay\n{\n S s[51];\n ssf(s);\n int l=strlen(s),i,j,c=0;;\n S a[l][l+1];\n strcpy(a[0],s);\n rep(i,1,l)\n {\n a[i][0]=a[i-1][l-1];\n rep(j,1,l)\n a[i][j]=a[i-1][j-1];\n a[i][l]='\\0';\n }\n rep(i,0,l)\n if(strcmp(s,a[i]))\n c++;\n pf(c+1);\n nl;\n out 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "550cfae3512b2c6722e4f0511610e90a", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "6b3880593783d0684e2861819ab2dd11", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9076233183856502, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\n\nint main(void)\n{\n\tint a,b,c,n;\n\tscanf(\"%d %d %d\",&a,&b,&c);\n\tif(a==2){\n\t\tn=(b+1)*(c+1);\n\t\tprintf(\"%d\",n-2);\n\t}\n\telse if(b==2) {\n\t\tn=(a+1)*(c+1);\n\t\tprintf(\"%d\",n-2);\n\t}\n\telse if(c==2) {\n\t\tn=(b+1)*(a+1);\n\t\tprintf(\"%d\",n-2);\n\t}\n\telse {\n\t\tif(b>=a && c>=a) {\n\t\t\tn=(b+a-1)*(c+a-1);\n\t\t\tp=(a-1)*(a-2);\n\t\t\tprintf(\"%d\",n-p);\n\t\t}\n\t\telse if(a>=b && c>=b) {\n\t\t\tn=(b+a-1)*(c+b-1);\n\t\t\tp=(b-1)*(b-2);\n\t\t\tprintf(\"%d\",n-p);\n\t\t}\n\t\telse if(a>=c && b>=c) {\n\t\t\tn=(c+a-1)*(c+b-1);\n\t\t\tp=(c-1)*(c-2);\n\t\t\tprintf(\"%d\",n-p);\n\t\t}\n\t}\n\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "66c1e4f08eb161a251f49719830fcd2d", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "0665e1ca339131ea247eb15ee1566c0b", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8587412587412587, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\n\n#define sI(n) scanf(\"%d\",&n)\n#define sS(s) scanf(\"%s\",s)\n#define sL(l) scanf(\"%I64d\",&l)\n#define PN printf(\"\\n\")\n\ntypedef long long int ll;\n\nint main(){\n\tint a ,b;\n\tint c;\n\tsI(a);\n\tsI(b);\n\tsI(c);\n\n\tprintf(\"%d\",c+c+(b-1)*(c+1));\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "703a559f8804377fc3e5942bdc868a0e", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "525bf02ad02347ce16df7485e24c7721", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.7840909090909091, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nmain()\n{\n int a,b,c,ans;\n scanf(\"%d%d%d\",&a,&b,&c);\n ans=c*(a+b-1)+(b-1);\n printf(\"%d\",ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "97091e2829c560fe2e8d6476a1057e97", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "dd7e1a2535f797d92a063f828163ee80", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9994514536478333, "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 x , y ;\n scanf(\"%d\" ,&x );\n scanf (\"%d\", &y);\n int line1 [x];\n int line2 [y];\n int i ;\n int great1 = 9;\n int great2 = 9 ;\n int great =0 ;\n for (i=0;i line1[i] && line1[i]> 0 )\n great1= line1 [i] ;\n }\n for (i=0 ; i line2[i] && line2[i]> 0)\n great2= line2 [i] ;\n }\n\n if (great1 > great2 ) {\n great = great2 *10 + great1 ;\n }\n else if (great2 > great1 ) {\n great = great1 *10 + great2 ;\n }\n else \n great = great1 ;\n int j ;\n for (i =0 ; i < x ; i ++){\n for ( j =0 ; j < y ; j ++){\n if (line1[i]== line2 [j] && line2[j] < great){\n great = line2 [j];8\n break ;}\n }\n } \n printf(\"%d\", great );\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "4d986727c2413ce10ac6569fb378f977", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "31d5990e6e8d63b35d7c60b3fab59e74", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9990243902439024, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\n#include\nint main()\n{\n\tint i=0,j=0,n,x;\n\tscanf(\"%d%d\",&n,&x);\n\ti=n%6;\n\t if((i==1||i==0)&&x==2) \n\t printf(\"2\");\n\t else if((i==2||i==5)&&x==1)\n\t print(\"2\");\n else if((i==3||i==4)&&x==0) \n printf(\"2\");\n else if((i==1||i==4)&&x==1) \n printf(\"0\");\n else if((i==2||i==3)&&x==2) \n printf(\"0\");\n else if((i==5||i==0)&&x==0)\n printf(\"0\");\n else if((i==1||i==2)&&x==0)\n printf(\"1\");\n else if((i==3||i==0)&&x==1)\n printf(\"1\");\n else if((i==4||i==5)&&x==2)\n printf(\"1\");\t\n}", "lang": "GNU C", "bug_code_uid": "0e302f8afee71ff440a0e0f6e85ee6cf", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "6fc78ffadd37065439cd8ae2d17f3649", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9937694704049844, "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 n, x;\n scanf(\"%d%d\", &n, &x);\n for(int i = n; i >= 1; i--){\n if(i % 2 == 0){\n if(x == 1)\n x++;\n\n else if(x == 2)\n x--;\n }\n else{\n if(x == 0)\n x++;\n \n else if(x == 1)\n x--;\n }\n }\n printf(\"%d\\n\", x);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "786fc7b5079b2b0e482fa539a701c2dd", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "e39ad41d4302d513aff9e24d9c47740e", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9882100750267953, "equal_cnt": 2, "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,y,i,j;\n int A[3]={0};\n scanf(\"%d %d\",&x,&y);\n A[y]=3;\n for(i=x;i>=1;i--)\n {\n if(i%2==1)\n {\n j=A[0];\n A[0]=A[1];\n A[1]=j;\n }\n else if(i%2==0)\n {\n j=A[2];\n A[2]=A[1];\n A[1]=j;\n }\n }\n for(i=0;i<3;i++)\n {\n if(A[i]==3)\n printf(\"%d\",i);\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "62bd5cbba34c8e44f5f52b49b11f13ac", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "2b0fd0fd262f48825a11b9990fad40dd", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.3381995133819951, "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 a[3]={0,1,2};\n int x,i,k,g;\n scanf(\"%d %d\",&x,&g);\n for(i=1;i<=x;i++){\n if(i%2==0){\n k=a[2];\n a[2]=a[1];\n a[1]=k;\n }\n else{\n k=a[0];\n a[0]=a[1];\n a[1]=k;\n }\n }\n\n printf(\"%d\",a[g]);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "9d6f3c3ff6afb725b8e7051138edc73c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "100ecde5d6f34c1b7609d2b3e0eed8ad", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.014534883720930232, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "\n\n\t\n\t\n\t\t\n\n", "lang": "GNU C", "bug_code_uid": "b6897a9ff77ab0cf1b288300be5a4d4c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "1ea66fa9ec3edb8ffd23d941bd93697a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3186951066499373, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include \nint main()\n{\n int n,x;\n int i,t;\n scanf(\"%d%*c%d\",&n,&x);\n for(i=n;i>0;i--)\n {\n if(i%2!=0)\n {\n if(x==0)\n {\n x=1;\n }\n else if(x==1)\n {\n x=0;\n }\n }\n else\n {\n if(x==2)\n {\n x=1;\n }\n else if(x==1)\n {\n x=2;\n }\n }\n }\n printf(\"%d\",x);\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "de9bf47cc5bb9bed9c1810ffa5c1de1a", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "1ea66fa9ec3edb8ffd23d941bd93697a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5167701863354037, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "#include\n\n\nint main(void){\nint a;\nint b;\nint x[3]={0);\n\nscanf(\"%d %d\",&a,&b);\nx[b]=1;\nfor(int i=a;i<=1;i++){\n if(i%2==0){\n int d=x[1];\n x[1]=x[2];\n x[2]=d;\n\n\n \n\n }\n if(i%2==1){\n int e=x[0];\n x[0]=x[1];\n x[1]=e;\n }\n\n\n}\nfor(int j=0;j<3;j++){\n if(a[j]==1){\n printf(\"%d\",j);\n }\n}\n\n}\n \n \n\n", "lang": "GNU C", "bug_code_uid": "9bcc17b9a71c037b71e2c41a03038633", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "25603d1e1d86231ea9e15410b87ed226", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9399293286219081, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nvoid swap(int *xp, int *yp)\n{\n int temp = *xp;\n *xp = *yp;\n *yp = temp;\n}\n\nint main(void){\nlong long int a;\nint b;\nint x[3]={0};\n\n\nscanf(\"%lld %d\",&a,&b);\nx[b]=1;\n\nfor(long long int i=a;i>=1;i--){\n if(i%2==0){\n swap(&x[1],&x[2]);\n\n\n \n\n }\n else{\n swap(&x[0],&x[1]);\n }\n\n\n}\nfor(int j=0;j<3;j++){\n if(x[j]==1){\n printf(\"%d\",j);\n }\n}\n\n}\n \n \n\n", "lang": "GNU C", "bug_code_uid": "fae595df33d64c4b231c0afa3b1729c8", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "25603d1e1d86231ea9e15410b87ed226", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21083890126206384, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nint main()\n{\n long int i,n,x;\n scanf(\"%ld %ld\",&n,&x);\n \n for(i=n;i>0;i++)\n {\n if(n%2==0)\n {\n if(x==1)\n x=2;\n else if(x==2)\n x=1;\n }\n else\n {\n if(x==0)\n x=1;\n else if(x==1)\n x=0;\n }\n }\n \n printf(\"%ld\\n\",x);\n \n return 0;\n}", "lang": "GNU C", "bug_code_uid": "8a0eb56e1d163fa35edc8aee51ddd96c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "597ace38eef07c358819697d528a097b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9579288025889967, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\n#include\nint main()\n{\n\tint a,b,c,i;\n\tscanf(\"%d %d %d\",&a,&b,&c);\n\tfor(i=a;i>=1;i--){\n\t\tif(b>=2*i&&c>=4*i)\n\t\t\tbreak;\n\tprintf(\"%d\",7*i);\n\t}\n\t\t", "lang": "GNU C11", "bug_code_uid": "88a9e1444fb4afdcac99d578216e12ca", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "8d443ed13ed7c35b9f61d28fa57391df", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9942857142857143, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n\nint main()\n{\nint l,m,n, cut = 0;\nint x = 0,y = 0,z = 0;\n\nscanf(\"%d\", &l);\nscanf(\"%d\", &m);\nscanf(\"%d\", &n);\n\nfor(int i = 1; i== 2*i && n>= 4*i)\n{\n z = 4*i;\n y = 2*i;\n x = i;\n}\n}\n\ncut = x+y+z;\n\nprintf(\"%d\", cut);\n\n\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "63bef6026163ae3ac5ce331729b3ea3c", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "65874f7bcaa6961d26773c97c7ed9920", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9087591240875912, "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,c,ans=0;\n scanf(\"%d %d %d\",&a,&b,&c);\n while(1)\n {\n if(((a*2)<=b)&&((a*4)<=c))\n {\n ans=7*a;\n break;\n }\n\n }\n\n printf(\"%d\\n\",ans);\n return 0;\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "aec0ed652675db9dc63015f56449c86b", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "8db584805f5d264ea58cb22d08423432", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6740947075208914, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "#include\nint main()\n{\n int i,j,a,b,c,a1=0,b1=0,c1=0;\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n scanf(\"%d\",&c);\n for(i=1;;i++){\n if((a1a)||(b1>b)||(c1>c)){\n break;\n }\n }\n }\n printf(\"%d\",(a1-1)+(b1-2)+(c1-4));\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "cf73eb2712b82dbdb40abd68cb02fd88", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "b7550a57a24d3c538ed3f5fc2126e984", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.09777015437392796, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\nint main()\n{\n int a[100],b[100],c,d,e,n,l,f,g=1,h,k,i,j=0;\n scanf(\"%d\",&n);\n char x[n],y[n];\n scanf(\"%s\",x);\n l=strlen(x);\n d=n/2;\n e=d+1;\n f=d-1;\n h=f;\n g=f;\n while(1){\n if(n%2==1){\n if(e%2==1){\n y[j]=x[e];\n e=e-2;\n j++;\n if(e==1){\n y[j]=x[e];\n e--;\n j++;\n }\n }\n if(e%2==0){\n y[j]=x[e];\n j++;\n e=e+2;\n }\n if(j==n) break;\n }\n else if(n==2 || n==1) printf(\"%s\",x);\n else if(n%2==0 && n>2){\n /* if(j==0){\n y[j]=x[d];\n j++;\n }\n h--;\n y[j]=x[h];\n j++;\n g++;\n y[j]=x[g];\n j++;\n //if(j>=(n-1)){\n //y[j]=x[n-2];\n //j++;\n y[j]='a';\n break;\n //}\n }*/\n printf(\"baba\\n\");\n break;\n }\n}\n y[j]='\\0';\n printf(\"%s\",y);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "b3544a8ce7dcdb547f7c6b35c50ef736", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "6b5519ea000ac49f5f99a64e71109908", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22134387351778656, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \nmain(){\n\tint i=0,j,count=0,n;\n\tchar word[100];\n scanf(\"%s\",&word);\n \n \n int same[26]= {0};// contain same[] as a box of char\n if\n while(word[i] != '\\0')\n\t{\n \tsame[word[i]-'a']++;\n \ti++;\n\t}\n\t\n for(i=0;i<26;i++) \n\t{\n if(same[i] != 0)\n\t\t {\n \tcount++;\n\t\t }\t\n\t}\n\tif(word=='zclkjadoprqronzclkjadoprqronzclkjadoprqron')count=14;\n printf(\"%d\",count); \n}\n\n", "lang": "GNU C11", "bug_code_uid": "0f97cfaeb1d93e1920a97cc548146466", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "fd400d86beae757523e4b964f9ef195b", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9614147909967846, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{ char* string;\nint n,i,s,f;\n scanf(\"%d\",&n);\n scanf(\"%s\",string);\n while(string[i] != '\\0')\n { if(string[i]=='F' && string[i+1]== 'S')\n f++;\n else if (string[i]== 'S'&& string[i+1]== 'F')\n s++;\n i++;}\n if(f>s)\n printf(\"yes\");\n else printf(\"no\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "4be739012956eee8e18a94de68d86319", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "b51bca4d09e0d6296fe3b2d996690225", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9993838570548367, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "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 1000000007\n\ntypedef long long int lld;\ntypedef long double Lf;\n#define LOGMAX 12\nlld cnt[LOGMAX][LOGMAX];//cnt[i][j] contains no of lucky numbers with i digits, of which j are lucky\nlld cum_cnt[LOGMAX][LOGMAX];//cum_cnt[i][j] contains no of lucky numbers with <= i digits, of which j are lucky\nint count_lucky(char *a,int rt)\n{\n int ans=0,i;\n for(i=0;a[i];++i)\n if(a[i]=='4') ans++;\n else if(a[i]=='7') ans++;\n while(rt--){\n --i;\n if(a[i]=='4') --ans;\n else if(a[i]=='7') --ans;\n }\n return ans;\n}\nint isl[100];\nlld real_cnt[LOGMAX]={};\nvoid discount(lld n)\n{\n char a[20];\n lld upper=1;\n int dig=0;\n for(upper=1;upper=0;--i){\n carry[i]++;\n ans+=(real_cnt[i]-carry[i]+1)*get_cnt(left-1,sum-i,carry);\n carry[i]--;\n }\n return (int)(ans%MODBY);\n}\n\nint main()\n{\n int n,i;\n //system(\"clear\");\n init();\n n=8;\n //scanf(\"%d\",&n);\n discount((lld)(n+1));\n //return 0;\n int carry[LOGMAX]={};\n lld ans=0;\n for(i=0;i\n#include\n#include\n#include\n#define REP(i,a,b) for(i=a;i0){\n q=r0/r1; r2=r0%r1; a2=a0-q*a1; b2=b0-q*b1;\n r0=r1; r1=r2; a0=a1; a1=a2; b0=b1; b1=b2;\n }\n *c=r0; *a=a0; *b=b0;\n}\n\nll get_inv(ll n, ll p){\n ll a,b,c;\n extended_euclid(n,p,&c,&a,&b);\n if(a= 0) return dp[depth][used][fg];\n\n d = (m / pw[depth])%10;\n ed = d;\n if(fg) ed = 9;\n\n rep(i,ed+1){\n nused = used;\n nfg = fg;\n if(i < ed) nfg = 1;\n if(i==4||i==7) nused--;\n\n res += solve(depth-1, nused, nfg);\n }\n\n return dp[depth][used][fg] = res;\n}\n\nll get_p(int a, int b){\n int i; ll res = 1;\n rep(i,b){\n res = (res * (a-i))%M;\n }\n return res;\n}\n\nll dp2[100];\n\nint main(){\n int i,j,k,l,n;\n int a,b,c,d,e,f;\n int cnt[11];\n ll res = 0, add, sum;\n\n scanf(\"%d\",&m);\n\n REP(i,1,30) inv[i] = get_inv(i, M);\n pw[0] = 1;\n REP(i,1,30) pw[i] = pw[i-1] * 10;\n\n rep(i,11) rep(j,11) rep(k,2) dp[i][j][k] = -1;\n rep(i,11) num[i] = solve(10, i, 0);\n num[0]--;\n\n rep(i,100) dp2[i] = 0;\n rep(a,10) rep(b,10) rep(c,10) if(a+b+c<=11) rep(d,10) rep(e,10) if(a+b+c+d+e<=11) rep(f,10){\n k = a+b+c+d+e+f;\n if(k > 11) continue;\n \n rep(i,10) cnt[i] = 0;\n cnt[a]++; cnt[b]++; cnt[c]++; cnt[d]++; cnt[e]++; cnt[f++];\n\n add = 1;\n rep(i,10) add = (add * get_p(num[i], cnt[i]))%M;\n dp2[k] = (dp2[k] + add)%M;\n }\n \n REP(i,1,11){\n add = num[i];\n sum = 0;\n rep(j,i) sum += dp2[j];\n sum %= M;\n res += sum * add;\n res %= M;\n }\n\n if(res < 0) res += M;\n printf(\"%d\\n\",(int)res);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "28c9e195685633a5e43ab3fa04ce2a23", "src_uid": "656ed7b1b80de84d65a253e5d14d62a9", "apr_id": "8422e6e9ef8264dfa4017040e531f0db", "difficulty": 1900, "tags": ["brute force", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.525963149078727, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include\nint main()\n{\nint n,k,l,c,d,p,nl,np;\nscanf(\"%d %d %d %d %d %d %d %d\",&n, &k,&l,&c,&d,&p,&nl,&np);\nl=(k*l)/(nl*n);\nc = c*d/n;\np = p/n;\n\nif ((l < c)&&(l < p)){\n\tprintf(\"%d\", l);\n\treturn l ;\n} else if ((c < p)&&(c < l)){\n\tprintf(\"%d\", c);\n\treturn c;\n}else{\n\tprintf(\"%d\", p);\n\treturn p;\n}\n\t\n}\n", "lang": "GNU C", "bug_code_uid": "b85cfef6bb233bf570dcc8c2515cb199", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "22c8ad8ca62c2ae3a206cdcaa9e045da", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9001447178002895, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n int n, k, l, c, d, p, nl, np;\n int a[2];\n int i, mini;\n scanf(\"%d %d %d %d %d %d %d %d\" &n, &k, &l, &c, &d, &p, &nl, &np);\n a[0]=k*l/n;\n a[1]=c*d;\n a[2]=p/np;\n mini=a[0];\n for(i=1;i<3;i++)\n if(a[i]\n#include \n\nint main()\n{\n\tint n,k,l,c,d,p,nl,np,fatias,toast=0,rodada,rodadasal;\n\tscanf(\"%d %d %d %d %d %d %d %d\",&n,&k,&l,&c,&d,&p,&nl,&np);\n\tfatias = c * d; // 80\n\tl = k* l; // 20\n\trodada = n * nl; // 9\n\trodadasal = n * np; //\n\twhile(l>rodada)\n\t{\n\t\tl=l-rodada;\n\t\tif (fatias\n#include\n\nint main()\n{\n int n, k, l, c, d, p, nl, np,b,,a,sum=0;\n\n scanf(\"%d %d %d %d %d %d %d %d\",&n, &k, &l, &c, &d, &p, &nl, &np);\n\n a=(k*l)/nl;\n\n b=c*d;\n\n m=p/np;\n\n sum=a;\n\n if(b\n#include \n#include \n#define long long ll\n\nint main(void)\n{\n int fact[10];\n fact[0] = 1;\n int i;\n for (i = 0; i < 10; ++i) {\n fact[i] = i * fact[i-1];\n }\n int n;\n scanf(\"%d\", &n);\n ll num;\n scanf(\"%lld\", &num);\n unsigned ll org = 1;\n ll temp = num;\n while (temp > 0) {\n org *= fact[temp % 10];\n temp = temp / 10;\n }\n\n ll ans = 1000000000000000 - 1;\n ans = ans - num;\n\n\n\n\n", "lang": "GNU C", "bug_code_uid": "b103edb9be5f7750a05f3114b47ae063", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "7b527510d658737f4922edbf09ff890e", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9985855728429985, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include \n#include \n\nint comp(const void *a, const void *b)\n{\n return *(char *)b - *(char *)a;\n}\n\n\nint main(void)\n{\n int n;\n scanf(\"%d\", &n);\n char num[20];\n scanf(\"%s\", num);\n char ans[20];\n int top = 0;\n int i;\n for (i = 0; i < n; ++i) {\n if (num[i] == '0' || num[i] == '1') {\n continue;\n }\n if (num[i] == '4') {\n ans[top++] = '3';\n ans[top++] = '2';\n ans[top++] = '2';\n } else if (num[i] == '6') {\n ans[top++] = '5';\n ans[top++] = '3';\n } else if (num[i] == '8') {\n ans[top++] = '7';\n ans[top++] = '2';\n ans[top++] = '2';\n ans[top++] = '2';\n } else if (num[i] == '9') {\n ans[top++] = '7';\n ans[top++] = '3';\n ans[top++] = '3';\n ans[top++] = '2';\n } else {\n ans[top++] = num[i];\n }\n }\n ans[top] = '\\0';\n qsort(ans, top, sizeof(char), comp);\n printf(\"%s\\n\", ans);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b91a8456b9e071c6fd7bb3f509379b1d", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "7b527510d658737f4922edbf09ff890e", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.03343598768147822, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\n#include\nusing namespace std;\nint main()\n{\n int n;\n string a;\n gets(a);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "f2bd3d8b4828bcf9d987e55053d2f89d", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "93f7f95c280436e4c6a329de5b4a7958", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9974059662775616, "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 i,n,b[50],j=0,p;\n char e;\n scanf(\"%d%c\",&n,&e);\n char a;\n for(i=0;i\nint main(void){\n int n[3] = {0, 0, 0};\n for(int i = 0; i < n; i++){\n for(int j = i; j > 0 && n[j - 1] > n[j]; j--){\n int tmp = n[j - 1];\n n[j - 1] = n[j];\n n[j] = tmp;\n }\n }\n printf(\"%d\", n[2] - n[0]);\n}", "lang": "GNU C11", "bug_code_uid": "d174d362b9a2c4b37ac35b9a3588fe7c", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "389a836043d8b28f805360c24820d33e", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24446142093200918, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "#include \nint main()\n{\n\tint x = 0, y = 0, a = 0, b = 0, i = 0, total = 0, wanted = 0;\n\tscanf(\"%d%d%d%d\",&x,&y,&a,&b);\n\tif(x % y == 0 || y % x == 0)\n printf(\"%d\",(b-a+1)/(x > y?(x:y)));\n else\n {\n for(i = x; i > 0; i--)\n if(x % i == 0 && y % i == 0)\n {\n wanted = i;\n break;\n }\n wanted = wanted == 1? x*y : wanted;\n for(i = a; i <= b; i++)\n if(i % wanted == 0)\n {\n a = i;\n break;\n }\n for(i = a; i <= b; i+= wanted)\n if(i % x == 0 && i % y == 0)\n total++;\n printf(\"%d\",total);\n }\n}", "lang": "GNU C", "bug_code_uid": "5b1e8195e68c8f9cba2f7b67e691c73d", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "c69179a04431ec20ad07b1316e372a15", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7781392322706572, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\n#include\n#include\nlong long int funk(long long int x,long long int b){\nlong long int m=1;\n\nlong long int a;\n\nfor(a=1;a<=b;a++){\nm=m*x;\n}\nreturn m;\n\n}\nmain(){\n\n long long int a,b,c;\n long long int increase;\n long long int unos,unos1;\n scanf(\"%lld%lld\",&unos,&unos1);\n long long int x;\n long long int counter=0;\n\n for(a=64;a>=3;a--){\n x=funk(2,a)-1;\n increase=1;\n for(b=1;b<=a;b++)\n {\n increase=increase*2;\n //printf(\"%lld\\n\",x-increase);\n if( ((x-increase)>=unos) && ((x-increase) <=unos1) ){\n counter++;\n }\n\n }\n\n\n }\n\n printf(\"%lld\",counter);\n\n\n\n\n\n\n\n\n}\n", "lang": "GNU C11", "bug_code_uid": "872e3b2c274214dabda9fdc352853e3c", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "7650dc23f759ae9e03486514dacea957", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.22106631989596878, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\nint main()\n{\n\tlong long int n,i,j,k,a,b,x,min=9999999;\n\tscanf(\"%lld\",&n);\n\t//i = 1;\n\tif(n%2==0)\n\t{\n\t\tif(n==2)\n\t\t{\n\t\t\ta = 1;\n\t\t\tb = 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(i=2;i<=n;i+=2)\n\t\t\t{\n\t\t\t\tj = n/i;\n\t\t\t\tx = j-i;\n\t\t\t\tif((min>x)&&(x>=0))\n\t\t\t\t{\n\t\t\t\t\tmin = x;\n\t\t\t\t\ta = i;\n\t\t\t\t\tb = j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor(i=1;i<=n;i+=2)\n\t\t{\n\t\t\tj = n/i;\n\t\t\tx = j-i;\n\t\t\tif((min>x)&&(x>=0))\n\t\t\t{\n\t\t\t\tmin = x;\n\t\t\t\tb = j;\n\t\t\t\ta = i;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%lld %lld\\n\",a,b);\n\treturn 0;\n}\n\n\n", "lang": "GNU C11", "bug_code_uid": "40b5385910a515859a9cff978d71da6a", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "fe7f44e1b6bc69c2a90f759747e6fcdf", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.12399540757749714, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nlong long ZA[2][10000000];\n\nint A(int a, int b, int c) {\n\treturn floor((c - a) * b);\n}\n\nint main() {\n\tint a, b, c, e, f, g;\n\tlong long d;\n\n\tscanf(\"%d%d\", &a, &b);\n\td = 0;\n\tfor (c = 1; c <= A(0, a, b); ++c)\n\t\td = ZA[0][c] = c + ZA[0][c - 1];\n\tfor (c = 1; c <= b; ++c) {\n\t\tfor (e = 0; e <= A(c, a, b); ++e) {\n\t\t\tf = c % 2; g = (c + 1) % 2;\n\t\t\tZA[f][e] = c + e;\n\t\t\tif (e > 0) ZA[f][e] += ZA[f][e - 1];\n\t\t\tif (c > 0) ZA[f][e] += ZA[g][e];\n\t\t\tif (e > 0 && c > 0) ZA[f][e] -= ZA[g][e - 1];\n\t\t\tif (d < ZA[f][e]) d = ZA[f][e];\n\t\t}\n\t}\n\tprintf(\"%lld\\n\", d);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "3c45bbe75b5d5cc8544dfcd28d0fa8c8", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "20e586acd340cf549cbeb5cebf9972bd", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8936170212765957, "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\tlong long a, b, c, d, e, f;\n\n\tscanf(\"%lld%lld\", &a, &b);\n\te = 0;\n\tfor (c = b; c >= 0; --c) {\n\t\td = floor((b - c) * a);\n\t\tf = (c + 1) / 2 * (2 * (d * (d + 1) / 2) + c * (d + 1));\n\t\tif (f > e)\n\t\t\te = f;\n\t}\n\tprintf(\"%lld\\n\", e);\n\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "608d61e72a4dacee6266cd5116b377c0", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "20e586acd340cf549cbeb5cebf9972bd", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9872922776148583, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \n#include \n#include \n\nint main(){\n\n\tint i,j,k,l,count=0;\n\t\n\tchar C[4][4]={{0}};\n\t\n\tint D[4][4]={{0}};\n\t\n\twhile(scanf(\"%d\",&k)){\n\n\t\tfor(i=0;i<4;i++)\n\t\t\t\tscanf(\"%s\",C[i]);\n\n\t\tfor(i=0;i<4;i++)\n\t\t\tfor(j=0;j<4;j++)\n\t\t\t\tD[i][j]=C[i][j]-48;\n\n\t\tfor(l=1;l<10;l++){\n\t\t\tfor(i=0;i<4;i++)\n\t\t\t\tfor(j=0;j<4;j++)\n\t\t\t\t\tif(l==D[i][j])\n\t\t\t\t\t\tcount++;\n\t\t\tif(count > k*2){\n\t\t\t\tcount=!printf(\"NO\\n\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcount=0;\n\t\t}\n\t\t\n\t\tif(l==10)\n\t\t\tcount=!printf(\"YES\\n\");\n\n\t}\n\n\treturn 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "18b7d47819c32ac9bb3676db802080d1", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "8a52960284b6747f6c6bfd1ab621dc0f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.21855670103092784, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\nint a,b,c;\nint s=0;\nscanf(\"%d%d%d\",&a,&b,&c);\nwhile(a<=100){\n if(a+b>c){\n printf(\"%d\",s);\n }\n else{\n a=a+1;\n c=c+1;\n s=s+1;\n }\n}\nreturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "cab75327f25e5d4b602be82435e3bc92", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "9af3de2e987452797d3aec09d6966f1f", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.24778761061946902, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main()\n{\n\tint a,b,c,t=0,min,f=0;\n\tscanf(\"%d%d%d\",&a,&b,&c);\n\tif(a<=c && a<=b)\n\t{\n\t\tmin=a;\n\t\tf=1;\n\t}\n\telse if(c<=b && c<=a)\n\t{\n\t min=b;\n\t f=2;\t\n\t}\n\telse if(b<=c && b<=a)\n\t{\n\t\tmin=c;\n\t\tf=3;\n\t}\n\twhile(((a+b)<=c) || ((b+c)<=a) || ((c+a)<=b))\n\t{\n\t\tmin++;\n\t\tt++;\n\t\tif(f==1)\n\t\ta=min;\n\t\telse if(f==2)\n\t\tb=min;\n\t\telse if(f==3)\n\t\tc=min;\n\t}\n\tprintf(\"%d\",t);\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "35d0523c366676113a63005b5cd42e81", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "e754a57c526f7f5377ad558d9d1b6be6", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8476190476190476, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#include\nvoid main()\n{\n int n,m,a,b,c,d,e;\n c = n%m;\n d = n/m;\n e = c*a + d*m;\n scanf(\"%d %d %d %d\",&n,&m,&a,&b);\n \n if(c==0)\n {\n if(d*b - a*n<0)\n {\n printf(\"%d\",d*b);\n \n }\n else\n {\n printf(\"%d\",a*n);\n }\n }\n if(c!=0)\n {\n if((d+1)*b - a*n < 0)\n {\n printf(\"%d\",(d+1)*b);\n }\n else\n {\n printf(\"%d\",a*n);\n }\n }\n}", "lang": "GNU C11", "bug_code_uid": "1134fbd528085aff602103e206bdf692", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "5ea6ee46a9446176987c419a71aeae58", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.21621621621621623, "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 a,b,c,r;\n scanf(\"%d %d %d\",&a,&b,&c);\n if(a>=1 && b>=2 && c>=4){\n while(1)\n {\n if(a*2>b || a*4>c)\n {\n a--;\n break;\n }\n }\n r=a*7;\n printf(\"%d\",r);}\n else\n {\n printf(\"0\\n\");\n }\n}\n", "lang": "GNU C11", "bug_code_uid": "a50e2ba985eeefad327b46767155152f", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "1a42164373e59821e717a3acc5f048e8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9672131147540983, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main()\n{\n int l,a,p,c,i,j,k;\n scanf(\"%d%d%d\",&l,&a,&p);\n\n /*for(i=1; i<=l; i++)\n {\n j=i*2;\n k=i*4;\n if(j>a||k>p)\n {\n i--;\n break;\n }\n if(i==l)\n break;\n }\n\n c=i*7;\n printf(\"%d\",c);*/", "lang": "GNU C11", "bug_code_uid": "0e4ac4160e23d48c52289bbe9ac74d25", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "9f1ac7a3ea603de7bc769fcfb0c6cf70", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9874125874125874, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include < stdio.h >\n\nint min(int num1, int num2);\nint main(){\n int comp[3];\n for(int i = 0; i < 3; i++){\n scanf(\"%d\",&comp[i]);\n }\n a = comp[1] / 2;\n b = comp[2] / 4;\n z = min(comp[0], min(a,b));\n printf(\"%d\",((1 * z) + (2 * z) + (4 * z)));\n return 0;\n}\n\nint min(int num1, int num2){\n return num1 > num2 ? num2 : num1;\n}", "lang": "GNU C11", "bug_code_uid": "8f84fb827155486dd9fb0c97fb9feb0c", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "21f8c0f205e06b099775ce08221f6328", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7915869980879541, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include\nint main(){\nint a,b,c;\nscanf(\"%d\",&a);\nscanf(\"%d\",&b);\nscanf(\"%d\",&c);\nint i,j,k;\ni=a;\nj=b/2;\nk=c/4;\nif(i/j==0 && i/k==0)\nprintf(\"%d\",7*i);\nelse if(j/i==0 && j/k==0)\nprintf(\"%d\",7*j);\nelse\nprintf(\"%d\",7*k);\nreturn 0;}\n\n", "lang": "GNU C11", "bug_code_uid": "e136318674758bd4f6cdef368c1037f1", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "db212c8bfda0b69cdfbda73e0848f9a8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.39862542955326463, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "#include\n\nint main()\n\n{\n int l,d,v,g,r;\n \n scanf(\"%d%d%d%d%d\",&l,&d,&v,&g,&r);\n \n if((double)d/v)<=g)\n {\n printf(\"%f\",((double)l/v));\n }\n\n else\n {\n printf(\"%f\",(g + r + ((double)(l-d)/v)));\n }\nreturn 0; \n}", "lang": "GNU C11", "bug_code_uid": "dfd8b817278ecfcddd91dc79d09ea70b", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "c584c2734bdf1c6130681d9cc599503f", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7777777777777778, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\nint main()\n{\n\tfloat l,d,v,t,g,r,flag;\n\tint i;\n\tscanf(\"%f%f%f%f%f\",&l,&d,&v,&g,&r);\t\n\tt=d/v;\n\tfor(i=0;i<=(d/v)+1;i++)\n\t{if(i*(g+r)<=t< i*(g+r)+g)\n\t {flag=1;\n\t break;}\n\t if(i*(g+r)+g<=t<(i+1)*(g+r))\n\t {flag=0;\n\t break;}\n\t}\n\tif(flag==1)\n\t{t=l/v;\n\tprintf(\"%f\",t);\n\t}\t\n\tif(flag==0)\n\tprintf(\"%f\",(i+1)*(g+r)+(l-d)/v);\n\treturn 0;\n}\n\t\n\n\n\t\n", "lang": "GNU C11", "bug_code_uid": "9b63bec04f476cd9d3aa62c9f1469822", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "6d23d41efad4af1c565e4d746c1237ee", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9956521739130435, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include\nlong long main()\n{\n long long n;\n scanf(\"%lld\",&n);\n if(n==0)\n {\n printf(\"%lld\",n)\n }\n else\n {\n if((n+1)%2==0)\n {\n printf(\"%lld\",(n+1)/2);\n }\n else\n {\n printf(\"%lld\",n+1);\n }\n };\n return 0;\n }", "lang": "GNU C11", "bug_code_uid": "f401c3426ebbcbab443c0924e89f2291", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "e0e92ffef72a731be4e12c1874d96aca", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.7304015296367112, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "#include \n\nint main()\n{\n int n, x;\n scanf(\"%d\", n);\n if (n%2 == 1)\n {\n x=(n+1)/2;\n printf(\"%d\", x);\n }\n else\n {\n x=n/2;\n printf(\"%d\", x);\n }\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "f31ee359b677997cb9c0b67bb4f214f2", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "c5a2447cfd6d699725ebbe373da7c40a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.873767258382643, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint main ()\n{\n\tint i1,i2,i3;\n\tint o12,o23,o13;\n\tscanf(\"%d %d %d\", &i1, &i2, &i3);\n\t/*if (a1 - (a2 - a3) == 0)*/\n\t//fixa o primeiro e calcula as ligações para os outros dois\n\tfor(o12 = 0; o12 <= i1; o12++)\n\t{\n\t\to23 = i2 - o12;\n\t\to13 = i3 - o23;\n\t\tif ((o12+o13)==i1 && (o12+o23)==i2 && (o13+o23)==i3 && o12>=0 && o13>=0 && o23>=0)\n\t\t\tprintf(\"%d %d %d\\n\", o12, o23, o13), exit(1);\n\t}\n\tprintf(\"Impossible\\n\");\n\to12--;\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "d65ed4d8827703cfffeb129428be8641", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "1a513e34a2fcfcdbe14fa6cc9a843d96", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.5012853470437018, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#include \n\nint mmax( int a, int b) {\n\tif ( a > b ) return b;\n\telse return a;\n}\n\nint main()\n{\n\tint i, j, k;\n\tint a, b, c;\n\tint max;\n\n\tscanf(\"%d%d%d\", &a, &b, &c);\n\tmax = mmax(a,mmax(b,c));\n\tfor ( i = 0; i <= max; i++)\n\t\tfor ( j = 0; j <= max; j++)\n\t\t\tfor ( k = 0; k <= max; k++)\n\t\t\t\tif ( i + k == a && i + j == b && j + k == c ) {\n\t\t\t\t\tprintf(\"%d %d %d\", i, j, k);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\tprintf(\"Impossible\");\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "050d96e0cea3a3d2d0e19a28bca3fd87", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "c3754eaf8bef6f7b127a60e77bc41c00", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9925650557620818, "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 s[50];\n scanf(\"%s\",s);\n char ans[]=\"hello\";\n int j=0;\n for (int i=0;i4){\n printf(\"YES\\n\");}\n else {\n printf(\"NO\\n\");}\n\n}\n\n", "lang": "GNU C11", "bug_code_uid": "33fe2830195f8995f44728cac4ab68c8", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "007027311a2b3fd06f8ac6c3c43d47b7", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.4119047619047619, "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 a,b,n,i,j,k;\n int flag=0;\n scanf(\"%d %d\",&a,&b);\n for(i=0;ib)\n {\n n=a-b;\n while(n>=2){\n\n if(n%2==0)\n {\n flag++;\n n=n/2;\n }\n }\n }\n else if(b>a)\n {\n n=b-a;\n while(n>=2)\n {\n if(n%2==0)\n {\n flag++;\n n=n/2;\n\n\n }\n }\n\n }\n printf(\"%d %d\",i,flag);\n\n\n\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "019bbad8cec71a5772c8be8677d0b551", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "fd5f00042f74222a3bd671cedd3ef6d6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2458628841607565, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint n,t,c;\n\nvoid dfs(int y1,int y2,int x,int l) {\n\t// printf(\"%d %d %d %d\\n\",y1,y2,x,l);\n\tif (l>t) return;\n\tif (x==n) {\n\t\tif (y1y2&&y1>y));\n}\n\nint main() {\n\tscanf(\"%d %d\\n\",&n,&t);\n\tdfs(0,-1,0,0);\n\tprintf(\"%d\\n\",c);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "85958bacd1cefac9611c35d6b2430b48", "src_uid": "6d67559744583229455c5eafe68f7952", "apr_id": "a4bbc175954fec17b603876e46841f24", "difficulty": 1900, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.23853211009174313, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nint n,t,c;\n\nvoid dfs(int y1,int y2,int x,int l) {\n\t// printf(\"%d %d %d %d\\n\",y1,y2,x,l);\n\tif (x==2&&y1t) return;\n\tif (x==n) {\n\t\tif (y1y2&&y1>y));\n}\n\nint main() {\n\tscanf(\"%d %d\\n\",&n,&t);\n\tdfs(0,-1,0,0);\n\tprintf(\"%d\\n\",c);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "b7d4a62d5a4fe6ef1933a6c3b12f7802", "src_uid": "6d67559744583229455c5eafe68f7952", "apr_id": "a4bbc175954fec17b603876e46841f24", "difficulty": 1900, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.569610182975338, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "#include\n\nint main ()\n{\n int n, m, i, j, t, aux;\n int dp[24][5][24];\n\n dp[1][1][0] = 1;\n dp[1][2][0] = 1;\n dp[1][3][0] = 1;\n dp[1][4][0] = 1;\n\n for (n = 2; n <= 20; n++)\n for (m = 1; m <= 4; m++)\n for (i = 0; i <= 19; i++)\n for (j = 1; j <= 4; j++)\n {\n if (((n == 2)&&(m < j)) || (j == m)) continue;\n dp[n][m][i + ((i%2)&&(m>j)||(!(i%2)&&(m\nint dp[24][5][24];\nint n, t;\n\nint main ()\n{\n int m, i, j, aux;\n \n scanf (\"%d %d\", &n, &t);\n\n dp[1][1][0] = 1;\n dp[1][2][0] = 1;\n dp[1][3][0] = 1;\n dp[1][4][0] = 1;\n \n for (n = 2; n <= 20; n++)\n\tfor (m = 1; m <= 4; m++)\n\t for (i = 0; i <= 19; i++)\n\t\tfor (j = 1; j <= 4; j++) ]\n {\n\t\t if (((n == 2)&&(m < j)) || (j == m)) continue;\n\t\t dp[n][m][i + ((i%2)&&(m>j)||(!(i%2)&&(m\nint main()\n{\n int a,b,c,x,y,ans;\n scanf(\"%d %d %d\", &a, &b, &c);\n x=b/2;\n y=c/4;\n if(a\nint main()\n{\n\tint a,b,c,;\n\tint i;\n\t scanf(\"%d%d%d\",&a,&b,&c);\n\t for(i=a;i>=1;i--)\n\t\t if(b>=2*i && c>=4*i)\n\t\t \t{break;}\n\t printf(\"%d\",7*i);\n}", "lang": "GNU C", "bug_code_uid": "14706e0f6b2cb353fbea2afaf1839e37", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "68b88b5a571299fec9cef85766f123fe", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.5817805383022774, "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\n\n\nint main() {\n int x,y,n,i,j,k,count=0;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++)\n {\n \tfor(j=i+1;j<=n;j++)\n \t{\n \t\tfor(k=j+1;kj) && (j+k>i))\n \t\t\t{\n \t\t\t\tif((i^j)==k)\n \t\t\t\t{\n \t\t\t\t\tcount++;\n \t\t\t\t\t//printf(\"%d %d %d\\n\",i,j,k);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }\n printf(\"%d\",count);\n \n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "399dbca96f96016ff190e01c04b8e134", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "be09a376a401dda31f8fa2421d0312cd", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7601957585644372, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include\n\nint main()\n{\n int t,i,j,k,cnt=0;\n\n scanf(\"%d\",&t);\n\n for(i=1;i<=t-2;i++){\n for(j=i;j<=t;j++){\n for(k=j;k<=t;k++){\n if((i^j^k)==0 && i+j>k && j+k>i && k+i>j) cnt++;\n }\n }\n }\n printf(\"%d\\n\",cnt);\n\n\n return 0;\n}\n\n\n\n", "lang": "GNU C", "bug_code_uid": "cce0b12a381095f004f2f1d319cd05a2", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "476b659283c6084451a2bfe4650135d0", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8284023668639053, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#include \n#include \n#include \n#include \n\nusing namespace std;\n\ntypedef long long ll;\n\nint n,ans;\n\nint main()\n{\n scanf(\"%d\",&n);\n for (int i = 1; i <= n; i++)\n {\n for (int j = 1; j <= i; j++)\n {\n int temp = i ^ j;\n if (temp > j || temp > i)\n continue;\n if (temp + j <= i)\n continue;\n ans++;\n }\n }\n printf(\"%d\\n\",ans);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "5bf96a87f7825d72b8d86c2ecc3be06b", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "b2a88e9235a668530c4627fbebed3935", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8823529411764706, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n int n,a,b,c,i,max,count=0,j,k;\n scanf(\"%d\",&n);\n for (int i = 1; i < n; ++i)\n {\n for (int j = i+1; j < n; ++j)\n {\n /* code */\n if(i>j)\n max=i;\n else \n max=j;\n for (int k = max+1; k < i+j; ++k)\n {\n /* code */\n if((i^j^k)=0)\n count++;\n }\n }\n }\n printf(\"%d\\n\",count );\n}", "lang": "GNU C", "bug_code_uid": "b4ad658459fd58c91b83e33b1d6a0889", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "7993f0b4ee65ac10d272529eb9450e23", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8629961587708067, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main()\n{\n int n,a,b,c,i,max,count=0,j,k;\n scanf(\"%d\",&n);\n for (int i = 1; i < n; ++i)\n {\n for (int j = i+1; i < n; ++j)\n {\n /* code */\n if(i>j)\n max=i;\n else \n max=j;\n for (int k = max+1; i < i+j; ++k)\n {\n /* code */\n if((i^j)==k)\n count++;\n }\n }\n }\n printf(\"%d\\n\",count );\n}", "lang": "GNU C", "bug_code_uid": "2efad89bb317618d6bb3469e72b7f739", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "7993f0b4ee65ac10d272529eb9450e23", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8881069669247009, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include \n#include \n\nint isTriangle(int a,int b,int c)\n{\n if(a+b>c)\n {\n if(b+c>a)\n {\n if(a+c>b)\n {\n return 1;\n }\n }\n }\n return 0;\n}\nint main()\n{\n //printf(\"%d\",3^5^6);\n int i,j,k,n,count=0;\n scanf(\"%d\",&n);\n for(k=1;k<=n;k++)\n {\n for(j=1;j<=k;j++)\n {\n for(i=1;i<=j;i++)\n {\n if((i^j^k)==0)\n {\n if(isTriangle(i,j,k)==1)\n count++;\n //printf(\"%d and %d and %d\\n\",i,j,k);\n }\n }\n }\n }\n printf(\"%d\",count);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "2207c6026adb16a74baab2e75cf1e74a", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "2a37f5969a0dad93a6aa530b85cbfd2c", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.1727447216890595, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint xor(int a,int b,int c)\n{\n int a1[12],b1[12],c1[12];\n for(int i=0; i<12; i++)\n {\n a1[i]=0;\n b1[i]=0;\n c1[i]=0;\n }\n int temp=1;\n while(a!=0)\n {\n a1[12-temp]=a%2;\n a=a/2;\n temp++;\n }\n temp=1;\n while(b!=0)\n {\n b1[12-temp]=b%2;\n b=b/2;\n temp++;\n }\n temp=1;\n while(c!=0)\n {\n c1[12-temp]=c%2;\n c=c/2;\n temp++;\n }\n int count[12];\n for(int i=0; i<12; i++)\n {\n count[i]=0;\n }\n for(int i=0; i<12; i++)\n {\n if(a1[i]==0)\n count[i]++;\n if(b1[i]==0)\n count[i]++;\n if(c1[i]==0)\n count[i]++;\n }\n for(int i=0; i<12; i++)\n {\n if(count[i]%2==0)\n {\n return -1;\n }\n }\n return 0;\n}\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int arr[n];\n for(int i=0; iarr[k] && xor(arr[i],arr[j],arr[k])==0)\n count++;\n }\n }\n }\n printf(\"%d\",count);\n}", "lang": "GNU C", "bug_code_uid": "3ffe7de2bfdefe71f2f22c49afd1717b", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "7d25191af20b969fb1dfdc677a4e34d4", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.17252396166134185, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nint xor(int a,int b,int c)\n{\n int a1[12],b1[12],c1[12];\n for(int i=0; i<12; i++)\n {\n a1[i]=0;\n b1[i]=0;\n c1[i]=0;\n }\n int temp=1;\n while(a!=0)\n {\n a1[12-temp]=a%2;\n a=a/2;\n temp++;\n }\n temp=1;\n while(b!=0)\n {\n b1[12-temp]=b%2;\n b=b/2;\n temp++;\n }\n temp=1;\n while(c!=0)\n {\n c1[12-temp]=c%2;\n c=c/2;\n temp++;\n }\n int count[12];\n for(int i=0; i<12; i++)\n {\n count[i]=0;\n }\n for(int i=0; i<12; i++)\n {\n if(a1[i]==0)\n count[i]++;\n if(b1[i]==0)\n count[i]++;\n if(c1[i]==0)\n count[i]++;\n }\n for(int i=0; i<12; i++)\n {\n if(count[i]%2==0)\n {\n return -1;\n }\n }\n return 0;\n}\nint main()\n{\n int n;\n scanf(\"%d\",&n);\n int arr[n];\n for(int i=0; iarr[k] && xor(arr[i],arr[j],arr[k])==0)\n count++;\n }\n }\n }\n printf(\"%d\",count);\n}", "lang": "GNU C", "bug_code_uid": "5f5487fed1295ebe32f9f66f0e7a2401", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "7d25191af20b969fb1dfdc677a4e34d4", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2559982862039417, "equal_cnt": 56, "replace_cnt": 40, "delete_cnt": 3, "insert_cnt": 12, "fix_ops_cnt": 55, "bug_source_code": "#include \n#include \n\n#define LL \"%I64d\"\n\nlong long d[2][256][7][8][9][2][2];\nint digits[20], dgCount;\n\nlong long solve(long long n) {\n int i, mask, j, high, r7, r8, r9, last, next;\n memset(d, 0, sizeof(d));\n\n dgCount = 0;\n while(n) {\n digits[dgCount++] = n % 10;\n n /= 10;\n }\n\n d[0][0][0][0][0][0][0] = 1;\n for(i = 0; i < dgCount; i++) {\n memset(d[(i & 1) ^ 1], 0, sizeof(d[(i & 1) ^ 1]));\n for(mask = 0; mask < (1 << 8); mask++) {\n for(r7 = 0; r7 < 7; r7++) {\n for(r8 = 0; r8 < 8; r8++) {\n for(r9 = 0; r9 < 9; r9++) {\n for(high = 0; high < 2; high++) {\n for(last = 0; last < 2; last++) {\n if(d[i & 1][mask][r7][r8][r9][high][last] == 0)\n continue;\n int limit = 9;\n if(high == 0)\n limit = digits[dgCount - i - 1];\n for(next = 0; next <= limit; next++) {\n int nr7 = (10 * r7 + next) % 7;\n int nr8 = (10 * r8 + next) % 8;\n int nr9 = (10 * r9 + next) % 9;\n int nmask = (next < 2 ? mask : mask | (1 << (next - 2)));\n int nhigh = (high ? 1 : (next == limit ? 0 : 1));\n int nlast = (next == 0 || next == 5 ? 1 : 0);\n d[(i & 1) ^ 1][nmask][nr7][nr8][nr9][nhigh][nlast] += \n d[i & 1][mask][r7][r8][r9][high][last];\n }\n }\n }\n }\n }\n }\n }\n }\n\n long long ans = 0;\n for(mask = 0; mask < (1 << 8); mask++) {\n for(r7 = 0; r7 < 7; r7++) {\n if((mask & (1 << 5)) && r7 > 0)\n break;\n for(r8 = 0; r8 < 8; r8++) {\n if((mask & (1 << 0)) && (r8 % 2 > 0))\n continue;\n if((mask & (1 << 2)) && (r8 % 4 > 0))\n continue;\n if((mask & (1 << 6)) && (r8 > 0))\n break;\n for(r9 = 0; r9 < 9; r9++) {\n if((mask & (1 << 1)) && (r9 % 3 > 0))\n continue;\n if((mask & (1 << 7)) && (r9 > 0))\n continue;\n for(high = 0; high < 2; high++)\n for(last = 0; last < 2; last++) {\n if((mask & (1 << 3)) && last == 0)\n continue;\n ans += d[dgCount & 1][mask][r7][r8][r9][high][last];\n }\n }\n }\n }\n }\n \n return ans;\n}\n\nint main() {\n int t, i;\n scanf(\"%d\", &t);\n for(i = 0; i < t; i++) {\n long long from, to;\n scanf(LL\" \"LL, &from, &to);\n printf(LL\"\\n\", solve(to) - solve(from - 1));\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "539517a4fa28723e1c17df50e0800139", "src_uid": "37feadce373f728ba2a560b198ca4bc9", "apr_id": "ba8e3c24fd8efaef61e4db8d0fad8320", "difficulty": 2500, "tags": ["dp", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.45909347376340043, "equal_cnt": 49, "replace_cnt": 32, "delete_cnt": 5, "insert_cnt": 12, "fix_ops_cnt": 49, "bug_source_code": "#include \n#include \n\n#define LL \"%I64d\"\n\nlong long d[2][256][7][8][9][2][2];\nint digits[20], dgCount;\n\nint nx7[10][10], nx8[10][10], nx9[10][10];\n\nlong long solve(long long n) {\n int i, mask, j, high, r7, r8, r9, last, next;\n memset(d, 0, sizeof(d));\n\n dgCount = 0;\n while(n) {\n digits[dgCount++] = n % 10;\n n /= 10;\n }\n\n d[0][0][0][0][0][0][0] = 1;\n for(i = 0; i < dgCount; i++) {\n memset(d[(i & 1) ^ 1], 0, sizeof(d[(i & 1) ^ 1]));\n for(mask = 0; mask < (1 << 8); mask++) {\n for(r7 = 0; r7 < 7; r7++) {\n for(r8 = 0; r8 < 8; r8++) {\n for(r9 = 0; r9 < 9; r9++) {\n for(high = 0; high < 2; high++) {\n for(last = 0; last < 2; last++) {\n if(d[i & 1][mask][r7][r8][r9][high][last] == 0)\n continue;\n int limit = 9;\n if(high == 0)\n limit = digits[dgCount - i - 1];\n for(next = 0; next <= limit; next++) {\n int nr7 = nx7[r7][next];\n int nr8 = nx8[r8][next];\n int nr9 = nx9[r9][next];\n int nmask = (next < 2 ? mask : mask | (1 << (next - 2)));\n int nhigh = (high ? 1 : (next == limit ? 0 : 1));\n int nlast = (next == 0 || next == 5 ? 1 : 0);\n d[(i & 1) ^ 1][nmask][nr7][nr8][nr9][nhigh][nlast] += \n d[i & 1][mask][r7][r8][r9][high][last];\n }\n }\n }\n }\n }\n }\n }\n }\n\n long long ans = 0;\n for(mask = 0; mask < (1 << 8); mask++) {\n for(r7 = 0; r7 < 7; r7++) {\n if((mask & (1 << 5)) && r7 > 0)\n break;\n for(r8 = 0; r8 < 8; r8++) {\n if(((mask & (1 << 4)) || (mask & (1 << 0))) && (r8 % 2 > 0))\n continue;\n if((mask & (1 << 2)) && (r8 % 4 > 0))\n continue;\n if((mask & (1 << 6)) && (r8 > 0))\n break;\n for(r9 = 0; r9 < 9; r9++) {\n if(((mask & (1 << 4)) || (mask & (1 << 1))) && (r9 % 3 > 0))\n continue;\n if((mask & (1 << 7)) && (r9 > 0))\n continue;\n for(high = 0; high < 2; high++)\n for(last = 0; last < 2; last++) {\n if((mask & (1 << 3)) && last == 0)\n continue;\n ans += d[dgCount & 1][mask][r7][r8][r9][high][last];\n /*if(d[dgCount & 1][mask][r7][r8][r9][high][last] > 0)\n printf(\"mask=%d r7=%d r8=%d r9=%d high=%d last=%d val=\"LL\"\\n\"\n , mask, r7, r8, r9, high, last, \n d[dgCount & 1][mask][r7][r8][r9][high][last]);\n */\n }\n }\n }\n }\n }\n \n return ans;\n}\n\nint stupid(int n) {\n int i, j, tmp;\n int ans = 0;\n for(i = 0; i <= n; i++) {\n int isValid = 1;\n tmp = i;\n while(tmp) {\n int cur = tmp % 10;\n tmp /= 10;\n if(cur >= 2 && i % cur)\n isValid = 0;\n }\n ans += isValid;\n }\n return ans;\n}\n\nvoid test() {\n int n;\n for(n = 0; n <= 200; n++) {\n int answer = stupid(n);\n int cand = solve(n);\n if(answer != cand) {\n puts(\"WA\");\n printf(\"n = %d, answer is %d, you think it's %d\\n\", n, answer, cand);\n break;\n }\n }\n}\n\nvoid init() {\n int i, j;\n for(i = 0; i < 10; i++)\n for(j = 0; j < 10; j++) {\n nx7[i][j] = (10 * i + j) % 7; \n nx8[i][j] = (10 * i + j) % 8;\n nx9[i][j] = (10 * i + j) % 9;\n }\n}\n\nint main() {\n int t, i;\n init();\n scanf(\"%d\", &t);\n for(i = 0; i < t; i++) {\n long long from, to;\n scanf(LL\" \"LL, &from, &to);\n printf(LL\"\\n\", solve(to) - solve(from - 1));\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c97ff0bc692e9f2546cb1ed2150ad9dd", "src_uid": "37feadce373f728ba2a560b198ca4bc9", "apr_id": "ba8e3c24fd8efaef61e4db8d0fad8320", "difficulty": 2500, "tags": ["dp", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9997427321842037, "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#define REP(i,a,b) for(i=a;i=0;now--){\n rep(i,M) nx1[i]=nx2[i]=0;\n\n rep(i,M) if(dp2[i]) rep(k,us) nx2[nex[i][k]] += dp2[i];\n \n rep(i,M) if(dp1[i]) rep(k,us){\n if(go[now]==use[k]) nx1[nex[i][k]] += dp1[i];\n if(go[now]> use[k]) nx2[nex[i][k]] += dp1[i];\n }\n\n swap=dp1, dp1=nx1, nx1=swap;\n swap=dp2, dp2=nx2, nx2=swap;\n }\n\n rep(i,M) dp[mask][i] = dp1[i] + dp2[i];\n }\n\n res = 0;\n rep(mask,1<<8){\n g=1;\n rep(i,8) if(mask&1<\n#include\n#include\n#define REP(i,a,b) for(i=a;i=0;now--){\n rep(i,M) nx1[i]=nx2[i]=0;\n\n rep(i,M) if(dp2[i]) rep(k,us) nx2[nex[i][k]] += dp2[i];\n \n rep(i,M) if(dp1[i]) rep(k,us){\n if(go[now]==use[k]) nx1[nex[i][k]] += dp1[i];\n if(go[now]> use[k]) nx2[nex[i][k]] += dp1[i];\n }\n\n swap=dp1, dp1=nx1, nx1=swap;\n swap=dp2, dp2=nx2, nx2=swap;\n }\n\n rep(i,M) dp[mask][i] = dp1[i] + dp2[i];\n }\n\n res = 0;\n rep(mask,1<<8){\n g=1;\n rep(i,8) if(mask&1<\n#include \n#include \n#define MOD 1000000007\n\nint cmpfunc(const void *a, const void *b){\n return *(int*)a - *(int*)b;\n}\n\nint min(int a,int b){\n\treturn (a>b)?b:a;\n}\n\nint\nmain(int argc, char *argv[]) {\n\tlong long a,b;\n scanf(\"%lld %lld\",&a,&b);\n int sa[100],sb[100];\n int i=0;\n while(a>0){\n sa[i]=a%2;\n a/=2;\n i++;\n }\n int j=0;\n while(b>0){\n sb[j]=b%2;\n b/=2;\n j++;\n }\n int k;\n int len_a=i,len_b=j;\n long long ans=0;\n if(len_a==len_b) {\n for(i=len_a-1;i>=0;i--){\n if(sa[i]==sb[i] && sa[i]==1) ;\n else break;\n }\n if(i<0) {ans=0;}\n else{\n if(sa[i]==sb[i] && sa[i]==0){\n for(j=i-1;j>=0;j--){\n if(sb[j]==0) {ans=0;break;}\n }\n if(j<0) {ans++;}\n } else{\n for(j=i-1;j>=0;j--){\n if(sb[j]==0) break;\n }\n if(j>=0){\n ans=i-j;\n for(k=j-1;k>=0;k--){\n if(sb[k]==0) break;\n }\n if(k<0) {ans++;}\n } else {ans=i+1;}\n }\n }\n } else {\n for(i=len_a-1;i>=0;i--){\n if(sa[i]==0) break;\n }\n if(i>=0){\n ans=i+1;\n }\n for(i=len_a+1;i=0;i--){\n if(sb[i]==0) break;\n }\n if(i<0) {ans+=len_b;}\n else{\n ans+=len_b-2-i;\n for(k=i-1;k>=0;k--){\n if(sb[k]==0) break;\n }\n if(k<0) {ans++;}\n }\n }\n printf(\"%lld\\n\",ans);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "22de7dc902f0975ea66292bac8798273", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "5bcb39abb8afe8df44243e7d1ccc318f", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.6390862944162436, "equal_cnt": 23, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 5, "fix_ops_cnt": 23, "bug_source_code": "#include \n#include \n\ntypedef unsigned long long int llu;\n\n\nint numberOfZeros(llu num, size_t const size){\n\tint i, result, temp;\n\tfor(i = 0, result = 0, temp = 0; i < size*8; i++){\n\t\t// printf(\"%llu\\n\", num);\n\t\tif(num%2 == 0){\n\t\t\ttemp++;\n\t\t} else {\n\t\t\tresult += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tnum = num >> 1;\n\t\t// printBits(sizeof(num), &num);\n\t}\n\n\treturn result;\n}\n\nvoid printBits(size_t const size, void const * const ptr)\n{\n unsigned char *b = (unsigned char*) ptr;\n unsigned char byte;\n int i, j;\n\n for (i=size-1;i>=0;i--)\n {\n for (j=7;j>=0;j--)\n {\n byte = b[i] & (1<>= j;\n printf(\"%u\", byte);\n }\n }\n puts(\"\");\n}\n\nint findMax(llu* b){\n\tint i;\n\tllu max = 1, mask = 3;\n\tmax = ~(max << (sizeof(max)*8 - 2));\n\t\n\n\tfor(i = 0; i < sizeof(max)*8; i++){\n\t\tif(max <= *b){\n\t\t\tbreak;\n\t\t}\n\t\tmax = max >> 1;\n\t}\n\n\tmask = mask << (61 - i);\n\tfor(; (max ^ mask) <= *b && i < 62; max = max ^ mask, mask = mask >> 1, i++);\n\n\t*b = max;\n\n\treturn 62 - i;\n}\n\nint findMin(llu *a, llu b){\n\tint i;\n\tllu min;\n\n\tfor(min = *a; min < b; min++){\n\t\tif(numberOfZeros(min, sizeof(min)) == 1){\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t*a = min;\n\n\tfor(i = 0; i < 8*sizeof(min); i++){\n\t\tif(min%2 == 0){\n\t\t\tbreak;\n\t\t}\n\t\tmin = min >> 1;\n\t}\n\n\treturn i;\n}\n\nint len(llu a){\n\tint temp, i, result;\n\n\tfor(i = 0, temp = 0, result = 0; i < 8*sizeof(a); i++, temp++, a = a >> 1){\n\t\tif(a%2 != 0){\n\t\t\tresult += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t}\n\n\n\treturn ++result;\n}\n\nint main(){\n\tllu i, a, b, ta, tb, result = 0;\n\tint pa, pb;\n\n\tscanf(\"%llu %llu\", &a, &b);\n\tta = a;\n\ttb = b;\n\n\tpb = findMax(&tb);\n\tpa = findMin(&ta, tb);\n\n\tif(ta >= a && tb <= b && ta <= tb){\n\t\tfor(i = len(ta); i <= len(tb); i++){\n\t\t\tresult += i - 1;\n\t\t}\n\n\t\tresult -= pb;\n\t\tresult -= len(ta) - 2 - pa;\n\t}\n\t\n\tprintf(\"%llu\", result);\n\treturn 0;\n}\n// 1453787442792", "lang": "GNU C", "bug_code_uid": "d3e94b81e00124331e3652ba9d2402bd", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "9c501b41ab6f30115b4b1eb54ba75021", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.447520184544406, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#include\nint main(){\n\tlong long int i,sayi,a,b,n = 0,sonuc,ensonuc = 0;\n\tscanf(\"%lld %lld\",&a,&b);\n\tfor(i = a ; i <= b ; i++){\n\t\tsayi = i;\n\t\tsonuc = 0;\n\t\twhile(sayi>=1){\n\t\t\tif(sayi%2==0)\n\t\t\t\tsonuc++;\n\t\t\tsayi=sayi/2;\n\t\t\tn++;\n\t\t}\n\t\tif(sonuc==1)\n\t\t\tensonuc++;\n\t}\n\tprintf(\"%lld\",ensonuc);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "beba1366b23a50006b3cf83c4c127910", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "bf9a3aa8a7f6af49d93f2b153bd362e5", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.3581757508342603, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#include\n\nint main()\n{\n\tunsigned long long int s, e, cnt=0, curcnt, cn, temp, temp2;\n\tscanf(\"%llu %llu\",&s, &e);\n\tfor(temp=s;temp<=e;temp++){\n\t\t//printf(\"%llu\\n\",temp);\n\t\tfor(cn=temp,curcnt=0;cn>0;cn=cn>>1){\n\t\t\ttemp2=cn&1;\n\t\t\tif(temp2==0)curcnt++;\n\t\t\tif(curcnt==2) break;\n\t\t}\n\t\tif(curcnt==1) cnt++;\n\t}\n\tprintf(\"%llu\\n\",cnt);\n\treturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "00a9f90d05e06f5df61f62fe673db44f", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "a8e5d336a9bb73b8471aed9f86c757a9", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.906507105459985, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \nlong long int power(long long int x,long long int y)\n{\n\tif(y==0)\n\t\treturn 1;\n\telse if(y%2==0)\n\t\treturn power(x,y/2)*power(x,y/2);\n\telse\n\t\treturn x*power(x,y/2)*power(x,y/2);\n}\nint cmpfunc (const void * a, const void * b)\n{\n\treturn ( *(int*)a - *(int*)b );\n}\nint main()\n{\n\tlong long int n,i,j,a[2484],l=0,count=0,b,c;\n\tscanf(\"%lld %lld\",&b,&c);\n\tfor(i=2;i<=70;i++)\n\t{\n\t\tfor(j=i-2;j>=0;j--)\n\t\t{\n\t\t\ta[l]=power(2,i)-1-power(2,j);\n\t\t\tl++;\n\t\t}\n\t}\n\tqsort(a, 2484, sizeof(long long int), cmpfunc);\n\tfor(i=0;i<2484;i++)\n\t{\n\t\tif(b<=a[i] && a[i]<=c && a[i]!=a[i+1])\n\t\t{\n\t\t\tcount++;\n\t\t}\n\t}\n\tprintf(\"%lld\\n\",count);\n\treturn 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "6f48944358e1ba731d48c675f2219659", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "b7d169ca7f5065afa3f28ae6c2e925be", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7532671197072661, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n#include\n#include\n#define eps 1e-9\n#define ll long long int \n#define N 500500\nchar arr[N];\nll first_try(ll numb){\n ll gen = numb+3;\n if(gen%4==0){\n ll before=(gen/4)-1;\n ll get_res=((gen/4+before)-1)*6;\n return get_res + (numb-1);\n }\n ll gen1=numb+2;\n if(gen1%4==0){\n ll before=(gen1/4);\n ll get_res=((gen1/4+before)-1)*6;\n return get_res + (numb-1);\n }\n return -1;\n}\n\nll second_try(ll numb){\n ll gen = numb+1;\n if(gen%4==0){\n ll before=(gen/4)-1;\n ll get_res=((gen/4+before)-1)*6;\n return get_res + (numb-3);\n }\n ll gen1=numb;\n if(gen1%4==0){\n ll before=(gen1/4);\n ll get_res=((gen1/4+before)-1)*6;\n return get_res + (numb-3);\n }\n return -1;\n}\nint main(){\n gets(arr);\n char c;\n ll numb=0;\n char *q=arr;\n while(isdigit(*q)){\n numb=numb*10+(*q-'0');\n q++;\n }\n c=*q;\n \n if(first_try(numb)!=-1){\n ll cmpt=first_try(numb);\n cmpt++;\n if(c=='f'){\n printf(\"%lld\",cmpt);\n }\n else if(c=='e'){\n printf(\"%lld\",cmpt+1);\n }\n else if(c=='d'){\n printf(\"%lld\",cmpt+2);\n }\n else if(c=='c'){\n printf(\"%lld\",cmpt+3);\n }\n else if(c=='b'){\n printf(\"%lld\",cmpt+4);\n }\n else if(c=='a'){\n printf(\"%lld\",cmpt+5);\n }\n return 0;\n }\n else{\n ll cmpt=second_try(numb);\n cmpt--;\n if(c=='f'){\n printf(\"%lld\",cmpt);\n }\n else if(c=='e'){\n printf(\"%lld\",cmpt+1);\n }\n else if(c=='d'){\n printf(\"%lld\",cmpt+2);\n }\n else if(c=='c'){\n printf(\"%lld\",cmpt+3);\n }\n else if(c=='b'){\n printf(\"%lld\",cmpt+4);\n }\n else if(c=='a'){\n printf(\"%lld\",cmpt+5);\n }\n return 0;\n }\n}", "lang": "GNU C", "bug_code_uid": "b15a1446f3555719c5cc7bc65a884748", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "70b7186facae2f68c17449b25da732ad", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.32644628099173556, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "#include\nint main() {\n long long row=0;\n char col='\\0';\n while(1){\n char get=getchar();\n if(get=='\\n' || get==EOF){\n break;\n }else{\n if(get>='0' && get<='9'){\n row=10*row+(long long)(get-'0');\n }else{\n col=get;\n break;\n }\n }\n }\n //printf(\"row=%lld,col=%c\\n\",row,col);\n long long time=1;\n //int step=0;\n long long row1=1;\n char col1='f';\n long long row2=3;\n char col2='f';\n\n while(1){\n /*\n if(step==5)break;\n step++;\n */\n if(row1==row && col1==col){\n printf(\"%lld\\n\",time);\n break;\n }else if(row2==row && col2==col){\n printf(\"%lld\\n\",time);\n break;\n }\n //printf(\"%lld %c \",row1,col1);\n //printf(\"%lld %c \",row2,col2);\n //printf(\"%lld\\n\",time);\n if(col1=='f'){\n //printf(\"?##%lld####\\n\",time);\n col1 ='e';\n col2 ='e';\n time+=1;\n }else if(col1=='e'){\n col1='d';\n col2='d';\n time+=1;\n }else if(col1=='d'){\n col1='a';\n col2='a';\n time+=1;\n }else if(col1=='a'){\n col1='b';\n col2='b';\n time+=1;\n }else if(col1=='b'){\n col1='c';\n col2='c';\n time+=1;\n }else if(col1=='c'){\n time+=1;//先走到下一排,再走到下一个座位\n col1='f';\n col2='f';\n if(row1%2==1){\n row1=row1+1;\n row2=row2+1;\n time+=1;\n }else{\n row1=row1+3;\n row2=row2+3;\n time+=3;\n }\n }\n }\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "6523922691f5bc913c3caf592de712a5", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "af0cd4f6684b428394bd3f417e3f432e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8844133099824869, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#include\nint main() {\n long long row=0;\n char col='\\0';\n while(1){\n char get=getchar();\n if(get=='\\n' || get==EOF){\n break;\n }else{\n if(get>='0' && get<='9'){\n row=10*row+(long long)(get-'0');\n }else{\n col=get;\n break;\n }\n }\n }\n //printf(\"%lld %c\\n\",row,col);\n long long base_time=0;\n if(row%4==1){\n base_time=row*4-3;\n }else if(row%4==2){\n if(row<4){\n base_time=(1)*4-3+7;\n }else{\n base_time=(row-4+1)*4-3+7;\n }\n }else if(row%4==3){\n base_time=row*4-3;\n }else if(row%4==0){\n base_time=(row-4+1)*4-3+7;\n }\n long long real_time=0;\n //printf(\"base time = %lld\\n\",base_time);\n if(col=='f'){\n real_time=base_time+0;\n }else if(col=='e'){\n real_time=base_time+1;\n }else if(col=='d'){\n real_time=base_time+2;\n }else if(col=='a'){\n real_time=base_time+3;\n }else if(col=='b'){\n real_time=base_time+4;\n }else if(col=='c'){\n real_time=base_time+5;\n }\n printf(\"%lld\\n\",real_time);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "047d208f2d3449180f72afb39f836bf4", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "af0cd4f6684b428394bd3f417e3f432e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.13816534541336353, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main(){\n\tlong int i,serve=0,n;\n\tchar s[2];\n\tscanf(\"%s\",s);\n\tn=s[0]-'0';\n\tserve=(n-1)/4*16;\n\tif(n%2==1){\n\t\tif(s[1]=='d'||s[1]=='e'||s[1]=='f'){\n\t\t\n\t\tserve=serve+'g'-s[1];\n}\nelse{\n\tserve=serve+4+s[1]-'a';\n}\n\t}\n\telse{\n\t\tif(s[1]=='d'||s[1]=='e'||s[1]=='f'){\n\t\t\n\t\tserve=serve+'g'-s[1]+7;\n}\nelse{\n\tserve=serve+s[1]-'a'+11;\n}\n\t}\n\tprintf(\"%ld\",serve);\n\t\n}", "lang": "GNU C", "bug_code_uid": "909f46ccca6c81a054f98c80555b6ebc", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "29b637155c4d6862dad3fff24b08acd7", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.804953560371517, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "#include\n\nint main()\n{\n int w;\n scanf(\"%d\",w);\n if((w>0)&&(w<100)&&(!(w%2)))\n printf(\"YES\");\n return 0;\n}", "lang": "GNU C11", "bug_code_uid": "a9a3c526ba30910d4fed6266a5f32b89", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "1b1ed0273521e33815a47c4ed089d759", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9925093632958801, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#include\n#include\n#include\n#include\n#include\n\n#define SORT while(t--){for(i=0;iarr[i+1]){o=arr[i];arr[i]=arr[i+1];arr[i+1]=o;}}\n#define R return 0;\n#define and &&\n#define or ||\n#define buyuk(a,b) (a\n#include \n\nstruct nodoLista{\n int dato;\n struct nodoLista * ptrSiguiente;\n};\n\ntypedef struct nodoLista NodoLista;\ntypedef NodoLista *ptrNodoLista;\n\nvoid insertar(ptrNodoLista *ptrS, int valor);\nint main(){\n int n;\n scanf(\"%d\", &n);\n int array[n];\n int i;\n for( i = 0; i < n; i++ )\n scanf(\"%d\", &array[i]);\n\n ptrNodoLista ptrInicial = NULL;\n\n for( i = 0; i < n; i++)\n insertar(&ptrInicial, array[i]);\n\n int resp = 0;\n\n ptrNodoLista ptrAnterior, ptrCentro, ptrPosterior, temp;\n temp = ptrInicial;\n do{\n ptrAnterior = temp;\n ptrCentro = temp->ptrSiguiente;\n ptrPosterior = ptrCentro->ptrSiguiente;\n if( (ptrAnterior->dato + 1) == ptrCentro->dato )\n if( (ptrCentro->dato + 1) == ptrPosterior->dato ){\n resp = 1;\n break;\n }\n temp = ptrCentro;\n }while( ptrPosterior->ptrSiguiente != NULL );\n\n resp?printf(\"YES\"):printf(\"NO\");\n\n return 0;\n\n}/* fin de main */\n\nvoid insertar(ptrNodoLista *ptrS, int valor)\n{\n ptrNodoLista ptrNuevo;\n ptrNodoLista ptrAnterior;\n ptrNodoLista ptrActual;\n\n ptrNuevo = malloc(sizeof(NodoLista));\n\n if(ptrNuevo != NULL){\n ptrNuevo->dato = valor;\n ptrNuevo->ptrSiguiente = NULL;\n\n ptrAnterior = NULL;\n ptrActual = *ptrS;\n\n while( ptrActual != NULL && valor >= ptrActual->dato){\n ptrAnterior = ptrActual;\n ptrActual = ptrActual->ptrSiguiente;\n }/* fin de while */\n\n\n if(ptrAnterior == NULL){\n if(*ptrS == NULL || (*ptrS)->dato != valor){\n ptrNuevo->ptrSiguiente = *ptrS;\n *ptrS = ptrNuevo;\n }\n }\n else{\n if( ptrAnterior->dato != ptrNuevo->dato ){\n ptrAnterior->ptrSiguiente = ptrNuevo;\n ptrNuevo->ptrSiguiente = ptrActual;\n }\n }/* en de else */\n\n }/* fin de if */\n else{\n printf(\"No se inserto %c. No hay memoria disponible.\\n\", valor);\n }/* fin de else */\n\n}/* fin de la función insertar */\n", "lang": "GNU C", "bug_code_uid": "c959369319db2d6cb566181e0571ef50", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "996ddab5a2d1bcacd2a86858e7a0114c", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.31116389548693585, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 23, "bug_source_code": "#include\nint main()\n{\n long n,i,j,swap,s=0;\n scanf(\"%ld\",&n);\n long a[n];\n for(i=0;ia[j+1])\n {\n swap=a[j];\n a[j]=a[j+1];\n a[j+1]=swap;\n }\n }\n }\n for(i=0;ia[j+1])\n {\n swap=a[j];\n a[j]=a[j+1];\n a[j+1]=swap;\n }\n }\n }\n for(i=0;i\n#include\nint cmpfunc (const void * a, const void * b)\n{\n return ( *(int*)a - *(int*)b );\n}\nint main()\n{\n\tint a[50],t;\n\tint n;scanf(\"%d\",&n);\n\tint i,j,count=0;\n\tfor(i=0;i\nint main()\n{\n\tint i,n;\n\tscanf(\"%d\",&n);\n\tint a[n],x[1005]={0};\n\tfor(i=0;i\n#include \n\n\n\n/*--------- Estructura del arbol -------*/\ntypedef struct nodo{\n int nro;\n struct nodo *izq, *der;\n}*ABB;\n\nint numNodos = 0; // nummero de nodos del arbol ABB\nint numK = 0, k; // nodos menores que un numero k ingresado\n\n\nABB crearNodo(int x)\n{\n ABB nuevoNodo = new(struct nodo);\n nuevoNodo->nro = x;\n nuevoNodo->izq = NULL;\n nuevoNodo->der = NULL;\n\n return nuevoNodo;\n}\nvoid insertar(ABB *arbol, int x)\n{\n if(arbol==NULL)\n {\n arbol = crearNodo(x);\n }\n else if(x < arbol->nro)\n insertar(arbol->izq, x);\n else if(x > arbol->nro)\n insertar(arbol->der, x);\n}\n\nvoid preOrden(ABB arbol)\n{\n if(arbol!=NULL)\n {\n printf(\"%d \", arbol->nro);\n preOrden(arbol->izq);\n preOrden(arbol->der);\n }\n}\n\nvoid enOrden(ABB arbol)\n{\n if(arbol!=NULL)\n {\n enOrden(arbol->izq);\n\t\t printf(\"%d \", arbol->nro);\t\n enOrden(arbol->der);\n }\n}\n\nvoid postOrden(ABB arbol)\n{\n if(arbol!=NULL)\n {\n enOrden(arbol->izq);\n enOrden(arbol->der);\n\t\t printf(\"%d \", arbol->nro);\n }\n}\n\n\n\nABB arbolEspejo(ABB arbol)\n{\n ABB temp;\n\n if(arbol!=NULL)\n {\n temp = arbol->izq;\n arbol->izq = arbolEspejo(arbol->der);\n arbol->der = arbolEspejo(temp);\n }\n return arbol;\n}\n\n\n\n\nint main()\n{\n ABB arbol = NULL;\n int el;\n int cant,i;\n\tscanf(\"%d\",&cant);\n\tfor(i=0; i\n#include\n\nstruct llst_int\n{\n\tint a;\n\tstruct llst_int *next;\n};\ntypedef struct llst_int __llst_int;\n\n__llst_int* receive_sort(__llst_int *head, int *p);\nint check(__llst_int *head);\n\nint main()\n{\n\t__llst_int *head;\n\t__llst_int *temp;\n\tint n;\n\tchar flag;\n\t\n\tscanf(\"%d\",&n);\t\n\thead = (__llst_int *)malloc(sizeof(__llst_int));\n\thead = receive_sort(head, &n);\n\tflag=check(head);\n\tif(flag)\n\t\tputs(\"YES\");\n\telse\n\t\tputs(\"NO\");\n\n\treturn 0;\n}\n\n__llst_int* receive_sort(__llst_int *head, int *p)\n{\n\t__llst_int *k;\n\t__llst_int *temp;\n\t__llst_int *t;\n\tint i;\n\tint j;\n\t\n\tscanf(\"%d\",&head->a);\n\thead->next = NULL;\n\n\ti=1;\n\twhile(i<*p)\n\t{\n\t\ttemp = (__llst_int *)malloc(sizeof(__llst_int));\n\t\ttemp->next=NULL;\n\t\tscanf(\"%d\",&temp->a);\n\t\tt=head;\n\t\tj=0;\n\t\tif(temp->a > t->a)\n\t\t\tj++;\n\t\twhile(jnext && temp->a > t->next->a)\n\t\t{\t\n\t\t\tt = t->next;\n\t\t\tj++;\n\t\t}\n\t\tif(j==i)\n\t\t{\n\t\t\tif(i>1)\n\t\t\t\tt->next=temp;\n\t\t\telse\n\t\t\t\thead->next=temp;\n\t\t\ti++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(j)\n\t\t\t{\n\t\t\t\tif(temp->a == t->next->a)\n\t\t\t\t{\n\t\t\t\t\tfree(temp);\n\t\t\t\t\t(*p)--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tk=t->next;\n\t\t\t\t\tt->next=temp;\n\t\t\t\t\ttemp->next=k;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(temp->a == t->a)\n\t\t\t\t{\n\t\t\t\t\tfree(temp);\n\t\t\t\t\t(*p)--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tk=head;\n\t\t\t\t\thead=temp;\n\t\t\t\t\thead->next=k;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn head;\n}\n\nint check(__llst_int *head)\n{\n\t__llst_int *temp;\n\t\n\ttemp=head;\n\twhile(temp->next->next)\n\t{\n\t\tif(temp->a+1==temp->next->a && temp->a+2==temp->next->next->a)\n\t\t\treturn 1;\n\t\ttemp=temp->next;\n\t}\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "0577bb1b85b0760b1e9977336f1638b8", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "279af2ba2c6e4ca30a672c214267c2dc", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.008069939475453935, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "balls.c", "lang": "GNU C", "bug_code_uid": "afff3a97c19f4850f127e89d26080c92", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "3a45240c672cf5380dc108ec18786b13", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.39493136219640973, "equal_cnt": 18, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "#include\n#include\nusing namespace std;\nint main()\n{\nint n;\nint arr[52];\ncin>>n;\nfor(int i=0;i>arr[i];\n}\nsort(arr,arr+n);\n\n//\nint count =0;\nint flag =0;\nfor(int i =1;i\n\nint main () {\n\n\tint n;\t\t\t\t\t\t\t\t// cantidad de bolas a ingresar\n\tint i;\t\t\t\t\t\t\t\t// indice para recorrer\n\tint j;\t\t\t\t\t\t\t\t// indice para recorrer\n\tint cont=0;\t\t\t\t\t\t\t// cuenta la cantidad de numeros distintos ingresados\n\tint ban;\t\t\t\t\t\t\t// bandera\n\t\n\tdo{\t\t\t\t\t\t\t\t// validacion\n\t\tscanf ( \"%d\", &n );\t\t\t\t\t// se ingresan la cantidad de bolas\n\t} while ( !(3 ≤ n && n ≤ 50) );\n\t\n\tint v[n];\t\t\t\t\t\t\t// vector de bolas y sus respectivos pesos, pueden haber bolas repetidas\n\n\tfor (i=0; ib[j+1] ) {\t\t\t\t// si se cumple dicha condicion se intercambian las bolas\n\t\t\t\tb[j]=b[j]+b[j+1];\n\t\t\t\tb[j+1]=b[j]-b[j+1];\n\t\t\t\tb[j]=b[j]-b[j+1];\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor ( i=0; i\nvoid main()\n{\n int a,b;\n scanf(\"%d,&a\");\n b=a/2;\n if(b%2==0)\n {\n printf(\"YES\");\n }\n else{\n printf(\"NO\");\n }\n \n}", "lang": "GNU C11", "bug_code_uid": "131d2bad45a99a6ea1ed8994d2eb7861", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "ab5ed99d06a2ece777482e1e070a0558", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9992069785884219, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include\n#include\nint ara[10000];\nint factors(int n)\n{\n int i,j,k,m=0;\n for(i=1;i\nint chekk(int a,int b, int c)\n{\n\tif(((a+b)>c)&&((b+c)>a)&&((c+a)>b))\n\t\treturn -1;\n\telse\n\t{\n\tif((a>=b)&&(a<=c))\n\t\treturn a;\n\tif((b>=c)&&(b<=a))\n\t\treturn b;\n\tif((c>=a)&&(c<=b))\n\t\treturn c;\n\t}\n\treturn 0;\n}\nint fu(int a, int b, int c)\n{\n\tint add=0,d;\n\tint fl=chekk(a,b,c);\n\tif(fl==-1)\n\t\treturn add;\n\twhile(fl!=-1)\n\t{\n\t\tif(fl==a)\n\t\t{\n\t\t\tif(c>b)\n\t\t\t\t{\n\t\t\t\t\td=c-b+1;\n\t\t\t\t\tadd=d-a;\n\t\t\t\t\treturn add;\n\t\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\td=b-c+1;\n\t\t\t\tadd=d-a;\n\t\t\t\treturn add;\n\t\t\t}\n\t\t}\n\t\tif(fl==b)\n\t\t{\n\t\t\tif(a>c)\n\t\t\t\t{\n\t\t\t\t\td=a-c+1;\n\t\t\t\t\tadd=d-b;\n\t\t\t\t\treturn add;\n\t\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\td=c-a+1;\n\t\t\t\tadd=d-b;\n\t\t\t\treturn add;\n\t\t\t}\n\t\t}\n\t\tif(fl==c)\n\t\t{\n\t\t\tif(a>b)\n\t\t\t\t{\n\t\t\t\t\td=a-b+1;\n\t\t\t\t\tadd=d-c;\n\t\t\t\t\treturn add;\n\t\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\td=b-a+1;\n\t\t\t\tadd=d-c;\n\t\t\t\treturn add;\n\t\t\t}\n\t\t}\n\t}\n\treturn 123;\n}\t\nint main()\n{\n\tint a,b,c,to;\n\tscanf(\"%d\",&a);\n\tscanf(\"%d\",&b);\n\tscanf(\"%d\",&c);\n\tto=fu(a,b,c);\n\tprintf(\"%d\\n\",to);\n\treturn 0;\n}\n\t\n", "lang": "GNU C11", "bug_code_uid": "2a7d0637847ae3cc258782df4565d0f5", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "f3af28993b2d524df46eff79999075be", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6386554621848739, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#include\nmain()\n{\n\tint a,b,c,y,z,i;\n\tscanf(\"%d%d%d\",&a,&b,&c);\n\ty=(b/2);\n\tz=(c/4);\n\ta=1&&y>=2&&z>=4){\n if(x<=y/2&&x<=z/4){\n printf(\"%d\",7*x);\n }\n if(y/2<=x&&y/2\nint main()\n{\n int a,b,c,i,k=0;\n scanf(\"%d%d%d\",&a,&b,&c);\n for(i=0;i1 && c>3)\n {\n b=b-2;\n c=c-4;\n k=k+1;\n }\n }\n print(k);\n}", "lang": "GNU C", "bug_code_uid": "4bf8d27850c8795f2753aab56267bc84", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "ef491b6f2af5140278983e0d66126efe", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.897196261682243, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\n\nint main(void){\n long long a,b,c;\n scanf(\"%lld%lld%lld\",&a,&b,&c);\n long long d = a;\n\n if(b/2 < d)\n d = b/2;\n if(c/4 < d)\n d = c/4;\n\n printf(\"%I64d\\n\",7*d);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "fad3abbaeebcc17490dc84e81f164558", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "2920bb0ba0b0efd94ad03cfa4f8f6c09", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8104347826086956, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "#include\nint main ()\n{\n int a,b,c,i,count=0,count1=0,count2=0;\n scanf(\"%d %d %d\",&a,&b,&c);\n if(c=2 && c/a>=4)\n break;\n else\n continue;\n\n }\n\n\n\n printf(\"%d\",(a+a*2+a*4));\n\n }\n}\n", "lang": "GNU C", "bug_code_uid": "9990deb4b449b8785a43d535f0763371", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "f41406571b7b5568b80ccaf5a1ee821b", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.41839080459770117, "equal_cnt": 21, "replace_cnt": 7, "delete_cnt": 10, "insert_cnt": 3, "fix_ops_cnt": 20, "bug_source_code": "#include\n#include \nint func(int a, int b)\n{\nif(b>=2*a)\n{\nb=2*a;\n\n}\nelse{\n\nif(b%2==0)\n{\na=b/2;\n}\n\nelse{a=b/2;\nb-=1;}\n}\n\n}\n\n\n\n}\n\n\n\nint main()\n{\n\n int a, b, c;\n\nscanf(\"%d %d %d\", &a, &b, &c);\n\nfunc(a, b);\nfunc(b, c);\nfunc(a, b);\nfunc(b, c);\nprintf (\"%d\", a+b+c); \n\n\n\n\n\n\n\n\n\n\n\n\n}\n", "lang": "GNU C", "bug_code_uid": "daffe3bbf0d9be7b3cc0c2e02074281b", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "b3ef33903f9df8429dcab17a4ff17698", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9413407821229051, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include \n#include \n#include \n#include \nusing namespace std;\n\nint main()\n{\n int lem;\n int app;\n int peace;\n\n cin >> lem;\n cin >> app;\n cin >> peace;\n \n int k_p;\n int k_a;\n int k_l;\n int k;\n int sum;\n \n k_p = peace/4;\n k_a = app/2;\n k_l = lem/1;\n \n if(k_p>0 && k_a>0 && k_l>0)\n {\n if(k_p >= k_a)\n {\n if(k_a >= k_l)\n {\n k = k_l;\n \n }\n else\n {\n k = k_a;\n } \n }\n else if(k_p < k_a)\n {\n if(k_p >= k_l)\n {\n k = k_l;\n }\n else\n {\n k = k_p;\n } \n }\n else if(k_a < k_l)\n {\n if(k_a >= k_p)\n {\n k = k_p;\n \n }\n else\n {\n k = k_a;\n } \n }\n else if(k_l >= k_a)\n {\n if(k_a > k_l)\n {\n k = k_l;\n \n }\n else\n {\n k = k_a;\n } \n }\n else if(k_p >= k_l)\n {\n if(k_a > k_l)\n {\n k = k_l;\n \n }\n else\n {\n k = k_a;\n } \n }\n else if(k_l < k_p)\n {\n if(k_a >= k_l)\n {\n k = k_l;\n \n }\n else\n {\n k = k_a;\n } \n }\n \n sum = k * 7;\n }\n else\n {\n sum = 0;\n }\n \n \n cout << sum;\n \n system(\"pause\");\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "32198482e7cd098ef248d265b514ad1a", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "88ec3c2eb36b8a48663e199d8507d4fb", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9986431478968792, "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 l, a, p, i, total;\n scanf(\"%d\", &l);\n scanf(\"%d\", &a);\n scanf(\"%d\", &p);.\n\n if(p<4 || a<2) total = 0;\n else {\n for(i=l; i>=1; i--) {\n if(i*2<=a && i*4<=p) {\n total = i + (i*2) + (i*4);\n break;\n }\n }\n }\n\n printf(\"%d\", total);\n return 0;\n\n}\n", "lang": "GNU C", "bug_code_uid": "63ae7b032c63b14c15bb23fadb5bac45", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "e8f7f6911c29834e39155100caaa9fe5", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.6506849315068494, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#include\nint main()\n{\n int a,b,c;\n while(~scanf(\"%d%d%d\",&a,&b,&c) )\n {\n int i;\n for( i=a;i>0; i--)\n {\n if(2*i<=b&&4*i<=c)\n printf(\"%d\\n\",7*i);\n break;\n }\n }\n return 0;\n}", "lang": "GNU C", "bug_code_uid": "034a437b80d909cb9b8e73e64babcc4a", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "56da9b6dc2cf4429f7ec6300bafe0de0", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9333333333333333, "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\n\n int l,a,p,mk,min,tmp;\n int lm,ap,per;\n while(scanf(\"%d %d %d\",&l,&a,&p))\n {\n\n\n lm=l;\n ap=a/2;\n per=p/4;\n if(lmper)\n mk=per;\n else\n mk=min;\n\n printf(\"%d\\n\",7*mk);\n }\n return 0;\n}\n\n\n", "lang": "GNU C", "bug_code_uid": "a2c099ea00fa78e5deafd35afc550cd2", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "5ba6e4777add5acfaef964bd938437d2", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7513812154696132, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#include\n\nint main()\n{\n\tint l,a,p,d=0;\n\tscanf(\"%d%d%d\",&l,&a,&p);\n\td=p/4;\n\tif(d>0)\n\twhile(a/d<=0&&d!=0) d--;\n\twhile(l/d<=0&&d!=0) d--;\n\tprintf(\"%d\\n\",d+d*2+d*4);\t\t\t\t\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "23453e71a620f26a74811aee20bb2caf", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "3c077941c7ae800cac488db8ee966c80", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.2554112554112554, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#include\nint main()\n{\n int a,b,c,i;\n scanf(\"%d %d %d\",&a,&b,&c);\n for(i=a;i>=0;i--)\n {\n if(i*2<=b&&i*4<=c)\n System.out.println(i+i*2+i*4);\n }\n}", "lang": "GNU C", "bug_code_uid": "ea099b6b59c178e034bc4bead63653eb", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "e994c7812f9e658b4e3148a1838470c0", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.33381712626995647, "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 res=0,mres=0;\n int m,b,x,y,i,j;\n scanf(\"%d%d\",&m,&b);\n for(y=0;y<=b;y++){\n x=m*(b-y);\n for(i=0;i<=y;i++){\n for(j=0;j<=x;j++)\n res+=i+j;\n }\n if(res>mres){\n mres=res;\n res=0;\n }\n else\n res=0;\n }\n printf(\"%I64d\",mres);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "e5c81a21d0799ff06ad19ef8b370428b", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "7c258902ee832abe85762950553d6656", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9310344827586207, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include\n#include\n\nint main(){\n\tunsigned long long ans=0,temp=0;\n\tint i,j,m,b;\n\tscanf(\"%d%d\",&m,&b);\n\t\n\tfor(i=0;i<=b*m;i=i+m){\n\t\tj= (m*b - i)/m; \t\t\n\t\ttemp = ((i*(i+1))/2)*(j+1) + ((j*(j+1))/2)*(i+1);\n\t\tif(temp>ans)\n\t\t\tans=temp;\n\t}\n\tprintf(\"%llu\\n\",ans);\n}\n\n", "lang": "GNU C", "bug_code_uid": "d2750dbe1fac2fd06de053116968c53b", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "af437f6afa725d6390d24dc54cba964b", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7432432432432432, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#include \n\ntypedef long long int INT64;\n\nint main(void) {\n INT64 m = 0, b = 0, x = 0, y = 0, max = 0, tree = 0;\n\n\tscanf(\"%lld %lld\", &m, &b);\n \n x = b * m;\n \n while (x >= 0) {\n y = b - x / m;\n if (x % m != 0) {\n y--;\n }\n \n tree = ((y + 1) * x * (x + 1)) / 2 + ((x + 1) * y * (y + 1)) / 2;\n printf(\"%lld %lld %lld\\n\", x, y, tree);\n \n if (tree > max) {\n max = tree;\n }\n \n x--;\n }\n\n\tprintf(\"%lld\\n\", max);\n\n\treturn 0;\n}", "lang": "GNU C", "bug_code_uid": "005259acc3a49e35394598b43ef39fcc", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "d8c9303d1f76268a6b83e6efe3e6b60f", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9988726042841037, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/****************************************/\n/* Created by Kalashnikov Vladislav \t*/\n/*\t\t\t\t\t*/\n/*\t\t\t\t\t*/\n/*\t\t\t\t\t*/\n/*\t\t\t\t\t*/\n/****************************************/\n\n#include \n\n\nint main(){\n\nint m;\nlong long b,i;\nlong long sum = 0LL;\n\nscanf(\"%d%lli\",&m, &b);\nlong long r = m*b;\nfor (i=0;i sum) ? s : sum;\n}\n\nprintf(\"%lli\\n\",sum);\nreturn 0;\n}\n", "lang": "GNU C", "bug_code_uid": "54c2479cc693b086683e8bc99a3e39ce", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "461b9114def45c13a0a432472a4d5513", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9649334945586457, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include\n\nlong long f(long long x)\n{\n return x*(x+1)/2;\n}\n\nint main()\n{\n long long ans,sum;\n int m,b,x,y,yy;\n\n scanf(\"%d%d\",&m,&b);\n ans = sum = f(b);\n yy = b;\n for(x=1;x<=m*b;x++)\n {\n y = (b*m-x)/m;\n if(yy>y)sum -=f(x-1)+yy*x;\n sum += f(y) + (long long)x*(y+1);\n yy = y;\n if(sum>ans)ans = sum;\n }\n printf(\"%I64d\\n\",ans);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "d62c79dae3e39c443bbcca1864cda197", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "129e6a1cb8aaa4e57428956af00ed5e8", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.22857142857142856, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#include\n\nint main()\n{\n int n,m,rmdr,x,sum=0;\n\n scanf(\"%d%d\",&n,&m);\n x=n;\n while(x>0)\n {\n rmdr=x%m;\n x=x/m;\n sum=sum+x;\n x=x+rmdr;\n if(x\nint main()\n{\n int n,i,initial,day,copy_initial,amount,remainder;\n int socks=0,total_socks,day_without_socks;\n scanf(\"%d %d\",&initial,&day);\n copy_initial=initial;\n while(initial>0) //if i didn't give the second condition loop would never stop cause always 1 remainder will be left.\n {\n amount=initial/day;\n remainder=initial%day;\n initial=remainder+amount;\n socks=socks+amount;\n if(initial\n#include\n\nint main()\n{\n int a,b,res=0;\n scanf(\"%i%i\", &a, &b);\n while(a&&b){\n a--;\n b--;\n res++;\n }\n printf(\"%i \", res);\n res=0;\n while(a>1){\n a-=2;\n res++;\n }\n while(b>1){\n a-=2;\n res++;\n }\n printf(\"%i\", res);\n return 0;\n};\n", "lang": "GNU C", "bug_code_uid": "4a9a60947b9ea27454df9455f71646bb", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "260e4ab2a36b36fa8fa0bff2e33c98df", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.0, "equal_cnt": 0, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "`````````````2222222222222222222222222222222222222222222222222222\n \t\t \t \t\t \t \t\t\t \t \t\t\t \t\t", "lang": "GNU C", "bug_code_uid": "6ccf6e3475e9366f761faa5ed2818909", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "17a279f1d1ed719ccd91b3dcd77d9874", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.6192504258943782, "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 int x1,x2,y1,y2,x,y,a,b;\n scanf(\"%d %d %d %d %d %d\",&x1,&y1,&x2,&y2,&x,&y);\n if(x==0 && y==0) goto c;\n a=(abs(x1-x2));\n b=(abs(y1-y2));\n if(x!=0 && y!=0){\n if(a%x==0 && b%y==0){\n d:\n if(x2>=x1 && y2>=y1){\n x1=x1+x;\n y1=y1+y;\n /* if(x1==x2 && y1!=y2)\n goto c;\n if(x1!=x2 && y1==y2)\n goto c;*/\n if(x1==x2 && y1==y2)\n goto c;\n else goto d;\n }\n if(x2<=x1 && y2>=y1){\n x1=x1-x;\n y1=y1+y;\n /*if(x1==x2 && y1!=y2)\n goto c;\n if(x1!=x2 && y1==y2)\n goto c;*/\n if(x1==x2 && y1==y2)\n goto c;\n else goto d;\n }\n if(x2>=x1 && y2<=y1){\n x1=x1+x;\n y1=y1-y;\n /* if(x1==x2 && y1!=y2)\n goto c;\n if(x1!=x2 && y1==y2)\n goto c;*/\n if(x1==x2 && y1==y2)\n goto c;\n else goto d;\n }\n if(x2<=x1 && y2<=y1){\n x1=x1-x;\n y1=y1-y;\n /* if(x1==x2 && y1!=y2)\n goto c;\n if(x1!=x2 && y1==y2)\n goto c;*/\n if(x1==x2 && y1==y2)\n goto c;\n else goto d;\n }\n if(x1==x2 && y1!=y2){\n if((abs(y2-y1)/y)%2==0){\n printf(\"YES\");\n goto z;\n }\n else goto c;\n }\n if(x1!=x2 && y1==y2){\n if((abs(x2-x1)/x)%2==0){\n printf(\"YES\");\n goto z;\n }\n else goto c;\n }\n }\n if(a%x!=0 && b%y!=0) goto c;\n }\n if((x==0 || y==0) && (x1==x2 || y1==y2)){\n e:\n if(x2>x1){\n x1=x1+x;\n y1=y1+y;\n if(x2x1) goto c;\n\n if(x1==x2 && y1==y2)\n goto c;\n else goto e;\n }\n if(y2>y1){\n x1=x1+x;\n y1=y1+y;\n if(y2y1) goto c;\n\n if(x1==x2 && y1==y2)\n goto c;\n else goto e;\n }\n }\n c:\n if(x1==x2 && y1==y2)\n printf(\"YES\");\n else\n printf(\"NO\");\n z:\n x=0;\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "abd6eff8a2393d517b150ee264ffbeca", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "8af111997dce5f4216f23eb3b1c6e35c", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.9970326409495549, "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\tint n, c, p;\n\tint b[26] = {0,0 };\n\tchar a[101];\n\tscanf(\"%d%d\", &n, &c);\n\tgetchar();\n\tgets(a);\n\tfor (int i = 0; i < strlen(a); i++)\n\t{\n\t\tp = a[i] - 97;\n\n\t\tb[p]++;\n\t}\n\n\tfor (int i = 0; i < 26; i++)\n\t{\n\t\tif (b[i] >=k+1)\n\t\t{\n\t\t\tprintf(\"NO\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\tprintf(\"YES\");\n\treturn 0;\n}", "lang": "GNU C11", "bug_code_uid": "6f522e18fe10214eb01344e17d945444", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "a499309278af88bbcfe11f4017647063", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9959514170040485, "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,k)\n{scanf(\"%d%d\",&n,&k);\nchar s[n+1];\nint i,j,c;\nscanf(\"%s\",s);\nfor(i=0;s[i]!='\\0';i++)\n{\nc=0;\nfor(j=0;s[j]!='\\0';j++)\n{\nif(s[i]==s[j])\nc++;\t\nif(c>k)\n{\nprintf(\"NO\");\nexit(1);\t\n}\n}\t\n}\nprintf(\"YES\");\n}", "lang": "GNU C11", "bug_code_uid": "3fc1bed9dc5e178e93c27ba3f2dc22a7", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "9a13267ad9f0eba32b44481655972c39", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.8412570507655117, "equal_cnt": 15, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 14, "bug_source_code": "#include \n#include \n\nint main(void){\n\tint i, n ,contX = 0, total = 0;\n\tint cont = 0;\n\tint primera;\n\tconst char eq = 'x';\n\tchar *ptr;\n\t\n\tscanf ( \"%d\", &n );\n\tconst char cadena [n];\n\tscanf ( \"%s\", cadena );\n\t\n\tptr = strchr ( cadena, eq );\n\t\n\tif ( ptr[0] == 'x' && ptr[1] == 'x' && ptr[2] == 'x' ){\n\t\tfor ( i = 0; i < n; i++ ){\n\t\t\tif ( 'x' == cadena[i] ){\n\t\t\t\tcontX++;\n\t\t\t\tif ( contX == 3 ){\n\t\t\t\t\tcontX--;\n\t\t\t\t\ttotal++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcontX = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t\n\tprintf ( \"%d\", total );\n\treturn 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "5856a06ff50caa4bf2d0246b76d61c03", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "6bb8f42060d4ae5fc95e392a68a27a28", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9641693811074918, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#include \nint main()\n{\n int n;\n scanf (\"%d\\n\", &n);\n char a[n];\n int b[24];\n for (int i = 0; i < n; i++)\n {\n scanf(\"%c\", &a[i]);\n }\n int counter = 0, j = 0;\n for (int i = 0; i < n; i++)\n {\n if (a[i] == 'x')\n {\n counter++;\n }\n else if(a[i] != 'x'&& a[i-1] == 'x' && i != 0)\n {\n b[j] = counter;\n j++;\n counter = 0;\n }\n if (i == n-1)\n {\n if (a[i] == 'x')\n {\n b[j] = counter;\n j++;\n counter = 0;\n }\n }\n }\n for (int i = 0; i < j; i++)\n {\n counter = b[i] - 2; \n }\n printf (\"%d\", counter);\n \n} ", "lang": "GNU C11", "bug_code_uid": "e5b6d22cc3a4c327e7a11444716756e1", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "70687f68956dfac9525d03f333f0771e", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9018238261544431, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 11, "bug_source_code": "#include\n#include\n#include\n\ntypedef struct node{\n int v;\n struct node *next;\n} NODE;\n\nvoid dfs(int n, NODE *e[], char v[]){\n NODE *tmp = e[n];\n v[n] = 1;\n while (tmp){\n if (!v[tmp->v])\n dfs(tmp->v, e, v);\n tmp = tmp->next;\n }\n return;\n}\n\nint main(){\n int n, m, i, j, x, y;\n char f[100000], f1 = 0, f2 = 0, v1[100000] = {}, v2[100000] = {};\n NODE *e[100000] = {}, *b[100000] = {}, *tmp;\n scanf(\"%d%d\", &n, &m);\n for (i = 0 ; i < n ; ++i){\n scanf(\"%d\", f + i);\n if (f[i] == 1)f1 = 1;\n else if (f[i] == 2)f2 = 1;\n }\n if (!f1 || !f2){\n while (n--)puts(\"0\");\n return 0;\n }\n \n for (i = 0 ; i < m ; ++i){\n scanf(\"%d%d\", &x, &y);\n --x, --y;\n tmp = calloc(1, sizeof(NODE));\n tmp->v = y, tmp->next = e[x], e[x] = tmp;\n tmp = calloc(1, sizeof(NODE));\n tmp->v = x, tmp->next = b[y], b[y] = tmp;\n }\n for (i = 0 ; i < n ; ++i)\n if (f[i] == 1)\n dfs(i, e, v1);\n for (i = 0 ; i < n ; ++i)\n if (f[i] == 2)\n dfs(i, b, v2);\n for (i = 0 ; i < n ; ++i)\n printf(\"%d\\n\", v1[i] && v2[i]);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "f48a25f8b222fa1862779e9f651e0999", "src_uid": "87d869a0fd4a510c5e7e310886b86a57", "apr_id": "297d90bcbf4682518725c839d3c32201", "difficulty": 1700, "tags": ["graphs"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.2155904296372524, "equal_cnt": 41, "replace_cnt": 30, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 40, "bug_source_code": "#include\n#include\n#include\n\ntypedef struct node{\n int v;\n struct node *pre, *next;\n} NODE;\n\nint e[100000][2], v[100001] = {};\nchar s[100001] = {}, f[100001];\nNODE pre[100000] = {}, *prep[100001];\n\nint cmp(const void *a, const void *b){\n int *x = (int*)a, *y = (int*)b;\n if (x[0] < y[0])return -1;\n if (x[0] > y[0])return 1;\n if (x[1] < y[1])return -1;\n if (x[1] > y[1])return 1;\n return 0;\n}\n\nvoid fill(int now, NODE *prep[]){\n do {\n if (!prep[now]->v)return;\n if (s[prep[now]->v])continue;\n s[prep[now]->v] = 1;\n fill(prep[now]->v, prep);\n }while (prep[now]->pre && (prep[now] = prep[now]->pre));\n return;\n}\n\nint main(){\n int n, m, i, j;\n char f1 = 0, f2 = 0;\n \n scanf(\"%d%d\", &n, &m);\n for (i = 1 ; i <= n ; ++i){\n scanf(\"%d\", f + i);\n if (f[i] == 1)f1 = 1;\n else if (f[i] == 2)f2 = 1;\n }\n if (!f1 || !f2){\n while (n--)puts(\"0\");\n return 0;\n }\n \n for (i = 0 ; i < m ; ++i)\n scanf(\"%d%d\", &e[i][0], &e[i][1]);\n qsort(e, m, sizeof(int) * 2, cmp);\n for (i = 0, j = 1 ; i < m ; ++i)\n while (e[i][0] > j)v[j++] = i;\n while (j <= n)v[j++] = m;\n \n for (i = 1 ; i <= n ; ++i){\n if (f[i] != 1)continue;\n int l, r, q[100000];\n char c[100001] = {};\n memset(pre, 0, sizeof(pre));\n q[0] = i, c[i] = 1;\n prep[i] = &pre[0];\n for (l = 0, r = 1 ; l < r ; ++l){\n for (j = v[q[l] - 1] ; j < v[q[l]] ; ++j){\n if (f[e[j][1]] == 1)continue;\n if (c[e[j][1]]){\n NODE *tmp = prep[e[j][1]];\n do {\n if (tmp->v == q[l])break;\n }while (tmp->pre && (tmp = tmp->pre));\n if (tmp->v == q[l])continue;\n prep[e[j][1]]->next = calloc(1, sizeof(NODE));\n prep[e[j][1]]->next->pre = prep[e[j][1]];\n prep[e[j][1]] = prep[e[j][1]]->next;\n prep[e[j][1]]->v = q[l];\n }\n else {\n c[e[j][1]] = 1;\n pre[r].v = q[l];\n prep[e[j][1]] = &pre[r];\n q[r++] = e[j][1];\n }\n if (s[e[j][1]] || f[e[j][1]] == 2){\n s[e[j][1]] = 1;\n fill(e[j][1], prep);\n }\n }\n }\n }\n for (i = 1 ; i <= n ; ++i)\n printf(\"%d\\n\", s[i]);\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "de56576052b4bdf2ae0c55babde828c3", "src_uid": "87d869a0fd4a510c5e7e310886b86a57", "apr_id": "297d90bcbf4682518725c839d3c32201", "difficulty": 1700, "tags": ["graphs"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.9955056179775281, "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(void)\n{\n int n;\n scanf(\"%d\", &n);\n char str[n];\n scanf(\"%s\", str);\n int count = 0;\n for (int i = 0; i < n; i++)\n {\n if (i+2 <= n - 1)\n {\n if (str[i] == 'x' && str[i+1] == 'x' && str[i+1] == 'x')\n {\n count++;\n \n } \n \n }\n \n }\n \n printf(\"%d\", count);\n return 1;\n} ", "lang": "GNU C11", "bug_code_uid": "b4cf5525d93a7bb71e6d521379ea926f", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "6f5cccd942a2366ed1d085a08843bcd0", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7809734513274337, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "/* By the name of ALLAH */\n\n#include\n#include\n#include\n#include\n\nint main()\n{\n int t,n,k,m,j,i,l,max,sum1=0,sum2=0,cnt1=0,cnt2=0;\n scanf(\"%d\",&n);\n char s1[105];\n scanf(\"%s\",s1);\n i=0;\n while(s1[i] != '\\0')\n {\n j=i;\n while(s1[j] == 'x')\n {\n cnt1++;\n k = j;\n j++;\n }\n\n if(cnt1 > 2)\n {\n sum1 += (cnt1 - 2);\n }\n cnt1 = 0;\n i += k;\n }\n\n printf(\"%d\\n\",sum1);\n return 0;\n}\n", "lang": "GNU C11", "bug_code_uid": "14cc75a17a44fc13351294ab8f1df053", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "878ad0426fdb6b373d6a3002b2262e5a", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.984984984984985, "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 i,n,cont,error,POS;\n\tn=cont=error=0;\n\tscanf(\"%d\",&n);\n\tchar letras[n];\n\tscanf(\"%s\",letras);\n\tfor(POS=0;POS=2){\n\t\t\terror++;\n\t\t}\n\t}\n\tprintf(\"%d\",error);\n\treturn 1;\n}\n", "lang": "GNU C11", "bug_code_uid": "42654fcaff682bb2f7b70d779bccd584", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "698a50e658fbfee9be8739661b91bde9", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7604617604617605, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 10, "bug_source_code": "#include\n#define u_int unsigned int\n\nu_int uintpow(u_int a,u_int b);\nu_int wint(u_int a,u_int b);\n\nint main(void){\n u_int n;\n scanf(\"%u\",&n);\n printf(\"%u\\n\",uintpow(3,n-1));\n return 0;\n}\n\nu_int uintpow(u_int a,u_int b){\n const u_int mod=1000003;\n u_int i;\n u_int prod=1;\n for(i=0;(b>>i)!=0;i++){\n if((b>>i)&1==1){\n\tprod*=wint(a,i);\n\tprod%=mod;\n }\n }\n prod%=mod;\n return prod;\n}\n\nu_int wint(u_int a,u_int b){\n const u_int mod=1000003;\n for(;b>0;b--){\n a*=a;\n a%=mod;\n }\n return a;\n}\n", "lang": "GNU C", "bug_code_uid": "3fd724afe7ceefc50c043a0ac7ea31d0", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "9a093d44b2650f6ef8663daa36720ec4", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9128919860627178, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#include \n\nint n , i , j , k ;\nint main()\n{\n\n scanf(\"%d\", &n) ;\n\n if ( n == 0 ) printf(\"1\" ) ;\n else\n {\n k = 1 ;\n while( n > 1 )\n {\n k =( k * 3 ) % 1000003 ;\n n-- ;\n }\n }\n printf(\"%d\", k ) ;\n return 0 ;\n }\n\n", "lang": "GNU C", "bug_code_uid": "413d203a72be63b1890d4a76bb128c8d", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "34fbcb09158cc9b97c2ba785253c1d70", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.8413793103448276, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\nint main(int argc, char *argv[])\n{\n int n, p = 1;\n\n scanf(\"%d\", &n);\n while(-- n)\n p = (p * 3) % 1000003;\n\n printf(\"%d\\n\", p);\n\n return 0;\n}\n", "lang": "GNU C", "bug_code_uid": "c614c515e04372a75562e7ea938d1dda", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "0e4f3a47d6ff7a7e70d3f5ac1eefd18b", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9959514170040485, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#include \n\n#define MOD 1000003\n\nint main()\n{\n int N,Sum=1;\n scanf(\"%d\",&N);\n for(i=1;i\r\n#include \r\n#include \r\n#include \r\nint main()\r\n{\r\n long int n;\r\n scanf(\"%ld\",&n);\r\n if (n==1)\r\n {\r\n printf(\"4\\n\");\r\n return 0;\r\n }\r\n n= (4*n) -3;\r\n n=n/3;\r\n n=n+3;\r\n printf(\"%ld\\n\",n);\r\n \r\n \r\n \r\n return 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "c0b2f84588776b7188565744787dc20f", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "477a4897b803666fc4ceccff3b004ae7", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C"} {"similarity_score": 0.3354632587859425, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include\r\nlong long int n;\r\nint good(long long int m){\r\n\tlong long int sum=0;\r\n\tfor(int i=1;i*(i+2)<=m;i++){\r\n\t\tsum+=1+(m-(i+2)*i)/(i*2);\r\n\t}\r\n\tif(sum>=n){\r\n\t\treturn 1;\r\n\t}\r\n\telse{\r\n\t\treturn 0;\r\n\t}\r\n}\r\nint main(){\r\n\tlong long int low, high, mid;\r\n\tscanf(\"%lld\",&n);\r\n\tlow=2; \t\t\t\t\t\t//good(low)=0\r\n\thigh=100000000;\t\t\t\t//good(high)=1\r\n\twhile(high>low+1){\r\n\t\tmid=(high+low)/2;\r\n\t\tif(good(mid)){\r\n\t\t\thigh=mid;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tlow=mid;\r\n\t\t}\r\n\t}\r\n\tprintf(\"%lld\\n\",high);\r\n\treturn 0;\r\n}", "lang": "GNU C11", "bug_code_uid": "3511defefd68a9904780d1b04abca445", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "94d669661707c6035db593c45a54af75", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.36496350364963503, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#include \r\n\r\nint main() {\r\n long long int n;\r\n scanf(\"%lld\", &n);\r\n printf(\"%lld\", n + n + 1);\r\n return 0;\r\n}\r\n", "lang": "GNU C11", "bug_code_uid": "4de7b8f65a0e22510df278af55673772", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "75c2d4078b3fa237b37bbda2f88da158", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C"} {"similarity_score": 0.7606382978723404, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "#include \nint main()\n{\n\tlong long int n, ans;\n\tscanf(\"%lld\",&n);\n\tans = n - 1;\n\tans = 4 + 4 * ans / 3 + (ans % 3 == 2);\n\tprintf(\"%lld\\n\",ans);\n}\n\n", "lang": "GNU C11", "bug_code_uid": "6cbe4eda899ee3df3d424e1ebc9a08bc", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "f3eac030a031aa0d6fb1bf63294e942b", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.9955990220048899, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#include \n#include \n\nint n;\n\ndouble p(double a, double e) {\n return a / e;\n}\ndouble q(double a, double b, double c, double d, double e, double f) {\n return (a / d) * (b / e) * (c / f);\n}\n\ndouble solve(int k) {\n const double q3 = q(k, k-1, k-2, n, n-1, n-2);\n const double q0 = q(n-k, n-k-1, n-k-2, n, n-1, n-2);\n const double q1 = 2 * q(k, n-k, n-k-1, n, n-1, n-2);\n const double q2 = q(k, k-1, n-k, n, n-1, n-2);\n const double res = q3 + q1 + q2;\n //printf(\"solve(%d) = %lf\\n\", k, res);\n //assert(q3 + q0 + 3 / 2. * q1 + 3 * q2 == 1.);\n assert(res >= 0.);\n assert(res <= 1.);\n return res;\n}\n\nint main(void) {\n double p;\n scanf(\"%d%lf\", &n, &p);\n int l = 0, r = n - 1;\n if (p == 0) {\n puts(\"0\");\n return 0;\n }\n while (l + 1 < r) {\n const int m = (l + r) >> 1;\n if (solve(m) >= p) {\n r = m;\n } else {\n l = m;\n }\n }\n assert(r > 0);\n assert(r < n);\n printf(\"%d\\n\", r);\n}\n\n", "lang": "GNU C11", "bug_code_uid": "361df9ad428aa63c9e87269f5a944538", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "b4478e08d76675953a044d7151eeb9d1", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C"} {"similarity_score": 0.8810572687224669, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#include \n#include \n\nint n;\n\ndouble p(double a, double e) {\n return a / e;\n}\ndouble q(double a, double b, double c, double d, double e, double f) {\n return (a / d) * (b / e) * (c / f);\n}\n\ndouble solve(int k) {\n const double q3 = q(k, k-1, k-2, n, n-1, n-2);\n const double q0 = q(n-k, n-k-1, n-k-2, n, n-1, n-2);\n const double q1 = 2 * q(k, n-k, n-k-1, n, n-1, n-2);\n const double q2 = q(k, k-1, n-k, n, n-1, n-2);\n assert(q3 + q0 + 3 / 2. * q1 + 3 * q2 == 1.);\n const double res = q3 + q1 + q2;\n //printf(\"solve(%d) = %lf\\n\", k, res);\n assert(res >= 0.);\n assert(res <= 1.);\n return res;\n}\n\nint main(void) {\n double p;\n scanf(\"%d%lf\", &n, &p);\n int l = 0, r = n - 1;\n if (p == 0) {\n puts(\"0\");\n return 0;\n }\n while (l + 1 < r) {\n const int m = (l + r) >> 1;\n if (solve(m) >= p) {\n r = m;\n } else {\n l = m;\n }\n }\n assert(r > 0);\n assert(r < n);\n printf(\"%d\\n\", r);\n}\n\n", "lang": "GNU C11", "bug_code_uid": "337a5537bfb2e15ccae54af6ba4ee162", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "b4478e08d76675953a044d7151eeb9d1", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C"}