{"similarity_score": 0.905952380952381, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " class Program\n {\n static void Main(string[] args)\n {\n string input;\n input = Console.ReadLine();\n String[] s = input.Split(':');\n int year = int.Parse(s[0]);\n int month = int.Parse(s[1]);\n int day = int.Parse(s[2]);\n DateTime start = new DateTime(year, month, day);\n input = Console.ReadLine();\n s = new String[3];\n s = input.Split(':');\n year = int.Parse(s[0]);\n month = int.Parse(s[1]);\n day = int.Parse(s[2]);\n DateTime enddate = new DateTime(year, month, day);\n TimeSpan result = enddate.Subtract(start);\n Console.WriteLine(Math.Abs(result.Days));\n }\n }", "lang": "MS C#", "bug_code_uid": "d724ee71b7993585eb463e0b4d7f26d4", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "9ee36a5ecfca8afe5a66ecafcba47470", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9499615088529638, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\n class Program\n {\n static void Main(string[] args)\n {\n var line = Console.ReadLine().Split(':');\n int x1 = Convert.ToInt32(tok1[0])\n int y1 = Convert.ToInt32(tok1[1])\n int z1 = Convert.ToInt32(tok1[2]);\n line = Console.ReadLine().Split(':');\n int x2 = Convert.ToInt32(tok1[0])\n int y2 = Convert.ToInt32(tok1[1])\n int z2 = Convert.ToInt32(tok1[2]);\n DateTime first = new DateTime(x1,y1,z1);\n DateTime second = new DateTime(x2,y2,z2);\n Console.WriteLine(Math.Abs((first-second).Days));\n }\n }", "lang": "MS C#", "bug_code_uid": "dcc21ac2805642c77ca2cfd0430f0821", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "apr_id": "eac5a820ae66f3e8334c1bf8213091cc", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9862385321100917, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Collections;\nusing CompLib.Util;\n\npublic class Program\n{\n\n public void Solve()\n {\n var sc = new Scanner();\n var n = sc.Next().Reverse().ToArray();\n\n // \u5148\u982d0\u4ee5\u5916\n // \u4e0b2\u6841 00 25 50 75\n\n int ans = int.MaxValue;\n\n // \u5148\u982d\n for (int i = 0; i < n.Length; i++)\n {\n if (n[i] == '0') continue;\n // 2\u6841\u76ee\n for (int j = 0; j < n.Length; j++)\n {\n if (i == j) continue;\n for (int k = 0; k < n.Length; k++)\n {\n if (i == k || j == k) continue;\n\n bool zero = n[j] == '0' && n[k] == '0';\n bool twentyfive = n[j] == '2' && n[k] == '5';\n bool fifty = n[j] == '5' && n[k] == '0';\n bool seventyfive = n[j] == '7' && n[k] == '5';\n if (!zero && !twentyfive && !fifty && !seventyfive) continue;\n var array = new int[n.Length];\n for (int l = 0; l < n.Length; l++)\n {\n if (l == i) array[l] = 0;\n else if (l == j) array[l] = 2;\n else if (l == k) array[l] = 3;\n else array[l] = 1;\n }\n int tmp = 0;\n var bit = new FenwickTree(4);\n for (int l = 0; l < n.Length; l++)\n {\n tmp += bit.Sum(array[l]);\n bit.Add(array[l], 1);\n }\n ans = Math.Min(ans, tmp);\n }\n }\n }\n if (ans == int.MaxValue) Console.WriteLine(\"-1\");\n else Console.WriteLine(ans);\n }\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\nnamespace CompLib.Collections\n{\n using Num = System.Int32;\n\n public class FenwickTree\n {\n private readonly Num[] _array;\n public readonly int Count;\n\n public FenwickTree(int size)\n {\n _array = new Num[size + 1];\n Count = size;\n }\n\n /// \n /// A[i]\u306bn\u3092\u52a0\u7b97\n /// \n /// \n /// \n public void Add(int i, Num n)\n {\n i++;\n for (; i <= Count; i += i & -i)\n {\n _array[i] += n;\n }\n }\n\n /// \n /// [0,r)\u306e\u548c\u3092\u6c42\u3081\u308b\n /// \n /// \n /// \n public Num Sum(int r)\n {\n Num result = 0;\n for (; r > 0; r -= r & -r)\n {\n result += _array[r];\n }\n\n return result;\n }\n\n // [l,r)\u306e\u548c\u3092\u6c42\u3081\u308b\n public Num Sum(int l, int r) => Sum(r) - Sum(l);\n }\n}\n\nnamespace CompLib.Util\n{\n using System;\n using System.Linq;\n\n class Scanner\n {\n private string[] _line;\n private int _index;\n private const char Separator = ' ';\n\n public Scanner()\n {\n _line = new string[0];\n _index = 0;\n }\n\n public string Next()\n {\n while (_index >= _line.Length)\n {\n _line = Console.ReadLine().Split(Separator);\n _index = 0;\n }\n\n return _line[_index++];\n }\n\n public int NextInt() => int.Parse(Next());\n public long NextLong() => long.Parse(Next());\n public double NextDouble() => double.Parse(Next());\n public decimal NextDecimal() => decimal.Parse(Next());\n public char NextChar() => Next()[0];\n public char[] NextCharArray() => Next().ToCharArray();\n\n public string[] Array()\n {\n _line = Console.ReadLine().Split(Separator);\n _index = _line.Length;\n return _line;\n }\n\n public int[] IntArray() => Array().Select(int.Parse).ToArray();\n public long[] LongArray() => Array().Select(long.Parse).ToArray();\n public double[] DoubleArray() => Array().Select(double.Parse).ToArray();\n public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "568733bac21003c888d78b2d305b7681", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "a30fe4bb75d177950ac1e5a5b4b3debc", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9854500616522811, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\ufeffusing System;\nusing System.IO;\nusing System.Text;\n\nnamespace Divisibility_by_25\n{\n internal class Program\n {\n private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);\n private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);\n\n private static void Main(string[] args)\n {\n writer.WriteLine(Solve(args));\n writer.Flush();\n }\n\n private static int Solve(string[] args)\n {\n string s = reader.ReadLine();\n\n int min = Math.Min(Math.Min(Check(s, '0', '0'), Check(s, '2', '5')), Math.Min(Check(s, '5', '0'), Check(s, '7', '5')));\n if (min == int.MaxValue)\n return -1;\n\n return min;\n }\n\n private static int Check(string s, char c1, char c2)\n {\n int index = s.LastIndexOf(c2);\n if (index < 0)\n return int.MaxValue;\n int ans = s.Length - index - 1;\n int index2;\n if (c1 == c2)\n index2 = s.Substring(0, index).LastIndexOf(c1);\n else\n index2 = s.LastIndexOf(c1);\n\n if (index2 < 0)\n return int.MaxValue;\n\n if (index2 != s.Length - 1)\n ans += s.Length - index2 - 2;\n\n var b = new StringBuilder();\n for (int i = 0; i < s.Length; i++)\n {\n if (i == index || i == index2)\n continue;\n b.Append(s[i]);\n }\n\n bool f = b.Length == 0;\n for (int i = 0; i < b.Length; i++)\n {\n if (b[i] != '0')\n {\n f = true;\n break;\n }\n ans++;\n }\n\n if (f)\n return ans;\n\n return int.MaxValue;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a3b14c38a221d31ddf765d5c66961eab", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "23503ddc96d966312514ba0c4f2c4221", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.024633123689727462, "equal_cnt": 21, "replace_cnt": 18, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 22, "bug_source_code": "\ufeff\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.29209.62\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp1\", \"ConsoleApp1\\ConsoleApp1.csproj\", \"{222A4524-A140-4F58-867E-F6E861CD2F2C}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{222A4524-A140-4F58-867E-F6E861CD2F2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{222A4524-A140-4F58-867E-F6E861CD2F2C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{222A4524-A140-4F58-867E-F6E861CD2F2C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{222A4524-A140-4F58-867E-F6E861CD2F2C}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {B7094F77-3830-474D-BFB8-5DE1C52FC44D}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "c915aea172ebb9f6beeafac849615c75", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "a4e9476684413cb15ed5e8b9bb7540b7", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9756276709401709, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CodeForcesApp\n{\n class E\n {\n #region Shortcuts\n static string RL() { return Console.ReadLine(); }\n static string[] RSA() { return RL().Split(' '); }\n static int[] RIA() { return Array.ConvertAll(RSA(), int.Parse); }\n static int RInt() { return int.Parse(RL()); }\n static long RLong() { return long.Parse(RL()); }\n static double RDouble() { return double.Parse(RL()); }\n static void RInts2(out int p1, out int p2) { int[] a = RIA(); p1 = a[0]; p2 = a[1]; }\n static void RInts3(out int p1, out int p2, out int p3) { int[] a = RIA(); p1 = a[0]; p2 = a[1]; p3 = a[2]; }\n static void RInts4(out int p1, out int p2, out int p3, out int p4) { int[] a = RIA(); p1 = a[0]; p2 = a[1]; p3 = a[2]; p4 = a[3]; }\n\n static void Swap(ref T a, ref T b) { T tmp = a; a = b; b = tmp; }\n static void Fill(T[] d, T v) { for (int i = 0; i < d.Length; i++) d[i] = v; }\n static void Fill(T[,] d, T v) { for (int i = 0; i < d.GetLength(0); i++) { for (int j = 0; j < d.GetLength(1); j++) { d[i, j] = v; } } }\n #endregion\n\n static void Main(string[] args)\n {\n System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;\n\n //SolutionTester tester = new SolutionTester(CodeForcesTask.E);\n //tester.Test();\n\n Task task = new Task();\n task.Solve();\n }\n\n public class Task\n {\n public void Solve()\n {\n int xv, yv, xp, yp, xw1, yw1, xw2, yw2, xm1, ym1, xm2, ym2;\n RInts2(out xv, out yv);\n RInts2(out xp, out yp);\n RInts4(out xw1, out yw1, out xw2, out yw2);\n RInts4(out xm1, out ym1, out xm2, out ym2);\n\n Point p = new Point(xp, yp);\n \n Segment view = new Segment(xv, yv, xp, yp);\n Segment wall = new Segment(xw1, yw1, xw2, yw2);\n Segment mirror = new Segment(xm1, ym1, xm2, ym2);\n\n Point rp = p.Reflect(mirror.ToLine());\n\n Segment rview = new Segment(xv, yv, rp.x, rp.y);\n\n Point pt1, pt2;\n\n if (!view.Intersects(wall, out pt1, out pt2) ||\n (rview.Intersects(mirror, out pt1, out pt2) && !rview.Intersects(wall, out pt1, out pt2)))\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n\n\n public class GeometryUtils\n {\n public const double EPS = 10e-8;\n\n public static double SqrDist(double x1, double y1, double x2, double y2)\n {\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n }\n\n public static double Dist(double x1, double x2)\n {\n return Math.Abs(x1 - x2);\n }\n\n public static double Dist(double x1, double y1, double x2, double y2)\n {\n return Math.Sqrt(SqrDist(x1, y1, x2, y2));\n }\n\n public static double Determinant(\n double a11, double a12,\n double a21, double a22)\n {\n return a11 * a22 - a21 * a12;\n }\n\n\n public static double Determinant(\n double a11, double a12, double a13,\n double a21, double a22, double a23,\n double a31, double a32, double a33\n )\n {\n return a11 * Determinant(a22, a23, a32, a33) - a21 * Determinant(a12, a13, a32, a33) + a31 * Determinant(a12, a13, a22, a23);\n }\n\n public static int Sign(double val)\n {\n if (Math.Abs(val) <= EPS)\n return 0;\n\n if (val > EPS)\n return 1;\n\n return -1;\n }\n\n }\n\n public class Point\n {\n public double x;\n public double y;\n\n #region Constructors\n\n public Point()\n {\n }\n\n public Point(double _x, double _y)\n {\n x = _x;\n y = _y;\n }\n\n #endregion\n\n #region Public Methods\n\n public Vector ToVector()\n {\n return new Vector(x, y);\n }\n\n public int Orientation(Point q, Point r)\n {\n return Orientation(this, q, r);\n }\n\n public double Area(Point q, Point r)\n {\n return Area(this, q, r);\n }\n\n public double SqrDist(Point q)\n {\n return GeometryUtils.SqrDist(x, y, q.x, q.y);\n }\n\n public double Distance()\n {\n return GeometryUtils.Dist(x, y, 0, 0);\n }\n\n public double Distance(Point q)\n {\n return GeometryUtils.Dist(x, y, q.x, q.y);\n }\n\n public double XDist(Point q)\n {\n return GeometryUtils.Dist(x, q.x);\n }\n\n public double YDist(Point q)\n {\n return GeometryUtils.Dist(y, q.y);\n }\n\n public Point Translate(double _x, double _y)\n {\n return new Point(x + _x, y + _y);\n }\n\n public Point Translate(Vector v)\n {\n return new Point(x + v.x, y + v.y);\n }\n\n // \u041d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u043f\u0440\u044f\u043c\u0443\u044e\n public Point Project(Line line)\n {\n Line ort = new Line(this, line.NormalVector);\n Point pt;\n line.Intersects(ort, out pt);\n return pt;\n }\n\n public Point Reflect(Line line)\n {\n Point pr = Project(line);\n Vector v = (pr - this).Scale(2);\n return this.Translate(v);\n }\n\n #endregion\n\n #region Static Members\n\n public static Vector operator -(Point p1, Point p2)\n {\n return new Vector(p1.x - p2.x, p1.y - p2.y);\n }\n\n public static int Orientation(Point p, Point q, Point r)\n {\n double det = GeometryUtils.Determinant(p.x, p.y, 1, q.x, q.y, 1, r.x, r.y, 1);\n if (det > 0) return 1;\n if (det < 0) return -1;\n return 0;\n }\n\n public static double Area(Point p, Point q, Point r)\n {\n return GeometryUtils.Determinant(q.x - p.x, q.y - p.y, r.x - p.x, r.y - p.y);\n }\n\n #endregion\n }\n\n public class Vector\n {\n public double x;\n public double y;\n\n public Vector()\n {\n }\n\n public Vector(double _x, double _y)\n {\n x = _x;\n y = _y;\n }\n\n public Vector Translate(double a, double b)\n {\n return new Vector(x + a, y + b);\n }\n\n public Vector Translate(Vector v)\n {\n return new Vector(x + v.x, y + v.y);\n }\n\n public Vector Scale(double d)\n {\n return new Vector(x * d, y * d);\n }\n }\n\n public class Segment\n {\n private Point start;\n private Point end;\n\n #region Constructors\n\n public Segment()\n : this(new Point(), new Point())\n {\n }\n\n public Segment(Point s, Point e)\n {\n start = s;\n end = e;\n }\n\n public Segment(double x1, double y1, double x2, double y2)\n : this(new Point(x1, y1), new Point(x2, y2))\n {\n }\n\n #endregion\n\n #region Public Properties\n\n public Point Start\n {\n get { return start; }\n set { start = value; }\n }\n\n public Point End\n {\n get { return end; }\n set { end = value; }\n }\n\n public double x1\n {\n get { return start.x; }\n set { start.x = value; }\n }\n\n public double y1\n {\n get { return start.y; }\n set { start.y = value; }\n }\n\n public double x2\n {\n get { return end.x; }\n set { end.x = value; }\n }\n\n public double y2\n {\n get { return end.y; }\n set { end.y = value; }\n }\n\n public Vector Direction\n {\n get { return End - Start; }\n }\n\n #endregion\n\n #region Public Methods\n\n public Line ToLine()\n {\n return new Line(this);\n }\n\n public bool Intersects(Segment seg, out Point p1, out Point p2)\n {\n p1 = new Point();\n p2 = new Point();\n\n double minx1 = Math.Min(Start.x, End.x);\n double maxx1 = Math.Max(Start.x, End.x);\n double miny1 = Math.Min(Start.y, End.y);\n double maxy1 = Math.Max(Start.y, End.y);\n\n double minx2 = Math.Min(seg.Start.x, seg.End.x);\n double maxx2 = Math.Max(seg.Start.x, seg.End.x);\n double miny2 = Math.Min(seg.Start.y, seg.End.y);\n double maxy2 = Math.Max(seg.Start.y, seg.End.y);\n\n if (minx1 > maxx2 || maxx1 < minx2 || miny1 > maxy2 || maxy1 < miny2)\n return false; // boundary rectangles not intersected\n\n Line this_line = this.ToLine();\n Line seg_line = seg.ToLine();\n\n if (this_line.Parallel(seg_line))\n {\n if (this_line.Equivalent(seg_line))\n {\n p1.x = Math.Max(minx1, minx2);\n p1.y = Math.Max(miny1, miny2);\n p2.x = Math.Min(maxx1, maxx2);\n p2.y = Math.Min(miny1, miny2);\n return true; // intersection by segment\n }\n else\n return false; // parallel\n }\n\n Point pt;\n if (!this_line.Intersects(seg_line, out pt))\n return false;\n\n if (pt.x >= minx1 && pt.x <= maxx1 &&\n pt.y >= miny1 && pt.y <= maxy1 &&\n pt.x >= minx2 && pt.x <= maxx2 &&\n pt.y >= miny2 && pt.y <= maxy2)\n {\n p1.x = pt.x;\n p1.y = pt.y;\n p2.x = pt.x;\n p2.y = pt.y;\n return true; // in one point\n }\n\n return false;\n }\n\n public double Distance(Point p)\n {\n Line line = this.ToLine();\n double[] cc = line.Coeffs;\n double A = cc[0];\n double B = cc[1];\n double C = cc[2];\n\n double d = (A * p.x + B * p.y + C) / Math.Sqrt(A * A + B * B);\n d = Math.Min(d, p.Distance(Start));\n d = Math.Min(d, p.Distance(End));\n return d;\n }\n\n #endregion\n\n }\n\n public class Line\n {\n #region Private Members\n\n private Point bp;\n private Vector dir;\n\n #endregion\n\n #region Constructors\n\n public Line()\n : this(new Point(), new Vector(1, 0))\n {\n }\n\n public Line(Point p, Vector v)\n {\n bp = p;\n dir = v;\n }\n\n public Line(Point p1, Point p2)\n : this(p1, p2 - p1)\n {\n\n }\n\n public Line(double x1, double y1, double x2, double y2) :\n this(new Point(x1, y1), new Point(x2, y2))\n {\n }\n\n public Line(Segment s) :\n this(s.Start, s.Direction)\n {\n\n }\n\n #endregion\n\n #region Public Properties\n\n public Point BasePoint { get { return bp; } }\n public Vector Direction { get { return dir; } }\n public Vector NormalVector { get { return new Vector(-dir.y, dir.x); } }\n public double[] Coeffs\n {\n get\n {\n return new double[3] \n {\n dir.y,\n -dir.x, \n dir.x * bp.y - dir.y * bp.x\n };\n }\n }\n\n public double A { get { return dir.y; } }\n public double B { get { return -dir.x; } }\n public double C { get { return dir.x * bp.y - dir.y * bp.x; } }\n\n #endregion\n\n #region Public Methods\n\n public bool Intersects(Line line, out Point pt)\n {\n pt = new Point();\n\n double d = GeometryUtils.Determinant(A, B, line.A, line.B);\n if (GeometryUtils.Sign(d) == 0)\n return false;\n\n pt.x = -GeometryUtils.Determinant(C, B, line.C, line.B) / d;\n pt.y = -GeometryUtils.Determinant(A, C, line.A, line.C) / d;\n\n return true;\n }\n\n public bool Parallel(Line line)\n {\n double d = GeometryUtils.Determinant(A, B, line.A, line.B);\n return GeometryUtils.Sign(d) == 0;\n }\n\n public bool Equivalent(Line line)\n {\n double d1 = GeometryUtils.Determinant(A, B, line.A, line.B);\n double d2 = GeometryUtils.Determinant(A, C, line.A, line.C);\n double d3 = GeometryUtils.Determinant(B, C, line.B, line.C);\n\n return GeometryUtils.Sign(d1) == 0 && GeometryUtils.Sign(d2) == 0 && GeometryUtils.Sign(d2) == 0;\n }\n\n public double Distance(Point p)\n {\n return (A * p.x + B * p.y + C) / Math.Sqrt(A * A + B * B);\n }\n\n #endregion\n }\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "246e4a1e196fbaccf16d8f5e07150e1b", "src_uid": "7539a41268b68238d644795bccaa0c0f", "apr_id": "dae02c6b57aaef8b3024f2d45be38c5a", "difficulty": 2400, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9821442999111255, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing System.IO;\nusing System.Linq;\nclass Program\n{\n class Point\n {\n public double x, y;\n public Point(double x, double y)\n {\n this.x = x;\n this.y = y;\n }\n }\n class Line\n {\n public double a, b, c;\n public Line(Point p1, Point p2)\n {\n a = p2.y - p1.y;\n b = p1.x - p2.x;\n c = a * p1.x + b * p1.y;\n }\n public Line()\n {\n\n }\n \n public Line prep( Point p)\n {\n Line res=new Line();\n res.a = -b;\n res.b = a;\n res.c = res.a * p.x + res.b * p.y;\n return res;\n \n }\n public Point Intersect(Line l)\n {\n Point res = new Point(0,0);\n double d = a * l.b - b * l.a;\n res.x = (l.b * c - b * l.c) / d;\n res.y = (a * l.c - l.a * c) / d;\n return res;\n }\n\n }\n double eps = 1e-9;\n void solve()\n {\n Point p = new Point(nextInt(), nextInt());\n Point v=new Point(nextInt(),nextInt());\n Point[]w=new Point[2];\n \n for (int i = 0; i < 2; i++)\n w[i] = new Point(nextInt(), nextInt());\n Point[] mir = new Point[2];\n for (int i = 0; i < 2; i++)\n mir[i] = new Point(nextInt(), nextInt());\n \n bool ok = false;\n if (good(p, v, w[0], w[1]))\n ok = true;\n else if (sign(cross(mir[0], mir[1],p)) * sign(cross(mir[0], mir[1],v)) ==1)\n {\n Line lm = new Line(mir[0], mir[1]);\n Line pr = lm.prep(p);\n Point inter = lm.Intersect(pr);\n Point other = new Point(inter.x + (inter.x - p.x), inter.y + (inter.y - p.y));\n {\n Line l = new Line(other, v);\n Point x = l.Intersect(lm);\n if (good(x, p, w[0], w[1]) && good(x, v, w[0], w[1]) && on(mir[0],mir[1],x))\n ok = true;\n }\n \n }\n if (ok)\n println(\"YES\");\n else\n println(\"NO\");\n\n }\n\n private bool good(Point p1, Point p2, Point p3, Point p4)\n {\n double d1 = cross(p1, p2, p3);\n double d2 = cross(p1, p2, p4);\n double d3 = cross(p3, p4,p1);\n double d4 = cross(p3, p4, p2);\n int x1 = sign(d1);\n int x2 = sign(d2);\n int x3 = sign(d3);\n int x4 = sign(d4);\n if (x1 * x2 < 0 && x3 * x4 < 0)\n return false;\n if (x1 == 0)\n {\n if (on(p1, p2, p3))\n return false;\n }\n if (x2 == 0)\n {\n if (on(p1, p2, p4))\n return false;\n }\n if (x3 == 0)\n {\n if (on(p3, p4, p1))\n return false;\n }\n if (x4 == 0)\n {\n if (on(p3, p4, p2))\n return false;\n }\n \n return true;\n\n }\n\n private bool on(Point p1, Point p2, Point p3)\n {\n return on(p1.x, p2.x, p3.x) && on(p1.y, p2.y, p3.y);\n }\n\n private bool on(double x, double y, double z)\n {\n return z >= Math.Min(x, y) - eps && z <= Math.Max(x, y) + eps;\n }\n\n private int sign(double d1)\n {\n return Math.Abs(d1) < eps ? 0 : Math.Sign(d1);\n }\n\n private double cross(Point p1, Point p2, Point p3)\n {\n return (p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y);\n }\n\n ////////////\n private void println(int[] ar)\n {\n for (int i = 0; i < ar.Length; i++)\n {\n if (i == ar.Length - 1)\n println(ar[i]);\n else\n print(ar[i] + \" \");\n }\n }\n private void println(int[] ar, bool add)\n {\n int A = 0;\n if (add)\n A++;\n for (int i = 0; i < ar.Length; i++)\n {\n if (i == ar.Length - 1)\n println(ar[i] + A);\n else\n print((ar[i] + A) + \" \");\n }\n }\n\n private void println(string Stringst)\n {\n Console.WriteLine(Stringst);\n }\n private void println(char charnum)\n {\n Console.WriteLine(charnum);\n }\n private void println(int Intnum)\n {\n Console.WriteLine(Intnum);\n }\n private void println(long Longnum)\n {\n Console.WriteLine(Longnum);\n }\n private void println(double Doublenum)\n {\n string s = Doublenum.ToString(CultureInfo.InvariantCulture);\n Console.WriteLine(s);\n }\n\n private void print(string Stringst)\n {\n Console.Write(Stringst);\n }\n private void print(int Intnum)\n {\n Console.Write(Intnum);\n }\n private void print(char charnum)\n {\n Console.Write(charnum);\n }\n private void print(long Longnum)\n {\n Console.Write(Longnum);\n }\n private void print(double Doublenum)\n {\n Console.Write(Doublenum);\n }\n\n\n string[] inputLine = new string[0];\n int inputInd = 0;\n string nextLine()\n {\n return Console.ReadLine();\n }\n void readInput()\n {\n if (inputInd != inputLine.Length)\n throw new Exception();\n inputInd = 0;\n inputLine = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n if (inputLine.Length == 0)\n readInput();\n\n }\n int nextInt()\n {\n if (inputInd == inputLine.Length)\n readInput();\n return int.Parse(inputLine[inputInd++]);\n }\n long nextLong()\n {\n if (inputInd == inputLine.Length)\n readInput();\n return long.Parse(inputLine[inputInd++]);\n }\n double nextDouble()\n {\n if (inputInd == inputLine.Length)\n readInput();\n return double.Parse(inputLine[inputInd++]);\n }\n string nextString()\n {\n if (inputInd == inputLine.Length)\n readInput();\n return inputLine[inputInd++];\n }\n static void Main(string[] args)\n {\n new Program().solve();\n }\n}\n\n\n", "lang": "Mono C#", "bug_code_uid": "deadac3823c8eab122368e439e6b7d42", "src_uid": "7539a41268b68238d644795bccaa0c0f", "apr_id": "cf2e001b7c5724bfc2f17bf0deccd5db", "difficulty": 2400, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.7632093933463796, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "namespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int num = Convert.ToInt16(Console.ReadLine());\n if (num >= 2)\n Console.WriteLine(\"25\");\n else\n return;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "857b06ec8c27eaec24ff7e9785155077", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "69311150c08a940bcb791a9000554222", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.8768768768768769, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n long long int n;\n n = Convert.ToInt32(Console.ReadLine());\n\n Console.WriteLine(\"25\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "46290fad502e41a4c81317e46066a6a6", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "0058c140f1da1792b6937493c7112734", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9567785234899329, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\npublic class Test\n{\n public static void Main()\n {\n // your code goes here\n int n = int.Parse(Console.ReadLine());\n var arrA = Console.ReadLine().Trim().Split().Select(x => int.Parse(x)).ToList();\n var arrB = Console.ReadLine().Trim().Split().Select(x => int.Parse(x)).ToList();\n Dictionary dict = new Dictionary();\n bool ok = false;\n int currentpos = 1;\n while(true){\n if(currentpos == arrA.Count){\n Console.WriteLine((currentpos - 1) + \" \" + 2);\n //Console.WriteLine();\n ok = true;\n break;\n }\n if(currentpos == arrB.Count){\n Console.WriteLine((currentpos - 1) + \" \" + 1);\n ok = true;\n break;\n }\n var str = getKey(arrA,currentpos,arrB);\n Console.WriteLine(str);\n if(dict.ContainsKey(str)){\n //Console.WriteLine(str);\n Console.WriteLine(-1);\n ok = true;\n break;\n }\n if(arrA[currentpos] > arrB[currentpos]){\n arrA.Add(arrB[currentpos]);\n arrA.Add(arrA[currentpos]);\n }else{\n arrB.Add(arrA[currentpos]);\n arrB.Add(arrB[currentpos]);\n }\n dict.Add(str,true);\n currentpos++;\n }\n \n }\n \n static string getKey(List arrA , int startPos , List arrB){\n string key = string.Empty;\n for(int i = startPos ; i < arrA.Count ; i++){\n key += arrA[i];\n }\n key + \"X\";\n for(int i = startPos ; i < arrB.Count ; i++){\n key += arrB[i];\n }\n return key;\n }\n}", "lang": "MS C#", "bug_code_uid": "b4e2e9228978f10b91cf6e47237c3d69", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "9b5a763b91f7194e6c8ebdad19f2e93d", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.6489637305699482, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication4\n{\n class Program\n {\n static void Main(string[] args)\n {\n int w1, h1, w2, h2, result;\n string []s;\n do\n { \n s = Console.ReadLine().Split(' ');\n w1 = int.Parse(s[0]);\n h1 = int.Parse(s[1]);\n w2 = int.Parse(s[2]);\n h2 = int.Parse(s[3]);\n } while (w1C\nC>A\n\");\n\n class Solver\n {\n public void Solve()\n {\n int[] p = new int[3];\n for (int i = 0; i < 3; i++)\n {\n string s = CF.ReadLine();\n if (s[1] == '<')\n {\n p[s[2] - 'A']++;\n }\n else\n {\n p[s[0] - 'A']++;\n }\n }\n\n if (p[0] == 1 && p[1] == 0)\n {\n CF.WriteLine(\"Impossible\");\n return;\n }\n\n char[] cs = new char[3];\n cs[p[0]] = 'A';\n cs[p[1]] = 'B';\n cs[p[2]] = 'C';\n foreach (char c in cs)\n CF.Write(c);\n }\n }\n \n \n #region test\n\n static void Main(string[] args)\n {\n System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(\"ru-RU\");\n\n new Solver().Solve();\n CF.Close();\n }\n\n static void TLE()\n {\n for (; ; ) ;\n }\n\n class CodeforcesUtils\n {\n public string ReadLine()\n {\n#if DEBUG\n if (_lines == null)\n {\n _lines = new List();\n string[] ss = _test_input.Replace(\"\\n\", \"\").Split('\\r');\n for (int i = 0; i < ss.Length; i++)\n {\n if (\n (i == 0 || i == ss.Length - 1) &&\n ss[i].Length == 0\n )\n continue;\n\n _lines.Add(ss[i]);\n }\n }\n\n string s = null;\n if (_lines.Count > 0)\n {\n s = _lines[0];\n _lines.RemoveAt(0);\n }\n return s;\n\n#else\n //return _sr.ReadLine();\n return Console.In.ReadLine();\n#endif\n }\n\n public void WriteLine(object o)\n {\n#if DEBUG\n System.Diagnostics.Trace.WriteLine(o);\n#else\n //_sw.WriteLine(o);\n Console.WriteLine(o);\n#endif\n }\n\n public void Write(object o)\n {\n#if DEBUG\n System.Diagnostics.Trace.Write(o);\n#else\n //_sw.Write(o);\n Console.Write(o);\n#endif\n }\n\n\n string _test_input;\n\n List _lines;\n\n#if DEBUG\n public CodeforcesUtils(string test_input)\n {\n _test_input = test_input;\n }\n#else\n\n public CodeforcesUtils(string dummy)\n {\n //_sr = new System.IO.StreamReader(\"input.txt\");\n //_sw = new System.IO.StreamWriter(\"output.txt\");\n }\n#endif\n\n public void Close()\n {\n if( _sr!= null)\n _sr.Close();\n if( _sw != null)\n _sw.Close();\n }\n\n System.IO.StreamReader _sr=null;\n System.IO.StreamWriter _sw=null;\n \n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5d9c4b0ba607ebdb4224513e74188d46", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "apr_id": "8f27a47e37d9aefb5643966572b1d119", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.24539196091494558, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace VK_Cup_CSharp_Wildcard_1\n{\n public class Program\n {\n private const long MaxNumber = 2 * 1000 * 1000 * 1000;\n private static HashSet allNumbers = new HashSet();\n\n private static void GenerateAllNumbers(long nextNumber)\n {\n if (nextNumber > MaxNumber)\n {\n return;\n }\n\n allNumbers.Add(nextNumber);\n GenerateAllNumbers(2 * nextNumber);\n GenerateAllNumbers(3 * nextNumber);\n }\n\n public static void Main(string[] args)\n {\n GenerateAllNumbers(1);\n\n var line = Console.ReadLine()?.Split().ToList();\n long left = long.Parse(line[0]);\n long right = long.Parse(line[1]);\n\n int count = 0;\n\n foreach (var number23 in allNumbers)\n {\n if (number23 >= left && number23 <= right)\n {\n count++;\n }\n }\n\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "56cbacfd27d66702aa55b41c5d2575a8", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "e8bbfc1ab1b3fe2bb900ba2c35df3027", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.6582914572864321, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n int left;\n int right;\n string line = Console.ReadLine();\n string[] splitLine = line.Split(' ');\n\n Int32.TryParse(splitLine[0], out left);\n Int32.TryParse(splitLine[1], out right);\n int abc=0;\n for (int i = left; i < right; i++)\n {\n int tmp = i;\n while (tmp % 2 == 0) tmp = tmp / 2;\n while (tmp % 3 == 0) tmp = tmp / 3;\n if (tmp == 1)\n abc++;\n }\n System.Console.Write(abc);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a9d87a18bc099189c2a2d3d324e5090d", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "5e359e4539fd3a805d5757b39aefef56", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9994931576279777, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace TMP\n{\n class Program\n {\n private static int Alex = 1;\n private static int Bob = 2;\n private static int Carl = 3;\n static void Main(string[] args)\n {\n // PrimeNumber primeNumber = new PrimeNumber();\n //primeNumber.GetPrimeNumbers();\n var gameNumber = Int32.Parse(Console.ReadLine());\n\n\n int spectating = Carl;\n int winner;\n int secondPlayer = Bob;\n\n for (var game = 0; game < gameNumber; game++)\n {\n winner = Int32.Parse(Console.ReadLine());\n\n if (winner == spectating || secondPlayer == spectating)\n {\n Console.Write(\"NO\");\n return;\n }\n secondPlayer = spectating;\n\n if (winner == 1)\n {\n if (secondPlayer == 2)\n {\n spectating = 3;\n }\n if (secondPlayer == 3)\n {\n spectating = 2;\n }\n }\n if (winner == 2)\n {\n if (secondPlayer == 1)\n {\n spectating = 3;\n }\n if (secondPlayer == 3)\n {\n spectating = 2;\n }\n }\n if (winner == 3)\n {\n if (secondPlayer == 1)\n {\n spectating = 2;\n }\n if (secondPlayer == 2)\n {\n spectating = 1;\n }\n }\n\n }\n Console.Write(\"YES\");\n }\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6c0e701dea6b0b5909987145ceddd64b", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "f47c76287f135a6c60c97ee641b78a79", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.5712155108128263, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace bowling\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] tokens = Console.ReadLine().Split();\n\n int leftHand = int.Parse(tokens[0]);\n int rightHand = int.Parse(tokens[1]);\n int ambidexters = int.Parse(tokens[2]);\n\n Console.WriteLine(maxGroupCount(leftHand, rightHand, ambidexters));\n \n }\n\n\n\n\n public static int maxGroupCount(int leftHand, int rightHand,int ambidexters) {\n \n leftHand += ambidexters;\n if (rightHand < leftHand) {\n int temp = rightHand;\n rightHand = leftHand;\n leftHand = temp;\n }\n \n if (leftHand == 0) return 0;\n else {\n int difference = rightHand - leftHand;\n if (difference == 0) return rightHand + leftHand;\n else {\n rightHand -= difference;\n return rightHand + leftHand + 2 * (difference / 2);\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "659d9fc2ec37c8472dd1fbecbe2da280", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "0497eb44d1bcc26d6b6baf01f1b06f4d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9984732824427481, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.linq;\nclass Task {\n \n static void Main() {\n var n = Convert.ToInt32(Console.ReadLine());\n var original = Console.ReadLine();\n \n string[] str = new string[n - 1];\n for(int i = 0; i < n - 1; i++) {\n str[i] = Char.ToString(original[i]) + Char.ToString(original[i + 1]);\n }\n \n int[] nums = new int[n - 1];\n int count = 0;\n \n for(int i = 0; i < n - 1; i++) {\n count = str.Count(f => f == str[i]);\n nums[i] = count;\n }\n \n Console.WriteLine(str[nums.ToList().IndexOf(nums.Max())]);\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "3c69dc5243c6039a85f71c9261692fe8", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "a885169c71211e10317721819a772ffd", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.990358126721763, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Two_gram\n{\n class Program\n {\n static void Main(string[] args)\n {\n int size = int.Parse(Console.ReadLine());\n string letter = Console.ReadLine();\n Dictionary dict = new Dictionary();\n string temp;\n\n for (int i = 1; i < letter.Length; i++)\n {\n temp = letter[i - 1].ToString() + letter[i].ToString();\n if (dict.ContainsKey(temp)) dict[temp]++;\n else dict.Add(temp, 1);\n }\n Console.WriteLine(dict.FirstOrDefault(x=>x.Value==dict.Values.Max()).Key);s\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b9058b24c0729b0fdd2ab50433fc1383", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "7589c0329a738e1c4160821f4c6cfe42", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.9669544507293838, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "// A Dynamic Programming based \n// C# program to find minimum \n// number operations to \n// convert str1 to str2 \nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass GFG\n{\n\n public static void Main()\n {\n List arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();\n var op = Console.ReadLine().Split(' ').ToArray();\n Console.Write(SmallestNumber(arr, op, 0, long.MaxValue));\n }\n\n public static long SmallestNumber(List arr, string[] ope, int opeCount, long min)\n {\n\n if (arr.Count == 1)\n return arr[0];\n int min1 = int.MaxValue;\n int min2 = int.MaxValue;\n\n for (int i = 0; i < arr.Count; i++)\n {\n for (int j = i + 1; j < arr.Count; j++)\n {\n if (ope[opeCount] == \"+\")\n {\n var listNew = new List(arr);\n var tmp = listNew[i] + listNew[j];\n listNew.RemoveAt(j);\n listNew.RemoveAt(i);\n listNew.Add(tmp);\n min = Math.Min(min, SmallestNumber(listNew, ope, opeCount + 1, min));\n }\n if (ope[opeCount] == \"*\")\n {\n var listNew = new List(arr);\n var tmp = listNew[i] * listNew[j];\n listNew.RemoveAt(j);\n listNew.RemoveAt(i);\n \n listNew.Add(tmp);\n min = Math.Min(min, SmallestNumber(listNew, ope, opeCount + 1, min));\n }\n }\n }\n\n //min = Math.Min(min1, min2);\n return min;\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "59977a06593834968c00d00e42cbf81a", "src_uid": "7a66fae63d9b27e444d84447012e484c", "apr_id": "25f83d1fdf85db9b11c98b2daaa68dbf", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9316890441516898, "equal_cnt": 137, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 126, "fix_ops_cnt": 136, "bug_source_code": "//#define TEST\n#if TEST\nusing System.IO;\n#endif\n\nusing System;\n\nnamespace CF\n{\n #region Start\n#if !TEST\n using cin = Console;\n using cout = Console;\n#endif\n#endregion\n class Program\n {\n static long[,] Varinats(long[] mas, string opr)\n {\n\n long[,] ans;\n if (mas.Length == 4) ans = new long[6, mas.Length - 1];\n else if (mas.Length == 3) ans = new long[3, mas.Length - 1];\n else if (mas.Length == 2) ans = new long[1, mas.Length - 1];\n else ans = new long[1, mas.Length - 1];\n\n if (opr == \"+\")\n {\n int N = 0;\n for (int i = 0; i < mas.Length - 1; i++)\n {\n if (mas[i] >= 0)\n {\n for (int j = i + 1; j < mas.Length; j++)\n {\n if (mas[j] >= 0)\n {\n for (int k = 0; k < mas.Length; k++)\n {\n if(k j) ans[N, k-1] = mas[k];\n }\n ans[N, i] = mas[i] + mas[j]; \n N++;\n }\n }\n }\n }\n }\n else\n {\n int N = 0;\n for (int i = 0; i < mas.Length - 1; i++)\n {\n if (mas[i] >= 0)\n {\n for (int j = i + 1; j < mas.Length; j++)\n {\n if (mas[j] >= 0)\n {\n for (int k = 0; k < mas.Length; k++)\n {\n if (k < j)\n ans[N, k] = mas[k];\n else\n if (k > j) ans[N, k - 1] = mas[k];\n }\n ans[N, i] = mas[i] * mas[j];\n N++;\n }\n }\n }\n }\n }\n return ans;\n }\n static void Main(string[] args)\n {\n #region BEGIN\n #if TEST\n string filepath = @\"E:\\Projects 2010\\CF55\\B\\\";\n FileStream file = new FileStream(String.Concat(filepath, @\"input.txt\"), FileMode.Open, FileAccess.Read);\n StreamReader cin = new StreamReader(file);\n FileStream fileOut = new FileStream(String.Concat(filepath, @\"output.txt\"), FileMode.Truncate, FileAccess.Write);\n StreamWriter cout = new StreamWriter(fileOut, System.Text.Encoding.Unicode);\n #endif\n try\n {\n #endregion\n long ANS = -1;\n string[] st = cin.ReadLine().Split(' ');\n long[] mas = new long[4];\n for (int i = 0; i < mas.Length; i++) mas[i] = long.Parse(st[i]);\n\n string[] opr = cin.ReadLine().Split(' ');\n int mult=0,\n summ=0;\n for (int i = 0; i < opr.Length; i++) if (opr[i] == \"*\") mult++; else summ++;\n\n if (mult == 3)\n {\n long[,] ans1 = Varinats(mas, \"*\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"*\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];\n }\n }\n cout.WriteLine(ANS);\n return;\n }\n if (summ == 3)\n {\n long[,] ans1 = Varinats(mas, \"+\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"+\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];\n }\n }\n cout.WriteLine(ANS);\n return;\n }\n\n if (mult > summ)\n {\n //+**\n long[,] ans1 = Varinats(mas, \"+\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2=new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n \n long[,] ans3 = Varinats(ans2, \"*\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];\n }\n }\n //*+*\n ans1 = Varinats(mas, \"*\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"+\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];\n }\n }\n //**+\n ans1 = Varinats(mas, \"*\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"*\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];\n }\n }\n }\n else\n { \n //*++\n long[,] ans1 = Varinats(mas, \"*\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"+\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];\n }\n }\n //+*+\n ans1 = Varinats(mas, \"+\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"*\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];\n }\n }\n //++*\n ans1 = Varinats(mas, \"+\");\n for (int i = 0; i < ans1.GetLength(0); i++)\n {\n long[] ans2 = new long[ans1.GetLength(1)];\n for (int j = 0; j < ans1.GetLength(1); j++)\n ans2[j] = ans1[i, j];\n\n long[,] ans3 = Varinats(ans2, \"+\");\n for (int k = 0; k < ans3.GetLength(0); k++)\n {\n long[] ans4 = new long[ans3.GetLength(1)];\n for (int j = 0; j < ans3.GetLength(1); j++)\n ans4[j] = ans3[k, j];\n\n if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];\n }\n }\n }\n cout.WriteLine(ANS);\n #region END\n }\n \n catch (Exception e)\n {\n #if TEST\n cout.WriteLine(e.Message);\n cout.WriteLine(\"----------------------\");\n cout.WriteLine(e.StackTrace);\n #endif\n }\n finally\n {\n #if TEST\n cout.Close();\n cin.Close();\n fileOut.Close();\n file.Close();\n #endif\n }\n #endregion\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9df019ed142b55d341c450b5411f4718", "src_uid": "7a66fae63d9b27e444d84447012e484c", "apr_id": "db27542a7a3445bd1c0c61fe6f6d65b2", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9558221181977765, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\ufeffusing System;\nusing System.IO;\nusing System.Text;\n\nnamespace Clear_Symmetry\n{\n internal class Program\n {\n private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);\n private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);\n\n private static void Main(string[] args)\n {\n int n = Next();\n\n int n4 = n/4;\n bool f2 = n%4 > 1;\n int count;\n if (n == 1)\n {\n count = 1;\n }\n else if (n == 2)\n {\n count = 3;\n }\n else if (n%2 == 1 || f2)\n {\n for (int i = f2 ? 5 : 3;; i += 2)\n {\n var kk = new int[i,i];\n if (n%2 == 1)\n kk[(i + 1)/2 - 1, i/2 - 1] = 1;\n if (f2)\n {\n kk[i/2 - 1, 0] = 1;\n kk[(i + 1)/2 - 1, 0] = 1;\n kk[(i + 1)/2 - 1, 1] = 1;\n }\n\n int c1 = 0, c0 = 0;\n for (int j = (i + 1)/2 - 1; j >= 0; j--)\n {\n for (int k = i/2 - 1; k >= 0; k--)\n {\n if (kk[j, k] == 1)\n continue;\n if ((j + k)%2 == 1)\n c1++;\n else c0++;\n }\n }\n if (Math.Max(c1, c0) >= n4)\n {\n count = i;\n break;\n }\n }\n }\n else\n {\n for (int i = 3;; i ++)\n {\n var kk = new int[i,i];\n\n int c1 = 0, c0 = 0;\n for (int j = (i + 1)/2 - (i%2 == 1 ? 1 : 2); j >= 0; j--)\n {\n for (int k = i/2 - (i%2 == 1 ? 1 : 2); k >= 0; k--)\n {\n if (kk[j, k] == 1)\n continue;\n if ((j + k)%2 == 1)\n c1++;\n else c0++;\n }\n }\n if (Math.Max(c1, c0) >= n4)\n {\n count = i;\n break;\n }\n }\n }\n\n writer.WriteLine(count);\n writer.Flush();\n }\n\n private static int Next()\n {\n int c;\n int res = 0;\n do\n {\n c = reader.Read();\n if (c == -1)\n return res;\n } while (c < '0' || c > '9');\n res = c - '0';\n while (true)\n {\n c = reader.Read();\n if (c < '0' || c > '9')\n return res;\n res *= 10;\n res += c - '0';\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "79051605dfa106327dc60b405b9d16cc", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "efb460b83b06d171389757b8ae89fcd6", "difficulty": 1700, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.8572631578947368, "equal_cnt": 29, "replace_cnt": 11, "delete_cnt": 7, "insert_cnt": 10, "fix_ops_cnt": 28, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace SP.Solutions.CodeForces.c338_196_1\n{\n\tpublic class ProgramC\n\t{\n\t private static long bestRes = long.MaxValue;\n\n\t\tpublic static void Main()\n\t\t{\n\t\t\tchecked\n\t\t\t{\n\t\t\t bestRes = long.MaxValue;\n\t\t\t int n = int.Parse(Console.ReadLine());\n\t\t\t var arr = Console.ReadLine().Split(' ').Select(long.Parse).Distinct().ToArray();\n Array.Sort(arr);\n\n\t\t\t var primes = GetPrimes();\n\n\t\t\t var nodes = new List();\n for (int i = 0; i < arr.Length; i++)\n {\n nodes.Add(new Node(arr[i], getFactors(arr[i], primes), arr[i], false, 0));\n }\n\n\t\t\t TryBuildTrees(nodes);\n Console.WriteLine(bestRes);\n\t\t\t}\n\t\t}\n\n\t private static void TryBuildTrees(List nodes)\n\t {\n\t for (int i = 0 ; i ();\n for (int k = 0; k < nodes.Count; k++) if (k != i && k != j) newNodes.Add(nodes[k]);\n\t int add = nodes[j].Factors > 1 ? 1 : 0;\n\t newNodes.Add(new Node(nodes[i].N, nodes[i].Factors, nodes[i].Rem/nodes[j].N, false, nodes[i].addFactors + nodes[j].addFactors + add));\n newNodes.Add(new Node(nodes[j].N, nodes[j].Factors, nodes[j].Rem, true, nodes[j].addFactors));\n TryBuildTrees(newNodes);\n\t }\n\n\t CalcPrice(nodes);\n\t }\n\n\t private static void CalcPrice(List nodes)\n\t {\n\t int n = 0;\n\t long res = 0;\n foreach (var node in nodes) if (!node.HasParent)\n {\n if (node.Factors > 1) res++;\n res += node.Factors + node.addFactors;\n n++;\n }\n\t if (n > 1) res++;\n\t bestRes = Math.Min(bestRes, res);\n\t }\n\n\t static int getFactors(long n, long[] primes)\n {\n int res = 0;\n int i = 0;\n while (n > 1)\n {\n if (n%primes[i] == 0)\n {\n res++;\n n /= primes[i];\n }\n else i++;\n }\n return res;\n }\n\n class Node\n {\n public override string ToString()\n {\n return string.Format(\"HasParent: {0}, N: {1}, Factors: {2}, Rem: {3}\", HasParent, N, Factors, Rem);\n }\n\n public bool HasParent;\n public readonly long N;\n public readonly int Factors;\n public readonly long Rem;\n public readonly int addFactors;\n\n public Node(long n, int factors, long rem, bool hasParent, int addFactors)\n {\n HasParent = hasParent;\n this.addFactors = addFactors;\n N = n;\n Factors = factors;\n Rem = rem;\n }\n }\n\n\t private static long[] GetPrimes()\n\t {\n\t const int max = 1000000;\n\t var primes = new List(80000);\n\t primes.Add(2);\n\t var isNotPrime = new bool[max + 1];\n for (int i = 3 ; i<= max ; i+=2) if (!isNotPrime[i])\n {\n primes.Add(i);\n for (int j = i*i; j <= max && j > 0; j += i) isNotPrime[j] = true;\n }\n\t return primes.ToArray();\n\t }\n\t}\n}", "lang": "MS C#", "bug_code_uid": "4d2030f5c18ba40521e5f043b8be1a6b", "src_uid": "52b8b6c68518d5129272b8c56e5b7662", "apr_id": "403a8d165abeb777999dafc7c23cf323", "difficulty": 2200, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8669635402170888, "equal_cnt": 27, "replace_cnt": 11, "delete_cnt": 7, "insert_cnt": 8, "fix_ops_cnt": 26, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace SP.Solutions.CodeForces.c338_196_1\n{\n\tpublic class ProgramC\n\t{\n\t private static long bestRes = long.MaxValue;\n\n\t\tpublic static void Main()\n\t\t{\n\t\t\tchecked\n\t\t\t{\n\t\t\t bestRes = long.MaxValue;\n\t\t\t int n = int.Parse(Console.ReadLine());\n\t\t\t var arr = Console.ReadLine().Split(' ').Select(long.Parse).Distinct().ToArray();\n Array.Sort(arr);\n\n\t\t\t var primes = GetPrimes();\n\n\t\t\t var nodes = new List();\n for (int i = 0; i < arr.Length; i++)\n {\n nodes.Add(new Node(arr[i], getFactors(arr[i], primes), arr[i], false, 0));\n }\n\n\t\t\t TryBuildTrees(nodes);\n Console.WriteLine(bestRes);\n\t\t\t}\n\t\t}\n\n\t private static void TryBuildTrees(List nodes)\n\t {\n\t for (int i = 0 ; i ();\n for (int k = 0; k < nodes.Count; k++) if (k != i && k != j) newNodes.Add(nodes[k]);\n\t int add = nodes[j].Factors > 1 ? 1 : 0;\n\t newNodes.Add(new Node(nodes[i].N, nodes[i].Factors, nodes[i].Rem/nodes[j].N, false, nodes[i].addFactors + nodes[j].addFactors + add));\n newNodes.Add(new Node(nodes[j].N, nodes[j].Factors, nodes[j].Rem, true, nodes[j].addFactors));\n TryBuildTrees(newNodes);\n\t }\n\n\t CalcPrice(nodes);\n\t }\n\n\t private static void CalcPrice(List nodes)\n\t {\n\t int n = 0;\n\t long res = 0;\n foreach (var node in nodes) if (!node.HasParent)\n {\n if (node.Factors > 1) res++;\n res += node.Factors + node.addFactors;\n n++;\n }\n\t if (n > 1) res++;\n\t bestRes = Math.Min(bestRes, res);\n\t }\n\n\t static int getFactors(long n, long[] primes)\n {\n int res = 0;\n int i = 0;\n while (n > 1 && i < primes.Length)\n {\n if (n%primes[i] == 0)\n {\n res++;\n n /= primes[i];\n }\n else i++;\n }\n\t if (i == primes.Length) res++;\n return res;\n }\n\n class Node\n {\n public override string ToString()\n {\n return string.Format(\"HasParent: {0}, N: {1}, Factors: {2}, Rem: {3}\", HasParent, N, Factors, Rem);\n }\n\n public bool HasParent;\n public readonly long N;\n public readonly int Factors;\n public readonly long Rem;\n public readonly int addFactors;\n\n public Node(long n, int factors, long rem, bool hasParent, int addFactors)\n {\n HasParent = hasParent;\n this.addFactors = addFactors;\n N = n;\n Factors = factors;\n Rem = rem;\n }\n }\n\n\t private static long[] GetPrimes()\n\t {\n\t const int max = 1000000;\n\t var primes = new List(80000);\n\t primes.Add(2);\n\t var isNotPrime = new bool[max + 1];\n for (int i = 3 ; i<= max ; i+=2) if (!isNotPrime[i])\n {\n primes.Add(i);\n for (int j = i*i; j <= max && j > 0; j += i) isNotPrime[j] = true;\n }\n\t return primes.ToArray();\n\t }\n\t}\n}", "lang": "MS C#", "bug_code_uid": "f3e9e3465f0cb869e7b7a185481642e1", "src_uid": "52b8b6c68518d5129272b8c56e5b7662", "apr_id": "403a8d165abeb777999dafc7c23cf323", "difficulty": 2200, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9964028776978417, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CD2\n{\n class Program\n {\n #region Reusable\n static int[] GetIntArray()\n {\n return Array.ConvertAll(Console.ReadLine().Trim().Split(' '), int.Parse);\n }\n static double[] GetDoubleArray()\n {\n return Array.ConvertAll(Console.ReadLine().Trim().Split(' '), Convert.ToDouble);\n }\n static List GetIntArray(int n)\n {\n List ips = new List();\n if (n == null)\n {\n string ip = Console.ReadLine().Trim();\n while (!string.IsNullOrEmpty(ip))\n {\n ips.Add(Convert.ToInt32(ip));\n ip = Console.ReadLine().Trim();\n }\n }\n else\n {\n while (n-- > 0)\n {\n ips.Add(Convert.ToInt32(Console.ReadLine().Trim()));\n }\n }\n return ips;\n }\n static string[] GetStringArray()\n {\n return Console.ReadLine().Trim().Split(' ');\n }\n static int GetN()\n {\n return Convert.ToInt32(Console.ReadLine().Trim());\n }\n static bool[] GetSieve(int max)\n {\n long sum = 0;\n long n = 2000000;\n bool[] e = new bool[n];//by default they're all false\n for (int i = 2; i < n; i++)\n {\n e[i] = true;//set all numbers to true\n }\n //weed out the non primes by finding mutiples \n for (int j = 2; j < n; j++)\n {\n if (e[j])//is true\n {\n for (long p = 2; (p * j) < n; p++)\n {\n e[p * j] = false;\n }\n }\n }\n return e;\n }\n static bool IsPrime(int n)\n {\n if (n > 1)\n {\n return Enumerable.Range(2, n / 2).Where(x => n % x == 0).Count() == 0;\n }\n\n return false;\n }\n static List GetListFromInt(int n)\n {\n List arr = new List();\n while (n > 0)\n {\n arr.Add(n % 10);\n n /= 10;\n }\n arr.Reverse();\n return arr;\n }\n static int GetIntFromArray(int[] arr)\n {\n int op = 0;\n foreach (int i in arr)\n {\n op = (op * 10) + i;\n }\n return op;\n }\n private static int GetMost(List vals, int m)\n {\n int ct = vals.Count;\n int l = vals.Max();\n int h = vals.Sum();\n\n while (l < h)\n {\n int mp = 1;\n int cl = 0;\n int mid = l + (h - l) / 2;\n for (int i = 0; i < ct; ++i)\n {\n if (cl + vals[i] <= mid) cl += vals[i];\n else { ++mp; cl = vals[i]; }\n }\n if (mp <= m) h = mid;\n else l = mid + 1;\n }\n return l;\n }\n private static int GetLeast(List vals, int m)\n {\n int max = -1;\n int ct = vals.Count;\n int h = vals[ct - 1];\n int l = 0;\n //int l = h;\n //for (int i = 1; i < ct; i++)\n //{\n // int df = vals[i] - vals[i - 1];\n // if (df < l) l = df;\n //}\n while (l < h)\n {\n int mp = 1;\n int prCwPos = vals[0];\n int mid = l + (h - l) / 2;\n for (int i = 1; i < ct; ++i)\n {\n int d = vals[i] - prCwPos;\n if (d >= mid)\n {\n mp++;\n prCwPos = vals[i];\n }\n }\n if (mp >= m) { l = mid + 1; if (mid > max) max = mid; }\n else h = mid;\n }\n return max;\n }\n static void Print(List op, bool newLine)\n {\n if (newLine)\n {\n foreach (string s in op)\n {\n Console.WriteLine(s);\n }\n }\n else\n {\n Console.WriteLine(string.Join(\" \", op));\n }\n }\n static void Print2DArray(int[,] ar)\n {\n for (int i = 0; i < ar.GetLength(0); i++)\n {\n string op = string.Empty;\n for (int j = 0; j < ar.GetLength(1); j++)\n {\n if (op == string.Empty) op = ar[i, j].ToString();\n else op += \" \" + ar[i, j].ToString();\n }\n Console.WriteLine(op);\n\n }\n }\n static void Print2DArray(bool[,] ar)\n {\n for (int i = 0; i < ar.GetLength(0); i++)\n {\n string op = string.Empty;\n for (int j = 0; j < ar.GetLength(1); j++)\n {\n if (op == string.Empty) op = (ar[i, j] ? \"1\" : \"0\");\n else op += \" \" + (ar[i, j] ? \"1\" : \"0\");\n }\n Console.WriteLine(op);\n\n }\n }\n #endregion\n static double pi = 3.14159265359;\n static void Main(string[] args)\n {\n //http://www.spoj.com/problems/PIE/\n\n a6();\n return;\n }\n\n private static void a6()\n {\n int[] ips = GetIntArray();\n int n = ips[0];\n int m = ips[1];\n //int ct = 0;\n //int h = (m + 1) / 2;\n //while(m > n)\n //{\n // if (n > h)\n // {\n // ct += n - h;\n // n = h;\n // }\n // while (n <= h)\n // {\n // n *= 2;\n // ct++;\n // }\n //}\n //if (n > m)\n //{\n // ct += n - m;\n //}\n if (m <= n)\n {\n Console.WriteLine(n - m);\n return;\n }\n bool[] v = new bool[300000];\n int[] d = new int[300000];\n Queue q = new Queue();\n q.Enqueue(n);\n v[n] = true;\n\n while (q.Count > 0)\n {\n int el = q.Dequeue();\n if (el == m) break;\n int n1 = el - 1;\n\n if (n1 > 0) { q.Enqueue(n1); v[n1] = true; d[n1] = d[el] + 1; }\n if (el <= 50000)\n {\n int n2 = el * 2;\n q.Enqueue(n2);\n v[n2] = true; d[n2] = d[el] + 1;\n }\n }\n Console.WriteLine(d[m]);\n }\n\n private static void a5()\n {\n int n = GetN();\n List x = GetIntArray().ToList();\n x.Sort();\n int max = x.Count - 1;\n int min = 0;\n int q = GetN();\n List m = new List();\n for (int i = 0; i < q; i++)\n {\n m.Add(Convert.ToInt32(Console.ReadLine().Trim()));\n }\n foreach (var itm in m)\n {\n int h = max;\n int l = min;\n bool found = false;\n int c = 0;\n while (h >= l)\n {\n\n int mid = l + (h - l) / 2;\n if (x[mid] <= itm)\n {\n found = true;\n if (c < mid) c = mid;\n l = mid + 1;\n }\n else h = mid - 1;\n }\n Console.WriteLine((found ? (c + 1) : 0));\n }\n\n }\n\n private static void a4()\n {\n int[] ips = GetIntArray();\n int n = ips[0];\n int m = ips[1];\n List> coll = new List>();\n bool nonZero = false;\n for (int i = 0; i < n; i++)\n {\n coll.Add(new List());\n int[] ipl = GetIntArray();\n coll[i].AddRange(ipl.Skip(1));\n if (coll[i].Count > 0) nonZero = true;\n }\n for (int i = 0; i < coll.Count; i++)\n {\n List el = coll[i];\n for (int j = i + 1; j < coll.Count; j++)\n {\n List nxt = coll[j];\n if (el.Any(p => nxt.Contains(p)))\n {\n coll[i].AddRange(nxt);\n coll.RemoveAt(j);\n j = i;\n }\n }\n }\n\n if (nonZero) Console.WriteLine(coll.Count - 1);\n else Console.WriteLine(coll.Count);\n\n }\n\n private static void a3()\n {\n int n = GetN();\n List ips = GetIntArray().ToList();\n ips.Sort();\n //List ipl = new List();\n //Dictionary dict = new Dictionary();\n List f = new List();\n //for (int i = 0; i < n; i++)\n //{\n // int it = ips[i];\n // if (!dict.ContainsKey(it))\n // {\n // dict.Add(it, 1);\n // }\n // else\n // {\n // dict[it] = dict[it] + 1;\n // }\n // if (!ipl.Contains(it)) ipl.Add(it);\n // //else ipl.Add(it);\n //}\n int ct = 0;\n while (ips.Count > 0)\n {\n int el = ips[0];\n f.Add(el);\n int k = 1;\n while (k < ips.Count && ips[k] <= el) k++;\n if (k < ips.Count)\n {\n f.Add(ips[k]);\n ips.RemoveAt(k);\n }\n\n ips.RemoveAt(0);\n }\n //for (int i = 0; i < ipl.Count; i++)\n //{\n // int el = ipl[i];\n // j = i + 1;\n // while (dict[el] != 0)\n // {\n // f.Add(el);\n // dict[el] = dict[el] - 1;\n // while(j> q = new Queue>();\n int[] dx = new int[] { 1, 0, -1, 0 };\n int[] dy = new int[] { 0, 1, 0, -1 };\n\n for (int i = 0; i < 5; i++)\n {\n int[] ips = GetIntArray();\n for (int j = 0; j < 5; j++)\n {\n if (ips[j] == 1)\n {\n q.Enqueue(new Tuple(i, j));\n v[i, j] = true;\n break;\n }\n }\n }\n while (q.Count > 0)\n {\n var el = q.Dequeue();\n int x = el.Item1;\n int y = el.Item2;\n if (x == 2 && y == 2)\n {\n Console.WriteLine(d[el.Item1, el.Item2]);\n break;\n }\n for (int i = 0; i < 4; i++)\n {\n int nr = x + dx[i];\n int nc = y + dy[i];\n if (nr >= 0 && nc >= 0 && nr < 5 && nc < 5 && !v[nr, nc])\n {\n v[nr, nc] = true;\n q.Enqueue(new Tuple(nr, nc));\n d[nr, nc] = d[x, y] + 1;\n }\n }\n }\n }\n\n private static void a1()\n {\n int n = GetN();\n List ipc = GetIntArray().ToList();\n if (!ipc.Contains(0))\n {\n Console.WriteLine(\"-1\");\n return;\n }\n ipc.Sort();\n ipc.Reverse();\n int m = 0;\n int sum = 0;\n for (int i = ipc.Count - 1; i >= 0; i--)\n {\n\n sum += ipc[i];\n if (sum % 9 == 0)\n {\n m = ipc.Count - i; ;\n }\n }\n string op = string.Empty;\n int ind = 0;\n for (int i = ipc.Count - 1; (i >= 0 && ind < m); i--)\n {\n op = ipc[i].ToString() + op;\n ind++;\n }\n op = op.TrimStart('0');\n if (op == \"\") op = \"0\";\n Console.WriteLine(op);\n }\n\n\n\n\n\n\n\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "791ccf8df07a3355dff3782168d207f5", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "caad44f90a8a96c141f7eac4205e4421", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.5509641873278237, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\n\nnamespace ConsoleApplication252\n{\n class Program\n {\n\n\n static void Main()\n {\n string[] ss = Console.ReadLine().Split();\n int a = int.Parse(ss[0]);\n int b = int.Parse(ss[1]);\n if (a >= b)\n {\n Console.WriteLine(a - b);\n return;\n }\n int x = 0;\n int y = 0;\n\n List d = new List();\n d.Add(a);\n for (int i = 0; x != b || y != b; i++)\n {\n x = d[i] - 1;\n y = d[i] * 2;\n d.Add(x);\n d.Add(y);\n if (x == b || y == b)\n {\n break;\n }\n }\n int p = 1;\n int k = 1;\n int q = 0;\n for (int i = 2; true; i *= 2)\n {\n for (int e = p; e <= p + i - 1; e++)\n {\n q = e;\n if (d[e] == b)\n {\n Console.WriteLine(k);\n return;\n }\n }\n k++;\n p = q + 1;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "ba9da4ac1b8ab6ea2829e8cb7d47b0db", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "eb361637e74ca7ba0b66f34a7566225e", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9630996309963099, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\npublic class Plate{\n static void Main(string[] args){\n Solve();\n }\n \n static void Solve(){\n string[] args = Console.ReadLine().Split(' ');\n int x = int.Parse(args[0]);\n int y = int.Parse(args[1]);\n int k = int.Parse(args[2]);\n \n int total = 0;\n for(int i = 0; i < k; i ++){\n total += Edges(x - 2 * i, y - 2 * i);\n }\n \n return total;\n }\n \n static int Edges(int x, int y){\n return 2 * x + 2 * y - 4;\n }\n}", "lang": "Mono C#", "bug_code_uid": "663f00e6eea118b65f54d8139559e290", "src_uid": "2c98d59917337cb321d76f72a1b3c057", "apr_id": "8893ed3cef5efcc18633515713abc98d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9720101781170484, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace Task1\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n\n var input = Console.ReadLine();\n var w = int.Parse(input.Split(' ')[0]);\n var h = int.Parse(input.Split(' ')[1]);\n var k = int.Parse(input.Split(' ')[2]);\n\n\n int result = 0;\n\n for (int i = 1; i <= k; i++)\n {\n\n int result = (w + h) * 2 - 4;\n int w =- 4;\n int h = -4; \n }\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "29bde23553a52a7f2fc9498f5da0fb2a", "src_uid": "2c98d59917337cb321d76f72a1b3c057", "apr_id": "f953b38f81bcc851e1fa6fc9613a2f5a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.9969688619454395, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n string s = \n\"111111101010101111100101001111111\" +\n\"100000100000000001010110001000001\" +\n\"101110100110110000011010001011101\" +\n\"101110101011001001111101001011101\" +\n\"101110101100011000111100101011101\" +\n\"100000101010101011010000101000001\" +\n\"111111101010101010101010101111111\" +\n\"000000001111101111100111100000000\" +\n\"100010111100100001011110111111001\" +\n\"110111001111111100100001000101100\" +\n\"011100111010000101000111010001010\" +\n\"011110000110001111110101100000011\" +\n\"111111111111111000111001001011000\" +\n\"111000010111010011010011010100100\" +\n\"101010100010110010110101010000010\" +\n\"101100000101010001111101000000000\" +\n\"000010100011001101000111101011010\" +\n\"101001001111101111000101010001110\" +\n\"101101111111000100100001110001000\" +\n\"000010011000100110000011010000010\" +\n\"001101101001101110010010011011000\" +\n\"011101011010001000111101010100110\" +\n\"111010100110011101001101000001110\" +\n\"110001010010101111000101111111000\" +\n\"001000111011100001010110111110000\" +\n\"000000001110010110100010100010110\" +\n\"111111101000101111000110101011010\" +\n\"100000100111010101111100100011011\" +\n\"101110101001010000101000111111000\" +\n\"101110100011010010010111111011010\"+\n\"101110100100011011110110101110000\"+\n\"100000100110011001111100111100000\"+\n\"111111101101000101001101110010001\";\n\n static void Main() {\n var i = Console.ReadLine().Split(' ').Select(int.Parse).Select(x => x-1)\n .Aggregate(0, (acc,a) => acc*32+a);\n Console.Write(s[i]);\n }\n}", "lang": "MS C#", "bug_code_uid": "2b0d34e69ac1f79e6a69839170cbab34", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "efce72ec4be9e3664d51efc9efe373a9", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9349409096335204, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Util;\nusing System.Threading;\n\npublic class Program\n{\n public void Solve()\n {\n var sc = new Scanner();\n const int n = 10;\n string[] s = new string[n];\n for (int i = 0; i < n; i++)\n {\n s[i] = sc.Next();\n }\n\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n if (i + 5 <= n)\n {\n int cnt = 0;\n bool f = true;\n for (int k = 0; f && k < 5; k++)\n {\n if (s[i + k][j] == 'O') f = false;\n else if (s[i + k][j] == '.') cnt++;\n }\n\n if (f && cnt <= 1)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n\n if (j + 5 <= n)\n {\n int cnt = 0;\n bool f = true;\n for (int k = 0; f && k < 5; k++)\n {\n if (s[i][j + k] == 'O') f = false;\n else if (s[i][j + k] == '.') cnt++;\n }\n\n if (f && cnt <= 1)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n\n if (i + 5 <= n && j + 5 <= n)\n {\n int cnt = 0;\n bool f = true;\n for (int k = 0; f && k < 5; k++)\n {\n if (s[i + k][j + k] == 'O') f = false;\n else if (s[i + k][j + k] == '.') cnt++;\n }\n\n if (f && cnt <= 1)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n }\n }\n\n Console.WriteLine(\"NO\");\n }\n\n public static void Main(string[] args) => new Program().Solve();\n // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();\n}\n\nnamespace CompLib.Util\n{\n using System;\n using System.Linq;\n\n class Scanner\n {\n private string[] _line;\n private int _index;\n private const char Separator = ' ';\n\n public Scanner()\n {\n _line = new string[0];\n _index = 0;\n }\n\n public string Next()\n {\n if (_index >= _line.Length)\n {\n string s;\n do\n {\n s = Console.ReadLine();\n } while (s.Length == 0);\n\n _line = s.Split(Separator);\n _index = 0;\n }\n\n return _line[_index++];\n }\n\n public string ReadLine()\n {\n _index = _line.Length;\n return Console.ReadLine();\n }\n\n public int NextInt() => int.Parse(Next());\n public long NextLong() => long.Parse(Next());\n public double NextDouble() => double.Parse(Next());\n public decimal NextDecimal() => decimal.Parse(Next());\n public char NextChar() => Next()[0];\n public char[] NextCharArray() => Next().ToCharArray();\n\n public string[] Array()\n {\n string s = Console.ReadLine();\n _line = s.Length == 0 ? new string[0] : s.Split(Separator);\n _index = _line.Length;\n return _line;\n }\n\n public int[] IntArray() => Array().Select(int.Parse).ToArray();\n public long[] LongArray() => Array().Select(long.Parse).ToArray();\n public double[] DoubleArray() => Array().Select(double.Parse).ToArray();\n public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();\n }\n}", "lang": ".NET Core C#", "bug_code_uid": "5a4042c014988190380b66eb90d20923", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "c3b43bcb579cc99d11acf318147e2ad7", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.7104072398190046, "equal_cnt": 32, "replace_cnt": 11, "delete_cnt": 6, "insert_cnt": 15, "fix_ops_cnt": 32, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp26\n{\n class Program\n {\n static void Main(string[] args)\n { int k = 0;\n int sum1 = 0;\n int sum2 = 0;\n int n=int.Parse(Console.ReadLine());\n int[] voices = new int[n];\n\n string[] str = Console.ReadLine().Split(' ');\n for (int i = 0; i < n; i++)\n {\n voices[i]=int.Parse(str[i]);\n }\n sum1 = voices.Sum();\n k= voices.Max();\n while(sum2 <= sum1)\n {\n k++;\n\n\n sum2 = 0;\n for (int i = 0; i < n; i++)\n {\n sum2 += k - voices[i];\n }\n }\n if (sum2 == 0) { k = 1; }\n\n //Console.WriteLine(sum1);\n //Console.WriteLine(sum2);\n Console.WriteLine(k);\n //Console.ReadKey();\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b25a6a909ef4ad6be70f5409fa93c5b8", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "4162b26047ee434806df08ba07d8b96d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9696794686687843, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#define Online\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing System.IO;\n\nnamespace CF\n{\n delegate double F (double x);\n\n delegate decimal Fdec (decimal x);\n\n partial class Program\n {\n\n static void Main (string[] args)\n {\n\n#if FileIO\n StreamReader sr = new StreamReader(\"bacon.in\");\n StreamWriter sw = new StreamWriter(\"bacon.out\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n A ();\n\n#if Online\n Console.ReadLine ();\n#endif\n\n#if FileIO\n sr.Close();\n sw.Close();\n#endif\n }\n\n static void A ()\n {\n int n = ReadInt ();\n int[] a = new int[n];\n ReadArray (' ');\n for (int i=0; i a [i]) {\n l = i;\n r = j;\n } else if (a [l] == a [i] && a [j] > a [r]) {\n l = i;\n r = j;\n }\n }\n }\n }\n List t = new List ();\n\n for (int i=0; i 0) {\n if ((n & 1) == 1) {\n res = (res * a) % mod;\n }\n a = (a * a) % mod;\n n >>= 1;\n }\n return res;\n }\n\n public static long GCD (long a, long b)\n {\n while (b != 0)\n b = a % (a = b);\n return a;\n }\n\n public static int GCD (int a, int b)\n {\n while (b != 0)\n b = a % (a = b);\n return a;\n }\n\n public static long LCM (long a, long b)\n {\n return (a * b) / GCD (a, b);\n }\n\n public static int LCM (int a, int b)\n {\n return (a * b) / GCD (a, b);\n }\n }\n\n static class ArrayUtils\n {\n public static int BinarySearch (int[] a, int val)\n {\n int left = 0;\n int right = a.Length - 1;\n int mid;\n\n while (left < right) {\n mid = left + ((right - left) >> 1);\n if (val <= a [mid]) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n\n if (a [left] == val)\n return left;\n else\n return -1;\n }\n\n public static double Bisection (F f, double left, double right, double eps)\n {\n double mid;\n while (right - left > eps) {\n mid = left + ((right - left) / 2d);\n if (Math.Sign (f (mid)) != Math.Sign (f (left)))\n right = mid;\n else\n left = mid;\n }\n return (left + right) / 2d;\n }\n\n public static decimal TernarySearchDec (Fdec f, decimal eps, decimal l, decimal r, bool isMax)\n {\n decimal m1, m2;\n while (r - l > eps) {\n m1 = l + (r - l) / 3m;\n m2 = r - (r - l) / 3m;\n if (f (m1) < f (m2))\n if (isMax)\n l = m1;\n else\n r = m2;\n else\n if (isMax)\n r = m2;\n else\n l = m1;\n }\n return r;\n }\n\n public static double TernarySearch (F f, double eps, double l, double r, bool isMax)\n {\n double m1, m2;\n while (r - l > eps) {\n m1 = l + (r - l) / 3d;\n m2 = r - (r - l) / 3d;\n if (f (m1) < f (m2))\n if (isMax)\n l = m1;\n else\n r = m2;\n else\n if (isMax)\n r = m2;\n else\n l = m1;\n }\n return r;\n }\n\n public static void Merge (T[] A, int p, int q, int r, T[] L, T[] R, Comparison comp)\n {\n for (int i = p; i <= q; i++)\n L [i] = A [i];\n for (int i = q + 1; i <= r; i++)\n R [i] = A [i];\n\n for (int k = p, i = p, j = q + 1; k <= r; k++) {\n if (i > q) {\n for (; k <= r; k++, j++)\n A [k] = R [j];\n return;\n }\n if (j > r) {\n for (; k <= r; k++, i++)\n A [k] = L [i];\n return;\n }\n if (comp (L [i], R [j]) <= 0) {\n A [k] = L [i];\n i++;\n } else {\n A [k] = R [j];\n j++;\n }\n }\n }\n\n public static void Merge_Sort (T[] A, int p, int r, T[] L, T[] R, Comparison comp)\n {\n if (p >= r)\n return;\n int q = p + ((r - p) >> 1);\n Merge_Sort (A, p, q, L, R, comp);\n Merge_Sort (A, q + 1, r, L, R, comp);\n Merge (A, p, q, r, L, R, comp);\n }\n\n public static void Merge (T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable\n {\n for (int i = p; i <= q; i++)\n L [i] = A [i];\n for (int i = q + 1; i <= r; i++)\n R [i] = A [i];\n\n for (int k = p, i = p, j = q + 1; k <= r; k++) {\n if (i > q) {\n for (; k <= r; k++, j++)\n A [k] = R [j];\n return;\n }\n if (j > r) {\n for (; k <= r; k++, i++)\n A [k] = L [i];\n return;\n }\n if (L [i].CompareTo (R [j]) <= 0) {\n A [k] = L [i];\n i++;\n } else {\n A [k] = R [j];\n j++;\n }\n }\n }\n\n public static void Merge_Sort (T[] A, int p, int r, T[] L, T[] R) where T : IComparable\n {\n if (p >= r)\n return;\n int q = p + ((r - p) >> 1);\n Merge_Sort (A, p, q, L, R);\n Merge_Sort (A, q + 1, r, L, R);\n Merge (A, p, q, r, L, R);\n }\n\n public static void Merge_Sort1 (T[] A, int p, int r, T[] L, T[] R) where T : IComparable\n {\n int k = 1;\n while (k < r - p + 1) {\n int i = 0;\n while (i < r) {\n int _r = Math.Min (i + 2 * k - 1, r);\n int q = Math.Min (i + k - 1, r);\n Merge (A, i, q, _r, L, R);\n i += 2 * k;\n }\n k <<= 1;\n }\n }\n\n public static void Merge_Sort1 (T[] A, int p, int r, T[] L, T[] R, Comparison comp)\n {\n int k = 1;\n while (k < r - p + 1) {\n int i = 0;\n while (i < r) {\n int _r = Math.Min (i + 2 * k - 1, r);\n int q = Math.Min (i + k - 1, r);\n Merge (A, i, q, _r, L, R, comp);\n i += 2 * k;\n }\n k <<= 1;\n }\n }\n\n static void Shake (T[] a)\n {\n Random rnd = new Random (Environment.TickCount);\n T temp;\n int b;\n for (int i = 0; i < a.Length; i++) {\n b = rnd.Next (i, a.Length);\n temp = a [b];\n a [b] = a [i];\n a [i] = temp;\n }\n }\n }\n\n partial class Program\n {\n static string[] tokens;\n static int cur_token = 0;\n\n static void ReadArray (char sep)\n {\n cur_token = 0;\n tokens = Console.ReadLine ().Split (sep);\n }\n\n static int ReadInt ()\n {\n return int.Parse (Console.ReadLine ());\n }\n\n static long ReadLong ()\n {\n return long.Parse (Console.ReadLine ());\n }\n\n static int NextInt ()\n {\n return int.Parse (tokens [cur_token++]);\n }\n\n static long NextLong ()\n {\n return long.Parse (tokens [cur_token++]);\n }\n\n static double NextDouble ()\n {\n return double.Parse (tokens [cur_token++]);\n }\n\n static decimal NextDecimal ()\n {\n return decimal.Parse (tokens [cur_token++]);\n }\n\n static string NextToken ()\n {\n return tokens [cur_token++];\n }\n\n static string ReadLine ()\n {\n return Console.ReadLine ();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "30c54d49bfa33a0e3c9f12e156e23e04", "src_uid": "4408eba2c5c0693e6b70bdcbe2dda2f4", "apr_id": "dbdd95518018f853637e34e88c17f7ce", "difficulty": 1300, "tags": ["constructive algorithms", "implementation", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.8543278084714548, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace Contest\n{\n public static class MainClass\n {\n\n static int ReadIntLine()\n {\n return int.Parse(Console.ReadLine());\n }\n\n static void ReadInt(ref int a)\n {\n a = ReadIntArrayLine()[0];\n }\n\n static void ReadInts(ref int a, ref int b)\n {\n var x = ReadIntArrayLine();\n a = x[0];\n b = x[1];\n }\n\n static void ReadInts(ref int a, ref int b, ref int c)\n {\n var x = ReadIntArrayLine();\n a = x[0];\n b = x[1];\n c = x[2];\n }\n\n static void ReadInts(ref int a, ref int b, ref int c, ref int d)\n {\n var x = ReadIntArrayLine();\n a = x[0];\n b = x[1];\n c = x[2];\n d = x[3];\n }\n\n static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e)\n {\n var x = ReadIntArrayLine();\n a = x[0];\n b = x[1];\n c = x[2];\n d = x[3];\n e = x[4];\n }\n\n static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e, ref int f)\n {\n var x = ReadIntArrayLine();\n a = x[0];\n b = x[1];\n c = x[2];\n d = x[3];\n e = x[4];\n f = x[5];\n }\n\n static int[] ReadIntArrayLine()\n {\n char[] sep = { ' ' };\n\t\t\treturn Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();\n\t\t}\n\n\t\tstatic void PrintLn(object obj)\n\t\t{\n\t\t\tConsole.WriteLine(obj.ToString());\n\t\t}\n\n\t\tpublic static string Reverse(string s)\n\t\t{\n\t\t\tchar[] charArray = s.ToCharArray();\n\t\t\tArray.Reverse(charArray);\n\t\t\treturn new string(charArray);\n\t\t}\n\n\n\t\tpublic static void PrintLnCollection(IEnumerable col)\n\t\t{\n\t\t\tPrintLn(string.Join(\" \", col));\n\t\t}\n\n\n\t\tpublic static void PrintLn(params object[] v)\n\t\t{\n\t\t\tPrintLnCollection(v);\n\t\t}\n\n\t\tpublic static string ReadLine()\n\t\t{\n\t\t\treturn Console.ReadLine();\n\t\t}\n\n\n\t\tpublic static string MySubstring(this string str, int start, int finish)\n\t\t{\n\t\t\tif (start > finish) return \"\";\n\t\t\treturn str.Substring(start, finish - start + 1);\n\t\t}\n\n\n\t\tpublic static bool IsInRange(this int a, int lb, int ub)\n\t\t{\n\t\t\treturn (a >= lb) && (a <= ub);\n\t\t}\n\n\t\tprivate static void mergeDS(int i, int j, int[] a)\n\t\t{\n\t\t\tint t = a[j];\n\t\t\tfor (int ii = 0; ii < a.Length; ii++)\n\t\t\t{\n\t\t\t\tif (a[ii] == t)\n\t\t\t\t\ta[ii] = a[i];\n\t\t\t}\n\t\t}\n\n\t\tprivate static T MyMax(params T[] a)\n\t\t{\n\t\t\treturn a.Max();\n\t\t}\n\n\t\tprivate static T MyMin(params T[] a)\n\t\t{\n\t\t\treturn a.Min();\n\t\t}\n\n\n\t\tprivate static int[] GetPrimesLessThan(int x)\n\t\t{\n\t\t\tif (x < 2)\n\t\t\t\treturn new int[0];\n\n\t\t\tint[] a = new int[x];\n\n\t\t\ta[0] = 1; a[1] = 1;\n\n\t\t\tfor (int i = 0; i < a.Length; i++)\n\t\t\t{\n\t\t\t\tif (a[i] == 0)\n\t\t\t\t\tfor (int j = 2 * i; j < a.Length; j += i)\n\t\t\t\t{\n\t\t\t\t\ta[j] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar abc = new List(x);\n\n\t\t\tfor (int i = 0; i < a.Length; i++)\n\t\t\t{\n\t\t\t\tif (a[i] == 0)\n\t\t\t\t\tabc.Add(i);\n\t\t\t}\n\n\t\t\treturn abc.ToArray();\n\t\t}\n\n\t\tprivate static int FindNearestLEQElementInTheArray(int[] a, int startIndex, int endIndex, int target)\n\t\t{\n\t\t\tif (startIndex == endIndex)\n\t\t\t{\n\t\t\t\tif (a[startIndex] <= target)\n\t\t\t\t\treturn startIndex;\n\t\t\t\telse\n\t\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif (startIndex + 1 == endIndex)\n\t\t\t{\n\t\t\t\tif (a[endIndex] <= target)\n\t\t\t\t\treturn endIndex;\n\t\t\t\telse if (a[startIndex] <= target)\n\t\t\t\t\treturn startIndex;\n\t\t\t\telse\n\t\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tint mid = (startIndex + endIndex) / 2;\n\t\t\tif (target == a[mid])\n\t\t\t\treturn mid;\n\t\t\telse if (target < a[mid])\n\t\t\t\treturn FindNearestLEQElementInTheArray(a, startIndex, mid - 1, target);\n\t\t\telse\n\t\t\t\treturn FindNearestLEQElementInTheArray(a, mid, endIndex, target);\n\t\t}\n\n\t\tprivate static int FindNearestLEQElementInTheArray(int[] a, int target)\n\t\t{\n\t\t\treturn FindNearestLEQElementInTheArray(a, 0, a.Length - 1, target);\n\t\t}\n\n\t\tprivate static int gcd(int a, int b)\n\t\t{\n\t\t\tint r = a % b;\n\t\t\twhile (r != 0)\n\t\t\t{\n\t\t\t\ta = b;\n\t\t\t\tb = r;\n\t\t\t\tr = a % b;\n\t\t\t}\n\t\t\treturn b;\n\n\t\t}\n\n\t\t//----------------------------------------------------------------------------\n\n static int mapTo1D(int i,int j,int m)\n {\n return i * m + j;\n }\n\n\t\tstatic void Main(string[] args)\n\t\t{\n int n = 0, m = 0;\n\n ReadInts(ref n, ref m);\n\n\n int[,] d = new int[m * n, m * n];\n\n string rowDir = ReadLine();\n string colDir = ReadLine();\n\n for (int i = 0; i < n*m; i++)\n for (int j = 0; j < n*m; j++)\n if (i == j)\n d[i, j] = 0;\n else\n d[i, j] = 2000;\n\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++) \n {\n if (rowDir[i] == '<' && j > 0)\n d[mapTo1D(i, j, m),mapTo1D(i, j - 1, m)] = 1;\n if (rowDir[i] == '>' && j < m-1)\n d[mapTo1D(i, j, m),mapTo1D(i, j + 1, m)] = 1;\n if (colDir[j]=='^' && i > 0)\n d[mapTo1D(i, j, m),mapTo1D(i - 1, j, m)] = 1;\n if (colDir[j]=='v' && i=0)\n {\n if (betterT - t0 < 0 || betterT - t0 > t - t0 || (betterT == t && speedX + speedY < x+y))\n {\n betterT = t;\n speedX = x;\n speedY = y;\n }\n }\n }\n \n }\n Console.WriteLine(speedX + \" \" + speedY);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "fadb2cddc1973bb7f7a49f7e8e9bf823", "src_uid": "87a500829c1935ded3ef6e4e47096b9f", "apr_id": "82293a4f9e353d434185b4ddfbddfc0b", "difficulty": 1900, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.13930348258706468, "equal_cnt": 49, "replace_cnt": 42, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 49, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace HotBath\n{\n\tpublic class HB\n\t{\n\t\tpublic static double GetTemp(double t1, double t2, double y1, double y2)\n\t\t{\n\t\t\tif (y1+y2 == 0) return double.MaxValue;\n\t\t\treturn (t1*y1 + t2*y2)/(y1+y2);\n\t\t}\n\t\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tstring line;\n\t\t\twhile ((line = Console.ReadLine()) != null)\n\t\t\t{\n\t\t\t\tvar para = line.Split(' ').Select(double.Parse).ToList();\n\t\t\t\tvar t1 = para[0];\n\t\t\t\tvar t2 = para[1];\n\t\t\t\tvar x1 = para[2];\n\t\t\t\tvar x2 = para[3];\n\t\t\t\tvar t0 = para[4];\n\n\t\t\t\tvar bestt0 = double.MaxValue;\n\t\t\t\tvar besty1 = 0;\n\t\t\t\tvar besty2 = 0;\n\t\t\t\tfor (var tryy1=0; tryy1 <= x1; tryy1++)\n\t\t\t\t{\n\t\t\t\t\tfor (var tryy2=0; tryy2 <= x2; tryy2++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tryt0 = GetTemp(t1, t2, tryy1, tryy2);\n\t\t\t\t\t\tvar diff = tryt0 - t0;\n\t\t\t\t\t\tif (diff < 0) continue;\n\t\t\t\t\t\tif (diff < bestt0 || (diff == bestt0 && tryy1+tryy2 > besty1+besty2))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Console.WriteLine(\"y1={0}, y2={1}, temp={2}\", tryy1, tryy2, tryt0);\n\t\t\t\t\t\t\tbestt0 = diff;\n\t\t\t\t\t\t\tbesty1 = tryy1;\n\t\t\t\t\t\t\tbesty2 = tryy2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tConsole.WriteLine(\"{0} {1}\", besty1, besty2);\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "9e06818e482be152033ca76a6435f39b", "src_uid": "87a500829c1935ded3ef6e4e47096b9f", "apr_id": "5ba4c3bda5689502cc6935226c6793b6", "difficulty": 1900, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.919908466819222, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "\ufeffusing System;\n\nnamespace testcs {\n class MainClass {\n\t\tpublic static int ReadInt() {\n\t\t\tchar ch;\n\t\t\tint x = 0;\n\n\t\t\tdo {\n\t\t\t\tch = (char)Console.Read();\n\t\t\t}\n\t\t\twhile (!Char.IsDigit(ch));\n\t\t\twhile (Char.IsDigit(ch)) {\n\t\t\t\tx = x * 10 + ch - '0';\n\t\t\t\tch = (char)Console.Read();\n\t\t\t}\n\n\t\t\treturn x;\n\t\t}\n\n\t\tpublic static void Main(string[] args) {\n\t\t\tint[] v, f, ans;\n\t\t\tint n, m, ptr;\n\n\t\t\tans = new int[10];\n\t\t\tv = new int[10];\n\t\t\tf = new int[10];\n\n\t\t\tn = ReadInt();\n\t\t\tm = ReadInt();\n\t\t\tfor (int i = 0; i < n; ++i)\n\t\t\t\tv[i] = ReadInt();\n\t\t\tfor (int dig, i = 0; i < m; ++i) {\n\t\t\t\tdig = ReadInt();\n\t\t\t\tf[dig] += 1;\n\t\t\t}\n\n\t\t\tptr = 0;\n\t\t\tfor (int i = 0; i < n; ++i)\n\t\t\t\tif (f[v[i]] != 0) {\n\t\t\t\t\tf[v[i]] -= 1;\n\t\t\t\t\tans[ptr++] = v[i];\n\t\t\t\t}\n\n\t\t\tif (ptr == m) {\n\t\t\t\tfor (int i = 0; i < m; ++i)\n\t\t\t\t\tConsole.Write(ans[i] + \" \");\n\t\t\t\tConsole.WriteLine(\"\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tConsole.WriteLine(\"\");\n\t\t\t}\n\t\t}\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "75ac6476c0bd4791cc91a1dd6ae3c246", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72", "apr_id": "51d4291a31a48981c2d8c9aa88dce3f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.6996865203761755, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "\ufeffusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace algorithms_700_01\n{\n class Program\n {\n static void Main()\n {\n Console.ReadLine();\n var fingerPrintDigits = Console.ReadLine().Split(new char[] { ' ' }).Select(x => int.Parse(x));\n var possibleSecretDigits = Console.ReadLine().Split(new char[] { ' ' }).Select(x => int.Parse(x)).ToHashSet();\n var secretCodeDigits = new List();\n foreach (var fingerPrintDigit in fingerPrintDigits)\n {\n if (possibleSecretDigits.Contains(fingerPrintDigit))\n {\n secretCodeDigits.Add(fingerPrintDigit);\n }\n }\n Console.WriteLine(string.Join(\" \", fingerPrintDigits));\n }\n }\nf", "lang": "Mono C#", "bug_code_uid": "cac20f8de340fab7974166521ee19e61", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72", "apr_id": "2f0b1e0ae07160e155078cf270ff7486", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8526315789473684, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp31\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string s = Console.ReadLine();\n char[] str = s.ToCharArray();\n int min=0;\n int plus=0;\n // int before = 0;\n for (int i=0; i min)\n //{\n // before = 0;\n\n // before += plus - min;\n //}\n //else if(min>=plus){\n // before = plus;\n // before -= min - plus;\n //}\n\n //if(before<0)\n //{\n // before = 0;\n //}\n int ans = 0;\n\n if( min == plus)\n {\n Console.WriteLine(plus);\n }\n\n if(min>plus)\n {\n Console.WriteLine(ans);\n }\n if(min upSpeed)\n {\n daysPass = -1;\n Console.WriteLine(daysPass + \" Breaked\");\n break;\n }\n\n if (daytime < 12)\n {\n wormPos += upSpeed;\n daytime++;\n }\n else\n {\n nightDec++;\n wormPos -= downSpeed;\n if (nightDec >= 12)\n {\n nightDec = 0;\n daytime = 0;\n daysPass++;\n }\n }\n // Console.WriteLine(\"Looping\");\n\n }\n\n Console.WriteLine(daysPass);\n Console.Read();\n }\n }", "lang": "Mono C#", "bug_code_uid": "dfd0d7ab2f310f058ad1444ceb4ff821", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "e937ce93e4baf6004d601b3d8cefeea5", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8377253814147018, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Gabriel_and_Worm\n{\n class Program\n {\n static void Main(string[] args)\n {\n Program p = new Program();\n string[] tokens = Console.ReadLine().Split();\n string[] tokens2 = Console.ReadLine().Split();\n\n int htCtr = int.Parse(tokens[0]);\n\n //Parse element 1\n int htApple = int.Parse(tokens[1]);\n\n int up = int.Parse(tokens2[0]);\n\n //Parse element 1\n int down = int.Parse(tokens2[1]);\n\n p.Ankush(htCtr, htApple, up, down);\n // p.Ankush(12, 120, 5, 3);\n }\n\n public void Ankush(int heightCaterpillar, int heightApple, int upSpeed, int downSpeed)\n {\n int wormPos = heightCaterpillar;\n\n int daytime = 4;\n int nightDec = 0;\n int daysPass = 0;\n\n while (wormPos < heightApple)\n {\n if (downSpeed > upSpeed && (heightApple - heightCaterpillar) > 8)\n {\n daysPass = -1;\n //Console.WriteLine(daysPass + \" Breaked\");\n break;\n // return;\n }\n\n if (daytime < 12)\n {\n wormPos += upSpeed;\n daytime++;\n }\n else\n {\n nightDec++;\n wormPos -= downSpeed;\n if (nightDec >= 12)\n {\n nightDec = 0;\n daytime = 0;\n daysPass++;\n }\n }\n // Console.WriteLine(\"Looping\");\n\n }\n\n Console.WriteLine(daysPass);\n Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "525aa165bf2da7f57a3b686ca72a1a9a", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "e937ce93e4baf6004d601b3d8cefeea5", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8202898550724638, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Linq;\n\nclass P {\n static IEnumerable GetNums() {\n for (var i = 0L ; ; i++) {\n var c = i;\n var res = 0L; var mult = 1L;\n while (c > 0) {\n if (c > 2) {\n var o = (c - 1)%2 + 1;\n c -= o;\n res += mult * (o == 1 ? 4 : 7);\n } else {\n c--;\n res += mult * (c == 1 ? 4 : 7);\n }\n c /= 2;\n mult *= 10;\n }\n yield return res;\n }\n }\n\n public static void Main() {\n long n = long.Parse(Console.ReadLine());\n var res = GetNums().First(x => x >= n);\n Console.Write(res);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "63fefa2668809fa5ea36a6981321985a", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "c7dabee16e3ab4205784b32262cef819", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9980294789942461, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n\n \n\n \n\n\nLuckyNumbers.cs\n\nusing System;\n\nnamespace LuckyNunmbers {\n\tclass Program {\n static void Main(string[] args) {\n var line = Console.ReadLine();\n var num = new LuckyNumber(long.Parse(line));\n Console.WriteLine(num.GetSuperLucky());\n }\n }\n\n internal enum NumberType {\n Simple, Lucky, SuperLucky\n }\n\n internal class LuckyNumber {\n\n private long _number;\n private long _lucky;\n private long _superLucky;\n\n private const uint LUCKY1 = 4;\n private const uint LUCKY2 = 7;\n\n private char CLUCKY1;\n private char CLUCKY2;\n\n public LuckyNumber(long number) {\n _number = number;\n var numType = GetNumberType();\n\n CLUCKY1 = UintToChar(LUCKY1);\n CLUCKY2 = UintToChar(LUCKY2);\n\n switch (numType) {\n case NumberType.Lucky:\n _lucky = _number;\n break;\n case NumberType.SuperLucky:\n _lucky = _number;\n _superLucky = _number;\n break;\n }\n }\n\n public long GetLucky() {\n if (_lucky != 0) return _lucky;\n\n var digits = _number.ToString().ToCharArray();\n\n if (digits.Length > 0) {\n var buff = new char[digits.Length];\n for(int i=0; i= 0) {\n buff[index] = CLUCKY2;\n index--;\n }\n\n _lucky = long.Parse(new string(buff));\n while (index < digits.Length - 1) {\n index++;\n buff[index] = CLUCKY1;\n\n var p = long.Parse(new string(buff));\n if (p > _number) _lucky = p;\n else buff[index] = CLUCKY2;\n }\n\n if(_lucky < _number) {\n var arr = new char[digits.Length + 1];\n for (int i = 0; i < arr.Length; i++) arr[i] = CLUCKY1;\n _lucky = long.Parse(new string(arr));\n }\n\n return _lucky;\n }\n return 0;\n }\n\n public long GetSuperLucky() {\n if (_superLucky != 0) return _superLucky;\n if (_lucky == 0) this.GetLucky();\n\n var num = _lucky.ToString();\n if (num.Length % 2 != 0) {\n var result = GetAbsoluteLucky(num.Length + 1);\n _superLucky = long.Parse(result);\n } else {\n var ch = ToSuperLucky(num.ToCharArray());\n _superLucky = long.Parse(new string(ch));\n }\n\n return _superLucky;\n }\n\n private string GetAbsoluteLucky(int len) {\n var right = string.Empty;\n var left = string.Empty;\n len /= 2;\n\n for (int i = 0; i < len; i++) {\n left += LUCKY1;\n right += LUCKY2;\n }\n return left + right;\n }\n\n private char[] ToSuperLucky(char[] input) {\n var diff = GetCharacterDiff(input);\n if (diff > 0) {\n Array.Reverse(input);\n var replaced = ReplaceNext(input, (uint)(diff / 2));\n Array.Reverse(replaced);\n return replaced;\n } else if (diff < 0) {\n try {\n var replaced = ReplaceFirst(input, (uint)(Math.Abs(diff) / 2));\n return replaced;\n } catch (IndexOutOfRangeException) {\n return string.Format(\"4{0}7\", GetAbsoluteLucky(input.Length)).ToCharArray();\n }\n } else return input;\n }\n\n private char[] ReplaceNext(char[] inp, uint depth, int move = 0) {\n int offset = move;\n for (int i = offset; i < inp.Length; i++) {\n move++;\n if (char.GetNumericValue(inp[i]) == LUCKY1) {\n inp[i] = CLUCKY2;\n break;\n }\n }\n depth--;\n\n if (depth > 0) return ReplaceNext(inp, depth, move);\n return inp;\n }\n\n /// \n /// Replaces LUCKY2 to LUCKY1\n /// \n /// In case of bad input\n private char[] ReplaceFirst(char[] inp, uint depth) {\n int index = inp.Length - 1;\n\n //This will throw ArgumentOutOfRangeException\n //in case if input is only LUCKY2\n while (char.GetNumericValue(inp[index]) != LUCKY1) index--;\n inp[index] = CLUCKY2;\n\n //This will throw ArgumentOutOfRangeException\n //in case if we have bad pattern\n while (depth + 1 > 0) {\n index++;\n depth--;\n inp[index] = CLUCKY1;\n }\n return inp;\n }\n\n public NumberType GetNumberType() {\n return LuckyNumber.GetNumberType(_number);\n }\n\n public static NumberType GetNumberType(long number) {\n uint l1s = 0, l2s = 0;\n foreach(var ch in number.ToString()) {\n if (char.GetNumericValue(ch) == LUCKY1) l1s++;\n else if (char.GetNumericValue(ch) == LUCKY2) l2s++;\n else return NumberType.Simple;\n }\n\n return (l1s == l2s)? NumberType.SuperLucky : NumberType.Lucky;\n }\n\n //---------------------\n\n private int GetCharacterDiff(char[] input) {\n int l1s = 0, l2s = 0;\n foreach (var ch in input) {\n if (char.GetNumericValue(ch) == LUCKY1) l1s++;\n else if (char.GetNumericValue(ch) == LUCKY2) l2s++;\n }\n\n return l1s - l2s;\n }\n\n private static string Reverse(string s) {\n char[] charArray = s.ToCharArray();\n Array.Reverse(charArray);\n return new string(charArray);\n }\n\n private static char UintToChar(uint inp) {\n return inp.ToString()[0];\n }\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "44f1930495e14f8c19e1c6a020dddaa8", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "00ea037822434ff238fc8a3d29b75ca6", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.9983164983164983, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace \u043f\u043e\u043a\u0443\u043f\u043a\u0430_\u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0430\n{\n class Program\n {\n static long Nod(long a, long b)\n {\n if(a yt)\n xt = xt - yt;\n else\n yt = yt - xt;\n }\n x /= xt;\n y /= yt;\n\n \n long cx = a / x;\n long cy = b / y;\n long res = Math.Min(cx, cy);\n Console.WriteLine(string.Format(\"{0:d}\", res));\n\n#if DEBUG\n Console.ReadKey();\n#endif\n }\n\n\n\n\n}", "lang": "Mono C#", "bug_code_uid": "c988191435159b635d42495f82a0e22b", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "apr_id": "03e414749993d1c99e786b88d17003ac", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8515369522563767, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nnamespace taskA\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tint n = int.Parse(Console.ReadLine());\n\t\t\t\n\t\t\tint[][] input = new int[n][];\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t\tinput[i] = GetArrayFromLine(Console.ReadLine());\n\t\t\t\n\t\t\tint center = n / 2;\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\t\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tsum+=input[i][center];\n\t\t\t\tsum+=input[center][i];\n\t\t\t\tsum+=input[i][i];\n\t\t\t\tsum+=input[n - 1 - i][n-1-i];\n\t\t\t}\n\t\t\t\n\t\t\tsum-=input[center][center]*3;\n\t\t\t\n\t\t\tConsole.WriteLine(sum);\n\t\t}\n\t\t\n\t\tprivate static int[] GetArrayFromLine(string line)\n {\n return Array.ConvertAll(line.Split(' '),\n new Converter((val) => { return int.Parse(val); }));\n }\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "d89a735376d98ac22a54e902609405be", "src_uid": "5ebfad36e56d30c58945c5800139b880", "apr_id": "04e8b86675f6b5d86165fcbc700a28c3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9719495091164095, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "/*\n * \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0432 SharpDevelop.\n * \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c: alexey\n * \u0414\u0430\u0442\u0430: 16.11.2012\n * \u0412\u0440\u0435\u043c\u044f: 19:15\n * \n * \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0421\u0435\u0440\u0432\u0438\u0441 | \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 | \u041a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 | \u041f\u0440\u0430\u0432\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432.\n */\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\nusing System.Threading;\nusing System.IO;\nusing System;\n\nnamespace round_159\n{\n\tclass Program\n\t{\n\t\tpublic static int ReadInt(){\n\t\t\t\n\t\t\t\treturn int.Parse(Console.ReadLine());\n\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t\t\t\n\t\tpublic static string[] ReadStrArr(){\n\t\t\t\n\t\t\t\treturn Console.ReadLine().Split(' ');\n\t\t\t\t\n\t\t\t}\n\t\t\n\t public static int ToInt(Object a){\n\t\t\t\t\n\t\t\treturn int.Parse(a.ToString());\n\t\t\t\t\n\t\t\t}\t\n\t\n\t\tpublic static void print(int[] mas){\n\t\n\t\tfor (int i =0;i max)\n {\n max = k;\n res = a;\n }\n // A[a] = k;\n }\n \n Console.WriteLine(res);\n // Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e136b076e6b2848af1f1c85a730f7806", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "5ad0639e00c55ee4f7dff1be0614094e", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.8042977743668457, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\n\nnamespace tes\n{\n\tclass contest\n\t{\n\t\t\t\t\n\t\t\n\t\tstatic void Main(string[] args)\n\t\t{\n\n\t\t\tvar input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = input[0];\n int m = input[1];\n\n var ran = Enumerable.Range(1, n).ToArray();\n\n int guess = 0;\n\n int div = n - m;\n\n \n\n if (Math.Abs(m - 1) > Math.Abs(n - m))\n {\n guess = m - 1;\n }\n else guess = m + 1;\n\n Console.WriteLine(guess);\n\t\t\t\n\n\t\t\t\n }\n\t\t\t\n\t}\n}", "lang": "MS C#", "bug_code_uid": "e4ee2ba36920ad294fcbf6e4d0af7b38", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "a9c1d425edf04d975abec89cf9ae0216", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9994753960759627, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (\u3065\u00b0\u03c9\u00b0)\u3065\uff90e\u2605\u309c\u30fb\u3002\u3002\u30fb\u309c\u309c\u30fb\u3002\u3002\u30fb\u309c\u2606\u309c\u30fb\u3002\u3002\u30fb\u309c\u309c\u30fb\u3002\u3002\u30fb\u309c\npublic class Solver\n{\n class Bit\n {\n private readonly int size;\n private readonly int[] data;\n\n public Bit(int n)\n {\n size = n;\n data = new int[n];\n }\n\n public int PrefixSum(int r)\n {\n int ret = 0;\n for (; r >= 0; r = (r & r + 1) - 1)\n ret += data[r];\n return ret;\n }\n\n public void Update(int idx, int diff)\n {\n for (; idx < size; idx = (idx | idx + 1))\n data[idx] += diff;\n }\n }\n\n long InvCount(int[] a)\n {\n int n = a.Length;\n var bit = new Bit(n + 1);\n long ret = 0;\n for (int i = 0; i < n; i++)\n {\n ret += i - bit.PrefixSum(a[i]);\n bit.Update(a[i], 1);\n }\n return ret;\n }\n\n public void Solve()\n {\n int n = ReadInt();\n int m = ReadInt();\n\n var a = Enumerable.Range(0, n).ToArray();\n for (int i = 0; i < n / 2 && m > 0; i++)\n {\n int t = a[i];\n a[i] = a[n - i - 1];\n a[n - i - 1] = t;\n }\n\n Write(InvCount(a));\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\n //reader = new StreamReader(Console.OpenStandardInput());\n writer = Console.Out;\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = new StreamReader(Console.OpenStandardInput());\n writer = new StreamWriter(Console.OpenStandardOutput());\n //reader = new StreamReader(\"input.txt\");\n //writer = new StreamWriter(\"output.txt\");\n#endif\n try\n {\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\n new Solver().Solve();\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex);\n#if DEBUG\n#else\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read / Write\n private static Queue currentLineTokens = new Queue();\n private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries); }\n public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }\n public static int ReadInt() { return int.Parse(ReadToken()); }\n public static long ReadLong() { return long.Parse(ReadToken()); }\n public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }\n public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }\n public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }\n public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }\n public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;\n }\n public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }\n public static void WriteArray(IEnumerable array) { writer.WriteLine(string.Join(\" \", array)); }\n public static void Write(params object[] array) { WriteArray(array); }\n public static void WriteLines(IEnumerable array) { foreach (var a in array)writer.WriteLine(a); }\n private class SDictionary : Dictionary\n {\n public new TValue this[TKey key]\n {\n get { return ContainsKey(key) ? base[key] : default(TValue); }\n set { base[key] = value; }\n }\n }\n private static T[] Init(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "abf5bd02af8439f29ad3b51d6966bcad", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "b3defe7bb4f9cd07a4a3f312046331d5", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.07587064676616916, "equal_cnt": 22, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 23, "bug_source_code": "#include \nint main()\n{\n long a,b,sum;\n int i,j;\n scanf(\"%ld%ld\",&a,&b);\n for(i=1;i GetIntList(int n)\n {\n var result = new List(n);\n for (int i = 0; i < n; i++)\n result.Add(NextInt());\n return result;\n }\n\n public int[] GetIntArray(int n)\n {\n var result = new int[n];\n for (int i = 0; i < n; i++)\n result[i] = (NextInt());\n return result;\n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "39590413f63ae3f88181209226389940", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "128a2d025300fefa75594a1e41cdb179", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.16380153738644304, "equal_cnt": 71, "replace_cnt": 49, "delete_cnt": 9, "insert_cnt": 13, "fix_ops_cnt": 71, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Contest\n{\n\n class HashMap : Dictionary\n {\n new public V this[K i]\n {\n get\n {\n V v;\n return TryGetValue(i, out v) ? v : base[i] = default(V);\n }\n set { base[i] = value; }\n }\n }\n\n class Program\n {\n private Scanner sc;\n private HashSet Hs;\n\n private bool[] B;\n private int N, K;\n private string S;\n private long ans = 0;\n public void Solve()\n {\n sc = new Scanner();\n N = sc.NextInt();\n K = sc.NextInt();\n S = sc.Next();\n B = new bool[N];\n Hs = new HashSet();\n for (int i = 0; i <= N; i++)\n {\n Search(0, i);\n if (Hs.Count >= K)\n {\n Console.WriteLine(ans);\n return;\n }\n }\n\n Console.WriteLine(-1);\n }\n\n private void Search(int i, int n)\n {\n if (Hs.Count >= K)\n return;\n\n if (N - i < n) return;\n if (N == i && n == 0)\n {\n string s = \"\";\n for (int j = 0; j < N; j++)\n {\n if (B[j]) s += S[j];\n }\n //Console.WriteLine(s);\n if (Hs.Add(s))\n {\n ans += S.Length - s.Length;\n //Console.WriteLine($\"\\\"{s}\\\"\");\n }\n return;\n }\n\n if (n > 0)\n {\n B[i] = false;\n Search(i + 1, n - 1);\n }\n\n B[i] = true;\n Search(i + 1, n);\n }\n\n static void Main() => new Program().Solve();\n }\n}\n\nclass Scanner\n{\n public Scanner()\n {\n _stream = new StreamReader(Console.OpenStandardInput());\n _pos = 0;\n _line = new string[0];\n _separator = ' ';\n }\n private readonly char _separator;\n private readonly StreamReader _stream;\n private int _pos;\n private string[] _line;\n #region get a element\n public string Next()\n {\n if (_pos >= _line.Length)\n {\n _line = _stream.ReadLine().Split(_separator);\n _pos = 0;\n }\n return _line[_pos++];\n }\n public int NextInt()\n {\n return int.Parse(Next());\n }\n public long NextLong()\n {\n return long.Parse(Next());\n }\n public double NextDouble()\n {\n return double.Parse(Next());\n }\n #endregion\n #region convert array\n private int[] ToIntArray(string[] array)\n {\n var result = new int[array.Length];\n for (int i = 0; i < array.Length; i++)\n {\n result[i] = int.Parse(array[i]);\n }\n\n return result;\n }\n private long[] ToLongArray(string[] array)\n {\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n {\n result[i] = long.Parse(array[i]);\n }\n\n return result;\n }\n private double[] ToDoubleArray(string[] array)\n {\n var result = new double[array.Length];\n for (int i = 0; i < array.Length; i++)\n {\n result[i] = double.Parse(array[i]);\n }\n\n return result;\n }\n #endregion\n #region get array\n public string[] Array()\n {\n if (_pos >= _line.Length)\n _line = _stream.ReadLine().Split(_separator);\n _pos = _line.Length;\n return _line;\n }\n public int[] IntArray()\n {\n return ToIntArray(Array());\n }\n public long[] LongArray()\n {\n return ToLongArray(Array());\n }\n public double[] DoubleArray()\n {\n return ToDoubleArray(Array());\n }\n #endregion\n}", "lang": "Mono C#", "bug_code_uid": "e1f3fa4861f4573031577ecd5efbce47", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "de17e1d3099dfb4336b65c1be1052f6c", "difficulty": 2000, "tags": ["graphs", "dp", "implementation", "shortest paths"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9287458379578246, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "// A Dynamic Programming based \n// C# program to find minimum \n// number operations to \n// convert str1 to str2 \nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nclass Lap\n{\n public int P;\n public int Q;\n\n}\nclass GFG\n{\n static string[] memo = new string[13];\n\n public static void Main()\n {\n ///var t = int.Parse(Console.ReadLine());\n\n ////while (t > 0)\n //{\n // // t--;\n var n = int.Parse(Console.ReadLine());\n // //var arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n //var input = Console.ReadLine().Split();\n //var n = int.Parse(input[0]);\n //var m = int.Parse(input[1]);\n // //var k = int.Parse(input[2]);\n // \n //var input = Console.ReadLine().Split(' ');\n //var n = int.Parse(input[0]);\n //var a = int.Parse(input[1]);\n //var b = int.Parse(input[2]);\n //var c = int.Parse(input[3]);\n\n List x = new List();\n List y = new List();\n for (int i = 0; i < n; i++)\n {\n var arr = Console.ReadLine().Split(' ').Select(xx => int.Parse(xx)).ToArray();\n x.Add(arr[0]);\n y.Add(arr[1]);\n }\n int sumx = x.Sum();\n int sumy = y.Sum();\n\n if (sumx % 2 == 0 && sumy % 2 == 0)\n {\n Console.Write(\"0\");\n return;\n }\n\n if (x.Count == 1 && y.Count == 1)\n {\n Console.Write(\"-1\");\n return;\n }\n\n if (sumx % 2 == 0 && sumy % 2 == 0)\n Console.Write(\"0\");\n else if (sumx % 2 == 0 && sumy % 2 != 0)\n Console.Write(\"-1\");\n else if (sumy % 2 == 0 && sumx % 2 != 0)\n Console.Write(\"-1\");\n\n if (sumx % 2 != 0 && sumy % 2 != 0)\n {\n for (int i = 0; i < n; i++)\n {\n if (Math.Abs(x[i] + y[i]) % 2 != 0)\n {\n\n Console.Write(\"1\");\n return;\n\n }\n else\n {\n Console.Write(\"-1\");\n return;\n }\n }\n }\n\n\n\n }\n}\n}\n\n \n\n\n\n", "lang": "Mono C#", "bug_code_uid": "cfdbc01868f53056abb731a7facee1f6", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "b9c16b41f76f1c9b331ce62afa99a729", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9853045745437308, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Threading;\n\nnamespace Codeforces13012019\n{\n class Solution\n {\n static void Main()\n {\n new Thread(new Solution().run, 64 * 1024 * 1024).Start();\n }\n\n private int n;\n private int k;\n private int[] vkl;\n private int result;\n private int[] diff;\n private int sum;\n\n void ReadData()\n {\n n = NextInt();\n k = NextInt();\n vkl = new int[n];\n for (int i = 0; i < n; i++)\n vkl[i] = NextInt();\n diff = new int[n];\n }\n\n\n void Solve()\n {\n int i = 0;\n for (; i < n; i++)\n {\n sum += vkl[i];\n }\n\n i = 0;\n for (; i < k; i++)\n {\n int result = sum;\n for (int j = i; j < n; j+=k)\n {\n result -= vkl[j];\n }\n\n diff[i] = result;\n }\n\n \n for (; i < n; i++)\n {\n diff[i] = diff[i - k] + vkl[i];\n }\n\n for (i = 0; i < n; ++i)\n {\n result = Math.Max(Math.Abs(diff[i]), result);\n }\n }\n\n void WriteAnswer()\n {\n _outputStream.WriteLine(result);\n }\n\n #region service\n\n void run()\n {\n //_inputStream = new StreamReader(File.OpenRead(@\"D:\\Codeforces\\lazy_loading.txt\"));\n //_outputStream = new StreamWriter(File.OpenWrite(@\"D:\\Codeforces\\lazy_loading_out.txt\"));\n\n //_inputStream = new StreamReader(File.OpenRead(@\"D:\\Facebook\\lazyloading.in\"));\n\n _inputStream = Console.In;\n _outputStream = Console.Out;\n\n\n //int testsCount = int.Parse(_inputStream.ReadLine());\n int testsCount = 1;\n var solvers = new Solution[testsCount];\n for (int i = 0; i < testsCount; ++i)\n {\n solvers[i] = new Solution();\n solvers[i].ReadData();\n }\n\n int done = 0;\n for (int i = 0; i < testsCount; ++i)\n {\n solvers[i].Solve();\n Console.Title = (++done).ToString() + \" of \" + testsCount;\n }\n for (int i = 0; i < testsCount; ++i)\n {\n //Out.Write(string.Format(\"Case #{0}: \", i + 1));\n solvers[i].WriteAnswer();\n }\n Out.Flush();\n Out.Close();\n }\n\n static TextWriter Out { get { return _outputStream; } }\n\n private static TextReader _inputStream;\n private static TextWriter _outputStream;\n\n public double NextDouble()\n {\n var token = NextToken();\n if (string.IsNullOrEmpty(token)) throw new ApplicationException(\"Input data missing\");\n return double.Parse(token, CultureInfo.InvariantCulture);\n }\n\n public long NextLong()\n {\n var token = NextToken();\n if (string.IsNullOrEmpty(token)) throw new ApplicationException(\"Input data missing\");\n return long.Parse(token);\n }\n\n public int NextInt()\n {\n var token = NextToken();\n if (string.IsNullOrEmpty(token)) throw new ApplicationException(\"Input data missing\");\n return int.Parse(token);\n }\n\n private static readonly Queue Tokens = new Queue();\n public string NextToken()\n {\n if (Tokens.Count > 0)\n {\n return Tokens.Dequeue();\n }\n while (Tokens.Count == 0)\n {\n var line = _inputStream.ReadLine();\n if (line == null) return null;\n foreach (var token in line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries))\n {\n Tokens.Enqueue(token);\n }\n }\n return Tokens.Count == 0 ? null : Tokens.Dequeue();\n }\n\n private readonly char[] _whiteSpaces = { ' ', '\\r', '\\n', '\\t' };\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d50834435bdc353e260b3dafe1ad9d02", "src_uid": "6119258322e06fa6146e592c63313df3", "apr_id": "549f6a7146740afbbbef80f35c4c8ae2", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.5391941391941392, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#define test\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing System.IO;\nusing System.Xml.Linq;\nusing System.Xml;\nusing System.Diagnostics;\nusing IFlowUtils;\nusing System.Data;\nusing ConsoleApplication5;\nnamespace ConsoleApplication7\n{\n\n\n\n class Program\n {\n public static void Main(string[] args)\n {\n int money = int.Parse(Console.ReadLine());\n int p1 = int.Parse(Console.ReadLine());\n int p2 = int.Parse(Console.ReadLine()) - int.Parse(Console.ReadLine());\n Console.WriteLine(money/Math.Min(p1,p2));\n } \n }\n}", "lang": "MS C#", "bug_code_uid": "9dc975dc9d6954ef4b30d5df941fb2d3", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "315376ebe0c413dc9895f7daa8763f2b", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.999652052887961, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\ufeffusing System;\nusing System.IO;\n\nusing Algorithms.Set_33;\n\nclass Solution\n{\n private class Tokenizer\n {\n private string currentString = null;\n\n private string[] tokens = null;\n\n private int tokenNumber = 0;\n\n private static readonly char[] Separators = { ' ' };\n\n public T NextToken(Func parser)\n {\n return parser(this.GetNextToken());\n }\n\n public string NextToken()\n {\n return this.GetNextToken();\n }\n\n public int NextInt()\n {\n return this.NextToken(int.Parse);\n }\n\n public long NextLong()\n {\n return this.NextToken(long.Parse);\n }\n\n private string GetNextToken()\n {\n if (this.currentString == null || this.tokenNumber == this.tokens.Length)\n {\n this.currentString = this.GetNextString();\n\n while (this.currentString != null && this.currentString.Equals(string.Empty))\n {\n this.currentString = this.GetNextString();\n }\n\n if (this.currentString == null)\n {\n throw new Exception(\"End of input\");\n }\n\n this.tokens = this.currentString.Split(Separators, StringSplitOptions.RemoveEmptyEntries);\n this.tokenNumber = 0;\n }\n\n return this.tokens[this.tokenNumber++];\n }\n\n private string GetNextString()\n {\n string content = Console.ReadLine();\n if (content == null)\n {\n return null;\n }\n\n return content.Trim();\n }\n }\n\n static void Main()\n {\n //Console.SetIn(new StreamReader(File.OpenRead(\"input.txt\")));\n //StreamWriter writer = new StreamWriter(File.Create(\"output.txt\"));\n //Console.SetOut(writer);\n\n Tokenizer tokenizer = new Tokenizer();\n long n = tokenizer.NextLong();\n long a = tokenizer.NextLong();\n long b = tokenizer.NextLong();\n long c = tokenizer.NextLong();\n\n Console.WriteLine(Guest.Solve(n, a, b, c));\n\n //writer.Close();\n }\n\n public class Guest\n {\n public static long Solve(long n, long a, long b, long c)\n {\n if (b - c > a || n < b)\n {\n return n / a;\n }\n\n long result = 0;\n long buffer;\n\n if (n >= b)\n {\n buffer = (n - b) / (b - c);\n result += buffer;\n n -= buffer * (b - c);\n }\n\n while (n >= b)\n {\n buffer = n / b;\n result += buffer;\n n = n - buffer * (b - c);\n }\n\n return result + n / Math.Min(a, b);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "170132f4b3c7ae56e81ef769c3ae430e", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "9c24b49b8d0cb9234048da514ca9db8f", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.980882864094543, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Linq;\nclass Solve{\n public Solve(){}\n StringBuilder sb;\n ReadData re;\n public static int Main(){\n new Solve().Run();\n return 0;\n }\n void Run(){\n sb = new StringBuilder();\n re = new ReadData();\n Calc();\n Console.Write(sb.ToString());\n }\n void Calc(){\n int N = re.i();\n int[] A = new int[N+2];\n for(int i=1;i<=N;i++){\n A[i] = re.i();\n }\n A[N+1] = 1001;\n N += 2;\n int count = 0;\n for(int i=1;i[] g(int N,int[] f,int[] t){\n List[] ans = new List[N];\n for(int j=0;j();\n }\n for(int j=0;j[] g(int N,int M){\n List[] ans = new List[N];\n for(int j=0;j();\n }\n for(int j=0;j[] g(){\n int N = i();\n int M = i();\n List[] ans = new List[N];\n for(int j=0;j();\n }\n for(int j=0;j();\n\n var d = 0;\n for (var i = 1; i < n-1; i++)\n if (A[i] == A[i-1] + 1 && A[i] == A[i+1] - 1) {\n d++;\n delIndex.Add(i);\n }\n\n if (n >= 2 && A[0] == 1 && A[1] == 2) {\n d++;\n delIndex.Add(0);\n }\n\n if (n >= 2 && A[n-2] == 999 && A[n-1] == 1000) {\n d++;\n delIndex.Add(n-1);\n }\n\n if (delIndex.Count == 0) {\n System.Console.WriteLine(0);\n return;\n }\n\n delIndex.Sort();\n\n // System.Console.WriteLine(\"del index = \" + string.Join(\" \", delIndex));\n\n var bestSize = 0;\n var size = 1;\n for (var i = 1; i < delIndex.Count; i++) {\n if (delIndex[i] == delIndex[i-1] + 1) {\n size++;\n }\n else {\n size = 1;\n }\n bestSize = Math.Max(size, bestSize);\n }\n\n System.Console.WriteLine(bestSize);\n }\n}\n\npublic static class Helpers {\n public static T[] CreateArray(int length, Func itemCreate) {\n var result = new T[length];\n for (var i = 0; i < result.Length; i++)\n result[i] = itemCreate(i);\n return result;\n }\n\n public static T ElementWithMax(this IEnumerable seq, Func func) {\n var bi = default(T);\n var bv = long.MinValue;\n foreach (var item in seq) {\n var v = func(item);\n if (v > bv) {\n bi = item;\n bv = v;\n }\n }\n return bi;\n }\n\n public static IEnumerable IndicesWhere(this IEnumerable seq, Func cond) {\n var i = 0;\n foreach (var item in seq) {\n if (cond(item)) yield return i;\n i++;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c53119c017c470f473bfdf74068106f8", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "01354f8736399b19401c3fc5ba93ae8a", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9961055819991346, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing Debug = System.Diagnostics.Debug;\nusing static System.Math;\nusing System.Runtime.CompilerServices;\nusing MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;\nusing MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;\n\npublic static class P\n{\n public static void Main()\n {\n var n = long.Parse(Console.ReadLine());\n var factors = PrimeFactors(n).Distinct().ToArray();\n if (factors.Length == 1)\n {\n Console.WriteLine(factors[0]);\n return;\n }\n Console.WriteLine(1);\n }\n static IEnumerable PrimeFactors(long n)\n {\n while ((n & 1) == 0)\n {\n n >>= 1;\n yield return 2;\n }\n for (int i = 3; i * i <= n; i += 2)\n {\n while (n % i == 0)\n {\n n /= i;\n yield return i;\n }\n }\n if (n != 1) yield return n;\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0142de281e19fa4b236e802bd05f99a0", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "8b15b18d908dea3558d6bbd221b0d2f1", "difficulty": 1500, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9994628194305886, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class Program : ProgramBase\n {\n private const long commonMod = 1000000007;\n\n static void Main(string[] args)\n {\n var p = new Program();\n var x = p.Get();\n p.Out(x);\n }\n\n object Get()\n {\n checked\n {\n var m = ReadLong();\n var res = Recurse(m);\n return res.Item1 + \" \" + res.Item2;\n }\n }\n\n Tuple Recurse(long m)\n {\n if (m < 8)\n return Tuple.Create(m, m);\n var root = MaxRoot(m);\n var cube = root * root * root;\n var lesserCube = (root - 1) * (root - 1) * (root - 1);\n var firstAns = Recurse(m - cube);\n var secondAns = Recurse(cube - 1 - lesserCube);\n return firstAns.Item1 >= secondAns.Item1\n ? Tuple.Create(firstAns.Item1 + 1, cube + firstAns.Item2)\n : Tuple.Create(secondAns.Item1 + 1, lesserCube + secondAns.Item2);\n\n }\n\n long MaxRoot(long x)\n {\n var root = (int) Math.Floor(Math.Pow(x, 1d / 3));\n if ((root + 1) * (root + 1) * (root + 1) <= x)\n root++;\n return root;\n }\n\n int Solve(string s1, string s2, int L, int m)\n {\n var diff = s1.Length + s2.Length - L;\n if (diff > 0)\n {\n if (s1.Substring(s1.Length - diff) == s2.Substring(0, diff))\n return 1 % m;\n else\n return 0;\n }\n else\n {\n return FastPow(26, Math.Abs(diff), m);\n }\n }\n\n public int FastPow(int b, int pow, int mod)\n {\n if (pow == 0)\n return 1 % mod;\n if (pow == 1)\n return b % mod;\n if ((pow & 1) == 0)\n return FastPow(b * b % mod, pow / 2, mod);\n return b * FastPow(b, pow - 1, mod) % mod;\n }\n \n class Automata\n {\n bool[] terminals;\n public int sigma;\n public int len;\n public int[,] jumps;\n\n public void Create()\n {\n var a = ReadInts();\n len = a[0];\n sigma = a[2];\n var ts = ReadInts();\n terminals = new bool[len];\n for (int i = 0; i < ts.Length; i++)\n terminals[ts[i]] = true;\n jumps = new int[len, sigma];\n for (int i = 0; i < len * sigma; i++)\n {\n var b = Console.ReadLine().Split(' ');\n jumps[Convert.ToInt32(b[0]), b[1][0] - 'a'] = Convert.ToInt32(b[2]);\n }\n }\n protected int[] ReadInts()\n {\n return Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n }\n\n public bool IsTerminal(int s)\n {\n return terminals[s];\n }\n }\n }\n\n abstract class ProgramBase\n {\n bool? prod = null;\n StreamReader f;\n protected string FileName { private get; set; }\n\n protected string Read()\n {\n if (f == null)\n f = string.IsNullOrEmpty(FileName)\n ? new StreamReader(Console.OpenStandardInput())\n : new StreamReader((GetProd() ? \"\" : \"c:\\\\dev\\\\\") + FileName);\n return f.ReadLine();\n }\n\n protected int ReadInt()\n {\n return int.Parse(Read());\n }\n\n protected int[] ReadInts()\n {\n var tokens = Read().Split(' ');\n var result = new int[tokens.Length];\n for (int i = 0; i < tokens.Length; i++)\n result[i] = int.Parse(tokens[i]);\n return result;\n }\n\n\n protected long ReadLong()\n {\n return Convert.ToInt64(Read());\n }\n\n protected long[] ReadLongs()\n {\n var tokens = Read().Split(' ');\n var result = new long[tokens.Length];\n for (int i = 0; i < tokens.Length; i++)\n result[i] = long.Parse(tokens[i]);\n return result;\n }\n\n public void Out(object r)\n {\n if (string.IsNullOrEmpty(FileName))\n Console.WriteLine(r);\n else if (GetProd())\n File.WriteAllText(FileName, r.ToString());\n else\n Console.WriteLine(r);\n }\n\n private bool GetProd()\n {\n\n if (!prod.HasValue)\n try\n {\n prod = Environment.MachineName != \"RENADEEN-W7\";\n }\n catch (Exception)\n {\n prod = true;\n }\n return prod.Value;\n }\n }\n\n public static class Huj\n {\n public static T MinBy(this IEnumerable source, Func func) where T : class\n {\n T result = null;\n var min = double.MaxValue;\n foreach (var item in source)\n {\n var current = func(item);\n if (min > current)\n {\n min = current;\n result = item;\n }\n }\n return result;\n }\n\n public static T MaxBy(this IEnumerable source, Func func, T defaultValue = default(T))\n {\n T result = defaultValue;\n var max = double.MinValue;\n foreach (var item in source)\n {\n var current = func(item);\n if (max < current)\n {\n max = current;\n result = item;\n }\n }\n return result;\n }\n\n public static string JoinStrings(this IEnumerable source, string delimeter)\n {\n return string.Join(delimeter, source.ToArray());\n }\n\n public static string JoinStrings(this IEnumerable source, string delimeter)\n {\n return source.Select(x => x.ToString()).JoinStrings(delimeter);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2e022dab7b63cf8250dbf92b90d81ec3", "src_uid": "385cf3c40c96f0879788b766eeb25139", "apr_id": "e4f53f23abcd31abbb082ae790779cf9", "difficulty": 2200, "tags": ["brute force", "constructive algorithms", "greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9862643906312029, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\nusing System.Globalization;\nusing System.Threading;\nusing System.Web.Script.Serialization;\nusing System.Numerics;\n\nclass Program\n{/*\n public class Point\n {\n public int X;\n public int Y;\n\n public Point(int x, int y)\n {\n this.X = x;\n this.Y = y;\n }\n\n public static Point operator +(Point a, Point b)\n {\n return new Point(a.X + b.X, a.Y + b.Y);\n }\n\n public static Point operator -(Point a, Point b)\n {\n return new Point(a.X - b.X, a.Y - b.Y);\n }\n\n public double Dist()\n {\n return Math.Sqrt(this.DistRoot());\n }\n\n public long DistRoot()\n {\n return this.X * (long)this.X + this.Y * (long)this.Y;\n }\n\n public override string ToString()\n {\n return this.X + \" \" + this.Y;\n }\n }\n\n public class Segment\n {\n public Point A;\n public Point B;\n\n public Segment(Point a, Point b)\n {\n this.A = a;\n this.B = b;\n }\n\n public double Dist()\n {\n return (this.A - this.B).Dist();\n }\n\n public long DistRoot()\n {\n return (this.A - this.B).DistRoot();\n }\n }\n\n private static Point ReadPoint()\n {\n return new Point(ReadInt(), ReadInt());\n }\n\n public static long ScalarProduct(Point a, Point b)\n {\n return a.X * (long)b.Y - b.X * (long)a.Y;\n }\n\n public static bool OnLine(Segment line, Point p)\n {\n var v1 = line.B - line.A;\n var v2 = p - line.A;\n\n if (v2.X == 0 && v2.Y == 0) return true;\n if (v2.X == v1.X && v2.Y == v1.Y) return true;\n if (ScalarProduct(v1, v2) != 0) return false;\n\n if (v2.DistRoot() > v1.DistRoot()) return false;\n\n if (v1.X != 0 && v2.X != 0)\n {\n return (v1.X > 0) == (v2.X > 0);\n }\n\n if (v1.Y != 0 && v2.Y != 0)\n {\n return (v1.Y > 0) == (v2.Y > 0);\n }\n\n throw new NotSupportedException(\"wtf?\");\n }\n\n public static bool Crossed(Segment a, Segment b)\n {\n var sp1 = ScalarProduct(a.B - a.A, b.A - a.A);\n var sp2 = ScalarProduct(a.B - a.A, b.B - a.A);\n if (sp1 < 0 && sp2 < 0) return false;\n if (sp1 > 0 && sp2 > 0) return false;\n\n var sp3 = ScalarProduct(b.B - b.A, a.A - b.A);\n var sp4 = ScalarProduct(b.B - b.A, a.B - b.A);\n if (sp3 < 0 && sp4 < 0) return false;\n if (sp3 > 0 && sp4 > 0) return false;\n\n return true;\n }\n\n public static bool CrossedNoTouch(Segment a, Segment b)\n {\n var sp1 = ScalarProduct(a.B - a.A, b.A - a.A);\n var sp2 = ScalarProduct(a.B - a.A, b.B - a.A);\n if (sp1 <= 0 && sp2 <= 0) return false;\n if (sp1 >= 0 && sp2 >= 0) return false;\n\n var sp3 = ScalarProduct(b.B - b.A, a.A - b.A);\n var sp4 = ScalarProduct(b.B - b.A, a.B - b.A);\n if (sp3 <= 0 && sp4 <= 0) return false;\n if (sp3 >= 0 && sp4 >= 0) return false;\n\n return true;\n }\n\n private static double Solve(Point s, Point t, Point a, Point b, Point c)\n {\n var st = new Segment(s, t);\n var ab = new Segment(a, b);\n var bc = new Segment(b, c);\n var ac = new Segment(a, c);\n\n\n if (ScalarProduct(b - a, c - a) == 0)\n {\n var q = ab;\n if (q.Dist() < bc.Dist()) q = bc;\n if (q.Dist() < ac.Dist()) q = ac;\n\n if (Crossed(q, st))\n {\n var d1 = (q.A - s).Dist() + (q.A - t).Dist();\n var d2 = (q.B - s).Dist() + (q.B - t).Dist();\n return Math.Min(d1, d2);\n }\n\n return (s - t).Dist();\n }\n\n if (!Crossed(ab, st) && !Crossed(bc, st))\n {\n return (s - t).Dist();\n }\n\n p[0] = s;\n p[1] = t;\n p[2] = a;\n p[3] = b;\n p[4] = c;\n\n for (int i = 0; i < d.Length; i++) d[i] = 1e10;\n\n Go(0, 0);\n\n return d[1];\n }\n\n private static Point[] p = new Point[5];\n private static double[] d = new double[5];\n private static void Go(int pos, double dist)\n {\n if (d[pos] < dist) return;\n d[pos] = dist;\n if (pos == 1) return;\n\n\n }*/\n\n private static void Main(string[] args)\n {\n /*\n PushTestData(@\"\n1\n0 0 0 10 -10 20 0 1 10 20\n0 0 0 10 -10 20 1 1 10 20\n0 0 0 10 -10 20 -1 1 10 20\n\n0 0 0 10 -10 1 0 1 10 1\n0 0 0 10 -10 1 1 1 10 1\n0 0 0 10 -10 1 -1 1 10 1\n\n\n\n\n\n\");\n\n int n = ReadInt();\n double[] answer = new double[n];\n for (int i = 0; i < n; i++)\n {\n var s = ReadPoint();\n var t = ReadPoint();\n var a = ReadPoint();\n var b = ReadPoint();\n var c = ReadPoint();\n\n answer[i] = Solve(s, t, a, b, c);\n }\n\n Console.WriteLine(string.Join(Environment.NewLine, answer));*/\n\n\n long x = ReadLong();\n var ans = GetGreedy(x);\n\n for (int i = ans.Count - 1; i >= 0; i--)\n {\n while (true)\n {\n ans[i]++;\n if (!IsValid(ans, x))\n {\n ans[i]--;\n break;\n }\n }\n }\n\n Console.WriteLine(ans.Count + \" \" + SumSqr3(ans));\n }\n\n private static long SumSqr3(List m)\n {\n long ans = 0;\n foreach (var x in m) ans += Sqr3(x);\n return ans;\n }\n\n private static bool IsValid(List m, long maxSum)\n {\n var sm = SumSqr3(m);\n if (sm > maxSum) return false;\n\n var gr = BuildGreedy(sm);\n if (gr.Count != m.Count)\n return false;\n\n gr.Reverse();\n for (int i = 0; i < m.Count; i++)\n if (gr[i] != m[i])\n return false;\n\n return true;\n }\n\n private static List GetGreedy(long x)\n {\n long p = 1;\n long total = 0;\n List values = new List();\n while (total + Sqr3(p) <= x)\n {\n if (total + Sqr3(p) < Sqr3(p + 1))\n {\n total += Sqr3(p);\n values.Add(p);\n }\n else p++;\n }\n\n return values;\n }\n\n private static long Sqr3(long x)\n {\n return x * x * x;\n }\n private static long Sqrt3(long x)\n {\n long min = 0;\n long max = Math.Min(100002, x);\n while (max - min > 1)\n {\n long mid = (max + min) / 2;\n if (mid * mid * mid <= x)\n min = mid;\n else\n max = mid;\n }\n\n return min;\n }\n\n private static List BuildGreedy(long x)\n {\n long ep = Math.Min(100001, x);\n List ans = new List();\n while (x > 0)\n {\n while (x > 0 && x >= ep * ep * ep)\n {\n ans.Add(ep);\n x -= ep * ep * ep;\n }\n ep--;\n }\n\n return ans;\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < n; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = ReadInt() - 1;\n int b = ReadInt() - 1;\n\n g[a].Add(b);\n g[b].Add(a);\n }\n\n return g;\n }\n\n private static int[,] ReadGraphAsMatrix(int n, int m)\n {\n int[,] matrix = new int[n + 1, n + 1];\n for (int i = 0; i < m; i++)\n {\n int a = ReadInt();\n int b = ReadInt();\n matrix[a, b] = matrix[b, a] = 1;\n }\n\n return matrix;\n }\n\n private static void Sort(ref int a, ref int b)\n {\n if (a > b) Swap(ref a, ref b);\n }\n\n private static void Swap(ref int a, ref int b)\n {\n int tmp = a;\n a = b;\n b = tmp;\n }\n\n private const int BufferSize = 1 << 16;\n private static StreamReader consoleReader;\n private static MemoryStream testData;\n\n private static int ReadInt()\n {\n int ans = 0;\n int mul = 1;\n do\n {\n ans = consoleReader.Read();\n if (ans == -1)\n return 0;\n if (ans == '-') mul = -1;\n } while (ans < '0' || ans > '9');\n\n ans -= '0';\n while (true)\n {\n int chr = consoleReader.Read();\n if (chr < '0' || chr > '9')\n return ans * mul;\n ans = ans * 10 + chr - '0';\n }\n }\n\n private static ulong ReadULong()\n {\n ulong ans = 0;\n int chr;\n do\n {\n chr = consoleReader.Read();\n if (chr == -1)\n return 0;\n } while (chr < '0' || chr > '9');\n\n ans = (uint)(chr - '0');\n while (true)\n {\n chr = consoleReader.Read();\n if (chr < '0' || chr > '9')\n return ans;\n ans = ans * 10 + (uint)(chr - '0');\n }\n }\n\n private static long ReadLong()\n {\n long ans = 0;\n int mul = 1;\n do\n {\n ans = consoleReader.Read();\n if (ans == -1)\n return 0;\n if (ans == '-') mul = -1;\n } while (ans < '0' || ans > '9');\n\n ans -= '0';\n while (true)\n {\n int chr = consoleReader.Read();\n if (chr < '0' || chr > '9')\n return ans * mul;\n ans = ans * 10 + chr - '0';\n }\n }\n\n private static int[] ReadIntArray(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = ReadInt();\n return ans;\n }\n\n private static long[] ReadLongArray(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = ReadLong();\n return ans;\n }\n\n private static char[] ReadString()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));\n\n List s = new List();\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));\n\n return s.ToArray();\n }\n\n private static char[] ReadString(int n)\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));\n\n char[] s = new char[n];\n int pos = 0;\n do\n {\n s[pos++] = (char)ans;\n if (pos == n) break;\n ans = consoleReader.Read();\n } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));\n\n return s;\n }\n\n private static char ReadLetter()\n {\n while (true)\n {\n int ans = consoleReader.Read();\n if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))\n return (char)ans;\n }\n }\n\n private static char ReadDigit()\n {\n while (true)\n {\n int ans = consoleReader.Read();\n if (ans >= '0' && ans <= '9')\n return (char)ans;\n }\n }\n\n private static int ReadDigitInt()\n {\n return ReadDigit() - (int)'0';\n }\n\n private static char ReadAnyChar()\n {\n return (char)consoleReader.Read();\n }\n\n private static string DoubleToString(double x)\n {\n return x.ToString(CultureInfo.InvariantCulture);\n }\n\n static Program()\n {\n //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);\n }\n\n private static void PushTestData(string data)\n {\n#if !ONLINE_JUDGE\n if (testData == null)\n {\n testData = new MemoryStream();\n consoleReader = new StreamReader(testData);\n }\n\n var pos = testData.Position;\n var bytes = Encoding.UTF8.GetBytes(data);\n testData.Write(bytes, 0, bytes.Length);\n testData.Flush();\n testData.Position = pos;\n#endif\n }\n}", "lang": "MS C#", "bug_code_uid": "a5c9f88055750f758aa2108c5052d263", "src_uid": "385cf3c40c96f0879788b766eeb25139", "apr_id": "9ebe88525517caa2ca3daada7ce63085", "difficulty": 2200, "tags": ["brute force", "constructive algorithms", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.4858792323295366, "equal_cnt": 70, "replace_cnt": 43, "delete_cnt": 12, "insert_cnt": 15, "fix_ops_cnt": 70, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R318.E\n{\n public static class Solver\n {\n public static void Main()\n {\n using (var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })\n {\n Solve(Console.In, sw);\n }\n }\n\n public static void Solve(TextReader tr, TextWriter tw)\n {\n WriteAnswer(tw, Parse(tr));\n }\n\n private static void WriteAnswer(TextWriter tw, (int, int, int)[] res)\n {\n if (res == null)\n {\n tw.WriteLine(\"NO\");\n return;\n }\n\n tw.WriteLine(res.Length);\n\n foreach (var t in res)\n {\n tw.WriteLine(\"{0} {1} {2}\", t.Item1 + 1, t.Item2 + 1, t.Item3);\n }\n }\n\n private static (int, int, int)[] Parse(TextReader tr)\n {\n var w = tr.ReadLine().Split();\n var v = int.Parse(w[1]);\n var e = int.Parse(w[2]);\n\n var a = from x in tr.ReadLine().Split() select int.Parse(x);\n var b = from x in tr.ReadLine().Split() select int.Parse(x);\n\n var edges = new (int, int)[e];\n for (int i = 0; i < e; ++i)\n {\n var l = tr.ReadLine().Split();\n edges[i] = (int.Parse(l[0]) - 1, int.Parse(l[1]) - 1);\n }\n\n return Calc(a.ToArray(), b.ToArray(), edges, v);\n }\n\n public static (int, int, int)[] Calc(int[] a, int[] b, (int, int)[] edges, int v)\n {\n var n = a.Length;\n var mat = new (int, int)[n, n];\n for (int i = 0; i < n; ++i)\n {\n for (int j = 0; j < n; ++j)\n {\n mat[i, j] = i == j ? (0, j) : (9999, j);\n }\n }\n\n foreach (var edge in edges)\n {\n mat[edge.Item1, edge.Item2] = (1, edge.Item1);\n mat[edge.Item2, edge.Item1] = (1, edge.Item2);\n }\n\n for (int i = 0; i < n; ++i)\n {\n for (int j = 0; j < n; ++j)\n {\n for (int k = 0; k < n; ++k)\n {\n if (mat[i, k].Item1 + mat[k, j].Item1 < mat[i, j].Item1)\n {\n mat[i, j] = (mat[i, k].Item1 + mat[k, j].Item1, mat[k, j].Item2);\n }\n }\n }\n }\n\n List<(int, int, int)> res = Execute(a, b, n, mat);\n\n if (!a.SequenceEqual(b))\n {\n return null;\n }\n\n return res.ToArray();\n }\n\n public static (int, int, int)[] Calc0(int[] a, int[] b, (int, int)[] edges, int v)\n {\n var n = a.Length;\n var mat = new (int, int)[n, n];\n for (int i = 0; i < n; ++i)\n {\n for (int j = 0; j < n; ++j)\n {\n mat[i, j] = i == j ? (0, j) : (9999, j);\n }\n }\n\n foreach (var edge in edges)\n {\n mat[edge.Item1, edge.Item2] = (1, edge.Item1);\n mat[edge.Item2, edge.Item1] = (1, edge.Item2);\n }\n\n for (int i = 0; i < n; ++i)\n {\n for (int j = 0; j < n; ++j)\n {\n for (int k = 0; k < n; ++k)\n {\n if (mat[i, k].Item1 + mat[k, j].Item1 < mat[i, j].Item1)\n {\n mat[i, j].Item1 = mat[i, k].Item1 + mat[k, j].Item1;\n mat[i, j].Item2 = k;\n }\n }\n }\n }\n\n List<(int, int, int)> res = Execute(a, b, n, mat, v);\n\n if (!a.SequenceEqual(b))\n {\n return null;\n }\n\n return res.ToArray();\n }\n\n public static List<(int, int, int)> Execute(int[] a, int[] b, int n, (int, int)[,] mat)\n {\n var res = new List<(int, int, int)>();\n\n for (; ; )\n {\n var prev = res.Count;\n for (int i = 0; i < n; ++i)\n {\n if (a[i] > b[i])\n {\n for (int j = 0; j < n; ++j)\n {\n if (a[j] < b[j])\n {\n if (mat[i, j].Item1 > n)\n {\n continue;\n }\n res.AddRange(Pour(mat, a, b, i, j, Math.Min(a[i] - b[i], b[j] - a[j])));\n }\n }\n }\n }\n if (prev == res.Count)\n {\n break;\n }\n }\n\n return res;\n }\n\n public static List<(int, int, int)> Execute(int[] a, int[] b, int n, (int, int)[,] mat, int v)\n {\n var R = new List<(int, int, int)>();\n for (int x = 0; x < n; ++x)\n {\n for (int y = 0; y < n; ++y)\n {\n if (mat[x, y].Item1 > n)\n continue;\n var j = Math.Min(a[x] - b[x], b[y] - a[y]);\n if (j <= 0) continue;\n Flow(x, y, j, mat, a, v, R);\n }\n }\n return R;\n }\n\n\n private static void Flow(int s, int t, int d, (int, int)[,] mat, int[] A, int V, List<(int, int, int)> R)\n {\n var N = mat.GetLength(0);\n\n var P = new List();\n P.Add(s);\n\n for (var i = s; i != t;)\n {\n int y = 0;\n for (; y < N; ++y)\n if (mat[i, y].Item1 == 1 && mat[y, t].Item1 == mat[i, t].Item1 - 1)\n break;\n P.Add(i = y);\n }\n\n Flow2(P, A, 0, P.Count - 1, d, V, R);\n }\n\n private static void Flow2(List P, int[] A, int si, int ti, int d, int V, List<(int, int, int)> R)\n {\n int i;\n if (si == ti) return;\n if (A[P[si + 1]] + d <= V)\n {\n A[P[si]] -= d;\n A[P[si + 1]] += d;\n R.Add((P[si], P[si + 1], d));\n Flow2(P, A, si + 1, ti, d, V, R);\n }\n else\n {\n int d2 = V - A[P[si + 1]];\n A[P[si]] -= d2;\n A[P[si + 1]] += d2;\n if (d2 > 0) R.Add((P[si], P[si + 1], d2));\n Flow2(P, A, si + 1, ti, d, V, R);\n A[P[si]] -= d - d2;\n A[P[si + 1]] += d - d2;\n R.Add((P[si], P[si + 1], d - d2));\n }\n }\n\n static Dictionary> memo = new Dictionary>();\n\n private static List<(int, int, int)> Pour((int, int)[,] g, int[] a, int[] b, int from, int to, int d)\n {\n var key = CreateKey(from, to, d);\n if (memo.ContainsKey(key))\n {\n return memo[key];\n }\n\n var res = new List<(int, int, int)>();\n\n var prev = g[from, to].Item2;\n\n var p = Math.Min(a[prev], d);\n if (p > 0)\n {\n a[prev] -= p;\n a[to] += p;\n res.Add((prev, to, d));\n }\n\n if (prev != from)\n {\n res.AddRange(Pour(g, a, b, from, prev, d));\n }\n\n return memo[key] = res;\n }\n\n private static int CreateKey(int from, int to, int d)\n {\n return (d * 300 + to) * 300 + from;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e9d72f65975427ee8ea90e1d04b573e9", "src_uid": "0939354d9bad8301efb79a1a934ded30", "apr_id": "3e5ceff162b5e8e901d52101a9275e87", "difficulty": 2500, "tags": ["dfs and similar", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8738645747316267, "equal_cnt": 40, "replace_cnt": 17, "delete_cnt": 14, "insert_cnt": 8, "fix_ops_cnt": 39, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R318.E\n{\n public static class Solver\n {\n public static void Main()\n {\n using (var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })\n {\n Solve(Console.In, sw);\n }\n }\n\n public static void Solve(TextReader tr, TextWriter tw)\n {\n WriteAnswer(tw, Parse(tr));\n }\n\n private static void WriteAnswer(TextWriter tw, long[] res)\n {\n if (res == null)\n {\n tw.WriteLine(\"NO\");\n return;\n }\n\n tw.WriteLine(res.Length);\n\n foreach (var t in res)\n {\n var prev = t & ((1 << 16) - 1);\n var to = (t >> 16) & ((1 << 16) - 1);\n var d = t >> 32;\n tw.WriteLine(\"{0} {1} {2}\", prev + 1, to + 1, d);\n }\n }\n\n private static long[] Parse(TextReader tr)\n {\n var w = tr.ReadLine().Split();\n var e = int.Parse(w[2]);\n\n var a = from x in tr.ReadLine().Split() select int.Parse(x);\n var b = from x in tr.ReadLine().Split() select int.Parse(x);\n\n var edges = new (int, int)[e];\n for (int i = 0; i < e; ++i)\n {\n var l = tr.ReadLine().Split();\n edges[i] = (int.Parse(l[0]) - 1, int.Parse(l[1]) - 1);\n }\n\n return Calc(a.ToArray(), b.ToArray(), edges);\n }\n\n public static long[] Calc(int[] a, int[] b, (int, int)[] edges)\n {\n var n = a.Length;\n var mat = new (int, int)[n, n];\n for (int i = 0; i < n; ++i)\n {\n for (int j = 0; j < n; ++j)\n {\n mat[i, j] = i == j ? (0, j) : (9999, j);\n }\n }\n\n foreach (var edge in edges)\n {\n mat[edge.Item1, edge.Item2] = (1, edge.Item1);\n mat[edge.Item2, edge.Item1] = (1, edge.Item2);\n }\n\n for (int i = 0; i < n; ++i)\n {\n for (int j = 0; j < n; ++j)\n {\n for (int k = 0; k < n; ++k)\n {\n if (mat[i, k].Item1 + mat[k, j].Item1 < mat[i, j].Item1)\n {\n mat[i, j] = (mat[i, k].Item1 + mat[k, j].Item1, mat[k, j].Item2);\n }\n }\n }\n }\n\n var res = Execute(a, b, mat);\n\n if (!a.SequenceEqual(b))\n {\n return null;\n }\n\n return res.ToArray();\n }\n\n public static List Execute(int[] a, int[] b, (int, int)[,] mat)\n {\n var calculator = new Calculator(a, b, mat);\n return calculator.Solve();\n }\n }\n\n internal class Calculator\n {\n List res = new List();\n int[] a;\n int[] b;\n (int, int)[,] mat;\n\n public Calculator(int[] a, int[] b, (int, int)[,] mat)\n {\n this.a = a;\n this.b = b;\n this.mat = mat;\n }\n\n public List Solve()\n {\n var n = a.Length;\n for (; ; )\n {\n var prev = res.Count;\n for (int i = 0; i < n; ++i)\n {\n if (a[i] > b[i])\n {\n for (int j = 0; j < n; ++j)\n {\n if (a[j] < b[j])\n {\n if (mat[i, j].Item1 > n)\n {\n continue;\n }\n Pour(i, j, Math.Min(a[i] - b[i], b[j] - a[j]));\n }\n }\n }\n }\n if (prev == res.Count)\n {\n break;\n }\n }\n\n return res;\n }\n\n private void Pour(int from, int to, int d)\n {\n for (; ; )\n {\n var prev = mat[from, to].Item2;\n\n var p = Math.Min(a[prev], d);\n if (p > 0)\n {\n a[prev] -= p;\n a[to] += p;\n res.Add(CreateKey(prev, to, p));\n }\n if (prev == from)\n {\n break;\n }\n to = prev;\n }\n }\n\n private long CreateKey(long prev, long to, long d)\n {\n return (d << 32) + (to << 16) + prev;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5cd7070231c125db3facbae6f60d4598", "src_uid": "0939354d9bad8301efb79a1a934ded30", "apr_id": "3e5ceff162b5e8e901d52101a9275e87", "difficulty": 2500, "tags": ["dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9991823385118561, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nnamespace codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int count = int.Parse(Console.ReadLine());\n int rez = count, max = count;\n while (count != 1)\n {\n for (int i = 2; i < max; i++)\n {\n if (count % i == 0)\n {\n count /= i;\n rez += count;\n break;\n }\n }\n }\n Console.WriteLine(rez);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "29dec4222dbeb209dbc9ea4a4dba4c81", "src_uid": "821c0e3b5fad197a47878bba5e520b6e", "apr_id": "9f1254aa0d083f634575d1f0b1dce954", "difficulty": 1000, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.7740307409956412, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "\ufeffusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Codeforces._20120421\n{\n public class Eratosthenes : IEnumerable\n {\n private readonly List knownPrimes;\n\n public Eratosthenes()\n {\n knownPrimes = new List { 2, 3 };\n }\n\n public IEnumerator GetEnumerator()\n {\n foreach (var prime in knownPrimes)\n yield return prime;\n\n var possible = knownPrimes.Last();\n while (true)\n if (IsPrime(possible += 2))\n {\n yield return possible;\n knownPrimes.Add(possible);\n }\n }\n\n IEnumerator IEnumerable.GetEnumerator()\n {\n return GetEnumerator();\n }\n\n private bool IsPrime(ulong value)\n {\n var sqrt = (ulong)Math.Sqrt(value);\n return !knownPrimes\n .TakeWhile(x => x <= sqrt)\n .Any(x => value % x == 0);\n }\n }\n\n public class B\n {\n public static void Main()\n {\n var primes = new Eratosthenes().Take(50847534);\n\n ulong n = ulong.Parse(Console.ReadLine());\n\n ulong ret = n;\n\n while (n != 1)\n {\n foreach (var prime in primes)\n {\n if (n % prime == 0)\n {\n n /= prime;\n ret += n;\n break;\n }\n if (prime > n)\n {\n ret++;\n n = 1;\n }\n }\n }\n\n Console.WriteLine(ret);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d2d439e774f324fd68db0e89ab78b7bb", "src_uid": "821c0e3b5fad197a47878bba5e520b6e", "apr_id": "8285fc23867774d456e975af4003efe1", "difficulty": 1200, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9597069597069597, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\ufeffusing System;\n\nnamespace ProjectContest\n{\n class Test\n {\n static void Main()\n {\n int n = Convert.ToInt32(Console.ReadLine());\n if (n % 2 == 0) Console.WriteLine(n);\n else Console.WriteLine(n - 1);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "fde9d85d041e8b3c37ef6406ca0c78ed", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "ca312a59baff1c00eb244778307202ca", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9593023255813954, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "class Program{\n static void Main(){\n var n = Int32.Parse(Console.ReadLine());\n Console.WriteLine(n % 2 == 0 ? (long)Math.Pow(2, n / 2) : 0);\n }\n}", "lang": "Mono C#", "bug_code_uid": "6d363b17a4a7164392d53d34cb0345eb", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "20d558447e7ccdaf92360aa052bc409b", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9902552204176334, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace CodeForce\n{\n class _118A_StringTask\n {\n void StringTask()\n {\n string input = Console.ReadLine();\n\n foreach(char c in input)\n {\n switch ((int)c)\n {\n case 65:\n case 69:\n case 73:\n case 79:\n case 85:\n case 89:\n case 97:\n case 101:\n case 105:\n case 111:\n case 117:\n case 121:\n break;\n default:\n Console.Write('.');\n if(c >= 65 && c <= 90)\n {\n Console.Write((char)(c + 32));\n }\n else\n {\n Console.Write(c);\n }\n break;\n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "50e36b57c6944dc85babcd1e4625e1a7", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "9f327b711d936c98625dedb284877c0e", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.4590495449949444, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n int m =int.Parse (Console.ReadLine());\n int n = int.Parse(Console.ReadLine());\n int k = n * m; \n if(k % 2 == 0)\n {\n Console.WriteLine(k / 2);\n }else{\n int v = k % 2\n k = k - v \n Console.WriteLine(k / 2);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2dd3550e629b39575f77072abed227d1", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "72293a6673170a5d948edb98806c09ab", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.8974277548428072, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n \n int n=int.Parse(Console.ReadLine());\n char[]c=new char[3];\n if(n%4==1)\n c[0]='A';\n else if(n%4==3)\n c[0]='B';\n else if(n%4==2)\n c[0]='C';\n else if(n%4==0)\n c[0]='D';\n \n \n if((n+1)%4==1)\n c[1]='A';\n else if((n+1)%4==3)\n c[1]='B';\n else if((n+1)%4==2)\n c[1]='C';\n else if((n+1)%4==0)\n c[1]='D';\n \n \n if((n+2)%4==1)\n c[2]='A';\n else if((n+2)%4==3)\n c[2]='B';\n else if((n+2)%4==2)\n c[2]='C';\n else if((n+2)%4==0)\n c[2]='D';\n \n \n \n string alph=\"ABCD\";\n \n int min=999999;\n for(int i=0;i<3;i++)\n {\n if(alph.Contains(c[i]))\n min=Math.Min(alph.IndexOf(c[i]),min);\n }\n Console.WriteLine(\"{0} {1}\",min+1,alph[min]);\n //Console.WriteLine(alph.IndexOf(c[1]));\n \n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b6191d54242bddbb7150f9d5f2c1da12", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "f9bb6bf4ffba5dbe9508d731d3d561e5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9860982391102873, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int hp = n % 4;\n if (hp == 0) Console.WriteLine(1 + \" A\");\n else if (hp == 1) Console.WriteLine(0 + \" A\");\n else if (hp == 2) Console.WriteLine(1 + \" B\");\n else if (hp == 3) Console.WriteLine(2 + \" A\"); \n }\n }", "lang": "Mono C#", "bug_code_uid": "823cbcf61ccde70dc799feee327a474b", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "f83c757004a002e5598eaca1e4912176", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.33515881708652795, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "class Program\n {\n static void Main(string[] args)\n {\n String s = Console.ReadLine();\n if (s.Contains(\"CODE\") && s.Contains(\"FORCES\"))\n {\n Console.WriteLine(\"YES\");\n }\n else\n Console.WriteLine(\"NO\");\n\n Console.Read();\n }\n }", "lang": "Mono C#", "bug_code_uid": "d10a5a48a63ddb379160fb5f70bf6154", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "c4dcd8070f0071913fd021da6f0d7ef4", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.8106402164111812, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "\ufeffusing System;\nusing System.IO;\nusing System.Text;\n\nnamespace Hexagons\n{\n internal class Program\n {\n private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);\n private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);\n\n private static void Main(string[] args)\n {\n long n = Next();\n\n if (n == 0)\n {\n writer.WriteLine(\"0 0\");\n writer.Flush();\n return;\n }\n\n\n long l = 0;\n long r = 1000000000;\n while (l < r)\n {\n long m = (l + r + 1)/2;\n if (3*m*(m + 1) + m + 1 > n)\n r = m - 1;\n else l = m;\n }\n\n long k = 3*l*(l + 1) + l + 1;\n for (long i = l + 1;; i++)\n {\n long next = 6*i + 1;\n if (k + next > n)\n {\n long moves = n - k;\n long x = i;\n long y = 2*x;\n int dir = 1;\n while (moves >= i)\n {\n switch (dir)\n {\n case 1:\n x -= 2*i;\n break;\n case 2:\n x -= i;\n y -= 2*i;\n break;\n case 3:\n x += i;\n y -= 2*i;\n break;\n case 4:\n x += 2*i;\n break;\n case 5:\n if (moves == i)\n {\n x += i;\n y += 2*i;\n }\n else\n {\n x += i + 1;\n y += 2*(i + 1);\n moves--;\n }\n break;\n case 6:\n throw new Exception(\"\");\n }\n moves -= i;\n dir++;\n }\n while (moves > 0)\n {\n switch (dir)\n {\n case 1:\n x -= 2;\n break;\n case 2:\n x -= 1;\n y -= 2;\n break;\n case 3:\n x += 1;\n y -= 2;\n break;\n case 4:\n x += 2;\n break;\n case 5:\n x += 1;\n y += 2;\n break;\n case 6:\n x -= 1;\n y += 2;\n break;\n }\n moves--;\n }\n\n writer.Write(x);\n writer.Write(' ');\n writer.WriteLine(y);\n break;\n }\n k += next;\n }\n\n writer.Flush();\n }\n\n private static long Next()\n {\n int c;\n long res = 0;\n do\n {\n c = reader.Read();\n if (c == -1)\n return res;\n } while (c < '0' || c > '9');\n res = c - '0';\n while (true)\n {\n c = reader.Read();\n if (c < '0' || c > '9')\n return res;\n res *= 10;\n res += c - '0';\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "82c494b402f1cbc834a07cc6fa53a447", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "4cfa517a1c5c07023fe301c01d0397ed", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9183548189073051, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "\ufeffusing System;\n\nclass Program\n{\n static void Main(string[] args)\n { // i = 577350269 at max\n long n = long.Parse(Console.ReadLine());\n Console.WriteLine(FindX(n) + \" \" + FindY(n));\n Console.ReadLine();\n }\n static long FindX(long n)\n {\n long[] p = { 2, 1, -1, -2, -1, 1 }; //p for pattern\n long[] iOfp = { 0, 1, 0, 1, 1, 1 }; //some start from 0, others from 1\n long lvl = 0, position = 0, t = 0;\n for (long min = 0, max = 577350269, i = (max + min) / 2; ; i = (max + min) / 2)\n {\n if (n < 4) { break; }\n t = 3 * i * i + 7 * i + 4;\n if (n > t) { min = i; }\n else if (n < t) { max = i; }\n if (t == n || max == min + 1)\n {\n i = (t == n) ? i : max;\n lvl = i;\n if (i != 0 && t != n)\n {\n i--;\n }\n position += i * (i + 1) / 2 * (p[0] + p[2]) + (i + 1) * (i + 2) / 2 * (p[1] + p[3] + p[4] + p[5]);\n n -= 3 * i * i + 7 * i + 4;\n //Console.WriteLine(position);\n break;\n }\n }\n for (int j = 0; j < 6 && n != 0; j++)\n {\n if (n >= lvl + iOfp[j])\n {\n position += p[j] * (lvl + iOfp[j]);\n n -= lvl + iOfp[j];\n if (n == 0)\n {\n return position;\n }\n }\n else\n {\n for (int i = 0; i < lvl + iOfp[j]; i++)\n {\n n = (p[j] == 0) ? n : n - 1;\n position += p[j];\n if (n == 0)\n {\n return position;\n }\n }\n }\n }\n return position;\n }\n static long FindY(long n)\n {\n long[] p = { 0, 2, 2, 0, -2, -2 }; //p for pattern\n long[] iOfp = { 0, 1, 0, 1, 1, 1 }; //some start from 0, others from 1\n long lvl = 0, position = 0, t = 0;\n for (long min = 0, max = 577350269, i = (max + min) / 2; ; i = (max + min) / 2)\n {\n if (n < 4) { break; }\n t = 3 * i * i + 7 * i + 4;\n if (n > t) { min = i; }\n else if (n < t){ max = i; }\n if (t == n || max == min + 1)\n {\n i = (t == n) ? i : max;\n lvl = i;\n if (i != 0 && t != n)\n {\n i--;\n }\n position += i * (i + 1) / 2 * (p[0] + p[2]) + (i + 1) * (i + 2) / 2 * (p[1] + p[3] + p[4] + p[5]);\n n -= 3 * i * i + 7 * i + 4;\n //Console.WriteLine(position);\n break;\n }\n }\n for (int j = 0; j < 6 && n != 0; j++)\n {\n if (n >= lvl + iOfp[j])\n {\n position += p[j] * (lvl + iOfp[j]);\n n -= lvl + iOfp[j];\n if (n == 0)\n {\n return position;\n }\n }\n else\n {\n for (int i = 0; i < lvl + iOfp[j]; i++)\n {\n n--;\n position += p[j];\n if (n == 0)\n {\n return position;\n }\n }\n }\n }\n return position;\n }\n}\n", "lang": "MS C#", "bug_code_uid": "db3858d4b4fee38f093145f8b8c46c14", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "74e41167fc2dc4ee23996ecf46966efe", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.6475462077756533, "equal_cnt": 35, "replace_cnt": 4, "delete_cnt": 28, "insert_cnt": 3, "fix_ops_cnt": 35, "bug_source_code": "using System;\nusing System.Diagnostics;\nusing System.Text.RegularExpressions;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n // int n = Convert.ToInt32(Console.ReadLine().Split()[0]);\n // int count = 0;\n // int sum = 0;\n // string one, two, three;\n // for(int i = 1; i <=n ; i++)\n // {\n // sum ^= i;\n // if (sum == 0)\n // ++count;\n // }\n // Console.WriteLine(count);\n //}\n using System;\n using System.Diagnostics;\n using System.Text.RegularExpressions;\n\nnamespace ConsoleApp1\n {\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] input = Console.ReadLine().Split(); ;\n\n int copies = Convert.ToInt32(input[0]);\n int original = Convert.ToInt32(input[1]);\n\n int c = 0, o = 1;\n\n if (original == 1 && copies > original)\n {\n Console.WriteLine(\"No\");\n return;\n }\n if (copies == c && original == o)\n {\n Console.WriteLine(\"Yes\");\n return;\n }\n else\n {\n while (o < original)\n {\n ++o;\n ++c;\n }\n while (c < copies)\n {\n c += 2;\n }\n }\n if (c > copies)\n {\n Console.WriteLine(\"No\");\n }\n else\n Console.WriteLine(\"Yes\");\n\n }\n }\n }\n}\n}\n", "lang": "MS C#", "bug_code_uid": "817ff8978149e9ce6296af2c186c52c3", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "19dbe698f1d3ad4884627656b62c3a78", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.9929328621908127, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Hack\n{\n \n class Program\n {\n \n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n = int.Parse(s[0]);\n long x = long.Parse(s[1]);\n int ans = 0;\n for (int i = 1; i <= n; i++)\n {\n if (x % i == 0 && x/i <=n)\n ans++;\n }\n Console.WriteLine(ans);\n\n }", "lang": "MS C#", "bug_code_uid": "14182ea1f19719b228b4c9e438d3434f", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "fde4ee607492d5973917ffe62b50f4cf", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.8487394957983193, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Text;\n\n\nnamespace Scath\n{\n\nclass Program\n{\nstatic void Main(){\nvar line= Console.ReadLine().Split(' ');\nint dimention= Convert.ToInt32(line[0]);\nint valieNum=Convert.ToInt32(line[1]);\nint count=0;\n\nConsole.WriteLine(\"{0},{1}\",dimention,valieNum);\n\nfor(int i=1;i int.Parse(i)).ToArray();\n costs= costs.OrderBy(i => i);\n\n line = Console.ReadLine().Split(' ');\n int = int M = int.Parse(line[0]);\n\n int profit = 0;\n\n for (int i = 0; i < M; i++)\n {\n if (i < costs.Length)\n profit += costs[i];\n else\n profit -= D;\n }\n\n Console.WriteLine(profit);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "9e318ded0c7d86da57c8b4c1b93e1450", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "1098f4cd35b7f01b34562eb8528dcfc3", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9940764674205708, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Globalization;\n\n\nstatic class Utils\n{\n public static int ReadInt()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n public static int[] ReadIntArray()\n {\n return (from s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToArray(); \n }\n public static List ReadIntList()\n {\n return (from s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToList();\n }\n\n}\n\nclass Program\n{\n static void Main(string[] args)\n {\n SerejaCoatRack();\n }\n static void SerejaCoatRack()\n {\n int[] n_d = Utils.ReadIntArray();\n int n = n_d[0];\n int d = n_d[1];\n int[] arr = Utils.ReadIntArray();\n Array.Sort(arr);\n int m = Utils.ReadInt();\n Console.WriteLine((m>n)?arr.Sum() - d*(m-n):arr.Reverse().Take(m).Sum());\n\n }\n \n \n \n}\n\n\n", "lang": "MS C#", "bug_code_uid": "86318528b92da0eab0bf266af455029c", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "a0a2ee32fc88f6f33ca8a2dfc0b6df19", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.9453681710213777, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n\n class Program\n {\n struct Point\n {\n public int l;\n public int r;\n public Point(int l, int r)\n {\n this.l = l;\n this.r = r;\n }\n }\n static void Main(string[] args)\n {\n long[] n = ((Console.ReadLine().Split(' ')).Select(long.Parse)).ToArray();\n int s = 0;\n int i = 0;\n while (s < n[0])\n {\n i++;\n s += i;\n }\n if (s - n[0] == 1 && n > 2)\n Console.WriteLine(i - 1);\n else\n Console.Write(i);\n Console.ReadLine();\n }\n static string FindSecondMax(List list)\n {\n Point point = new Point(int.MaxValue, int.MaxValue);\n Point maxpoint = new Point(int.MaxValue, int.MaxValue);\n foreach (Point p in list)\n {\n if (Rast(p) >= Rast(point))\n {\n maxpoint = point;\n point = p;\n }\n else if(Rast(p) > Rast(maxpoint)){ maxpoint = p; }\n }\n return $\"{maxpoint.l} {maxpoint.r}\";\n }\n\n private static int Rast(Point point)\n {\n return (int)(Math.Sqrt(point.l * point.l + point.r * point.r));\n }\n\n private static long S(long v)\n {\n long sum = 0;\n while (v != 0)\n {\n sum += v % 10;\n v /= 10;\n }\n return sum;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b101fc465144134c9a4ce03c622b8e4b", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "ce9a600fbccc3410a015995ab706fd94", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.6488888888888888, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\n\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\tlong x = Convert.ToInt64(Console.ReadLine());\n\t\t\tint cut = 1;\n\t\t\twhile(x!=1)\n\t\t\t{\n\t\t\t\tx/=2;\n\t\t\t\tcut++;\n\t\t\t}\n\t\t\tConsole.WriteLine(cut);\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "d471eb2baa7abe363f3a90e3ee266dab", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "05f49368750cb78aed338b266be5e500", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.38184663536776214, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": " int k =int.Parse( Console.ReadLine());\n\n for (int i =k; i < 10000; i++)\n {\n for(int j = 1; j < 10000; j++)\n {\n if (i + j == 10)\n {\n Console.WriteLine((int.Parse(i.ToString() + j.ToString())));\n break;\n }\n }\n break;\n }", "lang": "Mono C#", "bug_code_uid": "8a10600c95d4bd1db55f4f2a660313a7", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "747cd7054ab5267f9b58c9a0785f8dba", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.997872340425532, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass Program\n{\n static long fact(long val)\n {\n return val > 1 ? val * fact(val - 1) : val;\n }\n\n static void Main()\n {\n long val = long.Parse(Console.ReadLine());\n if (val > 1)\n {\n long v1 = fact(val / 2);\n long v2 = fact(val / 2 - 1);\n Console.WriteLine((fact(val) / (v1 * v1) * v2 * v2 / 2));\n }\n else\n {\n Console.WriteLine(1);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b5ebecbb0b3a1fb48ee687c4908888a4", "src_uid": "ad0985c56a207f76afa2ecd642f56728", "apr_id": "967057da4b2a7658e3560b2a23c2a2de", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9858356940509915, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "internal class Program\n {\n static void Main(string[] args)\n {\n var i = Convert.ToInt64(Console.ReadLine());\n if (i == 3)\n i = 24;\n else\n {\n long q = 0;\n for (var k = 0; k < i - 1; ++k)\n {\n if (k == 0 || k == i - 2)\n {\n q += (long)Math.Pow(4,i - 3) * 3;\n }\n else\n {\n q += (long)Math.Pow(4, (i - 4)) * 9;\n }\n }\n\n i = q * 4;\n }\n Console.WriteLine(i);\n }\n }", "lang": "Mono C#", "bug_code_uid": "4f2bdcbfff1aaa90a25e56aa1f7aea8f", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "2c0eda053ba09d840a34391c3229a8a3", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9151515151515152, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CodeforcesBetaRound83\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] ss = Console.ReadLine().Split(':');\n\n int a = int.Parse(ss[0]);\n int b = int.Parse(ss[1]);\n\n string c = perevorot(a);\n\n if (int.Parse(c) <= b)\n {\n if (a != 23)\n {\n int cc = a + 1;\n if (cc < 10)\n c = \"0\" + cc;\n else\n c = cc.ToString();\n\n Console.WriteLine(c + \":\" + perevorot(cc));\n }\n else\n Console.WriteLine(\"00:00\");\n }\n else\n {\n if (int.Parse(c) < 60)\n {\n Console.WriteLine(ss[0] + \":\" + c);\n\n }\n else\n {\n if (a != 23)\n {\n \n int cc = a + 1;\n if (cc < 10)\n c = \"0\" + cc;\n else\n c = cc.ToString();\n\n Console.WriteLine(c + \":\" + perevorot(c));\n \n }\n else\n Console.WriteLine(\"00:00\");\n }\n\n }\n\n Console.ReadLine();\n \n }\n public static string perevorot(int a)\n {\n int a1 = a % 10;\n string aa = a1.ToString();\n int a2 = a / 10;\n aa = aa + a2.ToString();\n\n // if (int.Parse(aa) < 10)\n // aa = \"0\" + aa;\n\n return aa;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "06edc09f8f027f84fc1ed018d5063619", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "d142194ea23bcebdf45ebcebea791a07", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9558998808104887, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Globalization;\n//using System.Threading.Tasks;\n\nnamespace Contest\n{\n\n class Program\n {\n\n static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(':').Select(s => int.Parse(s)).ToArray();\n //var input = \"23:59\".Split(':').Select(s => int.Parse(s)).ToArray();\n var h = input[0];\n var m = input[1];\n for (; ; )\n {\n var t = ++m / 60;\n m = m % 60;\n h = (h + t)%24;\n var p1 = h.ToString();\n var p2 = m.ToString().Reverse();\n if (p1.SequenceEqual(p2) ) break;\n }\n Console.Write(\"{0:00}:{1:00}\", h, m);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "09d02a6eaecbd8b20fd00550beb421f4", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "85141bfda0143a3416940a14fae523ac", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9967259356268574, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\nusing System.Threading;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Diagnostics;\nusing System.Numerics;\nusing static System.Console;\nusing static System.Convert;\nusing static System.Math;\nusing static Template;\nusing SC = Scanner;\n\npublic partial class Solver\n{\n int N, X;\n string S;\n public void Solve()\n {\n sc.Make(out N, out X);\n S = sc.Str;\n //dp[k][i][j]:=F(k)\u306e\u90e8\u5206\u5217\u306b\u542b\u307e\u308c\u308bS[j,i)\u306e\u6570\u306e\u548c\n var cur = Create(N + 1, () => new ModInt[N + 1]);\n var nxt = Create(N + 1, () => new ModInt[N + 1]);\n for (int i = 0; i < N; i++)\n {\n cur[i][i] = nxt[i][i] = 1;\n if (S[i] - '0' == 0) nxt[i + 1][i] = 1;\n else cur[i + 1][i] = 1;\n }\n //\u7aef\u306f\u3068\u3063\u3066\u3082\u53d6\u3089\u306a\u304f\u3066\u3082\u3044\u3044\u306e\u30672\n cur[0][0] = cur[N][N] = nxt[0][0] = nxt[N][N] = 2;\n for (int i = 0; i < X - 1; i++)\n {\n nxt = matmul(nxt, cur);\n swap(ref cur, ref nxt);\n }\n Console.WriteLine(cur[N][0]);\n }\n\n ModInt[][] matpow(ModInt[][] A, long k)\n {\n var res = Create(A.Length, () => new ModInt[A.Length]);\n for (int i = 0; i < A.Length; i++) res[i][i] = 1;\n while (k != 0)\n {\n if (k % 2 == 1) res = matmul(res, A);\n k >>= 1;\n A = matmul(A, A);\n }\n return res;\n }\n ModInt[][] matmul(ModInt[][] A, ModInt[][] B)\n {\n var rt = Create(A.Length, () => new ModInt[B[0].Length]);\n for (int i = 0; i < A.Length; i++)\n for (int j = 0; j < B[0].Length; j++)\n {\n for (int k = 0; k < B.Length; k++)\n rt[i][j] += A[i][k] * B[k][j];\n }\n return rt;\n }\n ModInt[] matdot(ModInt[][] A, ModInt[] B)\n {\n var rt = new ModInt[A.Length];\n for (int i = 0; i < A.Length; i++)\n {\n ModInt now = 0;\n for (int j = 0; j < B.Length; j++)\n {\n now += A[i][j] * B[j];\n }\n rt[i] = now;\n }\n return rt;\n }\n}\n\npublic struct ModInt\n{\n public const long MOD = (int)1e9 + 7;\n //public const long MOD = 998244353;\n public long Value { get; set; }\n public ModInt(long n = 0) { Value = n; }\n private static ModInt[] fac, inv, facinv;\n public override string ToString() => Value.ToString();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator +(ModInt l, ModInt r)\n {\n l.Value += r.Value;\n if (l.Value >= MOD) l.Value -= MOD;\n return l;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator -(ModInt l, ModInt r)\n {\n l.Value -= r.Value;\n if (l.Value < 0) l.Value += MOD;\n return l;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator *(ModInt l, ModInt r) => new ModInt(l.Value * r.Value % MOD);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator /(ModInt l, ModInt r) => l * Pow(r, MOD - 2);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static implicit operator long(ModInt l) => l.Value;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static implicit operator ModInt(long n)\n {\n n %= MOD; if (n < 0) n += MOD;\n return new ModInt(n);\n }\n\n public static ModInt Pow(ModInt m, long n)\n {\n if (n == 0) return 1;\n if (n % 2 == 0) return Pow(m * m, n >> 1);\n else return Pow(m * m, n >> 1) * m;\n }\n\n public static void Build(int n)\n {\n fac = new ModInt[n + 1];\n facinv = new ModInt[n + 1];\n inv = new ModInt[n + 1];\n inv[1] = fac[0] = fac[1] = facinv[0] = facinv[1] = 1;\n for (var i = 2; i <= n; i++)\n {\n fac[i] = fac[i - 1] * i;\n inv[i] = MOD - inv[MOD % i] * (MOD / i);\n facinv[i] = facinv[i - 1] * inv[i];\n }\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt Fac(int n) => fac[n];\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt Inv(int n) => inv[n];\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt FacInv(int n) => facinv[n];\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt Comb(int n, int r)\n {\n if (n < r) return 0;\n if (n == r) return 1;\n return fac[n] * facinv[r] * facinv[n - r];\n }\n public static ModInt Perm(int n, int r)\n {\n if (n < r) return 0;\n return fac[n] * facinv[n - r];\n }\n\n}\n#region Template\npublic partial class Solver\n{\n public SC sc = new SC();\n static void Main(string[] args)\n {\n Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n var sol = new Solver();\n int testcase = 1;\n //testcase = sol.sc.Int;\n //var th = new Thread(sol.Solve, 1 << 26);th.Start();th.Join();\n while (testcase-- > 0)\n sol.Solve();\n Console.Out.Flush();\n }\n}\npublic static class Template\n{\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static bool chmin(ref T a, T b) where T : IComparable { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static bool chmax(ref T a, T b) where T : IComparable { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static void swap(ref T a, ref T b) { var t = b; b = a; a = t; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static void swap(this IList A, int i, int j) { var t = A[i]; A[i] = A[j]; A[j] = t; }\n public static T[] Create(int n, Func f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }\n public static T[] Create(int n, Func f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }\n public static void Out(this IList A, out T a) => a = A[0];\n public static void Out(this IList A, out T a, out T b) { a = A[0]; b = A[1]; }\n public static void Out(this IList A, out T a, out T b, out T c) { A.Out(out a, out b); c = A[2]; }\n public static void Out(this IList A, out T a, out T b, out T c, out T d) { A.Out(out a, out b, out c); d = A[3]; }\n public static string Concat(this IEnumerable A, string sp) => string.Join(sp, A);\n public static char ToChar(this int s, char begin = '0') => (char)(s + begin);\n public static IEnumerable Shuffle(this IEnumerable A) => A.OrderBy(v => Guid.NewGuid());\n public static int CompareTo(this T[] A, T[] B, Comparison cmp = null) { cmp = cmp ?? Comparer.Default.Compare; for (var i = 0; i < Min(A.Length, B.Length); i++) { int c = cmp(A[i], B[i]); if (c > 0) return 1; else if (c < 0) return -1; } if (A.Length == B.Length) return 0; if (A.Length > B.Length) return 1; else return -1; }\n public static string ToStr(this T[][] A) => A.Select(a => a.Concat(\" \")).Concat(\"\\n\");\n public static int ArgMax(this IList A, Comparison cmp = null) { cmp = cmp ?? Comparer.Default.Compare; T max = A[0]; int rt = 0; for (int i = 1; i < A.Count; i++) if (cmp(max, A[i]) < 0) { max = A[i]; rt = i; } return rt; }\n public static T PopBack(this List A) { var v = A[A.Count - 1]; A.RemoveAt(A.Count - 1); return v; }\n public static void Fail(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }\n}\npublic class Scanner\n{\n public string Str => Console.ReadLine().Trim();\n public int Int => int.Parse(Str);\n public long Long => long.Parse(Str);\n public double Double => double.Parse(Str);\n public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();\n public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();\n public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());\n public int[] ArrInt1D(int n) => Create(n, () => Int);\n public long[] ArrLong1D(int n) => Create(n, () => Long);\n public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);\n public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);\n private Queue q = new Queue();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public T Next() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }\n public void Make(out T1 v1) => v1 = Next();\n public void Make(out T1 v1, out T2 v2) { v1 = Next(); v2 = Next(); }\n public void Make(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next(); }\n public void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next(); }\n public void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next(); }\n public void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next(); }\n public void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6, out T7 v7) { Make(out v1, out v2, out v3, out v4, out v5, out v6); v7 = Next(); }\n public (T1, T2) Make() { Make(out T1 v1, out T2 v2); return (v1, v2); }\n public (T1, T2, T3) Make() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }\n public (T1, T2, T3, T4) Make() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }\n}\n\n#endregion", "lang": ".NET Core C#", "bug_code_uid": "b16b149abc8196cd1ba48f481f9a9d47", "src_uid": "52c6aa73ff4460799402c646c6263630", "apr_id": "33db6ea6d3e63e39d8e8a83d2a5263dd", "difficulty": 2400, "tags": ["matrices", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.5266130784271128, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 23, "bug_source_code": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforce7A\n{\n class Program\n {\n static int[,] desk;\n static int ans = int.MaxValue;\n static bool check()\n {\n for (int i = 0; i < 8; i++)\n for (int j = 0; j < 8; j++)\n if (desk[i,j] == 1)\n return false;\n return true;\n }\n static void find(int step)\n {\n if (step >= ans) return;\n if (check())\n if (step < ans)\n {\n ans = step;\n return;\n }\n for (int i=0; i<8; i++)\n {\n bool ok =false;\n for (int j=0; j<8; j++)\n if (desk[i, j] == 1) { ok = true; break; }\n if (ok)\n {\n int[] d = new int[8];\n\n for (int j = 0; j < 8; j++)\n {\n \n d[j] = desk[i, j];\n desk[i, j] = 0;\n }\n\n find(step + 1);\n for (int j = 0; j < 8; j++)\n desk[i, j] = d[j];\n }\n\n }\n for (int i = 0; i < 8; i++)\n {\n bool ok = false;\n for (int j = 0; j < 8; j++)\n if (desk[j, i] == 1) { ok = true; break; }\n if (ok)\n {\n int[] d = new int[8];\n\n for (int j = 0; j < 8; j++)\n {\n\n d[j] = desk[i, i];\n desk[j, i] = 0;\n }\n\n find(step + 1);\n for (int j = 0; j < 8; j++)\n desk[j, i] = d[j];\n }\n\n }\n \n\n }\n static void Main(string[] args)\n {\n string[] ldesk = new string[8];\n for (int i = 0; i < 8; i++)\n ldesk[i] = Console.ReadLine();\n desk = new int[8, 8];\n for (int i = 0; i < 8; i++)\n for (int j = 0; j < 8; j++)\n if (ldesk[i][j]=='B') desk[i,j]=1;\n find(0);\n Console.WriteLine(ans);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "35cf57bcb46892b388f3a74c074dc387", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "4486e4ac9e2c43cc377714dc2213b0ef", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9945511901347863, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Globalization;\nusing System.IO;\n//using System.Linq;\nusing System.Text;\n\nnamespace ContestRuns\n{\n using System.ComponentModel;\n using System.Linq;\n using System.ServiceProcess;\n\n class Program\n {\n class Edge\n {\n public int a, b, cap, flow;\n };\n\n private static int n, source, target;\n private static int[] d, ptr, q;\n private static List e = new List();\n private static List> g;\n\n static void add_edge(int a, int b, int cap)\n {\n Edge e1 = new Edge {a = a, b = b, cap = cap, flow = 0};\n Edge e2 = new Edge {a = b, b = a, cap = 0, flow = 0};\n g[a].Add(e.Count);\n e.Add(e1);\n g[b].Add(e.Count);\n e.Add(e2);\n }\n\n static bool bfs()\n {\n int qh = 0, qt = 0;\n q[qt++] = source;\n\n d = Enumerable.Repeat(-1, n).ToArray();\n d[source] = 0;\n while (qh < qt && d[target] == -1)\n {\n int v = q[qh++];\n for (int i = 0; i < g[v].Count; ++i)\n {\n int id = g[v][i],\n to = e[id].b;\n if (d[to] == -1 && e[id].flow < e[id].cap)\n {\n q[qt++] = to;\n d[to] = d[v] + 1;\n }\n }\n }\n return d[target] != -1;\n }\n\n static int dfs(int v, int flow)\n {\n if (flow <= 0) return 0;\n if (v == target) return flow;\n for (; ptr[v] < g[v].Count; ++ptr[v])\n {\n int id = g[v][ptr[v]],\n to = e[id].b;\n if (d[to] != d[v] + 1) continue;\n int pushed = dfs(to, Math.Min(flow, e[id].cap - e[id].flow));\n if (pushed != 0)\n {\n e[id].flow += pushed;\n e[id ^ 1].flow -= pushed;\n return pushed;\n }\n }\n return 0;\n }\n\n static int dinic()\n {\n int flow = 0;\n for (;;)\n {\n if (!bfs()) break;\n ptr = new int[n];\n for (;;)\n {\n int pushed = dfs(source, int.MaxValue);\n if (pushed == 0) break;\n flow += pushed;\n }\n }\n return flow;\n }\n\n//#if DEBUG\n //static readonly TextReader input = File.OpenText(@\"../../A/A.in\");\n //static readonly TextWriter output = File.CreateText(@\"../../A/A.out\");\n //static readonly TextReader input = Console.In;\n //static readonly TextWriter output = Console.Out;\n\n\n class Horse\n {\n public decimal distForHorse;\n public decimal timeAlready;\n };\n class Edge1\n {\n public int from, to;\n public decimal dist;\n };\n private static void SolveA()\n {\n int T = int.Parse(input.ReadLine());\n\n output.WriteLine((T/2 + T%2)-1);\n //int[] inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n\n static void Main(string[] args)\n {\n SolveA();\n output.Flush();\n }\n }\n\n \n}", "lang": "MS C#", "bug_code_uid": "bfeb440dea0bc089f2a9928425a98179", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "0a698d306c07ae590f24e361bdfffe8f", "difficulty": 1000, "tags": ["constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.9906510283868775, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\ufeff/*\n\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0430. \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0434\u0440\u0443\u0433\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0446\u0435\u043b\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u041f\u0435\u0440\u0432\u043e\u043c\u0443 \u0434\u0440\u0443\u0433\u0443 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0430\u0440\u0438\u0442\u044c cnt1 \u0447\u0438\u0441\u0435\u043b, \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u2014 cnt2 \u0447\u0438\u0441\u0435\u043b. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u0434\u0430\u0440\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0438 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u043e\u0438\u043c \u0434\u0440\u0443\u0437\u044c\u044f\u043c.\n\n\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0440\u0443\u0433 \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0447\u0438\u0441\u043b\u043e x. \u0412\u0442\u043e\u0440\u043e\u0439 \u0434\u0440\u0443\u0433 \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0447\u0438\u0441\u043b\u043e y. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0430\u0440\u0438\u0442\u044c \u0434\u0440\u0443\u0437\u044c\u044f\u043c \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u043d\u0435 \u043b\u044e\u0431\u044f\u0442.\n\n\u0412\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e v, \u0442\u0430\u043a\u043e\u0435 \u0447\u0442\u043e \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0447\u0438\u0441\u0435\u043b 1,\u20092,\u2009...,\u2009v \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0430\u0440\u043a\u0438 \u0434\u0440\u0443\u0437\u044c\u044f\u043c. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0434\u0430\u0440\u0438\u0442\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445.\n\n\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043d\u0435 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430\u0446\u0435\u043b\u043e \u043d\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043a\u0440\u043e\u043c\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438 \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0433\u043e.\n\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\n\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u0446\u0435\u043b\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 cnt1, cnt2, x, y (1\u2009\u2264\u2009cnt1,\u2009cnt2\u2009<\u2009109; cnt1\u2009+\u2009cnt2\u2009\u2264\u2009109; 2\u2009\u2264\u2009x\u2009<\u2009y\u2009\u2264\u20093\u00b7104) \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0438\u0441\u043b\u0430. \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u0430 x, y \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.\n\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\n\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443.*/\nusing System;\n\nnamespace _483B\n{\n class Program\n {\n private static long HigherDividend(long x, long diveder)\n {\n if (x%diveder == 0)\n return x;\n var left = x - diveder;\n var right = x;\n var middle = (left + right)/2;\n while (middle%diveder != 0)\n {\n if (middle/diveder < x/diveder)\n left = middle;\n else\n right = middle;\n middle = (left + right)/2;\n }\n return middle;\n }\n\n static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ');\n var cnt1 = long.Parse(input[0]);\n var cnt2 = long.Parse(input[1]);\n var x = long.Parse(input[2]);\n var y = long.Parse(input[3]);\n\n long count = 0;\n long barrier = cnt1 + cnt2;\n while (count != cnt1 + cnt2)\n {\n long bad = HigherDividend(barrier, x*y)/(x*y);\n long xCountCommon = HigherDividend(barrier, y) / y - bad;\n long yCountCommon = HigherDividend(barrier, x) / x - bad;\n long xCount = Math.Min(xCountCommon, cnt1);\n long yCount = Math.Min(yCountCommon, cnt2);\n if (xCount < xCountCommon)\n bad += xCountCommon - xCount;\n if (yCount < yCountCommon)\n bad += yCountCommon - yCount;\n long good = barrier - bad - xCount - yCount;\n count = good + xCount + yCount;\n barrier += cnt1 + cnt2 - count;\n }\n\n Console.Write(barrier);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "71af60270a8d9622cb0733711429f1a7", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "9b8b7bb355767fd7e35653c43f7fa7e3", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9901345291479821, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\npublic class HelloAgain\n{\n public static void Main()\n {\n // your code goes here\n long[] num = Console.ReadLine().Trim().Split().Select(t => long.Parse(t)).ToArray();\n long c1 = num[0];\n long c2 = num[1];\n long x = num[2];\n long y = num[3];\n long min = 0;\n long max = 10000000000000000;\n\n while (min < max)\n {\n long mid = min + (max - min) / 2;\n long cnt1 = mid / x;\n long cnt2 = mid / y;\n\n long common = mid / (x * y);\n long exc1 = cnt2 - common;\n long exc2 = cnt1 - common;\n long co = (mid - cnt1 + mid - cnt2 - ((exc1 + exc2))) / 2;\n bool ok = false;\n long rem1 = c1 - exc1;\n long rem2 = c2 - exc2 < 0 ? 0 : c2 - exc2;\n if (rem1 + rem2 <= co)\n ok = true;\n if (ok)\n {\n max = mid;\n }\n else\n {\n min = mid + 1;\n }\n }\n Console.WriteLine(min);\n }\n\n\n}", "lang": "MS C#", "bug_code_uid": "b8dac443dc773b39734d2af8b0c592e2", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "bf4db1650d013fccb5cf6f79d485c109", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9409273766673725, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 18, "bug_source_code": "\ufeff// Submitted by Silithus @ Macau\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing CCF_XOI;\n\nnamespace CodeForces\n{\n\tclass CF443B\n\t{\n\t\tpublic void Solve(XOI xoi)\n\t\t{\n\t\t\tint N, NN, i, s, n;\n\t\t\tstring S;\n\t\t\tbool ok;\n\n\t\t\tS = xoi.ReadString();\n\t\t\tN = xoi.ReadInt();\n\n\t\t\tNN = S.Length + N;\n\t\t\tn = NN / 2;\n\t\t\twhile (n > 0)\n\t\t\t{\n\t\t\t\ts = NN - (2 * n);\n\t\t\t\tok = true;\n\t\t\t\tfor (i = s; i < s + n && ok; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i < S.Length && (i + n) < S.Length)\n\t\t\t\t\t\tok = (S[i] == S[i + n]);\n\t\t\t\t\telse break;\n\t\t\t\t}\n\n\t\t\t\tif (ok) break;\n\t\t\t\telse n--;\n\t\t\t}\n\n\t\t\txoi.o.WriteLine(2 * n);\n\t\t}\n\t}\n\n\tclass CodeForcesMain\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\t(new CF443B()).Solve(new XOI());\n\t\t}\n\t}\n}\n\nnamespace CCF_XOI\n{\t// version 2014.02.07\n\tclass XOI\n\t{\n\t\tprotected StreamReader sr;\n\t\tpublic StreamWriter o;\n\t\tprotected Queue buf = new Queue();\n\t\tpublic bool EOF = false;\n\n\t\tpublic XOI()\n\t\t{\n\t\t\tthis.sr = new StreamReader(Console.OpenStandardInput());\n\t\t\tthis.o = new StreamWriter(Console.OpenStandardOutput());\n\t\t\tthis.o.AutoFlush = true;\n\t\t}\n\n\t\tpublic XOI(string in_path, string out_path)\n\t\t{\n\t\t\tthis.sr = new StreamReader(in_path);\n\t\t\tthis.o = new StreamWriter(out_path);\n\t\t\tthis.o.AutoFlush = true;\n\t\t}\n\n\t\tpublic int ReadInt()\n\t\t{\n\t\t\tstring s = this.GetNext();\n\t\t\tif (s == null) return -1;\n\t\t\telse return Int32.Parse(s);\n\t\t}\n\n\t\tpublic long ReadLong()\n\t\t{\n\t\t\tstring s = this.GetNext();\n\t\t\tif (s == null) return -1;\n\t\t\telse return Int64.Parse(s);\n\t\t}\n\n\t\tpublic double ReadDouble()\n\t\t{\n\t\t\tstring s = this.GetNext();\n\t\t\tif (s == null) return -1;\n\t\t\telse return Double.Parse(s);\n\t\t}\n\n\t\tpublic string ReadString()\n\t\t{\n\t\t\tstring s = this.GetNext();\n\t\t\treturn (s == null ? null : s);\n\t\t}\n\n\t\tpublic string ReadLine()\n\t\t{\t// I will ignore current buffer and read a new line\n\t\t\tstring s = \"\";\n\t\t\twhile (s == \"\" && !this.EOF)\n\t\t\t{\n\t\t\t\ts = sr.ReadLine();\n\t\t\t\tthis.EOF = (s == null);\n\t\t\t}\n\t\t\treturn (this.EOF ? null : s);\n\t\t}\n\n\t\tprotected string GetNext()\n\t\t{\n\t\t\tif (buf.Count == 0)\n\t\t\t{\n\t\t\t\twhile (buf.Count == 0 && !this.EOF)\n\t\t\t\t{\n\t\t\t\t\tstring s = sr.ReadLine();\n\t\t\t\t\tif (s == null)\n\t\t\t\t\t\tthis.EOF = true;\n\t\t\t\t\telse\n\t\t\t\t\t\tforeach (string ss in s.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))\n\t\t\t\t\t\t\tbuf.Enqueue(ss);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn (this.EOF ? null : buf.Dequeue());\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "4e312b605d7fb38bba34ee69a954b71d", "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab", "apr_id": "6f2b1117e875c39bdb162a2a03e85635", "difficulty": 1500, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9646968534151957, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int k = Convert.ToInt32(Console.ReadLine());\n\n if (k >= s.Length)\n {\n Console.WriteLine((s.Length + k) / 2 * 2);\n return;\n }\n\n int max = 2;\n bool isEqual = false;\n for (int i = 2; i <= (s.Length + k) / 2; i++)\n {\n for (int j = 0; j <= s.Length + k - 2 * i; j++)\n {\n isEqual = false;\n for (int m = 0; m < i; m++)\n {\n if (j + i + m >= s.Length)\n {\n isEqual = true;\n break;\n }\n if (s[j + m] != s[j + i + m]) break;\n }\n if (isEqual)\n {\n max = 2 * i;\n break;\n }\n }\n }\n\n Console.WriteLine(max);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "646c4f7b863f665b5459aea05b78165b", "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab", "apr_id": "e9af584d71b0e88ea979441e367f9125", "difficulty": 1500, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9590909090909091, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\n\npublic class BearQuestion{\n static void Main(string[] args){\n Bear();\n }\n \n static void Bear(){\n int[] args = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int a = args[0];\n int b = args[1];\n int years = 0;\n \n while(a <= b){\n years++;\n a *= 3;\n b *= 2;\n }\n return years;\n }\n}", "lang": "Mono C#", "bug_code_uid": "119ea7d4b93da2555e02514260f821a2", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "7f7d7571e031a432d938fba5ad6cbf8a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9903288201160542, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\n\nclass Program {\n static void Main() {\n var n = int.Parse(Console.ReadLine());\n var t = Enumerable.Range(0, n).Select(i => Console.ReadLine().Split(' ')\n .Select(int.Parse).ToArray())\n .ToArray();\n var res = t.Select(a => a[0])\n .SelectMany(h => t.Select(a => a[1]), (h, v) => {h, v})\n .Where(t => t.h == t.v)\n .Count();\n Console.WriteLine(res);\n }\n}\n ", "lang": "MS C#", "bug_code_uid": "debc1d9843ccae130e6e2fc0fc2a267c", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "58554594063d5b7b660aa83c3a449443", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.2838456507521256, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces\n{\n public static class Class1\n {\n\n public static int Method1(int number, int result)\n {\n int res = 1;\n if (result / number % 1 == 0)\n result /= number;\n else if (result == number)\n return 0;\n else return -1;\n while (result>2)\n {\n res++;\n result = result % 3 == 0 ? result / 3 : result / 2;\n }\n return res;\n }\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "89406c73e037a570ddbb427863262e47", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "faca6788e2babeb3ecbd9eb4afed2dae", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.9933500812767844, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": " using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text.RegularExpressions;\n\n\n class Program\n {\n static void Main(string[] args){\n \n string[] input = Console.ReadLine().Split(' ');\n \n int xCoordinate = Int32.Parse(input[0]);\n int yCoordinate = Int32.Parse(input[1]);\n //int turnsCOmpleted = 0;\n int turnsTaken = 0;\n if ((xCoordinate == 0 && yCoordinate == 0) || (xCoordinate == 1 && yCoordinate == 0)){\n\t\tConsole.WriteLine(0);\n\t\tBreak;\t\t\t\n}\n \n else\n {\n int currentXCoor = 0;\n int currentYCoor = 0;\n int previousXCoor = 1;\n int previousYCoor = 0;\n int quadrant = 1;\n\n\n \n for (int i = 0; i < int.MaxValue; i++)\n {\n //int y = 0;\n //int x = 0;\n if (quadrant == 1)\n {\n currentXCoor = previousXCoor;\n currentYCoor = previousYCoor + 1 +(2*(-previousYCoor));\n turnsTaken += 1;\n if(xCoordinate == currentXCoor)\n {\n if (yCoordinate >= previousYCoor && yCoordinate <= currentYCoor)\n break;\n \n }\n \n\n }\n //continue;\n else if (quadrant == 2)\n {\n currentXCoor = -previousXCoor;\n currentYCoor = previousYCoor;\n turnsTaken += 1;\n if(yCoordinate == currentYCoor)\n {\n if (xCoordinate <= previousXCoor && xCoordinate >= currentXCoor)\n break;\n }\n\n //c//ontinue;\n }\n else if (quadrant == 3)\n {\n currentXCoor = previousXCoor;\n currentYCoor = -previousYCoor;\n turnsTaken += 1;\n if(xCoordinate == currentXCoor)\n {\n if (yCoordinate >= currentYCoor && yCoordinate <= previousYCoor)\n break;\n }\n\n }\n\n else if(quadrant == 4)\n {\n currentXCoor = -previousXCoor+1;\n currentYCoor = previousYCoor;\n turnsTaken += 1;\n if(yCoordinate == currentYCoor)\n {\n if (xCoordinate >= previousXCoor && xCoordinate <= currentXCoor)\n break;\n }\n\n }\n previousXCoor = currentXCoor;\n previousYCoor = currentYCoor;\n if (quadrant == 4)\n quadrant = 1;\n else\n quadrant += 1;\n\n\n\n }\n }\n Console.WriteLine(turnsTaken);\n }\n \n }", "lang": "Mono C#", "bug_code_uid": "7510e3d963f3703266bc74694060a60f", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "apr_id": "01baccf3a39c4d4aebe1f415ceb08a77", "difficulty": 1400, "tags": ["geometry", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.017, "equal_cnt": 27, "replace_cnt": 24, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 27, "bug_source_code": "\ufeff\n\n \n \n Debug\n AnyCPU\n {6E004330-966A-4BED-B095-733EFEF1E9A3}\n Exe\n Properties\n A\n A\n v4.0\n 512\n \n \n AnyCPU\n true\n full\n false\n bin\\Debug\\\n DEBUG;TRACE\n prompt\n 4\n \n \n AnyCPU\n pdbonly\n true\n bin\\Release\\\n TRACE\n prompt\n 4\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", "lang": "Mono C#", "bug_code_uid": "0e77deb317f6445ed64b31ca1f177bdf", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "apr_id": "55caac695bf88a46d6842e91d8c6d0bc", "difficulty": 1400, "tags": ["geometry", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"}
{"similarity_score": 0.27963014850098067, "equal_cnt": 15, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 9, "fix_ops_cnt": 15, "bug_source_code": "\ufeffusing System;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine();\n int space = input.IndexOf(' ');\n long sparrows = 0;\n\n long barnCapacity = long.Parse(input.Substring(0, space)),\n incomingGrains = long.Parse(input.Substring(space + 1)),\n currentCapacity = barnCapacity;\n do\n {\n currentCapacity = Math.Min(currentCapacity + incomingGrains, barnCapacity);\n currentCapacity -= ++sparrows;\n } while (currentCapacity > 0);\n\n Console.WriteLine(sparrows);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "ac4bab9be0b76d2a3202cc85990118e0", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "05735274fb5cb5a1fc6bf0671777d4f8", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"}
{"similarity_score": 0.9818181818181818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces._670\n{\n class pA\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int max = 2 + ((n - 2) / 7) * 2 + Math.Max(((n - 2) % 7) - 5, 0);\n int min = (n / 7 * 2) + Math.Max(0, (n % 7) - 5);\n if (n < 7) Console.WriteLine(\"0 \" + Math.Min(2, n));\n else Console.WriteLine(min + \" \" + max);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "08940ab4756722b92fa09cad86fd5ab4", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "5dfe0442b0acadb9fb578ebf1517431c", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"}
{"similarity_score": 0.40997957397140355, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing static Template;\nusing static System.Console;\nusing static System.Convert;\nusing static System.Math;\nusing Pi = Pair;\n\nclass Solver\n{\n int N;\n string s;\n ModInt[][] dp;\n bool[][] use;\n public void Solve(Scanner sc)\n {\n var N = sc.Int;\n dp = Create(N + 1, () => new ModInt[1 << 20]);\n use = Create(N + 1, () => new bool[1 << 20]);\n\n }\n /*ModInt memo(int s,int i)\n {\n var ct = 0;\n for (var j = 0; j < 20; j++)\n ct += 1 & s >> j;\n var rt = 0;\n if (i == N)\n {\n if (ct != 0 && (1 << ct) - 1 == s) return 1;\n return 0;\n }\n\n }*/\n}\n\npublic struct ModInt\n{\n public const long MOD = (int)1e9 + 7;\n //public const long MOD = 998244353;\n public long Value { get; set; }\n public ModInt(long n = 0) { Value = n; }\n private static ModInt[] fac;//\u968e\u4e57\n private static ModInt[] inv;//\u9006\u6570\n private static ModInt[] facinv;//1/(i!)\n public override string ToString() => Value.ToString();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator +(ModInt l, ModInt r)\n {\n l.Value += r.Value;\n if (l.Value >= MOD) l.Value -= MOD;\n return l;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator -(ModInt l, ModInt r)\n {\n l.Value -= r.Value;\n if (l.Value < 0) l.Value += MOD;\n return l;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator *(ModInt l, ModInt r) => new ModInt(l.Value * r.Value % MOD);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator /(ModInt l, ModInt r) => l * Pow(r, MOD - 2);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static implicit operator long(ModInt l) => l.Value;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static implicit operator ModInt(long n)\n {\n n %= MOD; if (n < 0) n += MOD;\n return new ModInt(n);\n }\n\n public static ModInt Pow(ModInt m, long n)\n {\n if (n == 0) return 1;\n if (n % 2 == 0) return Pow(m * m, n >> 1);\n else return Pow(m * m, n >> 1) * m;\n }\n\n public static void Build(int n)\n {\n fac = new ModInt[n + 1];\n facinv = new ModInt[n + 1];\n inv = new ModInt[n + 1];\n inv[1] = 1;\n fac[0] = fac[1] = 1;\n facinv[0] = facinv[1] = 1;\n for (var i = 2; i <= n; i++)\n {\n fac[i] = fac[i - 1] * i;\n inv[i] = MOD - inv[MOD % i] * (MOD / i);\n facinv[i] = facinv[i - 1] * inv[i];\n }\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt Fac(ModInt n) => fac[n];\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt Inv(ModInt n) => inv[n];\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt FacInv(ModInt n) => facinv[n];\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt Comb(ModInt n, ModInt r)\n {\n if (n < r) return 0;\n if (n == r) return 1;\n var calc = fac[n];\n calc = calc * facinv[r];\n calc = calc * facinv[n - r];\n return calc;\n }\n}\n#region Template\npublic static class Template\n{\n static void Main(string[] args)\n {\n Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n new Solver().Solve(new Scanner());\n Console.Out.Flush();\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static bool chmin(ref T a, T b) where T : IComparable\n { if (a.CompareTo(b) == 1) { a = b; return true; } return false; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static bool chmax(ref T a, T b) where T : IComparable\n { if (a.CompareTo(b) == -1) { a = b; return true; } return false; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static void swap(ref T a, ref T b)\n { var t = b; b = a; a = t; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static T[] Create(int n, Func f)\n {\n var rt = new T[n];\n for (var i = 0; i < rt.Length; ++i)\n rt[i] = f();\n return rt;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static T[] Create(int n, Func f)\n {\n var rt = new T[n];\n for (var i = 0; i < rt.Length; ++i)\n rt[i] = f(i);\n return rt;\n }\n public static T[] Copy